Browse Source

上传

master
前端-胡立永 3 months ago
parent
commit
10b519c209
8 changed files with 69 additions and 45 deletions
  1. +9
    -4
      api/api.js
  2. +2
    -3
      api/http.js
  3. +4
    -0
      components/userShop/deliverGoods.vue
  4. +1
    -1
      config.js
  5. +16
    -3
      mixins/order.js
  6. +9
    -20
      pages/index/order.vue
  7. +14
    -13
      pages_order/order/orderDetail.vue
  8. +14
    -1
      utils/utils.js

+ 9
- 4
api/api.js View File

@ -1,4 +1,5 @@
import http from './http.js' import http from './http.js'
import utils from '../utils/utils.js'
let limit = {} let limit = {}
let debounce = {} let debounce = {}
@ -340,7 +341,7 @@ const config = {
method: 'POST', method: 'POST',
auth: true, auth: true,
}, },
// 水洗店换货发货
// 水洗店发货
sendLogistics: { sendLogistics: {
url: '/order/send/logistics', url: '/order/send/logistics',
method: 'POST', method: 'POST',
@ -351,6 +352,12 @@ const config = {
url: '/conf/coupon', url: '/conf/coupon',
method: 'GET', 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 (req.auth) {
if (!uni.getStorageSync('token')) { if (!uni.getStorageSync('token')) {
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
utils.toLogin()
console.error('需要登录') console.error('需要登录')
return return
} }


+ 2
- 3
api/http.js View File

@ -1,5 +1,6 @@
import Vue from 'vue' import Vue from 'vue'
import utils from '../utils/utils.js'
function http(uri, data, callback, method = 'GET', showLoading, title) { 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 == '操作失败,用户不存在!'){ res.data.message == '操作失败,用户不存在!'){
uni.removeStorageSync('token') uni.removeStorageSync('token')
console.error('登录过期'); console.error('登录过期');
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
utils.toLogin()
} }
if(res.statusCode == 200 && res.data.code != 200){ if(res.statusCode == 200 && res.data.code != 200){


+ 4
- 0
components/userShop/deliverGoods.vue View File

@ -34,6 +34,9 @@
open(){ open(){
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
}, },
close(){
this.$refs.popup.close()
},
// //
sendLogistics(from, fn){ sendLogistics(from, fn){
@ -49,6 +52,7 @@
this.$api('sendLogistics', this.form, res => { this.$api('sendLogistics', this.form, res => {
if (res.code == 200) { if (res.code == 200) {
this.$emit('getData') this.$emit('getData')
this.$refs.popup.close()
} }
}) })
}, },


+ 1
- 1
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI); Vue.use(uvUI);
// 当前环境 // 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置 // 环境配置


+ 16
- 3
mixins/order.js View File

@ -56,11 +56,18 @@ export default {
confirmReceiveGoods(item) { confirmReceiveGoods(item) {
let self = this let self = this
let api = 'orderConfirm'
// 水洗订单,确认快递收货完成
if([21].includes(item.status)){
api = 'orderConfirmWashReceipt'
}
uni.showModal({ uni.showModal({
title: '您收到货了吗?', title: '您收到货了吗?',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
self.$api('orderConfirm', {
self.$api(api, {
id: item.id id: item.id
}, res => { }, res => {
if (res.code == 200) { 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 let self = this
this.$api('orderConfirmAccept', { this.$api('orderConfirmAccept', {
id: item.id, id: item.id,
flag,
...args, ...args,
}, res => { }, res => {
if (res.code == 200) { if (res.code == 200) {


+ 9
- 20
pages/index/order.vue View File

@ -39,18 +39,6 @@
</view> </view>
<view class="right"> <view class="right">
<!-- <view class="text-hidden-1">
客户姓名{{item.userName}}
</view>
<view class="text-hidden-1">
产品规格{{item.sku}}
</view>
<view class="text-hidden-1">
租赁地址{{item.userAddress}}
</view>
<view class="text-hidden-1">
数量{{ item.num }}
</view> -->
<view class="text-hidden-1"> <view class="text-hidden-1">
产品名称{{p.goodsName}} 产品名称{{p.goodsName}}
@ -66,7 +54,8 @@
</view> </view>
<view class="userInfo">
<view class="userInfo"
v-if="!userShop">
<text>{{ item.userName }}</text> <text>{{ item.userName }}</text>
<text>{{ item.userPhone }}</text> <text>{{ item.userPhone }}</text>
<text>{{ item.userAddress }}</text> <text>{{ item.userAddress }}</text>
@ -88,9 +77,9 @@
</view> </view>
<!-- 水洗订单水洗店选择收货方式 --> <!-- 水洗订单水洗店选择收货方式 -->
<template v-if="item.status == 4">
<template v-if="[4, 6].includes(item.status)">
<view @click.stop="orderConfirmAccept(item, {logisticsFlag : 0})" class="b2"> <view @click.stop="orderConfirmAccept(item, {logisticsFlag : 0})" class="b2">
快递取货
{{ item.status == 4 ? '快递取货' : '快递寄回' }}
</view> </view>
<view @click.stop="orderConfirmAccept(item, {logisticsFlag : 1})" class="b1"> <view @click.stop="orderConfirmAccept(item, {logisticsFlag : 1})" class="b1">
自行配送 自行配送
@ -105,7 +94,7 @@
</view> </view>
<!-- 待收货 --> <!-- 待收货 -->
<template v-if="[2].includes(item.status)">
<template v-if="[2, 21].includes(item.status)">
<view @click.stop="confirmReceiveGoods(item)" class="b2"> <view @click.stop="confirmReceiveGoods(item)" class="b2">
确认收货 确认收货
</view> </view>
@ -134,16 +123,16 @@
</template> </template>
<view <view
v-if="[8, 12].includes(item.status)"
v-if="[8, 12, 22].includes(item.status)"
@click.stop="orderId = item.id;$refs.deliverGoods.open()" class="b2"> @click.stop="orderId = item.id;$refs.deliverGoods.open()" class="b2">
发货填写单号 发货填写单号
</view> </view>
<view
<!-- <view
v-if="[6].includes(item.status)" v-if="[6].includes(item.status)"
@click.stop="orderFinishedWashing(item)" class="b2"> @click.stop="orderFinishedWashing(item)" class="b2">
水洗完成 水洗完成
</view>
</view> -->
</view> </view>
@ -195,7 +184,7 @@
</view> </view>
<!-- 待收货 --> <!-- 待收货 -->
<template v-if="[2].includes(item.status)">
<template v-if="[2, 23].includes(item.status)">
<view @click.stop="confirmReceiveGoods(item)" class="b2"> <view @click.stop="confirmReceiveGoods(item)" class="b2">
确认收货 确认收货
</view> </view>


+ 14
- 13
pages_order/order/orderDetail.vue View File

@ -21,23 +21,23 @@
<view class="btns"> <view class="btns">
<!-- 水洗订单水洗店选择收货方式 --> <!-- 水洗订单水洗店选择收货方式 -->
<template v-if="item.status == 4">
<view @click.stop="orderConfirmAccept(item, {logisticsFlag : 0})" class="b2">
快递取货
<template v-if="[4, 6].includes(order.status)">
<view @click.stop="orderConfirmAccept(order, {logisticsFlag : 0}, 1)" class="b2">
{{ order.status == 4 ? '快递取货' : '快递寄回' }}
</view> </view>
<view @click.stop="orderConfirmAccept(item, {logisticsFlag : 1})" class="b1">
<view @click.stop="orderConfirmAccept(order, {logisticsFlag : 1}, 1)" class="b1">
自行配送 自行配送
</view> </view>
</template> </template>
<view <view
v-if="[4, 18, 19].includes(order.status)"
v-if="[18, 19].includes(order.status)"
@click.stop="orderConfirmAccept(order)"> @click.stop="orderConfirmAccept(order)">
确认接单 确认接单
</view> </view>
<!-- 待收货 --> <!-- 待收货 -->
<template v-if="order.status == 2">
<template v-if="[2, 21].includes(order.status)">
<view @click.stop="confirmReceiveGoods(order)"> <view @click.stop="confirmReceiveGoods(order)">
确认收货 确认收货
</view> </view>
@ -62,16 +62,16 @@
</template> </template>
<view <view
v-if="[8, 12].includes(order.status)"
v-if="[8, 12, 22].includes(order.status)"
@click.stop="$refs.deliverGoods.open()" class="b2"> @click.stop="$refs.deliverGoods.open()" class="b2">
发货填写单号 发货填写单号
</view> </view>
<view
<!-- <view
v-if="[6].includes(order.status)" v-if="[6].includes(order.status)"
@click.stop="orderFinishedWashing(order)"> @click.stop="orderFinishedWashing(order)">
水洗完成 水洗完成
</view>
</view> -->
</view> </view>
@ -118,19 +118,19 @@
<view <view
class="current-price" class="current-price"
v-if="p.washPay">
v-if="p.washPay && !userShop">
水洗费用{{ p.washPay }} 水洗费用{{ p.washPay }}
</view> </view>
<view <view
class="current-price" class="current-price"
v-if="p.rentPay">
v-if="p.rentPay && !userShop">
租赁费用{{ p.rentPay }} 租赁费用{{ p.rentPay }}
</view> </view>
<view <view
class="current-price" class="current-price"
v-if="p.deposit">
v-if="p.deposit && !userShop">
押金{{ p.deposit }} 押金{{ p.deposit }}
</view> </view>
@ -188,7 +188,8 @@
</view> </view>
</view> --> </view> -->
<view class="line address">
<view class="line address"
v-if="!userShop">
<view class="address-top"> <view class="address-top">
<view class=""> <view class="">
收货地址 收货地址


+ 14
- 1
utils/utils.js View File

@ -172,6 +172,18 @@ export function navigateBack(num = -1){
export function redirectTo(...args){ export function redirectTo(...args){
uni.redirectTo(params(...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 { export default {
toArray, toArray,
@ -185,5 +197,6 @@ export default {
navigateTo, navigateTo,
navigateBack, navigateBack,
redirectTo, redirectTo,
copyText
copyText,
toLogin,
} }

Loading…
Cancel
Save