增加订单时分选择和判断
This commit is contained in:
parent
cc22cacd4b
commit
4aca6defd4
|
@ -391,6 +391,13 @@ export default {
|
|||
* 发布报价
|
||||
*/
|
||||
submit() {
|
||||
if (!this.addressId) {
|
||||
return this.$utils.toast("请选择地址");
|
||||
}
|
||||
if (!this.date || !this.time) {
|
||||
return this.$utils.toast("请选择时间和日期");
|
||||
}
|
||||
let datetime = this.date + " " + this.time;
|
||||
this.$models.service
|
||||
.createDemandOrder({
|
||||
cates: this.cateId,
|
||||
|
@ -398,7 +405,7 @@ export default {
|
|||
desc: this.content,
|
||||
img: this.uploadImages,
|
||||
addid: this.addressId,
|
||||
times: this.date + " " + this.time,
|
||||
times: datetime,
|
||||
baoxian: this.insurance ? 1 : 0,
|
||||
money: this.price,
|
||||
})
|
||||
|
|
|
@ -16,10 +16,21 @@
|
|||
</view>
|
||||
<view class="widget-item">
|
||||
<text class="iconfont icon-shijian icon"></text>
|
||||
<picker mode="date" :value="datetime" @change="bindDateChange" class="picker">
|
||||
<picker mode="date" @change="bindDateChange" class="picker">
|
||||
<text class="title">
|
||||
<text class="text limit-line clamp-1">
|
||||
{{ datetime ? datetime : "选择期望上门时间" }}
|
||||
{{ date ? date : "选择期望上门日期" }}
|
||||
</text>
|
||||
</text>
|
||||
</picker>
|
||||
<text class="iconfont icon-jinru more"></text>
|
||||
</view>
|
||||
<view class="widget-item">
|
||||
<text class="iconfont icon-shijian icon"></text>
|
||||
<picker mode="time" @change="bindTimeChange" class="picker">
|
||||
<text class="title">
|
||||
<text class="limit-line clamp-1">
|
||||
{{ time ? time : "选择期望上门时间" }}
|
||||
</text>
|
||||
</text>
|
||||
</picker>
|
||||
|
@ -72,7 +83,8 @@ export default {
|
|||
pageConfig: {},
|
||||
addressId: 0,
|
||||
addressText: "",
|
||||
datetime: "",
|
||||
date: "",
|
||||
time: "",
|
||||
content: "",
|
||||
insurance: false,
|
||||
isAgree: false,
|
||||
|
@ -126,7 +138,10 @@ export default {
|
|||
onPullDownRefresh() {},
|
||||
methods: {
|
||||
bindDateChange(e) {
|
||||
this.datetime = e.detail.value;
|
||||
this.date = e.detail.value;
|
||||
},
|
||||
bindTimeChange(e) {
|
||||
this.time = e.detail.value;
|
||||
},
|
||||
/**
|
||||
* 选择地址
|
||||
|
@ -164,11 +179,15 @@ export default {
|
|||
});
|
||||
return;
|
||||
}
|
||||
if (!this.date || !this.time) {
|
||||
return this.$utils.toast("请选择时间和日期");
|
||||
}
|
||||
let datetime = this.date + " " + this.time;
|
||||
this.$models.order
|
||||
.createOrder({
|
||||
ids: this.orderData,
|
||||
addid: this.addressId,
|
||||
times: this.datetime,
|
||||
times: datetime,
|
||||
baoxian: this.insurance ? 1 : 0,
|
||||
desc: this.content,
|
||||
})
|
||||
|
|
|
@ -201,12 +201,16 @@ export default {
|
|||
* 提交订单
|
||||
*/
|
||||
submit() {
|
||||
if (!this.date || !this.time) {
|
||||
return this.$utils.toast("请选择时间和日期");
|
||||
}
|
||||
let datetime = this.date + " " + this.time;
|
||||
this.$models.service
|
||||
.createDistributionOrder({
|
||||
car: this.carTypeId,
|
||||
address: this.pickupAddressId,
|
||||
addressb: this.unloadAddressId,
|
||||
starttime: this.date + " " + this.time,
|
||||
starttime: datetime,
|
||||
sendtime: 0,
|
||||
distance: this.distance,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue