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.

66 lines
2.0 KiB

3 years ago
// const { default: brandOption } = require("../../option/brandOption");
3 years ago
const app = getApp();
3 years ago
import histogram from "../../option/columnarOption"
3 years ago
Component({
data: {
showChart: true,
3 years ago
// brandOption: histogram(data1,data2,'#0084FF'),
// modelOption: histogram(data1,data2,'#20CC62'),
3 years ago
},
onShow() {
this.getTabBar().init();
},
3 years ago
lifetimes: {
attached() {
3 years ago
let sTimeType = wx.getStorageSync("sTimeType") || 34;
let sStartTime = wx.getStorageSync("sStartTime") || '';
let sEndTime = wx.getStorageSync("sEndTime") || '';
this.getData(sTimeType, sStartTime, sEndTime);
}
},
methods: {
changeTime(e){
let sTimeType = e.detail.sTimeType;
let sStartTime = e.detail.sStartTime;
let sEndTime = e.detail.sEndTime;
this.getData(sTimeType, sStartTime, sEndTime);
},
getData(sTimeType, sStartTime, sEndTime) {
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 300000
})
app.globalData.request( {
action: 'getWeiYiCountHome0528',
sType: 'Home',
sQueryType:1,
sTimeType: sTimeType,
sStartTime: sStartTime,
sEndTime: sEndTime,
}).then(res => {
const arr = []
const arr1=[]
3 years ago
res.forEach(ele => {
3 years ago
arr.push(ele.key);
arr1.push(ele.value)
3 years ago
})
3 years ago
3 years ago
this.setData({
3 years ago
brandOption: histogram(arr,arr1,"#0084FF")
3 years ago
})
3 years ago
setTimeout(() =>{
wx.hideToast();
},500)
console.log('333',arr)
console.log('333',arr1)
3 years ago
})
},
3 years ago
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
}
}
})