From 9a0b224b29ad79be697266c6cde97316eee0d580 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Mon, 22 Jun 2026 18:23:21 +0800 Subject: [PATCH] 1 --- package1/address/addressList.vue | 64 ++++++- package1/buyFood/buyFood.vue | 38 +++- package1/index/deliveryPersonList.vue | 13 +- package1/order/orderDetail.vue | 260 +++++++++++++++++++++++--- package1/order/orderList.vue | 4 +- package1/order/returnOrder.vue | 9 + package1/runErrand/runErrand.vue | 11 +- 7 files changed, 353 insertions(+), 46 deletions(-) diff --git a/package1/address/addressList.vue b/package1/address/addressList.vue index 98d8d1c..de80dc2 100644 --- a/package1/address/addressList.vue +++ b/package1/address/addressList.vue @@ -6,17 +6,17 @@ - - - 默认 - {{item.areaName || ''}}{{item.floor ? item.floor + '层' : ''}}{{item.roomNum || ''}} + class="address-item"> + + + 默认 + {{item.areaName || ''}}{{item.floor ? item.floor + '层' : ''}}{{item.roomNum || ''}} {{item.receiverName}} {{item.receiverPhone}} - + 编辑 @@ -319,6 +319,58 @@ height: 1200rpx; } + .address-item { + margin-bottom: 20rpx; + display: flex; + align-items: flex-start; + padding: 20rpx 40rpx 40rpx; + background: rgba(247, 248, 248, 0.6); + border-radius: 20rpx; + } + + .address-info { + flex: 1; + min-width: 0; + padding-right: 20rpx; + } + + .address-title-row { + min-height: 70rpx; + display: flex; + align-items: flex-start; + padding-top: 10rpx; + } + + .address-default-tag { + flex-shrink: 0; + margin-top: 8rpx; + margin-right: 10rpx; + padding: 4rpx 12rpx; + border-radius: 8rpx; + background: red; + color: #fff; + font-size: 20rpx; + line-height: 1; + } + + .address-title { + flex: 1; + min-width: 0; + font-size: 30rpx; + font-weight: 700; + line-height: 42rpx; + word-break: break-all; + overflow-wrap: break-word; + } + + .address-actions { + flex-shrink: 0; + display: flex; + align-items: center; + gap: 20rpx; + padding-top: 25rpx; + } + .bottom-btn { width: 90%; height: 100rpx; diff --git a/package1/buyFood/buyFood.vue b/package1/buyFood/buyFood.vue index a199918..459a840 100644 --- a/package1/buyFood/buyFood.vue +++ b/package1/buyFood/buyFood.vue @@ -279,9 +279,9 @@ 立即出餐-(拼团单,拼团成功后立即出餐) - + - + @@ -292,13 +292,13 @@ - + 堂食 - + 打包 @@ -343,7 +343,7 @@ 填写配送佣金 - 最低 0.1 元,最多输入 2 位小数 + 最低 0.1 元,最高 200 元,最多输入 2 位小数 - @@ -828,6 +828,11 @@ }); }, confirmCommission() { + let commission = parseFloat(this.commissionInputValue); + if (commission > 200) { + this.tui.toast('配送佣金不得超过200元'); + return; + } const value = this.formatCommissionValue(this.commissionInputValue); this.customCommission = value; this.$refs.commissionPopup.close(); @@ -951,6 +956,10 @@ this.$refs.warnPopup.open(); return; } + if (comm > 200) { + this.tui.toast('配送佣金不得超过200元'); + return; + } } if (this.isPaotui && this.selected === 'zhiding' && !this.assignedWorker && !isJoiningFaceToFace) { @@ -2417,6 +2426,23 @@ border: 0; } + .share-btn { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + background: transparent; + border: none; + color: inherit; + font-size: inherit; + font-weight: inherit; + line-height: 100rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: inherit; + } + .free-order-mask { position: fixed; left: 0; diff --git a/package1/index/deliveryPersonList.vue b/package1/index/deliveryPersonList.vue index 0a079a7..50a17b4 100644 --- a/package1/index/deliveryPersonList.vue +++ b/package1/index/deliveryPersonList.vue @@ -128,6 +128,7 @@ regionId: JSON.parse(uni.getStorageSync('area')).id, sortField: "score", putAreaId: '', + commissionAmount: '', workerList: [], orderType: null, pageNum: 1, // ← 新增 @@ -159,6 +160,7 @@ }); this.shopAreaId = option.shopAreaId || ''; this.putAreaId = option.putAreaId || ''; + this.commissionAmount = option.commissionAmount || ''; this.orderType = option.orderType || 0; this.getShopList(); }, @@ -204,6 +206,7 @@ xiangtong: this.xiangtong, sortField: this.sortField, regionId: this.regionId, + commissionAmount: this.commissionAmount, keyword: this.keyword, pageNum: this.pageNum, pageSize: this.pageSize @@ -221,6 +224,9 @@ } that.markers = [] for (let i = 0; i < that.workerList.length; i++) { + if (!that.workerList[i].geolocation) { + continue; + } that.workerList[i].geolocation = that.workerList[i].geolocation.split(","); // // 将用户位置添加到标记点 that.markers.push({ @@ -243,8 +249,10 @@ }); } - that.latitude = that.markers[0].latitude - that.longitude = that.markers[0].longitude + if (that.markers.length > 0) { + that.latitude = that.markers[0].latitude + that.longitude = that.markers[0].longitude + } that.totalPages = res.result.pages; // pages = 总页数 that.$forceUpdate(); } @@ -253,7 +261,6 @@ }, selectWorker(worker) { uni.setStorageSync('pendingAssignWorker', worker); - uni.$emit('updateDeliveryWorker', worker); uni.navigateBack(); }, searchShop(type, value) { diff --git a/package1/order/orderDetail.vue b/package1/order/orderDetail.vue index 19e38c4..ee01b50 100644 --- a/package1/order/orderDetail.vue +++ b/package1/order/orderDetail.vue @@ -16,6 +16,14 @@ {{orderDetail.shopName}} + + + 支付时间 + + + {{orderDetail.payTime | formatTime}} + + @@ -74,8 +82,7 @@ - @@ -145,7 +152,11 @@ 售后中 订单已售后 - + + + 创建时间 {{orderDetail.createTime | formatTime}} + + 预计{{orderDetail.deliveryInfo.mustFinishTime | formatHourMinute }}送达 - 送至 {{orderDetail.deliveryInfo.receiverAddress}} + 送至 + {{orderDetail.deliveryInfo.receiverAddress}} @@ -175,7 +187,7 @@ - 已下单 + {{orderDetail.status == 0 ? '待支付' : '已下单'}} @@ -461,6 +473,15 @@ {{orderDetail.createTime | formatTime}} + + + 支付时间 + + + {{orderDetail.payTime | formatTime}} + + @@ -647,7 +668,7 @@ - + @@ -744,8 +765,8 @@ - - + + 微信支付 @@ -780,18 +801,19 @@ - - - - - 确定要取消拼团吗 + + + + {{groupBuyCancelPopupType == 'cancel' ? '确定取消拼团订单吗?' : '确定要取消拼团吗'}} - - - + + 取消后将转为直接购买,并跳转至普通订单结算 + + + 取消 - + 确认 @@ -801,7 +823,7 @@ 增加配送佣金 - 最低 0.1 元,最多输入 2 位小数 + 最低 0.1 元,最高 200 元,最多输入 2 位小数 - - + + 增加配送佣金 @@ -885,7 +907,10 @@ codeImg: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/3a4e68eb14d7417cbb4f15fa85907c64.jpg', additionalFee: '', addFeeTradeNo: '', - isRefreshing: false + isRefreshing: false, + groupBuyCancelPopupType: 'buy', + assignWorkerModalVisible: false, + assignWorkerSelectionKey: '' } }, computed: { @@ -962,7 +987,6 @@ onLoad(option) { if (option.id) { this.orderId = option.id - this.getOrderDetail(this.orderId) } // 监听配送员选择事件(在onLoad中注册一次,确保事件不会丢失) uni.$on('updateDeliveryWorker', (worker) => { @@ -977,6 +1001,9 @@ uni.removeStorageSync('pendingAssignWorker'); this.handleWorkerSelected(pendingWorker); } + if (this.orderId) { + this.getOrderDetail(this.orderId); + } }, onShareAppMessage(res) { let that = this @@ -1173,6 +1200,10 @@ }, returnPopupProp(item) { this.payData = item; + if (item.status == 0) { + this.cancelUnpaidOrder(item); + return; + } if (this.payData.otherOrder == 1) { this.refundType = 3 @@ -1213,15 +1244,35 @@ this.peisongTime = `${fmt(hours1)}时${fmt(minutes1)}分${fmt(seconds1)}秒`; } - if(this.orderDetail.status != 10){ + if (item.status == 10) { + this.groupBuyCancelPopupType = 'cancel'; + this.$refs.returnPopupBuy.open('bottom'); + } else { this.$refs.returnPopup.open('bottom'); - }else{ - this.$refs.returnPopupBuy.open() } }, + cancelUnpaidOrder(item) { + let that = this; + that.tui.request("/mall/order/cancel", "POST", { + refundType: 3, + refundTypeStatus: 1, + orderId: item.id, + userId: uni.getStorageSync('id') + }, false, true).then((res) => { + uni.hideLoading(); + if (res.code == 200) { + that.tui.toast("操作成功"); + that.getOrderDetail(item.id); + that.$forceUpdate(); + } else { + that.tui.toast(res.message, 2000); + } + }).catch((res) => {}); + }, returnPopupPropBuy(item) { this.payData = item; + this.groupBuyCancelPopupType = 'buy'; if (this.payData.shopMakeTime != null) { const date1 = new Date(this.payData.deliveryInfo.acceptTime); const date2 = new Date(this.payData.shopMakeTime); @@ -1286,6 +1337,33 @@ }).catch((res) => {}); }, + confirmGroupBuyCancelPopup() { + if (this.groupBuyCancelPopupType == 'cancel') { + this.returnGroupOrder(); + return; + } + this.returnOrderBuy(); + }, + returnGroupOrder() { + this.$refs.returnPopupBuy.close(); + let item = this.payData; + let that = this; + that.tui.request("/mall/order/cancel", "POST", { + refundType: 3, + refundTypeStatus: 1, + orderId: item.id, + userId: uni.getStorageSync('id') + }, false, true).then((res) => { + uni.hideLoading(); + if (res.code == 200) { + that.tui.toast("操作成功"); + that.getOrderDetail(item.id); + that.$forceUpdate(); + } else { + that.tui.toast(res.message, 2000); + } + }).catch((res) => {}); + }, returnOrderBuy() { this.$refs.returnPopupBuy.close(); let item = this.payData @@ -1431,13 +1509,25 @@ } }, goAssignWorker() { - let shopAreaId = this.orderDetail.getAreaId || ''; - let putAreaId = this.orderDetail.putAreaId || ''; + let deliveryInfo = this.orderDetail.deliveryInfo || {}; + let shopAreaId = deliveryInfo.getAreaId || this.orderDetail.getAreaId || ''; + let putAreaId = deliveryInfo.putAreaId || this.orderDetail.putAreaId || ''; + let commissionAmount = deliveryInfo.deliveryFee != null + ? deliveryInfo.deliveryFee + : ''; uni.navigateTo({ - url: `/package1/index/deliveryPersonList?shopAreaId=${shopAreaId}&putAreaId=${putAreaId}` + url: `/package1/index/deliveryPersonList?shopAreaId=${shopAreaId}&putAreaId=${putAreaId}&commissionAmount=${commissionAmount}` }); }, handleWorkerSelected(worker) { + if (!worker) return; + uni.removeStorageSync('pendingAssignWorker'); + let workerKey = this.getWorkerSelectionKey(worker); + if (this.assignWorkerModalVisible && workerKey == this.assignWorkerSelectionKey) { + return; + } + this.assignWorkerModalVisible = true; + this.assignWorkerSelectionKey = workerKey; let that = this; uni.showModal({ title: '指派配送员', @@ -1446,9 +1536,15 @@ if (res.confirm) { that.reassignWorker(worker); } + }, + complete: function() { + that.assignWorkerModalVisible = false; } }); }, + getWorkerSelectionKey(worker) { + return String(worker.workerId || worker.id || worker.mobile || worker.workerName || ''); + }, reassignWorker(worker) { let that = this; let deliveryId = ''; @@ -1570,6 +1666,10 @@ this.tui.toast('请输入有效的金额'); return; } + if (fee > 200) { + this.tui.toast('增加配送佣金不得超过200元'); + return; + } // 关闭输入弹窗,生成随机订单号,打开支付弹窗 this.$refs.addFeePopup.close(); const now = Date.now(); // 获取当前时间戳 (13位) @@ -1584,6 +1684,10 @@ this.additionalFee = this.formatAdditionalFee(this.additionalFee); let fee = parseFloat(this.additionalFee); if (!fee || fee < 0.1) return; + if (fee > 200) { + this.tui.toast('增加配送佣金不得超过200元'); + return; + } let amountInCents = Math.round(fee * 100); this.tui.request("/api/wechat/pay/unified-order", "POST", { @@ -1916,8 +2020,11 @@ .status-text { flex: 1; + min-width: 0; position: relative; padding-left: 20rpx; + padding-right: 160rpx; + box-sizing: border-box; } .status-zhu { @@ -1933,8 +2040,24 @@ } .status-address { + display: flex; + align-items: flex-start; font-weight: 700; color: #243f38; + line-height: 40rpx; + word-break: break-all; + } + + .status-address-label { + flex-shrink: 0; + margin-right: 8rpx; + } + + .status-address-text { + flex: 1; + min-width: 0; + word-break: break-all; + overflow-wrap: break-word; } .status-btn { @@ -2069,11 +2192,81 @@ .evaluate-content, .car-content, .guize-list, + .group-buy-cancel-popup, .pay-popup { border-radius: 36rpx 36rpx 0 0 !important; box-shadow: 0 -18rpx 44rpx rgba(0, 35, 28, 0.12); } + .pay-popup { + width: 100vw; + min-height: 580rpx; + padding: 30rpx 0 calc(28rpx + env(safe-area-inset-bottom)); + box-sizing: border-box; + background: #fff; + } + + .pay-popup-content { + position: relative; + width: 100%; + height: auto; + margin-top: 0; + top: auto; + padding-bottom: 1rpx; + box-sizing: border-box; + } + + .group-buy-cancel-popup { + width: 100vw; + padding: 46rpx 42rpx calc(42rpx + env(safe-area-inset-bottom)); + box-sizing: border-box; + background: #fff; + } + + .group-buy-cancel-title { + color: #243f38; + font-size: 36rpx; + font-weight: 900; + line-height: 52rpx; + text-align: center; + } + + .group-buy-cancel-desc { + margin-top: 16rpx; + color: #7b8883; + font-size: 26rpx; + font-weight: 700; + line-height: 38rpx; + text-align: center; + } + + .group-buy-cancel-actions { + display: flex; + gap: 22rpx; + margin-top: 52rpx; + } + + .group-buy-cancel-btn { + flex: 1; + height: 88rpx; + border-radius: 999rpx; + font-size: 28rpx; + font-weight: 900; + line-height: 88rpx; + text-align: center; + } + + .group-buy-cancel-btn-muted { + background: #f0f2f1; + color: #7b8883; + } + + .group-buy-cancel-btn-confirm { + background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1)); + color: #00231C; + box-shadow: 0 14rpx 28rpx rgba(0, 191, 160, 0.12); + } + .cancel-popup { max-height: 86vh; padding: 20rpx 20rpx 0 !important; @@ -2577,9 +2770,20 @@ } .share-btn { + width: 100%; + height: 100%; margin: 0; padding: 0; + background: transparent; + border: none; + color: inherit; + font-size: inherit; + font-weight: inherit; line-height: 88rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: inherit; } .evaluate-list { diff --git a/package1/order/orderList.vue b/package1/order/orderList.vue index d4cf24c..d458357 100644 --- a/package1/order/orderList.vue +++ b/package1/order/orderList.vue @@ -195,10 +195,10 @@ 取消订单 --> - 去支付 - + --> 查看订单 diff --git a/package1/order/returnOrder.vue b/package1/order/returnOrder.vue index 8fd0cdf..eaedf80 100644 --- a/package1/order/returnOrder.vue +++ b/package1/order/returnOrder.vue @@ -65,6 +65,15 @@ ¥{{orderDetail.packageFee}} + + + 锦鲤免单 + + + ¥{{orderDetail.freeAmount == undefined ? '' : orderDetail.freeAmount}} + + diff --git a/package1/runErrand/runErrand.vue b/package1/runErrand/runErrand.vue index 9ada66c..bcfff52 100644 --- a/package1/runErrand/runErrand.vue +++ b/package1/runErrand/runErrand.vue @@ -315,7 +315,7 @@ 填写配送佣金 - 最低 0.1 元,最多输入 2 位小数 + 最低 0.1 元,最高 200 元,最多输入 2 位小数 200) { + this.tui.toast('配送佣金不得超过200元'); + return; + } this.customCommission = this.formatCommissionValue(this.commissionInputValue); this.$refs.commissionPopup.close(); this.fetchCoupons(); @@ -848,6 +853,10 @@ this.$refs.warnPopup.open(); return; } + if (comm > 200) { + this.tui.toast('配送佣金不得超过200元'); + return; + } } if (this.selectedWorker === 'zhiding' && !this.assignedWorker) { this.warnPopup = 'psy';