Quellcode durchsuchen

供应商发货

zhengjinyi vor 5 Jahren
Ursprung
Commit
5c78797ab3

+ 1 - 0
App.vue

@@ -33,6 +33,7 @@
 					console.log(e.platform)
 					if (e.platform == 'android') {
 						Vue.prototype.platformClass = 'left'
+						self.$store.dispatch('setVariableFun',false)
 					} else {
 						Vue.prototype.platformClass = 'center'
 						self.$store.dispatch('setIsIphoneFun',true)

+ 2 - 1
api/utils.js

@@ -39,6 +39,7 @@ export function queryProtocol() {
 }
 /**
  *获取图形验证码
+ * platformType:小程序 2  WWW 0  CRM 1 
  */
 export function getImageCode() {
 	return new Promise(function(resolve,reject) {
@@ -163,7 +164,7 @@ export function uploadFileImage() {
 			success: (res) => {
 				const tempFilePaths = res.tempFilePaths;
 				const uploadTask = uni.uploadFile({
-					url : requestUrl+'/formData/MultiPictareaddData',
+					url : 'https://spi-b.caimei365.com/formData/MultiPictareaddData',
 					filePath: tempFilePaths[0],
 					name: 'file',
 					header: {

+ 2 - 2
common/config/config.js

@@ -2,10 +2,10 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.1.24:8008'	 //俊俊联调地址
-	// URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.26:8008'	 //超超联调地址
     // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
-	URL_CONFIG = 'https://spi.caimei365.com'
+	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境
     URL_CONFIG = 'https://spi.caimei365.com'

+ 1 - 2
components/cm-module/modelAlert/shareAlert.vue

@@ -50,8 +50,7 @@
 			hideConfirm(){
 				this.$parent.isShareModal = false
 			},
-			//点击事件
-			btnConfirm(code){
+			btnConfirm(code){//点击事件
 				this.$emit('btnConfirm')
 			}
 		}

+ 181 - 0
components/cm-module/modelAlert/supplierShareAlert.vue

@@ -0,0 +1,181 @@
+<template name="alert">
+	<view class="alert spec" :class="specClass">
+		<!-- 运费弹窗说明 -->
+		<view class="freight-alert"  @click.stop="hideConfirm">
+			<view class="content clearfix">
+				<view class="text-content">
+					<view class="text-t">分享码</view>
+					<view class="text-c">{{shareCode}} <text class="clipboard" @click.stop="clipboard(shareCode)">复制</text></view>
+					<view class="text-h1">有效期为72小时。如果对方不是您公司的运营人员,需要输入该分享码才能查看本订单</view>
+				</view>
+				<view class="text-btn">
+					<!-- #ifdef MP-WEIXIN -->
+					<button class="btn" open-type="share" @click="btnConfirm(shareCode)">去分享</button>
+					<!-- #endif -->
+					<view class="btn-none" @click.stop="hideConfirm(shareCode)">取消</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	const thorui = require("@/components/clipboard/clipboard.thorui.js")
+	import { queryOrderShareCode } from "@/api/order.js" 
+	export default{
+		name:'alert',
+		props:{
+			shopOrderID:{
+				type:Number
+			}
+		},
+		data() {
+			return{
+				shareCode:'',
+			}
+		},
+		created() {
+			this.getShareCode(this.shopOrderID)
+		},
+		onLoad(){
+			
+		},
+		methods:{
+			getShareCode(data){
+				this.ShopService.ShopOrderShareCode({shopOrderId:data}).then(response =>{
+					this.shareCode = response.data
+					this.$parent.shareCode = this.shareCode;
+				}).catch(error =>{
+					this.$parent.isShareModal = false;
+					this.$util.modal('提示',error.msg,'确定','',false,() =>{})
+				})
+			},
+			clipboard(data) {
+				thorui.getClipboardData(data, (res) => {
+					// #ifdef H5
+					if (res) {
+						this.$util.msg("复制成功",2000);
+					} else {
+						this.$util.msg("复制失败",2000);
+					}
+					// #endif
+				})
+			},
+			hideConfirm(){
+				this.$parent.isShareModal = false
+			},
+			btnConfirm(code){//点击事件
+				this.$emit('btnConfirm')
+			}
+		},
+		onShow(){
+	
+		}
+	}
+</script>
+
+<style lang="scss">
+	/*弹窗*/
+	.model-warp.none{
+		display: none;
+	}
+	.model-warp.show{
+		display: block;
+	}
+	.freight-alert{
+		width: 100%;
+		height: 100%;
+		background: rgba(0,0,0,.5);
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 8888;
+		transition: all 0.4s;
+		&.none{
+			display: none;			
+		}
+		&.show{
+			display: block;
+		}
+		.content{
+			width: 492rpx;
+			height: 666rpx;
+			position: absolute;
+			background: url(https://img.caimei365.com/group1/M00/03/95/Cmis2F76nVaAPs9JAAHGoKa8KvY492.png) no-repeat;
+			background-size: cover;
+			left: 0;
+			right: 0;
+			bottom: 0;
+			top: 0;
+			margin: auto;
+			padding:0 24rpx 20rpx 24rpx;
+			border-radius: 12rpx;
+			.text-content{
+				width: 100%;
+				height: auto;
+				margin-top: 210rpx;
+				.text-t{
+					font-size: $font-size-28;
+					color: $text-color;
+					text-align: center;
+					line-height: 44rpx;
+				}
+				.text-c{
+					font-size: $font-size-44;
+					color: #16E17C;
+					text-align: center;
+					line-height: 80rpx;
+					position: relative;
+					.clipboard{
+						width: 84rpx;
+						height: 36rpx;
+						background: #EFEFEF;
+						text-align: center;
+						font-size: $font-size-24;
+						color: #999999;
+						border-radius: 4rpx;
+						line-height: 36rpx;
+						display: inline-block;
+						position: absolute;
+						top: 29%;
+						right: 18%;
+					}
+				}
+				.text-h1{
+					line-height: 40rpx;
+					font-size: $font-size-28;
+					color: $text-color;
+					text-align: justify;
+				}
+			}
+			.text-btn{
+				width: 100%;
+				height: auto;
+				margin-top: 40rpx;
+				.btn{
+					width: 100%;
+					height: 88rpx;
+					float: left;
+					background: $btn-confirm;
+					line-height: 88rpx;
+					font-size: $font-size-28;
+					text-align: center;
+					color: #FFFFFF;
+					border-radius: 14rpx;
+					padding: 0;
+				}
+				.btn-none{
+					width: 100%;
+					height: 88rpx;
+					float: left;
+					line-height: 88rpx;
+					font-size: $font-size-28;
+					text-align: center;
+					color: #666666;
+					padding: 0;
+				}
+			}
+		}
+	}
+	
+</style>

+ 4 - 9
components/cm-module/orderDetails/supplierDetaileButton.vue

@@ -6,7 +6,7 @@
 				<view class="tips" v-if="shareCode">分享码:{{shareCode}}</view>
 				分享订单
 			</view>	
-			<view class="btn btn-color" v-if="btnState.isRecord"  @click.stop="btnConfirm('record')">发货记录</view>
+			<view class="btn btn-color" @click.stop="btnConfirm('record')">发货记录</view>
 			<view class="btn btn-color" v-if="btnState.isDeliver"  @click.stop="btnConfirm('deliver')">发货</view>
 		</view>
 	</view>
@@ -21,7 +21,7 @@
 			},
 			shareCode:{
 				type:String,
-				default: '4564'
+				default: ''
 			}
 		},
 		watch:{
@@ -37,8 +37,7 @@
 				btnState:this.initStatus(),
 				isIphoneX:this.$store.state.isIphoneX,
 				mapStateArr:[
-					{label:'isDeliver',val:[0],status: true},
-					{label:'isRecord',val:[0,111],status: true},
+					{label:'isDeliver',val:[1,2],status: true},
 				]
 			}
 		},
@@ -53,11 +52,7 @@
 				/**
 				 * @分享按钮统一显示
 				 * @按钮根据状态显示
-				 * @(4、5、7、12、22、23、32)显示[查看物流]按钮,其他隐藏
-				 * @(6)显示[删除订单],其他隐藏
-				 * @(0、111)显示[取消订单],其他隐藏
-				 * @(21,31)只显示分享
-				 * @(13,33)显示[确认收货]和[查看物流]
+				 * @(1,2)显示[发货]按钮
 				 */
 				this.btnState = this.initStatus()
 				this.mapStateArr.forEach(el => {

+ 24 - 19
components/cm-module/productDetails/cm-parameter.vue

@@ -2,9 +2,9 @@
 	<!-- 相关参数 -->
 	<view class="cm-parameter">
 		<view class="cm-parameter-main clearfix">
-			<view class="item-tabody clearfix" v-for="(item, index) in data" :key="index" >
-				<view class="item-td">{{item.name}}</view>
-				<view class="item-tr">{{item.color}}</view>
+			<view class="item-tabody clearfix" v-for="(item, index) in product.parametersList" :key="index" >
+				<view class="item-td">{{item.paramsName}}</view>
+				<view class="item-tr">{{item.paramsContent}}</view>
 			</view>
 		</view>
 	</view>
@@ -20,53 +20,58 @@
 		},
 		data() {
 			return{
-				data:[
-					{name:'颜色',color:'白色'},
-					{name:'重量',color:'1000KG'},
-					{name:'规格',color:'12瓶/m'},
-					{name:'EEDF能量桂华技术',color:'50万次有效出光保证,量均匀,安全保证,效果'},
-					{name:'功能',color:'美白嫩肤,美白嫩肤美白嫩肤'},
-				]
+				data:[]
 			}
 		},
 		created() {
 			
 		},
 		methods:{
+			
 		},
 		
 	}
 </script>
 
-<style lang="scss">	
+<style lang="scss">
 	.cm-parameter{
-		width: 100%;
+		width: 702rpx;
 		height: auto;
 		background: #FFF;
+		margin: 0 auto;
+		padding: 24rpx 0;
 		.cm-parameter-main{
-			width: 702rpx;
-			height: auto;
-			margin: 0 auto;
+			display: flex;
+			flex: 1;
+			flex-direction: column;
+			background-color: #FFFFFF;
 			border: 1px solid #EFEFEF;
-			margin-top: 24rpx;
+			border-radius: 4rpx;
 			.item-tabody{
 				width: 100%;
 				height: auto;
-				padding:20rpx 0;
 				border-bottom: 1px solid #EFEFEF;
 				font-size: $font-size-24;
+				display: flex;
+				flex-wrap: wrap;
 				.item-td{
 					width: 238rpx;
 					float: left;
 					border-right: 1px solid #EFEFEF;
 					color: #999999;
-					text-indent: 20rpx;
+					padding:20rpx;
+					display: flex;
+					flex: 3;
+					flex-direction: column;
 				}
 				.item-tr{
 					width: 462rpx;
 					float: left;
 					color: $text-color;
-					text-indent: 20rpx;
+					padding:20rpx;
+					display: flex;
+					flex: 7;
+					flex-direction: column;
 				}
 				&:last-child{
 					border-bottom: none;

+ 31 - 2
components/cm-module/productDetails/cm-service.vue

@@ -1,7 +1,14 @@
 <template name="cm-service">
 	<!-- 服务项目 -->
 	<view class="cm-service">
-		服务项目
+		<view class="cm-service-text" v-show="product.orderInfo">
+			<view class="cm-service-title">订购方案</view>
+			<view class="cm-service-p" v-html="product.orderInfo"></view>
+		</view>
+		<view class="cm-service-text" v-show="product.serviceInfo">
+			<view class="cm-service-title">服务详情</view>
+			<view class="cm-service-p" v-html="product.serviceInfo"></view>
+		</view>
 	</view>
 </template>
 
@@ -29,7 +36,29 @@
 
 <style lang="scss">	
 	.cm-service{
-		
+		width: 702rpx;
+		height: auto;
+		background: #FFF;
+		margin: 0 auto;
+		padding: 24rpx 0;
+		.cm-service-text{
+			width: 100%;
+			height: auto;
+			margin-bottom: 24rpx;
+			.cm-service-title{
+				font-size: $font-size-28;
+				color: #333;
+				text-align: left;
+				line-height: 44rpx;
+				margin-bottom: 8rpx;
+			}
+			.cm-service-p{
+				font-size: $font-size-28;
+				color: #999;
+				text-align: justify;
+				line-height: 44rpx;
+			}
+		}
 	}
 </style>
 

+ 6 - 6
components/cm-module/productDetails/supplierDetails.vue

@@ -69,12 +69,12 @@
 				<view class="img"><image :src="shop.medicalPracticeLicenseImg3" mode="" @click="previewImg(shop.medicalPracticeLicenseImg3)"></image></view>
 			</view>
 		</view>
-		<view class="sup-msg massage-t">
+		<view class="sup-msg massage-t" v-if="shop.authorizationCertificateImage!=null">
 			<view class="sup-h1">
 				<text class="line">授权牌照</text>
 			</view>
 			<view class="sup-img">
-				<image :src="shop.businessLicenseImage" mode="widthFix" @click="previewImg(shop.businessLicenseImage)"></image>
+				<image :src="shop.authorizationCertificateImage" mode="widthFix" @click="previewImg(shop.authorizationCertificateImage)"></image>
 			</view>
 		</view>
 	</view>
@@ -150,7 +150,6 @@
 		width: 702rpx;
 		padding: 28rpx 24rpx 24rpx 24rpx;
 		display: flex;
-		margin-bottom: 24rpx;
 		background: #FFFFFF;
 		.header-img{
 			width: 216rpx;
@@ -162,10 +161,11 @@
 		}
 		.header-txt{
 			width:460rpx;
+			display: flex;
+			align-items: center;
 			text{
-				display: inline-block;
-				padding-top: 82rpx;
-				height: 80rpx;
+				display: flex;
+				flex: 1;
 				margin-left: 26rpx;
 				line-height: 40rpx;
 				-o-text-overflow: ellipsis;

+ 9 - 1
pages.json

@@ -427,17 +427,25 @@
 					"style": {
 						"navigationBarTitleText": "查看订单"
 					}
+				},{
+					"path": "pages/login/share-info",
+					"style": {
+						"navigationBarTitleText": "订单详情",
+						"navigationStyle":"custom"
+					}
 				},{
 					"path": "pages/order/order-details",
 					"style": {
 						"navigationBarTitleText": "订单详情",
+						"enablePullDownRefresh":true,
 						"navigationStyle":"custom"
 					}
 				},{
 					"path": "pages/order/order-service-details",
 					"style": {
 						"navigationBarTitleText": "订单详情",
-						"navigationStyle":"custom"
+						"navigationStyle":"custom",
+						"enablePullDownRefresh":true
 					}
 				},{
 					"path": "pages/deliver/add-logistics",

+ 3 - 1
pages/authorization/authorization.vue

@@ -37,7 +37,9 @@
 		},
 		onLoad(e) {
 			this.authorizeType = e.type
-			console.log(e)
+			if(this.authorizeType == '4'){
+				this.nvabarData.haveBack = false
+			}
 		},
 		computed: {
 			...mapState(['hasLogin','userInfo'])

+ 42 - 32
pages/goods/product.vue

@@ -66,32 +66,48 @@
 			</view>
 			<view class="product-details">
 				<!-- 头部 -->
-				<view  v-if="goodsData.isNoneDisabled" class="navbar" :class="navbarFiexd"
-					 :style="{top:headerBtnPosi.bottom + (headerBtnPosi.bottom - headerBtnPosi.height - systeminfo.statusBarHeight) +'px'}">
-					<view class="nav-item tui-skeleton-fillet" v-for="(item,index) in  disabledTabNavList" :key="index" :class="{ current: tabCurrentIndex === item.type }" @click="tabClick(index+2)">
+				<view  v-if="goodsData.isNoneDisabled" class="navbar" :class="navbarFiexd" :style="{top:headerBtnPosi.bottom + (headerBtnPosi.bottom - headerBtnPosi.height - systeminfo.statusBarHeight) +'px'}">
+					<view class="nav-item tui-skeleton-fillet" v-for="(item,index) in  disabledTabNavList" :key="index" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index+2)">
 						<text class="line"></text>
 						<text>{{item.name}}</text>
 					</view>					
 				</view>
-				<view v-else class="navbar" :class="navbarFiexd" 
-					 :style="{top:headerBtnPosi.bottom + (headerBtnPosi.bottom - headerBtnPosi.height - systeminfo.statusBarHeight) +'px'}">
-					<view class="nav-item tui-skeleton-fillet" v-for="(item,index) in  tabNavList" :key="index" :class="{ current: tabCurrentIndex === item.type }" @click="tabClick(item.type,index)">
+				<view v-else class="navbar" :class="navbarFiexd" :style="{top:headerBtnPosi.bottom + (headerBtnPosi.bottom - headerBtnPosi.height - systeminfo.statusBarHeight) +'px'}">
+					<view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 0 }" @click="tabClick(0)">
+						<text>商品详情</text>
 						<text class="line"></text>
-						<text>{{item.name}}</text>
-					</view>					
+					</view>
+					<view class="nav-item tui-skeleton-fillet" 
+						  :class="{ current: tabCurrentIndex === 1 }" 
+						  @click="tabClick(1)" 
+						  v-if="product.parametersList != ''">
+							<text>相关参数</text>
+							<text class="line"></text>
+					</view>	
+					<view class="nav-item tui-skeleton-fillet" 
+					      :class="{ current: tabCurrentIndex === 2 }" 
+						  @click="tabClick(2)" 
+						  v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo">
+							<text>服务项目</text>
+							<text class="line"></text>
+					</view>	
+					<view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 3 }" @click="tabClick(3)">
+						<text>相关推荐</text>
+						<text class="line"></text>
+					</view>	
 				</view>
-				<!-- 商品详情,供应商详情展示,相关推荐,评价-->
-				<view class="content tui-banner tui-skeleton-rect" v-if="tabCurrentIndex === 'details'">
+				<!-- 商品详情,相关参数,服务项目,相关推荐-->
+				<view class="content tui-banner tui-skeleton-rect" v-if="tabCurrentIndex === 0">
 					<parser :html="html" :img-mode="widthFix"></parser>
 				</view>
-				<view class="content hot" v-if="tabCurrentIndex === 'hot'">
-					<recommend :query-productid="product.productID" v-if="isRecommend"></recommend>
+				<view class="content param"  v-if="tabCurrentIndex === 1">
+					<cm-parameter :product="product" v-if="isRarameter"></cm-parameter>
 				</view>
-				<view class="content param" v-if="tabCurrentIndex === 'param'">
-					<cm-parameter :query-productid="product.productID" v-if="isRarameter"></cm-parameter>
+				<view class="content service" v-if="tabCurrentIndex === 2">
+					<cm-service :product="product.productDetail" v-if="isService"></cm-service>
 				</view>
-				<view class="content service" v-if="tabCurrentIndex === 'service'">
-					<cm-service :query-productid="product.productID" v-if="isService"></cm-service>
+				<view class="content hot" v-if="tabCurrentIndex === 3">
+					<recommend :query-productid="product.productID" v-if="isRecommend"></recommend>
 				</view>
 			</view>
 			<!-- 底部按钮 -->
@@ -198,12 +214,6 @@
 		data(){
 			return{			
 				html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
-				tabNavList:[
-					{name:'商品详情',type:'details'},
-					{name:'相关参数',type:'param'},
-					{name:'服务项目',type:'service'},
-					{name:'相关推荐',type:'hot'},
-				],
 				disabledTabNavList:[{name:'相关推荐'}],
 				mode:'round',
 				specClass: '',//规格弹窗css类,控制开关动画
@@ -225,7 +235,7 @@
 				isStock:false,
 				disabled:false,
 				isNoneDisabled:false,
-				tabCurrentIndex:'param',
+				tabCurrentIndex:0,
 				userID:'',
 				productID:0,
 				userIdentity:'',//用户类型
@@ -305,13 +315,13 @@
 					if(this.product.validFlag =='3' || this.stock == 0 ){
 						this.disabled = true
 						this.isNoneDisabled = true
-						this.tabCurrentIndex = 'hot';// 页面显示是默认选中第一
+						this.tabCurrentIndex = 2;// 页面显示是默认选中第一
 						this.isRecommend = true
 						this.goodsData.disabledText = '下架'
 					}else{
 						this.disabled = false
 						this.isNoneDisabled = false
-						this.tabCurrentIndex = 'details';// 页面显示是默认选中第三
+						this.tabCurrentIndex = 0;// 页面显示是默认选中第三
 						this.goodsData.disabledText = ''
 					}
 					if(this.product.price1TextFlag == "1"){
@@ -350,18 +360,18 @@
 					longPressActions:''
 				})
 			},
-			tabClick(type,index) {//商品详情&&供应商信息tab切换
-				this.tabCurrentIndex = type;
+			tabClick(index) {//商品详情&&供应商信息tab切换
+				this.tabCurrentIndex = index;
 				switch(this.tabCurrentIndex){
-					case 'hot':
-						this.isRecommend = true
-						break;
-					case 'param':
+					case 1:
 						this.isRarameter = true
 						break;
-					case 'service':
+					case 2:
 						this.isService = true
 						break;
+					case 3:
+						this.isRecommend = true
+						break;
 				}
 			},
 			handleContact(e){//跳转小程序客服

+ 7 - 2
pages/tabBar/home/home.vue

@@ -209,8 +209,7 @@
 			}
 		},
 		onLoad() {
-			this.getHomeInformation()
-			this.getOrganizeProducts()
+			
 		},
 		computed: {
 			...mapState(['hasLogin','userInfo','isWxAuthorize'])
@@ -232,6 +231,9 @@
 							uni.setStorageSync('sessionid','JSESSIONID='+response.data.sessionId)
 							if(response.data.userIdentity ==1){
 								this.$api.navigateTo('/seller/pages/index/index')
+							}else{
+								this.getHomeInformation()
+								this.getOrganizeProducts()
 							}
 						}).catch(error =>{
 							this.isLogin = false;
@@ -358,6 +360,9 @@
 			authorize.getSetting().then(res =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
 				if(res == 1){
 					this.getWxAuthorize()
+				}else{
+					this.getHomeInformation()
+					this.getOrganizeProducts()
 				}
 			})			
 		}

+ 2 - 4
pages/user/address/address.vue

@@ -117,8 +117,7 @@
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			//选择地址
-			checkAddress(item){
+			checkAddress(item){//选择地址
 				//是否需要返回地址(从订单确认页跳过来选收货地址)
 				if(!this.isSelect){return ;}
 				uni.setStorageSync('selectAddress',item)
@@ -132,8 +131,7 @@
 					url: `/pages/user/address/addressManage?type=${type}&data=${JSON.stringify(item)}`
 				})
 			},
-			//删除收货地址
-			deleteAddress(id){
+			deleteAddress(id){//删除收货地址
 				this.$util.modal('','确定要删除该地址?','确定','取消',true,() =>{
 					deleteNewAddress({addressID:id,userID:this.userID}).then(response =>{
 						this.$util.msg('删除成功',2000,true,'success')

+ 1 - 1
pages/user/order/create-order.vue

@@ -293,7 +293,7 @@
 						payInfo:this.payInfo,	//订单信息
 						orderInvoice:this.invoiceData
 					}
-					console.log(param)
+					// console.log(param)
 					debugger
 				this.modalLayer = true;	
 				createOrderSubmit({'params':JSON.stringify(param)}).then(response =>{

+ 2 - 2
services/ajax.env.js

@@ -2,9 +2,9 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.1.24:8008'	 //俊俊联调地址
-	// URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.26:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 10 - 25
services/ajax.service.js

@@ -11,26 +11,13 @@ class AjaxService {
 	getBaseUrl (url = '') {
 		return url.indexOf('://') > -1 ? url : baseUrl + url
 	}
-	getStorageUser(){
-		let userInfo =''
-		uni.getStorage({
-			key: 'userInfo',
-			success: function (res){
-				userInfo = res.data
-			}
-		})
-		return userInfo
-	}
 	getHeaders({ header = {} }) {
-		const GET_LOGIN_STAUS = this.getStorageUser();
-		console.log(GET_LOGIN_STAUS)
-		let REV_TOKEN_ENV='';
-		if (GET_LOGIN_STAUS != null) {
-			REV_TOKEN_ENV = GET_LOGIN_STAUS.token
-		}else{
-			REV_TOKEN_ENV = 'X-token'
-		}
-		header['authorization'] = REV_TOKEN_ENV
+		const REV_TOKEN_ENV = uni.getStorageSync('token') ? uni.getStorageSync('token') : 'X-token';
+		const REV_COOKIE_ENV = uni.getStorageSync('sessionid') ? uni.getStorageSync('sessionid') : 'sessionid';
+		header['Accept'] = 'application/json'
+		header['Content-Type'] = 'application/x-www-form-urlencoded'
+		header['X-Token'] = REV_TOKEN_ENV
+		header['cookie'] = REV_COOKIE_ENV
 		return header
 	}
 	request(options = {}) {
@@ -43,9 +30,7 @@ class AjaxService {
 			isLoading = true
 		} = options
 		if (isLoading) {
-			wx.showLoading({
-				title: '加载中'
-			})
+			wx.showLoading({ title: '加载中' })
 		}
 		const requestPromise = new Promise((resolve, reject) => {
 			uni.request({
@@ -55,7 +40,7 @@ class AjaxService {
 				header,
 				success: res => {
 					if (isLoading) wx.hideLoading();
-					if (res.data.code === 1) {
+					if (res.data.code === 0) {
 						resolve(res.data)
 					} else {
 						reject(res.data)
@@ -63,7 +48,7 @@ class AjaxService {
 				},
 				fail: error => {
 					reject(error)
-					msg(error)
+					// msg(error)
 					wx.hideLoading()
 				}
 			})
@@ -75,8 +60,8 @@ class AjaxService {
 		return this.request(options)
 	}
 	post(options) {
+		options.method = 'POST'
 		return this.request(options)
 	}
-
 }
 export default new AjaxService()

+ 1 - 4
services/common.service.js

@@ -6,8 +6,5 @@ export default class CommonService {
 		Object.assign(this, { AjaxService })
 		this.name = 'CommonService'
 	}
-	/* 扫码后去快递信息 */
-	getExpressInformation (data = {}) {
-		return this.AjaxService.get({ url:'https://www.kuaidi100.com/autonumber/autoComNum', data, isLoading: false })
-	}
+	
 }

+ 32 - 0
services/shop.service.js

@@ -6,4 +6,36 @@ export default class ShopService {
 		Object.assign(this, { AjaxService })
 		this.name = 'ShopService'
 	}
+	/* 小程序发货-权限控制 */
+	MiniShipments (data = {}) {
+		return this.AjaxService.post({ url:'/supplier/miniShipments', data, isLoading: true })
+	}
+	/* 小程序发货-查询供应商子订单详情 */
+	GetShopOrderDetails (data = {}) {
+		return this.AjaxService.get({ url:'/supplier/shopOrderDetails', data, isLoading: true })
+	}
+	/* 小程序发货-绑供应商运营人员 */
+	BindShopOperator (data = {}) {
+		return this.AjaxService.post({ url:'/supplier/shopBindingWx', data, isLoading: true })
+	}
+	/* 小程序发货-供应商订单详情获取订单分享码 */
+	ShopOrderShareCode (data = {}) {
+		return this.AjaxService.post({ url:'/supplier/shopShareShipments', data, isLoading: false })
+	}
+	/* 小程序发货-供应商订单发货商品查询 */
+	ShopOrderShipmentsInfo (data = {}) {
+		return this.AjaxService.get({ url:'/supplier/shipmentsInfo', data, isLoading: true })
+	}
+	/* 小程序发货-物流公司查询 */
+	GetLogisticsCompany (data = {}) {
+		return this.AjaxService.get({ url:'/supplier/logisticsCompany', data, isLoading: true })
+	}
+	/* 小程序发货-扫码获取物流公司信息 */
+	GetExpressInformation (data = {}) {
+		return this.AjaxService.get({ url:'/supplier/scanLogistics', data, isLoading: false })
+	}
+	/* 小程序发货-确认发货 */
+	ShopAddLogistics (data = {}) {
+		return this.AjaxService.post({ url:'/supplier/addLogistics', data, isLoading: false })
+	}
 }

+ 1 - 0
store/index.js

@@ -70,6 +70,7 @@ const store = new Vuex.Store({
 		setChangeVar(state,variable){
 			//获取设备信息是否为IphoneX
 			state.isIphoneX = variable;
+			console.log(state.isIphoneX);
 		},
 		setIsIphone(state,variable){
 			//获取设备信息是否为IphoneX

+ 109 - 26
supplier/pages/deliver/add-logistics.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="container logistics" :style="{paddingBottom :isIphoneX ? (236+68)+'rpx' : '236rpx'}">
+	<view class="container logistics" :style="{paddingBottom :isIphoneX ? (236+68)+'rpx' : '236rpx'}" v-if="isChange">
 		<view class="logistics-list" v-for="(item,index) in logisticsList" :key="index">
 			<view class="item-title">
 				<view class="title-left">物流{{index+1}}</view>
@@ -8,14 +8,14 @@
 				</view>
 			</view>
 			<view class="item-main">
-				<view class="item-main-cell" @click.stop="pageNavigateTo">
-					<input class="input" type="text" v-model="item.name" placeholder="物流公司" disabled="true">
+				<view class="item-main-cell" @click.stop="pageNavigateTo(index)">
+					<input class="input" type="text" v-model="item.label" placeholder="物流公司" disabled="true">
 					<text class="iconfont icon-xiayibu"></text>
 				</view>
 				<view class="item-main-cell">
 					<input class="input" type="text" v-model="item.number" placeholder="物流单号">
 				</view>
-				<view class="item-main-cell none" @click.stop="AddScanCode" >
+				<view class="item-main-cell none" @click.stop="AddScanCode(item)" >
 					<text class="iconfont icon-icon-test" ></text><text>扫码录入</text>
 				</view>
 			</view>
@@ -33,7 +33,7 @@
 				<view class="label">拍照备注</view>
 				<view class="remarks-photo clearfix">
 					<view class="photo-item" v-for="(item, index) in photoLists" :key="index">
-						<image :src="item" mode="aspectFill" @click="previewImg(index)"></image>
+						<image :src="item" mode="aspectFill" @click.stop="previewImg(index)"></image>
 						<text class="iconfont icon-iconfontguanbi" @click.stop="deletePhotoFn(index)"></text>
 					</view>
 					<view class="photo-item add" @click.stop="uploadPhotoFn" v-if="photoLists.length<10">
@@ -42,7 +42,7 @@
 				</view>
 				<view class="label">文字备注</view>
 				<view class="remarks-textarea">
-					<textarea class="textarea" v-model="contentText" value="" placeholder="文字备注,200字以内" maxlength="200" @input="conInput"/>
+					<textarea class="textarea" v-model="info.note" value="" placeholder="文字备注,200字以内" maxlength="200" @input="conInput"/>
 					<text class="limit-text"><text class="red">{{min}}</text>/{{max}}</text>
 				</view>
 				<view class="remarks-tips">请备注快递单、发货现场和货物的照片,最多10张</view>
@@ -62,20 +62,41 @@
 			return{
 				userID:'',
 				isIphoneX:this.$store.state.isIphoneX,
+				isChange:true,
 				isShowRemarks:false,
 				specClass:'',
 				photoLists:[],
+				checkLogicsIndex:0,
+				selectID:0,
+				info:{
+					image:'',
+					note:'',
+					shopOrderId:''
+				},//备注信息
+				record:[],//子订单商品信息
 				logisticsList:[{
-					name:'',
-					number:''
+					label:'',
+					number:'',
+					value:'',
 				}],
-				contentText:'',
 				min:0,
 				max:200
 			}
 		},
+		watch: {
+			logisticsList: {
+				handler: function (el) {//监听对象的变换使用 function,箭头函数容易出现this指向不正确
+				console.log(el)
+					this.logisticsList = el
+				},
+				deep: true
+			}
+		},
 		onLoad(option) {
-			
+			// console.log(option)
+			this.info.shopOrderId = option.shopOrderId;
+			this.record = JSON.parse(option.data)
+			// console.log(this.record)
 		},
 		methods:{
 			...mapMutations(['login']),
@@ -84,20 +105,22 @@
 				uni.scanCode({
 				    onlyFromCamera: true,
 				    success: function (res) {
-				        console.log(res);
-						item.name=res.scanType
-						item.number=res.result
-						self.CommonService.getExpressInformation({resultv2:2,text:res.result}).then(response =>{
+				        // console.log('条码内容:' + res.result); 
+						item.number= res.result
+						self.ShopService.GetExpressInformation({number:res.result}).then(response =>{
 							console.log(response)
+							item.label= response.data.label
+							item.value= response.data.value
+							self.selectID = response.data.id
+						}).catch(error =>{
+							self.$util.msg(error.msg,2000);
 						})
-				        console.log('条码类型:' + res.scanType);
-				        console.log('条码内容:' + res.result);
 				    }
 				});
 			},
 			addListFn(){
 				this.isShowRemarks = false
-				let obj ={name:'',number:''};
+				let obj ={name:'',number:'',value:''};
 				this.logisticsList.push(obj)
 			},
 			deleteLogistItemFn(item,index){
@@ -105,10 +128,13 @@
 					this.logisticsList.splice(index, 1);
 				})
 			},
-			pageNavigateTo(){
-				this.$api.navigateTo('/supplier/pages/deliver/logistics-list')
+			pageNavigateTo(index){//选择物流公司
+				this.isChange = false
+				this.checkLogicsIndex = index
+				console.log(this.checkLogicsIndex)
+				this.$api.navigateTo(`/supplier/pages/deliver/logistics-list?selectID=${this.selectID}`)
 			},
-			showShowRemarksFn(){
+			showShowRemarksFn(){//显示发货备注
 				this.isShowRemarks = !this.isShowRemarks 
 				if(this.isShowRemarks){
 					this.specClass = 'show';
@@ -116,14 +142,61 @@
 					this.specClass = 'hide';
 				}
 			},
-			uploadPhotoFn(){
+			uploadPhotoFn(){//添加发货备注图片
 				uploadFileImage().then(res =>{
 					this.photoLists.push(JSON.parse(res.data).data)
 				})
 			},
-			deletePhotoFn(index){
+			deletePhotoFn(index){//删除发货备注图片
 				this.photoLists.splice(index, 1);
 			},
+			confirmDeliverFn(){//确认发货
+				console.log(this.logisticsList)
+				if(this.logisticsList[0].label == ''){
+					this.$util.msg('请选择物流公司',2000);
+					return
+				}
+				if(this.logisticsList[0].number == ''){
+					this.$util.msg('请输入物流单号',2000);
+					return
+				}
+				//统一处理物流单号
+				let logisticsObj = {}
+				let logisticsArray = []
+				let map = new Map()
+				this.logisticsList.forEach(el =>{
+					if(map.get(el.number)!== el.number){
+						logisticsObj = {
+							number:el.number,
+							logisticsCompanyName:el.label,
+							logisticsCompanyCode:el.value
+						}
+						logisticsArray.push(logisticsObj)
+					}else{
+						this.$util.msg('物流单号重复',2000);
+						return
+					}
+				})
+				//统一处理备注图片
+				this.photoLists.forEach(el =>{
+					this.info.image+=el+'##'
+				})
+				let params = {
+						logistics:logisticsArray,
+						record:this.record,
+						info:this.info
+					}
+				console.log(params)
+				this.ShopService.ShopAddLogistics({params:JSON.stringify(params)}).then(response =>{
+					console.log(response)
+					this.$util.msg('发货成功',2000,true,'success')
+					setTimeout(()=>{
+						this.$api.navigateTo(`/supplier/pages/deliver/deliver-record`)
+					},2000)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			},
 			previewImg (index) {//顶部商品图片预览
 				isPreviewImg = true
 				let previewUrls = this.photoLists
@@ -144,10 +217,20 @@
 			}
 		},
 		onShow() {
-			this.$api.getStorage().then((resolve) => {
-				this.userID = resolve.userID
-				this.bindMobile = resolve.bindMobile
-			})
+			let pages = getCurrentPages();
+			let currPage = pages[pages.length-1];
+			if(currPage.data.select =='select'){
+				let SelectData = uni.getStorageSync('selectLogics')
+				this.selectID = SelectData.id
+				let setNewLogisticsList = this.logisticsList
+				setNewLogisticsList.forEach((el,index,arr) =>{
+					if(index == this.checkLogicsIndex ){
+						arr[this.checkLogicsIndex] = Object.assign({},arr[this.checkLogicsIndex],SelectData)
+					}
+				})
+				this.logisticsList = setNewLogisticsList
+			}
+			this.isChange = true
 		}
 	}
 </script>

+ 70 - 133
supplier/pages/deliver/deliver-goods.vue

@@ -11,20 +11,21 @@
 								<view class="checkbox-box">
 									<button class="checkbox iconfont" :class="[pros.checked ?'icon-gouxuanl':'icon-weigouxuan']"></button>
 								</view>
-								<view class="pros-img"><image :src="pros.mainImage ? pros.mainImage:''" alt="" /></view>
+								<view class="pros-img"><image :src="pros.productImage ? pros.productImage:''" alt="" /></view>
 								<view class="pros-product">
 									<view class="producttitle">{{pros.name}}</view>
 									<view class="productspec">规格:{{pros.productUnit ? pros.productUnit : ''}}</view>
-									<view class="productspec">商品编码:{{pros.productCode ? pros.productCode : ''}}</view>
+									<view class="productspec">商品编码:{{pros.productNo ? pros.productNo : ''}}</view>
 									<view class="product-view">
-										<view class="view-num">数量:{{pros.num}}</view>
+										<view class="view-num">数量:{{pros.num+pros.presentNum}}</view>
 									</view>
 									<view class="product-view">
-										<view class="view-num">已发货:{{pros.taxRate}}</view>
-										<view class="view-num">未发货:{{pros.discount == null ? '0' : pros.discount}}</view>
+										<view class="view-num">已发货:{{pros.shipmentsNum}}</view>
+										<view class="view-num">未发货:{{pros.notOutStore-pros.actualCancelNum}}</view>
 									</view>
 									<view class="product-view">
-										<view class="view-num">已退货:{{pros.discountPrice}}</view>
+										<view class="view-num">已退货:{{pros.returnedNum}}</view>
+										<view class="view-num">已取消:{{pros.actualCancelNum}}</view>
 									</view>
 								</view>	
 							</view>
@@ -33,9 +34,9 @@
 									<view class="text">本次发货</view>
 									<view class="count">
 										<view class="number-box">
-											<view  class="iconfont icon-jianhao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(pros)"></view>
-											<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,pros)">
-											<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(pros)"></view>
+											<view  class="iconfont icon-jianhao" :class="[pros.isReduceNum ? 'disabled':'']" @click="changeCountSub(pros)"></view>
+											<input class="btn-input" type="number" maxlength='4' v-model="pros.shipmentCount" @blur="changeNnmber($event,pros)">
+											<view  class="iconfont icon-jiahao"  :class="[pros.isPlusNum ?'disabled':'']" @click="changeCountAdd(pros)"></view>
 										</view>
 									</view>
 								</view>
@@ -62,7 +63,6 @@
 <script>
 	import authorize from '@/common/config/authorize.js'
 	import { mapState,mapMutations } from 'vuex';
-	import { queryShoppingCartList,shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js" 
 	
 	export default{
 		data(){
@@ -70,36 +70,10 @@
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				isIphoneX:this.$store.state.isIphoneX,
 				userID:'',
+				shopOrderId:'',
 				alertType:'',
-				isStock:'',
-				productsList:[
-					{
-						mainImage:'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
-						name:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德',
-						productUnit:'盒',
-						productCode:'FXSW2131231231',
-						num:20,
-						taxRate:5,
-						discount:5,
-						discountPrice:3,
-						productCount:6,
-						price:'200.00',
-						checked:false
-					},{
-						mainImage:'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
-						name:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德',
-						productUnit:'盒',
-						productCode:'FXSW2131231231',
-						num:20,
-						taxRate:5,
-						discount:5,
-						productCount:6,
-						discountPrice:3,
-						price:'200.00',
-						checked:false
-					}
-				],	//购物车的商品
-				setGoodData:'', //确认订单的商品
+				productsList:[],//发货的商品
+				setGoodData:'', //提交发货的商品
 				isCheckAll:false,//是否全选
 				isModallayer:false,
 				isDisabled: false, // 供应商/店铺全选是否禁用状态
@@ -108,34 +82,39 @@
 		},
 		onLoad(option){
 			console.log(option)
-			// this.initGetCartGoodsList();
+			this.shopOrderId = option.shopOrderId
+			this.initShopOrderShipmentsInfo();
 		},
 		computed: {
 			...mapState(['hasLogin','userInfo'])
 		},
 		methods:{
-			initGetCartGoodsList(){//初始化购物车 index:1
-				let params = {userID:this.userID}
-				queryShoppingCartList(params).then(response =>{
-					this.$store.commit('updateAllNum',response.data.cartQuantity)
-					const responseData = response.data
-					if(responseData.pageDate && responseData.pageDate.length > 0 ){
-						this.productsList = responseData.pageDate;
-						this.productsList.forEach((item,index) => {
-							let productsListLength = item.productsList.length,
-								invalidLength = 0;
-							item.productsList.forEach(pros => {
-								pros.shopID = item.shopID;
-								if(pros.validFlag == '3' ) {invalidLength++;}
-							})
-							item.isDisabled = invalidLength === productsListLength;
-						})
-					} else {
-						this.productsList = [];
-					}
+			initShopOrderShipmentsInfo(){//初始化购物车 index:1
+				this.ShopService.ShopOrderShipmentsInfo({ shopOrderId : this.shopOrderId }).then(response =>{
+					let orderProductList = response.data.orderProductList
+					let elObject = {}
+					let isReduceNum = false
+					let creatProductList = []
+					orderProductList.forEach(el =>{
+						let uninNum = el.notOutStore - el.actualCancelNum//未发货数量
+						if(uninNum == 1){
+							isReduceNum = true
+						}else{
+							isReduceNum = false
+						}
+						elObject = {
+							shipmentCount:uninNum,
+							isReduceNum:isReduceNum,
+							checked:false
+						}
+						creatProductList.push(Object.assign({},el,elObject))
+					})
+					this.productsList = creatProductList
+					console.log(this.productsList)
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
+				
 			},		
 			ischeck(pro){//为未选中的时候改变为true,反之为true
 				pro.checked = !pro.checked;
@@ -158,102 +137,57 @@
 			    this.isCheckAll = !this.isCheckAll;
 				this.updateBothCheckBtn();     
 			},
-			changeCountAdd(item,pros){//商品数量加加
-				if(pros.productCount == pros.stock){
-					pros.productCount= pros.stock
-					this.isStock =true
+			changeCountAdd(pros){//商品数量加加
+				let uninNum = pros.notOutStore-pros.actualCancelNum//未发货数量
+				if(pros.shipmentCount == uninNum){
+					this.isNoneNum =true
 					return
 				}else{
-					pros.productCount++
-					this.isStock =false
+					pros.shipmentCount++
+					this.isNoneNum =false
 				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
 			},
-			changeCountSub(item,pros){//商品数量减减
-				if(pros.productCount<=pros.minBuyNumber){
-					pros.productCount= pros.minBuyNumber
-					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
+			changeCountSub(pros){//商品数量减减
+				let uninNum = pros.notOutStore-pros.actualCancelNum//未发货数量
+				if(pros.shipmentCount == 1){
+					pros.shipmentCount = pros.shipmentCount
 					return
 				}else{
-					pros.productCount--
+					pros.shipmentCount--
 				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
 			},
 			changeNnmber(e,pros){//输入商品数量更新
+				let uninNum = pros.notOutStore-pros.actualCancelNum//未发货数量
 				let _value = e.detail.value;
-				if(!this.$api.isNumber(_value)){
-					pros.productCount = pros.minBuyNumber
-				}else if(_value < pros.minBuyNumber){	
-					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
-					pros.productCount = pros.minBuyNumber
+				if(!this.$api.isNumber(_value) || uninNum == 1){
+					pros.shipmentCount = uninNum
+				}else if(_value > uninNum){	
+					pros.shipmentCount = uninNum
 				}else{
-					pros.productCount = e.detail.value
+					pros.shipmentCount = e.detail.value
 				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
 			},
-			updateShoppogNum(pros){//加减购物车商品更新到后台
-				let params ={userID:this.userID,productID:pros.productID,productCount:pros.productCount}
-				shoppingCartUpdate(params).then(response =>{
-					this.isshowDelbtn = false;
-					this.initGetCartGoodsList();
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
-				})
-			 },
 			toConfirmDeliver(){//添加物流页面
-				this.$api.navigateTo(`/supplier/pages/deliver/add-logistics`)
-				return
-				let setGoodsList=[];
-				this.goodsList.forEach(res=>{
-					let products = res.productsList
-					products.forEach(pros=>{
-						if(pros.productsChecked){
-						    setGoodsList.push(pros.productID)
+				let setProductList=[];
+				this.productsList.forEach(el=>{
+					if(el.checked){
+						let elObject = {
+								orderProductId:el.orderProductID.toString(),
+								num:el.shipmentCount.toString()
 						}
-					})
+						setProductList.push(elObject)
+					}
 				})
-				if(setGoodsList == ''){
-					this.$util.msg("请先选择结算商品~",2000);
+				if(setProductList == ''){
+					this.$util.msg("请先选择商品~",2000);
 					return
 				}else{
-					this.isNoConfim = false
-					this.goodsList.forEach(el=>{
-						el.productsList.forEach(pros=>{
-							if(pros.productsChecked){
-							   if(pros.productCount<pros.minBuyNumber){
-								   this.isNoConfim = true
-							   }
-							}
-						})
-					})
-					if(this.isNoConfim){
-						this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
-						return;
-					}else{
-						let productID = '';
-						this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
-							el.productsList.forEach(pros=>{
-								if(pros.productsChecked){
-								   productID += pros.productID+','
-								}
-							})
-						})
-						let cartPramsData={
-								allPrice:this.allPrice,
-								allCount:this.allCount,
-								productID:productID.substring(0,productID.lastIndexOf(',')),
-								productCount:''
-						    }
-						this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
-					}
+					this.$api.navigateTo(`/supplier/pages/deliver/add-logistics?shopOrderId=${this.shopOrderId}&data=${JSON.stringify(setProductList)}`)
 				}
 			},
 		},
 		onPullDownRefresh() {//下拉刷新
-			// this.initGetCartGoodsList()
+			// this.initShopOrderShipmentsInfo()
 			// uni.stopPullDownRefresh()
 		},
 		onShow(){
@@ -385,6 +319,9 @@
 							text-align: center;
 							line-height: 48rpx;
 							font-weight: bold;
+							&.disabled{
+								color: #999999;
+							}
 						}
 						.btn-input{
 							width: 62rpx;

+ 1 - 0
supplier/pages/deliver/deliver-record.vue

@@ -73,6 +73,7 @@
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				isIphoneX:this.$store.state.isIphoneX,
 				userID:'',
+				shopOrderId:'',
 				alertType:'',
 				isStock:'',
 				lgisList:['ST465464646','SF656565656','YD12541545454'],

+ 23 - 34
supplier/pages/deliver/logistics-list.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container logistics clearfix"> 
-		<view class="list-cell-item" :class="isACtive ? 'active' : ''" v-for="(item,index) in companyList" :key="index" >
-			<view class="item-name">{{item.name}}</view>
+		<view class="list-cell-item" :class="selectID == item.id  ? 'active' : ''" v-for="(item,index) in companyList" :key="item.id" @click="checkLogics(item)">
+			<view class="item-name">{{item.label}}</view>
 			<view class="item-icon"><text class="iconfont icon-gou"></text></view>
 		</view>
 	</view>
@@ -16,53 +16,42 @@
 			return{
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				isIphoneX:this.$store.state.isIphoneX,
-				isACtive:true,
-				companyList:[
-					{name:'顺丰快递'},
-					{name:'申通快递'},
-					{name:'韵达快递'},
-					{name:'圆通快递'},
-					{name:'中通快递'},
-					{name:'德邦物流'},
-					{name:'菜鸟裹裹'}
-				]
+				isACtive:false,
+				companyList:[],
+				selectID:'',
 			}
 		},
 		onLoad(option){
 			console.log(option)
-			// this.initGetCartGoodsList();
+			this.selectID = option.selectID
+			this.initGetLogisticsCompany();
 		},
 		computed: {
 			...mapState(['hasLogin','userInfo'])
 		},
 		methods:{
-			initGetCartGoodsList(){//初始化购物车 index:1
+			initGetLogisticsCompany(){//初始化购物车 index:1
 				let params = {userID:this.userID}
-				queryShoppingCartList(params).then(response =>{
-					this.$store.commit('updateAllNum',response.data.cartQuantity)
-					const responseData = response.data
-					if(responseData.pageDate && responseData.pageDate.length > 0 ){
-						this.productsList = responseData.pageDate;
-						this.productsList.forEach((item,index) => {
-							let productsListLength = item.productsList.length,
-								invalidLength = 0;
-							item.productsList.forEach(pros => {
-								pros.shopID = item.shopID;
-								if(pros.validFlag == '3' ) {invalidLength++;}
-							})
-							item.isDisabled = invalidLength === productsListLength;
-						})
-					} else {
-						this.productsList = [];
-					}
+				this.ShopService.GetLogisticsCompany({}).then(response =>{
+					console.log(response)
+					this.companyList = response.data
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
-			},		
+			},	
+			checkLogics(item){//选择物流
+				//是否需要返回地址(从订单确认页跳过来选收货地址)
+				console.log(item)
+				uni.setStorageSync('selectLogics',item)
+				var pages = getCurrentPages();
+				var prevPage = pages[pages.length - 2];  //上一个页面	
+					prevPage.setData({select:'select'})
+				uni.navigateBack();
+			}
 		},
 		onPullDownRefresh() {//下拉刷新
-			// this.initGetCartGoodsList()
-			// uni.stopPullDownRefresh()
+			this.initGetLogisticsCompany()
+			uni.stopPullDownRefresh()
 		},
 		onShow(){
 			

+ 19 - 16
supplier/pages/login/bind-operator.vue

@@ -61,7 +61,7 @@
 			</view>
 		</view>
 		<view class="login-form clearfix">
-			<view class="login-btn"  @click="bindWechatInfo">绑定并登录</view>
+			<view class="login-btn"  @click="bindWechatInfo">绑定</view>
 		</view>
 	</view>
 </template>
@@ -70,13 +70,12 @@
 	import { mapState,mapMutations } from 'vuex'
 	import authorize from '@/common/config/authorize.js' 
 	import wxLogin from "@/common/config/wxLogin.js"
-	import { bindingWechat } from "@/api/use.js"
-	import { getImageCode, getbindWechatCode } from "@/api/utils.js"
+	import { getImageCode, getbindOperatorCode } from "@/api/utils.js"
 	export default{
 		data() {
 			return{
+				shopOrderId:'',
 				userID:'',
-				bindMobile:'',
 				bindLinkName:'',  		//供应商联系人姓名
 				bindLinkPhone:'',  		//用户手机号
 				mobildeCode:'',  		//手机验证码
@@ -87,9 +86,14 @@
 				count: '',				//倒计时
 				mobileCodeText: '获取验证码',
 				codeTime: null,
+				bind_supplierInfo:{}
 			}
 		},
 		onLoad(option) {
+			this.shopOrderId = option.shopOrderId
+			console.log(this.shopOrderId);
+			this.bind_supplierInfo = uni.getStorageSync('bind_supplierInfo');
+			console.log(this.bind_supplierInfo);
 			this.getVerificationCode()
 		},
 		methods:{
@@ -137,14 +141,14 @@
 					return
 				}
 				let params = {
+						userId:this.bind_supplierInfo.userId,
 						mobile:this.bindLinkPhone,
-						mobileOrEmail:this.bindMobile,
 						platformType:2,
 						imgCode:this.imageCode,
 						token:this.imageCodetoken,
-				}
+					}
 				this.isMobileDisabled = true;
-				getbindWechatCode(params).then(res =>{
+				getbindOperatorCode(params).then(res =>{
 					const TIME_COUNT = 60;
 					this.$util.msg('验证短信已发送',2000)
 			     	if (!this.codeTime) {
@@ -173,19 +177,21 @@
 						this.isUserInfo = false;
 						this.userInfo = res.userInfo;
 						let params ={
-								userID:this.userID,
+								userID:this.bind_supplierInfo.userId,
 								mobile:this.bindLinkPhone,
 								linkName:this.bindLinkName,
 								verificationCode:this.mobildeCode,
 								nickName:res.userInfo.nickName,
 								headimgurl:res.userInfo.avatarUrl,
+								openid:this.bind_supplierInfo.openid,
+								shopID:this.bind_supplierInfo.shopId,
+								unionId:this.bind_supplierInfo.unionId
 						}
-						// console.log(params)
-						bindingWechat(params).then(response =>{
-							this.$api.switchTabTo('/pages/tabBar/user/user')
+						this.ShopService.BindShopOperator(params).then(response =>{
+							this.$api.navigateTo(`/supplier/pages/order/order-details?shopOrderId=${this.shopOrderId}`)
 						}).catch(error =>{
 							this.$util.msg(error.msg,2000)
-						})							
+						})	
 					}
 				})
 			},
@@ -195,10 +201,7 @@
 			}
 		},
 		onShow() {
-			this.$api.getStorage().then((resolve) => {
-				this.userID = resolve.userID
-				this.bindMobile = resolve.bindMobile
-			})
+			
 		}
 	}
 </script>

+ 129 - 0
supplier/pages/login/share-info.vue

@@ -0,0 +1,129 @@
+<template>
+	<view class="container share" v-if="isRequest">
+		<view class="share-empty">
+			<view class="icon"><image :src="imagePath" mode="widthFix"></image></view>
+			<view class="text">暂无权限查看</view>
+		</view>
+	</view>
+</template>
+<script>
+	import authorize from '@/common/config/authorize.js' 
+	import { orderShareCode } from "@/api/order.js" 
+	export default{
+		data() {
+			return{
+				isRequest:false,
+				invitationCode:'',
+				imagePath:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/06/%E6%97%A0%E6%9D%83%E9%99%90%402x.png',
+				serviceProviderId:'',
+				shopOrderId:'',
+				source:1,
+				shareCode:'',
+				authority:'',//用户权限
+			}
+		},
+		onLoad(option) {
+			// scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene
+			if(option.scene){
+				this.shopOrderId =Number(decodeURIComponent(option.scene))
+			}else{
+				this.shopOrderId = option.shopOrderId
+				this.authority = option.authority
+				if(this.authority == '2'){
+					this.source = 2
+				}else if(this.authority == '3'){
+					this.source = 3
+				}
+			}
+			authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+				if(wxResponse != 1){
+					this.$api.navigateTo('/pages/authorization/authorization?type=4')
+					setTimeout(()=>{
+						this.isRequest = true
+					},2000)
+				}else{
+					this.infoMiniShipments();
+				}
+			})	
+		},
+		methods:{
+			infoMiniShipments(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					authorize.getUserInfo('weixin').then(wxResponse =>{
+						let params = {
+								code:wechatcode,
+								encryptedData:wxResponse.encryptedData,
+								iv:wxResponse.iv,
+								shopOrderId:this.shopOrderId,
+								source:this.source,
+								shareCode:this.shareCode
+						}
+						this.ShopService.MiniShipments(params).then(res =>{
+							switch(res.data.resultCode){
+								case 1:
+									this.shopOrderId = res.data.shopOrderId;
+									this.$api.navigateTo(`/supplier/pages/order/order-service-details?shopOrderId=${this.shopOrderId}`)
+									break;
+								case 2:
+									console.log('供应商联系人');
+									this.$api.navigateTo(`/supplier/pages/order/order-details?shopOrderId=${this.shopOrderId}`)
+									break;
+								case 3:
+									console.log('供应商发货人员');
+									this.$api.navigateTo(`/supplier/pages/order/order-details?shopOrderId=${this.shopOrderId}`)
+									break;
+							}
+						}).catch(err =>{
+							if(this.source == 2){
+								this.$api.setStorage('bind_supplierInfo', err.data)
+								this.$api.navigateTo(`/supplier/pages/login/bind-operator?shopOrderId=${this.shopOrderId}`)
+							}else if(this.source == 3){
+								this.$api.navigateTo(`/supplier/pages/login/share-login?shopOrderId=${this.shopOrderId}`)
+							}else{
+								this.isRequest = true;
+							}
+						})	
+					})
+				})		
+			}
+		},
+		onShow() {
+			authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+				if(wxResponse == 1){
+					this.isRequest = false;
+					this.infoMiniShipments();
+				}
+			})	
+		}
+	}
+</script>
+
+<style lang="scss">
+	.share{
+		width: 100%;
+		height:100%;
+		background: #FFFFFF;
+		display: flex;
+		align-items: center;
+		justify-content:center;
+		.share-empty{
+			width: 376rpx;
+			height: 460rpx;
+			.icon{
+				width: 376rpx;
+				height: 400rpx;
+				image{
+					width: 100%;
+					height: 100%;
+					display: block;
+				}
+			}
+			.text{
+				font-size: $font-size-28;
+				line-height: 60rpx;
+				color: $text-color;
+				text-align: center;
+			}
+		}
+	}
+</style>

+ 24 - 50
supplier/pages/login/share-login.vue

@@ -6,7 +6,7 @@
 		</view>
 		<view class="login-input">
 			<input type="number" 
-				   v-model="invitationCode"  
+				   v-model="shareCode"  
 				   maxlength="6" 
 				   class="input" 
 				   placeholder="请输入邀请码"
@@ -21,53 +21,22 @@
 	export default{
 		data() {
 			return{
-				invitationCode:'',
 				imagePath:'https://img.caimei365.com/group1/M00/03/83/Cmis214FbbCAQhKoAAKWfqqSIds292.png',
 				shareCode:'',  		//获取用户登录的邀请码
 				isUserInfo:false,	//控制显示授权弹窗
 				nickName:'',		//存储用户名
 				userInfo:'',		//存储微信用户授权信息
-				orderID:0,			//订单ID
+				shopOrderId:0,			//订单ID
 				userID:0			,//分享人的用户ID
 				isShareStatus:false,
 				serviceProviderId:''
 			}
 		},
-		onLoad(e) {
-			console.log(e)
-			this.orderID = e.orderID
-			this.userID = e.userID
-			if(e.serviceProviderId){
-				this.serviceProviderId = e.serviceProviderId
-			}
+		onLoad(option) {
+			this.shopOrderId = option.shopOrderId
+			console.log(this.shopOrderId)
 		},
 		methods:{
-			initQueryUser(){
-				authorize.getCode('weixin').then(wechatcode =>{
-					let params ={
-							code:wechatcode,
-							orderID:this.orderID,
-							userID:this.userID,
-							shareCode:this.shareCode,
-							serviceProviderId:this.serviceProviderId
-						}
-					orderShareCode(params).then(response =>{
-						if(response.code === 2){
-							this.$api.navigateTo(`/seller/pages/order/order-details?type=share&orderID=${this.orderID}`)
-						}else if(response.code === 0) {
-							if(response.data == true){//同为会所运营人员查看订单详情
-								this.$api.navigateTo(`/pages/user/order/order-details?type=share&orderID=${this.orderID}`)
-							}else{//游客第二次查看订单详情
-								this.$api.redirectTo(`/pages/user/order/order-sharedetails?orderID=${this.orderID}`)
-							}
-						}else if(response.code === -2){
-							this.$util.modal('提示',response.msg,'确定','',false,() =>{})
-						}else{
-							this.isShareStatus = true
-						}
-					})
-				})
-			},
 			goLogin() {
 				if(this.shareCode == ''){
 					this.$util.msg('请联系分享人获取分享码',2000);
@@ -78,24 +47,29 @@
 					return
 				}
 				authorize.getCode('weixin').then(wechatcode =>{
-					let params ={
-							code:wechatcode,
-							orderID:this.orderID,
-							userID:this.userID,
-							shareCode:this.shareCode
-						}
-					orderShareCode(params).then(response =>{
-						if (response.code === 0) {//游客第一次查看订单详情
-							this.$api.redirectTo('/pages/user/order/order-sharedetails?orderID='+this.orderID)
-						}else{
-							this.$util.msg(response.msg,2000);
-						}
-					})
+					authorize.getUserInfo('weixin').then(wxResponse =>{
+						let params ={
+								code:wechatcode,
+								encryptedData:wxResponse.encryptedData,
+								iv:wxResponse.iv,
+								shopOrderId:this.shopOrderId,
+								source:3,
+								shareCode:this.shareCode
+							}
+						this.ShopService.MiniShipments(params).then(res =>{
+							if(res.data.resultCode ==3){
+								console.log('供应商发货人员');
+								this.$api.navigateTo(`/supplier/pages/order/order-details?shopOrderId=${this.shopOrderId}`)
+							}
+						}).catch(error =>{
+							this.$util.msg(error.msg,2000);
+						})	
+					})	
 				})
 			},
 		},
 		onShow() {
-			this.initQueryUser()
+			
 		}
 	}
 </script>

+ 96 - 74
supplier/pages/order/order-details.vue

@@ -1,62 +1,63 @@
 <template>
 	<view class="container details clearfix" :style="{paddingBottom :isIphoneX ? (130+68)+'rpx' : '130rpx'}">
 		<cu-custom :navbar-data='nvabarData'></cu-custom>
-		<view class="container-details" :style="{paddingTop:CustomBar+'px'}">
+		<view class="container-details" :style="{paddingTop:CustomBar+'px'}" v-show="isRequest">
 			<!-- 订单信息 -->
 			<view class="information-content">
-				<view class="info-item"><view class="item-view"><text class="label">供应商:广州优斐斯生物科技有限公司</text></view></view>
-				<view class="info-item"><view class="item-view"><text class="label">订单号:W159013087369197</text></view></view>
-				<view class="info-item"><view class="item-view"><text class="label">下单时间:2019-11-11 16:17:08</text></view></view>
+				<view class="info-item"><view class="item-view"><text class="label">供应商:{{orderInfo.shopName ? orderInfo.shopName :''}}</text></view></view>
+				<view class="info-item"><view class="item-view"><text class="label">订单号:{{orderInfo.shopOrderNo}}</text></view></view>
+				<view class="info-item"><view class="item-view"><text class="label">下单时间:{{orderInfo.orderTime}}</text></view></view>
 				<view class="info-item">
-					<view class="item-view"><text class="label">收款状态:<text :style="{color:setStatusText(1)}">已收款</text></text></view>
-					<view class="item-view"><text class="label">结算状态:<text :style="{color:setStatusText(2)}">部分结算</text></text></view>
+					<view class="item-view"><text class="label">收款状态:<text :style="{color:setStatusText(orderInfo.receiptStatus)}">{{setStatusTextHtml(orderInfo.receiptStatus)}}</text></text></view>
+					<view class="item-view"><text class="label">结算状态:<text :style="{color:setStatusText(orderInfo.payStatus)}">{{setStatusTextHtml1(orderInfo.payStatus)}}</text></text></view>
 				</view>
 				<view class="info-item">
-					<view class="item-view"><text class="label">发货状态:<text :style="{color:setStatusText(3)}">待发货</text></text></view>
+					<view class="item-view"><text class="label">发货状态:<text :style="{color:setStatusText(orderInfo.sendOutStatus)}">{{setStatusTextHtml2(orderInfo.sendOutStatus)}}</text></text></view>
 				</view>
 			</view>
 			<!-- 地址信息 -->
 			<view class="address-content">
-				<view class="info-item"><text class="label">收货人:张能</text></view>
-				<view class="info-item"><text class="label">联系方式:18823666651</text></view>
-				<view class="info-item"><text class="label">收货地址:<text style="color: #666666;">安徽省蚌埠市蚌山区淮河路东海大瀚林银海大道瀚林银座小区B栋404</text></text></view>
+				<view class="info-item"><text class="label">收货人:{{orderInfo.userInfo.shouHuoRen}}</text></view>
+				<view class="info-item"><text class="label">联系方式:{{orderInfo.userInfo.mobile}}</text></view>
+				<view class="info-item"><text class="label">收货地址:<text style="color: #666666;">{{orderInfo.userInfo.address}}</text></text></view>
 			</view>
 			<!-- 商品 -->
 			<view class="goods-list">
 				<view class="goods-item clearfix">
-					<view class="productlist" v-for="(pros,idx) in shopOrderData.orderProductList" :key="idx">
+					<view class="productlist" v-for="(pros,idx) in orderInfo.orderProductList" :key="idx">
 						<view class="goods-pros-t" @click="hanldOperationConfim(pros)">
 							<view class="pros-left">
 								<view class="pros-img"><image :src="pros.productImage" alt="" /></view>
 							</view>
 							<view class="pros-product">
-								<view class="producttitle">{{pros.name}}</view>
+								<view class="producttitle">{{pros.aliasName ? pros.aliasName : ''}}</view>
 								<view class="productspec">规格:{{pros.productUnit ? pros.productUnit : ''}}</view>
-								<view class="productspec">商品编码:{{pros.productCode ? pros.productCode : ''}}</view>
+								<view class="productspec">商品编码:{{pros.productNo ? pros.productNo : ''}}</view>
 								<view class="product-view">
-									<view class="view-num">数量:{{pros.num}}</view>
+									<view class="view-num">数量:{{pros.num+pros.presentNum}}</view>
 								</view>
 								<view class="product-view">
-									<view class="view-num">已发货:{{pros.taxRate}}</view>
-									<view class="view-num">未发货:{{pros.discount == null ? '0' : pros.discount}}</view>
+									<view class="view-num">已发货:{{pros.shipmentsNum}}</view>
+									<view class="view-num">未发货:{{pros.notOutStore-pros.actualCancelNum}}</view>
 								</view>
 								<view class="product-view">
-									<view class="view-num">已退货:{{pros.discountPrice}}</view>
+									<view class="view-num">已退货:{{pros.returnedNum}}</view>
+									<view class="view-num">已取消:{{pros.actualCancelNum}}</view>
 								</view>
 							</view>	
 						</view>
 					</view>	
-					<view class="goods-pros-m" v-if="shopOrderData.note!=''">
+					<view class="goods-pros-m" v-if="orderInfo.note!=''">
 						<view class="m-text">留言:</view>
 						<view class="m-input">
-							<view class="text">{{shopOrderData.note ? shopOrderData.note : ''}}</view>
+							<view class="text">{{orderInfo.note ? orderInfo.note : ''}}</view>
 						</view>	
 					</view>
 					<view class="goods-pros-b">
-						<view class="count">共{{shopOrderData.itemCount}}件商品(含赠品{{shopOrderData.zeng}}件</view>
+						<view class="count">共{{orderInfo.itemCount}}件商品</view>
 					</view>
 				</view>
-			</view>	
+			</view>
 			<!-- 底部button -->
 			<order-button ref="orderButton" 
 						  v-if= "isRequest" 
@@ -65,7 +66,7 @@
 						   @buttonConfirm="handButtonConfirm">
 			</order-button>
 		</view>
-		<share-alert  :orderID="orderID" 
+		<share-alert  :shopOrderID="shopOrderId" 
 					  v-if="isShareModal"  
 					  @shareConfirm ='onShareAppMessage'>
 		</share-alert>		
@@ -77,7 +78,7 @@
 	import orderAddress from '@/components/cm-module/orderDetails/orderAddress' 		 //地址信息
 	import goodsList from '@/components/cm-module/orderDetails/goodsList'		 		 //商品列表
 	import orderButton from '@/components/cm-module/orderDetails/supplierDetaileButton'	//底部按钮
-	import shareAlert from '@/components/cm-module/modelAlert/shareAlert.vue'			 //分享弹窗
+	import shareAlert from '@/components/cm-module/modelAlert/supplierShareAlert'	  //分享弹窗
 	import { queryOrderDetails,cancelOrder,deleteOrder,confirmReceipt,affirmOrder } from "@/api/order.js" 
 	export default {
 		components:{
@@ -96,63 +97,35 @@
 					haveBack:false,
 					textLeft:this.$store.state.isIphone
 				},
+				windowHeight: '',
 				isIphoneX:this.$store.state.isIphoneX,
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				state:0,
 				userID:'',
-				orderID:'',
+				shopOrderId:'',
 				shareCode:'',				//分享码
 				payStatus:0,
 				btnStatus:0,				//按钮组件状态
-				isRequest:true,			//是否加载完成渲染子组件
+				isRequest:false,			//是否加载完成渲染子组件
 				isOrderShare:false,
 				isShareModal:false,
-				addressData:{},				//地址信息初始化
-				information:{},				//订单信息初始化
-				shopOrderData:{
-					note:'奥斯卡就打开是件大事的空间啊奥斯卡就打开是件大事的空间啊奥斯卡就打开是件大事的空间啊奥斯卡就打开是件大事的空间啊d',
-					itemCount:9,
-					zeng:2,
-					orderProductList:[
-						{
-							productImage:'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
-							name:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德',
-							productUnit:'盒',
-							productCode:'FXSW2131231231',
-							num:20,
-							taxRate:5,
-							discount:5,
-							discountPrice:3,
-							price:'200.00'
-						}
-					]
-				},//商品信息初始化
+				orderInfo:{},				//订单信息
+				
 			}
 		},
-		onLoad(){
-			// this.initOrderDetaileData()
+		onLoad(option){
+			console.log(option.shopOrderId)
+			this.shopOrderId = option.shopOrderId;
+			this.initShopOrderDetails()
 		},
 		methods: {
-			initOrderDetaileData(){//初始化页面数据@参数:订单ID
-				queryOrderDetails({ orderID : this.orderID }).then(response =>{
-					let resData = response.data;
+			initShopOrderDetails(){//初始化页面数据@参数:订单ID
+				this.ShopService.GetShopOrderDetails({ shopOrderId : this.shopOrderId }).then(res =>{
+					this.orderInfo  = res.data.shopOrder
+					this.btnStatus = this.orderInfo.sendOutStatus
 					this.isRequest = true
-					this.userID = resData.order.userID
-					this.shareCode = resData.shareCode
-					this.addressData = resData.userInfo
-					this.information = resData.order
-					this.btnStatus = resData.order.status
-					this.payStatus = resData.order.payStatus
-					this.shopOrderData = resData.shopOrderList
-					this.orderInvoice = resData.orderInvoice
-					this.returnedPurchaseList = resData.returnedPurchaseList
-					this.discernReceiptList = resData.discernReceiptList
-					this.receiptAmount = resData.order.receiptAmount
-					this.returnedPurchaseFee = resData.order.returnedPurchaseFee
-				}).catch(error =>{
-					this.$util.modal('提示','订单查询失败,请稍后重试~','确定','',false,() =>{
-						this.$api.switchTabTo('/pages/tabBar/home/home')
-					})
+				}).catch(err =>{
+					this.$util.msg(err.msg,2000);
 				})
 			},
 			handButtonConfirm(data){//监听点击时间的按钮类型并执行...
@@ -161,23 +134,68 @@
 			handShowAlert(type){//判断点击的按钮类型并执行...
 				switch(type){
 					case 'record':
-						this.$api.navigateTo('/supplier/pages/deliver/deliver-record?orderID='+this.orderID)
+						this.$api.navigateTo('/supplier/pages/deliver/deliver-record?shopOrderId='+this.shopOrderId)
 						break
 					case 'deliver':
-						this.$api.navigateTo('/supplier/pages/deliver/deliver-goods?orderID='+this.orderID)
+						this.$api.navigateTo('/supplier/pages/deliver/deliver-goods?shopOrderId='+this.shopOrderId)
 						break
 				}
 			},
+			setStatusTextHtml(status){
+				let TextHtml='';
+				switch(status){
+					case '1':
+						TextHtml = '待付款'
+						break;
+					case '2':
+						TextHtml = '部分付款'
+						break;
+					case '3':
+						TextHtml = '已付款'
+						break;
+				}
+				return TextHtml
+			},
+			setStatusTextHtml1(status){
+				let TextHtml='';
+				switch(status){
+					case '1':
+						TextHtml = '待结算'
+						break;
+					case '2':
+						TextHtml = '部分结算'
+						break;
+					case '3':
+						TextHtml = '已结算'
+						break;
+				}
+				return TextHtml
+			},
+			setStatusTextHtml2(status){
+				let TextHtml='';
+				switch(status){
+					case '1':
+						TextHtml = '待发货'
+						break;
+					case '2':
+						TextHtml = '部分发货'
+						break;
+					case '3':
+						TextHtml = '已发货'
+						break;
+				}
+				return TextHtml
+			},
 			setStatusText(status){
 				let textColor='';
 				switch(status){
-					case 1:
+					case '1':
 						textColor = '#FF2A2A'
 						break;
-					case 2:
+					case '2':
 						textColor = '#E15616'
 						break;
-					case 3:
+					case '3':
 						textColor = '#38CB3D'
 						break;
 				}
@@ -192,12 +210,16 @@
 					// 来自页面内转发按钮
 			    }
 				return {
-					title: '您有新的分享订单,快来查看吧~',
-					path: `/pages/user/order/orderShareLogin?orderID=${this.orderID}&userID=${this.userID}`,
+					title: '您有订单待处理,请点击查看~',
+					path: `/supplier/pages/login/share-info?authority=3&shopOrderId=${this.shopOrderId}`,
 					imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
 				}
 			}
 		},
+		onPullDownRefresh() {//下拉刷新
+			this.initShopOrderDetails()
+			uni.stopPullDownRefresh()
+		},
 		onShow() {
 
 		}
@@ -206,7 +228,7 @@
 
 <style lang="scss">
 	page {
-		height: auto;
+		height: 100%;
 		background:#F7F7F7;
 	}
 	.details{

+ 107 - 81
supplier/pages/order/order-service-details.vue

@@ -1,69 +1,70 @@
 <template>
 	<view class="container details clearfix" :style="{paddingBottom :isIphoneX ? (130+68)+'rpx' : '130rpx'}">
 		<cu-custom :navbar-data='nvabarData'></cu-custom>
-		<view class="container-details" :style="{paddingTop:CustomBar+'px'}">
+		<view class="container-details" :style="{paddingTop:CustomBar+'px'}" v-show="isRequest">
 			<!-- 订单信息 -->
 			<view class="information-content">
-				<view class="info-item"><view class="item-view"><text class="label">供应商:广州优斐斯生物科技有限公司</text></view></view>
-				<view class="info-item"><view class="item-view"><text class="label">订单号:W159013087369197</text></view></view>
-				<view class="info-item"><view class="item-view"><text class="label">下单时间:2019-11-11 16:17:08</text></view></view>
+				<view class="info-item"><view class="item-view"><text class="label">供应商:{{orderInfo.shopName ? orderInfo.shopName :''}}</text></view></view>
+				<view class="info-item"><view class="item-view"><text class="label">订单号:{{orderInfo.shopOrderNo}}</text></view></view>
+				<view class="info-item"><view class="item-view"><text class="label">下单时间:{{orderInfo.orderTime}}</text></view></view>
 				<view class="info-item">
-					<view class="item-view"><text class="label">收款状态:<text :style="{color:setStatusText(1)}">已收款</text></text></view>
-					<view class="item-view"><text class="label">结算状态:<text :style="{color:setStatusText(2)}">部分结算</text></text></view>
+					<view class="item-view"><text class="label">收款状态:<text :style="{color:setStatusText(orderInfo.receiptStatus)}">{{setStatusTextHtml(orderInfo.receiptStatus)}}</text></text></view>
+					<view class="item-view"><text class="label">结算状态:<text :style="{color:setStatusText(orderInfo.payStatus)}">{{setStatusTextHtml1(orderInfo.payStatus)}}</text></text></view>
 				</view>
 				<view class="info-item">
-					<view class="item-view"><text class="label">发货状态:<text :style="{color:setStatusText(3)}">待发货</text></text></view>
+					<view class="item-view"><text class="label">发货状态:<text :style="{color:setStatusText(orderInfo.sendOutStatus)}">{{setStatusTextHtml2(orderInfo.sendOutStatus)}}</text></text></view>
 				</view>
 			</view>
 			<!-- 地址信息 -->
 			<view class="address-content">
-				<view class="info-item"><text class="label">收货人:张能</text></view>
-				<view class="info-item"><text class="label">联系方式:18823666651</text></view>
-				<view class="info-item"><text class="label">收货地址:<text style="color: #666666;">安徽省蚌埠市蚌山区淮河路东海大瀚林银海大道瀚林银座小区B栋404</text></text></view>
+				<view class="info-item"><text class="label">收货人:{{orderInfo.userInfo.shouHuoRen}}</text></view>
+				<view class="info-item"><text class="label">联系方式:{{orderInfo.userInfo.mobile}}</text></view>
+				<view class="info-item"><text class="label">收货地址:<text style="color: #666666;">{{orderInfo.userInfo.address}}</text></text></view>
 			</view>
 			<!-- 商品 -->
 			<view class="goods-list">
 				<view class="goods-item clearfix">
-					<view class="productlist" v-for="(pros,idx) in shopOrderData.orderProductList" :key="idx">
+					<view class="productlist" v-for="(pros,idx) in orderInfo.orderProductList" :key="idx">
 						<view class="goods-pros-t" @click="hanldOperationConfim(pros)">
 							<view class="pros-left">
 								<view class="pros-img"><image :src="pros.productImage" alt="" /></view>
 							</view>
 							<view class="pros-product">
-								<view class="producttitle">{{pros.name}}</view>
+								<view class="producttitle">{{pros.aliasName ? pros.aliasName : ''}}</view>
 								<view class="productspec">规格:{{pros.productUnit ? pros.productUnit : ''}}</view>
-								<view class="productspec">商品编码:{{pros.productCode ? pros.productCode : ''}}</view>
+								<view class="productspec">商品编码:{{pros.productNo ? pros.productNo : ''}}</view>
 								<view class="product-view">
-									<view class="view-num">数量:{{pros.num}}</view>
+									<view class="view-num">数量:{{pros.num+pros.presentNum}}</view>
 								</view>
 								<view class="product-view">
-									<view class="view-num">已发货:{{pros.taxRate}}</view>
-									<view class="view-num">未发货:{{pros.discount == null ? '0' : pros.discount}}</view>
+									<view class="view-num">已发货:{{pros.shipmentsNum}}</view>
+									<view class="view-num">未发货:{{pros.notOutStore-pros.actualCancelNum}}</view>
 								</view>
 								<view class="product-view">
-									<view class="view-num">已退货:{{pros.discountPrice}}</view>
+									<view class="view-num">已退货:{{pros.returnedNum}}</view>
+									<view class="view-num">已取消:{{pros.actualCancelNum}}</view>
 								</view>
 								<text class="iconfont icon-genghuan"></text>
 							</view>	
 						</view>
 					</view>	
-					<view class="goods-pros-m" v-if="shopOrderData.note!=''">
+					<view class="goods-pros-m" v-if="orderInfo.note!=''">
 						<view class="m-text">留言:</view>
 						<view class="m-input">
-							<view class="text">{{shopOrderData.note ? shopOrderData.note : ''}}</view>
+							<view class="text">{{orderInfo.note ? orderInfo.note : ''}}</view>
 						</view>	
 					</view>
 					<view class="goods-pros-b">
-						<view class="count">共{{shopOrderData.itemCount}}件商品</view>
+						<view class="count">共{{orderInfo.itemCount}}件商品</view>
 					</view>
 				</view>
 			</view>	
 			<!-- 底部按钮 -->
 			<view class="button-template" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
 				<view class="button-content">
-					<view class="btn btn-color" @click.stop="onShareCode">
-						<view class="tips" v-if="shareCode">分享码:{{shareCode}}</view>分享订单
-					</view>	
+					<!-- #ifdef MP-WEIXIN -->
+					<button class="btn btn-color" open-type="share" @click="onShareAppMessage">分享订单</button>
+					<!-- #endif -->
 				</view>
 			</view>
 			<!--底部选择模态层弹窗组件 -->
@@ -74,15 +75,18 @@
 					<view class="content">
 						<view class="layer-title">商品显示名:</view>
 						<view class="layer-name">{{handleData.name}}</view>
-						<view class="layer-text">售价:<text style="color: #666;">¥{{handleData.price}}</text></view>
+						<view class="layer-text">
+							<view class="layer-text-fl">
+								售价:<text style="color: #666;">¥{{toFixedFn(handleData.discountPrice)}}</text>
+							</view>
+							<view class="layer-text-fr">
+								<text style="color: #666;">共计{{handleData.num}}件商品</text>
+							</view>
+						</view>
 					</view>
 				</view>
 			</view>
 		</view>
-		<share-alert  :orderID="orderID" 
-					  v-if="isShareModal"  
-					  @shareConfirm ='onShareAppMessage'>
-		</share-alert>		
 	</view>
 </template>
 
@@ -91,15 +95,12 @@
 	import orderAddress from '@/components/cm-module/orderDetails/orderAddress' 		 //地址信息
 	import goodsList from '@/components/cm-module/orderDetails/goodsList'		 		 //商品列表
 	import orderButton from '@/components/cm-module/orderDetails/orderButton'			 //底部按钮
-	import shareAlert from '@/components/cm-module/modelAlert/shareAlert.vue'			 //分享弹窗
-	import { queryOrderDetails,cancelOrder,deleteOrder,confirmReceipt,affirmOrder } from "@/api/order.js" 
 	export default {
 		components:{
 			headerBack,
 			orderAddress,
 			goodsList,
 			orderButton,
-			shareAlert,
 		},
 		data() {
 			return {
@@ -116,73 +117,89 @@
 				handleData:{},
 				state:0,
 				userID:'',
-				orderID:'',
+				shopOrderId:'',
 				shareCode:'',				//分享码
+				orderInfo:{},				//订单信息
 				payStatus:0,
 				btnStatus:0,				//按钮组件状态
 				isRequest:false,			//是否加载完成渲染子组件
 				isOrderShare:false,
-				isShareModal:false,
 				addressData:{},				//地址信息初始化
 				information:{},				//订单信息初始化
-				shopOrderData:{
-					note:'奥斯卡就打开是件大事的空间啊奥斯卡就打开是件大事的空间啊奥斯卡就打开是件大事的空间啊奥斯卡就打开是件大事的空间啊d',
-					itemCount:9,
-					orderProductList:[
-						{
-							productImage:'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
-							name:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德',
-							productUnit:'盒',
-							productCode:'FXSW2131231231',
-							num:20,
-							taxRate:5,
-							discount:5,
-							discountPrice:3,
-							price:'200.00'
-						}
-					]
-				},//商品信息初始化
 			}
 		},
-		onLoad(){
-			// this.initOrderDetaileData()
+		onLoad(option){
+			console.log(option)
+			this.shopOrderId = option.shopOrderId
+			this.initShopOrderDetails()
 		},
 		methods: {
-			initOrderDetaileData(){//初始化页面数据@参数:订单ID
-				queryOrderDetails({ orderID : this.orderID }).then(response =>{
-					let resData = response.data;
+			initShopOrderDetails(){//初始化页面数据@参数:订单ID
+				this.ShopService.GetShopOrderDetails({ shopOrderId : this.shopOrderId }).then(res =>{
+					this.orderInfo  = res.data.shopOrder
 					this.isRequest = true
-					this.userID = resData.order.userID
-					this.shareCode = resData.shareCode
-					this.addressData = resData.userInfo
-					this.information = resData.order
-					this.btnStatus = resData.order.status
-					this.payStatus = resData.order.payStatus
-					this.shopOrderData = resData.shopOrderList
-					this.orderInvoice = resData.orderInvoice
-					this.returnedPurchaseList = resData.returnedPurchaseList
-					this.discernReceiptList = resData.discernReceiptList
-					this.receiptAmount = resData.order.receiptAmount
-					this.returnedPurchaseFee = resData.order.returnedPurchaseFee
-				}).catch(error =>{
-					this.$util.modal('提示','订单查询失败,请稍后重试~','确定','',false,() =>{
-						this.$api.switchTabTo('/pages/tabBar/home/home')
-					})
+				}).catch(err =>{
+					this.$util.msg(err.msg,2000);
 				})
 			},
 			handButtonConfirm(data){//监听点击时间的按钮类型并执行...
 				this.handShowAlert(data)
 			},
+			setStatusTextHtml(status){
+				let TextHtml='';
+				switch(status){
+					case '1':
+						TextHtml = '待付款'
+						break;
+					case '2':
+						TextHtml = '部分付款'
+						break;
+					case '3':
+						TextHtml = '已付款'
+						break;
+				}
+				return TextHtml
+			},
+			setStatusTextHtml1(status){
+				let TextHtml='';
+				switch(status){
+					case '1':
+						TextHtml = '待结算'
+						break;
+					case '2':
+						TextHtml = '部分结算'
+						break;
+					case '3':
+						TextHtml = '已结算'
+						break;
+				}
+				return TextHtml
+			},
+			setStatusTextHtml2(status){
+				let TextHtml='';
+				switch(status){
+					case '1':
+						TextHtml = '待发货'
+						break;
+					case '2':
+						TextHtml = '部分发货'
+						break;
+					case '3':
+						TextHtml = '已发货'
+						break;
+				}
+				return TextHtml
+			},
 			setStatusText(status){
 				let textColor='';
 				switch(status){
-					case 1:
+					case '1':
 						textColor = '#FF2A2A'
 						break;
-					case 2:
+					case '2':
 						textColor = '#E15616'
 						break;
-					case 3:
+					case '3':
 						textColor = '#38CB3D'
 						break;
 				}
@@ -192,23 +209,22 @@
 				this.specClass = 'show';
 				this.handleData = data
 			},
+			toFixedFn(text){
+				return Number(text).toFixed(2);
+			},
 			hideSpec() {//关闭选择数量确认弹窗
 				this.specClass = 'hide';
 				setTimeout(() => {
 					this.specClass = 'none';
 				}, 200);
 			},
-			onShareCode(){
-				this.isShareModal = true
-			},
 			onShareAppMessage(res){//分享转发
-				this.isShareModal = false
 				if (res.from === 'button') {
 					// 来自页面内转发按钮
 			    }
 				return {
-					title: '您有新的分享订单,快来查看吧~',
-					path: `/pages/user/order/orderShareLogin?orderID=${this.orderID}&userID=${this.userID}`,
+					title: '您有订单待处理,请点击查看~',
+					path: `/supplier/pages/login/share-info?authority=2&shopOrderId=${this.shopOrderId}`,
 					imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
 				}
 			},
@@ -216,6 +232,10 @@
 				//丢弃
 			}
 		},
+		onPullDownRefresh() {//下拉刷新
+			this.initShopOrderDetails()
+			uni.stopPullDownRefresh()
+		},
 		onShow() {
 
 		}
@@ -224,7 +244,7 @@
 
 <style lang="scss">
 	page {
-		height: auto;
+		height: 100%;
 		background:#F7F7F7;
 	}
 	.details{
@@ -530,6 +550,12 @@
 					font-size: $font-size-28;
 					color: $text-color;
 					line-height: 58rpx;
+					.layer-text-fl{
+						float: left;
+					}
+					.layer-text-fr{
+						float: right;
+					}
 				}
 			}
 		}