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.
510 lines
15 KiB
510 lines
15 KiB
<template>
|
|
<!-- <mescroll-uni :up="upOption" @down="downCallback" @up="upCallback"> -->
|
|
<view>
|
|
<view class="an_box_mes wc_sbox pb_15">
|
|
<view class="dy_fx an_sch">
|
|
<view class="fx_1">
|
|
<input v-model="searchValue" @confirm="search" type="text" class="an_sch_ipt" confirm-type="search" placeholder-style="color:#999" placeholder="输入定制内容名称" />
|
|
</view>
|
|
<view class="an_sch_img" @click="search"><image src="../../../static/animg/icon-search.png" class="ac_size_1"></image></view>
|
|
</view>
|
|
<!-- <view class="search-container box_1 amt_30">
|
|
<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 @tap="changePanel" :class="[searchItemClass, selectedParam.hiddenAttributePanel ? 'active' : '']" data-type="hiddenAttributePanel">分类筛选</view>
|
|
</view>
|
|
</view> -->
|
|
</view>
|
|
<view>
|
|
<scroll-view @scroll="onReachScroll" @bindscrolltolower="lower" class="" :scroll-top="topNum" scrollY="true" style="top:200rpx;height:100vh">
|
|
<view class="list-container" style="background: none;padding-bottom: 40rpx">
|
|
<view class="aml_30 amr_30">
|
|
<navigator
|
|
class="amt_30"
|
|
hover-class="none"
|
|
:url="'/pages/sirendingzhi/sirendingzhidetail/sirendingzhidetail?id=' + item.id"
|
|
v-for="(item, index) in listDatas"
|
|
:key="index"
|
|
>
|
|
<view class="ls_inf_box lunb_img">
|
|
<image class="swp_2_img" mode="aspectFill" :src="item.elogo"></image>
|
|
<!-- <view class="item-city" v-if="item.etype">
|
|
<text>{{item.etype}}</text>
|
|
</view> -->
|
|
<view class="an_v_inf">
|
|
<view class="lst_tit word_1" v-if="item.ename">{{ item.ename }}</view>
|
|
|
|
</view>
|
|
</view>
|
|
</navigator>
|
|
<view class="data-is-bottom" v-if="param.finished">{{ this.$param.pageMsg }}</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- <view class="data-loading" v-if="param.loading">
|
|
<image class="icon" src="../../../static/images/loading-icon.png"></image>
|
|
加载中…
|
|
</view> -->
|
|
<!-- <view class="no-data-info" v-if="param.noData">{{ this.$param.dataMsg }}</view> -->
|
|
</scroll-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>
|
|
<!-- </mescroll-uni> -->
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
searchItemClass: 'search-tip-item',
|
|
pageClass: {
|
|
sortItemClass: 'sort-item',
|
|
filterHdItemClass: 'filter-hd-item',
|
|
filterBdItem: 'filter-bd-item'
|
|
},
|
|
priceSymbol: '',
|
|
destinationBak: 'all',
|
|
destination: 'all',
|
|
filter: [],
|
|
regionList: [],
|
|
parentLevelItem: 'attribute_hoventKey',
|
|
defaultFilter: {
|
|
attribute_hoventKey:0
|
|
},
|
|
latitude: 0,
|
|
longitude: 0,
|
|
selectedFIlterBak: {
|
|
attribute_hoventKey:0
|
|
},
|
|
selectedFIlter: {
|
|
attribute_hoventKey:0
|
|
},
|
|
selectedParam: {
|
|
sortId: 3,
|
|
bm: '',
|
|
hiddenSortPanel: !0,
|
|
hiddenAttributePanel: !0,
|
|
hiddenRegionPanel: !0
|
|
},
|
|
param: {
|
|
page: 1,
|
|
noData: !1,
|
|
loading: !1,
|
|
finished: !1
|
|
},
|
|
listDatas: [],
|
|
topNum: 0,
|
|
rootPaht: this.$config.ROOTPATH,
|
|
selectcondition: {
|
|
bm: '',
|
|
sortId: 3,
|
|
type: ''
|
|
},
|
|
regionname: '区域',
|
|
searchValue:"",
|
|
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.selectedFIlter['attribute_' + this.$param.hoteventTypeKey] = 0;
|
|
this.parentLevelItem = 'attribute_' + this.$param.hoteventTypeKey; */
|
|
this.initData();
|
|
// var region = option.region;
|
|
// if (region != null && region != '') {
|
|
// this.selectcondition.bm = region;
|
|
this.get_data();
|
|
// } else {
|
|
// this.getRedisData();
|
|
// }
|
|
this.getRedisRegion();
|
|
that.$util.saveOperatorLog(that, 'FUN', '活动');
|
|
},
|
|
onShow() {
|
|
this.destinationBak != this.destination && (this.initData(), this.get_data());
|
|
},
|
|
methods: {
|
|
initData: function() {
|
|
uni.showLoading({
|
|
title: '加载中',
|
|
mask: true
|
|
});
|
|
var param = {};
|
|
param.page = 1;
|
|
param.noData = false;
|
|
param.finished = false;
|
|
|
|
this.param = param;
|
|
this.listDatas = [];
|
|
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 = {
|
|
attribute_hoventKey:0
|
|
}
|
|
},
|
|
confirmClick: function() {
|
|
this.initData();
|
|
//设置选中的筛选项
|
|
var selectedParam = this.selectedParam;
|
|
(selectedParam.hiddenAttributePanel = true), (this.selectedFIlterBak = this.selectedFIlter);
|
|
this.parentLevelItem = 'attribute_hoventKey'
|
|
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 = {};
|
|
this.selectedFIlter = e;
|
|
this.selectcondition.type = a.id;
|
|
},
|
|
search: function() {
|
|
this.initData();
|
|
this.get_data();
|
|
},
|
|
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;
|
|
}
|
|
that.regionList = res.data;
|
|
for (var i = 0; i < that.regionList.length; i++) {
|
|
if (that.regionList[i].bm == that.selectcondition.bm) {
|
|
that.regionname = that.regionList[i].title;
|
|
}
|
|
}
|
|
});
|
|
},
|
|
get_attribute: function() {
|
|
var that = this;
|
|
var url = this.$config.getCondition;
|
|
var data = {
|
|
type: 'hotevent',
|
|
userkey: this.$param.userkey,
|
|
condition: this.$param.hoteventType
|
|
};
|
|
|
|
this.$Request.post(url, data).then(res => {
|
|
var flag = that.$util.isSuccess(res);
|
|
if (!flag) {
|
|
return;
|
|
}
|
|
/* if (res.data.attribute != null && res.data.attribute.length > 0) {
|
|
res.data.attribute[0].type = this.$param.hoteventTypeKey;
|
|
} */
|
|
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();
|
|
},
|
|
getRedisData: function() {
|
|
var that = this;
|
|
var data = {
|
|
key: this.$param.userkey + '_hotEvent_list'
|
|
};
|
|
that.$Request.post(that.$config.getRedisData, data).then(res => {
|
|
if(res.status == 200){
|
|
var listDatas = that.listDatas,
|
|
dataListLen = res.data.hoteventList.length,
|
|
data = res.data.hoteventList;
|
|
if (
|
|
(dataListLen == 10 ? (this.param.page += 1) : (this.param.page = 1 && 0 == dataListLen ? (this.param.noData = true) : (this.param.finished = true)),
|
|
(this.param.loading = false),
|
|
dataListLen > 0)
|
|
) {
|
|
for (var i = 0; i < dataListLen; i++) {
|
|
var item = {
|
|
id: data[i].guid,
|
|
elogo: this.rootPaht + data[i].logo,
|
|
ename: data[i].title,
|
|
eventdate: data[i].jointime,
|
|
eaddress: data[i].address,
|
|
distance: this.$util.formatDistance(data[i].distance)
|
|
};
|
|
this.listDatas.push(item);
|
|
uni.hideLoading();
|
|
}
|
|
}
|
|
}else{
|
|
that.get_data();
|
|
}
|
|
});
|
|
},
|
|
get_data: function() {
|
|
this.param.loading = true;
|
|
// var type = this.selectcondition.type;
|
|
// if (type != undefined && type != null && type != '') {
|
|
// if (type == 0) {
|
|
// type = '';
|
|
// } else {
|
|
// type = this.$param.hoteventTypeKey + '&' + type + '&select';
|
|
// }
|
|
// }
|
|
var type = this.selectedFIlterBak['attribute_hoventKey'];
|
|
if(type != 0){
|
|
var sub_column1 = "sub_column1&"+type+"&select"
|
|
}
|
|
var that = this;
|
|
var url = this.$config.getMessageInfoFormFilter_two;
|
|
var data = {
|
|
type: this.$param.siren,
|
|
userkey: this.$param.userkey,
|
|
pageno: this.param.page,
|
|
pageSize: 10,
|
|
region: this.selectcondition.bm,
|
|
sort: this.selectcondition.sortId,
|
|
lng: this.$param.clng,
|
|
lat: this.$param.clat,
|
|
title:this.searchValue,
|
|
sub_column1:sub_column1
|
|
};
|
|
console.log(data)
|
|
//data[this.$param.hoteventTypeKey] = type;
|
|
this.$Request.post(url, data).then(res => {
|
|
var flag = that.$util.isSuccess(res);
|
|
if (!flag) {
|
|
uni.hideLoading();
|
|
return;
|
|
}
|
|
var listDatas = this.listDatas,
|
|
dataListLen = res.data.length;
|
|
if (
|
|
(dataListLen == data.pageSize ? (this.param.page += 1) : (this.param.page = 1 && 0 == dataListLen ? (this.param.noData = true) : (this.param.finished = true)),
|
|
(this.param.loading = false),
|
|
dataListLen > 0)
|
|
) {
|
|
for (var i = 0; i < dataListLen; i++) {
|
|
var item = {
|
|
id: res.data[i].guid,
|
|
elogo: this.rootPaht + res.data[i].logo,
|
|
ename: res.data[i].title,
|
|
eventdate: res.data[i].jointime,
|
|
eaddress: res.data[i].address,
|
|
|
|
distance: this.$util.formatDistance(res.data[i].distance)
|
|
};
|
|
this.listDatas.push(item);
|
|
|
|
}
|
|
//console.log(this.param.finished);
|
|
}
|
|
uni.hideLoading();
|
|
});
|
|
}
|
|
/* 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);
|
|
}
|
|
});
|
|
} */
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style>
|
|
/* @import url("../../../static/css/common.css");*/
|
|
@import url('sirendingzhilist.css');
|
|
.list-item {
|
|
padding: 0;
|
|
}
|
|
.sort-page{ top:200rpx}
|
|
.filter-page {
|
|
top: 200rpx;
|
|
}
|
|
|
|
</style>
|
|
|