Przeglądaj źródła

优惠券修改、

twt 1 miesiąc temu
rodzic
commit
7c4577a8d6
3 zmienionych plików z 197 dodań i 17 usunięć
  1. 47 11
      pages/activity/jkDetail.vue
  2. 149 5
      pages/index/discountCardDetail.vue
  3. 1 1
      utils/request.js

+ 47 - 11
pages/activity/jkDetail.vue

@@ -920,11 +920,42 @@
 				this.ckshopShow=false;
 			},
 			queryActivityInfo(){
+				var that=this
+				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.getqueryActivityInfo();
+								
+						
+							},
+							fail(err) {
+								console.log("定位失败")
+						        that.getqueryActivityInfo();
+							}
+						});
+					},
+					fail: (err) => {
+						console.log(err)
+						 that.getqueryActivityInfo();
+						 
+					}})
+				
+				
+			},
+			getqueryActivityInfo(){
 				uni.showLoading({
 					title: '加载中'
 				})
 				this.$http('openHome/queryActivityInfo', {
-					collectingID:this.collectingID
+					collectingID:this.collectingID,
+					lat: this.location.lat ? this.location.lat : '',
+					lng: this.location.lng ? this.location.lng : '',
 				}, 'GET').then(res => {
 					//uni.hideLoading();
 					this.info = res.data;
@@ -1036,18 +1067,23 @@
 					uni.hideLoading();
 					//this.shopInfo = res.data.shopInfo
 					var shopinfo=res.data.shopInfo;
-					this.info.shopList.forEach(item=>{
-						
-						if(item.id==shopinfo.id){
-				            this.ckshopdata=shopinfo
-							this.shopInfo=shopinfo
-							this.shopName=this.shopInfo.shopName
-						}
-					})
-					if(this.shopInfo==''){
+					if(this.location.lng){
 						this.shopInfo=this.info.shopList[0]
-						//this.shopName=this.shopInfo.shopName
+					}else{
+						this.info.shopList.forEach(item=>{
+							
+							if(item.id==shopinfo.id){
+						        this.ckshopdata=shopinfo
+								this.shopInfo=shopinfo
+								this.shopName=this.shopInfo.shopName
+							}
+						})
+						if(this.shopInfo==''){
+							this.shopInfo=this.info.shopList[0]
+							//this.shopName=this.shopInfo.shopName
+						}
 					}
+					
 				 })
 					 this.beginTimer();
 					

+ 149 - 5
pages/index/discountCardDetail.vue

@@ -36,15 +36,42 @@
 								<image src="../../static/img/icon_youhui_red.png" mode="" class="redPoint"></image>
 								<view class="title">适用门店</view>
 						</view>
-							<view v-if="detail.shopNames" @click="spShopS" style="color: #666666;font-size: 24rpx;line-height: 24rpx;display: flex;">
-							{{detail.shopNames.split(',').length}}家门店通用
+							<view v-if="detail.shopList.length" @click="spShopS" style="color: #666666;font-size: 24rpx;line-height: 24rpx;display: flex;">
+							{{detail.shopList.length}}家门店通用
 							<image src="../../static/img/little_rightArrow.png" mode="" style="width: 24rpx;height: 24rpx;"></image>
 						    </view>
 					</view> 
 				    
-					 <view v-for="(v,index) in detail.shopNames.split(',')" v-if="index<5">
-						<view class="content">{{v}}</view>
-					</view> 
+					 <view v-if="detail.shopList.length">
+						<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>
+								<view style="padding-top: 6rpx;"><span >{{detail.shopList[0].distance}}km</span></view>
+							</view>
+							<view class="shoplineLeft">
+								<image :src="detail.shopList[0].doorImg1" mode="" class="shopImg" v-if="detail.shopList[0].doorImg1"></image>
+								<image :src="detail.shopList[0].doorImg2" mode="" class="shopImg" v-else-if="detail.shopList[0].doorImg2"></image>
+								<image src="../../static/timg/noimg.png" mode="" class="shopImg" v-else></image>
+							</view>
+							<view class="shopright">
+								<view style="width: 410rpx;">
+									<view class="shopTop">
+										<view class="shopName">{{detail.shopList[0].shopName}}</view>
+									</view>
+									
+								</view>
+								
+								<view class="shopTime">营业时间:<span v-if="detail.shopList[0].startTime">{{detail.shopList[0].startTime}}</span> - <span
+										v-if="detail.shopList[0].endTime">{{detail.shopList[0].endTime}}</span> </view>
+								<view class="shopBottomLeft">
+									<span class="shopaddress"
+										v-if="detail.shopList[0].address">{{detail.shopList[0].provinceName}}{{detail.shopList[0].cityName}}{{detail.shopList[0].areaName}}{{detail.shopList[0].address}}</span>
+								<!-- 	<span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span> -->
+								</view>
+							</view>
+						
+						</view>
+					 </view> 
 
 				
 			</view>
@@ -577,5 +604,122 @@ display: flex;
 			
 			height: 100%;
 			}
+	.shopline {
+		margin: 0rpx 24rpx 20rpx;
+		padding: 20rpx;
+		background-color: #FFFFFF;
+		border-radius: 10rpx;
+	    position: relative;
+		display: flex;
+	}
+.newdistance{
+		position: absolute;top: 22rpx;right: 18rpx;
+		text-align: center;
+		font-size: 22rpx;
+		color: #666666;
+	}
+.shopbox {
+		padding: 0 16rpx;
+	}
+
+
+
+	.shopImg {
+		width: 146rpx;
+		height: 146rpx;
+		border-radius: 10rpx;
+	}
+
+	.shopCallImg {
+		width: 38rpx;
+		height: 46rpx;
+	}
+
+	.shopTop {
+		display: flex;
+		justify-content: space-between;
+		width: 510rpx;
+	}
+
+	.shopright {
+		padding-left: 20rpx;
+	}
+
+	.shopName {
+		
+		width: 450rpx;
+		white-space: nowrap;
+		overflow: hidden;
+		text-overflow: ellipsis;
+	}
+
+	.shopScore1 {
+		font-size: 36rpx;
+		font-weight: bold;
+		color: #FF4F00;
+		height: 50rpx;
+		line-height: 50rpx;
+	}
+
+	.shopScore11 {
+		font-size: 22rpx;
+		color: #FF4F00;
+		margin-right: 14rpx;
+
+	}
+
+	.shopScore2 {
+		font-size: 22rpx;
+		color: #666666;
+		margin-right: 14rpx;
+		padding: 8rpx 0;
+	}
+
+	.shopScore3 {
+		font-size: 22rpx;
+		color: #333333;
+		padding-left: 20rpx;
+	}
+.shopaddress {
+		width: 400rpx;
+		/* 隐藏文字显示 ...不换行 */
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		color: #999999;
+	}
+.shopCont {
+		padding-left: 22rpx;
+		width: 520rpx;
+	}
+
+	.shopName {
+		    font-size: 32rpx;
+		    font-weight: bold;
+		    color: #222222;
+			line-height: 40rpx;
+			width: 450rpx;
+			white-space: nowrap;
+			overflow: hidden;
+			text-overflow: ellipsis;
 			
+	}
+.shopTime {
+		color: #666666;
+		font-size: 26rpx;
+		padding-top: 4rpx;
+	}
+
+	.addressBox {
+		color: #666666;
+		font-size: 22rpx;
+	}
+	.shopaddress {
+		width: 400rpx;
+		/* 隐藏文字显示 ...不换行 */
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		color: #999999;
+	}
 </style>

+ 1 - 1
utils/request.js

@@ -11,7 +11,7 @@ console.log(extConfig)
 const baseUrl=extConfig.url+'/'
 //const baseUrl='http://api2.dms.66km.com.cn/'
 //const baseUrl='http://dms.66km.com.cn/'
-//const baseUrl='http://192.168.1.18:20187/' 
+//const baseUrl='http://192.168.1.2:20187/' 
 //const baseUrl='https://store-api.qdbtl.cn/'
 //const baseUrl='https://apidms.66km.com/'
 //京猫虎