wylyl22 3 years ago
parent 7348d51134
commit d42a8230b4

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

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

@ -1,4 +1,4 @@
<!--pages/components/custom-echarts/index.wxml-->
<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>

@ -1,18 +1,40 @@
import histogram from "../option/columnarOption"
const data=['智骏', '国机', '小虎', '华晨', '朋克美美','华晨新日','百智大熊','朋克多多','YOUNG光小新','易至EV3','雷丁芒果','风光MINIEV','宝骏KiWiEV','思皓E10X','零跑T03','科莱威CLEVER','奔奔E-Star','QQ冰激凌','小蚂蚁','宏光MINIEV',]
const data2= [600,700,800,900,1000,1200,1300,1400,1500,1600,1700,1900,2000,2100,2200,2300,2400,2500,2600,2700,]
const app = getApp()
Component({
data: {
showChart: true,
brandOption: histogram(data,data2,[],'#0084FF',false),
},
onShow() {
this.getTabBar().init();
// onShow() {
// this.getTabBar().init();
// },
lifetimes:{
attached(){
this.getTrend()
}
},
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){
this.setData({
intervalSel: e.currentTarget.dataset.index

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

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

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

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

@ -1,42 +1,42 @@
<!--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;">
<view class="top">
<view class="box_title">全部</view>
</view>
<view class="top">
<view class="box_title">
<picker mode="date" header-text="选择时间" fields="month" value="{{date}}" bindchange="bindDateChange">
<view class="font30">
<!-- <text class="color3">填报时间:</text> -->
<text class="color6">{{date}}</text>
<text class="timeIcon">▼</text>
</view>
</picker>
</view>
<view class="box_title">
<picker mode="date" header-text="选择时间" fields="month" value="{{date}}" bindchange="bindDateChange">
<view class="font30">
<!-- <text class="color3">填报时间:</text> -->
<text class="color6">{{date}}</text>
<text class="timeIcon">▼</text>
</view>
</picker>
</view>
</view>
<view class="top">
<!-- 下拉框 -->
<view class="top-selected" id="1" bindtap="bindShowMsg">
<text class="title">{{grade_name1}}</text>
<view class="top-selected" id="1" bindtap="bindShowMsg">
<text class="title">{{grade_name1}}</text>
<text class="timeIcon">▼</text>
</view>
<!-- 下拉需要显示的列表 -->
<view class="select_box" wx:if="{{select1}}">
<view wx:for="{{grades1}}" wx:key="unique">
<view class="select_box" wx:if="{{select1}}">
<view wx:for="{{grades1}}" wx:key="unique">
<view class="select_one" bindtap="mySelect1" data-name="{{item}}">{{item.name}}</view>
</view>
</view>
</view>
<view class="top">
<!-- 下拉框 -->
<view class="top-selected" id="2" bindtap="bindShowMsg">
<view class="top-selected" id="2" bindtap="bindShowMsg">
<text class="title">{{grade_name2}}</text>
<text class="timeIcon">▼</text>
</view>
<!-- 下拉需要显示的列表 -->
<view class="select_box" wx:if="{{select2}}">
<view class="select_box" wx:if="{{select2}}">
<view wx:for="{{grades2}}" wx:key="unique">
<view class="select_one" bindtap="mySelect2" data-name="{{item}}">{{item.name}}</view>
</view>
@ -49,7 +49,7 @@
<text class="timeIcon">▼</text>
</view>
<!-- 下拉需要显示的列表 -->
<view class="select_box" wx:if="{{select3}}">
<view class="select_box" wx:if="{{select3}}">
<view wx:for="{{grades3}}" wx:key="unique">
<view class="select_one" bindtap="mySelect3" data-name="{{item}}">{{item.name}}</view>
</view>
@ -62,7 +62,7 @@
<text class="timeIcon">▼</text>
</view>
<!-- 下拉需要显示的列表 -->
<view class="select_box" wx:if="{{select4}}">
<view class="select_box" wx:if="{{select4}}">
<view wx:for="{{grades4}}" wx:key="unique">
<view class="select_one" bindtap="mySelect4" data-name="{{item}}">{{item}}</view>
</view>
@ -104,7 +104,7 @@
</view>
<view style="width: 30%;">
<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" />
<view>销量趋势</view>
</view>
@ -115,18 +115,17 @@
</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 style="display: flex;">
<view class="qushi">销量趋势</view>
<view class="tubiao" bindtap="exit">
<van-icon name="cross" />
</view>
</view>
<view class="pinlai">宏光MINIEV销量趋势</view>
<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>
</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": "",
"launchMode": "default",
"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