|
|
|
@ -1,9 +1,5 @@
|
|
|
|
|
const app = getApp()
|
|
|
|
|
import brokenLine from "../../../../components/option/singleLineOption"
|
|
|
|
|
// const dName = ['正面', ]
|
|
|
|
|
// const data = ['12月', '1月', '2月', '3月', '4月', '5月', '6月']
|
|
|
|
|
// const dValue = [1500, 1000, 500, 800, 100, 1000, 300]
|
|
|
|
|
// const dColor = ['#0084FF', ]
|
|
|
|
|
let iPageIndex = 1 // 当前第几页,0代表第一页
|
|
|
|
|
let iPageSize = 20 //每页显示多少数据
|
|
|
|
|
Component({
|
|
|
|
@ -25,17 +21,14 @@ Component({
|
|
|
|
|
//图表
|
|
|
|
|
// positiveOption:brokenLine(dName,dValue,dColor,data),
|
|
|
|
|
imageUrl: getApp().globalData.imageUrl,
|
|
|
|
|
date: '2021-01',
|
|
|
|
|
accountIndex: 0,
|
|
|
|
|
ranking: [],
|
|
|
|
|
|
|
|
|
|
imageUrl: getApp().globalData.imageUrl,
|
|
|
|
|
date: '2021-01',
|
|
|
|
|
accountIndex: 0,
|
|
|
|
|
//
|
|
|
|
|
ec: {
|
|
|
|
|
lazyLoad: true // 设置图表懒加载
|
|
|
|
|
}
|
|
|
|
|
date:wx.getStorageSync('newTime'),
|
|
|
|
|
accountIndex:0,
|
|
|
|
|
ranking:[],
|
|
|
|
|
accountIndex:0,
|
|
|
|
|
//
|
|
|
|
|
ec: {
|
|
|
|
|
lazyLoad:true // 设置图表懒加载
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
lifetimes: {
|
|
|
|
|
attached() {
|
|
|
|
@ -85,14 +78,15 @@ Component({
|
|
|
|
|
this.getTrend()
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
wx.hideToast();
|
|
|
|
|
}, 500)
|
|
|
|
|
},
|
|
|
|
|
getTrend() {
|
|
|
|
|
let obj = {
|
|
|
|
|
},500)
|
|
|
|
|
},
|
|
|
|
|
getTrend(time=wx.getStorageSync('newTime')){
|
|
|
|
|
// console.log("eee",this.data.date)
|
|
|
|
|
let obj = {
|
|
|
|
|
action: 'getCheZhuCarSeriesRankingHome',
|
|
|
|
|
sType: 'Marketing',
|
|
|
|
|
sStartTime: "2021-10",
|
|
|
|
|
sEndTime: "2021-10",
|
|
|
|
|
sType:'Marketing',
|
|
|
|
|
sStartTime: time,
|
|
|
|
|
sEndTime: time,
|
|
|
|
|
iPageIndex: iPageIndex,
|
|
|
|
|
iPageSize: iPageSize,
|
|
|
|
|
// sSpec:wx.getStorageSync('sSpec') || '',
|
|
|
|
@ -305,10 +299,20 @@ Component({
|
|
|
|
|
wx.hideToast();
|
|
|
|
|
}, 500)
|
|
|
|
|
},
|
|
|
|
|
bindDateChange: function (e) {
|
|
|
|
|
bindDateChange: function(e) {
|
|
|
|
|
wx.showToast({
|
|
|
|
|
title: '加载中',
|
|
|
|
|
icon: 'loading',
|
|
|
|
|
duration: 300000
|
|
|
|
|
})
|
|
|
|
|
// console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
|
|
|
this.getTrend(e.detail.value)
|
|
|
|
|
setTimeout(() =>{
|
|
|
|
|
wx.hideToast();
|
|
|
|
|
},500),
|
|
|
|
|
this.setData({
|
|
|
|
|
date: e.detail.value
|
|
|
|
|
date: e.detail.value,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
priceSel(e) {
|
|
|
|
@ -316,22 +320,55 @@ Component({
|
|
|
|
|
intervalSel: e.currentTarget.dataset.index
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
bindAccountChange(e) {
|
|
|
|
|
// console.log('切换改变的值', e.detail.value);
|
|
|
|
|
this.setData({
|
|
|
|
|
accountIndex: e.detail.value
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//弹出框
|
|
|
|
|
popup(e) {
|
|
|
|
|
// bindAccountChange(e){
|
|
|
|
|
// // console.log('切换改变的值', e.detail.value);
|
|
|
|
|
// this.setData({
|
|
|
|
|
// accountIndex: e.detail.value
|
|
|
|
|
// })
|
|
|
|
|
// },
|
|
|
|
|
//弹出框
|
|
|
|
|
times(val){
|
|
|
|
|
var month=val.substring(0,4) //获取年份
|
|
|
|
|
var bYear=val.substring(val.length-2,val.length-1)=="0"//是否为带零的月份
|
|
|
|
|
var year1=val.substring(val.length-1,val.length) //获取月份最后一个数
|
|
|
|
|
var year2=val.substring(val.length-2,val.length) //获取整个月份
|
|
|
|
|
var time,months,years
|
|
|
|
|
if(bYear){
|
|
|
|
|
if(parseInt(year1)<6){
|
|
|
|
|
months=parseInt(month-1)
|
|
|
|
|
if(parseInt(year1)<3){
|
|
|
|
|
years="0"+((12-(6-parseInt(year1)))+1)
|
|
|
|
|
}else{
|
|
|
|
|
years=(12-(6-parseInt(year1)))+1
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
months=month
|
|
|
|
|
years="0"+((parseInt(year1)-6)+1)
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
months=month
|
|
|
|
|
years="0"+(parseInt(year2)-6+1)
|
|
|
|
|
}
|
|
|
|
|
time=months+'-'+years
|
|
|
|
|
return time
|
|
|
|
|
},
|
|
|
|
|
popup(e) {
|
|
|
|
|
let duration = this.data.duration
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
let models = e.currentTarget.dataset.car
|
|
|
|
|
console.log("1234",models)
|
|
|
|
|
=======
|
|
|
|
|
let models=e.currentTarget.dataset.car
|
|
|
|
|
// this.times(this.data.date)
|
|
|
|
|
>>>>>>> 4f34912e9badff47678d759e0af47416a96d131c
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: "getCheZhuCarSeriesListHome",
|
|
|
|
|
sType: "Marketing",
|
|
|
|
|
sSeriesName: models
|
|
|
|
|
action:"getCheZhuCarSeriesListHome",
|
|
|
|
|
sType:"Marketing",
|
|
|
|
|
sSeriesName:models,
|
|
|
|
|
sStartTime:this.times(this.data.date),
|
|
|
|
|
sEndTime: this.data.date,
|
|
|
|
|
}).then(res => {
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
const dataTime = []
|
|
|
|
|
const dataCar = []
|
|
|
|
|
for (let i = 0; i < 6; i++) {
|
|
|
|
@ -345,6 +382,19 @@ Component({
|
|
|
|
|
}
|
|
|
|
|
dataCar.push(res[i].salescount)
|
|
|
|
|
}
|
|
|
|
|
=======
|
|
|
|
|
// console.log(res)
|
|
|
|
|
const dataTime=[]
|
|
|
|
|
const dataCar=[]
|
|
|
|
|
res.forEach(e => {
|
|
|
|
|
if((e.sourcetime).substring(5,6)=="0"){
|
|
|
|
|
dataTime.push((e.sourcetime).substring((e.sourcetime).length-1,(e.sourcetime).length)+'月')
|
|
|
|
|
}else{
|
|
|
|
|
dataTime.push((e.sourcetime).substring((e.sourcetime).length-2,(e.sourcetime).length)+"月")
|
|
|
|
|
}
|
|
|
|
|
dataCar.push(e.salescount)
|
|
|
|
|
});
|
|
|
|
|
>>>>>>> 4f34912e9badff47678d759e0af47416a96d131c
|
|
|
|
|
// console.log(dataCar,dataTime)
|
|
|
|
|
// console.log(models)
|
|
|
|
|
this.setData({
|
|
|
|
|