update api

This commit is contained in:
cmxdd
2020-07-29 20:35:33 +08:00
parent fef56d1b52
commit 243e1f93bd
13 changed files with 622 additions and 177 deletions

View File

@@ -19,7 +19,9 @@
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" class="order-list">
<view v-for="(item, index) in 5" :key="index"><OrderItem :cur="current"></OrderItem></view>
<view v-for="(item, index) in allorder" :key="index">
<OrderItem :info="item"></OrderItem>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
@@ -163,7 +165,8 @@ export default {
}
],
publishstate: false,
num: 0
num: 0,
allorder:[],//所有订单
};
},
components: {
@@ -171,42 +174,33 @@ export default {
},
onLoad() {
this.getswiper();
this.getallorder();
this.getorderlist();
this.getallorder();
// 订单状态0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
},
onReachBottom() {
this.num++
},
methods: {
// 关闭发布弹窗
close() {
this.publishstate = false;
},
// 获取订单列表
getorderlist(type) {
let that = this;
this.$u.api
.getorderlist({
page: that.num,
state_type: type
})
.then(res => {
console.log(res);
if (res.errCode != 0) {
} else {
}
});
},
// 获取全部订单
getallorder() {
let that = this;
this.$u.api
.getorderlist({
page: that.num
})
.then(res => {
console.log(res);
if (res.errCode != 0) {
} else {
}
});
this.$u.api.getorderlist({
page: that.num
}).then(res => {
console.log(res);
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
this.allorder = res.data
}
});
},
// 获取轮播图
getswiper() {