|
|
|
@ -7,9 +7,8 @@ |
|
|
|
|
<view class="wc_sbox"> |
|
|
|
|
<view class="dy_fx an_sch"> |
|
|
|
|
<view class="fx_1"> |
|
|
|
|
<input @input="write" type="text" class="an_sch_ipt" @confirm="confirm" |
|
|
|
|
confirm-type="search" color="#666666" placeholder-style="color:#999" |
|
|
|
|
placeholder="输入酒店名称" /> |
|
|
|
|
<input @input="write" type="text" class="an_sch_ipt" @confirm="confirm" confirm-type="search" |
|
|
|
|
color="#666666" placeholder-style="color:#999" placeholder="输入酒店名称" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="an_sch_img" @click="search()"> |
|
|
|
|
<image src="/subPageB/static/img/icon-search.png" class="ac_size_1"></image> |
|
|
|
@ -19,17 +18,14 @@ |
|
|
|
|
|
|
|
|
|
<view class="search-container amt_30"> |
|
|
|
|
<view class="search-tip-bar"> |
|
|
|
|
<view @tap="changeRegionPanel" |
|
|
|
|
:class="[searchItemClass, selectedParam.hiddenRegionPanel ? 'active' : '']" |
|
|
|
|
<view @tap="changeRegionPanel" :class="[searchItemClass, selectedParam.hiddenRegionPanel ? 'active' : '']" |
|
|
|
|
data-type="hiddenRegionPanel"> |
|
|
|
|
{{ regionname }} |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view @tap="changePanel" |
|
|
|
|
:class="[searchItemClass, selectedParam.hiddenSortPanel ? 'active' : '']" |
|
|
|
|
<view @tap="changePanel" :class="[searchItemClass, selectedParam.hiddenSortPanel ? 'active' : '']" |
|
|
|
|
data-type="hiddenSortPanel">智能排序</view> |
|
|
|
|
<view @tap="changePanel" |
|
|
|
|
:class="[searchItemClass, selectedParam.hiddenAttributePanel ? 'active' : '']" |
|
|
|
|
<view @tap="changePanel" :class="[searchItemClass, selectedParam.hiddenAttributePanel ? 'active' : '']" |
|
|
|
|
data-type="hiddenAttributePanel"> |
|
|
|
|
分类筛选 |
|
|
|
|
</view> |
|
|
|
@ -43,9 +39,9 @@ |
|
|
|
|
:url="'/subPageB/hotel/hoteldetail/hoteldetail?id=' + itemName.id + '®ion=' + itemName.region" |
|
|
|
|
v-for="(itemName, index) in listDatas" :key="index"> |
|
|
|
|
<view class="dy_fx aml_30 amr_30 relative"> |
|
|
|
|
<view class="lq_recommend" v-if="itemName.isrecommend=='YES'"> |
|
|
|
|
<image src="https://eluyou.ailuquan.cn/upload/image/2024/mapIcon/daolan/tuijian.png" |
|
|
|
|
mode="widthFix"></image> |
|
|
|
|
<view class="lq_recommend" v-if="itemName.isrecommend == 'YES'"> |
|
|
|
|
<image src="https://eluyou.ailuquan.cn/upload/image/2024/mapIcon/daolan/tuijian.png" mode="widthFix"> |
|
|
|
|
</image> |
|
|
|
|
</view> |
|
|
|
|
<image class="an_ls_img2" :src="itemName.hlogo" mode="aspectFill"></image> |
|
|
|
|
<view class="item-info_jd fx_1 aml_30"> |
|
|
|
@ -54,7 +50,10 @@ |
|
|
|
|
<view class="tip_jd">{{ itemName.hlevel }}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="data_jd"> |
|
|
|
|
<view class="sell_jd"><image src="https://eluyou.ailuquan.cn/upload/image/2024/mapIcon/daolan/icon_address.png" mode="widthFix"></image>距您约{{ itemName.distance }}</view> |
|
|
|
|
<view class="sell_jd"> |
|
|
|
|
<image src="https://eluyou.ailuquan.cn/upload/image/2024/mapIcon/daolan/icon_address.png" |
|
|
|
|
mode="widthFix"></image>距您约{{ itemName.distance }} |
|
|
|
|
</view> |
|
|
|
|
<view class="price_jd"> |
|
|
|
|
<block v-if="itemName.price > 0"> |
|
|
|
|
<text class="num_jd">¥{{ itemName.price }}</text> |
|
|
|
@ -77,8 +76,8 @@ |
|
|
|
|
<view class="sort-group"> |
|
|
|
|
<view @tap="selected" |
|
|
|
|
:class="[pageClass.sortItemClass, selectedParam.sortId == item.id ? 'sort-item-active' : '']" |
|
|
|
|
data-panel="hiddenSortPanel" data-type="sortId" :data-id="item.id" |
|
|
|
|
v-for="(item, index) in filter.sort" :key="index"> |
|
|
|
|
data-panel="hiddenSortPanel" data-type="sortId" :data-id="item.id" v-for="(item, index) in filter.sort" |
|
|
|
|
:key="index"> |
|
|
|
|
{{ item.name }} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -100,8 +99,7 @@ |
|
|
|
|
<scroll-view scrollY class="filter-hd"> |
|
|
|
|
<view @tap="parentLevel" |
|
|
|
|
:class="[pageClass.filterHdItemClass, parentLevelItem == 'attribute_' + items.type ? 'filter-hd-item-active' : '']" |
|
|
|
|
:data-parentLevelItem="'attribute_' + items.type" v-for="(items, index) in filter.attribute" |
|
|
|
|
:key="index"> |
|
|
|
|
:data-parentLevelItem="'attribute_' + items.type" v-for="(items, index) in filter.attribute" :key="index"> |
|
|
|
|
{{ items.name }} |
|
|
|
|
</view> |
|
|
|
|
</scroll-view> |
|
|
|
@ -115,8 +113,8 @@ |
|
|
|
|
</view> |
|
|
|
|
<view @tap="childLevel" |
|
|
|
|
:class="[pageClass.filterBdItem, selectedFIlter['attribute_' + items.type] == item.dicnum ? 'filter-bd-item-active' : '']" |
|
|
|
|
:data-id="item.dicnum" :data-type="'attribute_' + items.type" |
|
|
|
|
v-for="(item, childIndex) in items.child" :key="childIndex"> |
|
|
|
|
:data-id="item.dicnum" :data-type="'attribute_' + items.type" v-for="(item, childIndex) in items.child" |
|
|
|
|
:key="childIndex"> |
|
|
|
|
{{ item.dicname }} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -133,92 +131,83 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'; |
|
|
|
|
import uniNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'; |
|
|
|
|
import uniSection from '@/components/uni-section/uni-section.vue'; |
|
|
|
|
import uniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue'; |
|
|
|
|
// 自定义的mescroll-xinlang.vue |
|
|
|
|
import MescrollUni from '@/components/mescroll-diy/mescroll-xinlang.vue'; |
|
|
|
|
var that; |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
uniIcons, |
|
|
|
|
uniNavBar, |
|
|
|
|
uniSection, |
|
|
|
|
uniStatusBar, |
|
|
|
|
MescrollUni |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
that = this; |
|
|
|
|
return { |
|
|
|
|
searchItemClass: 'search-tip-item', |
|
|
|
|
pageClass: { |
|
|
|
|
sortItemClass: 'sort-item', |
|
|
|
|
filterHdItemClass: 'filter-hd-item', |
|
|
|
|
filterBdItem: 'filter-bd-item' |
|
|
|
|
}, |
|
|
|
|
priceSymbol: '', |
|
|
|
|
destinationBak: 'all', |
|
|
|
|
destination: 'all', |
|
|
|
|
filter: [], |
|
|
|
|
parentLevelItem: 'attribute_htype', |
|
|
|
|
defaultFilter: { |
|
|
|
|
attribute_htype: 0 |
|
|
|
|
}, |
|
|
|
|
latitude: 0, |
|
|
|
|
longitude: 0, |
|
|
|
|
selectedFIlterBak: { |
|
|
|
|
price: 0 |
|
|
|
|
}, |
|
|
|
|
selectedFIlter: { |
|
|
|
|
attribute_htype: 0 |
|
|
|
|
}, |
|
|
|
|
selectedParam: { |
|
|
|
|
sortId: 5, |
|
|
|
|
bm: '', |
|
|
|
|
hiddenSortPanel: !0, |
|
|
|
|
hiddenAttributePanel: !0, |
|
|
|
|
hiddenRegionPanel: !0 |
|
|
|
|
}, |
|
|
|
|
param: { |
|
|
|
|
page: 1, |
|
|
|
|
noData: !1, |
|
|
|
|
loading: !1, |
|
|
|
|
finished: !1 |
|
|
|
|
}, |
|
|
|
|
listDatas: [], |
|
|
|
|
topNum: 0, |
|
|
|
|
rootPaht: this.$config.ROOTPATH, |
|
|
|
|
regionname: '区域', |
|
|
|
|
regionList: [], |
|
|
|
|
searchTitle: '', |
|
|
|
|
downOption: { |
|
|
|
|
auto: false //是否在初始化完毕之后自动执行下拉回调callback; 默认true |
|
|
|
|
}, |
|
|
|
|
upOption: { |
|
|
|
|
auto: true //是否在初始化完毕之后自动执行下拉回调callback; 默认true |
|
|
|
|
}, |
|
|
|
|
top: 0, |
|
|
|
|
import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'; |
|
|
|
|
import uniNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'; |
|
|
|
|
import uniSection from '@/components/uni-section/uni-section.vue'; |
|
|
|
|
import uniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue'; |
|
|
|
|
// 自定义的mescroll-xinlang.vue |
|
|
|
|
import MescrollUni from '@/components/mescroll-diy/mescroll-xinlang.vue'; |
|
|
|
|
var that; |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
uniIcons, |
|
|
|
|
uniNavBar, |
|
|
|
|
uniSection, |
|
|
|
|
uniStatusBar, |
|
|
|
|
MescrollUni |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
that = this; |
|
|
|
|
return { |
|
|
|
|
searchItemClass: 'search-tip-item', |
|
|
|
|
pageClass: { |
|
|
|
|
sortItemClass: 'sort-item', |
|
|
|
|
filterHdItemClass: 'filter-hd-item', |
|
|
|
|
filterBdItem: 'filter-bd-item' |
|
|
|
|
}, |
|
|
|
|
priceSymbol: '', |
|
|
|
|
destinationBak: 'all', |
|
|
|
|
destination: 'all', |
|
|
|
|
filter: [], |
|
|
|
|
parentLevelItem: 'attribute_htype', |
|
|
|
|
defaultFilter: { |
|
|
|
|
attribute_htype: 0 |
|
|
|
|
}, |
|
|
|
|
latitude: 0, |
|
|
|
|
longitude: 0, |
|
|
|
|
selectedFIlterBak: { |
|
|
|
|
price: 0 |
|
|
|
|
}, |
|
|
|
|
selectedFIlter: { |
|
|
|
|
attribute_htype: 0 |
|
|
|
|
}, |
|
|
|
|
selectedParam: { |
|
|
|
|
sortId: 5, |
|
|
|
|
bm: '', |
|
|
|
|
hiddenSortPanel: !0, |
|
|
|
|
hiddenAttributePanel: !0, |
|
|
|
|
hiddenRegionPanel: !0 |
|
|
|
|
}, |
|
|
|
|
param: { |
|
|
|
|
page: 1, |
|
|
|
|
noData: !1, |
|
|
|
|
loading: !1, |
|
|
|
|
finished: !1 |
|
|
|
|
}, |
|
|
|
|
listDatas: [], |
|
|
|
|
topNum: 0, |
|
|
|
|
rootPaht: this.$config.ROOTPATH, |
|
|
|
|
regionname: '区域', |
|
|
|
|
regionList: [], |
|
|
|
|
searchTitle: '', |
|
|
|
|
downOption: { |
|
|
|
|
auto: false //是否在初始化完毕之后自动执行下拉回调callback; 默认true |
|
|
|
|
}, |
|
|
|
|
upOption: { |
|
|
|
|
auto: true //是否在初始化完毕之后自动执行下拉回调callback; 默认true |
|
|
|
|
}, |
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
|
|
mescroll: '', |
|
|
|
|
data: false, |
|
|
|
|
netType: true |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
onLoad(option) { |
|
|
|
|
var that = this; |
|
|
|
|
this.$util.getNetworkType( |
|
|
|
|
function(res) { |
|
|
|
|
if (res.networkType === 'none') { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: that.$param.netMsg, |
|
|
|
|
icon: "none", |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
that.netType = false; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
function() { |
|
|
|
|
mescroll: '', |
|
|
|
|
data: false, |
|
|
|
|
netType: true |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
onLoad(option) { |
|
|
|
|
var that = this; |
|
|
|
|
this.$util.getNetworkType( |
|
|
|
|
function (res) { |
|
|
|
|
if (res.networkType === 'none') { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: that.$param.netMsg, |
|
|
|
|
icon: "none", |
|
|
|
@ -226,261 +215,277 @@ |
|
|
|
|
}) |
|
|
|
|
that.netType = false; |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
if (!that.netType) { |
|
|
|
|
return; |
|
|
|
|
}, |
|
|
|
|
function () { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: that.$param.netMsg, |
|
|
|
|
icon: "none", |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
that.netType = false; |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
if (!that.netType) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$util.hideLoadingByTime(); |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var region = option.region; |
|
|
|
|
if (region != null && region != '') { |
|
|
|
|
this.selectedParam.bm = region; |
|
|
|
|
} |
|
|
|
|
this.get_attribute(); |
|
|
|
|
this.getRedisRegion(); |
|
|
|
|
this.initData(); |
|
|
|
|
//this.get_data(null); |
|
|
|
|
// this.requestLocation(); |
|
|
|
|
that.$util.saveOperatorLog(that, 'FUN', '酒店'); |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.$util.getLocation( |
|
|
|
|
function (res) { |
|
|
|
|
console.log(res,'坐标') |
|
|
|
|
that.$param.clat = res.latitude; |
|
|
|
|
that.$param.clng = res.longitude; |
|
|
|
|
that.destinationBak != that.destination && (that.initData(), that.get_data()); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
/*下拉刷新的回调 */ |
|
|
|
|
downCallback(mescroll) { |
|
|
|
|
that.initData(), that.get_data(mescroll); |
|
|
|
|
//this.get_data(mescroll); |
|
|
|
|
// #ifdef H5 |
|
|
|
|
this.top = uni.upx2px(100 + 88) + 'px'; // H5的高度需加上 88的标题栏 |
|
|
|
|
// #endif |
|
|
|
|
// #ifndef H5 |
|
|
|
|
this.top = uni.upx2px(100) + 'px'; // 非H5不必加 |
|
|
|
|
// #endif |
|
|
|
|
setTimeout(() => { |
|
|
|
|
mescroll.endSuccess(); |
|
|
|
|
this.top = 0; |
|
|
|
|
}, 2500); |
|
|
|
|
}, |
|
|
|
|
upCallback(mescroll) { |
|
|
|
|
var that = this; |
|
|
|
|
if (that.param.page == 1) { |
|
|
|
|
that.mescroll = mescroll; |
|
|
|
|
that.get_data(mescroll); |
|
|
|
|
//that.requestLocation(); |
|
|
|
|
} else { |
|
|
|
|
that.get_data(mescroll); |
|
|
|
|
} |
|
|
|
|
this.$util.hideLoadingByTime(); |
|
|
|
|
}, |
|
|
|
|
write: function (e) { |
|
|
|
|
this.searchTitle = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
search: function () { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var region = option.region; |
|
|
|
|
if (region != null && region != '') { |
|
|
|
|
this.selectedParam.bm = region; |
|
|
|
|
} |
|
|
|
|
this.get_attribute(); |
|
|
|
|
this.getRedisRegion(); |
|
|
|
|
this.initData(); |
|
|
|
|
//this.get_data(null); |
|
|
|
|
// this.requestLocation(); |
|
|
|
|
that.$util.saveOperatorLog(that, 'FUN', '酒店'); |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.destinationBak != this.destination && (this.initData(), this.get_data()); |
|
|
|
|
// |
|
|
|
|
back() { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
showMenu() { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '菜单' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
clickLeft() { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '左侧按钮' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
showCity() { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '选择城市' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
scan() { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '扫码' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
confirm(e) { |
|
|
|
|
this.searchTitle = e.detail.value; |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
this.initData(); |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
/*下拉刷新的回调 */ |
|
|
|
|
downCallback(mescroll) { |
|
|
|
|
that.initData(), that.get_data(mescroll); |
|
|
|
|
//this.get_data(mescroll); |
|
|
|
|
// #ifdef H5 |
|
|
|
|
this.top = uni.upx2px(100 + 88) + 'px'; // H5的高度需加上 88的标题栏 |
|
|
|
|
// #endif |
|
|
|
|
// #ifndef H5 |
|
|
|
|
this.top = uni.upx2px(100) + 'px'; // 非H5不必加 |
|
|
|
|
// #endif |
|
|
|
|
setTimeout(() => { |
|
|
|
|
mescroll.endSuccess(); |
|
|
|
|
this.top = 0; |
|
|
|
|
}, 2500); |
|
|
|
|
}, |
|
|
|
|
upCallback(mescroll) { |
|
|
|
|
var that = this; |
|
|
|
|
if (that.param.page == 1) { |
|
|
|
|
that.mescroll = mescroll; |
|
|
|
|
that.get_data(mescroll); |
|
|
|
|
//that.requestLocation(); |
|
|
|
|
} else { |
|
|
|
|
that.get_data(mescroll); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
write: function(e) { |
|
|
|
|
this.searchTitle = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
search: function() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
this.initData(); |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
// |
|
|
|
|
back() { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
showMenu() { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '菜单' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
clickLeft() { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '左侧按钮' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
showCity() { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '选择城市' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
scan() { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '扫码' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
confirm(e) { |
|
|
|
|
this.searchTitle = e.detail.value; |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
this.initData(); |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// |
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
callGpsSuccess: function(lat, lng) { |
|
|
|
|
that.$param.clat = lat; |
|
|
|
|
that.$param.clng = lng; |
|
|
|
|
that.latitude = lat; |
|
|
|
|
that.longitude = lng; |
|
|
|
|
that.get_data(); |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
that.$util.unbindGpsObj(); |
|
|
|
|
}, |
|
|
|
|
callGpsFail: function() { |
|
|
|
|
that.latitude = this.$param.lat; |
|
|
|
|
that.longitude = this.$param.lng; |
|
|
|
|
that.get_data(); |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
this.$util.unbindGpsObj(); |
|
|
|
|
}, |
|
|
|
|
requestLocation: function(region) { |
|
|
|
|
console.log('---requestLocation---'); |
|
|
|
|
this.$util.getLocation( |
|
|
|
|
function(res) { |
|
|
|
|
if (that.$wechat.isWechat()) { |
|
|
|
|
that.$param.clat = res.latitude; |
|
|
|
|
that.$param.clng = res.longitude; |
|
|
|
|
that.getData(); |
|
|
|
|
that.get_attribute(), that.initData(), that.get_data(); |
|
|
|
|
} else { |
|
|
|
|
that.get_attribute(), that.initData(), that.get_data(); |
|
|
|
|
} |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
}, |
|
|
|
|
function() { |
|
|
|
|
console.log('location error---'); |
|
|
|
|
callGpsSuccess: function (lat, lng) { |
|
|
|
|
that.$param.clat = lat; |
|
|
|
|
that.$param.clng = lng; |
|
|
|
|
that.latitude = lat; |
|
|
|
|
that.longitude = lng; |
|
|
|
|
that.get_data(); |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
that.$util.unbindGpsObj(); |
|
|
|
|
}, |
|
|
|
|
callGpsFail: function () { |
|
|
|
|
that.latitude = this.$param.lat; |
|
|
|
|
that.longitude = this.$param.lng; |
|
|
|
|
that.get_data(); |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
this.$util.unbindGpsObj(); |
|
|
|
|
}, |
|
|
|
|
requestLocation: function (region) { |
|
|
|
|
console.log('---requestLocation---'); |
|
|
|
|
this.$util.getLocation( |
|
|
|
|
function (res) { |
|
|
|
|
if (that.$wechat.isWechat()) { |
|
|
|
|
that.$param.clat = res.latitude; |
|
|
|
|
that.$param.clng = res.longitude; |
|
|
|
|
that.getData(); |
|
|
|
|
that.get_attribute(), that.initData(), that.get_data(); |
|
|
|
|
} else { |
|
|
|
|
that.get_attribute(), that.initData(), that.get_data(); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
initData: function() { |
|
|
|
|
var param = {}; |
|
|
|
|
param.page = 1; |
|
|
|
|
param.noData = false; |
|
|
|
|
param.finished = false; |
|
|
|
|
this.data = false; |
|
|
|
|
this.param = param; |
|
|
|
|
this.listDatas = []; |
|
|
|
|
this.destinationBak = this.destination; |
|
|
|
|
}, |
|
|
|
|
selected: function(event) { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
this.initData(); |
|
|
|
|
var dataset = event.currentTarget.dataset; |
|
|
|
|
var param = this.selectedParam; |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
}, |
|
|
|
|
function () { |
|
|
|
|
console.log('location error---'); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
initData: function () { |
|
|
|
|
var param = {}; |
|
|
|
|
param.page = 1; |
|
|
|
|
param.noData = false; |
|
|
|
|
param.finished = false; |
|
|
|
|
this.data = false; |
|
|
|
|
this.param = param; |
|
|
|
|
this.listDatas = []; |
|
|
|
|
this.destinationBak = this.destination; |
|
|
|
|
}, |
|
|
|
|
selected: function (event) { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
this.initData(); |
|
|
|
|
var dataset = event.currentTarget.dataset; |
|
|
|
|
var param = this.selectedParam; |
|
|
|
|
|
|
|
|
|
param[dataset.type] = dataset.id; |
|
|
|
|
param.hiddenSortPanel = !0; |
|
|
|
|
//console.log(dataset.id); |
|
|
|
|
this.selectedParam = param; |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
regionSelected: function(event) { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
this.initData(); |
|
|
|
|
var dataset = event.currentTarget.dataset; |
|
|
|
|
var param = this.selectedParam; |
|
|
|
|
param[dataset.type] = dataset.id; |
|
|
|
|
param.hiddenRegionPanel = !0; |
|
|
|
|
// console.log(dataset.id); |
|
|
|
|
this.selectedParam = param; |
|
|
|
|
this.regionname = dataset.name; |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
getRedisRegion: function() { |
|
|
|
|
var that = this; |
|
|
|
|
var data = { |
|
|
|
|
key: that.$param.userkey + '_mdd_list' |
|
|
|
|
}; |
|
|
|
|
that.$Request.post(that.$config.getRedisData, data).then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
that.regionList = res.data.mddList; |
|
|
|
|
var all = { |
|
|
|
|
bm: '', |
|
|
|
|
title: '全部' |
|
|
|
|
}; |
|
|
|
|
that.regionList.unshift(all); |
|
|
|
|
for (var i = 0; i < that.regionList.length; i++) { |
|
|
|
|
if (that.regionList[i].bm == that.selectedParam.bm) { |
|
|
|
|
that.regionname = that.regionList[i].title; |
|
|
|
|
} |
|
|
|
|
param[dataset.type] = dataset.id; |
|
|
|
|
param.hiddenSortPanel = !0; |
|
|
|
|
//console.log(dataset.id); |
|
|
|
|
this.selectedParam = param; |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
regionSelected: function (event) { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
this.initData(); |
|
|
|
|
var dataset = event.currentTarget.dataset; |
|
|
|
|
var param = this.selectedParam; |
|
|
|
|
param[dataset.type] = dataset.id; |
|
|
|
|
param.hiddenRegionPanel = !0; |
|
|
|
|
// console.log(dataset.id); |
|
|
|
|
this.selectedParam = param; |
|
|
|
|
this.regionname = dataset.name; |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
getRedisRegion: function () { |
|
|
|
|
var that = this; |
|
|
|
|
var data = { |
|
|
|
|
key: that.$param.userkey + '_mdd_list' |
|
|
|
|
}; |
|
|
|
|
that.$Request.post(that.$config.getRedisData, data).then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
that.regionList = res.data.mddList; |
|
|
|
|
var all = { |
|
|
|
|
bm: '', |
|
|
|
|
title: '全部' |
|
|
|
|
}; |
|
|
|
|
that.regionList.unshift(all); |
|
|
|
|
for (var i = 0; i < that.regionList.length; i++) { |
|
|
|
|
if (that.regionList[i].bm == that.selectedParam.bm) { |
|
|
|
|
that.regionname = that.regionList[i].title; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
that.getRegion(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
changePanel: function(event) { |
|
|
|
|
var dataSet = event.currentTarget.dataset, |
|
|
|
|
selectedParam = this.selectedParam; |
|
|
|
|
'hiddenSortPanel' == dataSet.type ? (selectedParam.hiddenAttributePanel = !0, selectedParam |
|
|
|
|
.hiddenRegionPanel = !0) : (selectedParam.hiddenSortPanel = !0), |
|
|
|
|
(selectedParam[dataSet.type] = !selectedParam[dataSet.type]), |
|
|
|
|
(this.selectedParam = selectedParam); |
|
|
|
|
}, |
|
|
|
|
changeRegionPanel: function(event) { |
|
|
|
|
var dataSet = event.currentTarget.dataset, |
|
|
|
|
selectedParam = this.selectedParam; |
|
|
|
|
if ('hiddenRegionPanel' == dataSet.type) { |
|
|
|
|
selectedParam.hiddenAttributePanel = !0; |
|
|
|
|
selectedParam.hiddenSortPanel = !0; |
|
|
|
|
} else { |
|
|
|
|
selectedParam.hiddenRegionPanel = !0; |
|
|
|
|
that.getRegion(); |
|
|
|
|
} |
|
|
|
|
(selectedParam[dataSet.type] = !selectedParam[dataSet.type]), (this.selectedParam = selectedParam); |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
changePanel: function (event) { |
|
|
|
|
var dataSet = event.currentTarget.dataset, |
|
|
|
|
selectedParam = this.selectedParam; |
|
|
|
|
'hiddenSortPanel' == dataSet.type ? (selectedParam.hiddenAttributePanel = !0, selectedParam |
|
|
|
|
.hiddenRegionPanel = !0) : (selectedParam.hiddenSortPanel = !0), |
|
|
|
|
(selectedParam[dataSet.type] = !selectedParam[dataSet.type]), |
|
|
|
|
(this.selectedParam = selectedParam); |
|
|
|
|
}, |
|
|
|
|
changeRegionPanel: function (event) { |
|
|
|
|
var dataSet = event.currentTarget.dataset, |
|
|
|
|
selectedParam = this.selectedParam; |
|
|
|
|
if ('hiddenRegionPanel' == dataSet.type) { |
|
|
|
|
selectedParam.hiddenAttributePanel = !0; |
|
|
|
|
selectedParam.hiddenSortPanel = !0; |
|
|
|
|
} else { |
|
|
|
|
selectedParam.hiddenRegionPanel = !0; |
|
|
|
|
} |
|
|
|
|
(selectedParam[dataSet.type] = !selectedParam[dataSet.type]), (this.selectedParam = selectedParam); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
resetFilter: function() { |
|
|
|
|
this.selectedFIlter = { |
|
|
|
|
attribute_htype: 0 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
confirmClick: function() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
this.initData(); |
|
|
|
|
//设置选中的筛选项 |
|
|
|
|
var selectedParam = this.selectedParam; |
|
|
|
|
(selectedParam.hiddenAttributePanel = true), (this.selectedFIlterBak = this.selectedFIlter); |
|
|
|
|
this.parentLevelItem = 'attribute_htype'; |
|
|
|
|
this.selectedParam = selectedParam; |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
parentLevel: function(t) { |
|
|
|
|
var currentTarget = t.currentTarget.dataset; |
|
|
|
|
//console.log("aaaaaaaaaaaaaaaaa"+a.parentlevelitem); |
|
|
|
|
this.parentLevelItem = currentTarget.parentlevelitem; |
|
|
|
|
}, |
|
|
|
|
childLevel: function(t) { |
|
|
|
|
var a = t.currentTarget.dataset, |
|
|
|
|
e = this.selectedFIlter; |
|
|
|
|
this.selectedFIlterBak = e; |
|
|
|
|
e[a.type] = a.id; |
|
|
|
|
this.selectedFIlter = e; |
|
|
|
|
}, |
|
|
|
|
get_attribute: function() { |
|
|
|
|
var that = this; |
|
|
|
|
var url = this.$config.getCondition; |
|
|
|
|
var data = { |
|
|
|
|
type: 'hotel', |
|
|
|
|
userkey: this.$param.userkey, |
|
|
|
|
condition: this.$param.hotelType |
|
|
|
|
}; |
|
|
|
|
resetFilter: function () { |
|
|
|
|
this.selectedFIlter = { |
|
|
|
|
attribute_htype: 0 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
confirmClick: function () { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}); |
|
|
|
|
this.initData(); |
|
|
|
|
//设置选中的筛选项 |
|
|
|
|
var selectedParam = this.selectedParam; |
|
|
|
|
(selectedParam.hiddenAttributePanel = true), (this.selectedFIlterBak = this.selectedFIlter); |
|
|
|
|
this.parentLevelItem = 'attribute_htype'; |
|
|
|
|
this.selectedParam = selectedParam; |
|
|
|
|
this.get_data(); |
|
|
|
|
}, |
|
|
|
|
parentLevel: function (t) { |
|
|
|
|
var currentTarget = t.currentTarget.dataset; |
|
|
|
|
//console.log("aaaaaaaaaaaaaaaaa"+a.parentlevelitem); |
|
|
|
|
this.parentLevelItem = currentTarget.parentlevelitem; |
|
|
|
|
}, |
|
|
|
|
childLevel: function (t) { |
|
|
|
|
var a = t.currentTarget.dataset, |
|
|
|
|
e = this.selectedFIlter; |
|
|
|
|
this.selectedFIlterBak = e; |
|
|
|
|
e[a.type] = a.id; |
|
|
|
|
this.selectedFIlter = e; |
|
|
|
|
}, |
|
|
|
|
get_attribute: function () { |
|
|
|
|
var that = this; |
|
|
|
|
var url = this.$config.getCondition; |
|
|
|
|
var data = { |
|
|
|
|
type: 'hotel', |
|
|
|
|
userkey: this.$param.userkey, |
|
|
|
|
condition: this.$param.hotelType |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
this.$Request.post(url, data).then(res => { |
|
|
|
|
var flag = that.$util.isSuccess(res); |
|
|
|
@ -595,89 +600,41 @@ |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// getRedisData:function(){ |
|
|
|
|
/* var that = this; |
|
|
|
|
var data = { |
|
|
|
|
key: this.$param.userkey + '_hotel_list' |
|
|
|
|
}; |
|
|
|
|
that.$Request.post(that.$config.getRedisData, data).then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
that.param.page += 1; |
|
|
|
|
var listDatas = that.listDatas, |
|
|
|
|
dataListLen = res.data.hotelList.length; |
|
|
|
|
if ( |
|
|
|
|
(dataListLen == that.pageSize |
|
|
|
|
? (that.param.page += 1) |
|
|
|
|
: (that.param.page = 1 && 0 == dataListLen ? (that.param.noData = true) : (that.param.finished = true)), |
|
|
|
|
(that.param.loading = false), |
|
|
|
|
dataListLen > 0) |
|
|
|
|
) { |
|
|
|
|
for (var i = 0; i < dataListLen; i++) { |
|
|
|
|
var item = { |
|
|
|
|
id: res.data.hotelList[i].guid, |
|
|
|
|
hlogo: this.rootPaht + res.data.hotelList[i].hlogo, |
|
|
|
|
hname: res.data.hotelList[i].hname, |
|
|
|
|
hlevel: res.data.hotelList[i].hlevel, |
|
|
|
|
dicname: res.data.hotelList[i].dicname, |
|
|
|
|
hphone: res.data.hotelList[i].hphone, |
|
|
|
|
price: res.data.hotelList[i].price, |
|
|
|
|
distance: this.$util.formatDistance(res.data.hotelList[i].distance) |
|
|
|
|
}; |
|
|
|
|
this.listDatas.push(item); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
} else { */ |
|
|
|
|
// that.get_data(this.selectedParam.bm); |
|
|
|
|
/* } |
|
|
|
|
}); |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
/* requestLocation:function(){ |
|
|
|
|
this.longitude = 31.22; |
|
|
|
|
uni.getLocation({ |
|
|
|
|
type: 'wgs84', |
|
|
|
|
success: function (res) { |
|
|
|
|
this.longitude = res.longitude; |
|
|
|
|
this.latitude = res.latitude; |
|
|
|
|
|
|
|
|
|
console.log('当前位置的经度:' + res.longitude); |
|
|
|
|
console.log('当前位置的纬度:' + res.latitude); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
onPullDownRefresh() { |
|
|
|
|
console.log('onPullDownRefresh'); |
|
|
|
|
setTimeout(function() { |
|
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
|
console.log('stopPullDownRefresh'); |
|
|
|
|
}, 1000); |
|
|
|
|
} |
|
|
|
|
onPullDownRefresh() { |
|
|
|
|
console.log('onPullDownRefresh'); |
|
|
|
|
setTimeout(function () { |
|
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
|
console.log('stopPullDownRefresh'); |
|
|
|
|
}, 1000); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
|
/* @import url('/static/css/common.css'); |
|
|
|
|
/* @import url('/static/css/common.css'); |
|
|
|
|
@import url('hotellist.css'); */ |
|
|
|
|
/* page { |
|
|
|
|
/* page { |
|
|
|
|
background: #fff; |
|
|
|
|
} */ |
|
|
|
|
/* .list-item{ padding: 20rpx; box-sizing: border-box; box-shadow: none; margin-top:0; margin-bottom: 20rpx;} */ |
|
|
|
|
.sort-page { |
|
|
|
|
top: 210rpx !important |
|
|
|
|
} |
|
|
|
|
/* .list-item{ padding: 20rpx; box-sizing: border-box; box-shadow: none; margin-top:0; margin-bottom: 20rpx;} */ |
|
|
|
|
.sort-page { |
|
|
|
|
top: 210rpx !important |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.filter-page { |
|
|
|
|
height: auto; |
|
|
|
|
top: 210rpx !important; |
|
|
|
|
} |
|
|
|
|
.filter-page { |
|
|
|
|
height: auto; |
|
|
|
|
top: 210rpx !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.search-container { |
|
|
|
|
height: auto; |
|
|
|
|
} |
|
|
|
|
.sell_jd image{width: 24rpx;margin-right: 8rpx;} |
|
|
|
|
</style> |
|
|
|
|
.search-container { |
|
|
|
|
height: auto; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.sell_jd image { |
|
|
|
|
width: 24rpx; |
|
|
|
|
margin-right: 8rpx; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|