diff --git a/package1/address/addressList.vue b/package1/address/addressList.vue index 94d47cc..63c69e2 100644 --- a/package1/address/addressList.vue +++ b/package1/address/addressList.vue @@ -37,40 +37,26 @@ - + {{addressForm.id ? '编辑地址' : '填写地址'}} - - + + {{areaTitleInput}} + 请搜索选择楼座区域 + - - - {{addressForm.floor}} - 请填写所在楼层(仅限整数) - + - - - {{addressForm.roomNum}} - 请填写门牌号或所在机构科室 - + - - - {{addressForm.receiverName}} - 收货人名字 - + - - - {{addressForm.receiverPhone}} - 联系电话 - + 设为默认地址 @@ -81,6 +67,38 @@ + + + + 选择楼座区域 + + + + + + + + 未找到匹配的楼座 + + + {{item}} + + + + @@ -88,11 +106,11 @@ export default { data() { return { - isComboxFocused: false, addressList: [], areaList: [], areaTitleList: [], areaTitleInput: '', + areaSearchInput: '', addressForm: { id: '', areaId: '', @@ -109,6 +127,13 @@ this.getAddressList(); this.getAreaList(); }, + computed: { + filteredAreaTitleList() { + const keyword = (this.areaSearchInput || '').toString(); + if (!keyword) return this.areaTitleList; + return this.areaTitleList.filter(item => item.toString().indexOf(keyword) > -1); + } + }, methods: { getAddressList() { let that = this; @@ -165,6 +190,7 @@ isDefault: 0 }; this.areaTitleInput = ''; + this.areaSearchInput = ''; this.$refs.addBookPopup.open('bottom'); }, openEdit(item) { @@ -180,8 +206,21 @@ }; let match = this.areaList.find(a => a.id === item.areaId); this.areaTitleInput = match ? match.title : (item.areaName || ''); + this.areaSearchInput = ''; this.$refs.addBookPopup.open('bottom'); }, + openAreaPopup() { + this.areaSearchInput = this.areaTitleInput; + this.$refs.areaPopup.open(); + }, + closeAreaPopup() { + this.$refs.areaPopup.close(); + }, + selectAreaTitle(title) { + this.areaTitleInput = title; + this.areaSearchInput = title; + this.closeAreaPopup(); + }, submitAddress() { if(this.areaTitleInput) { let match = this.areaList.find(a => a.title === this.areaTitleInput); @@ -256,13 +295,81 @@ } .book-popup-content{ height: auto; + padding-top: 40rpx; } - - - \ No newline at end of file diff --git a/package1/buyFood/buyFood.vue b/package1/buyFood/buyFood.vue index 12bacc3..908f962 100644 --- a/package1/buyFood/buyFood.vue +++ b/package1/buyFood/buyFood.vue @@ -119,9 +119,10 @@ 不指定 - + 佣金 ¥ - + {{customCommission || '0.1'}} + @@ -281,8 +282,10 @@ 备注 - - + + + {{remark || '口味、餐具等备注'}} + @@ -313,7 +316,7 @@ - {{isStoreGroupOrder ? '立即支付-到店核销' : ('立即支付' + (nowMake && isPaotui == false ? '-即刻出餐' : ''))}} + {{isStoreGroupOrder ? '立即支付-到店核销' : ('立即支付' + (nowMake && isPaotui == false ? '-即刻出餐' : ''))}} {{totalAmountCalc.toFixed(2)}} @@ -324,6 +327,35 @@ @close="closeAddressBook"> + + + 填写配送佣金 + 最低 0.1 元,最多输入 2 位小数 + + + + + + 取消 + 确定 + + + + + + 填写备注 + 最多输入 100 字 + + + + + 上传图片 + + + - - - - - - - - - - + + - - - - + + + + + - 取消订单需要商家同意 - - 请选择退款原因 - - + 取消订单需要商家同意 + + 请选择退款原因 + + + - + 商家还未出餐 - - - - - - 配送员到店时间:{{shopTime}} - - + + + + 配送员到店时间:{{shopTime}} + - - - - - 本单商家备餐时长:{{shopTime}} - - + + + + 本单商家备餐时长:{{shopTime}} + - - - - - 配送员配送时长:{{peisongTime}} - - + + + + 配送员配送时长:{{peisongTime}} + - - 确认取消 - + + + + 确认取消 @@ -697,18 +695,18 @@ - - - - 增加配送佣金 + + + 增加配送佣金 + 最低 0.1 元,最多输入 2 位小数 + + + - - 请输入要增加的佣金金额(元) - - - - 去支付 + + 取消 + 去支付 @@ -765,6 +763,13 @@ menuButtonInfo: {}, refundType: 3, refundTypeStatus: 1, + returnData: { + reason: '', + pictures: '' + }, + cancelReasonOptions: ['配送超时', '收到的商品少了', '骑手送错地址', '收到的商品错了', '商家出餐超时', '餐品损坏或撒了', '商品质量问题'], + selectedCancelReasonOptions: [], + popupPageStyle: '', shopTime: '', hasRefund: false, peisongTime: '', @@ -776,7 +781,8 @@ }, codeImg: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/3a4e68eb14d7417cbb4f15fa85907c64.jpg', additionalFee: '', - addFeeTradeNo: '' + addFeeTradeNo: '', + isRefreshing: false } }, components: { @@ -886,6 +892,22 @@ }, methods: { + isRefundPending(item) { + return item && (item.status == 0 || item.status == 3); + }, + getAutoRefundTime(value) { + if (!value) return ''; + const date = new Date(value); + if (isNaN(date.getTime())) return ''; + date.setHours(date.getHours() + 1); + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + const hour = String(date.getHours()).padStart(2, '0'); + const minute = String(date.getMinutes()).padStart(2, '0'); + const second = String(date.getSeconds()).padStart(2, '0'); + return `${year}-${month}-${day} ${hour}:${minute}:${second}`; + }, openCode() { let that = this this.$refs.imgPopup.open() @@ -983,6 +1005,18 @@ this.refundTypeStatus = 3 } }, + onCancelPopupChange(e) { + this.popupPageStyle = e.show ? 'height:100vh;overflow:hidden;' : ''; + }, + toggleCancelReasonOption(item) { + let index = this.selectedCancelReasonOptions.indexOf(item); + if (index === -1) { + this.selectedCancelReasonOptions.push(item); + } else { + this.selectedCancelReasonOptions.splice(index, 1); + } + this.returnData.reason = this.selectedCancelReasonOptions.join('、'); + }, makeCall(phone) { uni.makePhoneCall({ phoneNumber: phone @@ -1103,16 +1137,19 @@ refundType: this.refundType, refundTypeStatus: this.refundTypeStatus, orderId: item.id, - userId: uni.getStorageSync('id') + userId: uni.getStorageSync('id'), + reason: this.returnData.reason, + pictures: this.returnData.pictures }, 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); + that.tui.toast(res.message,2000); } - uni.hideLoading(); + }).catch((res) => {}); }, returnOrderBuy() { @@ -1178,7 +1215,7 @@ that.payData.packageFee }); } else { - that.tui.toast(res.message); + that.tui.toast(res.message,2000); return; } uni.hideLoading(); @@ -1191,8 +1228,18 @@ }).catch((res) => {}); }, refreah(item) { + if (this.isRefreshing) return; + this.isRefreshing = true; + uni.showLoading({ + title: '刷新中...', + mask: true + }); this.getOrderDetail(item.id) this.$forceUpdate(); + setTimeout(() => { + uni.hideLoading(); + this.isRefreshing = false; + }, 1000); }, returnProducts(item) { uni.redirectTo({ @@ -1245,7 +1292,9 @@ return } }).catch((res) => {}) - uni.hideLoading(); + if (!this.isRefreshing) { + uni.hideLoading(); + } }, goAssignWorker() { let shopAreaId = this.orderDetail.getAreaId || ''; @@ -1291,11 +1340,35 @@ }, openAddFeePopup() { this.additionalFee = ''; - this.$refs.addFeePopup.open('bottom'); + this.$refs.addFeePopup.open('center'); + }, + formatMoneyInput(value) { + value = String(value || ''); + value = value.replace(/[^\d.]/g, ''); + const dotIndex = value.indexOf('.'); + if (dotIndex !== -1) { + value = value.slice(0, dotIndex + 1) + value.slice(dotIndex + 1).replace(/\./g, ''); + const parts = value.split('.'); + value = parts[0] + '.' + parts[1].slice(0, 2); + } + return value; + }, + formatAdditionalFee(value) { + let fee = parseFloat(this.formatMoneyInput(value)); + if (isNaN(fee) || fee < 0.1) { + return ''; + } + return (Math.floor(fee * 100) / 100).toFixed(2).replace(/\.?0+$/, ''); + }, + onAdditionalFeeInput(e) { + const value = this.formatMoneyInput(e.detail.value); + this.additionalFee = value; + return value; }, submitAddFee() { + this.additionalFee = this.formatAdditionalFee(this.additionalFee); let fee = parseFloat(this.additionalFee); - if (isNaN(fee) || fee <= 0) { + if (isNaN(fee) || fee < 0.1) { this.tui.toast('请输入有效的金额'); return; } @@ -1310,8 +1383,9 @@ }, addFeeWxPayment() { let that = this; + this.additionalFee = this.formatAdditionalFee(this.additionalFee); let fee = parseFloat(this.additionalFee); - if (!fee || fee <= 0) return; + if (!fee || fee < 0.1) return; let amountInCents = Math.round(fee * 100); this.tui.request("/api/wechat/pay/unified-order", "POST", { @@ -1379,7 +1453,12 @@ }); }, back() { - uni.navigateBack() + const pages = getCurrentPages() + if (pages.length > 1) { + uni.navigateBack({ delta: 1 }) + } else { + uni.switchTab({ url: '/pages/index/index' }) + } } } @@ -1453,6 +1532,120 @@ overflow: hidden; } + .auto-refund-tip { + margin: 8rpx 0 18rpx; + padding: 18rpx 20rpx; + border-radius: 18rpx; + background: rgba(255, 244, 232, 0.9); + border: 1rpx solid rgba(255, 180, 118, 0.48); + color: #b4572d; + font-size: 24rpx; + font-weight: 700; + line-height: 34rpx; + } + + .refund-card { + margin-top: 10px; + padding: 20rpx; + background: rgba(247, 248, 248, 0.6); + border-radius: 20rpx; + } + + .refund-goods-card { + display: flex; + padding: 18rpx; + margin: 12rpx 0; + background: rgba(255, 255, 255, 0.72); + border-radius: 22rpx; + border: 1rpx solid rgba(166, 255, 234, 0.28); + box-sizing: border-box; + } + + .refund-goods-img { + width: 132rpx; + height: 132rpx; + flex-shrink: 0; + border-radius: 20rpx; + overflow: hidden; + background: #f4f7f6; + } + + .refund-goods-img img { + width: 100%; + height: 100%; + border-radius: 20rpx; + object-fit: cover; + } + + .refund-goods-content { + flex: 1; + min-width: 0; + padding-left: 18rpx; + } + + .refund-goods-name { + color: #243f38; + font-size: 28rpx; + font-weight: 900; + line-height: 38rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .refund-goods-spec { + margin-top: 8rpx; + color: #7b8883; + font-size: 22rpx; + line-height: 32rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .refund-goods-bottom { + display: flex; + justify-content: space-between; + margin-top: 14rpx; + color: #243f38; + font-size: 24rpx; + font-weight: 800; + line-height: 34rpx; + } + + .refund-info-row { + display: flex; + align-items: flex-start; + padding: 18rpx 0; + border-bottom: 1rpx solid rgba(0, 35, 28, 0.045); + } + + .refund-info-label { + width: 160rpx; + flex-shrink: 0; + color: #87938f; + font-weight: 700; + line-height: 38rpx; + } + + .refund-info-value { + flex: 1; + min-width: 0; + color: #243f38; + font-weight: 700; + line-height: 38rpx; + word-break: break-all; + text-align: right; + } + + .refund-image { + width: 180rpx; + height: 180rpx; + border-radius: 20rpx; + display: block; + margin-left: auto; + } + .content > .box1:first-child { background: radial-gradient(circle at 94% 4%, rgba(255, 221, 176, 0.2) 0, rgba(255, 221, 176, 0) 170rpx), @@ -1683,6 +1876,143 @@ box-shadow: 0 -18rpx 44rpx rgba(0, 35, 28, 0.12); } + .cancel-popup { + max-height: 86vh; + padding: 20rpx 20rpx 0 !important; + overflow: hidden; + box-sizing: border-box; + background: #fff; + } + + .cancel-scroll { + height: 62vh; + overflow: hidden; + } + + .cancel-type-item { + min-height: 76rpx; + line-height: 76rpx; + color: #243f38; + font-size: 28rpx; + font-weight: 700; + } + + .cancel-section { + padding: 0 20rpx 24rpx; + } + + .cancel-section-title { + margin: 10rpx 0 18rpx; + color: #243f38; + font-size: 28rpx; + font-weight: 900; + } + + .cancel-option-list { + display: flex; + flex-wrap: wrap; + gap: 16rpx; + } + + .cancel-option { + padding: 0 22rpx; + height: 64rpx; + line-height: 64rpx; + border-radius: 999rpx; + background: rgba(247, 248, 248, 0.78); + border: 1rpx solid rgba(0, 35, 28, 0.06); + color: #65736f; + font-size: 24rpx; + font-weight: 700; + } + + .cancel-option.checked { + background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1)); + color: #00231C; + border-color: rgba(166, 255, 234, 0.78); + } + + .cancel-textarea { + width: 100%; + height: 180rpx; + padding: 20rpx; + box-sizing: border-box; + border-radius: 24rpx; + background: rgba(247, 248, 248, 0.8); + color: #243f38; + font-size: 26rpx; + line-height: 38rpx; + } + + .cancel-upload-row { + display: flex; + align-items: center; + gap: 18rpx; + flex-wrap: wrap; + } + + .cancel-upload-img { + width: 150rpx; + height: 150rpx; + border-radius: 20rpx; + object-fit: cover; + } + + .cancel-upload-btn { + display: flex; + align-items: center; + justify-content: center; + background: rgba(247, 248, 248, 0.8); + border: 1rpx dashed rgba(0, 35, 28, 0.18); + } + + .cancel-upload-preview { + width: 150rpx; + height: 150rpx; + border-radius: 20rpx; + overflow: hidden; + } + + .cancel-warning-card { + margin-top: 20rpx; + padding: 18rpx 20rpx; + border-radius: 18rpx; + background: #fff5f5; + color: #ff5722; + font-size: 24rpx; + line-height: 36rpx; + box-sizing: border-box; + } + + .cancel-time-tips { + margin-top: 14rpx; + display: flex; + flex-direction: column; + gap: 10rpx; + } + + .cancel-warning-line { + display: flex; + align-items: flex-start; + width: 100%; + min-height: 36rpx; + line-height: 36rpx; + text-align: left; + word-break: break-all; + } + + .cancel-warning-line text { + flex: 1; + min-width: 0; + padding-left: 10rpx; + white-space: normal; + } + + .cancel-confirm-btn { + width: 95%; + margin: 18rpx auto 20rpx; + } + .evaluate-content { background: linear-gradient(180deg, #ffffff 0%, #f7fffb 100%); } @@ -1700,6 +2030,83 @@ background-size: 100%; } + .commission-popup { + width: 620rpx; + padding: 44rpx 36rpx 34rpx; + box-sizing: border-box; + border-radius: 32rpx; + background: #fff; + box-shadow: 0 28rpx 70rpx rgba(0, 35, 28, 0.18); + } + + .commission-popup-title { + color: #243f38; + font-size: 34rpx; + font-weight: 900; + text-align: center; + } + + .commission-popup-desc { + margin-top: 12rpx; + color: #87938f; + font-size: 24rpx; + text-align: center; + } + + .commission-popup-input { + display: flex; + align-items: center; + height: 88rpx; + margin-top: 34rpx; + padding: 0 26rpx; + border-radius: 24rpx; + background: #f6faf8; + border: 1rpx solid #e5efeb; + + text { + margin-right: 12rpx; + color: #ff7043; + font-size: 34rpx; + font-weight: 900; + } + + input { + flex: 1; + height: 88rpx; + min-height: 88rpx; + font-size: 34rpx; + font-weight: 800; + } + } + + .commission-popup-actions { + display: flex; + margin-top: 34rpx; + gap: 18rpx; + } + + .commission-popup-cancel, + .commission-popup-confirm { + flex: 1; + height: 76rpx; + border-radius: 999rpx; + font-size: 28rpx; + font-weight: 800; + line-height: 76rpx; + text-align: center; + } + + .commission-popup-cancel { + background: #f3f6f4; + color: #87938f; + } + + .commission-popup-confirm { + background: linear-gradient(135deg, #fff7d7 0%, #a6ffea 100%); + color: #243f38; + box-shadow: 0 12rpx 26rpx rgba(0, 191, 160, 0.12); + } + .evaluate-content { width: 600rpx; height: 800rpx; @@ -1879,6 +2286,20 @@ box-sizing: border-box; } + .kaituan-refresh-btn { + height: 44rpx; + line-height: 44rpx; + padding: 0 22rpx; + margin: 10rpx 0 0 16rpx; + border-radius: 999rpx; + background: rgba(255, 255, 255, 0.86); + border: 1rpx solid rgba(166, 255, 234, 0.7); + color: #0f806d; + font-size: 22rpx; + font-weight: 800; + box-shadow: 0 8rpx 18rpx rgba(0, 35, 28, 0.06); + } + .kaituan21 { display: flex; align-items: center; diff --git a/package1/order/orderList.vue b/package1/order/orderList.vue index bccd33a..d4cf24c 100644 --- a/package1/order/orderList.vue +++ b/package1/order/orderList.vue @@ -168,7 +168,7 @@ - + @@ -454,7 +454,7 @@ that.tui.toast("订单创建失败,请联系客服处理"); } }) */ - uni.redirectTo({ + uni.navigateTo({ url: '/package1/order/orderDetail?id=' + that.payData.id }); }, @@ -472,7 +472,7 @@ return false; }, orderDetail(id){ - uni.redirectTo({ + uni.navigateTo({ url: '/package1/order/orderDetail?id=' + id }); }, diff --git a/package1/order/returnOrder.vue b/package1/order/returnOrder.vue index a25630d..2f75abe 100644 --- a/package1/order/returnOrder.vue +++ b/package1/order/returnOrder.vue @@ -1,6 +1,6 @@