Browse Source

bug修改

twt 2 years ago
parent
commit
62f61aec00

+ 10 - 3
pages/index/confirmYuyue.vue

@@ -15,7 +15,7 @@
 			  <view class="kklineLeft">
 				<span class="stars">*</span> <span>预约车辆</span>
 			  </view>
-			  <view class="kklineRight">
+			  <view class="kklineRight" @click="goCarlist">
 				  <span>{{carInfo.plateNumber?carInfo.plateNumber:'请选择'}}</span>
 				  <img src="../../static/img/big_rightArrow.png" alt="" class="rightJt">
 			  </view>
@@ -85,13 +85,20 @@
 		onLoad() {
 			console.log(this.$store.state.yuyueData)
 			this.yuyueData=this.$store.state.yuyueData;
-			this.carInfo=this.$store.state.carInfo
+			//this.carInfo=this.$store.state.carInfo
 			this.userInfo = uni.getStorageSync("userInfo");
 			this.yyshopInfo=uni.getStorageSync("yyshopInfo")
 			//this.getOrderTimes()
 		},
-		
+		onShow() {
+			this.carInfo=this.$store.state.carInfo;
+		},
 		methods: {
+			goCarlist(){
+				uni.navigateTo({
+					url:'../user/addCar/cailist'
+				})
+			},
 			yuyue(){
 				if(!this.billDate){
 					uni.showToast({

+ 14 - 6
pages/index/index.vue

@@ -148,7 +148,7 @@
 						<view class="hotSx"></view>
 						<view class="hottitle">热门商品</view>
 					</view>
-					<view class="hotRight">
+					<view class="hotRight" @click="goShop">
 						<view class="hotMore">更多</view>
 						<img src="../../static/timg/icon_arrow_right.png" alt="" class="hotMoreJt">
 					</view>
@@ -213,16 +213,19 @@
 				miniAppName:'',
 				iStatusBarHeight:'',
 				managerInfo:'',
+				unionId:'',
 			}
 		},
 		onLoad() {
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			var that=this;
-			 this.$common.getExtStoreId()
+			 //this.$common.getExtStoreId()
 			 var ext=this.$common.getExtStoreId();
+			 console.log(ext)
 			//console.log( String(Date.now()))
 			this.shopId=ext.shopId;
 			this.url=ext.url;
+			this.unionId=ext.unionId
 			// uni.setStorage({
 			// 	key: 'extdata',
 			// 	data: {
@@ -265,6 +268,11 @@
 					})
 				}
 			},
+			goShop(){
+				uni.switchTab({
+					url:'../shop/shop'
+				})
+			},
 			information(){
 				
 			},
@@ -419,7 +427,7 @@
 				 })
 				 this.$http('miniApp2/sys/getWxOpenID', {
 				   code:e.code,
-				   unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243'
+				   unionId:this.unionId
 				  },'GET').then(res => {
 				 	this.wxOpenData=res.data;
 					
@@ -456,7 +464,7 @@
 				 var that=this;
 				 this.$http('miniApp2/sys/wxPhoneLogin', {
 				   appId:'wx33053a645546ec31',
-				   unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243',
+				   unionId:this.unionId,
 				   code:this.code,
 				   openId:this.wxOpenData.openid
 				  },'POST').then(res => {
@@ -503,7 +511,7 @@
 			 queryHomeCardList(){
 				 //console.log(this.wxOpenData)
 				 this.$http('openHome/queryHomeCardList', {
-				   unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243'
+				   unionId:this.unionId
 				  },'GET').then(res => {
 					    uni.hideLoading();
 				 		this.homeCardList=res.data
@@ -965,7 +973,7 @@
 		font-size: 24rpx;
 		font-weight: 400;
 		color: #FF0000;
-			padding-top: 5rpx;
+		padding-top: 8rpx;
 	}
 	.goodsPrice2{
 		font-size: 22rpx;

+ 2 - 14
pages/index/onlineBooking.vue

@@ -26,7 +26,7 @@
 			  <view class="newshopDadressBpx">
 			    <view class="newshopDaleft">
 			      <view class="newshopDaleftTop">
-			        <img src="../../static/timg/icon_coordinate@2x.png" alt="" class="shopaddressIcon">
+			       <!-- <img src="../../static/timg/icon_coordinate@2x.png" alt="" class="shopaddressIcon"> -->
 			       <!-- <span class="shopDdistance" v-if="Number(shopInfo.distance)>1">距离{{shopInfo.distance}}km</span>
 			        <span class="shopDdistance" v-else-if="Number(shopInfo.distance)">距离{{shopInfo.distance*1000}}m</span>
 			        <span class="shopDdistance" v-else>距离--km</span> -->
@@ -143,19 +143,7 @@
 			}
 			console.log(this.naShopId)
 			var that = this;
-			uni.getLocation({
-				type: 'gcj02',
-				success: function(res) {
-					console.log(res)
-					that.location.lat = res.latitude
-					that.location.lng = res.longitude
-					that.getInfo() 
-			
-				},
-				fail(err) {
-			       that.getInfo()
-				}
-			});
+			that.getInfo()
 			//this.listBigTags()
 		},
 		computed: {

+ 1 - 1
pages/shop/confirm.vue

@@ -27,7 +27,7 @@
 			</view>
 			<view class="contLine">
 				<view class="contlineLeft">车牌号</view>
-				<view class="contlineRight">
+				<view class="contlineRight" @click="goCarlist">
 					<span>{{carInfo.plateNumber}}</span>
 					<image src="../../static/timg/icon_arrow_right.png" mode="" class="contlineRightJt"></image>
 				</view>

+ 183 - 29
pages/shop/goodsDetail.vue

@@ -18,7 +18,7 @@
 				<view class="goodsPrice3">{{info.salePrice?info.salePrice:info.scribingPrice}}</view>
 				<view class="goodsPrice4" v-if="info.scribingPrice">¥{{info.scribingPrice}}</view>
 			</view>
-			<view class="Sold">已售 {{info.saleQty}}</view>
+			<view class="Sold" v-if="info.showLabel&&info.showLabel.indexOf('3')!=-1">已售 {{info.saleQty}}</view>
 		</view>
 		<view class="goodsName">{{info.name}}</view>
 		<view class="goodsMd" v-if="info.sellingPoint">{{info.sellingPoint}}</view>
@@ -29,17 +29,17 @@
 			<view class="modelineLeft">配送方式</view>
 			<view class="modeLineRight">{{info.distributionType==1?'到店取货':'到店使用'}}</view>
 		</view>
-		<view class="modeline">
+		<view class="modeline" v-if="info.oneQty">
 			<view class="modelineLeft">限购数量</view>
-			<view class="modeLineRight" v-if="info.oneQty">{{info.oneQty}}</view>
+			<view class="modeLineRight" >{{info.oneQty}}</view>
 		</view>
-		<view class="modeline">
+		<view class="modeline" v-if="info.afterService">
 			<view class="modelineLeft">售后服务</view>
 			<view class="modeLineRight">{{info.afterService}}</view>
 		</view>
 	</view>
 	<!-- 服务流程 -->
-	<view class="fuwuliucBox">
+	<view class="fuwuliucBox" v-if="info.showLabel&&info.showLabel.indexOf('4')!=-1">
 		<view class="fwlcTitle">服务流程</view>
 		<view class="fwlcxian">
 			<view class="fwlcyuan"></view>
@@ -60,7 +60,7 @@
 	<!-- 套餐内容 -->
 	<view class="mealBox" v-if="info.bizType==3">
 		<view class="fwlcTitle">套餐内容</view>
-		<view class="mealLine" v-for="(item,index) in 2">
+		<view class="mealLine" v-if="info.itemPackTimesDetails">
 			<view class="mealTop">
 				<view class="mealName">项目名称</view>
 				<view class="mealTopRight">
@@ -69,18 +69,30 @@
 				</view>
 			</view>
 			<view class="itemlinebOX">
-				<view class="itemline">
-					<view class="itemname">这是项目名称长长长长长项目名称项目名称长长sss长长换行换</view>
-					<view>20</view>
-					<view>10个月</view>
+				<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-else>永久</view>
 				</view>
-				<view class="itemline">
-					<view class="itemname">这是项目名称</view>
-					<view>200</view>
-					<view>10个月</view>
+			</view>
+		</view>
+		<view class="mealLine" v-if="info.goodsPackTimesDetails">
+			<view class="mealTop">
+				<view class="mealName">商品名称</view>
+				<view class="mealTopRight">
+					<view>数量</view>
+					<view style="padding-left: 44rpx;">有效期</view>
+				</view>
+			</view>
+			<view class="itemlinebOX">
+				<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-else>永久</view>
 				</view>
 			</view>
-			
 		</view>
 	</view>
 	<!-- 商品详情 -->
@@ -100,7 +112,7 @@
 			<image src="../../static/timg/share.png" mode="" class="bottomImg"></image>
 			<view class="bottomTxt">分享</view>
 		</view>
-		<view class="bottomBtn" @click="buyShow=true">立即购买</view>
+		<view class="bottomBtn" @click="ljbuy">立即购买</view>
 		
 	</view>
 	
@@ -111,12 +123,12 @@
 			<view class="goodsBox">
 				<view class="hotGoodsLine" >
 					<view>
-						<image :src="info.ImgList[0].url" mode="" v-if="info.ImgList.length>1" class="hotGoodsLineImg"></image>
+						<image :src="info.ImgList[0].url" mode="" v-if="info.ImgList.length>0" class="hotGoodsLineImg"></image>
 					    <image src="../../static/timg/noimg.png"  class="hotGoodsLineImg" v-else></image>
 					</view>
 					<view class="hotGoodsLineRIght">
 						<view class="goodsName2">{{info.name}}</view>
-					    <view class="Sold" v-if="item.showLabel&&item.showLabel.indexOf('2')!=-1">
+					    <view class="Sold" v-if="info.showLabel&&info.showLabel.indexOf('3')!=-1">
 							已售 {{info.saleQty}}</view>
 						<view class="goodsPrice">
 							<view class="goodsPrice11" v-if="info.saleLabel">{{info.saleLabel}}</view>
@@ -155,7 +167,17 @@
 		</view>
 	</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 :style="{color:colorX}">asdfas</view> -->
 </view>
 </template>
@@ -176,15 +198,21 @@
 					shopName:'',
 					shopId:''
 				},
+				authorizShow:false,
+				code:'',
+				wxOpenData:'',
 			}
 		},
 		onLoad(opt) {
 			this.id=opt.id;
-			this.userInfo = uni.getStorageSync("userInfo");
+			//this.userInfo = uni.getStorageSync("userInfo");
+			this.userInfo=this.$store.state.userInfo;
+			this.wxOpenData=this.$store.state.wxOpenData;
 			this.openGoodsDetailById();
 		},
 		onShow() {
 			this.shopInfo=this.$store.state.ckshopInfo;
+			
 			console.log(this.shopInfo)
 		},
 		methods: {
@@ -202,20 +230,56 @@
 						if(this.info.details){
 							this.info.details = this.info.details.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
 						}
-						var item={
-							shopId:this.info.shopId,
-							shopName:this.info.shopName
-						}
-						this.shopInfo=item
-					    this.$store.commit('mutationsckshopInfo', item)
+						this.szShop()
+						
 				 })
 			},
+			ljbuy(){
+				if(!this.userInfo){
+					this.authorizShow=true
+				}else{
+					this.buyShow=true
+				}
+			
+			},
+			szShop(){
+				if(this.userInfo){
+					this.$http('openMall/openStoreList', {
+					    goodsId:this.id,
+						// lat: '',
+						// lng: '',
+					}, 'GET').then(res => {
+						
+						var queryShopList = res.data
+						//console.log('list+=', this.queryShopList);
+					   queryShopList.forEach(itme=>{
+						   if(item.shopId==this.info.shopId){
+							   var item={
+							   	shopId:this.info.shopId,
+							   	shopName:this.info.shopName
+							   }
+							   this.shopInfo=item
+							   this.$store.commit('mutationsckshopInfo', item)
+						   }
+					   })
+					})
+				}
+				
+			},
 			goINdex(){
 				uni.switchTab({
 					url:'../index/index'
 				})
 			},
 			goBuy(){
+				if(!this.shopInfo.shopId){
+					uni.showToast({
+						title: '请选择服务门店',
+						icon: 'none',
+						duration: 3000
+					});
+					return false;
+				}
 				var that=this;
 				uni.setStorage({
 					key: 'goodsDetail',
@@ -234,11 +298,42 @@
 						this.goodsnum--
 					}
 				}else{
-					if(this.info.oneQty>this.goodsnum){
+					console.log("+++")
+					if(this.info.oneQty!=null){
+						if(this.info.oneQty>this.goodsnum){
+							this.goodsnum++
+						}
+					}else{
 						this.goodsnum++
 					}
+					
 				}
-			}
+			},
+			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.szShop()
+						}	
+					  })
+			},
 			
 		}
 	}
@@ -352,7 +447,7 @@
 .buyNumBox{
 	padding: 30rpx;
     padding-top: 10rpx;
-	padding-top: 70rpx;
+	padding-bottom: 70rpx;
 }
 .buyContCh{
 	position: absolute;
@@ -652,4 +747,63 @@
 	color: #333333;
 	font-size: 26rpx;
 }
+.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>

+ 16 - 11
pages/shop/shop.vue

@@ -67,6 +67,7 @@
 	   					</view>
 	   				</view>
 	   			</view>
+				<nodata v-if="list.length==0"></nodata>
 	   		</view>
 	   </scroll-view>
 	</view>
@@ -88,10 +89,10 @@
 </template>
 
 <script>
-	
+	import nodata from '../../components/nodata/nodata.vue'
 	export default {
 		components: {
-			
+			nodata
 		},
 		
 		data() {
@@ -119,6 +120,7 @@
 				wxOpenData:'',
 				shopcategoryID:'',
 				inputChShow:false,
+				ext:'',
 			}
 		},
 		  watch:{
@@ -138,7 +140,8 @@
 				this.categoryID=this.shopcategoryID
 			}
 			this.userInfo=this.$store.state.userInfo;
-			this.wxOpenData=this.$store.state.wxOpenData
+			this.wxOpenData=this.$store.state.wxOpenData;
+			this.ext=this.$common.getExtStoreId();
 			this.getcategoryList();
 			this.getlistOpenGoodsPage();
 			/* uni.getLocation({
@@ -286,18 +289,19 @@
 				this.getlistOpenGoodsPage()
 			},
 			goDetail(item){
-				if(!this.userInfo){
-					this.authorizShow=true;
-				}else{
-					uni.navigateTo({
-						url:'goodsDetail?id='+item.id
-					})
-				}
+				// if(!this.userInfo){
+				// 	this.authorizShow=true;
+				// }else{
+					
+				// }
+				uni.navigateTo({
+					url:'goodsDetail?id='+item.id
+				})
 				
 			},
 			getcategoryList(){
 				this.$http('openMall/categoryList', {
-				
+				    unionId:this.ext.unionId
 				 },'GET').then(res => {
 						this.categoryList=res.data;
 						var obj={
@@ -326,6 +330,7 @@
 				   categoryID:this.categoryID,
 				   orderBy:this.order,
 				   order:this.orderBy,
+				    unionId:this.ext.unionId
 				 },'GET').then(res => {
 					 uni.hideLoading();
 						var data=res.data.Items;