123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>趋势图-我的业绩-爽客邦</title>
- <meta name="keywords" content="趋势图-我的业绩-爽客邦">
- <meta name="description" content="趋势图-我的业绩-爽客邦">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="趋势图-我的业绩-爽客邦">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body>
- <div class="trendchart" id="app">
- <van-nav-bar class="user_rank_explan_title user_title_normal titlef16" left-arrow :title="title +'-趋势图'" v-if="toptitleisshow" @click-left="goback">
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <van-tabs v-model="active" @click="changetab">
- <van-tab disabled> </van-tab>
- <van-tab title="日报">
- <div v-if="active === 1">
- <div class="panel pl16 pr16">
- <div class="echaet_box" ref="echart_all"></div>
- <div class="text f16 tc">总交易趋势图</div>
- </div>
- <div class="panel pl16 pr16">
- <div class="echaet_box" ref="echart_add"></div>
- <div class="text f16 tc">新增创客总数趋势图</div>
- </div>
- <div class="panel pl16 pr16">
- <div class="echaet_box" ref="echart_add1"></div>
- <div class="text f16 tc">新增参与商户总数趋势图</div>
- </div>
- </div>
- </van-tab>
- <van-tab title="月报">
- <div v-if="active === 2">
- <div class="panel pl16 pr16">
- <div class="echaet_box" ref="echart_all"></div>
- <div class="text f16 tc">总交易趋势图</div>
- </div>
- <div class="panel pl16 pr16">
- <div class="echaet_box" ref="echart_add"></div>
- <div class="text f16 tc">新增创客总数趋势图</div>
- </div>
- <div class="panel pl16 pr16">
- <div class="echaet_box" ref="echart_add1"></div>
- <div class="text f16 tc">新增参与商户总数趋势图</div>
- </div>
- </div>
- </van-tab>
- <van-tab disabled> </van-tab>
- </van-tabs>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/echarts.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/performanceechart.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- Vue.use(vant.Dialog);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- toptitleisshow:false,
- title:'个人业绩',
- active:1,
- echart1Data:{
- },
- echart2Data:{
- },
- echart3Data:{
- }
- }
- },
- created(){
- this.toptitleisshow = toptitleisshow;
- this.title = PublicLib.getCookieInfo('trendtype');
- this.getdata();
- PublicLib.SetTitle({Title:PublicLib.getCookieInfo('trendtype')+'-趋势图'});
- },
- computed:{
- },
- methods: {
- echart1(){
- performanceechart(this.$refs.echart_all,this.echart1Data.data,this.echart1Data.date,'元');
- },
- echart2(){
- performanceechart(this.$refs.echart_add,this.echart2Data.data,this.echart2Data.date,'个');
- },
- echart3(){
- performanceechart(this.$refs.echart_add1,this.echart3Data.data,this.echart3Data.date,'个');
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- changetab(){
- this.getdata();
- },
- async getdata(){
- let requestUrl = '';
- if(PublicLib.getCookieInfo('trendtype') === '个人业绩'){
- requestUrl = '/api/v1/users/personalperformancetrend';
- }else{
- requestUrl = '/api/v1/users/teamperformancetrend';
- };
- PublicLib.ShowLoading({Message:''});
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest(requestUrl,JSON.stringify({Kind:this.active,UserId}));
- if(res.status !== '1')return tips('业绩趋势图获取失败,请重试!');
- PublicLib.HideLoading();
- if(this.active === 1){
- res.data.MainTrade = [
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 6), //日期/月份
- TradeAmt: 1368.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 5), //日期/月份
- TradeAmt: 2657.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 4), //日期/月份
- TradeAmt: 2361.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 3), //日期/月份
- TradeAmt: 2968.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 2), //日期/月份
- TradeAmt: '2982.00' //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 1), //日期/月份
- TradeAmt: 5023.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate()), //日期/月份
- TradeAmt: '3209.00' //交易额
- }
- ];
- res.data.AddMaker = [
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate()-6), //日期/月份
- TradeAmt: 8.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() -5), //日期/月份
- TradeAmt: 6.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() -4), //日期/月份
- TradeAmt: 6.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() -3 ), //日期/月份
- TradeAmt: 9.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 2), //日期/月份
- TradeAmt: '8' //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 1), //日期/月份
- TradeAmt: 11.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate()), //日期/月份
- TradeAmt: '12' //交易额
- }
- ];
- res.data.AddActMerchant = [
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 6), //日期/月份
- TradeAmt: 235.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 5), //日期/月份
- TradeAmt: 356.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 4), //日期/月份
- TradeAmt: 421.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 3), //日期/月份
- TradeAmt: 432.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 2), //日期/月份
- TradeAmt: '352' //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 1), //日期/月份
- TradeAmt: 635.00 //交易额
- },
- {
- Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate()), //日期/月份
- TradeAmt: '523' //交易额
- }
- ];
- }else{
- res.data.MainTrade = [
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -5), //日期/月份
- TradeAmt: 45201.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -4), //日期/月份
- TradeAmt: 56201.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -3), //日期/月份
- TradeAmt: 62510.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -2), //日期/月份
- TradeAmt: 71055.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -1), //日期/月份
- TradeAmt: '73856.00' //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth()), //日期/月份
- TradeAmt: 83000.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth()+1), //日期/月份
- TradeAmt: '82100.00' //交易额
- }
- ];
- res.data.AddMaker = [
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 5), //日期/月份
- TradeAmt: 204.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 4), //日期/月份
- TradeAmt: 175.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 3), //日期/月份
- TradeAmt: 186.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 2), //日期/月份
- TradeAmt: 198.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 1), //日期/月份
- TradeAmt: '261' //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth()), //日期/月份
- TradeAmt: 275.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() + 1), //日期/月份
- TradeAmt: '268' //交易额
- }
- ];
- res.data.AddActMerchant = [
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 5), //日期/月份
- TradeAmt: 1587.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 4), //日期/月份
- TradeAmt: 2541.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 3), //日期/月份
- TradeAmt: 3521.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 2), //日期/月份
- TradeAmt: 3985.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 1), //日期/月份
- TradeAmt: '4852' //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth()), //日期/月份
- TradeAmt: 5215.00 //交易额
- },
- {
- Time: new Date().getFullYear() + ' ' + (new Date().getMonth() + 1), //日期/月份
- TradeAmt: '6202' //交易额
- }
- ];
- };
- //- 需要删除模拟数据
- this.echart1Data.date = res.data.MainTrade.map(item=>item.Time);
- this.echart1Data.data = res.data.MainTrade.map(item=>item.TradeAmt);
- this.echart1();
- this.echart2Data.date = res.data.AddMaker.map(item=>item.Time);
- this.echart2Data.data = res.data.AddMaker.map(item=>item.TradeAmt);
- this.echart2();
- this.echart3Data.date = res.data.AddActMerchant.map(item=>item.Time);
- this.echart3Data.data = res.data.AddActMerchant.map(item=>item.TradeAmt);
- this.echart3();
- },
- }
- });
- </script>
- </body>
- </html>
|