product-trendchart.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>趋势图-我的业绩-创业帮</title>
  6. <meta name="keywords" content="趋势图-我的业绩-创业帮">
  7. <meta name="description" content="趋势图-我的业绩-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="趋势图-我的业绩-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. <style>
  17. .screenroll::-webkit-scrollbar {
  18. display: none !important;
  19. }
  20. .screenroll{
  21. height : calc(100vh - 45px) !important;
  22. }
  23. </style>
  24. </head>
  25. <body class="pb0 pt0 ovh" style="box-sizing: border-box;padding:0;">
  26. <div class="trendchart" id="app" style="padding:none;" v-cloak>
  27. <van-nav-bar class="user_rank_explan_title user_title_normal titlef16" left-arrow :title="title +'-趋势图'" v-if="toptitleisshow" @click-left="goback">
  28. <template #left> <img src="./static/images/left.png" alt=""></template>
  29. </van-nav-bar>
  30. <van-tabs v-model="active" swipeable @change="changetab">
  31. <van-tab disabled> </van-tab>
  32. <van-tab title="日报">
  33. <div class="screenroll">
  34. <div v-if="active === 1">
  35. <div class="panel pl16 pr16">
  36. <div class="echaet_box" ref="echart_all"></div>
  37. <div class="text f16 tc">总交易趋势图</div>
  38. </div>
  39. <div class="panel pl16 pr16">
  40. <div class="echaet_box" ref="echart_add"></div>
  41. <div class="text f16 tc">新增创客总数趋势图</div>
  42. </div>
  43. <div class="panel pl16 pr16">
  44. <div class="echaet_box" ref="echart_add1"></div>
  45. <div class="text f16 tc">新增激活商户总数趋势图</div>
  46. </div>
  47. </div>
  48. </div>
  49. </van-tab>
  50. <van-tab title="月报">
  51. <div class="screenroll">
  52. <div v-if="active === 2">
  53. <div class="panel pl16 pr16">
  54. <div class="echaet_box" ref="echart_all"></div>
  55. <div class="text f16 tc">总交易趋势图</div>
  56. </div>
  57. <div class="panel pl16 pr16">
  58. <div class="echaet_box" ref="echart_add"></div>
  59. <div class="text f16 tc">新增创客总数趋势图</div>
  60. </div>
  61. <div class="panel pl16 pr16">
  62. <div class="echaet_box" ref="echart_add1"></div>
  63. <div class="text f16 tc">新增激活商户总数趋势图</div>
  64. </div>
  65. </div>
  66. </div>
  67. </van-tab>
  68. <van-tab disabled> </van-tab>
  69. </van-tabs>
  70. </div>
  71. <script src="./static/js/echarts.min.js"></script>
  72. <script src="./static/js/klm-vv.min.js"></script>
  73. <script src="./static/js/appfunc.min.js"></script>
  74. <script src="./static/js/klm-axios-config.js"></script>
  75. <script src="./static/js/publicfn.js"></script>
  76. <script src="./static/js/performanceechart.js"></script>
  77. <script>
  78. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  79. // 可以通过下面的方式手动注册
  80. Vue.use(vant.Lazyload);
  81. Vue.use(vant.Dialog);
  82. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  83. // 在 #app 标签下渲染一个按钮组件
  84. let app = new Vue({
  85. el: '#app',
  86. data() {
  87. return {
  88. toptitleisshow,
  89. title:'个人交易',
  90. active:1,
  91. echart1Data:{
  92. },
  93. echart2Data:{
  94. },
  95. echart3Data:{
  96. },
  97. daydata:{},
  98. monthdata:{},
  99. }
  100. },
  101. async created(){
  102. this.title = PublicLib.getCookieInfo('trendtype');
  103. await this.getdata();
  104. await this.getmonthdata();
  105. PublicLib.SetTitle({Title:PublicLib.getCookieInfo('trendtype')+'-趋势图'});
  106. },
  107. beforeUpdate() {
  108. this.$nextTick(()=>{
  109. performanceechart(this.$refs.echart_all,this.echart1Data.data,this.echart1Data.date,'元');
  110. performanceechart(this.$refs.echart_add,this.echart2Data.data,this.echart2Data.date,'个');
  111. performanceechart(this.$refs.echart_add1,this.echart3Data.data,this.echart3Data.date,'个');
  112. this.firstchart();
  113. })
  114. },
  115. methods: {
  116. echart1(){
  117. performanceechart(this.$refs.echart_all,this.echart1Data.data,this.echart1Data.date,'元');
  118. },
  119. echart2(){
  120. performanceechart(this.$refs.echart_add,this.echart2Data.data,this.echart2Data.date,'个');
  121. },
  122. echart3(){
  123. performanceechart(this.$refs.echart_add1,this.echart3Data.data,this.echart3Data.date,'个');
  124. },
  125. goback(){
  126. PublicLib.GoBack({Level:1});
  127. },
  128. changetab(){
  129. if(this.active === 1){
  130. this.formatdata(this.daydata);
  131. };
  132. if(this.active === 2){
  133. this.formatdata(this.monthdata);
  134. };
  135. },
  136. async getdata(){
  137. let requestUrl = '';
  138. if(PublicLib.getCookieInfo('trendtype') === '个人交易'){
  139. requestUrl = 'api/v1/users/personalperformancetrend?t='+Math.random(6);
  140. }else{
  141. requestUrl = 'api/v1/users/teamperformancetrend?t='+Math.random(6);
  142. };
  143. const UserId = PublicLib.getCookieInfo('userId');
  144. const res = await getRequest(requestUrl,JSON.stringify({Kind:1,UserId}));
  145. if(res.status !== '1')return tips('业绩趋势图获取失败,请重试!');
  146. this.daydata = res;
  147. this.formatdata(res);
  148. this.echart1();
  149. this.echart2();
  150. this.echart3();
  151. },
  152. async getmonthdata(){
  153. let requestUrl = '';
  154. if(PublicLib.getCookieInfo('trendtype') === '个人交易'){
  155. requestUrl = 'api/v1/users/personalperformancetrend?t='+Math.random(6);
  156. }else{
  157. requestUrl = 'api/v1/users/teamperformancetrend?t='+Math.random(6);
  158. };
  159. const UserId = PublicLib.getCookieInfo('userId');
  160. const res = await getRequest(requestUrl,JSON.stringify({Kind:2,UserId}));
  161. if(res.status !== '1')return tips('业绩趋势图获取失败,请重试!');
  162. res.data.MainTrade.forEach(item=>{
  163. if(item.Time === '202208' && PublicLib.getCookieInfo('userId') === '1'){
  164. item.TradeAmt += 313218560.58;
  165. };
  166. if(item.Time === '202207' && PublicLib.getCookieInfo('userId') === '1'){
  167. item.TradeAmt += 53218560.58;
  168. };
  169. })
  170. this.monthdata = res;
  171. //- this.formatdata(res);
  172. },
  173. formatdata(res){
  174. this.echart1Data.date = res.data.MainTrade.map(item=>item.Time);
  175. this.echart1Data.data = res.data.MainTrade.map(item=>item.TradeAmt);
  176. this.echart2Data.date = res.data.AddMaker.map(item=>item.Time);
  177. this.echart2Data.data = res.data.AddMaker.map(item=>item.Count);
  178. this.echart3Data.date = res.data.AddActMerchant.map(item=>item.Time);
  179. this.echart3Data.data = res.data.AddActMerchant.map(item=>item.Count);
  180. },
  181. }
  182. });
  183. </script>
  184. </body>
  185. </html>