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.

64 lines
1.8 KiB

3 years ago
import brokenLine from "../../option/stackingLineOption"
3 years ago
import moment from "moment"
3 years ago
// const dName=['正面', '中性','负面']
const dName=[]
const dValue=[]
// const dValue=[
// [250, 326, 178, 349, 900, 1300, 140],
// [200, 382, 661, 34, 909, 1308, 150],
// [20, 32, 41, 354, 90, 130, 10],
// ]
3 years ago
const dColor=['#FF4852','#FF6E25','#FFBF00']
// const data=['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00']
const data = []
3 years ago
const app = getApp()
3 years ago
Component({
data: {
showChart: true,
3 years ago
positiveOption:brokenLine(dName,dValue,dColor,data),
negativeOption: brokenLine(dName,dValue,dColor,data),
3 years ago
Time:moment().format("YYYY-MM-DD HH:mm:ss"),
3 years ago
},
onShow() {
this.getTabBar().init();
},
3 years ago
lifetimes: {
attached() {
app.globalData.request({action: 'getAffections0528',sType:'Home' ,sTimeType:34,}).then(res => {
let arr = []
res.forEach(ele => {
3 years ago
let ol = {
data:ele.Time
3 years ago
}
3 years ago
ele.Data.forEach(val =>{
let obj = {
dName:val.key,
dValue:val.value,
// data:
}
arr.push(obj)
})
arr.push(ol)
3 years ago
})
this.setData({
positiveOption:arr,
})
console.log('111',arr)
// console.log('22',obj)
})
}
},
3 years ago
methods: {
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
}
}
})