123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <!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">
- <style>
- .screenroll::-webkit-scrollbar {
- display: none !important;
- }
- .screenroll{
- height : calc(100vh - 45px) !important;
- }
- </style>
- </head>
- <body class="pb0 pt0 ovh" style="box-sizing: border-box;padding:0;">
- <div class="trendchart" id="app" style="padding:none;" v-cloak>
- <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" swipeable @change="changetab">
- <van-tab disabled> </van-tab>
- <van-tab title="日报">
- <div class="screenroll">
- <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>
- </div>
- </van-tab>
- <van-tab title="月报">
- <div class="screenroll">
- <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>
- </div>
- </van-tab>
- <van-tab disabled> </van-tab>
- </van-tabs>
- </div>
- <script src="./static/js/echarts.min.js"></script>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script src="./static/js/performanceechart.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- Vue.use(vant.Dialog);
- PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- toptitleisshow,
- title:'个人交易',
- active:1,
- echart1Data:{
- },
- echart2Data:{
- },
- echart3Data:{
- },
- daydata:{},
- monthdata:{},
- }
- },
- async created(){
- this.title = PublicLib.getCookieInfo('trendtype');
- await this.getdata();
- await this.getmonthdata();
- PublicLib.SetTitle({Title:PublicLib.getCookieInfo('trendtype')+'-趋势图'});
- },
- beforeUpdate() {
- this.$nextTick(()=>{
- performanceechart(this.$refs.echart_all,this.echart1Data.data,this.echart1Data.date,'元');
- performanceechart(this.$refs.echart_add,this.echart2Data.data,this.echart2Data.date,'个');
- performanceechart(this.$refs.echart_add1,this.echart3Data.data,this.echart3Data.date,'个');
- this.firstchart();
- })
- },
- 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(){
- if(this.active === 1){
- this.formatdata(this.daydata);
- };
- if(this.active === 2){
- this.formatdata(this.monthdata);
- };
- },
- async getdata(){
- let requestUrl = '';
- if(PublicLib.getCookieInfo('trendtype') === '个人交易'){
- requestUrl = 'api/v1/users/personalperformancetrend?t='+Math.random(6);
- }else{
- requestUrl = 'api/v1/users/teamperformancetrend?t='+Math.random(6);
- };
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest(requestUrl,JSON.stringify({Kind:1,UserId}));
- if(res.status !== '1')return tips('业绩趋势图获取失败,请重试!');
- this.daydata = res;
- this.formatdata(res);
- this.echart1();
- this.echart2();
- this.echart3();
- },
- async getmonthdata(){
- let requestUrl = '';
- if(PublicLib.getCookieInfo('trendtype') === '个人交易'){
- requestUrl = 'api/v1/users/personalperformancetrend?t='+Math.random(6);
- }else{
- requestUrl = 'api/v1/users/teamperformancetrend?t='+Math.random(6);
- };
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest(requestUrl,JSON.stringify({Kind:2,UserId}));
- if(res.status !== '1')return tips('业绩趋势图获取失败,请重试!');
- res.data.MainTrade.forEach(item=>{
- if(item.Time === '202208' && PublicLib.getCookieInfo('userId') === '1'){
- item.TradeAmt += 313218560.58;
- };
- if(item.Time === '202207' && PublicLib.getCookieInfo('userId') === '1'){
- item.TradeAmt += 53218560.58;
- };
- })
- this.monthdata = res;
- //- this.formatdata(res);
- },
- formatdata(res){
- this.echart1Data.date = res.data.MainTrade.map(item=>item.Time);
- this.echart1Data.data = res.data.MainTrade.map(item=>item.TradeAmt);
- this.echart2Data.date = res.data.AddMaker.map(item=>item.Time);
- this.echart2Data.data = res.data.AddMaker.map(item=>item.Count);
- this.echart3Data.date = res.data.AddActMerchant.map(item=>item.Time);
- this.echart3Data.data = res.data.AddActMerchant.map(item=>item.Count);
- },
- }
- });
- </script>
- </body>
- </html>
|