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

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