Selaa lähdekoodia

项目日志: 12.15 合并

gubai 2 vuotta sitten
vanhempi
commit
9a8d4d94c1

+ 22 - 10
components/extra/navbarTransparent.vue

xqd xqd xqd xqd xqd xqd
@@ -1,9 +1,9 @@
-<template>
-	<view class="navbarTran" :style="{height: `${placeholderHeight}px`}">
-		<view :style="{height: `${barHeight}px`, marginTop:`${barTop}px`}">
-			<uni-icons style="margin-left: 10px;" type="back" color="#000000" size="26" @click="back"></uni-icons>
-			<text style="margin-left: 10px;">{{title}}</text>
-		</view>
+<template>
+	<view :class="{navbarTran: true, active: active}" :style="{height: `${placeholderHeight}px`}">
+		<view :style="{height: `${barHeight}px`, marginTop:`${barTop}px`}">
+			<uni-icons style="margin-left: 10px;" type="back" color="#000000" size="26" @click="back"></uni-icons>
+			<text style="margin-left: 10px;">{{title}}</text>
+		</view>
 	</view>
 </template>
 
@@ -15,7 +15,9 @@
 			return {
 				barTop:0,
 				barHeight:0,
-				placeholderHeight:0
+				placeholderHeight:0,
+				active:false,
+				timer: 0
 			}
 		},
 		onReady(){
@@ -23,7 +25,11 @@
 			const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
 			this.barHeight = menuButtonInfo.height + (menuButtonInfo.top - this.barTop) * 2
 			this.placeholderHeight = this.barHeight + this.barTop
-		},
+		},
+		onHide(){
+			clearInterval(this.timer)
+		},
+		
 		methods:{
 			back(){
 				uni.navigateBack({
@@ -33,7 +39,8 @@
 						})
 					}
 				})
-			}
+			},
+			
 		}
 	}
 </script>
@@ -45,7 +52,8 @@
 		top: 0;
 		// height: 100rpx;
 		width: 100%;
-		background-color: transparent;
+		background-color: transparent;
+		transition: 0.3s all;
 		
 		>view{
 			display: flex;
@@ -56,6 +64,10 @@
 			color:#000;
 			font-size: 32rpx;
 			text-shadow: 0.1px 0.1px 0.2px #000;
+		}
+		
+		&.active{
+			background-color: #fff;
 		}
 	}
 </style>

+ 28 - 17
pages/goods/goods-detail/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -120,18 +120,16 @@
 						</view>
 					</view>
 					<image style="width: 52rpx;height: 52rpx;" src="/static/icon/close01.png" mode=""  @click="Recipientclose"></image>
-				</view>
-				
-				
+				</view>				
 				<view class="pop-flavor" v-for="i in attr_groups" :key="i.attr_group_id" style="margin-top: 44rpx;">
 					<text>{{i.attr_group_name}}</text>
 					<view class="tab_flavor">
 						<view class="flavorTitle-item" 
-							:class="{'flavorTitle-item-active':flavorIsActive[i.attr_group_id] === item.attr_id}"  
+							:class="{'flavorTitle-item-active':flavorIsActive[i.attr_group_name] === item.attr_name}"
 							v-for="(item,index) in i.attr_list" :key="item.attr_id"
-							@click="flavorchecked(item.attr_id,i.attr_group_id)"
+							@click="flavorchecked(item.attr_name,i.attr_group_name)"
 						>
-							<view :class="{'active-flavor':flavorIsActive[i.attr_group_id] === item.attr_id}">
+							<view :class="{'active-flavor':flavorIsActive[i.attr_group_name] === item.attr_name}">
 								{{item.attr_name}}
 							</view>
 						</view>
@@ -146,7 +144,6 @@
 				<view class="purchase-btn">确认</view>
 			</view>
 		</uni-popup>
-
 		<!-- 二维码购买 -->
 		<uni-popup ref="codePurchase" type="center">
 			<view class="code-purchase">
@@ -161,7 +158,6 @@
 				</view>
 			</view>
 		</uni-popup>
-
 	</view>
 </template>
 
@@ -194,9 +190,7 @@
 				flavorIsActive:{},
 				weightIsActive:0,
 				packIsActive:0,
-				
 				backImageUrl: require('../../../static/icon/add01.png'),
-
 				//轮播图
 				info: [{
 					img: 'http://t9.9026.com/imgs/swiper01.png',
@@ -216,6 +210,9 @@
 				attr_groups:[],
 				page: {
 					title: '产品详情'
+				},
+				sku:{
+					keys: [],
 				}
 			}
 		},
@@ -309,8 +306,9 @@
 						const hotel_ids = JSON.parse(res.data.hotel_ids);
 						(hotel_ids.constructor == Array) && (hotel_ids.length > 0) &&  this.getHotelDetail(hotel_ids[0]);
 						//
-						const sku = JSON.parse(res.data.sku);
-						console.log(sku)
+						const sku = JSON.parse(res.data.sku);
+						this.sku.keys = Object.keys(sku.attrs);
+						this.sku.sku = sku.sku;
 					}
 				})
 			},
@@ -350,9 +348,24 @@
 			},
 			// 口味切换
 			flavorchecked(index,name) {
-				this.$set(this.flavorIsActive, name, index)
-				console.log(this.flavorIsActive)
-				this.specs.flavor=name
+				this.$set(this.flavorIsActive, name, index)			
+				this.specs.flavor=name
+				if(Object.keys(this.flavorIsActive).length < this.sku.keys.length) return;
+
+
+				for(let index=0; index < this.sku.sku.length; index++){
+					const item = this.sku.sku[index];
+					let res = true;
+					for(const k in this.flavorIsActive){
+						if(item[k] != this.flavorIsActive[k]){
+							res = false
+						}
+					}
+					if(res){
+						this.productDetail.price = item.price;
+						break;
+					}
+				}
 			},
 			// 重量切换
 			weightchecked(index,name) {
@@ -386,7 +399,6 @@
 			change1(e) {
 				this.current1 = e.detail.current;
 			},
-			
 			//积分兑换
 			goProductChange(id,flavorIsActive){
 				console.log(flavorIsActive,'------flavorIsActive');
@@ -399,7 +411,6 @@
 				// 	url:'/pages/my/integral/integralOrder?product_id='+id
 				// })
 			},
-			
 			// 跳转积分兑换
 			goIntegralOrder(id){
 				this.$utils.jump({

+ 5 - 5
pages/goods/goods.vue

xqd xqd
@@ -1,17 +1,17 @@
 <template>
 	<view class="goods">
-		<navbarTransparent title="产品活动列表"/>
 		<scroll-view class="scroll-y" @scroll="handleScroll" :scroll-into-view="topItem" scroll-with-animation
-			scroll-y="true">
+			scroll-y="true">
+			<navbarTransparent title="产品活动列表"/>
 			<view id="top"></view>
 			<!-- 背景图 -->
 			<view class="goods-img">
-				<image v-if="bannerImg" style="width: 100%; height: 450rpx;" :src="bannerImg" mode=""></image>
+				<image v-if="bannerImg" style="width: 100vw; height: 82vw;" :src="bannerImg" mode="scaleToFill"></image>
 			</view>
 			<!-- 内容 -->
 			<view class="main">
 				<view class="search">
-					<u-input placeholder="搜索" border='none'  v-model="search" @input="searchText">
+					<u-input id="search-input" placeholder="搜索" border='none'  v-model="search" @input="searchText">
 						<template slot="suffix" style='margin-right:40rpx;'>
 							<u-image :showLoading="true" :showError='true' src="/static/icon/search.png" width="40rpx"
 								height="32rpx"></u-image>
@@ -364,7 +364,7 @@
 
 	.goods-img {
 		width: 100%;
-		height: 450rpx;
+		height: 82vw;
 	}
 
 	.main {

+ 43 - 35
pages/index/vote-detail/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -125,26 +125,26 @@
 				</view>
 				<view class="textfont">
 					<text v-if="!isVoteNum && is_prize==0">今日投票数已用完
-						点击 加入IHG会员 可享受额外{{vipRewardTicketNum}}票数</text>
+						{{!isVoteNum&&is_vip ? '' : `点击 加入IHG会员 可享受额外${vipRewardTicketNum}票数`}}</text>					
 					<text v-if="isVoteNum && is_prize==0 ">今日投票数还有 {{userCanVoteNum}} 次
 						点击再次投票可再次为本项目投票也可为其他项目投票</text>
 					<text v-if="is_prize==1">恭喜你中奖了!
-						获得了{{prizeProduct}}的奖品,请尽快领取</text>
+						获得了{{prizeProduct}}的奖品{{prizeProduct.indexOf('积分')==-1?'':',请尽快领取'}}</text>
 				</view>
 				<view class="btn">
 					<view v-if="is_prize==0" class="cancel"
-						@click="isVoteNum?voteAgain(activity_project_id):closeVote()">
+						@click="isVoteNum?goVote(activity_project_id,true):closeVote()">
 						<text>{{isVoteNum?'再次投票':'关闭'}}</text>
 					</view>
-					<view v-if="is_prize==0" class="download" @click="isVoteNum?goOtherItem():goJoin()">
-						<text>{{isVoteNum?'其他项目':'加入IHG会员'}}</text>
+					<view v-if="is_prize==0" class="download" @click="isVoteNum||is_vip?goOtherItem():goJoin()">
+						<text>{{isVoteNum||is_vip?'其他项目':'加入IHG会员' }}</text>
 					</view>
 
 					<view v-if="is_prize==1" class="cancel" @click="closeVote">
 						<text>关闭</text>
 					</view>
-					<view v-if="is_prize==1" class="download" @click="goConvert">
-						<text>去兑换</text>
+					<view v-if="is_prize==1" class="download" @click="goConvert(prizeProduct.indexOf('积分')==-1)">
+						<text>{{prizeProduct.indexOf('积分')==-1?'去兑换':'去查看'}}</text>
 					</view>
 				</view>
 			</view>
@@ -220,23 +220,18 @@
 
 			}
 		},
-		onReady: function(res) {
+		onReady: function(res) {
+			if(!this.$store.getters.userInfo){
+				uni.navigateTo({
+					url: '/pages/login/login'
+				})
+				return;
+			}
 			this.videoContext = uni.createVideoContext('myVideo')
-			console.log('onReady')
-			uni.getStorage({
-				key: 'is_vip',
-				success: (data)=> {
-					console.log(data)
-					this.is_vip = data.data === 1 ? true : false
-					console.log(this.is_vip)
-				},
-				fail:()=>{
-					this.is_vip = false;
-				}
-			});
+			
 			
 		},
-		onLoad(op) {
+		onLoad(op) {	
 			this.activity_project_id = op.id
 			this.getDetail(op.id)
 			this.admin = this.$store.getters.userInfo
@@ -266,7 +261,7 @@
 			},
 
 			//去兑换页面
-			goConvert() {
+			goConvert(isConvert=true) {
 				this.$utils.jump({
 					jump_type: 4,
 					jump_config: '/pages/my/prize/prize'
@@ -289,13 +284,23 @@
 			change1(e) {
 				this.current1 = e.detail.current;
 			},
-			getDetail(id) {
+			getDetail(id,callback) {
 				this.$api.active.getActiveProjectDetail({
 					activity_project_id: id
 				}).then(res => {
 					// console.log(res, "detail")
 					if (res.code == 0) {
-						this.voteDetail = res.data
+						this.voteDetail = res.data
+						uni.getStorage({
+							key: `is_vip_${this.voteDetail.id}`,
+							success: (data)=> {
+								this.is_vip = data.data === 1 ? true : false
+							},
+							fail:()=>{
+								this.is_vip = false;
+							}
+						});
+						
 						this.startTime = res.data.activity.start_time.replace(/-/g, "/")
 						// “yyyy-MM-dd-hh-mm-ss”.replace(/-/g,"/")
 						this.endTime = res.data.activity.end_time.replace(/-/g, "/")
@@ -306,7 +311,8 @@
 							this.isVoteNum = true
 						} else {
 							this.isVoteNum = false
-						}
+						}
+						callback && callback()
 						this.sourceId = res.data.id
 						//跳转vip小程序获得投票数
 						this.vipRewardTicketNum = res.data.activity.vip_reward_ticket_num
@@ -408,12 +414,14 @@
 					this.$api.my.userJoinVip({
 						source_type: 1,
 						source_id: this.sourceId
-					}).then(res => {
+					}).then(res => {
+						console.log(res)
 						uni.setStorage({
-							key: 'is_vip',
+							key: `is_vip_${this.voteDetail.id}`,
 							data: 1,
 						});
-						this.is_vip = true
+						this.is_vip = true
+						this.closeVote()
 					})
 				})
 			},
@@ -426,12 +434,12 @@
 					console.log(res, '投票')
 					if (res.code == 0) {			   
 						this.is_prize = res.data.is_prize
-						if (this.is_prize == 1) {
-							this.prizeProduct = res.data?.product?.name
+						if (this.is_prize == 1) {
+							this.prizeProduct = res.data?.product?.name ? res.data.product.name : `${res.data.integral}积分`
 						}
-						this.openVote()
-						this.getDetail(this.activity_project_id)
-					}  else if(res.code === 1){
+						this.getDetail(this.activity_project_id, this.openVote())
+					}  else if(res.code === 2){
+						console.log(this.is_vip)
 						if(!this.is_vip){
 							this.openVote(false)
 						}else{
@@ -442,8 +450,8 @@
 						}
 					} else {
 						uni.showToast({
-							icon: 'none',
-							title: res.msg
+							icon: 'error',
+							title: res.msg?res.msg:"暂无权限"
 						})
 					}
 				}).catch(err => {

+ 1 - 1
pages/index/vote-detail/poster.vue

xqd
@@ -14,7 +14,7 @@
 		<view :class="{'poster-share':true, on:poster.show}">
 			<view>分享到</view>
 			<view class="poster-share-panel">
-				<view @click="share">
+				<view >
 					 <button class="shareButton" open-type="share"><image src="/static/icon/wechat.svg" mode="aspectFit"/>
 					<text>微信分享</text></button>
 				</view>

+ 46 - 21
pages/map/map.scss

xqd xqd xqd
@@ -1,6 +1,12 @@
 page {
 		height: 100%;
-	}
+	}
+	
+	
+.searchInput{
+	
+}
+
 
 	.map {
 		height: 100%;
@@ -68,16 +74,25 @@ page {
 							}
 
 							.content {
-								margin: 12rpx 0 20rpx;
-								width: 92rpx;
-								height: 34rpx;
-								background: rgba(142, 160, 166, .6);
-								border-radius: 17rpx;
-								color: #ffffff;
-								font-size: 22rpx;
+								width: 100%;
+								height: 64rpx;
 								display: flex;
 								align-items: center;
-								justify-content: center;
+								justify-content: flex-start;
+								flex-wrap: nowrap;
+								overflow: hidden;
+								
+								text{
+									line-height: 36rpx;
+									height: 36rpx;
+									padding: 0 10rpx;
+									/* padding: 4rpx 6rpx; */
+									font-size: 22rpx;
+									color: #ffffff;
+									background: rgba(142, 160, 166, 0.6);
+									border-radius: 17rpx;
+									margin-right: 10rpx;
+								}
 							}
 
 							.bottom {
@@ -456,18 +471,28 @@ page {
 							color: #FFFFFF;
 						}
 
-						.content {
-							margin: 12rpx 0 20rpx;
-							width: 92rpx;
-							height: 34rpx;
-							background: rgba(142, 160, 166, .6);
-							border-radius: 17rpx;
-							color: #ffffff;
-							font-size: 22rpx;
-							display: flex;
-							align-items: center;
-							justify-content: center;
-						}
+						.content {
+							width: 100%;
+							height: 64rpx;
+							display: flex;
+							align-items: center;
+							justify-content: flex-start;
+							flex-wrap: nowrap;
+							overflow: hidden;
+							
+							text{
+								line-height: 36rpx;
+								height: 36rpx;
+								padding: 0 10rpx;
+								/* padding: 4rpx 6rpx; */
+								font-size: 22rpx;
+								color: #ffffff;
+								background: rgba(142, 160, 166, 0.6);
+								border-radius: 17rpx;
+								margin-right: 10rpx;
+							}
+						}
+						
 
 						.bottom {
 							display: flex;

+ 140 - 65
pages/map/map.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -4,14 +4,25 @@
 		<!-- 查询 -->
 		<view class="search" v-if="true">
 			<view class="search-top" style="padding: 16rpx 30rpx 0rpx;margin-bottom: 20rpx;">
-				<view class="search-loupe" @click="isopenSearch = !isopenSearch">
+				<view class="search-loupe" @click="search.openId=search.openId==-2?0:-2">
 					<image style="width: 32rpx;height: 32rpx;" src="/static/icon/search02.png" mode=""></image>
 				</view>
 				<view class="search-area-all">
-					<view :class="search.openId!=item.id?'search-area':'search-areaClick'" 
-					v-for="(item, index) in search.content" :key="item.id" @click="openSelector(item.id)">
-						<text>{{item.name}}</text>
-						<image v-if="search.openId!=item.id" style="width: 16rpx;height: 10rpx;" src="/static/icon/down01.png"
+					<template v-for="(item, index) in search.content"  >
+						<view v-if="index<2" :class="search.openId!=item.id?'search-area':'search-areaClick'" 
+						:key="item.id" @click="openSelector(item.id)">
+							<text>{{item.name}}</text>
+							<image v-if="search.openId!=item.id" style="width: 16rpx;height: 10rpx;" src="/static/icon/down01.png"
+								mode="">
+							</image>
+							<image v-else style="width: 16rpx;height: 10rpx;" src="/static/icon/up01.png"
+								mode="">
+							</image>
+						</view>
+					</template>
+					<view :class="search.openId!=-1?'search-area':'search-areaClick'" @click="openSelector(-1)">
+						<text>更多筛选</text>
+						<image v-if="search.openId!=-1" style="width: 16rpx;height: 10rpx;" src="/static/icon/down01.png"
 							mode="">
 						</image>
 						<image v-else style="width: 16rpx;height: 10rpx;" src="/static/icon/up01.png"
@@ -21,11 +32,11 @@
 				</view>
 				<image @click="goJoin"  style=" flex: none; width: 52rpx;height: 46rpx;" src="/static/icon/vip.png" mode=""></image>
 			</view>
-			<view class="search-detail" v-if="isopenSearch">
-				<u-input placeholder="输入酒店/城市名称搜索酒店" border='none'>
+			<view class="search-detail" style="z-index:9" v-if="search.openId==-2">
+				<u-input placeholder="输入酒店/城市名称搜索酒店" border='none' :value="search.text" @input="syncSearchInput">
 					<template slot="suffix" style='margin-right:40rpx;'>
 						<u-image :showLoading="true" :showError='true' src="/static/icon/search.png" width="40rpx"
-							height="32rpx"></u-image>
+							height="32rpx" @click="confirmSearch"></u-image>
 					</template>
 				</u-input>
 			</view>
@@ -56,45 +67,32 @@
 			
 		
 			<!-- 筛选-->
-			<view class="search-detail" style="z-index: 9;display: none;" v-if="!isSelectSift">
+			<view class="search-detail" style="z-index: 9;" v-if="search.openId==-1">
 				<view class="partner">
-					<view class="partner-top" @click="selectPartner">
-						<text>合作伙伴</text>
-						<image v-if="isPartner" style=" width: 20rpx; height: 12rpx; " src="/static/icon/up02.png"
-							mode=""></image>
-						<image v-if="!isPartner" style=" width: 20rpx; height: 12rpx; " src="/static/icon/down02.png"
-							mode=""></image>
-					</view>
-					<view class="partner-main" v-if="isPartner">
-						<uni-data-checkbox multiple 
-							v-model="search.coop" 
-							:localdata="search.content.coop" 
-							emptyText="无"
-							:map="{text: 'name',value: 'id'}"
-						/>
-					</view>
-
-					<view class="partner-top" style="border-top: none;" @click="selectJoin">
-						<text>加盟品牌</text>
-						<image v-if="isJoin" style=" width: 20rpx; height: 12rpx; " src="/static/icon/up02.png" mode="">
-						</image>
-						<image v-if="!isJoin" style=" width: 20rpx; height: 12rpx; " src="/static/icon/down02.png"
-							mode=""></image>
-					</view>
-					<view class="partner-main" v-if="isJoin">
-						<uni-data-checkbox multiple
-							v-model="search.league" 
-							:localdata="search.content.league" 
-							emptyText="无"
-							:map="{text: 'name',value: 'id'}"
-						/>
-					</view>
-
+					<template v-for="(item,index) in search.content">
+						<view class="partner-top" v-if="index >= 2" @click="search.partner=item.id==search.partner?0:item.id" :key="item.id">
+							<text>{{item.name}}</text>
+							<image v-if="search.openId!=-1" style=" width: 20rpx; height: 12rpx; " src="/static/icon/up02.png"
+								mode=""></image>
+							<image v-else style=" width: 20rpx; height: 12rpx; " src="/static/icon/down02.png"
+								mode=""></image>
+						</view>
+						<view class="partner-main" v-if="search.partner==item.id">
+							<uni-data-checkbox multiple 
+								:value="search.selected"
+								@input="syncSelected"
+								:localdata="item.sub"
+								emptyText="无"
+								:map="{text: 'name',value: 'id'}"
+							/>
+						</view>
+					</template>
 					<view class="search-detail-btn">
 						<view class="search-detail-btn-left" @click="cancelSearch">
 							<text>取消</text>
 						</view>
-						<view class="search-detail-btn-right" >
+
+						<view class="search-detail-btn-right" @click="confirmSearch">
 							<text>确认</text>
 						</view>
 					</view>
@@ -141,9 +139,11 @@
 								<view class="address-detail-main-left">
 									<text class="title">{{item.name}}</text>
 									<view class="content" :style="{opacity: item.label?1:0}">
-										<text>{{item.label}}</text>
+										<template v-if="item.label">
+											<text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
+										</template>
 									</view>
-									<view class="bottom" v-if="item.min_price">
+									<view class="bottom" :style="{opacity: item.min_price?1:0}">
 										<text class="bottom-left">¥</text>
 										<text class="bottom-right">{{item.min_price}}起</text>
 									</view>
@@ -183,9 +183,11 @@
 							<view class="address-detail-main-left">
 								<text class="title">{{item.name}}</text>
 								<view class="content" :style="{opacity: item.label?1:0}">
-									<text>{{item.label}}</text>
+									<template v-if="item.label">
+										<text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
+									</template>
 								</view>
-								<view class="bottom" v-if="item.min_price">
+								<view class="bottom"  :style="{opacity: item.min_price?1:0}">
 									<text class="bottom-left">¥</text>
 									<text class="bottom-right">{{item.min_price}}起</text>
 								</view>
@@ -253,7 +255,9 @@
 					openId:0,
 					isSearch:false,
 					selected:[],
-					currentSelected:[]
+					currentSelected:[],
+					partner:0,
+					checkedselected:[],
 				},
 				areaList: [],
 				//激活指定table菜单
@@ -301,6 +305,32 @@
 			})
 		},
 		methods: {
+			syncSearchInput(e){
+				this.search.text = e
+			},
+			syncSelected(e){
+				if(this.search.checkedselected.length > e.length){
+					const resArr = this.$utils.arrayDiff(this.search.checkedselected, e)
+					const tempSet = new Set(this.search.selected);
+					resArr.forEach(i=>{
+						tempSet.delete(i)
+					})
+					this.search.selected = Array.from(tempSet);
+				}else{
+					this.search.selected = Array.from(new Set([...this.search.selected, ...e]));
+				}		
+				this.search.checkedselected = e;
+				console.log(this.search.selected)
+			},
+			checked(id) {
+				if(this.search.selected.includes(id)){
+					const tempSet = new Set(this.search.selected)
+					tempSet.delete(id)
+					this.search.selected = Array.from(tempSet)
+				}else{
+					this.search.selected.push(id)
+				}
+			},
 			confirmSearch(){
 				this.search.currentSelected = Object.assign(this.search.selected);
 				this.getList();
@@ -336,8 +366,6 @@
 						_this.latitude = res.latitude
 						_this.longitude = res.longitude
 						_this.$refs.map.goLocation(res.latitude,res.longitude)
-						// //获取酒店列表
-						// _this.getList()
 					},
 					fail: function(res) {
 						console.log(res)
@@ -352,8 +380,7 @@
 					success: function(res) {
 						_this.latitude = res.latitude
 						_this.longitude = res.longitude
-						_this.$refs.map.goLocation(res.latitude,res.longitude)
-						_this.getList()
+						_this.getList(true)
 						//获取酒店列表
 					},
 					fail: function(res) {
@@ -372,23 +399,66 @@
 			  return s;
 			},
 			//-------------------------------------
-			//菜单index切换
-			checked(id) {
-				if(this.search.selected.includes(id)){
-					const tempSet = new Set(this.search.selected)
-					tempSet.delete(id)
-					this.search.selected = Array.from(tempSet)
-				}else{
-					this.search.selected.push(id)
-				}
+			requestHotelPage(tempobj){
+				tempobj.page = tempobj.page + 1;
+				this.$api.hotel.getHotelList({
+					...tempobj,
+				}).then(res => {
+					const tempHotelList = res.data.data.map(item=>{
+						item.logo = this.$utils.toHttps(item.logo);
+						return {
+							...item, 
+							marker:{
+								id:item.id,
+								latitude: item.latitude,
+								longitude: item.longitude,
+								width:'34rpx',
+								height:'40rpx',
+								iconPath:'../../static/icon/late02.png' ,
+								active: {
+									width: '90rpx',
+									height: '100rpx',
+									iconPath: item.logo,
+								},
+								noActive:{
+									width:'34rpx',
+									height:'40rpx',
+									iconPath:'../../static/icon/late02.png' ,
+								},
+								callout1: {
+									content:item.name,
+									borderRadius: 10,
+									padding: 10,
+									display: "ALWAYS",
+								},
+							}
+						}
+						this.hotelList.map(item=>{
+							item.distanceToMe=this.space(this.latitude,this.longitude,item.latitude,item.longitude).toFixed(1);
+							return item;
+						})
+						
+					})
+					this.hotelList.push(...tempHotelList)
+					if(res.data.data.length >= 15){
+						this.requestHotelPage(tempobj);
+					}
+				})
 			},
-			getList() {
+			getList(islocal = false) {
 				const tempobj = {type: 1,page: 1,};
 				if(this.search.currentSelected.length){
 					this.search.currentSelected.forEach((item,index) => {
 						tempobj[`category_ids[${index}]`] = item
 					})
 				}
+				if(this.latitude&&this.longitude){
+					tempobj['latitude'] = this.latitude;
+					tempobj['longitude'] = this.longitude;
+				}
+				if(this.search.text){
+					tempobj['name'] = this.search.text;
+				}
 				this.$api.hotel.getHotelList({
 					...tempobj,
 				}).then(res => {
@@ -427,10 +497,12 @@
 						item.distanceToMe=this.space(this.latitude,this.longitude,item.latitude,item.longitude).toFixed(1);
 						return item;
 					})	
-					this.hotelList.sort((prev,next)=>{
-						return prev.distanceToMe-next.distanceToMe;
-					})
-					
+					// this.hotelList.sort((prev,next)=>{
+					// 	return prev.distanceToMe-next.distanceToMe;
+					// })
+					if(islocal){
+						this.$refs.map.goLocation(this.latitude,this.longitude)
+					}
 					setTimeout(()=>{
 						if(!this.beginConfig.hotel_id){
 							this.$refs.map.markertap({markerId: this.hotelList[0].id},true,this.search.isSearch)
@@ -442,6 +514,9 @@
 							this.beginConfig.hotel_id = 0
 						}
 					}, 300)
+					if(res.data.data.length >= 15){
+						this.requestHotelPage(tempobj)
+					}
 				})
 			},
 			//去预定页面

+ 24 - 2
utils/tools.js

xqd
@@ -149,9 +149,31 @@ const jumpJoinVip = () => {
 			}
 		})
 	})
-}
+}
+
+/**
+ * ÇóÊý×é²î¼¯
+ * @param {Object} arr1
+ * @param {Object} arr2
+ */
+const arrayDiff = function(arr1, arr2) {
+    var set1 = new Set(arr1);
+    var set2 = new Set(arr2);
+ 
+    var subset = [];
+ 
+    for (let item of set1) {
+        if (!set2.has(item)) {
+            subset.push(item);
+        }
+    }
+ 
+    return subset;
+}
+
 export default {
 	toHttps,
 	jump,
-	jumpJoinVip
+	jumpJoinVip,
+	arrayDiff
 }