球星卡微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

601 lines
15 KiB

  1. <template>
  2. <view>
  3. <!-- tabs选项卡 -->
  4. <view class="lf-flex">
  5. <view style="width: 84%;">
  6. <u-tabs
  7. :current="tabIndex"
  8. :list="tabList"
  9. :lineWidth="34"
  10. :scrollable="false"
  11. :itemWidth="100 / tabList.length +'%'"
  12. @change="switchTab"
  13. >
  14. </u-tabs>
  15. </view>
  16. <view class="filter-icon">
  17. <image src="@/static/icon/filter.png" @click="showFilter = !showFilter"></image>
  18. </view>
  19. </view>
  20. <!-- 筛选 -->
  21. <view class="filter-box" v-if="showFilter">
  22. <view class="flex-col group_6" >
  23. <view class="flex-col section_5">
  24. <view class="flex-col">
  25. <text class="text_7">按收货确认时间</text>
  26. <view class="flex-col group_8">
  27. <view class="flex-row">
  28. <view class="flex-col items-center text-wrapper">
  29. <text>1个月内</text>
  30. </view>
  31. <view class="text-wrapper_1 flex-col items-center">
  32. <text>3个月内</text>
  33. </view>
  34. <view class="text-wrapper_1 flex-col items-center view_3">
  35. <text>6个月内</text>
  36. </view>
  37. <view class="text-wrapper_1 flex-col items-center">
  38. <text>今年</text>
  39. </view>
  40. </view>
  41. <view class="flex-row group_10">
  42. <view class="left-text-wrapper flex-col items-center">
  43. <text>2021</text>
  44. </view>
  45. <view class="left-text-wrapper flex-col items-center view_6">
  46. <text>2020</text>
  47. </view>
  48. <view class="left-text-wrapper flex-col items-center view_7">
  49. <text>2019</text>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="flex-col group_11">
  55. <text class="text_15">按送评信息</text>
  56. <view class="flex-row group_12">
  57. <view class="flex-col items-center text-wrapper_2">
  58. <text>输入送评人姓名或手机号</text>
  59. </view>
  60. <view class="flex-col items-start text-wrapper_3">
  61. <text class="text_17">输入标签</text>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="flex-col group_13">
  66. <text class="text_18">按送评信息</text>
  67. <view class="flex-col items-start text-wrapper_4">
  68. <text class="text_19">输入评级编号</text>
  69. </view>
  70. </view>
  71. <view class="flex-row group_14">
  72. <view class="flex-col items-center text-wrapper_5">
  73. <text>重置</text>
  74. </view>
  75. <view class="flex-col items-center text-wrapper_6">
  76. <text>确认</text>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="flex-col items-center group_15">
  81. <view class="section_7"> </view>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 页面主体滚动区域 -->
  86. <swiper :current="tabIndex" :style="{height: swiperContentHeight}" @change="swiperChange">
  87. <swiper-item v-for="(tabItem, idx) in tabList" :key="idx" :item-id="tabItem.ident" @touchmove="stopTouchMove">
  88. <scroll-view
  89. :style="{height: swiperContentHeight, 'padding-top': '30rpx'}"
  90. :scroll-y="true"
  91. :refresher-enabled="true"
  92. :refresher-triggered="tabItem.isRefresher"
  93. @scrolltolower="scrolltolower"
  94. @refresherrefresh="refresherrefresh"
  95. >
  96. <view class="item-box" v-for="(item, index) in tabItem.data" :key="index">
  97. <view class="flex-col section_5">
  98. <view class="justify-between">
  99. <view class="flex-row group_8">
  100. <image
  101. src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497798740970822.png"
  102. class="image_7"
  103. />
  104. <text class="text_7">在线送评</text>
  105. </view>
  106. <text class="text_8">待确认</text>
  107. </view>
  108. <view class="justify-between group_9">
  109. <view class="flex-row">
  110. <text>李丽丽</text>
  111. <text class="text_10">15273936409</text>
  112. </view>
  113. <text>共5件</text>
  114. </view>
  115. <view class="justify-between group_11">
  116. <text class="text_12">更多</text>
  117. <view class="flex-row">
  118. <view class="flex-col items-center text-wrapper">
  119. <text>取消</text>
  120. </view>
  121. <view class="flex-col items-center text-wrapper_1">
  122. <text>寄送藏品</text>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. <!-- 当前tab下没有数据且无分页数据时显示系统剪辑中 -->
  129. <view class="nomore-box" v-if="tabItem.data.length <= 0 && !tabItem.isPage">
  130. <image src="@/static/images/nomore.png"></image>
  131. <view>暂无订单记录</view>
  132. </view>
  133. <!-- 加载中和暂无更多显示 -->
  134. <u-loadmore :status="tabItem.status" margin-bottom="20" marginTop="20" v-else></u-loadmore>
  135. <!-- 底部修饰解决部分机型底部被挡住且padding和margin都不生效的BUG -->
  136. <view class="additional"></view>
  137. </scroll-view>
  138. </swiper-item>
  139. </swiper>
  140. <!-- 轻提示 -->
  141. <u-toast ref="uToast"></u-toast>
  142. </view>
  143. </template>
  144. <script>
  145. export default {
  146. data(){
  147. let publicKey = {
  148. page: 1,
  149. pageSize: 5,
  150. isPage: true,
  151. status: 'loading', // loading加载,nomore没有更多了
  152. isRefresher: false, // 下拉刷新状态,默认没有开启下拉
  153. }
  154. return {
  155. showFilter: false,
  156. tabList: [{
  157. name: '全部',
  158. ident: 'all',
  159. data: [],
  160. badge: {isDot: false},
  161. requestFunction: 'getList',
  162. ...publicKey
  163. },{
  164. name: '待确认',
  165. ident: 'video',
  166. data: [],
  167. badge: {isDot: false},
  168. requestFunction: 'getList',
  169. ...publicKey
  170. },{
  171. name: '评级中',
  172. ident: 'image',
  173. data: [],
  174. badge: {isDot: false},
  175. requestFunction: 'getList',
  176. ...publicKey
  177. },{
  178. name: '待付款',
  179. ident: 'share',
  180. data: [],
  181. badge: {isDot: false},
  182. requestFunction: 'getList',
  183. ...publicKey
  184. },{
  185. name: '待收货',
  186. ident: 'short',
  187. data: [],
  188. badge: {isDot: false},
  189. requestFunction: 'getList',
  190. ...publicKey
  191. }],
  192. tabIndex: 0,
  193. scenic: {}
  194. }
  195. },
  196. computed: {
  197. // 传入对应tab的ident值,在当前tabIndex下是否匹配,匹配上返回true,否则返回false,调用matchTabIdent(par1, par2, ...)
  198. matchTabIdent(){
  199. let that = this;
  200. return function(){
  201. let identList = Array.from(arguments);
  202. let hasKey = identList.some(item => that.tabList[that.tabIndex].ident === item);
  203. return hasKey;
  204. }
  205. },
  206. // 计算获得swiper内容区域剩余高度
  207. swiperContentHeight(){
  208. return `calc(100vh - 80rpx - 10rpx)`;
  209. }
  210. },
  211. onLoad(options){
  212. this.tabIndex = Number(options.current || this.tabIndex);
  213. this.scenic = uni.getStorageSync("scenic_key") || {};
  214. this[ this.tabList[this.tabIndex].requestFunction ](); // 获取当前tab下的数据列表
  215. },
  216. methods: {
  217. // 获取数据
  218. getList(options = {}){
  219. let tabItem = this.tabList[this.tabIndex];
  220. setTimeout(() => {
  221. if(tabItem.page === 1){
  222. tabItem.data = [1,2,3,4,5]
  223. }else{
  224. let arr = [Math.random(), Math.random(), Math.random(), Math.random(), Math.random()];
  225. tabItem.data.push(...arr);
  226. if(tabItem.page === 4){
  227. tabItem.isPage = false;
  228. tabItem.status = "nomore";
  229. }
  230. }
  231. if(options.refresher){
  232. this.$refs.uToast.show({
  233. title: '刷新成功',
  234. type: 'success'
  235. });
  236. tabItem.isRefresher = false;
  237. }
  238. }, 800);
  239. },
  240. // 切换tab
  241. switchTab(item){
  242. this.tabIndex = item.index;
  243. // 判断所切换到的tab下是否有数据并且isPage为true,如果没有再请求,否则啥也不干
  244. let tabItem = this.tabList[this.tabIndex];
  245. if(tabItem.data.length === 0 && tabItem.isPage){
  246. this[ tabItem.requestFunction ]();
  247. }
  248. },
  249. // swiper滑动响应事件
  250. swiperChange(event){
  251. // 事件触发类型为触摸时才做处理,否则是因为switchTab方法执行导致的事件回调
  252. if(event.detail.source === 'touch'){
  253. this.tabIndex = event.detail.current;
  254. // 判断所切换到的tab下是否有数据并且isPage为true,如果没有再请求,否则啥也不干
  255. let tabItem = this.tabList[this.tabIndex];
  256. if(tabItem.data.length === 0 && tabItem.isPage){
  257. this[ tabItem.requestFunction ]();
  258. }
  259. }
  260. console.log("swiperChange", event);
  261. },
  262. stopTouchMove(){
  263. return false;
  264. },
  265. // 下拉刷新,重新获取页面数据,将状态置回初始值再请求
  266. refresherrefresh(){
  267. let tabItem = this.tabList[this.tabIndex];
  268. tabItem.isRefresher = true;
  269. tabItem.page = 1;
  270. tabItem.isPage = true;
  271. tabItem.status = 'loading';
  272. tabItem.data = [];
  273. this[tabItem.requestFunction]({refresher: true});
  274. },
  275. // 滚动到底部
  276. scrolltolower(){
  277. let tabItem = this.tabList[this.tabIndex];
  278. if(tabItem.isPage){
  279. tabItem.page++;
  280. this[tabItem.requestFunction]();
  281. }
  282. }
  283. }
  284. }
  285. </script>
  286. <style>
  287. /* 修复ios页面左右漂浮BUG */
  288. page{
  289. overflow: hidden;
  290. }
  291. </style>
  292. <style scoped lang="scss">
  293. .filter-icon{
  294. width: 16%;
  295. height: 34rpx;
  296. display: flex;
  297. justify-content: center;
  298. align-items: center;
  299. border-left: 2rpx solid #F6F6F6;
  300. image{
  301. width: 36rpx;
  302. height: 32rpx;
  303. }
  304. }
  305. .filter-box{
  306. position: absolute;
  307. z-index: 9999;
  308. width: 750rpx;
  309. .text-wrapper_1 {
  310. margin-left: 16rpx;
  311. flex: 1 1 160rpx;
  312. color: rgb(51, 51, 51);
  313. font-size: 28rpx;
  314. font-weight: 500;
  315. line-height: 40rpx;
  316. white-space: nowrap;
  317. padding: 14rpx 0;
  318. background-color: rgb(246, 246, 246);
  319. border-radius: 10rpx;
  320. height: 68rpx;
  321. }
  322. .left-text-wrapper {
  323. padding: 14rpx 0;
  324. background-color: rgb(246, 246, 246);
  325. border-radius: 10rpx;
  326. width: 160rpx;
  327. height: 68rpx;
  328. }
  329. .group_6 {
  330. padding-top: 2rpx;
  331. }
  332. .section_5 {
  333. padding: 40rpx 32rpx 50rpx;
  334. background-color: rgb(255, 255, 255);
  335. }
  336. .group_15 {
  337. padding: 506rpx 0 16rpx;
  338. position: relative;
  339. }
  340. .group_11 {
  341. margin-top: 50rpx;
  342. }
  343. .group_13 {
  344. margin-top: 50rpx;
  345. }
  346. .group_14 {
  347. margin-top: 50rpx;
  348. }
  349. .section_7 {
  350. background-color: rgba(0, 0, 0, 0.5);
  351. width: 750rpx;
  352. height: 528rpx;
  353. top: 0;
  354. right: 0;
  355. bottom: 0;
  356. left: 0;
  357. position: absolute;
  358. }
  359. .text_7 {
  360. color: rgb(51, 51, 51);
  361. font-size: 32rpx;
  362. font-weight: 500;
  363. line-height: 44rpx;
  364. white-space: nowrap;
  365. }
  366. .group_8 {
  367. margin-top: 20rpx;
  368. }
  369. .text_15 {
  370. color: rgb(51, 51, 51);
  371. font-size: 32rpx;
  372. font-weight: 500;
  373. line-height: 44rpx;
  374. white-space: nowrap;
  375. }
  376. .group_12 {
  377. margin-top: 20rpx;
  378. color: rgb(195, 195, 195);
  379. font-size: 28rpx;
  380. font-weight: 500;
  381. line-height: 40rpx;
  382. white-space: nowrap;
  383. }
  384. .text_18 {
  385. color: rgb(51, 51, 51);
  386. font-size: 32rpx;
  387. font-weight: 500;
  388. line-height: 44rpx;
  389. white-space: nowrap;
  390. }
  391. .text-wrapper_4 {
  392. margin-top: 18rpx;
  393. padding: 12rpx 0;
  394. color: rgb(195, 195, 195);
  395. font-size: 28rpx;
  396. font-weight: 500;
  397. line-height: 40rpx;
  398. white-space: nowrap;
  399. border-radius: 10rpx;
  400. border: solid 2rpx rgb(195, 195, 195);
  401. }
  402. .text-wrapper_5 {
  403. padding: 24rpx 0;
  404. flex: 1 1 330rpx;
  405. color: rgb(195, 195, 195);
  406. font-size: 32rpx;
  407. font-weight: 600;
  408. line-height: 44rpx;
  409. white-space: nowrap;
  410. border-radius: 10rpx;
  411. height: 96rpx;
  412. border: solid 2rpx rgb(195, 195, 195);
  413. }
  414. .text-wrapper_6 {
  415. margin-left: 26rpx;
  416. padding: 26rpx 0;
  417. flex: 1 1 330rpx;
  418. color: rgb(255, 255, 255);
  419. font-size: 32rpx;
  420. font-weight: 600;
  421. line-height: 44rpx;
  422. white-space: nowrap;
  423. background-color: rgb(231, 162, 63);
  424. border-radius: 10rpx;
  425. height: 96rpx;
  426. }
  427. .group_10 {
  428. margin-top: 20rpx;
  429. color: rgb(51, 51, 51);
  430. font-size: 28rpx;
  431. font-weight: 500;
  432. line-height: 40rpx;
  433. white-space: nowrap;
  434. }
  435. .text-wrapper_2 {
  436. padding: 12rpx 0;
  437. flex: 1 1 auto;
  438. border-radius: 10rpx;
  439. height: 68rpx;
  440. border: solid 2rpx rgb(195, 195, 195);
  441. }
  442. .text-wrapper_3 {
  443. margin-left: 28rpx;
  444. padding: 12rpx 0;
  445. border-radius: 10rpx;
  446. width: 308rpx;
  447. height: 68rpx;
  448. border: solid 2rpx rgb(195, 195, 195);
  449. }
  450. .text_19 {
  451. margin-left: 18rpx;
  452. }
  453. .text-wrapper {
  454. padding: 14rpx 0;
  455. flex: 1 1 160rpx;
  456. color: rgb(255, 255, 255);
  457. font-size: 28rpx;
  458. font-weight: 500;
  459. line-height: 40rpx;
  460. white-space: nowrap;
  461. background-color: rgb(231, 162, 63);
  462. border-radius: 10rpx;
  463. height: 68rpx;
  464. }
  465. .view_3 {
  466. margin-left: 14rpx;
  467. }
  468. .view_6 {
  469. margin-left: 16rpx;
  470. }
  471. .view_7 {
  472. margin-left: 14rpx;
  473. }
  474. .text_17 {
  475. margin-left: 18rpx;
  476. }
  477. }
  478. .item-box{
  479. width: 686rpx;
  480. // height: 300rpx;
  481. margin: 0 auto;
  482. background-color: #f6f6f6;
  483. &:nth-child(n+2){
  484. margin-top: 20rpx;
  485. }
  486. .section_5 {
  487. padding: 40rpx 32rpx 0;
  488. background-color: rgb(255, 255, 255);
  489. }
  490. .group_9 {
  491. margin-top: 30rpx;
  492. color: rgb(51, 51, 51);
  493. font-size: 32rpx;
  494. font-weight: 500;
  495. line-height: 44rpx;
  496. white-space: nowrap;
  497. }
  498. .group_11 {
  499. margin-top: 26rpx;
  500. padding: 32rpx 0 28rpx;
  501. border-top: solid 2rpx rgb(239, 239, 239);
  502. }
  503. .group_8 {
  504. color: rgb(153, 153, 153);
  505. font-size: 28rpx;
  506. line-height: 40rpx;
  507. white-space: nowrap;
  508. }
  509. .text_8 {
  510. color: rgb(43, 102, 234);
  511. font-size: 28rpx;
  512. font-weight: 500;
  513. line-height: 40rpx;
  514. white-space: nowrap;
  515. }
  516. .text_12 {
  517. align-self: center;
  518. color: rgb(153, 153, 153);
  519. font-size: 28rpx;
  520. line-height: 40rpx;
  521. white-space: nowrap;
  522. }
  523. .image_7 {
  524. width: 40rpx;
  525. height: 40rpx;
  526. }
  527. .text_7 {
  528. margin-left: 12rpx;
  529. }
  530. .text_10 {
  531. margin-left: 21rpx;
  532. }
  533. .text-wrapper {
  534. padding: 10rpx 0;
  535. color: rgb(153, 153, 153);
  536. font-size: 28rpx;
  537. font-weight: 500;
  538. line-height: 40rpx;
  539. white-space: nowrap;
  540. border-radius: 32rpx;
  541. width: 160rpx;
  542. height: 64rpx;
  543. border: solid 2rpx rgb(153, 153, 153);
  544. }
  545. .text-wrapper_1 {
  546. margin-left: 18rpx;
  547. padding: 10rpx 0;
  548. color: rgb(231, 162, 63);
  549. font-size: 28rpx;
  550. font-weight: 500;
  551. line-height: 40rpx;
  552. white-space: nowrap;
  553. border-radius: 32rpx;
  554. width: 160rpx;
  555. height: 64rpx;
  556. border: solid 2rpx rgb(231, 162, 63);
  557. }
  558. }
  559. .nomore-box{
  560. width: 686rpx;
  561. height: 500rpx;
  562. margin: 0 auto;
  563. display: flex;
  564. flex-direction: column;
  565. justify-content: center;
  566. align-items: center;
  567. image{
  568. width: 434rpx;
  569. height: 260rpx;
  570. }
  571. view{
  572. text-align: center;
  573. color: #777777;
  574. margin-top: 40rpx;
  575. }
  576. }
  577. // 解决scroll-view底部padding和margin都不生效贴边的BUG
  578. .additional{
  579. height: calc( env(safe-area-inset-bottom) + 20rpx );
  580. height: calc( constant(safe-area-inset-bottom) + 20rpx );
  581. }
  582. </style>