完善订单操作
This commit is contained in:
parent
af6e4b67c8
commit
0dd266954c
|
@ -39,7 +39,7 @@
|
|||
</view>
|
||||
</block>
|
||||
<block v-if="order.state == 5">
|
||||
<view class="btn" @click.stop="confirmOrder">
|
||||
<view class="btn" @click.stop="finishOrder">
|
||||
<text>确认完成</text>
|
||||
</view>
|
||||
</block>
|
||||
|
@ -72,7 +72,7 @@
|
|||
</view>
|
||||
</block>
|
||||
<block v-if="order.state == 2 || order.state == 3">
|
||||
<view class="btn" @click.stop="">
|
||||
<view class="btn" @click.stop="finishOrder">
|
||||
<text>确认完成</text>
|
||||
</view>
|
||||
</block>
|
||||
|
@ -111,7 +111,7 @@ export default {
|
|||
},
|
||||
})
|
||||
.then(() => {
|
||||
this.$emit("afterPay");
|
||||
this.$emit("refresh");
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
@ -128,39 +128,44 @@ export default {
|
|||
},
|
||||
})
|
||||
.then(() => {
|
||||
this.$emit("afterPay");
|
||||
this.$emit("refresh");
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 取消
|
||||
* 确认完成
|
||||
*/
|
||||
finishOrder() {
|
||||
this.$models.order
|
||||
.finishOrder({
|
||||
request: {
|
||||
api: "order.finish." + this.order.listType,
|
||||
data: {
|
||||
id: this.order.id,
|
||||
},
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
this.$utils.toast(response.msg).then(() => {
|
||||
this.$emit("refresh");
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 取消订单
|
||||
*/
|
||||
cancelOrder() {
|
||||
this.$emit("cancelOrder");
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
delOrder() {
|
||||
this.$emit("delOrder");
|
||||
},
|
||||
/**
|
||||
* 确认完成
|
||||
*/
|
||||
confirmOrder() {
|
||||
this.$emit("confirmOrder");
|
||||
},
|
||||
/**
|
||||
* 评价
|
||||
*/
|
||||
appraiseOrder() {
|
||||
// this.$emit("appraiseOrder");
|
||||
this.$utils.toPage("/pages/worker/appraise?id=" + this.order.worker.id);
|
||||
},
|
||||
/**
|
||||
* 退款
|
||||
*/
|
||||
refundOrder() {
|
||||
// this.$emit("refundOrder");
|
||||
this.$utils.toPage("/pages/order/refund?id=" + this.order.worker.id);
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -55,7 +55,8 @@
|
|||
<block
|
||||
v-if="
|
||||
(order.listType == 't1' && order.state != 0 && order.state != 1) ||
|
||||
(order.listType == 't2' && order.state != 0)
|
||||
(order.listType == 't2' && order.state != 0) ||
|
||||
(order.listType == 't3' && order.state != 0 && order.state != 1)
|
||||
"
|
||||
>
|
||||
<view class="worker-item-box">
|
||||
|
|
|
@ -209,6 +209,21 @@ export default {
|
|||
url: ""
|
||||
},
|
||||
},
|
||||
finish: {
|
||||
t1: {
|
||||
url: "/wxapp/order/orderok",
|
||||
showLoading: true,
|
||||
auth: true,
|
||||
},
|
||||
t2: {
|
||||
url: "/wxapp/orderb/orderok",
|
||||
showLoading: true,
|
||||
auth: true,
|
||||
},
|
||||
t3: {
|
||||
url: ""
|
||||
}
|
||||
},
|
||||
chooseWorker: {
|
||||
url: "/wxapp/orderb/chooseshifu",
|
||||
showLoading: true,
|
||||
|
|
|
@ -152,8 +152,21 @@ export default {
|
|||
orderType: item.types,
|
||||
price: item.money,
|
||||
state: item.status,
|
||||
worker: item.shifu,
|
||||
worker: {},
|
||||
};
|
||||
// 师傅
|
||||
if (prototype.$utils.isType(item.shifu, "object")) {
|
||||
order.worker = {
|
||||
id: item.shifu.id,
|
||||
name: item.shifu.name,
|
||||
avatar: item.shifu.avatar,
|
||||
type: item.shifu.status,
|
||||
times: item.shifu.shifu_date.count,
|
||||
favorableRate: item.shifu.shifu_date.good,
|
||||
grade: item.shifu.shifu_date.score,
|
||||
price: item.money,
|
||||
}
|
||||
}
|
||||
list.push(order);
|
||||
});
|
||||
}
|
||||
|
@ -224,17 +237,7 @@ export default {
|
|||
});
|
||||
}
|
||||
} else if (options.listType == 't3') {
|
||||
order = {
|
||||
id: 1,
|
||||
orderId: 2,
|
||||
cate: "货运订单",
|
||||
content: 4,
|
||||
createTime: 5,
|
||||
serviceTime: 6,
|
||||
orderType: 7,
|
||||
state: 8,
|
||||
images: 9,
|
||||
};
|
||||
|
||||
}
|
||||
return resolve(order);
|
||||
}
|
||||
|
@ -263,4 +266,17 @@ export default {
|
|||
}).catch(e => { });
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 完成订单
|
||||
*/
|
||||
finishOrder(options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
prototype.$request(options.request).then((response) => {
|
||||
if (response.code == 1) {
|
||||
return resolve(response);
|
||||
}
|
||||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
<text class="text">客服</text>
|
||||
</view>
|
||||
<view class="action">
|
||||
<order-action :order="order" @afterPay="afterPay" />
|
||||
<order-action :order="order" @refresh="refresh" />
|
||||
</view>
|
||||
</view>
|
||||
</app-layout>
|
||||
|
@ -301,7 +301,7 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
afterPay() {
|
||||
refresh() {
|
||||
this.loadDetail();
|
||||
},
|
||||
},
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<text>¥ {{ item.price }}</text>
|
||||
</block>
|
||||
</view>
|
||||
<order-action :order="item" @afterPay="afterPay" />
|
||||
<order-action :order="item" @refresh="refresh" />
|
||||
</view>
|
||||
</order-item>
|
||||
</view>
|
||||
|
@ -177,9 +177,9 @@ export default {
|
|||
this.$utils.toPage("/pages/order/detail?list=" + listType + "&tab=" + tab + "&id=" + id);
|
||||
},
|
||||
/**
|
||||
* 支付后操作
|
||||
* 重新加载
|
||||
*/
|
||||
afterPay() {
|
||||
refresh() {
|
||||
this.switchTab(this.tabIndex);
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue