product-trendchart.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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. </head>
  17. <body>
  18. <div class="trendchart" id="app">
  19. <van-nav-bar class="user_rank_explan_title user_title_normal titlef16" left-arrow :title="title +'-趋势图'" v-if="toptitleisshow" @click-left="goback">
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <van-tabs v-model="active" @click="changetab">
  23. <van-tab disabled> </van-tab>
  24. <van-tab title="日报">
  25. <div v-if="active === 1">
  26. <div class="panel pl16 pr16">
  27. <div class="echaet_box" ref="echart_all"></div>
  28. <div class="text f16 tc">总交易趋势图</div>
  29. </div>
  30. <div class="panel pl16 pr16">
  31. <div class="echaet_box" ref="echart_add"></div>
  32. <div class="text f16 tc">新增创客总数趋势图</div>
  33. </div>
  34. <div class="panel pl16 pr16">
  35. <div class="echaet_box" ref="echart_add1"></div>
  36. <div class="text f16 tc">新增参与商户总数趋势图</div>
  37. </div>
  38. </div>
  39. </van-tab>
  40. <van-tab title="月报">
  41. <div v-if="active === 2">
  42. <div class="panel pl16 pr16">
  43. <div class="echaet_box" ref="echart_all"></div>
  44. <div class="text f16 tc">总交易趋势图</div>
  45. </div>
  46. <div class="panel pl16 pr16">
  47. <div class="echaet_box" ref="echart_add"></div>
  48. <div class="text f16 tc">新增创客总数趋势图</div>
  49. </div>
  50. <div class="panel pl16 pr16">
  51. <div class="echaet_box" ref="echart_add1"></div>
  52. <div class="text f16 tc">新增参与商户总数趋势图</div>
  53. </div>
  54. </div>
  55. </van-tab>
  56. <van-tab disabled> </van-tab>
  57. </van-tabs>
  58. </div>
  59. <script src="./static/js/klm-vv.min.js"></script>
  60. <script src="./static/js/echarts.min.js"></script>
  61. <script src="./static/js/klm-axios-config.js"></script>
  62. <script src="./static/js/performanceechart.js"></script>
  63. <script>
  64. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  65. // 可以通过下面的方式手动注册
  66. Vue.use(vant.Lazyload);
  67. Vue.use(vant.Dialog);
  68. // 在 #app 标签下渲染一个按钮组件
  69. let app = new Vue({
  70. el: '#app',
  71. data() {
  72. return {
  73. toptitleisshow:false,
  74. title:'个人业绩',
  75. active:1,
  76. echart1Data:{
  77. },
  78. echart2Data:{
  79. },
  80. echart3Data:{
  81. }
  82. }
  83. },
  84. created(){
  85. this.toptitleisshow = toptitleisshow;
  86. this.title = PublicLib.getCookieInfo('trendtype');
  87. this.getdata();
  88. PublicLib.SetTitle({Title:PublicLib.getCookieInfo('trendtype')+'-趋势图'});
  89. },
  90. computed:{
  91. },
  92. methods: {
  93. echart1(){
  94. performanceechart(this.$refs.echart_all,this.echart1Data.data,this.echart1Data.date,'元');
  95. },
  96. echart2(){
  97. performanceechart(this.$refs.echart_add,this.echart2Data.data,this.echart2Data.date,'个');
  98. },
  99. echart3(){
  100. performanceechart(this.$refs.echart_add1,this.echart3Data.data,this.echart3Data.date,'个');
  101. },
  102. goback(){
  103. PublicLib.GoBack({Level:1});
  104. },
  105. changetab(){
  106. this.getdata();
  107. },
  108. async getdata(){
  109. let requestUrl = '';
  110. if(PublicLib.getCookieInfo('trendtype') === '个人业绩'){
  111. requestUrl = '/api/v1/users/personalperformancetrend';
  112. }else{
  113. requestUrl = '/api/v1/users/teamperformancetrend';
  114. };
  115. PublicLib.ShowLoading({Message:''});
  116. const UserId = PublicLib.getCookieInfo('userId');
  117. const res = await getRequest(requestUrl,JSON.stringify({Kind:this.active,UserId}));
  118. if(res.status !== '1')return tips('业绩趋势图获取失败,请重试!');
  119. PublicLib.HideLoading();
  120. if(this.active === 1){
  121. res.data.MainTrade = [
  122. {
  123. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 6), //日期/月份
  124. TradeAmt: 1368.00 //交易额
  125. },
  126. {
  127. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 5), //日期/月份
  128. TradeAmt: 2657.00 //交易额
  129. },
  130. {
  131. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 4), //日期/月份
  132. TradeAmt: 2361.00 //交易额
  133. },
  134. {
  135. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 3), //日期/月份
  136. TradeAmt: 2968.00 //交易额
  137. },
  138. {
  139. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 2), //日期/月份
  140. TradeAmt: '2982.00' //交易额
  141. },
  142. {
  143. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 1), //日期/月份
  144. TradeAmt: 5023.00 //交易额
  145. },
  146. {
  147. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate()), //日期/月份
  148. TradeAmt: '3209.00' //交易额
  149. }
  150. ];
  151. res.data.AddMaker = [
  152. {
  153. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate()-6), //日期/月份
  154. TradeAmt: 8.00 //交易额
  155. },
  156. {
  157. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() -5), //日期/月份
  158. TradeAmt: 6.00 //交易额
  159. },
  160. {
  161. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() -4), //日期/月份
  162. TradeAmt: 6.00 //交易额
  163. },
  164. {
  165. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() -3 ), //日期/月份
  166. TradeAmt: 9.00 //交易额
  167. },
  168. {
  169. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 2), //日期/月份
  170. TradeAmt: '8' //交易额
  171. },
  172. {
  173. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 1), //日期/月份
  174. TradeAmt: 11.00 //交易额
  175. },
  176. {
  177. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate()), //日期/月份
  178. TradeAmt: '12' //交易额
  179. }
  180. ];
  181. res.data.AddActMerchant = [
  182. {
  183. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 6), //日期/月份
  184. TradeAmt: 235.00 //交易额
  185. },
  186. {
  187. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 5), //日期/月份
  188. TradeAmt: 356.00 //交易额
  189. },
  190. {
  191. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 4), //日期/月份
  192. TradeAmt: 421.00 //交易额
  193. },
  194. {
  195. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 3), //日期/月份
  196. TradeAmt: 432.00 //交易额
  197. },
  198. {
  199. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 2), //日期/月份
  200. TradeAmt: '352' //交易额
  201. },
  202. {
  203. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate() - 1), //日期/月份
  204. TradeAmt: 635.00 //交易额
  205. },
  206. {
  207. Time: (new Date().getMonth() + 1) + ' ' + (new Date().getDate()), //日期/月份
  208. TradeAmt: '523' //交易额
  209. }
  210. ];
  211. }else{
  212. res.data.MainTrade = [
  213. {
  214. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -5), //日期/月份
  215. TradeAmt: 45201.00 //交易额
  216. },
  217. {
  218. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -4), //日期/月份
  219. TradeAmt: 56201.00 //交易额
  220. },
  221. {
  222. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -3), //日期/月份
  223. TradeAmt: 62510.00 //交易额
  224. },
  225. {
  226. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -2), //日期/月份
  227. TradeAmt: 71055.00 //交易额
  228. },
  229. {
  230. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() -1), //日期/月份
  231. TradeAmt: '73856.00' //交易额
  232. },
  233. {
  234. Time: new Date().getFullYear() + ' ' + (new Date().getMonth()), //日期/月份
  235. TradeAmt: 83000.00 //交易额
  236. },
  237. {
  238. Time: new Date().getFullYear() + ' ' + (new Date().getMonth()+1), //日期/月份
  239. TradeAmt: '82100.00' //交易额
  240. }
  241. ];
  242. res.data.AddMaker = [
  243. {
  244. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 5), //日期/月份
  245. TradeAmt: 204.00 //交易额
  246. },
  247. {
  248. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 4), //日期/月份
  249. TradeAmt: 175.00 //交易额
  250. },
  251. {
  252. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 3), //日期/月份
  253. TradeAmt: 186.00 //交易额
  254. },
  255. {
  256. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 2), //日期/月份
  257. TradeAmt: 198.00 //交易额
  258. },
  259. {
  260. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 1), //日期/月份
  261. TradeAmt: '261' //交易额
  262. },
  263. {
  264. Time: new Date().getFullYear() + ' ' + (new Date().getMonth()), //日期/月份
  265. TradeAmt: 275.00 //交易额
  266. },
  267. {
  268. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() + 1), //日期/月份
  269. TradeAmt: '268' //交易额
  270. }
  271. ];
  272. res.data.AddActMerchant = [
  273. {
  274. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 5), //日期/月份
  275. TradeAmt: 1587.00 //交易额
  276. },
  277. {
  278. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 4), //日期/月份
  279. TradeAmt: 2541.00 //交易额
  280. },
  281. {
  282. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 3), //日期/月份
  283. TradeAmt: 3521.00 //交易额
  284. },
  285. {
  286. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 2), //日期/月份
  287. TradeAmt: 3985.00 //交易额
  288. },
  289. {
  290. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() - 1), //日期/月份
  291. TradeAmt: '4852' //交易额
  292. },
  293. {
  294. Time: new Date().getFullYear() + ' ' + (new Date().getMonth()), //日期/月份
  295. TradeAmt: 5215.00 //交易额
  296. },
  297. {
  298. Time: new Date().getFullYear() + ' ' + (new Date().getMonth() + 1), //日期/月份
  299. TradeAmt: '6202' //交易额
  300. }
  301. ];
  302. };
  303. //- 需要删除模拟数据
  304. this.echart1Data.date = res.data.MainTrade.map(item=>item.Time);
  305. this.echart1Data.data = res.data.MainTrade.map(item=>item.TradeAmt);
  306. this.echart1();
  307. this.echart2Data.date = res.data.AddMaker.map(item=>item.Time);
  308. this.echart2Data.data = res.data.AddMaker.map(item=>item.TradeAmt);
  309. this.echart2();
  310. this.echart3Data.date = res.data.AddActMerchant.map(item=>item.Time);
  311. this.echart3Data.data = res.data.AddActMerchant.map(item=>item.TradeAmt);
  312. this.echart3();
  313. },
  314. }
  315. });
  316. </script>
  317. </body>
  318. </html>