完善师傅接单
This commit is contained in:
parent
f7abec5e77
commit
8b0a19c458
|
@ -1,17 +1,19 @@
|
|||
<template>
|
||||
<view class="component-order-action">
|
||||
<view class="btn">
|
||||
<text>立即抢单</text>
|
||||
</view>
|
||||
<view class="btn" @click.stop="confirmPrice">
|
||||
<block v-if="order.listType == 't1' || order.listType == 't2'">
|
||||
<block v-if="order.state == 1">
|
||||
<view class="btn normal">待用户支付</view>
|
||||
</block>
|
||||
<block v-if="order.state == 2">
|
||||
<view class="btn active" @click.stop="confirmPrice">
|
||||
<text>尾款确认</text>
|
||||
</view>
|
||||
<view v-if="false" class="btn">
|
||||
<text>取消报价</text>
|
||||
</view>
|
||||
<view v-if="false" class="btn normal">
|
||||
<text>已完成</text>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="order.state == 4">
|
||||
<view class="btn normal">待用户支付尾款</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-if="order.listType == 't3'"> </block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -23,12 +25,6 @@ export default {
|
|||
models: this.$models,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
date: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
props: {
|
||||
order: {
|
||||
type: Object,
|
||||
|
@ -37,9 +33,14 @@ export default {
|
|||
},
|
||||
components: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
mounted() {
|
||||
console.log(this.order);
|
||||
},
|
||||
destroyed() {},
|
||||
methods: {
|
||||
/**
|
||||
* 确认价格
|
||||
*/
|
||||
confirmPrice() {
|
||||
this.$emit("confirmPrice");
|
||||
},
|
||||
|
@ -73,6 +74,7 @@ export default {
|
|||
color: #999999;
|
||||
background-color: unset;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -56,8 +56,10 @@ export default {
|
|||
this.$emit("close");
|
||||
},
|
||||
confirmPrice() {
|
||||
console.log("当前id:" + this.confirmId + ",价格:" + this.price);
|
||||
this.$emit("confirm");
|
||||
this.$emit("confirm", {
|
||||
id: this.confirmId,
|
||||
price: this.price,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -114,6 +114,23 @@ const apis = {
|
|||
auth: true,
|
||||
},
|
||||
},
|
||||
finish: {
|
||||
t1: {
|
||||
url: "/user/workerorderb/orderok",
|
||||
showLoading: true,
|
||||
auth: true,
|
||||
},
|
||||
t2: {
|
||||
url: "/user/workerorderc/orderok",
|
||||
showLoading: true,
|
||||
auth: true,
|
||||
},
|
||||
t3: {
|
||||
url: "",
|
||||
showLoading: true,
|
||||
auth: true,
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -54,5 +54,18 @@ export default {
|
|||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 完成订单
|
||||
*/
|
||||
finishOrder(options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
prototype.$request(options.request).then(response => {
|
||||
if (response.code == 1) {
|
||||
return resolve(response.data);
|
||||
}
|
||||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<order-confirm-price v-show="showConfirmModal" @close="showConfirmModal = false" @confirm="showConfirmModal = false" />
|
||||
<order-confirm-price v-show="showConfirmModal" @close="showConfirmModal = false" @confirm="finishOrder" />
|
||||
</app-layout>
|
||||
</template>
|
||||
|
||||
|
@ -134,6 +134,31 @@ export default {
|
|||
this.$store.commit("order/setConfirmId", id);
|
||||
this.showConfirmModal = true;
|
||||
},
|
||||
/**
|
||||
* 确认订单
|
||||
*/
|
||||
finishOrder(e) {
|
||||
this.showConfirmModal = false;
|
||||
let currentTab = this.tabList[this.tabIndex];
|
||||
this.$models.order
|
||||
.finishOrder({
|
||||
request: {
|
||||
api: "order.finish." + currentTab.listType,
|
||||
data: {
|
||||
id: e.id,
|
||||
money: e.price,
|
||||
},
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
this.$utils.toast(response.msg).then(() => {
|
||||
this.switchTab(this.tabIndex);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$utils.toast(e);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 加载数据
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue