球星卡微信小程序
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.

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