wylyl22 3 years ago
parent 7348d51134
commit d42a8230b4

@ -6,6 +6,7 @@
"pages/index/detailedvolume/detailedvolume", "pages/index/detailedvolume/detailedvolume",
"pages/index/Brandsales/Brandsales", "pages/index/Brandsales/Brandsales",
"pages/index/Salesranking/Salesranking", "pages/index/Salesranking/Salesranking",
"index/home/home",
"pages/index/Salesranking/Vehicletype/Vehicletype", "pages/index/Salesranking/Vehicletype/Vehicletype",
"pages/index/Salesranking/Brandranking/Brandranking", "pages/index/Salesranking/Brandranking/Brandranking",
"pages/index/Salesranking/Allbrands/Allbrands", "pages/index/Salesranking/Allbrands/Allbrands",
@ -25,7 +26,8 @@
"pages/varComm/pages/brandRatio/index", "pages/varComm/pages/brandRatio/index",
"pages/brandCrisis/index", "pages/brandCrisis/index",
"pages/detail/index", "pages/detail/index",
"pages/brandCrisis/crisiSet/index" "pages/brandCrisis/crisiSet/index",
"pages/pages/home/home"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

@ -13,6 +13,10 @@ Component({
showChart: { // 控制图表的显示时机 showChart: { // 控制图表的显示时机
type: Boolean type: Boolean
}, },
flocShow:{
type:Boolean,
value:false
},
chartOption: { // 图表option对象 chartOption: { // 图表option对象
type: Object, type: Object,
observer: function () { // 监听图表option的变化实现动态渲染 observer: function () { // 监听图表option的变化实现动态渲染

@ -1,4 +1,4 @@
<!--pages/components/custom-echarts/index.wxml--> <!--pages/components/custom-echarts/index.wxml-->
<view style="height: {{ height }}; width:100%;"> <view style="height: {{ height }}; width:100%;">
<ec-canvas force-use-old-canvas="{{false}}" wx:if="{{showChart}}" id="{{ chartId }}" canvas-id="eventBar" ec="{{ec}}" options="{{chartOption}}"></ec-canvas> <ec-canvas force-use-old-canvas="{{flocShow}}" wx:if="{{showChart}}" id="{{ chartId }}" canvas-id="eventBar" ec="{{ec}}" options="{{chartOption}}"></ec-canvas>
</view> </view>

@ -1,18 +1,40 @@
import histogram from "../option/columnarOption" import histogram from "../option/columnarOption"
const data=['智骏', '国机', '小虎', '华晨', '朋克美美','华晨新日','百智大熊','朋克多多','YOUNG光小新','易至EV3','雷丁芒果','风光MINIEV','宝骏KiWiEV','思皓E10X','零跑T03','科莱威CLEVER','奔奔E-Star','QQ冰激凌','小蚂蚁','宏光MINIEV',] const app = getApp()
const data2= [600,700,800,900,1000,1200,1300,1400,1500,1600,1700,1900,2000,2100,2200,2300,2400,2500,2600,2700,]
Component({ Component({
data: { data: {
showChart: true, showChart: true,
brandOption: histogram(data,data2,[],'#0084FF',false),
}, },
onShow() { // onShow() {
this.getTabBar().init(); // this.getTabBar().init();
// },
lifetimes:{
attached(){
this.getTrend()
}
}, },
methods: { methods: {
getTrend(){
app.globalData.request({
action: 'getCheZhuCarSeriesRankingHome',
sType:'Marketing',
sStartTime: "2021-10",
sEndTime:"2021-10",
iPageIndex: "iPageIndex",
iPageSize: "iPageSize",
// sSpec:wx.getStorageSync('sSpec') || '',
// sPriceType:wx.getStorageSync('sPriceType') || '',
// sEnergyType:wx.getStorageSync('sEnergyType') || ''
}).then(res => {
let carName = []
let carValue=[]
res.forEach(e =>{
carName.push(e.seriesname),
carValue.push(e.salescount)
})
this.setData({
brandOption: histogram(carName,carValue,'#0084FF',false)
})
})},
priceSel(e){ priceSel(e){
this.setData({ this.setData({
intervalSel: e.currentTarget.dataset.index intervalSel: e.currentTarget.dataset.index

@ -9,13 +9,14 @@ export default function histogram(dx = [], ds = [], color1 = '', direction = tru
}, },
confine: true confine: true
}, },
dataZoom: [{ //添加X轴滚动条
dataZoom: direction?[{ //添加X轴滚动条
type: 'inside', type: 'inside',
show: false, show: false,
start: 50, start: 50,
end: 10, end: 10,
handleSize: 10 handleSize: 10
}], }]:[],
// legend: { // legend: {
// x:'15', // x:'15',
// icon: 'rectangle',//data图标样式 // icon: 'rectangle',//data图标样式

@ -1,5 +1,5 @@
// 折线 // 折线
export default function brokenLine(dName = [], dValue = [], dColor = [], dx = []) { export default function brokenLine(dValue = [], dx = []) {
return { return {
grid: { grid: {
left: 30, left: 30,

@ -1,5 +1,5 @@
// 折线 // 折线
export default function brokenLine(dName = [], dValue = [], dColor = [], dx = []) { export default function brokenLines(dName = [], dValue = [], dColor = [], dx = []) {
return { return {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',

@ -1,4 +1,4 @@
// pages/index/home/home.js // index/home/home.js
Page({ Page({
/** /**

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,2 @@
<!--index/home/home.wxml-->
<text>index/home/home.wxml</text>

@ -0,0 +1 @@
/* index/home/home.wxss */

@ -14,6 +14,7 @@ Component({
grade_name3:'按能源', grade_name3:'按能源',
grade_name4:'列表展示', grade_name4:'列表展示',
grades4:['列表展示','图表展示'], grades4:['列表展示','图表展示'],
positiveOption:brokenLine(dValue,data),
//弹出框 //弹出框
show: false, show: false,
duration: 300, duration: 300,
@ -21,20 +22,22 @@ Component({
round: true, round: true,
overlay: true, overlay: true,
showChart: true, showChart: true,
positiveOption:brokenLine(dName,dValue,dColor,data),
imageUrl: getApp().globalData.imageUrl, imageUrl: getApp().globalData.imageUrl,
date:'2021-01', date:'2021-01',
accountIndex:0, accountIndex:0,
//
ec: {
lazyLoad:true // 设置图表懒加载
}
}, },
lifetimes: { lifetimes: {
attached() { attached() {
let sTimeType = wx.getStorageSync("sTimeType") || 34; let sTimeType = wx.getStorageSync("sTimeType") || 34;
let sStartTime = wx.getStorageSync("sStartTime") || ''; let sStartTime = wx.getStorageSync("sStartTime") || '';
let sEndTime = wx.getStorageSync("sEndTime") || ''; let sEndTime = wx.getStorageSync("sEndTime") || '';
this.getData(sTimeType, sStartTime, sEndTime); this.getData(sTimeType, sStartTime, sEndTime);
this.getTrend(); this.getTrend();
} }
}, },
@ -52,7 +55,6 @@ Component({
},500) },500)
}, },
getTrend(){ getTrend(){
app.globalData.request({ app.globalData.request({
action: 'getCheZhuCarSeriesRankingHome', action: 'getCheZhuCarSeriesRankingHome',
sType:'Marketing', sType:'Marketing',
@ -213,7 +215,7 @@ Component({
duration: 300000 duration: 300000
}) })
console.log(e) console.log(e)
var name=e.currentTarget.dataset.name var name=e.currentTarget.dataset.name.name
var value=e.currentTarget.dataset.name.value var value=e.currentTarget.dataset.name.value
wx.setStorageSync('sEnergyType',value) wx.setStorageSync('sEnergyType',value)
this.setData({ this.setData({
@ -263,6 +265,7 @@ Component({
popup(e) { popup(e) {
let duration = this.data.duration let duration = this.data.duration
this.setData({ this.setData({
show: true, show: true,
duration duration
}) })

@ -1,6 +1,6 @@
<!--pages/index/Salesranking/Vehicletype/Vehicletype.wxml--> <!--pages/index/Salesranking/Vehicletype/Vehicletype.wxml-->
<view class="vehicletype">
<view class="vehicletype">
<scroll-view scroll-x="{{true}}" style="white-space: nowrap;height: 100%; width: 100%;background: #ffffff;"> <scroll-view scroll-x="{{true}}" style="white-space: nowrap;height: 100%; width: 100%;background: #ffffff;">
<view class="top"> <view class="top">
<view class="box_title">全部</view> <view class="box_title">全部</view>
@ -104,7 +104,7 @@
</view> </view>
<view style="width: 30%;"> <view style="width: 30%;">
<view class="volume">{{item.volume}}</view> <view class="volume">{{item.volume}}</view>
<view class="trend" bindtap="onclick" bindtap="popup" data-position="bottom"> <view class="trend" bindtap="popup" data-position="bottom">
<van-icon size="16px" name="arrow" /> <van-icon size="16px" name="arrow" />
<view>销量趋势</view> <view>销量趋势</view>
</view> </view>
@ -115,18 +115,17 @@
</view> </view>
</view> </view>
<page-container show="{{show}}" round="{{round}}" overlay="{{overlay}}" duration="{{duration}}" position="{{position}}" close-on-slide-down="{{false}}" custom-style="height:40%"> <page-container show="{{show}}" duration="{{duration}}" position="{{position}}" close-on-slide-down="{{false}}" custom-style="height:50%">
<view class="detail-page"> <view class="detail-page">
<view style="display: flex;"> <view style="display: flex;">
<view class="qushi">销量趋势</view> <view class="qushi">销量趋势</view>
<view class="tubiao" bindtap="exit"> <view class="tubiao" bindtap="exit">
<van-icon name="cross" /> <van-icon name="cross" />
</view> </view>
</view> </view>
<view class="pinlai">宏光MINIEV销量趋势</view> <view class="pinlai">宏光MINIEV销量趋势</view>
<view class="brand_tu"> <view class="brand_tu">
<c-echars showChart="{{showChart}}" canvasId="tonalitybar-canvas" chartId="tonalitybar" chartOption="{{positiveOption}}" width="100%" height="100%"></c-echars> <c-echars flocShow="{{true}}" showChart="{{showChart}}" canvasId="tonalitybar-canvas" chartId="tonalitybar" chartOption="{{positiveOption}}" width="200rpx"height='500rpx' ></c-echars>
</view> </view>
</view> </view>
</page-container> </page-container>

@ -1,2 +0,0 @@
<!--pages/index/home/home.wxml-->
<text>pages/index/home/home.wxml</text>

@ -0,0 +1,66 @@
// pages/pages/home/home.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,2 @@
<!--pages/pages/home/home.wxml-->
<text>pages/pages/home/home.wxml</text>

@ -49,6 +49,20 @@
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
},
{
"name": "",
"pathName": "pages/index/home/home",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/home/home",
"query": "",
"launchMode": "default",
"scene": null
} }
] ]
} }

Loading…
Cancel
Save