diff --git a/package1/buyFood/buyFood.vue b/package1/buyFood/buyFood.vue index abf9526..1990ab1 100644 --- a/package1/buyFood/buyFood.vue +++ b/package1/buyFood/buyFood.vue @@ -92,7 +92,10 @@ 配送员 - 指定配送员后,如遇到配送员拒绝接单,该订单进入抢单大厅 + 指定配送员,如配送员拒绝接单或者下线,订单进入抢单大厅 + + + 不指定配送员超过10分钟没有人接单,会发送短信通知 @@ -207,6 +210,16 @@ ¥{{deliveryFeeCalc.toFixed(2)}} + + + 备注 + + + + + @@ -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) {