From 5cdb8dcd33071f14ef356aeff43e79782541070a Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Sun, 20 Sep 2026 11:05:34 +0800 Subject: [PATCH] 1 --- package3/myCenter/problemFeedback.vue | 105 +++++++++++++++- package3/shop/transferDeliveryOrderList.vue | 127 ++++++++++++++++++-- 2 files changed, 222 insertions(+), 10 deletions(-) diff --git a/package3/myCenter/problemFeedback.vue b/package3/myCenter/problemFeedback.vue index f4de247..6a41fce 100644 --- a/package3/myCenter/problemFeedback.vue +++ b/package3/myCenter/problemFeedback.vue @@ -11,6 +11,13 @@ + + + 平台客服电话 + {{servicePhoneLoading ? '正在获取客服热线...' : '遇到问题可联系平台客服'}} + + 联系客服 + 我的反馈 按处理状态和时间排序 @@ -79,6 +86,8 @@ typeOptions: ['投诉', '吐槽', '建议', '其他'], pictureList: [], loading: false, + servicePhone: '', + servicePhoneLoading: false, totalPages: 0, feedbackList: [], form: { @@ -97,6 +106,7 @@ onLoad() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect ? uni.getMenuButtonBoundingClientRect() : {} this.form.contactPhone = uni.getStorageSync('mobile') || uni.getStorageSync('phone') || '' + this.getPlatformServicePhone() this.getFeedbackList() }, computed: { @@ -116,11 +126,65 @@ }, getArea() { try { - return uni.getStorageSync('area') ? JSON.parse(uni.getStorageSync('area')) : {} + const area = uni.getStorageSync('area') + if (!area) return {} + if (typeof area === 'object') return area + return JSON.parse(area) } catch (e) { return {} } }, + getCurrentRegionId() { + const area = this.getArea() + return area && area.id ? area.id : '' + }, + makeCall(phone) { + if (!phone) { + this.tui.toast('暂无联系电话') + return + } + uni.makePhoneCall({ + phoneNumber: phone + }) + }, + getPlatformServicePhone(callAfterFetch = false) { + if (this.servicePhone) { + if (callAfterFetch) { + this.makeCall(this.servicePhone) + } + return + } + if (this.servicePhoneLoading) return + const regionId = this.getCurrentRegionId() + if (!regionId) { + if (callAfterFetch) { + this.tui.toast('请选择区域') + } + return + } + this.servicePhoneLoading = true + this.tui.request('/mall/admin/seckillGroup/customerPhone/get', 'GET', { + regionId: regionId + }, false, true).then((res) => { + this.servicePhoneLoading = false + if (res.code == 200 && res.result) { + this.servicePhone = res.result + if (callAfterFetch) { + this.makeCall(res.result) + } + } else if (callAfterFetch) { + this.tui.toast(res.message || '获取客服电话失败') + } + }).catch(() => { + this.servicePhoneLoading = false + if (callAfterFetch) { + this.tui.toast('获取客服电话失败') + } + }) + }, + callPlatformService() { + this.getPlatformServicePhone(true) + }, getFeedbackList() { if (this.loading) return this.loading = true @@ -305,6 +369,43 @@ padding: 0 24rpx 180rpx; } + .service-phone-card { + display: flex; + align-items: center; + justify-content: space-between; + margin: 0 4rpx 24rpx; + padding: 24rpx 10rpx; + border-radius: 28rpx; + background: linear-gradient(135deg, #FFFFFF 0%, #ECFFF7 100%); + box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06); + } + + .service-phone-label { + color: #60706C; + font-size: 24rpx; + font-weight: 700; + } + + .service-phone-value { + margin-top: 8rpx; + color: #00231C; + font-size: 26rpx; + font-weight: 700; + } + + .service-phone-action { + min-width: 108rpx; + height: 56rpx; + padding: 0 24rpx; + border-radius: 999rpx; + background: #34C8A0; + color: #fff; + font-size: 24rpx; + font-weight: 900; + line-height: 56rpx; + text-align: center; + } + .feedback-popup, .feedback-item { border-radius: 28rpx; @@ -436,7 +537,7 @@ } .feedback-scroll { - height: calc(100vh - 348rpx); + height: calc(100vh - 476rpx); min-height: 520rpx; } diff --git a/package3/shop/transferDeliveryOrderList.vue b/package3/shop/transferDeliveryOrderList.vue index 1e1c09f..68fc31e 100644 --- a/package3/shop/transferDeliveryOrderList.vue +++ b/package3/shop/transferDeliveryOrderList.vue @@ -3,11 +3,13 @@ - 中转配送 + {{isWorkerMode ? '中转单' : '中转配送'}} - 待送达 - 已送达 + 待接单 + 待送达中转点({{transferTodoCount}}) + 待送达 + 已送达 @@ -17,6 +19,13 @@ 预约配送 #{{item.numberCode}} + + 商家 + + {{item.shopName || '-'}} + {{item.shopPhone}} + + 中转点 {{item.transferAddressName || item.shopName}} @@ -37,13 +46,20 @@ 取餐码 {{item.transferPickupCode || '配送员接单后生成'}} - + 配送员 {{item.workerName || '未分配'}} {{item.workerPhone}} + + 中转员 + + {{item.transferWorkerName || '未分配'}} + {{item.transferWorkerMobile}} + + 用户 @@ -58,12 +74,18 @@ 已送达中转点:{{formatTime(item.transferArriveTime)}} + + + {{item.transferAccepting ? '接单中...' : '接单'}} + + 拍照 送达中转点 - 暂无中转配送单 + + {{isWorkerMode ? (tab === 'accepted' ? '暂无待送达中转点订单' : '暂无待接中转单') : '暂无中转配送单'}} @@ -104,8 +126,13 @@ data() { return { tab: 'wait', + isWorkerMode: false, + currentWorker: {}, + transferTodoCount: 0, + acceptingTransferId: '', list: [], productData: [], + isLoadingPage: false, loadStatus: 'more', totalPages: 1, searchForm: { @@ -114,6 +141,9 @@ deliveryType: 1, transferDelivery: 1, transferArriveEmpty: true, + transferWorkerView: false, + transferWorkerAccepted: false, + transferWorkerId: '', shopId: '', regionId: '' }, @@ -124,6 +154,9 @@ listTop: 210 } }, + onLoad(options) { + this.isWorkerMode = !!(options && options.role === 'worker') + }, onShow() { this.initNavMetrics() this.resetList() @@ -165,27 +198,67 @@ this.totalPages = 1 this.list = [] this.loadStatus = 'more' - this.searchForm.transferArriveEmpty = this.tab === 'wait' - this.searchForm.shopId = uni.getStorageSync('shopId') + this.isLoadingPage = false const area = uni.getStorageSync('area') this.searchForm.regionId = area ? JSON.parse(area).id : '' + this.searchForm.transferWorkerView = this.isWorkerMode + if (this.isWorkerMode) { + this.currentWorker = uni.getStorageSync('worker') || {} + this.searchForm.shopId = '' + this.searchForm.transferWorkerId = this.currentWorker.workerId || '' + this.searchForm.transferArriveEmpty = true + this.searchForm.transferWorkerAccepted = this.tab === 'accepted' + } else { + this.searchForm.shopId = uni.getStorageSync('shopId') + this.searchForm.transferWorkerId = '' + this.searchForm.transferArriveEmpty = this.tab === 'wait' + this.searchForm.transferWorkerAccepted = false + } this.getList() }, loadMore() { - if (this.searchForm.pageNum >= this.totalPages) return + if (this.isLoadingPage || this.searchForm.pageNum >= this.totalPages) return this.searchForm.pageNum++ this.getList() }, getList() { + if (this.isLoadingPage) return + this.isLoadingPage = true this.tui.request('/mall/delivery/pageTransferDelivery', 'POST', this.searchForm, false, false).then((res) => { if (res.code == 200) { const records = res.result.records || [] this.list = this.searchForm.pageNum == 1 ? records : this.list.concat(records) this.totalPages = res.result.pages || 1 this.loadStatus = this.searchForm.pageNum >= this.totalPages ? 'nomore' : 'more' + if (this.isWorkerMode) { + if (this.tab === 'accepted') { + this.transferTodoCount = Number(res.result.total) || 0 + } else { + this.getTransferTodoCount() + } + } } else { this.tui.toast(res.message) } + this.isLoadingPage = false + }).catch(() => { + this.isLoadingPage = false + }) + }, + getTransferTodoCount() { + if (!this.isWorkerMode || !this.searchForm.transferWorkerId) { + this.transferTodoCount = 0 + return + } + const params = Object.assign({}, this.searchForm, { + pageNum: 1, + pageSize: 1, + transferWorkerAccepted: true + }) + this.tui.request('/mall/delivery/pageTransferDelivery', 'POST', params, false, false).then((res) => { + if (res.code == 200) { + this.transferTodoCount = Number((res.result || {}).total) || 0 + } }) }, chooseImage(index) { @@ -227,6 +300,43 @@ } }) }, + transferAccept(index, item) { + if (this.acceptingTransferId) return + const worker = this.currentWorker && this.currentWorker.workerId ? this.currentWorker : (uni.getStorageSync('worker') || {}) + if (!worker.workerId) { + this.tui.toast('您还没有注册兼职') + return + } + this.acceptingTransferId = item.id + this.$set(this.list[index], 'transferAccepting', true) + uni.showLoading({ + title: '接单中...', + mask: true + }) + this.tui.request('/mall/delivery/transferAccept', 'POST', { + deliveryId: item.id, + workerId: worker.workerId, + workerName: worker.workerName || '', + workerMobile: worker.mobile || '' + }, false, true).then((res) => { + if (res.code == 200) { + this.list.splice(index, 1) + this.transferTodoCount += 1 + this.tui.toast('接单成功') + } else { + this.tui.toast(res.message) + this.resetList() + } + }).catch(() => { + this.tui.toast('接单失败,请重试') + }).then(() => { + this.acceptingTransferId = '' + if (this.list[index] && this.list[index].id === item.id) { + this.$set(this.list[index], 'transferAccepting', false) + } + uni.hideLoading() + }) + }, productDetail(item) { const goodsList = item.goodsList || item.mallOrderGoodsList || item.orderGoodsList || [] this.productData = goodsList @@ -290,6 +400,7 @@ .photo-btn,.main-btn{flex:1;height:76rpx;line-height:76rpx;text-align:center;border-radius:38rpx;font-weight:700;} .photo-btn{background:#f2f6f4;color:#0b9b73;} .main-btn{background:linear-gradient(90deg,#e3ff96,#a6ffea);color:#00231c;} + .main-btn-disabled{opacity:.58;} .empty{text-align:center;color:#8a9692;padding:80rpx 0;} .product-popup-content { width: 680rpx;