From 1bf9e379f70c4290afff39edb627e2f4fea23355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Wed, 15 Sep 2021 16:09:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/channel/index.js | 12 +++--- pages/channel/index.wxml | 8 ++-- pages/dataAnalysis/index.js | 81 +++++++++++++++++++++++++++++++++++ pages/dataAnalysis/index.wxml | 43 +++++++++++++++++-- 4 files changed, 131 insertions(+), 13 deletions(-) diff --git a/pages/channel/index.js b/pages/channel/index.js index ffa60c4..12e4633 100644 --- a/pages/channel/index.js +++ b/pages/channel/index.js @@ -27,8 +27,8 @@ Page({ deallist:'', hoursTip:'', - cityarray: ['第一季度', '第二季度', '第三季度','第四季度', ], - cityobj: [ + quarterarray: ['第一季度', '第二季度', '第三季度','第四季度', ], + quarterobj: [ { id: 0, name: '第一季度' @@ -46,7 +46,7 @@ Page({ name: '第四季度' }, ], - cityIndex: 0, + quarterIndex: 0, }, @@ -95,10 +95,10 @@ Page({ }); }, - //选择城市 - changeCity(e) { + //选择季度 + changeQuarter(e) { this.setData({ - cityIndex: e.detail.value + quarterIndex: e.detail.value }) }, diff --git a/pages/channel/index.wxml b/pages/channel/index.wxml index c3b748c..093cea1 100644 --- a/pages/channel/index.wxml +++ b/pages/channel/index.wxml @@ -32,9 +32,9 @@ 数据分析·客户 - + - {{cityarray[cityIndex]}} + {{quarterarray[quarterIndex]}} @@ -49,9 +49,9 @@ 数据分析·订单 - + - {{cityarray[cityIndex]}} + {{quarterarray[quarterIndex]}} diff --git a/pages/dataAnalysis/index.js b/pages/dataAnalysis/index.js index c65c335..256aa7e 100644 --- a/pages/dataAnalysis/index.js +++ b/pages/dataAnalysis/index.js @@ -1,9 +1,56 @@ import _ from '../../commons/js/commons' +import popularData from '../../commons/js/lib/popularData'; import * as echarts from '../../ecCanvas/components/ec-canvas/echarts'; const app = getApp() Page({ data: { imgUrl:_.config.imgUrl, + + storearray: ['厦门店', '泉州店', '福州店', ], + storeobj: [ + { + id: 0, + name: '厦门店' + }, + { + id: 1, + name: '泉州店' + }, + { + id: 2, + name: '福州店' + }, + ], + storeIndex:0, + + staffarray: ['张三', '李四', '王五', ], + staffobj: [ + { + id: 0, + name: '张三' + }, + { + id: 1, + name: '李四' + }, + { + id: 2, + name: '王五' + }, + ], + staffIndex:-1, + + tabId:'1', + tab:[ + { + id: 1, + title: '王五' + }, + { + id: 2, + title: '王五' + }, + ], }, onLoad(options) { @@ -12,6 +59,11 @@ Page({ [key]: options[key] }) } + popularData.getDateLater(0,0).then(res => { + this.setData({ + dateTime:res[0], + }) + }) this.getBar() this.getLine() @@ -21,6 +73,35 @@ Page({ }, + //选择门店 + changeStore(e) { + this.setData({ + storeIndex: e.detail.value + }) + }, + + //日期选择 + changeDate(e){ + this.setData({ + dateTime: e.detail.value, + }) + }, + + //选择人员 + changeStaff(e) { + this.setData({ + staffIndex: e.detail.value + }) + }, + + //切换tab + changeTab(e){ + this.setData({ + tabId:e.currentTarget.dataset.id, + }) + //this.searchSubmit() + }, + getBar(){ this.setData({ ecBar: { diff --git a/pages/dataAnalysis/index.wxml b/pages/dataAnalysis/index.wxml index dfd51ac..4cb7041 100644 --- a/pages/dataAnalysis/index.wxml +++ b/pages/dataAnalysis/index.wxml @@ -2,10 +2,47 @@ - - + + 门店 - + + + {{storearray[storeIndex]}} + + + + + + 日期选择 + + + {{dateTime}} + + + + + + 人员选择 + + + 全部 + {{staffarray[staffIndex]}} + + + + + + + + + + + {{item.title}} + + + + +