twt пре 1 месец
родитељ
комит
0f4be95016
1 измењених фајлова са 267 додато и 15 уклоњено
  1. 267 15
      pages/activity/jkDetail.vue

+ 267 - 15
pages/activity/jkDetail.vue

@@ -64,9 +64,12 @@
 			<view class="shopCont">
 				<view class="shopContLeft">
 					<view class="shopName">{{shopInfo.shopName}}</view>
+					<view class="shopTime"><span v-if="shopInfo.startTime">{{shopInfo.startTime}}</span> - <span
+							v-if="shopInfo.endTime">{{shopInfo.endTime}}</span> </view>
 					<view class="shopaddress">{{shopInfo.address?shopInfo.address:''}}</view>
 				</view>
 				<view class="shopContRight">
+					
 					<view class="shopContRightLine" @click="getmap">
 						<image src="../../static/timg/icon_map.png" alt="" class="shopRightIcon"></image>
 						<view class="shopRightTxt">地图</view>
@@ -76,6 +79,7 @@
 						<image src="../../static/timg/icon_phone.png" alt="" class="shopRightIcon"></image>
 						<view class="shopRightTxt">电话</view>
 					</view>
+					
 				</view>
 			</view>
 			
@@ -167,11 +171,11 @@
 					<image src="../../static/timg/chahao.png" alt="" class="bmChimg" @click="nobmshow"></image>
 				</view>
 				<view style="padding: 0 24rpx;">
-					<view class="bmshopLine" @click="showCkshop">
+					<!-- <view class="bmshopLine" @click="showCkshop">
 						<view class="bmshopname" v-if="!shopName">请选择门店</view>
 						<view class="bmshopname" style="color: #333333;">{{shopName}}</view>
 						<image src="../../static/timg/icon_arrow_right.png" alt="" class="bmshopjt"></image>
-					</view>
+					</view> -->
 					<!-- clWhere报名凭证1,2,3,4 1手机号2车牌号3姓名4单位 -->
 					<view class="bmLine" v-if="info.clWhere.indexOf(1)!=-1" @click="focusState1cl">
 					<!-- :focus="focusState1" -->	<input  type="number" :hold-keyboard="true" :adjust-position="false" @blur="inputBindBlur" @focus="inputBindFocus" v-model="mobilePhone"  class="bmlineInput" placeholder="输入手机号" placeholder-style="color:#999999">
@@ -185,6 +189,40 @@
 					<view class="bmLine" v-if="info.clWhere.indexOf(4)!=-1" @click="focusState4cl">
 					  <input type="text" :adjust-position="false" :hold-keyboard="true"   @blur="inputBindBlur" @focus="inputBindFocus"  v-model="unit"  class="bmlineInput" placeholder="输入单位" placeholder-style="color:#999999">
 					</view>
+					<view class="buySHop" @click="showCkshop">
+						<view>服务门店</view>
+						<view class="buyShopRight" >
+							<view v-if="shopName">切换门店</view><!-- {{shopInfo.shopName}} -->
+							<view v-else>请选择</view>
+							<image src="../../static/timg/icon_arrow_right.png" mode="" class="buyShopRightJt"></image>
+						</view>
+					</view>
+					<view class="buyShopBox"v-if="shopName">
+						<view class="buyShop">
+								<view class="buyShopTop">
+									<view class="buyShopTleft">
+										<!-- <view class="shopbq">距离最近</view> -->
+										<view class="buyshopName">{{shopInfo.shopName}}</view>
+									</view>
+									<view class="buyShopTRgiht">
+									
+										<image src="/static/timg/icon_checked@2x.png" mode="" class="duihao"></image>
+									</view>
+								</view>
+								<view class="buyShopCont">
+									<image :src="shopInfo.doorImg1" v-if="shopInfo.doorImg1" mode="" class="buyShopContImg"></image>
+									<image :src="shopInfo.doorImg2" v-else-if="shopInfo.doorImg2" mode="" class="buyShopContImg"></image>
+									<image src="/static/timg/noimg.png" v-else class="buyShopContImg"></image>
+									<view class="buyShopContAdress">
+										<span v-if="shopInfo.provinceName">{{shopInfo.provinceName}}</span> 
+										<span v-if="shopInfo.cityName">{{shopInfo.cityName}}</span> 
+										<span v-if="shopInfo.areaName">{{shopInfo.areaName}}</span> 
+										<span v-if="shopInfo.address">{{shopInfo.address}}</span> 
+									</view>
+									<view class="buyShopJl" v-if="shopInfo.distance&&shopInfo.distance!= '0.00'">{{shopInfo.distance}}km</view>
+								</view>
+							</view>
+					</view>
 				</view>
 				<view class="bmTtnBox">
 					<view style="height: 1rpx;"></view>
@@ -211,16 +249,17 @@
 				<view style="padding: 0 24rpx; height: 65vh;overflow-y: scroll;">
 					<view class="ckshopLine" v-for="(item,index) in info.shopList" @click="ckshop(item)">
 						<view class="shoplineLeft">
-							<image :src="item.photoPath" mode="" class="shopImg" v-if="item.photoPath"></image>
+							<image :src="item.doorImg1" mode="" class="shopImg" v-if="item.doorImg1"></image>
+							<image :src="item.doorImg2" mode="" class="shopImg" v-else-if="item.doorImg2"></image>
 							<image src="../../static/timg/noimg.png" mode="" class="shopImg" v-else></image>
 						</view>
 						<view class="shopright" style="padding-left: 20rpx;">
 							<view class="shopTop">
 								<view class="shopName">{{item.shopName}}</view>
 							</view>
-							<view class="brandsBg" v-if="item.brands">
+							<!-- <view class="brandsBg" v-if="item.brands">
 								<view class="brands" v-for="(v,index2) in item.brands.split(',')">{{v}}</view>
-							</view>
+							</view> -->
 							<view class="shopTime"><span v-if="item.startTime">{{item.startTime}}</span> - <span
 									v-if="item.endTime">{{item.endTime}}</span> </view>
 							<view class="shopBottomLeft">
@@ -247,17 +286,22 @@
 				</view>
 				<view style="padding: 0 24rpx; height: 65vh;overflow-y: scroll;">
 					<view class="ckshopLine" v-for="(item,index) in info.shopList"  @click="ckshop(item)">
+						<view class="newdistance" v-if="item.distance&&item.distance!= '0.00'">
+							 <image src="../../static/img2/dh.png" mode="" class="dhImg"></image>
+							<view style="padding-top: 6rpx;"><span >{{item.distance}}km</span></view>
+						</view>
 						<view class="shoplineLeft">
-							<image :src="item.photoPath" mode="" class="shopImg" v-if="item.photoPath"></image>
+							<image :src="item.doorImg1" mode="" class="shopImg" v-if="item.doorImg1"></image>
+							<image :src="item.doorImg2" mode="" class="shopImg" v-else-if="item.doorImg2"></image>
 							<image src="../../static/timg/noimg.png" mode="" class="shopImg" v-else></image>
 						</view>
 						<view class="shopright" style="padding-left: 20rpx;">
 							<view class="shopTop">
 								<view class="shopName">{{item.shopName}}</view>
 							</view>
-							<view class="brandsBg" v-if="item.brands">
+							<!-- <view class="brandsBg" v-if="item.brands">
 								<view class="brands" v-for="(v,index2) in item.brands.split(',')">{{v}}</view>
-							</view>
+							</view> -->
 							<view class="shopTime"><span v-if="item.startTime">{{item.startTime}}</span> - <span
 									v-if="item.endTime">{{item.endTime}}</span> </view>
 							<view class="shopBottomLeft">
@@ -265,6 +309,20 @@
 									v-if="item.address">{{item.provinceName}}{{item.cityName}}{{item.areaName}}{{item.address}}</span>
 								<span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span>
 							</view>
+							<view class="shopdhBox">
+								
+								<view class="shopcall"  @click.stop="goMap(item)">
+									  <image class="shopcallIcon" src="../../static/img2/dhjt.png" mode=""></image>
+									<view class="shopcallTxt">导航</view>
+								</view>
+								<view class="shopcall" @click.stop="makePhoneCall(item.contactorPhone)">
+									  <image class="shopcallIcon" src="../../static/img2/call.png" mode=""></image>
+									  <view class="shopcallTxt">电话</view>
+								</view>
+								<!-- <view class="shopcall"></view> -->
+								
+							 
+							</view>
 						</view>
 					</view>
 				</view>
@@ -391,6 +449,10 @@
 				 ticker: null,
 				 djsMoreShow:false,
 				 isgo:true,
+				 location: {
+				 	lng: '',
+				 	lat: '',
+				 },
 			}
 		},
 		onLoad(opt) {
@@ -456,11 +518,12 @@
 			this.shopName=this.$store.state.ckshopInfo.shopName;
 			if(this.$store.state.ckshopInfo){
 				this.ckshopdata=this.$store.state.ckshopInfo
+				this.shopInfo=this.$store.state.ckshopInfo
 			}
 			
-			this.shopInfo=this.$store.state.ckshopInfo
+			
 			/* console.log(this.shopName)
-			console.log(this.ckshopdata) */
+			console.log(this.shopInfo) */
 		},
 		onPullDownRefresh(){
 			//this.getInfo();
@@ -935,9 +998,39 @@
 				});
 			},
 			getInfo(){
+				var that=this
+				that.getInfo2();
+				/* uni.authorize({
+					scope: 'scope.userLocation',
+					success() {
+						uni.getLocation({
+							type: 'gcj02',
+							success: function(res) {
+								console.log(res)
+								that.location.lat = res.latitude
+								that.location.lng = res.longitude
+						        that.getInfo2();
+								
+						
+							},
+							fail(err) {
+								console.log("定位失败")
+						        that.getInfo2();
+							}
+						});
+					},
+					fail: (err) => {
+						console.log(err)
+						 that.getInfo2();
+						 
+					}}) */
+				
+				
+			},
+			getInfo2(){
 				this.$http('openreservation/getInfo', {
-					lat: '',
-					lng: '',
+					lat: this.location.lat ? this.location.lat : '',
+					lng: this.location.lng ? this.location.lng : '',
 				
 				}, 'GET').then(res => {
 					uni.hideLoading();
@@ -946,7 +1039,7 @@
 					this.info.shopList.forEach(item=>{
 						
 						if(item.id==shopinfo.id){
-                            this.ckshopdata=shopinfo
+				            this.ckshopdata=shopinfo
 							this.shopInfo=shopinfo
 							this.shopName=this.shopInfo.shopName
 						}
@@ -955,12 +1048,13 @@
 						this.shopInfo=this.info.shopList[0]
 						//this.shopName=this.shopInfo.shopName
 					}
+				 })
 					 this.beginTimer();
-				})
+					
 			},
 			call() {
 				uni.makePhoneCall({
-					phoneNumber: this.shopInfo.mobilePhone
+					phoneNumber: this.shopInfo.contactorPhone
 				});
 			},
 			getmap() {
@@ -1075,6 +1169,35 @@
 		   			}	
 		   		  })
 		   },
+		   makePhoneCall(num){
+		   	uni.makePhoneCall({
+		   		phoneNumber:num
+		   	});
+		   },
+		   goMap(item){
+		   	var that = this;
+		   	if (!item.lat || !item.lng) {
+		   		uni.showToast({
+		   			title: '该店铺未设置定位',
+		   			icon: 'none',
+		   			duration: 3000
+		   		});
+		   	} else {
+		   		uni.openLocation({
+		   			latitude: Number(item.lat),
+		   			longitude: Number(item.lng),
+		   			name: item.shopName,
+		   			address: item.provinceName + item.cityName + item.areaName +
+		   				item.address,
+		   			success: function() {
+		   				console.log('success');
+		   			},
+		   			fail(err) {
+		   				console.log(err)
+		   			}
+		   		});
+		   	}
+		   },
 		},
 		filters: {
 		    	// 拼团有效期的filter
@@ -1934,4 +2057,133 @@ color: #FFFFFF;font-size: 26rpx;
 		.couponNum{
 			font-size: 26rpx;line-height: 38rpx;color: #999999;
 		}
+.buySHop{
+	display: flex;
+	justify-content: space-between;
+	font-size:28rpx ;
+	color: #666666;
+	padding-top: 30rpx;
+}
+.buyShopBox{
+		/* padding: 0 24rpx; */
+		padding-top: 20rpx;
+	}
+	.nobuyShopBox{
+		height: 220rpx;
+	}
+	.duihao{
+		width: 28rpx;height: 28rpx;
+	}
+	.buyShopTRgiht{
+		    display: flex;
+		    align-items: center;
+	}
+	.buyShop{
+		background: #F9F9F9;
+		border-radius:6rpx;
+		overflow: hidden;
+	}
+	.buyShopTop{
+		display: flex;justify-content: space-between;
+		padding: 16rpx 22rpx;
+		background: #F9EFF0;
+	}
+	.shopbq{
+		color: #FF063A;font-size: 22rpx;
+		border-radius: 6rpx;
+		border: 1rpx solid #FF063A;
+		padding: 0rpx 6rpx;
+		height: 30rpx;line-height: 30rpx;
+	    margin-top: 4rpx;
+	}
+	.buyShopTleft{
+		display: flex;
+	}
+	.buyshopName{
+		font-size: 26rpx;
+		color: #222222;
+		line-height: 37rpx;
+		/* padding-left: 8rpx; */
+	}
+	.buyShopCont{
+		display: flex;
+		padding: 22rpx;
+	}
+	.buyShopContImg{
+		width: 102rpx;
+		height: 102rpx;
+		border-radius: 6rpx;
+	}
+	.buyShopContAdress{
+		font-weight: 400;
+		font-size: 22rpx;
+		color: #666E80;
+		line-height: 34rpx;
+		width: 440rpx;
+		padding-left: 12rpx;
+	}
+	.buyShopJl{
+		font-size: 22rpx;
+		color: #666E80;	line-height: 34rpx;
+		    width: 110rpx;
+		    text-align: right;
+	}
+	.buyNumlineActive{
+		border-radius: 25rpx;
+		border: 1rpx solid #FF0035;
+		color: #FF0035;
+		background: #ffffff;
+		height: 48rpx;
+		line-height: 48rpx;width: 147rpx;
+	}
+	.buyShopRightJt{
+		width: 12rpx;
+		height: 20rpx;
+		margin-top: 8rpx;
+		margin-left: 10rpx;
+	}
+	.buyShopRight{
+		display: flex;
+	}
+	.bugNUm{
+		border-top: 1px solid #EEEEEE;
+		border-Bottom: 1px solid #EEEEEE;
+		padding: 28rpx 0;
+		display: flex;
+		justify-content: space-between;
+	}
+	.buyXg{
+		min-width: 110rpx;
+		height: 36rpx;
+		border-radius: 4rpx;
+		border: 1px solid #F19D01;
+		text-align: center;
+		line-height: 36rpx;
+		color: #F19D01;
+		font-size: 24rpx;
+	}
+	.dhImg{
+		width: 35rpx;height: 35rpx;border-radius: 6rpx;
+	}
+	.newdistance{
+		position: absolute;top: 22rpx;right: 18rpx;
+		text-align: center;
+		font-size: 22rpx;
+		color: #666666;
+	}
+	.shopdhBox{
+		display: flex;padding-top: 20rpx;
+		justify-content: space-between;
+	}
+	.shopcall{
+		display: flex;
+	}
+	.shopcallIcon{
+		width: 26rpx;height: 26rpx;margin-top: 2rpx;
+	}
+	.shopcallTxt{
+	font-size: 24rpx;
+	color: #222222;
+		line-height: 33rpx;padding-left: 8rpx;
+	}
 </style>