|
@@ -7,7 +7,7 @@
|
|
<view class="search-loupe" @click="search.openId=search.openId==-2?0:-2">
|
|
<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>
|
|
<image style="width: 32rpx;height: 32rpx;" src="/static/icon/search02.png" mode=""></image>
|
|
</view>
|
|
</view>
|
|
- <view class="search-area-all">
|
|
|
|
|
|
+ <view class="search-area-all">
|
|
<template v-for="(item, index) in search.content" >
|
|
<template v-for="(item, index) in search.content" >
|
|
<view v-if="index<2" :class="search.openId!=item.id?'search-area':'search-areaClick'"
|
|
<view v-if="index<2" :class="search.openId!=item.id?'search-area':'search-areaClick'"
|
|
:key="item.id" @click="openSelector(item.id)">
|
|
:key="item.id" @click="openSelector(item.id)">
|
|
@@ -18,19 +18,19 @@
|
|
<image v-else style="width: 16rpx;height: 10rpx;" src="/static/icon/up01.png"
|
|
<image v-else style="width: 16rpx;height: 10rpx;" src="/static/icon/up01.png"
|
|
mode="">
|
|
mode="">
|
|
</image>
|
|
</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"
|
|
|
|
- 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"
|
|
|
|
+ mode="">
|
|
|
|
+ </image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <image style=" flex: none; width: 52rpx;height: 46rpx;" src="/static/icon/vip.png" mode=""></image>
|
|
|
|
|
|
+ <image @click="goJoin" style=" flex: none; width: 52rpx;height: 46rpx;" src="/static/icon/vip.png" mode=""></image>
|
|
</view>
|
|
</view>
|
|
<view class="search-detail" style="z-index:9" v-if="search.openId==-2">
|
|
<view class="search-detail" style="z-index:9" v-if="search.openId==-2">
|
|
<u-input placeholder="输入酒店/城市名称搜索酒店" border='none' :value="search.text" @input="syncSearchInput">
|
|
<u-input placeholder="输入酒店/城市名称搜索酒店" border='none' :value="search.text" @input="syncSearchInput">
|
|
@@ -68,7 +68,7 @@
|
|
|
|
|
|
<!-- 筛选-->
|
|
<!-- 筛选-->
|
|
<view class="search-detail" style="z-index: 9;" v-if="search.openId==-1">
|
|
<view class="search-detail" style="z-index: 9;" v-if="search.openId==-1">
|
|
- <view class="partner">
|
|
|
|
|
|
+ <view class="partner">
|
|
<template v-for="(item,index) in search.content">
|
|
<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">
|
|
<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>
|
|
<text>{{item.name}}</text>
|
|
@@ -78,8 +78,8 @@
|
|
mode=""></image>
|
|
mode=""></image>
|
|
</view>
|
|
</view>
|
|
<view class="partner-main" v-if="search.partner==item.id">
|
|
<view class="partner-main" v-if="search.partner==item.id">
|
|
- <uni-data-checkbox multiple
|
|
|
|
- :value="search.selected"
|
|
|
|
|
|
+ <uni-data-checkbox multiple
|
|
|
|
+ :value="search.selected"
|
|
@input="syncSelected"
|
|
@input="syncSelected"
|
|
:localdata="item.sub"
|
|
:localdata="item.sub"
|
|
emptyText="无"
|
|
emptyText="无"
|
|
@@ -91,6 +91,7 @@
|
|
<view class="search-detail-btn-left" @click="cancelSearch">
|
|
<view class="search-detail-btn-left" @click="cancelSearch">
|
|
<text>取消</text>
|
|
<text>取消</text>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
<view class="search-detail-btn-right" @click="confirmSearch">
|
|
<view class="search-detail-btn-right" @click="confirmSearch">
|
|
<text>确认</text>
|
|
<text>确认</text>
|
|
</view>
|
|
</view>
|
|
@@ -136,11 +137,11 @@
|
|
<view class="inner">
|
|
<view class="inner">
|
|
<view class="address-detail-main">
|
|
<view class="address-detail-main">
|
|
<view class="address-detail-main-left">
|
|
<view class="address-detail-main-left">
|
|
- <text class="title">{{item.name}}</text>
|
|
|
|
- <view class="content" :style="{opacity: item.label?1:0}">
|
|
|
|
- <template v-if="item.label">
|
|
|
|
- <text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <text class="title">{{item.name}}</text>
|
|
|
|
+ <view class="content" :style="{opacity: item.label?1:0}">
|
|
|
|
+ <template v-if="item.label">
|
|
|
|
+ <text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
|
|
|
|
+ </template>
|
|
</view>
|
|
</view>
|
|
<view class="bottom" :style="{opacity: item.min_price?1:0}">
|
|
<view class="bottom" :style="{opacity: item.min_price?1:0}">
|
|
<text class="bottom-left">¥</text>
|
|
<text class="bottom-left">¥</text>
|
|
@@ -181,10 +182,10 @@
|
|
<view class="address-detail-main">
|
|
<view class="address-detail-main">
|
|
<view class="address-detail-main-left">
|
|
<view class="address-detail-main-left">
|
|
<text class="title">{{item.name}}</text>
|
|
<text class="title">{{item.name}}</text>
|
|
- <view class="content" :style="{opacity: item.label?1:0}">
|
|
|
|
- <template v-if="item.label">
|
|
|
|
- <text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <view class="content" :style="{opacity: item.label?1:0}">
|
|
|
|
+ <template v-if="item.label">
|
|
|
|
+ <text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
|
|
|
|
+ </template>
|
|
</view>
|
|
</view>
|
|
<view class="bottom" :style="{opacity: item.min_price?1:0}">
|
|
<view class="bottom" :style="{opacity: item.min_price?1:0}">
|
|
<text class="bottom-left">¥</text>
|
|
<text class="bottom-left">¥</text>
|
|
@@ -254,8 +255,8 @@
|
|
openId:0,
|
|
openId:0,
|
|
isSearch:false,
|
|
isSearch:false,
|
|
selected:[],
|
|
selected:[],
|
|
- currentSelected:[],
|
|
|
|
- partner:0,
|
|
|
|
|
|
+ currentSelected:[],
|
|
|
|
+ partner:0,
|
|
checkedselected:[],
|
|
checkedselected:[],
|
|
},
|
|
},
|
|
areaList: [],
|
|
areaList: [],
|
|
@@ -285,6 +286,9 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ onShow() {
|
|
|
|
+ this.admin = this.$store.getters.userInfo
|
|
|
|
+ },
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
const {hotel_id,category_ids} = e;
|
|
const {hotel_id,category_ids} = e;
|
|
this.beginConfig.hotel_id = hotel_id;
|
|
this.beginConfig.hotel_id = hotel_id;
|
|
@@ -300,32 +304,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)
|
|
|
|
- }
|
|
|
|
|
|
+ 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(){
|
|
confirmSearch(){
|
|
this.search.currentSelected = Object.assign(this.search.selected);
|
|
this.search.currentSelected = Object.assign(this.search.selected);
|
|
@@ -395,51 +399,51 @@
|
|
return s;
|
|
return s;
|
|
},
|
|
},
|
|
//-------------------------------------
|
|
//-------------------------------------
|
|
- 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);
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ 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(islocal = false) {
|
|
getList(islocal = false) {
|
|
const tempobj = {type: 1,page: 1,};
|
|
const tempobj = {type: 1,page: 1,};
|
|
@@ -447,13 +451,13 @@
|
|
this.search.currentSelected.forEach((item,index) => {
|
|
this.search.currentSelected.forEach((item,index) => {
|
|
tempobj[`category_ids[${index}]`] = item
|
|
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;
|
|
|
|
|
|
+ }
|
|
|
|
+ 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({
|
|
this.$api.hotel.getHotelList({
|
|
...tempobj,
|
|
...tempobj,
|
|
@@ -495,23 +499,23 @@
|
|
})
|
|
})
|
|
// this.hotelList.sort((prev,next)=>{
|
|
// this.hotelList.sort((prev,next)=>{
|
|
// return prev.distanceToMe-next.distanceToMe;
|
|
// 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)
|
|
|
|
- this.beginConfig.hotel_id = 0
|
|
|
|
- this.search.isSearch = false
|
|
|
|
- }else{
|
|
|
|
- this.localToMark(this.beginConfig.hotel_id);
|
|
|
|
- // this.$refs.map.markertap({markerId: this.beginConfig.hotel_id})
|
|
|
|
- this.beginConfig.hotel_id = 0
|
|
|
|
- }
|
|
|
|
- }, 300)
|
|
|
|
- if(res.data.data.length >= 15){
|
|
|
|
- this.requestHotelPage(tempobj)
|
|
|
|
|
|
+ // })
|
|
|
|
+ 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)
|
|
|
|
+ this.beginConfig.hotel_id = 0
|
|
|
|
+ this.search.isSearch = false
|
|
|
|
+ }else{
|
|
|
|
+ this.localToMark(this.beginConfig.hotel_id);
|
|
|
|
+ // this.$refs.map.markertap({markerId: this.beginConfig.hotel_id})
|
|
|
|
+ this.beginConfig.hotel_id = 0
|
|
|
|
+ }
|
|
|
|
+ }, 300)
|
|
|
|
+ if(res.data.data.length >= 15){
|
|
|
|
+ this.requestHotelPage(tempobj)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -596,8 +600,57 @@
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
this.scrollData.spa = false;
|
|
this.scrollData.spa = false;
|
|
}, 10)
|
|
}, 10)
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
|
+ //获取当前页面路径
|
|
|
|
+ getPageUrl() {
|
|
|
|
+ const pages = getCurrentPages();
|
|
|
|
+ console.log(pages,'--------->pages')
|
|
|
|
+ if(pages.length==1){
|
|
|
|
+ const currentPage = pages[0];
|
|
|
|
+ let pageUrl = `/${currentPage.route}`;
|
|
|
|
+ return pageUrl
|
|
|
|
+ console.log('当前页面url:', pageUrl);
|
|
|
|
+ }else{
|
|
|
|
+ const currentPage = pages[pages.length - 1];
|
|
|
|
+ let pageUrl = `/${currentPage.route}`;
|
|
|
|
+ return pageUrl
|
|
|
|
+ console.log('当前页面url:', pageUrl);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 跳转其他小程序
|
|
|
|
+ goJoin() {
|
|
|
|
+ let _this = this
|
|
|
|
+ wx.navigateToMiniProgram({
|
|
|
|
+ appId: 'wx255b58f0992b3c53', //appid
|
|
|
|
+ path: 'newUIMain/enrollment/enrollment', //path
|
|
|
|
+ extraData: { //参数
|
|
|
|
+ foo: 'bar'
|
|
|
|
+ },
|
|
|
|
+ // envVersion: 'develop', //开发版develop 开发版 trial 体验版 release 正式版
|
|
|
|
+ success(res) {
|
|
|
|
+ let page = _this.getPageUrl()
|
|
|
|
+ let user_id = ''
|
|
|
|
+ if (_this.admin != null) {
|
|
|
|
+ user_id = _this.admin.id
|
|
|
|
+ } else {
|
|
|
|
+ user_id = 0
|
|
|
|
+ }
|
|
|
|
+ console.log('成功', page)
|
|
|
|
+ _this.$api.my.userMemberAdd({
|
|
|
|
+ user_id,
|
|
|
|
+ page,
|
|
|
|
+ }).then(res => {
|
|
|
|
+ console.log(res.data);
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // 打开成功
|
|
|
|
+ },
|
|
|
|
+ fail(e) {
|
|
|
|
+ console.log(e, '失败')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|