From 10b519c2091bdd555bf59ff3f056c721a252426f Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Thu, 21 Nov 2024 19:17:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.js | 13 +++++++++---- api/http.js | 5 ++--- components/userShop/deliverGoods.vue | 4 ++++ config.js | 2 +- mixins/order.js | 19 ++++++++++++++++--- pages/index/order.vue | 29 +++++++++-------------------- pages_order/order/orderDetail.vue | 27 ++++++++++++++------------- utils/utils.js | 15 ++++++++++++++- 8 files changed, 69 insertions(+), 45 deletions(-) diff --git a/api/api.js b/api/api.js index 48a6b83..1ad4198 100644 --- a/api/api.js +++ b/api/api.js @@ -1,4 +1,5 @@ import http from './http.js' +import utils from '../utils/utils.js' let limit = {} let debounce = {} @@ -340,7 +341,7 @@ const config = { method: 'POST', auth: true, }, - // 水洗店换货发货 + // 水洗店发货 sendLogistics: { url: '/order/send/logistics', method: 'POST', @@ -351,6 +352,12 @@ const config = { url: '/conf/coupon', method: 'GET', }, + // 水洗订单,水洗店确认快递收货完成 + orderConfirmWashReceipt : { + url: '/order/shop/wash/receipt', + method: 'POST', + auth: true, + } } @@ -386,9 +393,7 @@ export function api(key, data, callback, loadingTitle) { //必须登录 if (req.auth) { if (!uni.getStorageSync('token')) { - uni.navigateTo({ - url: '/pages_order/auth/wxLogin' - }) + utils.toLogin() console.error('需要登录') return } diff --git a/api/http.js b/api/http.js index 1598d64..9b48cd7 100644 --- a/api/http.js +++ b/api/http.js @@ -1,5 +1,6 @@ import Vue from 'vue' +import utils from '../utils/utils.js' function http(uri, data, callback, method = 'GET', showLoading, title) { @@ -29,9 +30,7 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { res.data.message == '操作失败,用户不存在!'){ uni.removeStorageSync('token') console.error('登录过期'); - uni.navigateTo({ - url: '/pages_order/auth/wxLogin' - }) + utils.toLogin() } if(res.statusCode == 200 && res.data.code != 200){ diff --git a/components/userShop/deliverGoods.vue b/components/userShop/deliverGoods.vue index 35f8af4..a8882f4 100644 --- a/components/userShop/deliverGoods.vue +++ b/components/userShop/deliverGoods.vue @@ -34,6 +34,9 @@ open(){ this.$refs.popup.open('bottom') }, + close(){ + this.$refs.popup.close() + }, // 水洗店换货发货 sendLogistics(from, fn){ @@ -49,6 +52,7 @@ this.$api('sendLogistics', this.form, res => { if (res.code == 200) { this.$emit('getData') + this.$refs.popup.close() } }) }, diff --git a/config.js b/config.js index 1ff1c77..cfb0a2d 100644 --- a/config.js +++ b/config.js @@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'dev' +const type = 'prod' // 环境配置 diff --git a/mixins/order.js b/mixins/order.js index 1a3d857..7123950 100644 --- a/mixins/order.js +++ b/mixins/order.js @@ -56,11 +56,18 @@ export default { confirmReceiveGoods(item) { let self = this + let api = 'orderConfirm' + + // 水洗订单,确认快递收货完成 + if([21].includes(item.status)){ + api = 'orderConfirmWashReceipt' + } + uni.showModal({ title: '您收到货了吗?', success(res) { if (res.confirm) { - self.$api('orderConfirm', { + self.$api(api, { id: item.id }, res => { if (res.code == 200) { @@ -71,11 +78,17 @@ export default { } }) }, - // 水洗店确认接单 - orderConfirmAccept(item, args = {}){ + // 水洗店确认接单, logisticsFlag = 0:快递取货、快递寄回,1自行配送 + orderConfirmAccept(item, args = {},flag = 0){ + + if([6].includes(item.status)){ + flag = 1 + } + let self = this this.$api('orderConfirmAccept', { id: item.id, + flag, ...args, }, res => { if (res.code == 200) { diff --git a/pages/index/order.vue b/pages/index/order.vue index 6ae3e12..b70fc55 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -39,18 +39,6 @@ - 产品名称:{{p.goodsName}} @@ -66,7 +54,8 @@ - + {{ item.userName }} {{ item.userPhone }} {{ item.userAddress }} @@ -88,9 +77,9 @@ -