diff --git a/components/distributePoster/index.wxml b/components/distributePoster/index.wxml index 60480d9..5883836 100644 --- a/components/distributePoster/index.wxml +++ b/components/distributePoster/index.wxml @@ -1,12 +1,12 @@ - + - + diff --git a/pages/dataAnalysis/index.json b/pages/dataAnalysis/index.json index a0accc8..f00c9e7 100644 --- a/pages/dataAnalysis/index.json +++ b/pages/dataAnalysis/index.json @@ -1,4 +1,5 @@ { + "navigationBarTitleText": "数据分析", "enablePullDownRefresh": true, "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#1a1c26", diff --git a/pages/distribute/index.wxml b/pages/distribute/index.wxml index 5db03e9..dfc2956 100644 --- a/pages/distribute/index.wxml +++ b/pages/distribute/index.wxml @@ -1,21 +1,52 @@ - - - - - {{item.name}} - - - - - - - - - + + + + 分享素材,获得属于你的专属客户 + 所有报名用户都会直接进入你的客户 + - + + + + 推广素材 + + + + 推广数据 + + + + + + + + + + + 联系小狸 + + + + - \ No newline at end of file + + + + + + 添加客服微信号 + + 分销问题,下单问题都可以加我哦 + + + + + + + + + + \ No newline at end of file diff --git a/pages/distribute/material/index.js b/pages/distribute/material/index.js index 4d7dbe2..9be7c80 100644 --- a/pages/distribute/material/index.js +++ b/pages/distribute/material/index.js @@ -13,12 +13,12 @@ Page({ flag: 1, poster: { isShow: false, - status:0, isCreateQrcode: false, qrcodeid:'', customPoster: '', slogan:'', }, + showPoster:false, }, onLoad: function (options) { for (let key in options) { @@ -142,16 +142,44 @@ Page({ //生成海报 showPoster(e){ let index = e.currentTarget.dataset.index + let that = this + if(that.data.list[index].status == 0){ + that.setData({ + showPoster:true, + currentIndex:index, + }) + }else{ + wx.showLoading({ + title: '正在生成中...', + }) + that.setData({ + 'poster.isCreateQrcode':true, + 'poster.qrcodeid':that.data.list[index].id, + 'poster.customPoster':that.data.list[index].img, + 'poster.slogan':that.data.list[index].title, + }) + setTimeout(function(){ + that.setData({ + 'poster.isShow': true + }) + wx.hideLoading() + },3000) + } + + }, + + //生成海报 + createSpecial(e){ let that = this wx.showLoading({ title: '正在生成中...', }) that.setData({ - 'poster.status':that.data.list[index].status, + showPoster:false, 'poster.isCreateQrcode':true, - 'poster.qrcodeid':that.data.list[index].id, - 'poster.customPoster':that.data.list[index].img, - 'poster.slogan':that.data.list[index].title, + 'poster.qrcodeid':that.data.list[that.data.currentIndex].id, + 'poster.customPoster':that.data.list[that.data.currentIndex].img, + 'poster.slogan':that.data.list[that.data.currentIndex].title, }) setTimeout(function(){ that.setData({ @@ -159,7 +187,27 @@ Page({ }) wx.hideLoading() },3000) - + }, + + //复制内容 + copyWord(e){ + if(e.currentTarget.dataset.tx){ + wx.setClipboardData({ + data: e.currentTarget.dataset.tx, + success (res) { + _.utils.$toast('复制成功') + } + }) + }else{ + _.utils.$toast('目前无文案') + } + }, + + //推送链接 + pushLink(e){ + if(e.currentTarget.dataset.url){ + _.$router.openUrlScheme(e.currentTarget.dataset.url) + } }, //页面相关事件处理函数--监听用户下拉动作 diff --git a/pages/distribute/material/index.wxml b/pages/distribute/material/index.wxml index 31fd73d..a34365f 100644 --- a/pages/distribute/material/index.wxml +++ b/pages/distribute/material/index.wxml @@ -14,8 +14,34 @@ + + 哪吒V仅售28999元,立即预约马上试驾,还可享受5年电池质保~ + + 复制 + + + + + 哪吒V仅售28999元,立即预约马上试驾,还可享受5年电池质保~ + + 复制 + + + - \ No newline at end of file + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/distribute/statistics/index.js b/pages/distribute/statistics/index.js index d91f863..ca1e25a 100644 --- a/pages/distribute/statistics/index.js +++ b/pages/distribute/statistics/index.js @@ -1,113 +1,182 @@ -import _ from '../../../commons/js/commons'; +import _ from '../../../commons/js/commons' +import popularData from '../../../commons/js/lib/popularData'; import * as echarts from '../../../ecCanvas/components/ec-canvas/echarts'; -let chartData; -function initChart(canvas, width, height, dpr) { +const app = getApp() + +let barChartData; +let lineChartData; +function barChart(canvas, width, height, dpr) { const chart = echarts.init(canvas, null, { width: width, height: height, devicePixelRatio: dpr // new }); canvas.setChart(chart); - let option = chartData + let option = barChartData chart.setOption(option); return chart; } +function lineChart(canvas, width, height, dpr) { + const chart = echarts.init(canvas, null, { + width: width, + height: height, + devicePixelRatio: dpr // new + }); + canvas.setChart(chart); + let option = lineChartData + chart.setOption(option); + return chart; +} + Page({ data: { - imgUrl: _.config.imgUrl,//静态图片路径 - tab_list:[ + imgUrl:_.config.imgUrl, + showBarChart:false,//是否显示Bar图表 + ecBar:{}, + showLineChart:false,//是否显示Line图表 + ecLine:{}, + storeArray: [], + storeobj: [], + storeIndex:0, + staffArray: [], + staffobj: [], + staffIndex:-1, + tabId:'1', + tab:[ { - title:'近7日', - value:7, + id: 1, + title: '客户数据' }, { - title:'近30日', - value:30, + id: 2, + title: '订单数据' }, ], - tabvalue:7, + custom:[],//客户数据 + order:[],//订单数据 }, - onLoad: function (options) { + + onLoad(options) { for (let key in options) { this.setData({ [key]: options[key] }) } + popularData.getDateLater(0,0).then(res => { + this.setData({ + dateTime:res[0], + }) + }) - this.getdata() + this.getAppStatisticsOcust() }, - //获取统计数据 - getdata(){ + onShow: function () { + + }, - chartData = { - legend: { - data: ['浏览', '报名', '成交'], - bottom:20, - left: 'center', - z: 100 - }, - grid: { - containLabel: true - }, - tooltip: { - show: true, - trigger: 'axis' - }, - xAxis: { - type: 'category', - boundaryGap: false, - data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], - // show: false - }, - yAxis: { - x: 'center', - type: 'value', - splitLine: { - lineStyle: { - type: 'dashed' - } + //获取管理门店 + getAppUserAdmins(){ + let params = {}; + params['biz_id'] = this.data.storeobj[this.data.storeIndex].id; + params['page'] = 1; + params['size'] = 1000; + _.apiQuery.getAppUserAdmins(params).then(res => { + let staffArray = [] + res.data.list.forEach(item => { + staffArray.push(item.uname) + }) + this.setData({ + staffArray:staffArray, + staffobj: res.data.list, + }) + }); + }, + + //数据分析-订单数据 + getAppStatisticsOcust(){ + + let res = { + "code":200, + "data":{ + "stat_data":{ + "tooltip":{"trigger":"axis"}, + "legend":{ + "top":"bottom", + "data":["浏览","客户","订单"] + }, + "grid":{"top":"10%","left":"2%","right":"5%","bottom":"15%","containLabel":true}, + "xAxis":{"type":"category","boundaryGap":false,"data":["10月","11月","12月"]}, + "yAxis":{"type":"value"}, + "series":[ + {"name":"浏览","type":"line","stack":"总量","data":[2,3,4],"smooth":true}, + {"name":"客户","type":"line","stack":"总量","data":[3,6,7],"smooth":true}, + {"name":"订单","type":"line","stack":"总量","data":[5,2,1],"smooth":true}, + ] }, - // show: false + "season_data":[], + "season":3 }, - series: [ - { - name: '浏览', - type: 'line', - smooth: true, - data: [18, 36, 65, 30, 78, 40, 33] - }, - { - name: '报名', - type: 'line', - smooth: true, - data: [12, 50, 51, 35, 70, 30, 20] - }, - { - name: '成交', - type: 'line', - smooth: true, - data: [10, 30, 31, 50, 40, 20, 10] - } - ] - }; + "msg":"" + } + lineChartData = res.data.stat_data this.setData({ - ec: { - onInit:initChart - } + order:res.data.custom, + showLineChart:true, + ['ecLine.onInit']:lineChart, }) + wx.stopPullDownRefresh() + // let params = {}; + // params['biz_id'] = this.data.storeobj[this.data.storeIndex].id; + // params['day'] = this.data.dateTime; + // if(this.data.staffIndex>-1){ + // params['admin_id'] = this.data.staffobj[this.data.staffIndex].id; + // } + // _.apiQuery.getAppStatisticsOcust(params).then(res => { + + // lineChartData = res.data.stat_data + // this.setData({ + // order:res.data.custom, + // showLineChart:true, + // ['ecLine.onInit']:lineChart, + // }) + + // wx.stopPullDownRefresh() + + // }); }, - //却换时间tab - changeTab(e){ + //选择城市 + changeCity(e) { this.setData({ - tabvalue: e.currentTarget.dataset.value, + city_id:this.data.cityList[e.detail.value].city_id, + cityIndex: e.detail.value }) - //this.getDxtPhoneBill() + this.getAppUserBizs() + }, + + //选择门店 + changeStore(e) { + this.setData({ + storeIndex: e.detail.value + }) + this.getAppStatisticsOcust() + }, + + //日期选择 + changeDate(e){ + this.setData({ + dateTime: e.detail.value, + }) + if(this.data.tabId==1){ + this.getAppStatisticsScust() + }else if(this.data.tabId==2){ + this.getAppStatisticsOcust() + } }, //推送链接 @@ -119,6 +188,32 @@ Page({ //页面相关事件处理函数--监听用户下拉动作 onPullDownRefresh: function () { - + //this.getAppUserBizs() }, -}) \ No newline at end of file + +}) + +function getLineOption() { + + return{ + grid: { + top: '15%', + left: '2%', + right: '5%', + bottom: '5%', + containLabel: true + }, + xAxis: { + type: 'category', + data: ['1月', '2月', '3月',] + }, + yAxis: { + type: 'value' + }, + series: [{ + data: [20, 932, 901,], + type: 'line', + smooth: true + }] + }; +} \ No newline at end of file diff --git a/pages/distribute/statistics/index.json b/pages/distribute/statistics/index.json index 21d1d27..26aa7a7 100644 --- a/pages/distribute/statistics/index.json +++ b/pages/distribute/statistics/index.json @@ -1,5 +1,10 @@ { - "navigationBarTitleText": "推广与提现", + "navigationBarTitleText": "数据分析", + "enablePullDownRefresh": true, + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#1a1c26", + "backgroundColor": "#ffffff", + "backgroundColorTop": "#1a1c26", "usingComponents": { "ec-canvas": "../../../ecCanvas/components/ec-canvas/ec-canvas" } diff --git a/pages/distribute/statistics/index.wxml b/pages/distribute/statistics/index.wxml index 94a01e1..34f41a9 100644 --- a/pages/distribute/statistics/index.wxml +++ b/pages/distribute/statistics/index.wxml @@ -1,69 +1,69 @@ - - - - - - 累计数据 + + + + + + 泉州鲤城区4s店 + + 日期选择 + + + {{dateTime}} + + + - - - 19.00W - 浏览 - - - 2345 - 报名 - - - 1875 - 成交 - + + 素材选择 + + + 全部 + {{staffArray[staffIndex]}} + + + - - - - 推广车型 - - - - 东风EX1 - 车型 + + + + + + + + + + 233 + 浏览次数 + + + + + + + + 233 + 报名客户 + + + + + + + + 12.23w + 订单客户 + + - - 4353 - 报名 + + + - - 265 - 成交 - - - 26.13W - 佣金 - - - - - 浏览情况趋势图 - - - - {{item.title}} - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/pages/distribute/statistics/index.wxss b/pages/distribute/statistics/index.wxss index d37860e..e69de29 100644 --- a/pages/distribute/statistics/index.wxss +++ b/pages/distribute/statistics/index.wxss @@ -1,21 +0,0 @@ -/* pages/distribute/statistics/index.wxss */ -@import '../../../commons/css/custom/kefu.wxss'; - -.echarts-con { - position:relative; - top:-20px; - bottom: 0; - left: 0; - right: 0; - height:560rpx; - - display: flex; - flex-direction: column; - align-items: center; - justify-content: space-between; - box-sizing: border-box; -} -ec-canvas { - width: 100%; - height: 100%; -}