wangfukang 3 weeks ago
parent
commit
fe69ffb857
  1. 58
      package1/buyFood/buyFood.vue

58
package1/buyFood/buyFood.vue

@ -92,7 +92,10 @@
配送员
</view>
<view style="font-size: 24rpx;color: #777;">
指定配送员后如遇到配送员拒绝接单该订单进入抢单大厅
指定配送员如配送员拒绝接单或者下线订单进入抢单大厅
</view>
<view style="font-size: 24rpx;color: #777;">
不指定配送员超过10分钟没有人接单会发送短信通知
</view>
</view>
<view style="padding: 40rpx;">
@ -207,6 +210,16 @@
{{deliveryFeeCalc.toFixed(2)}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;">
<view style="flex: 1;color: #777;font-weight: 700;">
备注
</view>
<view style="color: #000;font-weight:700;">
<input type="digit" v-model="remark"
style="width: 140rpx; border-bottom: 1px solid #ccc; text-align: center; font-size: 28rpx; font-weight: normal; height: 50rpx; min-height: 50rpx;"
/>
</view>
</view>
</view>
<view
style="display: flex;height: 80rpx;line-height: 100rpx;border-top: 1px solid #eee;font-size: 32rpx;font-weight: 700;">
@ -354,6 +367,7 @@
peisongyuan: ''
},
content: [],
remark:'',
selected: 'buzhiding',
customCommission: '0',
shopItem: {},
@ -675,18 +689,29 @@
},
getMustFinishTime() {
if (!this.formData.deliveryTime || this.formData.deliveryTime === '自动送达' || this.formData.deliveryTime ===
'尽快送达') return null;
let timeStr = this.formData.deliveryTime;
if (timeStr.length === 5) {
let [h, m] = timeStr.split(':');
let targetHour = parseInt(h);
let d = new Date();
if (targetHour < d.getHours()) d.setDate(d.getDate() + 1);
let yyyy = d.getFullYear();
let MM = String(d.getMonth() + 1).padStart(2, '0');
let DD = String(d.getDate()).padStart(2, '0');
return `${yyyy}-${MM}-${DD}T${timeStr}:00`;
}
'尽快送达'){
const now = new Date();
now.setMinutes(now.getMinutes() + 35);
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
}else{
let timeStr = this.formData.deliveryTime;
if (timeStr.length === 5) {
let [h, m] = timeStr.split(':');
let targetHour = parseInt(h);
let d = new Date();
if (targetHour < d.getHours()) d.setDate(d.getDate() + 1);
let yyyy = d.getFullYear();
let MM = String(d.getMonth() + 1).padStart(2, '0');
let DD = String(d.getDate()).padStart(2, '0');
return `${yyyy}-${MM}-${DD}T${timeStr}:00`;
}
}
return null;
},
submitOrderToBackend() {
@ -717,8 +742,8 @@
userId: uni.getStorageSync('id') || 'test-user123',
shopId: this.shopItem.id,
deliveryType: deliveryType,
packageFee: this.packageFee,
remark: '',
packageFee: this.isPaotui ? this.packageFee : 0,
remark: this.remark,
items: items,
receiverName: this.formData.address ? this.formData.address.receiverName : '',
receiverPhone: this.formData.address ? this.formData.address.phone : '',
@ -726,7 +751,7 @@
.address.floor ? this.formData.address.floor + '层' : '') + (this.formData.address
.roomNum || '')) : '',
shopName: this.shopItem.shopName,
shopPhone: this.shopItem.shopPhone || '',
shopPhone: this.shopItem.contactPhone || '',
shopAddress: this.shopItem.shopAddress || ''
};
@ -768,6 +793,7 @@
uni.showLoading({
title: '创建订单中...'
});
payload.regionId = JSON.parse(uni.getStorageSync('area')).id
this.tui.request("/mall/order/create", "POST", payload, false, false).then(res => {
uni.hideLoading();
if (res.success && res.result) {

Loading…
Cancel
Save