You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
562 lines
16 KiB
562 lines
16 KiB
<template>
|
|
<view>
|
|
<view class="box_1">
|
|
<view class="an_box_mes wc_sbox pb_15">
|
|
<view class="dy_fx an_sch">
|
|
<view class="fx_1">
|
|
<input
|
|
@input="write"
|
|
type="text"
|
|
class="an_sch_ipt"
|
|
@confirm="confirm"
|
|
confirm-type="search"
|
|
placeholder-style="color:#999"
|
|
placeholder="搜索娱乐场所"
|
|
/>
|
|
</view>
|
|
<view class="an_sch_img" @click="search()"><image src="/subPage/animg/icon-search.png" class="ac_size_1"></image></view>
|
|
</view>
|
|
|
|
<view class="amt_30">
|
|
<view class="search-container">
|
|
<view class="search-tip-bar">
|
|
<view @tap="changeRegionPanel" :class="[searchItemClass, selectedParam.hiddenRegionPanel ? 'active' : '']" data-type="hiddenRegionPanel">
|
|
{{ regionname }}
|
|
</view>
|
|
|
|
<view @tap="changePanel" :class="[searchItemClass, selectedParam.hiddenSortPanel ? 'active' : '']" data-type="hiddenSortPanel">智能排序</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<scroll-view @scroll="onReachScroll" @bindscrolltolower="lower" class="scroll-view" :scroll-top="topNum" scrollY="true">
|
|
<view class="">
|
|
<swiper class="wc_swp" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
|
|
<swiper-item v-for="(item, index) in foodList" :key="index" @click="goToAntDetail(item.guid, item.bm)">
|
|
<view class="swp2_pic"><image :src="item.logo" mode="widthFix" class="swp_2_img"></image></view>
|
|
</swiper-item>
|
|
</swiper>
|
|
</view>
|
|
|
|
<view class="an_box_3">
|
|
<view :style="chaType" class="wc_tit_wp">
|
|
<view class="an_t"><view class="an_t_1">精品推荐</view></view>
|
|
</view>
|
|
|
|
<!-- -->
|
|
|
|
<view class="amt_30" v-for="(item, index) in shangjiaList" :key="index" @click="goToAntDetail(item.guid, item.bm)">
|
|
<view class="dy_fx ls_inf_box">
|
|
<image :src="item.logo" mode="aspectFill" class="an_ls_img2"></image>
|
|
<view class="fx_1 ls_txt">
|
|
<view class="lst_tit word_2">{{ item.title }}</view>
|
|
<view class="lsinf word_1">{{ item.content }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view v-if="isData" :style="chaType" class="data-is-bottom" @tap="getAntList(selectcondition.bm, true)">+ 查看更多</view>
|
|
<view v-if="!isData" class="data-is-bottom">{{ this.$param.pageMsg }}</view>
|
|
|
|
<!-- 排序 -->
|
|
<!-- <view class="sort-page" :hidden="selectedParam.hiddenSortPanel">
|
|
<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">
|
|
{{item.name}}
|
|
</view>
|
|
</view>
|
|
</view> -->
|
|
<!-- 区域 -->
|
|
<!-- <view class="sort-page" :hidden="selectedParam.hiddenRegionPanel">
|
|
<view class="sort-group wd_flt">
|
|
<view @tap="regionSelected" :class="[pageClass2.sortItemClass,selectedParam.bm==item.bm?'sort-item-active2':'']"
|
|
data-panel="hiddenRegionPanel" :data-name="item.mc" data-type="bm" :data-id="item.bm" v-for="(item,index) in filter.regionList"
|
|
:key="index" hover-stay-time="400ms">
|
|
<text>{{item.mc}}</text>
|
|
</view>
|
|
</view>
|
|
</view> -->
|
|
<!-- <view class="sort-page" :hidden="selectedParam.hiddenRegionPanel">
|
|
<view class="sort-group">
|
|
<view @tap="regionSelected" :class="[pageClass.sortItemClass,selectedParam.bm==item.bm?'sort-item-active':'']"
|
|
data-panel="hiddenRegionPanel" :data-name="item.title" data-type="bm" :data-id="item.bm" v-for="(item,index) in regionList" :key="index">
|
|
{{item.title}}
|
|
</view>
|
|
</view>
|
|
</view> -->
|
|
<view class="sort-page" :hidden="selectedParam.hiddenSortPanel">
|
|
<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"
|
|
>
|
|
{{ item.name }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="sort-page" :hidden="selectedParam.hiddenRegionPanel">
|
|
<view class="sort-group">
|
|
<view
|
|
@tap="regionSelected"
|
|
:class="[pageClass.sortItemClass, selectedParam.bm == item.bm ? 'sort-item-active' : '']"
|
|
data-panel="hiddenRegionPanel"
|
|
:data-name="item.title"
|
|
data-type="bm"
|
|
:data-id="item.bm"
|
|
v-for="(item, index) in regionList"
|
|
:key="index"
|
|
>
|
|
{{ item.title }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 分类 -->
|
|
<!-- <view class="filter-page" :hidden="selectedParam.hiddenAttributePanel">
|
|
<view class="filter-box">
|
|
<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">{{items.name}}</view>
|
|
</scroll-view>
|
|
<scroll-view scrollY class="filter-bd">
|
|
|
|
<view class="filter-group" v-if="parentLevelItem=='attribute_'+items.type" v-for="(items,index) in filter.attribute"
|
|
:key="items.dicnum">
|
|
<view @tap="childLevel" :class="[pageClass.filterBdItem,selectedFIlter['attribute_'+items.type]==0?'filter-bd-item-active':'']"
|
|
data-id="0" :data-type="'attribute_'+items.type">全 部</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">{{item.dicname}}</view>
|
|
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
<view class="control-bar-block">
|
|
<view @tap="resetFilter" class="control-back-btn">恢复默认</view>
|
|
<view @tap="confirmClick" class="control-confirm-btn">确定</view>
|
|
</view>
|
|
</view> -->
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import uniIcons from '@/components/uni-icons/uni-icons.vue';
|
|
import uniNavBar from '@/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';
|
|
export default {
|
|
components: {
|
|
uniIcons,
|
|
uniNavBar,
|
|
uniSection,
|
|
uniStatusBar
|
|
},
|
|
data() {
|
|
return {
|
|
// 轮播图
|
|
indicatorDots: true,
|
|
autoplay: true,
|
|
interval: 5000,
|
|
duration: 500,
|
|
|
|
tabHeight: 350,
|
|
searchItemClass: 'search-tip-item',
|
|
pageClass: {
|
|
sortItemClass: 'sort-item',
|
|
filterHdItemClass: 'filter-hd-item',
|
|
filterBdItem: 'filter-bd-item'
|
|
},
|
|
pageClass2: {
|
|
sortItemClass: 'sort-item2'
|
|
},
|
|
priceSymbol: '',
|
|
destinationBak: 'all',
|
|
destination: 'all',
|
|
filter: {
|
|
sort: [],
|
|
attribute: []
|
|
},
|
|
regionList: [],
|
|
parentLevelItem: 'attribute_etype',
|
|
defaultFilter: {},
|
|
latitude: 0,
|
|
longitude: 0,
|
|
selectedFIlterBak: {
|
|
price: 0
|
|
},
|
|
selectedFIlter: {
|
|
attribute_etype: 0
|
|
},
|
|
selectedParam: {
|
|
sortId: 3,
|
|
bm: '',
|
|
hiddenSortPanel: !0,
|
|
hiddenAttributePanel: !0,
|
|
hiddenRegionPanel: !0
|
|
},
|
|
param: {
|
|
page: 1,
|
|
noData: !1,
|
|
loading: !1,
|
|
finished: !1
|
|
},
|
|
foodlist: [],
|
|
shangjiaList: [],
|
|
topNum: 0,
|
|
rootPaht: this.$config.ROOTPATH,
|
|
selectcondition: {
|
|
bm: '',
|
|
sortId: 3,
|
|
type: ''
|
|
},
|
|
regionname: '区域',
|
|
width: 280,
|
|
isData: true,
|
|
pageSize: 10,
|
|
searchTitle: '',
|
|
chaType:"display: none;",
|
|
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(){
|
|
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
|
|
});
|
|
this.initData();
|
|
this.get_attribute();
|
|
var region = option.region;
|
|
if (region != null && region != '') {
|
|
this.selectcondition.bm = region;
|
|
this.get_data();
|
|
} else {
|
|
this.getData();
|
|
}
|
|
this.getRedisRegion() /* this.requestLocation(), this.get_data()*/;
|
|
that.$util.saveOperatorLog(that, 'FUN', '娱乐');
|
|
},
|
|
onShow() {
|
|
this.destinationBak != this.destination && (this.initData(), this.get_data());
|
|
},
|
|
methods: {
|
|
write: function(e) {
|
|
this.searchTitle = e.detail.value;
|
|
},
|
|
search: function() {
|
|
this.chaType = 'display: none;';
|
|
uni.showLoading({
|
|
title: '加载中',
|
|
mask: true
|
|
});
|
|
this.initData();
|
|
this.get_data();
|
|
},
|
|
back: function(e) {
|
|
uni.navigateBack({
|
|
delta: 1
|
|
});
|
|
},
|
|
confirm: function(e) {
|
|
this.chaType = 'display: none;';
|
|
uni.showLoading({
|
|
title: '加载中',
|
|
mask: true
|
|
});
|
|
this.searchTitle = e.detail.value;
|
|
this.initData();
|
|
this.get_data();
|
|
},
|
|
getData: function() {
|
|
var that = this;
|
|
var data = {
|
|
"key": this.$param.userkey + "_yule_list"
|
|
}
|
|
that.$Request.post(that.$config.getRedisData, data).then(res => {
|
|
if (res.status == 200) {
|
|
this.param.page += 1;
|
|
var fd = res.data.tuijian;
|
|
for (let i = 0; i < fd.length; i++) {
|
|
fd[i].logo = that.$config.ROOTPATH + fd[i].logo;
|
|
}
|
|
that.width = "width:" + (fd.length * 90) + "%";
|
|
that.foodList = fd;
|
|
var sd = res.data.yuleList;
|
|
for (let i = 0; i < sd.length; i++) {
|
|
sd[i].logo = that.$config.ROOTPATH + sd[i].logo;
|
|
}
|
|
that.shangjiaList = sd;
|
|
if (sd.length < that.pageSize) {
|
|
that.isData = false;
|
|
}
|
|
uni.hideLoading();
|
|
that.chaType = "";
|
|
} else {
|
|
that.get_data();
|
|
}
|
|
})
|
|
},
|
|
initData: function() {
|
|
this.chaType = 'display: none;';
|
|
uni.showLoading({
|
|
title: '加载中',
|
|
mask: true
|
|
});
|
|
var param = {};
|
|
param.page = 1;
|
|
param.noData = false;
|
|
param.finished = false;
|
|
this.isData = true;
|
|
this.param = param;
|
|
this.foodList = [];
|
|
this.shangjiaList = [];
|
|
this.destinationBak = this.destination;
|
|
},
|
|
selected: function(event) {
|
|
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.selectcondition.sortId = dataset.id;
|
|
this.get_data();
|
|
},
|
|
regionSelected: function(event) {
|
|
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.selectcondition.bm = this.selectedParam.bm;
|
|
this.regionname = dataset.name;
|
|
this.get_data();
|
|
},
|
|
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 = this.defaultFilter;
|
|
},
|
|
confirmClick: function() {
|
|
this.initData();
|
|
//设置选中的筛选项
|
|
var selectedParam = this.selectedParam;
|
|
(selectedParam.hiddenAttributePanel = true), (this.selectedFIlterBak = this.selectedFIlter);
|
|
this.parentLevelItem = 'attribute_etype';
|
|
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;
|
|
this.selectcondition.type = a.id;
|
|
},
|
|
getRedisRegion: function() {
|
|
var data = {
|
|
key: this.$param.userkey + '_mdd_list'
|
|
};
|
|
this.$Request.post(this.$config.getRedisData, data).then(res => {
|
|
if (res.status == 200) {
|
|
this.regionList = res.data.mddList;
|
|
var all = {
|
|
bm: '',
|
|
title: '全部'
|
|
};
|
|
this.regionList.unshift(all);
|
|
for (var i = 0; i < this.regionList.length; i++) {
|
|
if (this.regionList[i].bm == this.selectcondition.bm) {
|
|
this.regionname = this.regionList[i].title;
|
|
}
|
|
}
|
|
} else {
|
|
this.getRegion();
|
|
}
|
|
});
|
|
},
|
|
getRegion: function() {
|
|
var that = this;
|
|
var url = this.$config.getMessageInfoFormFilter;
|
|
var data = {
|
|
type: this.$param.mddType,
|
|
userkey: this.$param.userkey,
|
|
pageSize: 100,
|
|
sort: '2'
|
|
};
|
|
this.$Request.post(url, data).then(res => {
|
|
var flag = that.$util.isSuccess(res);
|
|
if (!flag) {
|
|
return;
|
|
}
|
|
this.regionList = res.data;
|
|
var all = {
|
|
bm: '',
|
|
title: '全部'
|
|
};
|
|
this.regionList.unshift(all);
|
|
for (var i = 0; i < this.regionList.length; i++) {
|
|
if (this.regionList[i].bm == this.selectcondition.bm) {
|
|
this.regionname = this.regionList[i].title;
|
|
}
|
|
}
|
|
});
|
|
},
|
|
get_attribute: function() {
|
|
var that = this;
|
|
var url = this.$config.getCondition;
|
|
var data = {
|
|
type: 'food',
|
|
userkey: this.$param.userkey
|
|
};
|
|
this.$Request.post(url, data).then(res => {
|
|
var flag = that.$util.isSuccess(res);
|
|
if (!flag) {
|
|
return;
|
|
}
|
|
this.filter = res.data;
|
|
});
|
|
},
|
|
onReachScroll: function(t) {
|
|
//console.log(t);
|
|
// t.detail.scrollTop > 100 ? this.floorstatus = true : this.floorstatus = false;
|
|
// var a = this.param;
|
|
// a.noData || a.finished || a.loading || this.get_data();
|
|
},
|
|
get_data: function() {
|
|
var that = this;
|
|
var url = this.$config.getMessageInfoFormFilter;
|
|
var data = {
|
|
type: this.$param.entType,
|
|
userkey: this.$param.userkey,
|
|
pageSize: 100,
|
|
//region: this.selectcondition.bm,
|
|
isrecommend: 'YES',
|
|
sort: '2',
|
|
//title: this.searchTitle
|
|
};
|
|
this.$Request.post(url, data).then(res => {
|
|
var flag = that.$util.isSuccess(res);
|
|
if (!flag) {
|
|
return;
|
|
}
|
|
var data = res.data;
|
|
for (let i = 0; i < data.length; i++) {
|
|
data[i].logo = that.$config.ROOTPATH + data[i].logo;
|
|
}
|
|
that.width = 'width:' + data.length * 90 + '%';
|
|
that.foodList = data;
|
|
that.getAntList(that.selectcondition.bm, false);
|
|
});
|
|
},
|
|
getAntList(region, flag) {
|
|
var that = this;
|
|
var url = this.$config.getMessageInfoFormFilter;
|
|
var data = {
|
|
type: this.$param.entType,
|
|
userkey: this.$param.userkey,
|
|
pageno: this.param.page,
|
|
pageSize: this.pageSize,
|
|
region: region,
|
|
sort: this.selectcondition.sortId,
|
|
title: this.searchTitle,
|
|
lng: this.$param.clng,
|
|
lat: this.$param.clat,
|
|
};
|
|
this.$Request.post(url, data).then(res => {
|
|
var flag = that.$util.isSuccess(res);
|
|
if (!flag) {
|
|
return;
|
|
}
|
|
// console.log("列表"+JSON.stringify(res.data))
|
|
var data = res.data;
|
|
for (let i = 0; i < data.length; i++) {
|
|
data[i].logo = that.$config.ROOTPATH + data[i].logo;
|
|
if (flag) {
|
|
this.shangjiaList.push(data[i]);
|
|
}
|
|
}
|
|
if (!flag) {
|
|
this.shangjiaList = data;
|
|
} else {
|
|
this.param.page += 1;
|
|
if (data.length < this.pageSize) {
|
|
this.isData = false;
|
|
}
|
|
}
|
|
uni.hideLoading();
|
|
that.chaType = "";
|
|
});
|
|
},
|
|
goToAntDetail: function(guid, region) {
|
|
uni.navigateTo({
|
|
url: '/subPage/amusement/amusementdetail/amusementdetail?guid=' + guid + '®ion=' + region
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style></style>
|
|
|