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.

59 lines
1.9 KiB

3 years ago
const app = getApp();
import totallist from "./dataConfig/totallist"
import dataOption from "./dataConfig/dataOption"
3 years ago
Component({
data: {
3 years ago
imageUrl: getApp().globalData.imageUrl,
3 years ago
active:0,
3 years ago
countYear: 0,
count6month: 0,
countAll: 0,
3 years ago
timelist: ['二十四小时', '最近七天', '最近三十天', '自定义'],
3 years ago
totallist: [],
3 years ago
showChart: true,
3 years ago
chartOption: dataOption
3 years ago
},
3 years ago
3 years ago
lifetimes: {
attached() {
3 years ago
app.globalData.request({action: 'getHomeCount0528', sType: 'Home', sTimeType: 3, iStatus: 1}).then(res => {
const data = res;
const sourcetypeCount = data.sourcetypeCount || [];
const arr = []
3 years ago
const imgObj = {'微博': '/weibo.png', '微信': '/weixin.png', 'APP': '/app.png', '论坛': '/luntan.png', '新闻': '/xinwen.png', '其他': '/qita.png', '短视频': '/shipin.png'}
3 years ago
arr.push({
num: data.count,
text: '入库数据',
url: '/ruku.png'
})
sourcetypeCount.forEach(ele => {
let obj = {
num: ele.value,
text: ele.key + '数据',
url: imgObj[ele.key]
}
arr.push(obj)
})
this.setData({
countYear: data.count_year,
count6month: data.count_6month,
countAll: data.count_all,
totallist: arr
})
})
3 years ago
},
3 years ago
},
methods: {
3 years ago
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
3 years ago
},
3 years ago
dynamic(){
wx.navigateTo({
url: "/pages/index/total/tatal"
})
},
3 years ago
}
})