cmy il y a 2 ans
Parent
commit
c5b48e2504

+ 12 - 0
api/water.js

@@ -110,6 +110,18 @@ export function GetAdminOrderList(data) {
 }
 
 
+//送货
+export function deliveryKeep(data) {
+	return request({
+		url: '/api/admin/order/delivery/keep',
+		method: 'post',
+		data
+	});
+}
+
+
+
+
 
 
 

+ 1 - 1
pages.json

@@ -303,7 +303,7 @@
 					"path": "money/pay",
 					"style": {
 						"navigationBarTitleText": "支付",
-						"navigationBarBackgroundColor": "#0BBB62",
+						"navigationBarBackgroundColor": "#3C82E6",
 						"navigationBarTextStyle": "white"
 					}
 				},

+ 131 - 66
pages/user/admin/orderAdmin.vue

@@ -2,7 +2,12 @@
 	<view class="content">
 		<view class="navbar">
 			<view v-for="(item, index) in navList" :key="index" class="nav-item"
-				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
+				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}
+				<template v-if="item.ordertype">
+					(<text v-if="shopOrderDetail[item.ordertype]>99">99+</text>
+					<text v-else>{{shopOrderDetail[item.ordertype]}}</text>)
+				</template>
+			</view>
 		</view>
 
 		<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
@@ -12,7 +17,8 @@
 					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
 
 					<!-- 订单列表 -->
-					<view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index" class="order-item position-relative">
+					<view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index"
+						class="order-item position-relative">
 						<view class="i-top b-b flex">
 							<view class="order-code flex">
 								<view class="no">
@@ -22,7 +28,8 @@
 									{{ item.order_id }}
 								</view>
 							</view>
-							<text class="font-size-sm" :style="{ color: item.stateTipColor }">{{ item.status_name }}</text>
+							<text class="font-size-sm"
+								:style="{ color: item.stateTipColor }">{{ item.status_name }}</text>
 						</view>
 
 						<scroll-view v-if="item._info.length > 0" class="goods-box" scroll-x>
@@ -45,10 +52,10 @@
 						<!-- 客户信息 -->
 						<view class="kh-info">
 							<view class="">
-								客户信息:<text>李丹丹 13757625302</text>
+								客户信息:<text>{{item.user_address_info.real_name}} {{item.user_address_info.phone}}</text>
 							</view>
 							<view class="">
-								配送地址:<text>浙江省台州市东海大道100号402室</text>
+								配送地址:<text>{{item.user_address_info.locate_address}}</text>
 							</view>
 						</view>
 						<!-- 底部操作栏 -->
@@ -57,28 +64,30 @@
 								下单时间:{{item.add_time.split(' ')[0].replace(/-/g,'/')}}
 							</view>
 							<view class="btm-right flex">
-								<view class="btm-btn" @click.stop="toCall(item)">
+								<view class="btm-btn" @click.stop="toCall(item.user_address_info.phone)">
 									联系客户
 								</view>
-								<view class="btm-btn ksps" @click.stop="openSend(item)" v-if=" item.status_name=='未发货'">
-									开始配送
+								<view class="btm-btn ksps" @click.stop="actionItem = item"
+									v-if=" item.status_name=='未发货' &&shopOrderDetail.is_main_store">
+									<picker mode="selector" :range="kflist" range-key="staff_name" @change="changeKf">
+										<view>开始配送</view>
+									</picker>
 								</view>
-								<view class="btm-btn ksps" v-if=" item.status_name=='待收货'">
+								<view class="btm-btn ksps" v-if=" item.status_name=='待收货'"  @click.stop="shopNext(item)">
 									导航
 								</view>
 							</view>
 						</view>
 					</view>
-
 					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
 				</scroll-view>
 			</swiper-item>
 		</swiper>
 		<uni-popup ref="popup" type="bottom">
 			<view class="buttomBox">
-				<picker mode="selector" :range="kflist" @change="changeKf">
-					<view>{{}}</view>
-				</picker>
+				<view class="item">
+					取消
+				</view>
 			</view>
 			<view class="buttomBox" @click="$refs.popup.close()">
 				<view class="item qx">
@@ -86,25 +95,29 @@
 				</view>
 			</view>
 		</uni-popup>
-		
-		
 	</view>
 </template>
 
 <script>
 	import {
 		adminkf,
-		GetAdminOrderList
+		GetAdminOrderList,
+		adminStatistics,
+		deliveryKeep
 	} from '@/api/water.js';
 	import {
-		
-	} from '@/api/user.js'
+		mapState,
+		mapMutations
+	} from 'vuex';
 	export default {
 		data() {
 			return {
-				kflist:[],//客服列表
-				actionKf:{},//选中的客服
-				actionItem:{},//保存当前配送对象
+				kflist: [], //客服列表
+				actionKf: {
+					staff_name: '',
+					id: ''
+				}, //选中的客服
+				actionItem: {}, //保存当前配送对象
 				tabCurrentIndex: 0,
 				navList: [{
 						state: 0,
@@ -112,7 +125,8 @@
 						loadingType: 'more',
 						orderList: [],
 						page: 1, //当前页数
-						limit: 10 //每次信息条数
+						limit: 10, //每次信息条数
+						ordertype: 'unpaid_count'
 					},
 					{
 						state: 1,
@@ -120,7 +134,8 @@
 						loadingType: 'more',
 						orderList: [],
 						page: 1, //当前页数
-						limit: 10 //每次信息条数
+						limit: 10, //每次信息条数
+						ordertype: 'unshipped_count'
 					},
 					{
 						state: 2,
@@ -128,7 +143,8 @@
 						loadingType: 'more',
 						orderList: [],
 						page: 1, //当前页数
-						limit: 10 //每次信息条数
+						limit: 10, //每次信息条数
+						ordertype: 'received_count'
 					},
 					{
 						state: 4,
@@ -136,11 +152,14 @@
 						loadingType: 'more',
 						orderList: [],
 						page: 1, //当前页数
-						limit: 10 //每次信息条数
+						limit: 10, //每次信息条数
 					}
 				]
 			};
 		},
+		computed: {
+			...mapState('shop', ['shopOrderDetail'])
+		},
 
 		onLoad(options) {
 			/**
@@ -157,7 +176,10 @@
 			}
 			// #endif
 			// 获取客服
-			this.getadminkf()
+			this.getadminkf();
+			if (!this.shopOrderDetail.unpaid_count) {
+				this.adminStatistics()
+			}
 		},
 		// #ifdef APP-PLUS || H5
 		onBackPress(e) {
@@ -168,29 +190,68 @@
 		},
 		// #endif
 		methods: {
+			...mapMutations('shop', ['setShopOrder']),
+			// 获取订单数量信息
+			adminStatistics() {
+				adminStatistics({}).then((e) => {
+					this.setShopOrder(e.data)
+				}).catch((e) => {
+					console.log(e, 'sj');
+				})
+			},
 			// 客服变更
-			changeKf(){
-				
+			changeKf(item) {
+				const that = this;
+				that.actionKf = that.kflist[item.detail.value]
+				uni.showModal({
+					title: '送货',
+					content: `是否让员工${that.actionKf.staff_name}(${that.actionKf.id})送货?`,
+					success: res => {
+						if (res.confirm) {
+							deliveryKeep({
+								delivery_kf: that.actionKf.id,
+								delivery_type: 'send',
+								order_id: that.actionItem.order_id,
+								delivery_name: that.actionKf.staff_name,
+								delivery_id: that.actionKf.phone
+							}).then((res) => {
+								uni.showToast({
+									title: res.msg
+								});
+								that.adminStatistics();
+								that.navList[that.tabCurrentIndex].page = 1;
+								that.navList[that.tabCurrentIndex].orderList = [];
+								that.navList[that.tabCurrentIndex].loadingType = 'more';
+								that.loadData();
+							}).catch((res) => {
+
+							})
+						}
+					},
+					fail: () => {},
+					complete: () => {}
+				});
 			},
 			// 开始配送
-			openSend(item){
+			openSend(item) {
 				this.$refs.popup.open();
 				this.actionItem = item;
 			},
 			// 获取客服列表
-			getadminkf(){
-				adminkf({}).then((res)=>{
-					console.log(res,'kf');
-				}).catch((res)=>{
+			getadminkf() {
+				adminkf({}).then((res) => {
+					this.kflist = res.data;
+					console.log(res, 'kf');
+				}).catch((res) => {
 					console.log(res);
 				})
 			},
-			// 前往商家
-			shopNext() {
+			// 前往客户
+			shopNext(item) {
 				// 打开地图导航
 				uni.openLocation({
-					latitude: +this.item.system_store.latitude,
-					longitude: +this.item.system_store.longitude,
+					latitude: +item.user_address_info.latitude,
+					longitude: +item.user_address_info.longitude,
 					fail(e) {
 						console.log(e);
 					}
@@ -199,7 +260,7 @@
 			// 联系用户
 			toCall(phone) {
 				uni.makePhoneCall({
-					phoneNumber:phone
+					phoneNumber: phone
 				})
 			},
 			//跳转到订单详情
@@ -240,7 +301,6 @@
 					}) => {
 						let arr = data.map(e => {
 							let b = this.orderStateExp(e.status);
-							e.stateTip = b.stateTip;
 							e.stateTipColor = b.stateTipColor;
 							return e;
 						});
@@ -273,36 +333,34 @@
 			},
 			//订单状态文字和颜色
 			orderStateExp(state) {
-				let stateTip = '',
-					stateTipColor = '#3C82E6';
+				let stateTipColor = '#3C82E6';
 				switch (+state) {
 					case 0:
-						stateTip = '待付款';
+						//'待付款';
 						stateTipColor = '#3C82E6'
 						break;
 					case 1:
-						stateTip = '待发货';
+						//'待发货';
 						stateTipColor = '#3C82E6'
 						break;
 					case 2:
-						stateTip = '待收货';
+						//'待收货';
 						break;
 					case 3:
-						stateTip = '待评价';
+						//'待评价';
 						break;
 					case 4:
-						stateTip = '已完成';
+						//'已完成';
 						stateTipColor = '#999999';
 						break;
 					case 9:
-						stateTip = '订单已关闭';
+						//'订单已关闭';
 						stateTipColor = '#909399';
 						break;
 
 						//更多自定义
 				}
 				return {
-					stateTip,
 					stateTipColor
 				};
 			}
@@ -368,13 +426,15 @@
 		margin-bottom: 30rpx;
 		border-radius: 30rpx;
 		background: #fff;
-		color: #A8ADBF;
+		color:$font-color-light;
 
 		.i-top {
 			height: 80rpx;
-			.order-code{
+
+			.order-code {
 				font-size: $font-sm;
-				.no{
+
+				.no {
 					padding: 10rpx 10rpx;
 					background-color: #FFEAE5;
 					color: #FD5B23;
@@ -382,9 +442,10 @@
 					border-top-right-radius: 10rpx;
 					border-bottom-left-radius: 10rpx;
 					margin-right: 10rpx;
-					
+
 				}
 			}
+
 			.del-btn {
 				padding: 10rpx 0 10rpx 36rpx;
 				font-size: $font-lg;
@@ -423,16 +484,16 @@
 			}
 
 			.js {
-				color: #A8ADBF;
+				color:$font-color-light;
 			}
 		}
 
 		.kh-info {
 			font-size: 24rpx;
 			font-weight: 500;
-			color: #666666;
-			padding: 20rpx 0;
-			border-top: 1px solid #F8F8F8;
+			color:$font-color-light;
+			padding-top: 20rpx;
+			border-top: 1px solid $border-color-base;
 
 			view {
 				padding: 5rpx 0;
@@ -440,7 +501,6 @@
 
 			text {
 				font-weight: bold;
-				color: #333333;
 			}
 
 		}
@@ -480,7 +540,7 @@
 			width: 100%;
 			font-size: 24rpx;
 			font-weight: 500;
-			color: #A3A8BB;
+			color:$font-color-light;
 			line-height: 1;
 
 			.btm-right {
@@ -490,21 +550,22 @@
 			.btm-btn {
 				width: 144rpx;
 				padding: 10rpx 0;
-				border: 2px solid #ededed;
+				border: 2px solid $border-color-base;
 				border-radius: 28rpx;
 				font-size: 26rpx;
 				font-weight: 500;
 				text-align: center;
 				margin-left: 10rpx;
-				color: #999999;
+				color: $font-color-light;
 			}
 
 			.ksps {
-				border-color: #4589ec;
-				color: #4589ec;
+				border-color:$base-color;
+				color: $base-color;
 			}
 		}
 	}
+
 	.buttomBox {
 		border-radius: 20rpx;
 		margin: 0 $page-row-spacing;
@@ -512,21 +573,25 @@
 		color: $font-color-dark;
 		background-color: #FFFFFF;
 		overflow: hidden;
-	
+
+		.send {
+			text-align: center;
+		}
+
 		.item {
 			line-height: 100rpx;
 			height: 100rpx;
 			text-align: center;
 			font-size: 32rpx;
 			color: $base-color;
-	
+
 			&.qx {
 				color: $color-red;
 			}
 		}
-	
+
 		.border_b {
 			border-bottom: 1px solid $page-color-light;
 		}
 	}
-</style>
+</style>

+ 2 - 2
pages/user/money/pay.vue

@@ -54,7 +54,7 @@
 	} from '@/api/wallet.js';
 	import {
 		orderPay
-	} from '@/api/set.js';
+	} from '@/api/order.js';
 	// #ifdef H5
 	import weixinObj from "@/plugin/jweixin-module/index.js";
 	// #endif
@@ -216,7 +216,7 @@
 	}
 
 	.bg {
-		background-color: $color-green;
+		background-color: $base-color;
 		width: 950rpx;
 		position: absolute;
 		left: -100rpx;

+ 0 - 3
pages/user/money/paySuccess.vue

@@ -4,9 +4,6 @@
 			<image class="img" src="../../../static/image/success.png" mode="widthFix"></image>
 			<text class="tit">支付成功</text>
 			<view class="tip" >
-				<text v-if="type==0">
-				请前往母婴界严选加盟商一领取
-				</text>
 			</view>
 			<view class="btn-group flex">
 				<navigator v-if="type==0" :url="'/pages/order/orderDetail?id='+orderId" open-type="redirect"

BIN
static/icon/adminUserPhone.png


BIN
static/image/success.png