老白干小程序
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.
 
 
 
 

451 lines
12 KiB

<template>
<refresh @interrupt="interrupt" @pushToInterrupt="to" @backToInterrupt="back" @finished="finished">
<view slot="top">
<!-- 图标式 -->
<!-- <view :style="'height: ' + 100 + 'rpx;line-height:' + 100 + 'rpx;'" class="weiz_ref">
<view class="sta_static">
<view class="icn_ref_pic" v-if="refresh_show == '1' || refresh_show == '2'">
<image src="../../../static/images/icn_ref_1.png" class="icn_ref"></image>
</view>
</view>
<view class="sta_rotate">
<view class="icn_ref_pic" v-if="refresh_show == '3'">
<image src="../../../static/images/icn_ref_1.png" class="icn_ref icn_ref2"></image>
</view>
</view>
</view> -->
<!-- 带文字式 -->
<view :style="'position: absolute;bottom: 0rpx;height: ' + 60 + 'rpx;line-height:' + 60 + 'rpx;width: 100%;text-align: center; z-index:99'">
<view class="ing2_ref" v-if="refresh_show == '1'">
<image src="../../../static/images/icn_ref.png" class="ing2_ref_pic"></image>
<text class="ref_ing">{{ tip }}</text>
</view>
<view class="ing2_ref" v-if="refresh_show == '2'">
<image src="../../../static/images/icn_ref.png" class="ing2_ref_pic ing2_icn_ref2"></image>
<text class="ref_ing">{{ tip }}</text>
</view>
<view class="ing2_ref" v-if="refresh_show == '3'">
<image src="../../../static/images/loading-icon.png" class="ing2_ref_pic icn_ref2"></image>
<text class="ref_ing">{{ tip }}</text>
</view>
</view>
</view>
<template slot="vue-mes">
<view class="an_box_mes wc_sbox">
<view class="dy_fx an_sch amb_30">
<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>
<view class="container">
<scroll-view @scroll="onReachScroll" @bindscrolltolower="lower" class="scroll-view amt_30" :scroll-top="topNum" scrollY="true">
<view class="mode_com">
<!-- <text class="tit_com">旅游资讯</text> -->
<navigator class="list-item" hover-class="none" :url="'/sunPackIndex/zixun/zixundetail/zixundetail?id=' + item.id" v-for="(item, index) in listDatas" :key="index">
<view class="item-info">
<view class="title">{{ item.title }}</view>
<view class="data">
<view class="myd1">{{ item.jointime }}</view>
</view>
</view>
<image class="item-pic" v-if="item.logo != null && item.logo != ''" :src="item.logo"></image>
</navigator>
</view>
<view class="data-loading" v-if="param.loading">
<image class="icon" src="../../../static/images/loading-icon.png"></image>
加载中…
</view>
<view class="data-is-bottom" v-if="param.finished">{{this.$param.pageMsg}}</view>
<view class="no-data-info" v-if="param.noData">{{this.$param.dataMsg}}</view>
</scroll-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.mc"
data-type="bm"
:data-id="item.bm"
v-for="(item, index) in filter.regionList"
:key="index"
>
{{ item.mc }}
</view>
</view>
</view> -->
</view>
</template>
</refresh>
</template>
<script>
import refresh from '@/components/refresh_3.vue';
export default {
components: {
refresh
},
data() {
return {
tip: '下拉刷新',
refresh_show: '1',
//
indicatorDots: true,
autoplay: true,
interval: 6000,
duration: 1500,
searchItemClass: 'search-tip-item',
pageClass: {
sortItemClass: 'sort-item',
filterHdItemClass: 'filter-hd-item',
filterBdItem: 'filter-bd-item'
},
priceSymbol: '',
destinationBak: 'all',
destination: 'all',
filter: [],
parentLevelItem: 'attribute_etype',
defaultFilter: {},
latitude: 0,
longitude: 0,
selectedFIlterBak: {
price: 0
},
selectedFIlter: {
attribute_etype: 0
},
selectedParam: {
sortId: 1,
bm: '',
hiddenSortPanel: !0,
hiddenRegionPanel: !0
},
param: {
page: 1,
noData: !1,
loading: !1,
finished: !1
},
listDatas: [],
topNum: 0,
rootPaht: this.$config.ROOTPATH,
selectcondition: {
bm: this.$config.ARER_CODE,
sortId: 2
},
regionname: '区域',
topVideoList: [],
topVideoImg: '',
region: '',
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
});
var region = option.region;
this.region = region;
this.initData();
if (region != null && region != '') {
this.get_data(region);
} else {
this.getRedisData();
}
this.get_attribute();
that.$util.saveOperatorLog(that,"FUN","资讯");
},
onShow() {
this.destinationBak != this.destination && (this.initData(), this.get_data());
},
methods: {
getRedisData: function() {
var that = this;
var data = {
key: this.$param.userkey + '_information_list'
};
that.$Request.post(that.$config.getRedisData, data).then(res => {
if (res.status == 200) {
var listDatas = this.listDatas,
dataListLen = res.data.hoteventList.length;
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 logo = res.data.hoteventList[i].logo;
if(logo.indexOf("http") == -1){
logo = this.rootPaht + logo;
}
var item = {
id: res.data.hoteventList[i].guid,
logo: logo,
title: res.data.hoteventList[i].title,
jointime: res.data.hoteventList[i].jointime
};
this.listDatas.push(item);
}
uni.hideLoading();
}
} else {
that.get_data();
}
});
},
interrupt(e) {
this.refresh_show = '3';
this.tip = '刷新中';
setTimeout(() => {
this.get_attribute(), this.initData(), this.get_data(this.region);
this.tip = '刷新成功';
this.refresh_show = '1';
e();
}, 2000);
},
to() {
this.tip = '释放刷新';
this.refresh_show = '2';
},
back() {
this.tip = '下拉刷新';
this.refresh_show = '1';
},
finished() {
this.tip = '下拉刷新';
this.refresh_show = '1';
},
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.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.hiddenSortPanel = !0;
} else {
selectedParam.hiddenRegionPanel = !0;
}
(selectedParam[dataSet.type] = !selectedParam[dataSet.type]), (this.selectedParam = selectedParam);
},
resetFilter: function() {
this.selectedFIlter = this.defaultFilter;
},
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 url = this.$config.quyuList;
var data = {
type: 'consultation'
};
this.$Request.post(url, data).then(res => {
var e = {
price: 0
};
this.filter = res.data;
this.defaultFilter = e;
});
},
search: function() {
this.initData();
this.get_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() {
this.param.loading = true;
var that = this;
var url = this.$config.getMessageInfoFormFilter;
var data = {
title:this.searchValue,
type: this.$param.zixunType,
userkey: this.$param.userkey,
pageno: this.param.page,
pageSize: 10,
sort:"2"
};
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 logo = res.data[i].logo;
if(logo.indexOf("http") == -1){
logo = this.rootPaht + logo;
}
var item = {
id: res.data[i].guid,
logo: logo,
title: res.data[i].title,
jointime: res.data[i].jointime
};
this.listDatas.push(item);
}
uni.hideLoading();
}
});
}
// getVideoUrl: function() {
// var data = {
// "pageno": "1",
// "pagesize": "1",
// "sort": "2",
// "region": "130101",
// "type": "2916",
// }
// this.$Request.post(this.$config.messagelist, data).then(res => {
// var data = res.data;
// for (var i = 0; i < data[0].videolist.length; i++) {
// data[0].videolist[i] = this.$config.ROOTPATH + data[0].videolist[i];
// }
// this.topVideoList = data[0].videolist;
// this.topVideoImg = this.$config.ROOTPATH + data[0].logo;
// })
// }
/* 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('zixunlist.css');
</style>