diff --git a/package1/buyFood/buyFood.vue b/package1/buyFood/buyFood.vue index 8099553..6b4da7a 100644 --- a/package1/buyFood/buyFood.vue +++ b/package1/buyFood/buyFood.vue @@ -783,7 +783,7 @@ let shopId = this.createdOrderInfo.shopId || this.shopItem.id || this.shopItem.shopId || ''; return { - title: '我发起了一个拼团,快来一起拼单吧!', + title: '天灵灵地灵灵,这个价格不拼真的不行!😭', path: buildGroupHomeSharePath({ shopId: shopId, groupId: groupId, diff --git a/package1/index/deliveryPersonList.vue b/package1/index/deliveryPersonList.vue index 75b5233..ba6f5a3 100644 --- a/package1/index/deliveryPersonList.vue +++ b/package1/index/deliveryPersonList.vue @@ -39,10 +39,7 @@ @confirm="getShopList"> - - 当前可指派配送员列表是按照不超过您的总配送佣金筛选的,增加配送佣金可筛选更多配送员 - - + @@ -56,8 +53,14 @@ alt="" style="width: 140rpx;height: 32rpx;margin-top: 18rpx;" v-if="worker.rebateAmount > 0" /> - - ¥{{worker.orderBkge}} + + + 需补¥{{formatAmount(getCommissionDiff(worker))}} + + + ¥{{formatAmount(getWorkerCommission(worker))}} + @@ -134,6 +137,8 @@ sortField: "score", putAreaId: '', commissionAmount: '', + addressId: '', + isHighFloorAddress: false, workerList: [], orderType: null, pageNum: 1, // ← 新增 @@ -171,14 +176,82 @@ this.shopAreaId = option.shopAreaId || ''; this.putAreaId = option.putAreaId || ''; this.commissionAmount = option.commissionAmount || ''; + this.addressId = option.addressId || ''; this.orderType = option.orderType || 0; - this.getShopList(); + if (this.addressId) { + this.getAddressInfo().then(() => { + this.getShopList(); + }); + } else { + this.getShopList(); + } }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.regionId = JSON.parse(uni.getStorageSync('area')).id }, methods: { + toAmount(value) { + let amount = parseFloat(value); + return isNaN(amount) ? 0 : amount; + }, + formatAmount(value) { + let amount = Math.ceil(this.toAmount(value) * 100) / 100; + return amount.toFixed(2).replace(/\.?0+$/, ''); + }, + getWorkerCommission(worker) { + if (!worker) return 0; + let commission = this.toAmount(worker.orderBkge); + if (this.isHighFloorAddress) { + commission += this.toAmount(worker.highFloorFee); + } + return Math.ceil(commission * 100) / 100; + }, + getCommissionDiff(worker) { + if (!this.hasCommissionAmount || !worker) return 0; + let currentAmount = this.toAmount(this.commissionAmount); + let workerAmount = this.getWorkerCommission(worker); + let diff = workerAmount - currentAmount; + return diff > 0 ? Math.ceil(diff * 100) / 100 : 0; + }, + normalizeWorkerCommission(worker) { + if (!worker) return worker; + let assignedWorker = Object.assign({}, worker); + assignedWorker.orderBkge = this.formatAmount(this.getWorkerCommission(worker)); + return assignedWorker; + }, + makeUpCommission(worker) { + let diff = this.getCommissionDiff(worker); + if (diff <= 0) return; + uni.setStorageSync('pendingAddCommissionWorker', { + worker: this.normalizeWorkerCommission(worker), + additionalFee: this.formatAmount(diff) + }); + this.commissionAmount = ''; + uni.navigateBack(); + }, + getAddressInfo() { + if (!this.addressId) return Promise.resolve(); + return this.tui.request("/app/userAddress/get", "GET", { + id: this.addressId + }, false, true).then((res) => { + if (res.code == 200 && res.result) { + this.isHighFloorAddress = this.isAddressAboveThirdFloor(res.result); + } + }).catch(() => {}); + }, + isAddressAboveThirdFloor(address) { + let floor = this.extractFloor(address.floor); + if (!floor && address.address) { + floor = this.extractFloor(address.address); + } + return floor > 3; + }, + extractFloor(value) { + if (value === undefined || value === null) return 0; + let match = String(value).match(/\d+/); + return match ? parseInt(match[0]) || 0 : 0; + }, getLoca(item){ this.markers = [{ @@ -216,7 +289,6 @@ xiangtong: this.xiangtong, sortField: this.sortField, regionId: this.regionId, - commissionAmount: this.commissionAmount, keyword: this.keyword, pageNum: this.pageNum, pageSize: this.pageSize @@ -270,7 +342,8 @@ }); }, selectWorker(worker) { - uni.setStorageSync('pendingAssignWorker', worker); + uni.setStorageSync('pendingAssignWorker', this.normalizeWorkerCommission(worker)); + this.commissionAmount = ''; uni.navigateBack(); }, searchShop(type, value) { @@ -555,6 +628,26 @@ white-space: nowrap; } + .worker-price-wrap { + display: flex; + align-items: center; + flex-shrink: 0; + } + + .make-up-btn { + height: 48rpx; + line-height: 48rpx; + padding: 0 14rpx; + margin-right: 10rpx; + border-radius: 999rpx; + background: #fff5ec; + border: 1rpx solid rgba(255, 112, 67, 0.42); + color: #f0441f; + font-size: 21rpx; + font-weight: 800; + white-space: nowrap; + } + .worker-price { display: flex; align-items: center; diff --git a/package1/order/orderDetail.vue b/package1/order/orderDetail.vue index 47ded27..4a3cbba 100644 --- a/package1/order/orderDetail.vue +++ b/package1/order/orderDetail.vue @@ -245,8 +245,11 @@ - - 退款/售后 + + 退款/售后 + + 平台介入 + @@ -309,7 +312,7 @@ {{item2.refundType == 1 ? '退商品 ' : item2.refundType == 2 ? '退配送费 ' : '全额退款 ' }} - | {{item2.refundTypeStatus == 1 ? '商家原因' : item2.refundTypeStatus == 2 ? '配送员原因' : (item2.refundTypeStatus == 3 && item2.linkId.indexOf("W") == -1) ? '商家原因' : (item2.refundTypeStatus == 3 && item2.linkId.indexOf("W") != -1) ? '配送员原因' : '平台退款' }} + | {{item2.refundTypeStatus == 1 ? '商家退款' : item2.refundTypeStatus == 2 ? '配送员退款' : (item2.refundTypeStatus == 3 && item2.linkId.indexOf("W") == -1) ? '商家退款' : (item2.refundTypeStatus == 3 && item2.linkId.indexOf("W") != -1) ? '配送员退款' : '平台退款' }} @@ -321,6 +324,14 @@ {{item2.status == 0 ? '处理退款中' : item2.status == 1 ? '同意退款' : item2.status == 2 ? '拒绝退款' : item2.status == 3 ? '处理售后中' : item2.status == 4 ? '同意售后' : '拒绝售后' }} + + + 拒绝原因 + + + {{item2.rejectReason}} + + {{getAutoRefundTime(item2.createTime)}} 之前对方未处理系统会自动退款 @@ -572,8 +583,8 @@ {{orderDetail.shopDelivery == 1 ? '商家到店时间' : '配送员到店时间'}} - - {{orderDetail.deliveryInfo.arriveTime ? orderDetail.deliveryInfo.arriveTime : '' | formatTime}} + + {{formatTimeText(orderDetail.deliveryInfo.arriveTime)}} - - - 申请平台介入 - - - - - @@ -704,26 +705,32 @@ 请选择退款原因 - + 商家还未出餐 - + - 配送员到店时间:{{shopTime}} + 商家已出餐 - + + + + 配送员到店时间:{{arriveTime}} + + + 本单商家备餐时长:{{shopTime}} - + 配送员配送时长:{{peisongTime}} @@ -735,15 +742,15 @@ - 全额退款(商家原因) + 全额退款(商家退款) - 全额退款(配送员原因) + 全额退款(配送员退款) - 全额退款(商家+配送员原因) + 全额退款(商家退商品+配送员退配送费) - + @@ -434,7 +434,8 @@ isCreatingOrder: false, warnPopup: '', availableCoupons: [], - selectedCoupon: null + selectedCoupon: null, + navigatingFromPayPopup: false } }, components: { @@ -580,6 +581,18 @@ this.selectedCoupon = item; this.$refs.couponPopup.close(); }, + onPayPopupChange(e) { + if (!e.show && this.currentOrderId && !this.navigatingFromPayPopup) { + this.goPayOrderDetail(); + } + }, + goPayOrderDetail() { + if (!this.currentOrderId) return; + this.navigatingFromPayPopup = true; + uni.redirectTo({ + url: '/package1/order/orderDetail?id=' + this.currentOrderId + }); + }, getShopArea(){ if (this.shopAreaLoaded || this.shopAreaLoading) return Promise.resolve(this.shopArea); this.shopAreaLoading = true; @@ -860,8 +873,8 @@ }, submitPay() { uni.hideKeyboard(); - if (this.currentOrderId && this.backendTotalAmount) { - this.$refs.payPopup.open('bottom'); + if (this.currentOrderId) { + this.goPayOrderDetail(); return; } if (this.isCreatingOrder) return; @@ -959,6 +972,7 @@ getPictures: pics, regionId: JSON.parse(uni.getStorageSync('area')).id, deliveryFee: this.deliveryFeeCalc, + appointmentDelivery: this.formData.isImmediately === false ? 1 : 0, userCouponId: this.selectedCoupon ? this.selectedCoupon.id : null }; @@ -989,6 +1003,7 @@ if (res.success && res.result) { this.currentOrderId = res.result.id; this.backendTotalAmount = res.result.deliveryFee || this.deliveryFeeCalc; + this.navigatingFromPayPopup = false; this.$refs.payPopup.open('bottom'); } else { uni.showToast({ title: res.message || '下单失败', icon: 'none' }); @@ -1033,19 +1048,16 @@ that.handlePaymentSuccess(); }, fail: function(err) { - uni.redirectTo({ - url: '/package1/order/orderDetail?id=' + that.currentOrderId - }); + that.goPayOrderDetail(); } }); } else { - uni.redirectTo({ - url: '/package1/order/orderDetail?id=' + that.currentOrderId - }); + that.goPayOrderDetail(); } }) }, handlePaymentSuccess() { + this.navigatingFromPayPopup = true; uni.redirectTo({ url: '/package1/order/orderDetail?id=' + this.currentOrderId });