|
|
const app = getApp();
|
|
|
Component({
|
|
|
data: {
|
|
|
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:'新浪微博'
|
|
|
},
|
|
|
],
|
|
|
tabActive: 0,
|
|
|
themeData: [],
|
|
|
},
|
|
|
methods: {
|
|
|
toAddTheme() {
|
|
|
wx.navigateTo({
|
|
|
url: "/pages/insight/pages/addTheme/index"
|
|
|
})
|
|
|
},
|
|
|
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 => {
|
|
|
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})
|
|
|
});
|
|
|
},
|
|
|
toThemeDataList(event) {
|
|
|
let id = event.currentTarget.dataset.id.Guids;
|
|
|
let start = event.currentTarget.dataset.id.StartTime;
|
|
|
let end = event.currentTarget.dataset.id.EndTime;
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/insight/pages/themeList/index' + '?Guid=' + id +'&StartTime='+start+'&EndTime='+end,
|
|
|
})
|
|
|
},
|
|
|
editTheme(event) {
|
|
|
let id = event.currentTarget.dataset.id
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/insight/pages/editTheme/index' + '?Guid=' + id,
|
|
|
})
|
|
|
},
|
|
|
deleteTheme(event) {
|
|
|
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()
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
lifetimes: {
|
|
|
attached() {
|
|
|
this.getData()
|
|
|
}
|
|
|
}
|
|
|
}) |