Parcourir la source

Merge branch 'master' of http://47.98.226.240:3000/twt/wxThird

* 'master' of http://47.98.226.240:3000/twt/wxThird:
  11

# Conflicts:
#	pages/user/user.vue
guo il y a 2 ans
Parent
commit
796b329fb3

+ 2 - 1
ext.json

@@ -5,6 +5,7 @@
 	"ext": {
 		"shopId": "E37BB296-5A08-4534-859D-B351BA611AF9",
         "url":"http://api.dms.66km.com.cn",
-		"unionId":"EEADACCD-8A19-499D-8AD7-6975D2C93243"
+		"unionId":"EEADACCD-8A19-499D-8AD7-6975D2C93243",
+		"appId":"wx33053a645546ec31"
 	}
 }

+ 5 - 2
pages/index/index.vue

@@ -214,6 +214,7 @@
 				iStatusBarHeight:'',
 				managerInfo:'',
 				unionId:'',
+				ext:'',
 			}
 		},
 		onLoad() {
@@ -221,6 +222,7 @@
 			var that=this;
 			 //this.$common.getExtStoreId()
 			 var ext=this.$common.getExtStoreId();
+			 this.ext=ext
 			 console.log(ext)
 			//console.log( String(Date.now()))
 			this.shopId=ext.shopId;
@@ -463,7 +465,7 @@
 			 wxPhoneLogin(){
 				 var that=this;
 				 this.$http('miniApp2/sys/wxPhoneLogin', {
-				   appId:'wx33053a645546ec31',
+				   appId:this.ext.appId,
 				   unionId:this.unionId,
 				   code:this.code,
 				   openId:this.wxOpenData.openid
@@ -936,7 +938,7 @@
 		font-size: 28rpx;
 	}
 	.hotGoodsLine{
-		margin-top: 20rpx;
+		margin-top: 30rpx;
 		padding: 20rpx;
 		background: #FFFFFF;
 		border-radius: 16rpx;
@@ -947,6 +949,7 @@
 		height: 194rpx;
 		border-radius: 16rpx;
 		border: 1px solid #EEEEEE;
+		display: block;
 	}
 	.goodsName{
 		font-size: 28rpx;

+ 19 - 5
pages/shop/confirm.vue

@@ -4,7 +4,7 @@
 	<view class="yuanhu"></view>
 	<view class="goodsBox">
 		<view class="goodsBoxLeft">
-			<image :src="goodsInfo.ImgList[0].url" mode="" v-if="goodsInfo.ImgList.length>1" class="hotGoodsLineImg"></image>
+			<image :src="goodsInfo.ImgList[0].url" mode="" v-if="goodsInfo.ImgList.length>0" class="hotGoodsLineImg"></image>
 			<image src="../../static/timg/noimg.png" v-else class="hotGoodsLineImg" ></image>
 		</view>
 		<view class="goodsBoxRgiht">
@@ -95,6 +95,7 @@
 				mobilePhone:'',
 				comment:'',
 				mydata:'',
+				orderData:'',
 			}
 		},
 		onLoad(opt) {
@@ -153,7 +154,7 @@
 				this.$http('openMallOrder/submitOrder', params,'POST').then(res => {
 					uni.hideLoading();
 					if(res.code==0){
-						
+						this.orderData=res.data
 						this.unifiedPay(res.data)
 					}else{
 						uni.showToast({
@@ -183,8 +184,9 @@
 			},
 			requestPayment(res){
 				var payInfo=res;
-				console.log(payInfo)
-				console.log(String(Date.now()))
+				//console.log(payInfo)
+				//console.log(String(Date.now()))
+				var that=this;
 				uni.requestPayment({
 					provider: 'wxpay',
 					//timeStamp: String(Date.now()),
@@ -211,6 +213,11 @@
 							 icon:'none',
 							 duration: 2000
 						 });
+						  if((that.orderData.sheetType==1)||(that.orderData.sheetType==2)||(that.orderData.sheetType==3)){
+						  	uni.redirectTo({
+						  		url: "../user/myOrder/mallOrderDetail?id=" + that.orderData.id +"&SheetType=" + that.orderData.sheetType
+						  	})
+						  }
 						
 				    },
 				    fail: function (err) {
@@ -219,7 +226,14 @@
 						 title: '支付失败',
 						 icon:'none',
 						 duration: 2000
-				      });			 
+				      });
+					  console.log(that.orderData)
+					   if(that.orderData.sheetType==1||that.orderData.sheetType==2||that.orderData.sheetType==3){
+						   console.log("商城订单s")
+						uni.redirectTo({
+							url: "../user/myOrder/mallOrderDetail?id=" + that.orderData.id +"&SheetType=" + that.orderData.sheetType
+						})
+					   }
 				    }
 				}); 
 			},

+ 9 - 5
pages/shop/goodsDetail.vue

@@ -73,7 +73,7 @@
 				<view class="itemline" v-for="(item,index) in info.itemPackTimesDetails">
 					<view class="itemname">{{item.flowName}}</view>
 					<view>{{item.flowQty}}</view>
-					<view v-if="expireNumber">{{expireNumber}}个月</view>
+					<view v-if="item.expireNumber">{{item.expireNumber}}个月</view>
 					<view v-else>永久</view>
 				</view>
 			</view>
@@ -90,7 +90,7 @@
 				<view class="itemline" v-for="(item,index) in info.goodsPackTimesDetails">
 					<view class="itemname">{{item.flowName}}</view>
 					<view>{{item.flowQty}}</view>
-					<view v-if="expireNumber">{{expireNumber}}个月</view>
+					<view v-if="item.expireNumber">{{item.expireNumber}}个月</view>
 					<view v-else>永久</view>
 				</view>
 			</view>
@@ -148,7 +148,9 @@
 					</view>
 					<view class="numJsbox">
 						<view class="numJj" @click="calculation(1)">-</view>
-						<view class="goodsnum">{{goodsnum}}</view>
+						<view class="goodsnum">
+						 <input type="number" value="" v-model="goodsnum" class="goodsnumInput"/>
+						</view>
 						<view class="numJj" @click="calculation(2)">+</view>
 					</view>
 				</view>
@@ -202,6 +204,7 @@
 				authorizShow:false,
 				code:'',
 				wxOpenData:'',
+				ext:'',
 			}
 		},
 		onLoad(opt) {
@@ -210,6 +213,7 @@
 			this.userInfo=this.$store.state.userInfo;
 			this.wxOpenData=this.$store.state.wxOpenData;
 			this.openGoodsDetailById();
+			this.ext=this.$common.getExtStoreId();
 		},
 		onShow() {
 			this.shopInfo=this.$store.state.ckshopInfo;
@@ -321,8 +325,8 @@
 			wxPhoneLogin(){
 					 var that=this;
 					 this.$http('miniApp2/sys/wxPhoneLogin', {
-					   appId:'wx33053a645546ec31',
-					   unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243',
+					   appId:this.ext.appId,
+					   unionId:this.ext.unionId,
 					   code:this.code,
 					   openId:this.wxOpenData.openid
 					  },'POST').then(res => {

+ 8 - 2
pages/shop/shop.vue

@@ -9,7 +9,7 @@
 		<scroll-view scroll-x="true" class="scroll-Y" >
 			<view class="classificationBox">
 				<view  class="classification" v-for="(item,index) in categoryList" @click="topClick(index,item)">
-					<view class="classificationName">{{item.name}}</view>
+					<view class="classificationName" :class="{classificationNameActive:topIndex==index}">{{item.name}}</view>
 					<view class="classificationHx" v-if="topIndex==index"></view>
 				</view>
 			</view>
@@ -440,6 +440,11 @@ z-index: 11;
 	color: #3C3C3C;
 	line-height: 40rpx;
 	padding:24rpx 24rpx 8rpx 24rpx;
+	font-weight: 400;
+}
+.classificationNameActive{
+	font-weight: 500 !important;
+	color: #FF0000 ;
 }
 .classificationHx{
 	width: 40rpx;
@@ -461,7 +466,7 @@ z-index: 11;
 		display: flex;
 	}
 	.hotGoodsLine{
-		margin-top: 20rpx;
+		margin-top: 30rpx;
 		padding:0rpx 20rpx;
 		background: #FFFFFF;
 		border-radius: 16rpx;
@@ -472,6 +477,7 @@ z-index: 11;
 		height: 194rpx;
 		border-radius: 16rpx;
 		border: 1px solid #EEEEEE;
+		display: block;
 	}
 	.goodsName{
 		font-size: 28rpx;

+ 52 - 0
pages/user/myOrder/mallOrderDetail.vue

@@ -244,6 +244,58 @@
 		},
 
 		methods: {
+			pay(){
+				this.$http('openMallOrder/unifiedPay', {
+					sheetId:this.id
+				},'POST').then(res => {
+					
+					if(res.code==0){
+						
+						this.requestPayment(res.data)
+					}else{
+						uni.showToast({
+							title: res.msg,
+							icon: 'none',
+							duration: 3000
+						});
+					}
+				 })
+			},
+			requestPayment(res){
+				var payInfo=res;
+				//console.log(payInfo)
+				//console.log(String(Date.now()))
+				var that=this;
+				uni.requestPayment({
+					provider: 'wxpay',
+					//timeStamp: String(Date.now()),
+					timeStamp: payInfo.timeStamp,
+					nonceStr: payInfo.nonceStr,
+					package:payInfo.package,
+					signType: payInfo.signType,
+					paySign: payInfo.paySign,
+					appid:payInfo.appId,	
+				
+				    success: function (res) {
+				        console.log('success:' + JSON.stringify(res));
+						 uni.showToast({
+							 title: '支付成功',
+							 icon:'none',
+							 duration: 2000
+						 });
+						that.getData()
+				    },
+				    fail: function (err) {
+					  console.log(err)
+				      uni.showToast({
+						 title: '支付失败',
+						 icon:'none',
+						 duration: 2000
+				      });
+					
+				    }
+				}); 
+			},
 			copy(txt) {
 				uni.setClipboardData({
 					data: txt,

+ 4 - 3
pages/user/user.vue

@@ -205,6 +205,7 @@
 				wxOpenData: '',
 				nickName:'',
 				phone:'',
+				ext:'',
 			}
 		},
 		onLoad(opt) {
@@ -233,7 +234,7 @@
 				this.uid = wxOpenData.loginInfo.uid;
 			}
 			//this.userInfo = uni.getStorageSync("userInfo")
-
+            this.ext=this.$common.getExtStoreId();
 		},
 		onShow() {
 			this.userInfo = this.$store.state.userInfo;
@@ -255,8 +256,8 @@
 			wxPhoneLogin() {
 				var that = this;
 				this.$http('miniApp2/sys/wxPhoneLogin', {
-					appId: 'wx33053a645546ec31',
-					unionId: 'EEADACCD-8A19-499D-8AD7-6975D2C93243',
+					appId:this.ext.appId,
+					unionId:this.ext.unionId,
 					code: this.code,
 					openId: this.wxOpenData.openid
 				}, 'POST').then(res => {