index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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. <view class="flex-around-center p-20 bg--w111-fff" style="margin: 4rpx 0;">
  8. <text class="wall-title" :class="wallTitleId == 1 ? 'wall-title-on' : ''" @tap="onWallTitle(1)">本校</text>
  9. <text class="wall-title" :class="wallTitleId == 2 ? 'wall-title-on' : ''" @tap="onWallTitle(2)">同城</text>
  10. </view>
  11. <view class="flex-y-center mb-10 h-116 bg--w111-fff">
  12. <view class="flex-1 h-full flex-center" :class="wallTypeId == item.id ? 'type-bg' : ''"
  13. v-for="(item, index) in wallTypeData" :key="index" @tap="onWallType(item.id)">
  14. <view class="flex-col flex-center">
  15. <image class="type-image mb-10" :src="'/static/img/ic-wall-type-' + item.id + '.png'" mode=""></image>
  16. <view class="wall-font f-s-24 f-w-500">{{item.name}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <image class="w-full h-116" src="/static/img/img1.png" mode=""></image>
  21. <!-- 提示 -->
  22. <view class="flex-y-center bg--w111-fff mt-10 mb-10 pl-32">
  23. <!-- 左侧固定图片 -->
  24. <text class='iconfont icon-laba ' style="font-size: 24rpx;margin-right: 20rpx;"></text>
  25. <!-- 右侧文字轮播区域 -->
  26. <view class="flex-1 h-40 mt-10" style="overflow: hidden;">
  27. <swiper :indicator-dots="false" :autoplay="autoplay" interval="2500" :duration="500" vertical="true" circular="true">
  28. <block v-for="(item,index) in wallHeadline" :key='index'>
  29. <swiper-item catchtouchmove='catchTouchMove'>
  30. <view class='newsTitle'>
  31. {{item.title}}
  32. </view>
  33. </swiper-item>
  34. </block>
  35. </swiper>
  36. </view>
  37. </view>
  38. <scroll-view class="scroll-view_x" scroll-x style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
  39. <view class='flex-y-center'>
  40. <text v-for="(item,index) in navList" :key="index" class='wall-nav' :class='active==item.id ? "wall-nav-on": ""'
  41. @click="tabSelect(item.id, index)">
  42. <text>{{item.name}}</text>
  43. </text>
  44. </view>
  45. </scroll-view>
  46. <view class='newsList tui-skeleton flex-col' style="flex: 1;overflow: hidden;margin: 20rpx;">
  47. <view class="flex-center flex-col noCommodity" v-if="noDataTip">
  48. <view class='pictrue'>
  49. <image :src="urlDomain+'crmebimage/presets/noSearch.png'"></image>
  50. </view>
  51. <text class="text-ccc">{{noDataTip}}</text>
  52. </view>
  53. <scroll-view scroll-y scroll-with-animation @scrolltolower="onScrollBottom" style="flex: 1;overflow: hidden;">
  54. <view class="fast-box" v-for="(item, index) in wallData" :key="index"></view>
  55. <view class='loadingicon flex-center' :hidden='!loading'>
  56. <text class='loading iconfont icon-jiazai' style="width: auto;"></text>加载更多
  57. </view>
  58. <view class="flex-center no-data-tip" v-if="loadTitle">{{loadTitle}}</view>
  59. </scroll-view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. // +----------------------------------------------------------------------
  65. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  66. // +----------------------------------------------------------------------
  67. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  68. // +----------------------------------------------------------------------
  69. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  70. // +----------------------------------------------------------------------
  71. // | Author: CRMEB Team <admin@crmeb.com>
  72. // +----------------------------------------------------------------------
  73. import navBar from '@/components/navBar';
  74. import animationType from '@/utils/animationType.js'
  75. import tuiSkeleton from '@/components/base/tui-skeleton.vue';
  76. import {
  77. getAddressList
  78. } from '@/api/user.js';
  79. import {
  80. getExpressOrderList
  81. } from '@/api/fastMail.js';
  82. import orderPay from "@/mixins/OrderPay.js";
  83. import {
  84. Debounce
  85. } from '@/utils/validate.js'
  86. let app = getApp();
  87. export default {
  88. mixins: [orderPay],
  89. components: {
  90. tuiSkeleton,
  91. navBar
  92. },
  93. data() {
  94. return {
  95. wallTitleId: 2,
  96. wallTypeId: 1,
  97. wallTypeData: [{
  98. id: 0,
  99. name: '全部'
  100. },
  101. {
  102. id: 1,
  103. name: '表白'
  104. },
  105. {
  106. id: 2,
  107. name: '心愿'
  108. },
  109. {
  110. id: 3,
  111. name: '吐槽'
  112. },
  113. {
  114. id: 4,
  115. name: '签到'
  116. },
  117. ],
  118. wallHeadline: [{
  119. title: '温馨提示,请注意保护好自身隐私,面基需要'
  120. },
  121. {
  122. title: '%%%温馨提示,请注意保护好自身隐私,面基需要'
  123. },
  124. ],
  125. urlDomain: this.$Cache.get("imgHost"),
  126. winHeight: 0,
  127. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  128. autoplay: true,
  129. navList: [{
  130. id: -1,
  131. name: '默认'
  132. }, {
  133. id: 1,
  134. name: '评论'
  135. }, {
  136. id: 2,
  137. name: '点赞'
  138. }, {
  139. id: 3,
  140. name: '有图'
  141. }],
  142. active: -1,
  143. page: 1,
  144. limit: 10,
  145. scrollLeft: 0,
  146. wallData: [],
  147. loadTitle: '',
  148. loading: false,
  149. noDataTip: '',
  150. keywords: '',
  151. addressItem: {}
  152. };
  153. },
  154. onLoad() {
  155. let that = this;
  156. uni.getSystemInfo({
  157. success: function(res) {
  158. that.winHeight = res.windowHeight
  159. },
  160. });
  161. this.getPreExpressApi()
  162. },
  163. /**
  164. * 生命周期函数--监听页面显示
  165. */
  166. onShow: function() {
  167. let that = this;
  168. uni.$on('addressItem', function(res) {
  169. that.$set(that, 'addressItem', res);
  170. })
  171. },
  172. methods: {
  173. onWallTitle(index) {
  174. if (this.wallTitleId == index) return
  175. this.wallTitleId = index
  176. },
  177. onWallType(id) {
  178. if (this.wallTypeId == id) return
  179. this.wallTypeId = id
  180. },
  181. //搜索
  182. search() {
  183. this.wallData = []
  184. this.loadTitle = ''
  185. this.loading = false
  186. this.page = 1
  187. this.getPreExpressApi()
  188. },
  189. onTap(val) {
  190. console.log(val)
  191. },
  192. tabSelect(active, e) {
  193. if (this.active == active) return
  194. this.page = 1;
  195. this.loadTitle = '';
  196. this.wallData = [];
  197. this.active = active;
  198. this.getPreExpressApi()
  199. },
  200. getPreExpressApi() {
  201. this.loading = true
  202. const params = {
  203. keywords: this.keywords,
  204. limit: this.limit,
  205. page: this.page,
  206. status: this.active
  207. }
  208. getExpressOrderList(params).then(res => {
  209. let list = res.data.list || [];
  210. this.wallData = this.$util.SplitArray(list, this.wallData);
  211. if (this.wallData.length == 0) {
  212. this.loadTitle = ''
  213. this.noDataTip = ' 暂无快递信息 ';
  214. } else {
  215. this.noDataTip = ''
  216. this.loadTitle = list.length < this.limit ? "我也是有底线的~" : '';
  217. }
  218. this.loading = false
  219. this.page += 1;
  220. }).catch(err => {
  221. this.noDataTip = ' 暂无快递信息 ';
  222. this.loading = false
  223. console.log(err)
  224. });
  225. },
  226. onScrollBottom() {
  227. if (!this.loadTitle) {
  228. this.getPreExpressApi()
  229. }
  230. },
  231. lookImg(itemIndex, valIndex) {
  232. const url = this.wallData[itemIndex].orderInfoList[valIndex].image
  233. uni.previewImage({
  234. urls: url
  235. });
  236. },
  237. cancelOrder(index, orderNo) {
  238. console.log(index, orderNo)
  239. },
  240. /**
  241. * 打开支付组件
  242. *
  243. */
  244. goPay: Debounce(function(item) {
  245. uni.showLoading({
  246. title: '加载中...'
  247. });
  248. let data = {
  249. payPrice: +item.payPrice,
  250. orderNo: item.orderNo
  251. }
  252. this.getToPayment('', data, 'fast')
  253. }),
  254. }
  255. }
  256. </script>
  257. <style lang="scss">
  258. .container {
  259. position: relative;
  260. overflow: hidden;
  261. }
  262. .wall-title {
  263. display: inline-block;
  264. font-weight: 500;
  265. font-size: 31rpx;
  266. color: #B2B2B2;
  267. }
  268. .wall-title-on {
  269. font-weight: 600;
  270. font-size: 35rpx;
  271. color: #141414;
  272. border-bottom: 5rpx solid;
  273. border-bottom-color: linear-gradient(90deg, #FFCA5F 0%, #FF1B95 100%);
  274. }
  275. .type-image {
  276. width: 46rpx;
  277. height: 46rpx;
  278. }
  279. .wall-font {
  280. color: #141414;
  281. }
  282. .newsTitle {
  283. font-weight: 400;
  284. font-size: 21rpx;
  285. color: #646464;
  286. white-space: nowrap;
  287. overflow: hidden;
  288. text-overflow: ellipsis;
  289. }
  290. .wall-nav {
  291. font-weight: 500;
  292. font-size: 23rpx;
  293. color: #999999;
  294. }
  295. .wall-nav~.wall-nav {
  296. margin-left: 38rpx;
  297. }
  298. .wall-nav-on {
  299. font-weight: 600;
  300. font-size: 27rpx;
  301. color: #141414;
  302. }
  303. .type-bg {
  304. background: #EEF4FF;
  305. }
  306. .no-data-tip {
  307. color: #CCC;
  308. }
  309. .image2 {
  310. width: 42rpx;
  311. height: 42rpx;
  312. margin-right: 20rpx;
  313. }
  314. .order-no {
  315. background-color: rgba(255, 103, 2, 0.1);
  316. padding: 10rpx 20rpx;
  317. color: $bg-color-primary;
  318. font-weight: 600;
  319. font-size: 21rpx;
  320. margin: 20rpx 0;
  321. display: inline-block;
  322. }
  323. .bg_color {
  324. color: #fff;
  325. background-color: $bg-color-primary;
  326. }
  327. </style>