|
|
|
@ -9,7 +9,16 @@ Page({
|
|
|
|
|
active: 0,
|
|
|
|
|
activetab: 0,
|
|
|
|
|
brand: '',
|
|
|
|
|
// intervalSel:0,
|
|
|
|
|
intervalSel: 0,
|
|
|
|
|
newsList: [{
|
|
|
|
|
title: '已读',
|
|
|
|
|
value: 1
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '未读',
|
|
|
|
|
value: 2
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
// news: '',
|
|
|
|
|
// Grade: '',
|
|
|
|
|
// option: [{
|
|
|
|
@ -53,10 +62,11 @@ Page({
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
crisisList: [],
|
|
|
|
|
DataList:[],
|
|
|
|
|
DataList: [],
|
|
|
|
|
value: 1,
|
|
|
|
|
loadMore: false, //"上拉加载"的变量,默认false,隐藏
|
|
|
|
|
loadAll: false, //“没有数据”的变量,默认false,隐藏
|
|
|
|
|
iReadState: 0, //0 未读 1 已读
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
wx.setNavigationBarTitle({
|
|
|
|
@ -70,6 +80,7 @@ Page({
|
|
|
|
|
})
|
|
|
|
|
iPageIndex = 1;
|
|
|
|
|
this.getData(3);
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
onReachBottom: function () {
|
|
|
|
|
console.log("上拉触底事件")
|
|
|
|
@ -81,6 +92,7 @@ Page({
|
|
|
|
|
});
|
|
|
|
|
//加载更多,这里做下延时加载
|
|
|
|
|
that.getData(this.data.value);
|
|
|
|
|
that.getList(this.data.value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getList() {
|
|
|
|
@ -89,26 +101,27 @@ Page({
|
|
|
|
|
let sEndTime = wx.getStorageSync("sEndTime") || '';
|
|
|
|
|
let sCrisis = this.data.value;
|
|
|
|
|
let obj = {
|
|
|
|
|
action: "getList",
|
|
|
|
|
action: "getSwsQyMessageList",
|
|
|
|
|
sTimeType: sTimeType,
|
|
|
|
|
sStartTime: sStartTime,
|
|
|
|
|
sEndTime: sEndTime,
|
|
|
|
|
iPageIndex: iPageIndex,
|
|
|
|
|
iPageSize: iPageSize,
|
|
|
|
|
sType: "BrandData",
|
|
|
|
|
// sType: "BrandData",
|
|
|
|
|
iReadState: this.data.iReadState,
|
|
|
|
|
sCrisis: sCrisis,
|
|
|
|
|
sBrand: this.data.brand,
|
|
|
|
|
// sBrand: this.data.brand,
|
|
|
|
|
// sSeriesName: sSeriesName,
|
|
|
|
|
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
|
|
|
|
|
}
|
|
|
|
|
app.globalData.request(obj).then(res => {
|
|
|
|
|
if (res && res.length > 0) {
|
|
|
|
|
iPageIndex++;
|
|
|
|
|
res.forEach(ele => {
|
|
|
|
|
ele._source.affections = ele._source.affections;
|
|
|
|
|
ele._source.title = doStr(ele._source.title, 70);
|
|
|
|
|
ele._source.content = doStr(ele._source.content, 200);
|
|
|
|
|
})
|
|
|
|
|
// res.forEach(ele => {
|
|
|
|
|
// ele._source.affections = ele._source.affections;
|
|
|
|
|
// ele._source.title = doStr(ele._source.title, 70);
|
|
|
|
|
// ele._source.content = doStr(ele._source.content, 200);
|
|
|
|
|
// })
|
|
|
|
|
let arr = this.data.DataList.concat(res);
|
|
|
|
|
this.setData({
|
|
|
|
|
DataList: arr,
|
|
|
|
@ -128,6 +141,16 @@ Page({
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 设置已读
|
|
|
|
|
getTimeData(e) {
|
|
|
|
|
let id = e.currentTarget.dataset.row.ID
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'updSwsQyMessageByIDRead',
|
|
|
|
|
Id: id,
|
|
|
|
|
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
|
|
|
|
|
}).then(res => {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getData() {
|
|
|
|
|
let sTimeType = wx.getStorageSync("sTimeType") || 34;
|
|
|
|
|
let sStartTime = wx.getStorageSync("sStartTime") || '';
|
|
|
|
@ -153,9 +176,9 @@ Page({
|
|
|
|
|
ele._source.title = doStr(ele._source.title, 70);
|
|
|
|
|
ele._source.content = doStr(ele._source.content, 200);
|
|
|
|
|
})
|
|
|
|
|
let arr = this.data.crisisList.concat(res);
|
|
|
|
|
let arr1 = this.data.crisisList.concat(res);
|
|
|
|
|
this.setData({
|
|
|
|
|
crisisList: arr,
|
|
|
|
|
crisisList: arr1,
|
|
|
|
|
loadMore: false
|
|
|
|
|
})
|
|
|
|
|
if (res.length < iPageSize) {
|
|
|
|
@ -183,19 +206,51 @@ Page({
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handlerTap(e) {
|
|
|
|
|
let intervalSel = e.currentTarget.dataset.index;
|
|
|
|
|
let value = this.data.list[intervalSel].value
|
|
|
|
|
let n = e.currentTarget.dataset.index;
|
|
|
|
|
let value = this.data.list[n].value
|
|
|
|
|
iPageIndex = 1;
|
|
|
|
|
this.setData({
|
|
|
|
|
intervalSel: e.currentTarget.dataset.index,
|
|
|
|
|
value: value,
|
|
|
|
|
crisisList: []
|
|
|
|
|
})
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
handList(e) {
|
|
|
|
|
let n = e.currentTarget.dataset.index;
|
|
|
|
|
let value = this.data.list[n].value
|
|
|
|
|
iPageIndex = 1;
|
|
|
|
|
this.setData({
|
|
|
|
|
intervalSel: e.currentTarget.dataset.index,
|
|
|
|
|
value: value,
|
|
|
|
|
DataList: []
|
|
|
|
|
})
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handlerDetail(e) {
|
|
|
|
|
let row = e.currentTarget.dataset.row;
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: '/subPackages/pages/detail/index?id=' + row._id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//复制链接
|
|
|
|
|
handlerCopy(e) {
|
|
|
|
|
const {
|
|
|
|
|
msg
|
|
|
|
|
} = e.currentTarget.dataset
|
|
|
|
|
wx.setClipboardData({
|
|
|
|
|
data: `${msg}`, //这个是要复制的数据
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
ChangeList(e) {
|
|
|
|
|
this.setData({
|
|
|
|
|
intervalSel: e.currentTarget.dataset.index,
|
|
|
|
|
iReadState: e.currentTarget.dataset.index,
|
|
|
|
|
DataList: []
|
|
|
|
|
});
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
})
|