index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view class="flex-col container" :style="{height: winHeight + 'px'}">
  3. <view class="cart_nav">
  4. <nav-bar iconColor='#fff' ref="navBarRef" navTitle="表白墙" backgroundColor="#FF6702" :isBackgroundColor="false">
  5. </nav-bar>
  6. </view>
  7. <wall-info :itemInfo="{type: 3}" :onUrl="false"></wall-info>
  8. <view class='newsList bg--w111-fff flex-col' style="flex: 1;overflow: hidden;">
  9. <view class="flex-center flex-col noCommodity" v-if="noDataTip">
  10. <view class='pictrue'>
  11. <image :src="urlDomain+'crmebimage/presets/noSearch.png'"></image>
  12. </view>
  13. <text class="text-ccc">{{noDataTip}}</text>
  14. </view>
  15. <scroll-view class="bg--w111-fff pt-10 pb-10 pl-32" scroll-x style="white-space: nowrap; vertical-align: middle;border-top-right-radius: 23rpx;"
  16. show-scrollbar="false">
  17. <view class='flex-y-center'>
  18. <text class='wall-nav' :class='active==1 ? "wall-nav-on": ""' @click="tabSelect(1)">
  19. <text>全部回复</text>
  20. </text>
  21. <text class='wall-nav' :class='active==2 ? "wall-nav-on": ""' @click="tabSelect(2)">
  22. <text>只看楼主</text>
  23. </text>
  24. </view>
  25. </scroll-view>
  26. <scroll-view scroll-y scroll-with-animation @scrolltolower="onScrollBottom" style="flex: 1;">
  27. <view class="flex-y-center pl-30 pr-30 mt-20 mb-20" v-for="(item, index) in wallData" :key="index">
  28. <image class="w-30 h-30" style="position: relative;bottom: 30rpx;" :src="`/static/img/ic-wall-type-${item.type}.png`"
  29. mode=""></image>
  30. <view class="flex-1 ml-20">
  31. <view class="flex-between-center">
  32. <view class="info-dzi fs-24">Lalala·北京大学</view>
  33. <view class="flex-center">
  34. <text class='iconfont icon-dianzan' style="font-size: 24rpx;margin-right: 10rpx;"></text>
  35. <text class="info-xzi f-s-22">16</text>
  36. </view>
  37. </view>
  38. <view class="info-dzi mt-10 mb-10">评论评论评论评论评论</view>
  39. <view @tap="openReply"><text class="info-xzi fs-24">05-17 16:20 </text><text class="fw-bold ml-14">回复</text></view>
  40. </view>
  41. </view>
  42. <view class='loadingicon flex-center' :hidden='!loading'>
  43. <text class='loading iconfont icon-jiazai' style="width: auto;"></text>加载更多
  44. </view>
  45. <view class="flex-center no-data-tip" v-if="loadTitle">{{loadTitle}}</view>
  46. </scroll-view>
  47. </view>
  48. <wall-reply ref="replyRef"></wall-reply>
  49. </view>
  50. </template>
  51. <script>
  52. // +----------------------------------------------------------------------
  53. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  54. // +----------------------------------------------------------------------
  55. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  56. // +----------------------------------------------------------------------
  57. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  58. // +----------------------------------------------------------------------
  59. // | Author: CRMEB Team <admin@crmeb.com>
  60. // +----------------------------------------------------------------------
  61. import navBar from '@/components/navBar';
  62. import {
  63. getExpressOrderList
  64. } from '@/api/fastMail.js';
  65. import wallInfo from '../components/wall_info.vue'
  66. import wallReply from '../components/wall_reply.vue'
  67. let app = getApp();
  68. export default {
  69. components: {
  70. navBar,
  71. wallInfo,
  72. wallReply
  73. },
  74. data() {
  75. return {
  76. wallTitleId: 2,
  77. wallTypeId: 1,
  78. wallTypeData: [{
  79. id: 0,
  80. name: '全部'
  81. },
  82. {
  83. id: 1,
  84. name: '表白'
  85. },
  86. {
  87. id: 2,
  88. name: '心愿'
  89. },
  90. {
  91. id: 3,
  92. name: '吐槽'
  93. },
  94. {
  95. id: 4,
  96. name: '签到'
  97. },
  98. ],
  99. bannerList: [{
  100. id: 1
  101. },
  102. {
  103. id: 2
  104. }
  105. ],
  106. wallHeadline: [{
  107. title: '温馨提示,请注意保护好自身隐私,面基需要'
  108. },
  109. {
  110. title: '%%%温馨提示,请注意保护好自身隐私,面基需要'
  111. },
  112. ],
  113. urlDomain: this.$Cache.get("imgHost"),
  114. winHeight: 0,
  115. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  116. autoplay: true,
  117. active: 1,
  118. page: 1,
  119. limit: 10,
  120. scrollLeft: 0,
  121. wallData: [{
  122. id: 1,
  123. type: 1
  124. },
  125. {
  126. id: 2,
  127. type: 2
  128. },
  129. {
  130. id: 3,
  131. type: 1
  132. },
  133. ],
  134. loadTitle: '',
  135. loading: false,
  136. noDataTip: ''
  137. };
  138. },
  139. onLoad() {
  140. let that = this;
  141. uni.getSystemInfo({
  142. success: function(res) {
  143. that.winHeight = res.windowHeight
  144. },
  145. });
  146. // this.getPreExpressApi()
  147. },
  148. methods: {
  149. onWallTitle(index) {
  150. if (this.wallTitleId == index) return
  151. this.wallTitleId = index
  152. },
  153. onWallType(id) {
  154. if (this.wallTypeId == id) return
  155. this.wallTypeId = id
  156. },
  157. tabSelect(active) {
  158. if (this.active == active) return
  159. this.active = active;
  160. },
  161. openReply() {
  162. this.$refs.replyRef.visible = true; // 调用子组件的方法显示对话框
  163. },
  164. getPreExpressApi() {
  165. this.loading = true
  166. const params = {
  167. limit: this.limit,
  168. page: this.page,
  169. status: this.active
  170. }
  171. getExpressOrderList(params).then(res => {
  172. let list = res.data.list || [];
  173. this.wallData = this.$util.SplitArray(list, this.wallData);
  174. if (this.wallData.length == 0) {
  175. this.loadTitle = ''
  176. this.noDataTip = ' 暂无快递信息 ';
  177. } else {
  178. this.noDataTip = ''
  179. this.loadTitle = list.length < this.limit ? "我也是有底线的~" : '';
  180. }
  181. this.loading = false
  182. this.page += 1;
  183. }).catch(err => {
  184. this.noDataTip = ' 暂无快递信息 ';
  185. this.loading = false
  186. console.log(err)
  187. });
  188. },
  189. onScrollBottom() {
  190. if (!this.loadTitle) {
  191. // this.getPreExpressApi()
  192. }
  193. }
  194. }
  195. }
  196. </script>
  197. <style lang="scss">
  198. .container {
  199. position: relative;
  200. overflow: hidden;
  201. }
  202. .wall-nav {
  203. font-weight: 500;
  204. font-size: 23rpx;
  205. color: #999999;
  206. }
  207. .wall-nav~.wall-nav {
  208. margin-left: 38rpx;
  209. }
  210. .wall-nav-on {
  211. font-weight: 600;
  212. font-size: 27rpx;
  213. color: #141414;
  214. }
  215. .info-xzi {
  216. font-weight: 400;
  217. font-size: 19rpx;
  218. color: #999999;
  219. }
  220. .info-dzi {
  221. font-weight: 500;
  222. font-size: 23rpx;
  223. color: #141414;
  224. }
  225. </style>