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

58
package1/buyFood/buyFood.vue

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

Loading…
Cancel
Save