Ver código fonte

优惠券修改

twt 1 mês atrás
pai
commit
d7256e7740
2 arquivos alterados com 225 adições e 24 exclusões
  1. 64 11
      pages/activity/jkDetail.vue
  2. 161 13
      pages/index/discountCardDetail.vue

+ 64 - 11
pages/activity/jkDetail.vue

@@ -61,7 +61,7 @@
 					<img src="../../static/timg/jt2.png" alt="" class="shopjt">
 				</view>
 			</view>
-			<view class="shopCont">
+			<!-- <view class="shopCont">
 				<view class="shopContLeft">
 					<view class="shopName">{{shopInfo.shopName}}</view>
 					<view class="shopTime"><span v-if="shopInfo.startTime">{{shopInfo.startTime}}</span> - <span
@@ -81,6 +81,46 @@
 					</view>
 					
 				</view>
+			</view> -->
+			<view  class="symendinaBox">
+						<view class="shopline" >
+							<view class="newdistance" v-if="shopInfo.distance&&shopInfo.distance!= '0.00'">
+								 <image src="../../static/img2/dh.png" mode="" class="dhImg"></image>
+								<view style="padding-top: 6rpx;"><span >{{shopInfo.distance}}km</span></view>
+							</view>
+							<view class="shoplineLeft">
+								<image :src="shopInfo.doorImg1" mode="" class="shopImg" v-if="shopInfo.doorImg1"></image>
+								<image :src="shopInfo.doorImg2" mode="" class="shopImg" v-else-if="shopInfo.doorImg2"></image>
+								<image src="../../static/timg/noimg.png" mode="" class="shopImg" v-else></image>
+							</view>
+							<view class="shopright">
+								<view style="width: 475rpx;">
+									<view class="shopTop">
+										<view class="shopName">{{shopInfo.shopName}}</view>
+									</view>
+								</view>
+							
+								<view class="shopTime">营业时间:<span v-if="shopInfo.startTime">{{shopInfo.startTime}}</span> - <span
+										v-if="shopInfo.endTime">{{shopInfo.endTime}}</span> </view>
+								<view class="shopBottomLeft">
+									<span class="shopaddress"
+										v-if="shopInfo.address">{{shopInfo.provinceName}}{{shopInfo.cityName}}{{shopInfo.areaName}}{{shopInfo.address}}</span>
+								
+								</view>
+								<view class="shopdhBox">
+									<view class="shopcall"  @click.stop="goMap(shopInfo)">
+										  <image class="shopcallIcon" src="../../static/img2/dhjt.png" mode=""></image>
+										<view class="shopcallTxt">导航</view>
+									</view>
+									<view class="shopcall" @click.stop="makePhoneCall(shopInfo.contactorPhone)">
+										  <image class="shopcallIcon" src="../../static/img2/call.png" mode=""></image>
+										  <view class="shopcallTxt">电话</view>
+									</view>
+									
+								</view>
+							</view>
+						
+						</view>
 			</view>
 			
 		</view>
@@ -265,7 +305,7 @@
 							<view class="shopBottomLeft">
 								<span class="shopaddress"
 									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>
+							<!-- 	<span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span> -->
 							</view>
 						</view>
 					</view>
@@ -307,7 +347,7 @@
 							<view class="shopBottomLeft">
 								<span class="shopaddress"
 									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>
+								<!-- <span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span> -->
 							</view>
 							<view class="shopdhBox">
 								
@@ -1740,11 +1780,7 @@ color: #FFFFFF;font-size: 26rpx;
 		margin: 0 auto;
 		margin-bottom: 10rpx;
 	}
-	.shopName{
-		color: #3C3C3C;
-		font-size: 28rpx;
-		width: 500rpx;
-	}
+	
 	.shopaddress{
 		font-weight: 400;
 		color: #999999;
@@ -1875,10 +1911,11 @@ color: #FFFFFF;font-size: 26rpx;
 	
 	.shopName {
 		color: #333333;
-		font-size: 26rpx;
+		font-size: 32rpx;
 		font-weight: 600;
 	}
 	
+	
 	.span1 {
 		color: #FF4F00;
 		font-size: 36rpx;
@@ -1944,8 +1981,9 @@ color: #FFFFFF;font-size: 26rpx;
 	}
 	.ckshopLine{
 		display: flex;
-		padding: 20rpx 0;
+		padding: 24rpx 0;
 		border-bottom: 1px solid #EEEEEE;
+		position: relative;
 	}
 	button::after{
 	 	border: none;
@@ -2202,7 +2240,7 @@ color: #FFFFFF;font-size: 26rpx;
 		width: 35rpx;height: 35rpx;border-radius: 6rpx;
 	}
 	.newdistance{
-		position: absolute;top: 22rpx;right: 18rpx;
+		position: absolute;top: 22rpx;right: 10rpx;
 		text-align: center;
 		font-size: 22rpx;
 		color: #666666;
@@ -2222,4 +2260,19 @@ color: #FFFFFF;font-size: 26rpx;
 	color: #222222;
 		line-height: 33rpx;padding-left: 8rpx;
 	}
+.shopright{
+	width: 530rpx;
+}
+.shopright {
+		padding-left: 20rpx;
+	}
+.symendinaBox .shopline {
+	position: relative;
+}
+.shopTop .shopName {
+	width: 450rpx;
+	white-space: nowrap;
+	overflow: hidden;
+	text-overflow: ellipsis;
+}
 </style>

+ 161 - 13
pages/index/discountCardDetail.vue

@@ -2,7 +2,7 @@
 	<view class="box">
 		<view style="width: 750rpx;height: 172rpx;" class="boxtop"  :style="{background:'#'+themeColor}"></view>
 
-		<view class="detailBg">
+		<view class="detailBg" v-if="detail">
 			<view class="detailTop">
 				<view class="leftB" v-if="detail.discountType==1">
 					<view class="use">¥<span class="use2">{{detail.actMoney}}</span></view>
@@ -21,7 +21,9 @@
 					</view>
 				    <view class="time" v-if="detail.startTime">
 						有效期:{{detail.startTime.slice(0,10)}}至{{detail.endTime.slice(0,10)}}</view>
-					<view class="time" v-else>有效期:领取后{{detail.endOffsetDays}}天</view> 
+					<view class="time" v-else>有效期:领取后 <span v-if="detail.endOffsetDays">{{detail.endOffsetDays}}</span> 天
+					
+					</view> 
 				</view>
 
 			</view>
@@ -42,7 +44,7 @@
 						    </view>
 					</view> 
 				    
-					 <view v-if="detail.shopList.length">
+					 <view v-if="detail.shopList.length" class="symendinaBox">
 						<view class="shopline" >
 							<view class="newdistance" v-if="detail.shopList[0].distance&&detail.shopList[0].distance!= '0.00'">
 								 <image src="../../static/img2/dh.png" mode="" class="dhImg"></image>
@@ -54,7 +56,7 @@
 								<image src="../../static/timg/noimg.png" mode="" class="shopImg" v-else></image>
 							</view>
 							<view class="shopright">
-								<view style="width: 410rpx;">
+								<view style="width: 475rpx;">
 									<view class="shopTop">
 										<view class="shopName">{{detail.shopList[0].shopName}}</view>
 									</view>
@@ -83,6 +85,10 @@
 						
 						</view>
 					 </view> 
+					 <view class="nodataBox" v-if="detail.shopList.length==0">
+						 <image src="http://dmsphoto.66km.com.cn/thFiles/3C95A4C5-73F8-4B34-902B-703B8A0825C9.png" mode="widthFix" class="nodataImg"></image>
+						 <view class="noTxt">暂无可用门店</view>
+					 </view>
 
 				
 			</view>
@@ -154,7 +160,50 @@
 				<img src="../../static/timg/chahao.png" alt="" class="chahaoImg" @click="spShopHide"/>
 			</view>
 			<view class="spShopLineBox">
-				<view class="spShopLine" v-for="(item,index) in detail.shopNames.split(',')">{{item}}</view>
+				<view class="spShopLine" >
+					<view  class="spShopLineke"  v-for="(item,index) in detail.shopList">
+						<view class="shopline">
+							<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.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">
+								<view style="width: 500rpx;">
+									<view class="shopTop">
+										<view class="shopName">{{item.shopName}}</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">
+									<span class="shopaddress"
+										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>
+							</view>
+						
+						</view>
+					</view>
+					
+				</view>
 			</view>
 		</view>
 		
@@ -204,6 +253,10 @@
 				src: '', // 二维码生成后的图片地址或base64
 				hxShow:false,
 				spShopShow:false,
+				location: {
+					lng: '',
+					lat: '',
+				},
 			}
 		},
 		onLoad(opt) {
@@ -247,19 +300,52 @@
 				this.hxShow=false;
 			},
 			getData() {
+				var that=this
 				uni.showLoading({
 					title: '加载中'
 				});
-                if(this.type==2){
+				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.getData2();
+								
+						
+							},
+							fail(err) {
+								console.log("定位失败")
+						        that.getData2();
+							}
+						});
+					},
+					fail: (err) => {
+						console.log(err)
+						 that.getData2();
+						 
+					}})
+				
+			},
+			getData2(){
+				
+				if(this.type==2){
 					var url='opencoupon/detailsCouponDetails';
 					var params={
 						id: this.id,
-						custId:this.$store.state.wxOpenData.loginInfo.customerInfo.id
+						custId:this.$store.state.wxOpenData.loginInfo.customerInfo.id,
+						lat: this.location.lat ? this.location.lat : '',
+						lng: this.location.lng ? this.location.lng : '',
 					}
 				}else{
 					var url='opencoupon/detailsCoupon'
 					var params={
 						id: this.id,
+						lat: this.location.lat ? this.location.lat : '',
+						lng: this.location.lng ? this.location.lng : '',
 					}
 				}
 				this.$http(url, params, 'GET').then(res => {
@@ -271,10 +357,39 @@
 					}
 					
 					this.detail = res.data;
-
-
+				
+				
 				})
 			},
+			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)
+						}
+					});
+				}
+			},
 		}
 	}
 </script>
@@ -311,8 +426,8 @@
 }
 .spShopLine{
 	color: #333333;font-size: 26rpx;
-	padding: 26rpx 30rpx;
-	border-bottom: 1px solid #EEEEEE;
+	padding: 10rpx 24rpx;
+	/* border-bottom: 1px solid #EEEEEE; */
 }
 .chBox2{
 	display: flex;justify-content: space-between;
@@ -497,6 +612,10 @@ display: flex;
 
 	.leftB {
 		margin-right: 15rpx;
+		width: 170rpx;
+	}
+	.centerB{
+		width: 500rpx;
 	}
 
 	.comtentBox {
@@ -616,7 +735,7 @@ display: flex;
 			height: 100%;
 			}
 	.shopline {
-		margin: 20rpx 24rpx 20rpx;
+		margin: 20rpx 0rpx 24rpx 20rpx;
 	/* 	padding: 20rpx; */
 		background-color: #FFFFFF;
 		border-radius: 10rpx;
@@ -624,7 +743,7 @@ display: flex;
 		display: flex;
 	}
 .newdistance{
-		position: absolute;top: 22rpx;right: 18rpx;
+		position: absolute;top: 2rpx;right: 0rpx;
 		text-align: center;
 		font-size: 22rpx;
 		color: #666666;
@@ -757,4 +876,33 @@ display: flex;
 	color: #222222;
 		line-height: 33rpx;padding-left: 8rpx;
 	}
+	.dhImg{
+		width: 35rpx;height: 35rpx;border-radius: 6rpx;
+	}
+	.nodataImg {
+		width: 400rpx;
+		padding-top: 100rpx;
+	}
+	
+	.noTxt {
+		font-size: 30rpx;
+		color: #999999;
+		padding-top: 50rpx;
+	}
+	
+	.nodataBox {
+		text-align: center;
+	}
+.symendinaBox{
+	border-bottom: 2rpx dashed #eaeaea;
+}
+.spShopLine .shopline{
+	margin: 0;
+	margin-top: 20rpx;
+	padding: 10rpx 0 20rpx 0;
+}
+.spShopLineke{
+	border-bottom: 1px solid #eeeeee;
+
+}
 </style>