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.

97 lines
3.3 KiB

3 years ago
const app = getApp();
3 years ago
Component({
3 years ago
data: {
3 years ago
content:[
{
time: '2022-04-29 23:00:00',
title: '谁说国产没有高性能SUV这3款国产SUV配2.0T发动机星途凌云换个运动轮胎妥妥的6秒3最快6...',
author: '明哥飞扬',
media:'新浪微博'
},
{
time: '2022-04-29 23:00:00',
title: '星途凌云S上市传播分析评论中毒 奇瑞车为何如此招黑?',
author: '明哥飞扬',
media:'新浪微博'
},
{
time: '2022-04-29 23:00:00',
title: 'MG5天蝎座上市传播分析评论区疑似',
author: '明哥飞扬',
media:'新浪微博'
},
{
time: '2022-04-29 23:00:00',
title: '谁说国产没有高性能SUV这3款国产SUV配2.0T发动机星途凌云换个运动轮胎妥妥的6秒3最快6...',
author: '明哥飞扬',
media:'新浪微博'
},
3 years ago
],
tabActive: 0,
themeData: [],
3 years ago
},
3 years ago
methods: {
toAddTheme() {
wx.navigateTo({
url: "/pages/insight/pages/addTheme/index"
})
3 years ago
},
changeTab(event) {
this.setData({ tabActive: event.detail.index});
this.getData()
},
getData() {
app.globalData.request({
action: 'getSchemeDataToTheme',
token: 't%2BrswgjvzGM=',
pageIndex: 1,
pageSize: 100,
sType: this.data.tabActive == 0 ? 'now' : 'former'
}).then(res => {
3 years ago
let data = res;
let nd = new Date().valueOf();
data.forEach(ele => {
if(new Date(ele.EndTime).valueOf() < nd) {
ele.Classify = 1
}
})
this.setData({themeData: data})
3 years ago
});
},
toThemeDataList(event) {
3 years ago
let id = event.currentTarget.dataset.id.Guids;
let start = event.currentTarget.dataset.id.StartTime;
let end = event.currentTarget.dataset.id.EndTime;
3 years ago
wx.navigateTo({
3 years ago
url: '/pages/insight/pages/themeList/index' + '?Guid=' + id +'&StartTime='+start+'&EndTime='+end,
3 years ago
})
},
editTheme(event) {
3 years ago
let id = event.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/insight/pages/editTheme/index' + '?Guid=' + id,
})
3 years ago
},
deleteTheme(event) {
3 years ago
wx.showModal({
title: '是否要删除该主题?',
success: (result) => {
if(result.cancel == false) {
app.globalData.request({
action: 'delCarBigDataByGuid',
token: 't%2BrswgjvzGM=',
Guids: event.currentTarget.dataset.id
}).then(res => {
this.getData()
});
}
}
});
3 years ago
}
3 years ago
},
3 years ago
lifetimes: {
3 years ago
attached() {
this.getData()
}
3 years ago
}
3 years ago
})