|
@@ -2,7 +2,7 @@
|
|
<template>
|
|
<template>
|
|
<view class="order">
|
|
<view class="order">
|
|
<view class="tabs">
|
|
<view class="tabs">
|
|
- <u-tabs :list="tabLists" lineWidth="40" lineHeight="8" :lineColor="`url(${lineBg}) 100% 100%`" :activeStyle="{
|
|
|
|
|
|
+ <u-tabs :list="tabLists" lineWidth="40" :current="current" lineHeight="8" :lineColor="`url(${lineBg}) 100% 100%`" :activeStyle="{
|
|
color: '#0D121A',
|
|
color: '#0D121A',
|
|
fontSize: '32rpx',
|
|
fontSize: '32rpx',
|
|
fontWeight: 'bold',
|
|
fontWeight: 'bold',
|
|
@@ -15,7 +15,7 @@
|
|
</u-tabs>
|
|
</u-tabs>
|
|
</view>
|
|
</view>
|
|
<view class="content">
|
|
<view class="content">
|
|
- <mescroll-body height="100%" class="custom-height" ref="mescrollRef" @down="downCallback"
|
|
|
|
|
|
+ <mescroll-body :height="`calc(100% - 24rpx)`" class="custom-height" ref="mescrollRef" @down="downCallback"
|
|
:up="upOption" @up="upCallback">
|
|
:up="upOption" @up="upCallback">
|
|
<view class="order-list" v-if="arrList && arrList.length">
|
|
<view class="order-list" v-if="arrList && arrList.length">
|
|
<view class="tab-content" v-for="(item, index) in arrList" :key="index" @click="goOrderDetail(item)">
|
|
<view class="tab-content" v-for="(item, index) in arrList" :key="index" @click="goOrderDetail(item)">
|
|
@@ -96,7 +96,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <no-data :statusType="2" tipsText="暂无记录" v-if="!isInit && !arrList.length"></no-data>
|
|
|
|
|
|
+ <no-data :top="230" :statusType="1" @buttonHandle="buttonHandle" tipsText="暂无记录" v-if="!isInit && !arrList.length"></no-data>
|
|
</mescroll-body>
|
|
</mescroll-body>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -123,13 +123,13 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
-
|
|
|
|
|
|
+ current: 0,
|
|
page: 1,
|
|
page: 1,
|
|
limit: 10,
|
|
limit: 10,
|
|
lineBg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_line.png',
|
|
lineBg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_line.png',
|
|
timeImg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_time.png',
|
|
timeImg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_time.png',
|
|
arrList: [],
|
|
arrList: [],
|
|
- isInit: false,
|
|
|
|
|
|
+ isInit: true,
|
|
downOption: {
|
|
downOption: {
|
|
auto: false //是否在初始化完毕之后自动执行下拉回调callback; 默认true
|
|
auto: false //是否在初始化完毕之后自动执行下拉回调callback; 默认true
|
|
},
|
|
},
|
|
@@ -139,12 +139,12 @@ export default {
|
|
size: 10 // 每页数据的数量,默认10
|
|
size: 10 // 每页数据的数量,默认10
|
|
},
|
|
},
|
|
noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
|
|
noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
|
|
- empty: {
|
|
|
|
- tip: '暂无相关数据'
|
|
|
|
- }
|
|
|
|
|
|
+ textNoMore: '- 没有更多了 -'
|
|
},
|
|
},
|
|
paymentStatus: 'WAIT_PAYMENT',
|
|
paymentStatus: 'WAIT_PAYMENT',
|
|
- tabLists: [{name: '待付款', value: 'WAIT_PAYMENT'},
|
|
|
|
|
|
+ tabLists: [
|
|
|
|
+ {name: '全部', value: ''},
|
|
|
|
+ {name: '待付款', value: 'WAIT_PAYMENT'},
|
|
{name: '待接单', value: 'WAIT_ORDER'},
|
|
{name: '待接单', value: 'WAIT_ORDER'},
|
|
// {name: '待寄样', value: 'WAIT_SEND'},
|
|
// {name: '待寄样', value: 'WAIT_SEND'},
|
|
{name: '拍摄中', value: 'SHOOTING'},
|
|
{name: '拍摄中', value: 'SHOOTING'},
|
|
@@ -158,8 +158,10 @@ export default {
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
watch: {},
|
|
watch: {},
|
|
- onLoad() {
|
|
|
|
- this.getOrderListPage()
|
|
|
|
|
|
+ onLoad(options) {
|
|
|
|
+ if(options.status) this.paymentStatus = options.status
|
|
|
|
+ if(options.current) this.current = options.current
|
|
|
|
+ // this.getOrderListPage()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
goOrderDetail(item){
|
|
goOrderDetail(item){
|
|
@@ -219,25 +221,43 @@ export default {
|
|
},
|
|
},
|
|
tabsChange(item) {
|
|
tabsChange(item) {
|
|
this.paymentStatus = item.value
|
|
this.paymentStatus = item.value
|
|
- this.page = 1
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.getOrderListPage()
|
|
|
|
- }, 200)
|
|
|
|
|
|
+ this.mescroll.resetUpScroll()
|
|
|
|
+ this.mescroll.scrollTo(0, 300)
|
|
|
|
+ },
|
|
|
|
+ // upCallback(){
|
|
|
|
+ // console.log('123456');
|
|
|
|
+ // },
|
|
|
|
+
|
|
|
|
+ buttonHandle() {
|
|
|
|
+ this.mescroll.resetUpScroll()
|
|
|
|
+ this.mescroll.scrollTo(0, 300)
|
|
},
|
|
},
|
|
- getOrderListPage() {
|
|
|
|
|
|
+ upCallback(page) {
|
|
getOrderListPage({
|
|
getOrderListPage({
|
|
paymentStatus: this.paymentStatus,
|
|
paymentStatus: this.paymentStatus,
|
|
- page: 1,
|
|
|
|
- limit: 50,
|
|
|
|
|
|
+ page: page.num,
|
|
|
|
+ limit: page.size,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- this.arrList = res.list
|
|
|
|
|
|
+ // this.arrList = res.list
|
|
|
|
+ if(res){
|
|
|
|
+ if (page.num == 1) { //如果是第一页需手动制空列表
|
|
|
|
+ this.arrList = res.list
|
|
|
|
+ } else {
|
|
|
|
+ this.arrList = this.arrList.concat(res.list) //追加新数据
|
|
|
|
+ }
|
|
|
|
+ this.mescroll.endSuccess(res.list.length, res.total > this.arrList.length) // 参考https://www.mescroll.com/uni.html#mescrolluni
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ this.mescroll.endErr()
|
|
|
|
+ }
|
|
|
|
+ this.isInit = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- downCallback() {
|
|
|
|
- this.page=1
|
|
|
|
- this.getOrderListPage()
|
|
|
|
- this.mescroll.endSuccess(); // 结束下拉刷新状态
|
|
|
|
- },
|
|
|
|
|
|
+ // downCallback() {
|
|
|
|
+ // this.page = 1
|
|
|
|
+ // // this.upCallback()
|
|
|
|
+ // this.mescroll.endSuccess(); // 结束下拉刷新状态
|
|
|
|
+ // },
|
|
|
|
|
|
cancelOrder(orderId) {
|
|
cancelOrder(orderId) {
|
|
const that = this
|
|
const that = this
|
|
@@ -354,10 +374,12 @@ export default {
|
|
.content {
|
|
.content {
|
|
flex: 1;
|
|
flex: 1;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
|
+ padding: 24rpx;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
.order-list {
|
|
.order-list {
|
|
- padding: 24rpx;
|
|
|
|
|
|
+ // padding: 24rpx;
|
|
|
|
|
|
|
|
|
|
.tab-content {
|
|
.tab-content {
|