This commit is contained in:
2020-07-10 17:38:21 +08:00
parent 66f21e230a
commit 7cff88b5d6
11 changed files with 215 additions and 116 deletions

View File

@@ -53,7 +53,7 @@ export default {
watch: {
current(value) {
this.page = 0;
this.getOrderList('again');
this.getOrderList({ reload: 'again' });
},
},
onLoad(option) {
@@ -63,7 +63,7 @@ export default {
this.setViewHeight();
},
methods: {
async getOrderList(reload = '') {
async getOrderList({ reload = '' } = {}) {
let type;
// state_type 订单状态0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
switch (this.current) {
@@ -80,7 +80,7 @@ export default {
type = -1; // 试穿试送
break;
case 5:
type = 20; // 待评价
type = 'state_noeval'; // 待评价
break;
case 6:
type = 40; // 售后
@@ -92,6 +92,7 @@ export default {
const res = await this.$u.api.getOrderList({
page: this.page,
type: type,
refund_state: this.current == 6 ? '1' : 0, // 判断是不是售后列表
})
this.timer = true;
if(res.errCode == 0) {
@@ -101,11 +102,13 @@ export default {
return res;
},
reachBottom() {
// 大于15条才会加载更多
if(this.orderList.length < 15) return false;
if(!this.timer) return false;
this.timer = false;
this.loadStatus.splice(this.current, 1, "loading");
this.page++;
this.getOrderList.then(res => {
this.getOrderList().then(res => {
this.loadStatus.splice(this.current, 1, "nomore");
if(res.data.length == 0) this.page--;
}).catch(() => {
@@ -135,9 +138,6 @@ export default {
background-color: #ECECEC;
display: flex;
flex-direction: column;
// > uni-swiper {
// flex: 1;
// }
.swiper-item {
.item-container {
padding: 20rpx 30rpx;