wylyl22 3 years ago
parent 61f78758ef
commit 5f1acd8f0f

@ -5,13 +5,13 @@
<view class="text">品牌传播声量</view>
<view class="brand_tu">
<!-- <Histogram></Histogram> -->
<c-echars showChart="{{showChart}}" canvasId="brandbar-canvas" chartId="brandbar" chartOption="{{brandOption}}" height="100%"></c-echars>
<c-echars showChart="{{showChart}}" canvasId="brandspreadbar-canvas" chartId="brandspreadbar" chartOption="{{brandOption}}" height="100%"></c-echars>
</view>
</view>
<view class="brand">
<view class="text">车型传播声量</view>
<view class="brand_tu">
<c-echars showChart="{{showChart}}" canvasId="modelbar-canvas" chartId="modelbar" chartOption="{{modelOption}}" height="100%"></c-echars>
<c-echars showChart="{{showChart}}" canvasId="modelspreadbar-canvas" chartId="modelspreadbar" chartOption="{{modelOption}}" height="100%"></c-echars>
</view>
</view>

@ -1,19 +1,52 @@
import histogram from "../../option/columnarOption"
const data1=['大众速腾', '激励帝豪', '吉利星越', '奥迪A4', '奥迪Q5']
const data2=[1400, 2000, 1500, 1800, 1490, 900, 310]
const data3=['尾翼互动量']
const app = getApp()
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
showChart: true,
brandOption: histogram(data1,data2,data3,'#0084FF'),
modelOption: histogram(data1,data2,data3,'#20CC62'),
},
onShow() {
this.getTabBar().init();
},
lifetimes:{
attached(){
this.getData()
}
},
methods: {
getData(){
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 300000
})
app.globalData.request({action: 'getCheZhuLatestTimeHome',sType:'Marketing'}).then(res => {
wx.setStorageSync('newTime', res)
this.setData({
newTime:wx.getStorageSync('newTime')
})
})
app.globalData.request({action: 'getCheZhuCarBrandRankingHome',sType:'Marketing',
sTimeType:"4",
sStartTime:wx.getStorageSync('newTime'),
sEndTime:wx.getStorageSync('newTime')}).then(res => {
console.log(res)
const carName=[]
const carCount=[]
res.forEach(e => {
carName.push(e.brand),
carCount.push(e.salescount)
});
this.setData({
brandOption:histogram(carName,carCount,'#0084FF'),
// modelOption:histogram()
})
})
setTimeout(() =>{
wx.hideToast();
},500)
},
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index

@ -21,6 +21,7 @@
<van-icon size="24rpx" name="arrow" style="color:#D0D0D0 ;margin-bottom: 10rpx;" />
</view>
</view>
<view style="font-size: 24rpx;color:#D0D0D0 ; margin: 0 32rpx;">{{newTime}}</view>
<view class="brand_tu">
<c-echars showChart="{{showChart}}" canvasId="brandsbar-canvas" chartId="brandsbar" chartOption="{{brandOption}}" height="100%"></c-echars>
</view>
@ -34,6 +35,7 @@
<van-icon size="24rpx" name="arrow" style="color:#D0D0D0 ;margin-bottom: 10rpx;" />
</view>
</view>
<view style="font-size: 24rpx;color:#D0D0D0 ; margin: 0 32rpx;">{{newTime}}</view>
<view class="brand_tu">
<c-echars showChart="{{showChart}}" canvasId="modelsbar-canvas" chartId="modelsbar" chartOption="{{modelOption}}" height="100%"></c-echars>
</view>

@ -132,14 +132,24 @@ showPopup() {
app.globalData.request({
action: 'getCheZhuCarBrandRankingHome',
sType: 'Marketing',
sTimeType:'34',
iPageIndex:'',
iPageSize:''
sTimeType:'4',
sStartTime:'2020-01-01',
sEndTime:'2021-01-01',
iPageIndex:'1',
}).then(res => {
console.log(res)
const arr=[]
res.forEach(e => {
let obj={
name:e.brand,
img:e.img,
share:e.percentage,
sales:e.salescount
}
arr.push(obj)
});
this.setData({
// mockData:arr
ranking:arr
})})
},

@ -27,17 +27,17 @@
<view style="display: flex;">
<view class="ranks_text"> 01</view>
<view class="ranks_text1">
<image style="width: 96rpx;height: 72rpx;" src="{{imageUrl}}/carSide.png"></image>
<view style="margin-left: 15rpx; height: 102rpx;line-height: 102rpx;">奥迪
<image style="width: 96rpx;height: 72rpx;" src="{{item.img}}"></image>
<view style="margin-left: 15rpx; height: 102rpx;line-height: 102rpx;width: 180rpx;">{{item.name}}
</view>
</view>
<view class="ranks_text2">11.09</view>
<view class="ranks_text2">{{item.share}}</view>
<view class="ranks_text3">
<view class="volume">1234567</view>
<view class="volume">{{item.sales}}</view>
<view class="trend" bindtap="detail">
<van-icon size="16px" name="arrow" />
<view>销量详情</view>
</view>
</view>
</view>

@ -53,24 +53,15 @@ Component({
},
getTrend(){
// 页面数据
let sTimeType = wx.getStorageSync("sTimeType") || 34;
let sStartTime = wx.getStorageSync("sStartTime") || '';
let sEndTime = wx.getStorageSync("sEndTime") || '';
let sSeriesName = wx.getStorageSync("sSeriesName") || '';
let sBrand = wx.getStorageSync('sBrand') || 34;
let sBrand = wx.getStorageSync('sBrand') || '奥迪';
app.globalData.request({
action: 'getCheZhuCarSeriesRankingHome',
sType:'Marketing',
sTimeType:sTimeType,
sStartTime:sStartTime,
sEndTime:sEndTime,
iPageIndex: iPageIndex,
iPageSize: iPageSize,
sBrand: sBrand,
sSeriesName:sSeriesName,
sSpec:'a00',
sPriceType:'1',
sEnergyType:'1'
sStartTime: "2021-10",
sEndTime:"2021-10",
}).then(res => {
const data = res;
const rinking = data.rinking || [];
@ -86,7 +77,7 @@ Component({
this.setData({
ranking:arr
})
console.log(arr)
console.log("品牌",res)
})
},
getAmount(sTimeType, sStartTime, sEndTime){

Loading…
Cancel
Save