fuwu.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <!-- pages/me.wxml -->
  3. <view class="container">
  4. <uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="search" @input="search"
  5. style="width: 100%;"
  6. @cancel="cancel">
  7. </uni-search-bar>
  8. <view class="rnwdList">
  9. <view class="list" @tap="goDetails(item)" v-for="(item, index1) in qbwd" :key="index1">
  10. <span class="listTitle">{{ item.titleName }}</span>
  11. <view class="onePic" v-if="item.urls.length == 1">
  12. <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
  13. </image>
  14. </view>
  15. <view class="twoPic" v-if="item.urls.length == 2">
  16. <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
  17. </image>
  18. </view>
  19. <view class="threePic" v-if="item.urls.length == 3">
  20. <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
  21. </image>
  22. </view>
  23. <!-- <view class="jlSj">
  24. <span class="jf">
  25. {{ item.jf }}
  26. <em class="iconfont icon-jifen"></em>
  27. </span>
  28. <view class="ck">
  29. <span>
  30. <em class="iconfont icon-pinglun"></em>
  31. {{ item.pl }}
  32. </span>
  33. <span>
  34. <em class="iconfont icon-chakan"></em>
  35. {{ item.ck }}
  36. </span>
  37. <span>
  38. <em class="iconfont icon-shoucang"></em>
  39. {{ item.dz }}
  40. </span>
  41. </view>
  42. </view> -->
  43. </view>
  44. </view>
  45. <!-- 新增资讯按钮 -->
  46. <!-- <button class="addInfomarionBtn" @click="addInfomation()"></button> -->
  47. </view>
  48. </template>
  49. <script>
  50. import { listWxs ,listWx} from '@/api/information/information.js'
  51. // pages/me.js
  52. export default {
  53. data() {
  54. return {
  55. qbwd:[],
  56. listParams:{
  57. pageNum: 1,
  58. pageSize: 7,
  59. titleName: '',
  60. type: 12,
  61. flag:''
  62. },
  63. total:0,
  64. searchValue:''
  65. };
  66. },
  67. created(){
  68. this.getList()
  69. // 查置顶
  70. listWx({}).then(e => {
  71. })
  72. },
  73. onReachBottom(){
  74. let pageNum = this.listParams.pageNum
  75. let pageSize = this.listParams.pageSize
  76. let total = this.total
  77. if(pageNum * pageSize >= total){
  78. uni.showToast({
  79. title:'暂无更多数据'
  80. })
  81. return
  82. } else {
  83. this.listParams.pageNum += 1;
  84. this.getList()
  85. }
  86. },
  87. methods:{
  88. search(){
  89. this.listParams.titleName = this.searchValue
  90. this.qbwd = []
  91. this.getList()
  92. },
  93. getList(){
  94. listWxs(this.listParams).then(res => {
  95. this.qbwd = [...this.qbwd,...res.rows]
  96. this.total = res.total
  97. })
  98. },
  99. goDetails(e) {
  100. let id = e.id || ''
  101. let type = 12
  102. uni.navigateTo({
  103. url: `../informationDetail/informationDetail?id=${id}&type=${type}`
  104. });
  105. },
  106. // 新增资讯
  107. addInfomation(){
  108. uni.navigateTo({
  109. url: `../informationAdd/informationAdd`
  110. });
  111. }
  112. },
  113. /**
  114. * 生命周期函数--监听页面加载
  115. */
  116. onLoad(options) {},
  117. /**
  118. * 生命周期函数--监听页面初次渲染完成
  119. */
  120. onReady() {},
  121. /**
  122. * 生命周期函数--监听页面显示
  123. */
  124. onShow() {},
  125. /**
  126. * 生命周期函数--监听页面隐藏
  127. */
  128. onHide() {},
  129. /**
  130. * 生命周期函数--监听页面卸载
  131. */
  132. onUnload() {},
  133. /**
  134. * 页面相关事件处理函数--监听用户下拉动作
  135. */
  136. onPullDownRefresh() {},
  137. /**
  138. * 用户点击右上角分享
  139. */
  140. onShareAppMessage() {},
  141. };
  142. </script>
  143. <style>
  144. @import './fuwu.css';
  145. .container{
  146. height: 100%;
  147. }
  148. </style>