This commit is contained in:
2020-07-14 17:43:15 +08:00
parent b83b375945
commit 4ab7d33643
11 changed files with 299 additions and 25 deletions

View File

@@ -70,7 +70,7 @@
<view class="btn" v-if="['1', '2', '6'].indexOf(state) >= 0">
<view class="logistics" v-if="state == '1'" @click="toOtherPage('Logistics')">查看物流</view>
<view class="comment" v-if="state == '2'" @click="toOtherPage('Comment')">立即评价</view>
<view class="cancel" v-if="state == '6'">取消支付</view>
<view class="cancel" v-if="state == '6'" @click="cancelOrder">取消支付</view>
<view class="payment" v-if="state == '6'">立即支付</view>
<view class="service" v-if="state == '7'">联系官方客服</view>
<view class="submit" v-if="state == '7'">提交官方审核</view>
@@ -111,10 +111,6 @@ export default {
text: '待退款',
image: '../static/mine/34.png',
},
'8': {
text: '已退款',
image: '../static/mine/34.png',
},
},
current: 0,
orderInfo: {}
@@ -148,10 +144,12 @@ export default {
}
if(this.orderInfo.refund_state) state = '5';
// 申请退款
const refund = this.orderInfo.refund_list[this.orderInfo.extend_order_common.order_id];
if(this.orderInfo.refund_list) {
if([1, 2].indexOf(refund.refund_state) >= 0) state = '7';
if(refund.refund_state == 3) state = '8';
const refund = this.orderInfo.refund_list[this.orderInfo.extend_order_common.order_id];
if(this.orderInfo.refund_list) {
if([1, 2].indexOf(refund.refund_state) >= 0) state = '7';
if(refund.refund_state == 3) state = '8';
}
}
this.state = state;
},
@@ -165,6 +163,15 @@ export default {
}
})
},
cancelOrder() {
this.$u.api.cancelOrder({
order_id: this.orderInfo.order_id,
}).then(res => {
if(res.errCode == 0) {
uni.navigateBack();
}
})
},
setTitle(){
let title = '';
switch (this.current) {

View File

@@ -8,7 +8,7 @@
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
<view>
<view class="item-container" v-for="order in orderList" :key="order.order_id">
<OrderItem :order="order"></OrderItem>
<OrderItem :order="order" @refreshOrderList="getOrderList"></OrderItem>
</view>
</view>
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
@@ -64,7 +64,7 @@ export default {
this.setViewHeight();
},
methods: {
async getOrderList({ reload = '' } = {}) {
setOrderType() {
let type;
// state_type 订单状态0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
switch (this.current) {
@@ -87,6 +87,10 @@ export default {
type = -1;
break;
}
return type;
},
async getOrderList({ reload = '' } = {}) {
const type = this.setOrderType();
const res = await this.$u.api.getOrderList({
page: this.page,
type: type,