浏览代码

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

* 'master' of http://47.98.226.240:3000/twt/wxThird:
  11
guo 2 年之前
父节点
当前提交
be2ea06e08
共有 5 个文件被更改,包括 137 次插入15 次删除
  1. 2 2
      pages/index/index.vue
  2. 6 3
      pages/shop/goodsDetail.vue
  3. 21 4
      pages/shop/shop.vue
  4. 107 5
      pages/user/user.vue
  5. 1 1
      utils/request.js

+ 2 - 2
pages/index/index.vue

@@ -161,7 +161,7 @@
 					<view class="hotGoodsLineRIght">
 						<view class="goodsName">{{item.name}}</view>
 					    <view class="Sold">
-							<view v-if="item.showLabel&&item.showLabel.indexOf('2')!=-1">
+							<view v-if="item.showLabel&&item.showLabel.indexOf('3')!=-1">
 								已售 {{item.saleQty}}
 							</view>
 						</view>
@@ -169,7 +169,7 @@
 							<view class="goodsPrice1">{{item.saleLabel}}</view>
 							<view class="goodsPrice2">¥</view>
 							<view class="goodsPrice3">{{item.salePrice}}</view>
-							<view class="goodsPrice4" v-if="item.scribingPrice">¥{{item.scribingPrice}}</view>
+							<view class="goodsPrice4" v-if="item.showLabel&&item.scribingPrice&&item.showLabel.indexOf('1')!=-1">¥{{item.scribingPrice}}</view>
 						</view>
 					</view>
 				</view>

+ 6 - 3
pages/shop/goodsDetail.vue

@@ -17,7 +17,7 @@
 				<view class="goodsPrice1" v-if="info.saleLabel">{{info.saleLabel}}</view>
 				<view class="goodsPrice2">¥</view>
 				<view class="goodsPrice3">{{info.salePrice?info.salePrice:info.scribingPrice}}</view>
-				<view class="goodsPrice4" v-if="info.scribingPrice">¥{{info.scribingPrice}}</view>
+				<view class="goodsPrice4" v-if="info.showLabel&&info.scribingPrice&&info.showLabel.indexOf('1')!=-1">¥{{info.scribingPrice}}</view>
 			</view>
 			<view class="Sold" v-if="info.showLabel&&info.showLabel.indexOf('3')!=-1">已售 {{info.saleQty}}</view>
 		</view>
@@ -135,7 +135,7 @@
 							<view class="goodsPrice11" v-if="info.saleLabel">{{info.saleLabel}}</view>
 							<view class="goodsPrice22">¥</view>
 							<view class="goodsPrice33">{{info.salePrice?info.salePrice:info.scribingPrice}}</view>
-							<view class="goodsPrice44" v-if="info.scribingPrice">¥{{info.scribingPrice}}</view>
+							<view class="goodsPrice44" v-if="info.showLabel&&info.scribingPrice&&info.showLabel.indexOf('1')!=-1">¥{{info.scribingPrice}}</view>
 						</view>
 					</view>
 				</view>
@@ -231,6 +231,8 @@
 						if(this.info.details){
 							this.info.details = this.info.details.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
 						}
+						this.shopInfo='';
+						this.$store.commit('mutationsckshopInfo', '')
 						this.szShop()
 						
 				 })
@@ -253,7 +255,7 @@
 						
 						var queryShopList = res.data
 						//console.log('list+=', this.queryShopList);
-					   queryShopList.forEach(itme=>{
+					   queryShopList.forEach(item=>{
 						   if(item.shopId==this.info.shopId){
 							   var item={
 							   	shopId:this.info.shopId,
@@ -566,6 +568,7 @@
 .goodsDetail{
 	margin-top: 20rpx;
 	padding-bottom: 30rpx;
+	background: #FFFFFF;
 }
 .goodsDetail img{
 	width: 750rpx;

+ 21 - 4
pages/shop/shop.vue

@@ -14,6 +14,8 @@
 				</view>
 			</view>
 	   </scroll-view>
+	</view>
+	<view style="height: 180rpx;"></view>
 	   <view class="paixuBox">
 			<view class="paixuLine" @click="defaultpx" :class="{pxActive:defaultpxActive}">
 				默认排序
@@ -55,7 +57,7 @@
 	   				<view class="hotGoodsLineRIght">
 	   					<view class="goodsName">{{item.name}}</view>
 	   				    <view class="Sold" >
-							<view v-if="item.showLabel&&item.showLabel.indexOf('2')!=-1">
+							<view v-if="item.showLabel&&item.showLabel.indexOf('3')!=-1">
 								已售 {{item.saleQty}}
 							</view>
 						</view>
@@ -63,14 +65,16 @@
 	   						<view class="goodsPrice1">{{item.saleLabel}}</view>
 	   						<view class="goodsPrice2">¥</view>
 	   						<view class="goodsPrice3">{{item.salePrice?item.salePrice:item.scribingPrice}}</view>
-	   						<view class="goodsPrice4" v-if="item.salePrice&&item.scribingPrice">¥{{item.scribingPrice}}</view>
+	   						<view class="goodsPrice4" v-if="item.showLabel&&item.scribingPrice">
+								<span v-if="item.showLabel.indexOf('1')!=-1">¥{{item.scribingPrice}}</span>
+							</view>
 	   					</view>
 	   				</view>
 	   			</view>
 				<nodata v-if="list.length==0"></nodata>
 	   		</view>
 	   </scroll-view>
-	</view>
+	
 	
 	<!-- 手机号授权 -->
 	<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
@@ -114,7 +118,7 @@
 				orderBy:'',
 				list:[],
 				defaultImg: require("../../static/timg/noimg.png"),
-				defaultpxActive:true,
+				defaultpxActive:false,
 				authorizShow:false,
 				code:'',
 				wxOpenData:'',
@@ -256,6 +260,7 @@
 				this.getlistOpenGoodsPage()
 			},
 			defaultpx(){
+				this.defaultpxActive=true;
 				this.order='';
 				this.orderBy='';
 				this.salessort=false;
@@ -356,6 +361,13 @@
 </script>
 
 <style scoped lang="less">
+.topbox{
+	position: fixed;
+	width: 750rpx;
+	top: -1rpx;
+	left: 0;
+	z-index: 11;
+}
 .inputCh{
 width:40rpx;
 height: 40rpx;
@@ -413,6 +425,10 @@ z-index: 11;
 .scroll-Y{
 	background: #ffffff;
 	width: 750rpx;
+	
+}
+.goodsBox{
+	min-height: calc(100vh - 280rpx);
 }
 .classificationBox{
 	display: flex;
@@ -438,6 +454,7 @@ z-index: 11;
 	margin-top: 20rpx;
 	display: flex;
 	justify-content: space-around;
+	border-bottom: 1px solid #EEEEEE;
 	}
 	.paixuLine{
 		line-height: 37rpx;font-size: 26rpx;color: #666666;padding-top: 18rpx;

+ 107 - 5
pages/user/user.vue

@@ -173,7 +173,17 @@
 
 
 		<!-- <view class="signOut" @click="signOut">退出登录</view> -->
-
+<!-- 手机号授权 -->
+	<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
+		<view class="authorizCont" @click.stop="">
+			<view class="authorizName">{{wxOpenData.miniAppName}}</view>
+			<view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
+			<button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
+		</view>
+		<view style="text-align: center;padding-top: 56rpx;">
+			<image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
+		</view>
+	</view>
 
 	</view>
 </template>
@@ -192,6 +202,9 @@
 					lng: '',
 					lat: '',
 				},
+				authorizShow:false,
+				code:'',
+				wxOpenData:'',
 			}
 		},
 		onLoad(opt) {
@@ -217,15 +230,45 @@
 				this.headImg = wxOpenData.loginInfo.customerInfo.headImgurl;
 				this.uid = wxOpenData.loginInfo.uid;
 			}
-			this.userInfo = uni.getStorageSync("userInfo")
+			//this.userInfo = uni.getStorageSync("userInfo")
+			
 		},
 		onShow() {
-
-			this.queryMyDetail();
+            this.userInfo=this.$store.state.userInfo;
+			if(this.userInfo){
+				this.queryMyDetail();
+			}else{
+				this.authorizShow=true;
+			}
+			
 			
 		},
 		methods: {
-			
+			decryptPhoneNumber: function(e) {
+			  console.log(e);
+			  this.code=e.detail.code
+			  this.wxPhoneLogin()
+			  this.authorizShow=false;
+			},
+			wxPhoneLogin(){
+					 var that=this;
+					 this.$http('miniApp2/sys/wxPhoneLogin', {
+					   appId:'wx33053a645546ec31',
+					   unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243',
+					   code:this.code,
+					   openId:this.wxOpenData.openid
+					  },'POST').then(res => {
+						var data = res.data;
+						if(data.loginInfo){
+							this.userInfo=data.loginInfo.openUser;
+							this.wxOpenData=data.loginInfo;
+							this.$store.commit('mutationswxOpenData', data.loginInfo)
+							this.$store.commit('mutationsuserInfo', this.userInfo)
+						   
+						    this.queryMyDetail()
+						}	
+					  })
+			},
 			map() {
 				console.log("打开地图")
 				var that = this;
@@ -603,4 +646,63 @@
 		width: 44rpx;
 		height: 45rpx;
 	}
+	.authorizBox{
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0, 0, 0, 0.5);
+		position: fixed;
+		top: 0;
+		left: 0;
+	}
+	.authorizCont{
+		margin-top: 30vh;
+		width: 564rpx;
+		height: 408rpx;
+		background: #FFFFFF;
+		border-radius: 24rpx;
+		margin-left: 93rpx;
+		position: relative;
+	}
+	.authorizCloseImg{
+		width: 62rpx;
+		height: 62rpx;
+	}
+	.sqLogoBox{
+		width: 180rpx;
+		height: 180rpx;
+		background: #FFFFFF;
+		border-radius: 90rpx;
+		text-align: center;
+		position: absolute;
+		top: -50rpx;
+		left: 192rpx;
+	}
+	.authorizName{
+		color: #333333;
+		line-height: 42rpx;
+		font-size: 30rpx;
+		text-align: center;
+		padding-top: 58rpx;
+	}
+	.authorizMs{
+		color: #999999;
+		line-height: 36rpx;
+		font-size: 26rpx;
+		width: 452rpx;
+		padding-top: 24rpx;
+		text-align: center;
+		margin-left: 56rpx;
+	}
+	.authorizContbutton{
+		width: 422rpx;
+		height: 88rpx;
+		background: #D53533;
+		border-radius: 44rpx;
+		line-height: 88rpx;
+		text-align: center;
+		font-size:30rpx;
+		color: #FFFFFF;
+		margin-top: 62rpx;
+		margin-left:71rpx;
+	}
 </style>

+ 1 - 1
utils/request.js

@@ -1,6 +1,6 @@
 //测试地址
 const baseUrl = 'http://api.dms.66km.com.cn/'
-//const baseUrl = 'http://192.168.0.122:20187/'
+//const baseUrl = 'http://192.168.0.123:20187/'
 
 //正式地址
 import $store from '../store'