| 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"
|
| xqd
@@ -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>
|
| xqd
@@ -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>
|
| xqd
@@ -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>
|
| xqd
@@ -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>
|
| xqd
@@ -253,7 +255,9 @@
|
|
|
openId:0,
|
|
|
isSearch:false,
|
|
|
selected:[],
|
|
|
- currentSelected:[]
|
|
|
+ currentSelected:[],
|
|
|
+ partner:0,
|
|
|
+ checkedselected:[],
|
|
|
},
|
|
|
areaList: [],
|
|
|
//激活指定table菜单
|
| xqd
@@ -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();
|
| xqd
@@ -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)
|
| xqd
@@ -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) {
|
| xqd
@@ -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 => {
|
| xqd
@@ -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)
|
| xqd
@@ -442,6 +514,9 @@
|
|
|
this.beginConfig.hotel_id = 0
|
|
|
}
|
|
|
}, 300)
|
|
|
+ if(res.data.data.length >= 15){
|
|
|
+ this.requestHotelPage(tempobj)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
//去预定页面
|