|
|
|
@ -2,12 +2,12 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-05-04 20:47:29
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-05-12 16:55:56
|
|
|
|
|
* @LastEditTime: 2022-05-16 14:14:18
|
|
|
|
|
* @Description: file content
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="main">
|
|
|
|
|
<Tab :active="tabActive" @change="changeTab"></Tab>
|
|
|
|
|
<Tab :active="tabActive" @change="changeTab" ref="tab"></Tab>
|
|
|
|
|
<UiLoading v-if="loading"></UiLoading>
|
|
|
|
|
<UiEmpty v-if="!orderTotal && !loading" desc="暂无订单数据" :icon="require('@/assets/img/account/order/empty.png')">
|
|
|
|
|
<UiButton type="grey" @click="$router.push('/')">去逛逛</UiButton>
|
|
|
|
@ -47,7 +47,7 @@
|
|
|
|
|
<td width="145" :rowspan="item.products.length">
|
|
|
|
|
<template v-if="item.orderStatus === 1">
|
|
|
|
|
<UiButton type="yellow_gradual" @click="pay(item)">去支付</UiButton>
|
|
|
|
|
<span class="link-btn" @click="canvelPay(item)">取消支付</span>
|
|
|
|
|
<span class="link-btn" @click="cancelPay(item)">取消支付</span>
|
|
|
|
|
</template>
|
|
|
|
|
<router-link :to="`./detail?id=${item.orderId}`" v-if="item.orderStatus > 4">查看物流</router-link>
|
|
|
|
|
<template v-if="item.orderStatus === 4">
|
|
|
|
@ -67,8 +67,8 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<BsCancelOrder :visible.sync="cancelVisible" :orderId="operationOrder.orderId"/>
|
|
|
|
|
<BsPay :visible.sync="payVisible" :orderId="operationOrder.orderId" @finish="getOrderList"/>
|
|
|
|
|
<BsCancelOrder :visible.sync="cancelVisible" :orderId="operationOrder.orderId" @cancel="reloadData"/>
|
|
|
|
|
<BsPay :visible.sync="payVisible" :orderId="operationOrder.orderId" @finish="reloadData"/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
@ -114,6 +114,9 @@ export default {
|
|
|
|
|
this.getOrderList();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 查询订单列表
|
|
|
|
|
*/
|
|
|
|
|
async getOrderList(){
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const {error, result} = await ApiGetOrderList({
|
|
|
|
@ -129,30 +132,38 @@ export default {
|
|
|
|
|
this.orderList = result.records;
|
|
|
|
|
this.orderTotal = result.total
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 重新加载数据,确认收货和取消,支付订单这些操作完成后需要
|
|
|
|
|
*/
|
|
|
|
|
reloadData(){
|
|
|
|
|
this.getOrderList();
|
|
|
|
|
this.$refs.tab.getOrderStatistics();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
pay(item){
|
|
|
|
|
this.operationOrder = item;
|
|
|
|
|
this.payVisible = true;
|
|
|
|
|
},
|
|
|
|
|
canvelPay(item){
|
|
|
|
|
cancelPay(item){
|
|
|
|
|
this.operationOrder = item;
|
|
|
|
|
this.cancelVisible = true;
|
|
|
|
|
},
|
|
|
|
|
receive(){
|
|
|
|
|
receive(item){
|
|
|
|
|
this.$confirm('确认已经收到货了吗?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(async () => {
|
|
|
|
|
const {error} = await ApiPutOrderReceive({orderId : this.operationOrder.orderId});
|
|
|
|
|
const {error} = await ApiPutOrderReceive({orderId : item.orderId});
|
|
|
|
|
if(error){
|
|
|
|
|
uni.$toast(error.message);
|
|
|
|
|
this.$$message.error(error.message);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '成功收货!'
|
|
|
|
|
});
|
|
|
|
|
this.emitStatus()
|
|
|
|
|
this.reloadData()
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|