fuwu.vue 4.0 KB

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