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 @@
-
+
- 快递取货
+ {{ item.status == 4 ? '快递取货' : '快递寄回' }}
自行配送
@@ -105,7 +94,7 @@
-
+
确认收货
@@ -134,16 +123,16 @@
发货填写单号
-
水洗完成
-
+ -->
@@ -195,7 +184,7 @@
-
+
确认收货
diff --git a/pages_order/order/orderDetail.vue b/pages_order/order/orderDetail.vue
index a79bf3f..6b91f07 100644
--- a/pages_order/order/orderDetail.vue
+++ b/pages_order/order/orderDetail.vue
@@ -21,23 +21,23 @@
-
-
- 快递取货
+
+
+ {{ order.status == 4 ? '快递取货' : '快递寄回' }}
-
+
自行配送
确认接单
-
+
确认收货
@@ -62,16 +62,16 @@
发货填写单号
-
水洗完成
-
+ -->
@@ -118,19 +118,19 @@
+ v-if="p.washPay && !userShop">
水洗费用:{{ p.washPay }}元
+ v-if="p.rentPay && !userShop">
租赁费用:{{ p.rentPay }}元
+ v-if="p.deposit && !userShop">
押金:{{ p.deposit }}元
@@ -188,7 +188,8 @@
-->
-
+
收货地址
diff --git a/utils/utils.js b/utils/utils.js
index dabe1e0..22e228d 100644
--- a/utils/utils.js
+++ b/utils/utils.js
@@ -172,6 +172,18 @@ export function navigateBack(num = -1){
export function redirectTo(...args){
uni.redirectTo(params(...args))
}
+export const toLogin = function(){
+ let time = 0
+ return () => {
+ if(new Date().getTime() - time < 1000){
+ return
+ }
+ time = new Date().getTime()
+ uni.navigateTo({
+ url: '/pages_order/auth/wxLogin'
+ })
+ }
+}()
export default {
toArray,
@@ -185,5 +197,6 @@ export default {
navigateTo,
navigateBack,
redirectTo,
- copyText
+ copyText,
+ toLogin,
}
\ No newline at end of file