maker-details-echarts.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  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. /* 首页*/
  18. .banner .van-skeleton__title{height:3rem;border-radius:10px;}
  19. .banner1 .van-skeleton__title{height:5rem;border-radius:15px;}
  20. .indexicon{margin-top:50px;}
  21. .indexicon .van-skeleton__content{display:flex; justify-content:space-between;}
  22. .indexicon .van-skeleton__content .van-skeleton__row{display:inline-block; width:1.2rem !important; height:1.2rem; margin-top:0 !important; border-radius:50%;}
  23. /* 商品详情*/
  24. .mall-skeleton-title .van-skeleton__title{height:9rem;border-radius:15px;}
  25. .mall-skeleton-text .van-skeleton__title{height:3rem;border-radius:15px;}
  26. .mall-skeleton .van-skeleton__title{height:10rem;border-radius:15px;}
  27. </style>
  28. </head>
  29. <body class="pt0" id="user_rank_explan">
  30. <div class="pt0" id="app" v-cloak>
  31. <van-skeleton title avatar :row="0" title-width="30%" round :loading="loading" style="padding:30px;"></van-skeleton>
  32. <van-skeleton title :row="0" title-width="100%" round :loading="loading" style="padding:10px 20px;"></van-skeleton>
  33. <van-skeleton title :row="0" title-width="100%" round :loading="loading" style="padding:10px 20px;"></van-skeleton>
  34. <van-skeleton class="banner1" title :row="0" title-width="100%" :loading="loading" style="margin-top:30px;"></van-skeleton>
  35. <van-skeleton class="banner1" title :row="0" title-width="100%" :loading="loading" style="margin-top:30px;"></van-skeleton>
  36. <van-skeleton class="banner1" title :row="0" title-width="100%" :loading="loading" style="margin-top:30px;"></van-skeleton>
  37. <van-sticky>
  38. <van-nav-bar class="user_rank_explan_title user_title_normal" title="创客详情" left-arrow @click-left="backbtn" v-if="toptitleisshow">
  39. <template #left> <img src="./static/images/left.png" alt=""></template>
  40. </van-nav-bar>
  41. </van-sticky>
  42. <div v-if="!loading">
  43. <div class="userpanel bordertop df borderbottom ovh">
  44. <div class="imgbox tc mr12" @click="speclick"><img class="headportrait" :src="createrinfo.HeadPhoto" alt=""><img class="grade_rank" :src="gradephoto[createrinfo.UserLevel-1]" alt=""></div>
  45. <div class="infobox">
  46. <div class="userinfo df spb">
  47. <div class="right">
  48. <div class="name f16"><span class="mr12">{{createrinfo.RealName}}</span><span>{{createrinfo.MakerCode}}</span></div>
  49. <div class="phonenumber f12 c999">{{createrinfo.phoneNum}}</div>
  50. </div>
  51. <div class="leftbtn">
  52. <button class="c333" @click="takephone(createrinfo.Mobile)">联系TA</button>
  53. </div>
  54. </div>
  55. <div class="time c999">实名时间 {{createrinfo.AuthDate}}</div>
  56. </div>
  57. </div>
  58. <van-tabs class="creater_main_panel creater_tab" v-model="active" sticky @change="checktab" swipeable :class="toptitleisshow ? '':'istitletab'" v-if="!loading">
  59. <van-tab disabled></van-tab>
  60. <van-tab title="近七天">
  61. <div v-if="active === 1">
  62. <div class="bordertop pl16 pr16 pt16">
  63. <div class="title df">
  64. <div class="left df">
  65. <div class="tips"></div>
  66. <div class="text c333 f14 b">交易分类占比</div>
  67. </div>
  68. <div class="f12 c333">总交易{{abs(echartsdata.TradeTotal)}}元</div>
  69. </div>
  70. <div class="card" ref="transactionclassification"></div>
  71. <div class="title df">
  72. <div class="left df">
  73. <div class="tips"></div>
  74. <div class="text c333 f14 b">交易趋势图</div>
  75. </div>
  76. </div>
  77. <div class="card" ref="secend"></div>
  78. </div>
  79. <div class="ovh ovhbox">
  80. <div class="btnbox" @touchmove.stop>
  81. <button v-for="item,index in ActMerchantTrenditem(echartsdata.TradeTrend)" :key="index" :class="ischeck === index ? 'productbtn':''" @click="checkbtn(index)">{{item}}</button>
  82. </div>
  83. </div>
  84. <div class="bordertop pl16 pr16 pt16">
  85. <div class="title df">
  86. <div class="left df">
  87. <div class="tips"></div>
  88. <div class="text c333 f14 b">新增激活商户分类占比</div>
  89. </div>
  90. <div class="f12 c333">总激活{{echartsdata.ActTotal}}户</div>
  91. </div>
  92. <div class="card" ref="addmerchantpie"></div>
  93. <div class="title df">
  94. <div class="left df">
  95. <div class="tips"></div>
  96. <div class="text c333 f14 b">新增激活商户趋势图</div>
  97. </div>
  98. </div>
  99. <div class="card" ref="addmerchantbar"></div>
  100. </div>
  101. <div class="ovh ovhbox">
  102. <div class="btnbox" @touchmove.stop>
  103. <button v-for="item,index in ActMerchantTrenditem(echartsdata.ActMerchantTrend)" :key="index" :class="ischeck2 === index ? 'productbtn':''" @click="checkbtn2(index)">{{item}}</button>
  104. </div>
  105. </div>
  106. <div class="bordertop pl16 pr16 pt16">
  107. <div class="title df">
  108. <div class="left df">
  109. <div class="tips"></div>
  110. <div class="text c333 f14 b">创客新增趋势图</div>
  111. </div>
  112. </div>
  113. <div class="card" ref="addmakerbar"></div>
  114. </div>
  115. </div>
  116. </van-tab>
  117. <van-tab title="近半年">
  118. <div v-if="active === 2">
  119. <div class="bordertop pl16 pr16 pt16">
  120. <div class="title df">
  121. <div class="left df">
  122. <div class="tips"></div>
  123. <div class="text c333 f14 b">交易分类占比</div>
  124. </div>
  125. <div class="f12 c333">总交易{{abs(echartsdata.TradeTotal)}}元</div>
  126. </div>
  127. <div class="card" ref="transactionclassification"></div>
  128. <div class="title df">
  129. <div class="left df">
  130. <div class="tips"></div>
  131. <div class="text c333 f14 b">交易趋势图</div>
  132. </div>
  133. </div>
  134. <div class="card" ref="secend"></div>
  135. </div>
  136. <div class="ovh ovhbox">
  137. <div class="btnbox" @touchmove.stop>
  138. <button v-for="item,index in ActMerchantTrenditem(echartsdata.TradeTrend)" :key="index" :class="ischeck === index ? 'productbtn':''" @click="checkbtn(index)">{{item}}</button>
  139. </div>
  140. </div>
  141. <div class="bordertop pl16 pr16 pt16">
  142. <div class="title df">
  143. <div class="left df">
  144. <div class="tips"></div>
  145. <div class="text c333 f14 b">新增激活商户分类占比</div>
  146. </div>
  147. <div class="f12 c333">总激活{{echartsdata.ActTotal}}户</div>
  148. </div>
  149. <div class="card" ref="addmerchantpie"></div>
  150. <div class="title df">
  151. <div class="left df">
  152. <div class="tips"></div>
  153. <div class="text c333 f14 b">新增激活商户趋势图</div>
  154. </div>
  155. </div>
  156. <div class="card" ref="addmerchantbar"></div>
  157. </div>
  158. <div class="ovh ovhbox">
  159. <div class="btnbox" @touchmove.stop>
  160. <button v-for="item,index in ActMerchantTrenditem(echartsdata.ActMerchantTrend)" :key="index" :class="ischeck2 === index ? 'productbtn':''" @click="checkbtn2(index)">{{item}}</button>
  161. </div>
  162. </div>
  163. <div class="bordertop pl16 pr16 pt16">
  164. <div class="title df">
  165. <div class="left df">
  166. <div class="tips"></div>
  167. <div class="text c333 f14 b">创客新增趋势图</div>
  168. </div>
  169. </div>
  170. <div class="card" ref="addmakerbar"></div>
  171. </div>
  172. </div>
  173. </van-tab>
  174. <van-tab disabled></van-tab>
  175. </van-tabs>
  176. </div>
  177. </div>
  178. <script src="./static/js/echarts.min.js"></script>
  179. <script src="./static/js/klm-vv.min.js"></script>
  180. <script src="./static/js/appfunc.min.js"></script>
  181. <script src="./static/js/klm-axios-config.js"></script>
  182. <script src="./static/js/publicfn.js"></script>
  183. <script src="./static/js/performanceechart.js"></script>
  184. <script>
  185. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  186. // 在 #app 标签下渲染一个按钮组件
  187. let app = new Vue({
  188. el: '#app',
  189. data() {
  190. return {
  191. loading:true,
  192. isLoading:false,
  193. toptitleisshow,
  194. active:1,
  195. createrinfo:[],
  196. gradephoto:[
  197. './static/images/grade-k1.png',
  198. './static/images/grade-k2.png',
  199. './static/images/grade-k3.png',
  200. './static/images/grade-k4.png',
  201. './static/images/grade-k5.png',
  202. './static/images/grade-k6.png',
  203. './static/images/grade-k7.png',
  204. './static/images/grade-k8.png',
  205. './static/images/grade-k9.png',
  206. ],
  207. ischeck:0,
  208. ischeck2:0,
  209. echartsdata:{
  210. //- TradePercent: [
  211. //- {
  212. //- Name: '', //产品名称
  213. //- TradeAmt: 0, //交易额
  214. //- },
  215. //- ],
  216. //- TradeTrend: [
  217. //- {
  218. //- Name: 'awdaw', //产品名称
  219. //- Times: [
  220. //- {
  221. //- TimeString: '11204', //交易日期/月份
  222. //- TradeAmt: 500.00 //交易额
  223. //- },
  224. //- {
  225. //- TimeString: '11204', //交易日期/月份
  226. //- TradeAmt: 50.00 //交易额
  227. //- },
  228. //- {
  229. //- TimeString: '11204', //交易日期/月份
  230. //- TradeAmt: 50.00 //交易额
  231. //- },
  232. //- {
  233. //- TimeString: '11204', //交易日期/月份
  234. //- TradeAmt: 50.00 //交易额
  235. //- },
  236. //- {
  237. //- TimeString: '11204', //交易日期/月份
  238. //- TradeAmt: 500.00 //交易额
  239. //- },
  240. //- {
  241. //- TimeString: '11204', //交易日期/月份
  242. //- TradeAmt: 50.00 //交易额
  243. //- },
  244. //- ]
  245. //- },
  246. //- {
  247. //- Name: '111', //产品名称
  248. //- Times: [
  249. //- {
  250. //- TimeString: '444', //交易日期/月份
  251. //- TradeAmt: 5100.00 //交易额
  252. //- },
  253. //- {
  254. //- TimeString: '444', //交易日期/月份
  255. //- TradeAmt: 50450.00 //交易额
  256. //- },
  257. //- {
  258. //- TimeString: '444', //交易日期/月份
  259. //- TradeAmt: 5005.00 //交易额
  260. //- },
  261. //- {
  262. //- TimeString: '444', //交易日期/月份
  263. //- TradeAmt: 50630.00 //交易额
  264. //- },
  265. //- ]
  266. //- },
  267. //- {
  268. //- Name: '23232', //产品名称
  269. //- Times: [
  270. //- {
  271. //- TimeString: '333', //交易日期/月份
  272. //- TradeAmt: 500.00 //交易额
  273. //- },
  274. //- {
  275. //- TimeString: '333', //交易日期/月份
  276. //- TradeAmt: 0.00 //交易额
  277. //- },
  278. //- {
  279. //- TimeString: '333', //交易日期/月份
  280. //- TradeAmt: 0.00 //交易额
  281. //- },
  282. //- ]
  283. //- },
  284. //- ],
  285. //- ActMerchantPercent: [
  286. //- {
  287. //- Name: '4', //产品名称
  288. //- ActCount: 50 //激活数
  289. //- },
  290. //- {
  291. //- Name: '5', //产品名称
  292. //- ActCount: 150 //激活数
  293. //- },
  294. //- {
  295. //- Name: '6', //产品名称
  296. //- ActCount: 500 //激活数
  297. //- }
  298. //- ],
  299. //- ActMerchantTrend: [
  300. //- {
  301. //- Name: '123', //产品名称
  302. //- Times: [
  303. //- {
  304. //- TimeString: '1133324', //统计日期/月份
  305. //- ActCount: 50 //激活数
  306. //- },
  307. //- {
  308. //- TimeString: '1124', //统计日期/月份
  309. //- ActCount: 502 //激活数
  310. //- },
  311. //- {
  312. //- TimeString: '1124', //统计日期/月份
  313. //- ActCount: 50 //激活数
  314. //- },
  315. //- {
  316. //- TimeString: '1124', //统计日期/月份
  317. //- ActCount: 502 //激活数
  318. //- },
  319. //- {
  320. //- TimeString: '1124', //统计日期/月份
  321. //- ActCount: 50 //激活数
  322. //- },
  323. //- ]
  324. //- },
  325. //- {
  326. //- Name: '456', //产品名称
  327. //- Times: [
  328. //- {
  329. //- TimeString: '0000', //统计日期/月份
  330. //- ActCount: 150 //激活数
  331. //- },
  332. //- {
  333. //- TimeString: '000', //统计日期/月份
  334. //- ActCount: 5014 //激活数
  335. //- },
  336. //- {
  337. //- TimeString: '0000', //统计日期/月份
  338. //- ActCount: 50 //激活数
  339. //- },
  340. //- ]
  341. //- },
  342. //- {
  343. //- Name: '56415', //产品名称
  344. //- Times: [
  345. //- {
  346. //- TimeString: '0000', //统计日期/月份
  347. //- ActCount: 150 //激活数
  348. //- },
  349. //- {
  350. //- TimeString: '000', //统计日期/月份
  351. //- ActCount: 4 //激活数
  352. //- },
  353. //- {
  354. //- TimeString: '0000', //统计日期/月份
  355. //- ActCount: 50 //激活数
  356. //- },
  357. //- ]
  358. //- }
  359. //- ],
  360. //- MakerAdd: [
  361. //- {
  362. //- TimeString: '11024', //统计日期/月份
  363. //- AddCount: 50 //新增数
  364. //- },
  365. //- {
  366. //- TimeString: '1124', //统计日期/月份
  367. //- AddCount: 50 //新增数
  368. //- },
  369. //- {
  370. //- TimeString: '1124', //统计日期/月份
  371. //- AddCount: 50 //新增数
  372. //- },
  373. //- {
  374. //- TimeString: '1124', //统计日期/月份
  375. //- AddCount: 50 //新增数
  376. //- },
  377. //- {
  378. //- TimeString: '1124', //统计日期/月份
  379. //- AddCount: 50 //新增数
  380. //- },
  381. //- {
  382. //- TimeString: '1124', //统计日期/月份
  383. //- AddCount: 50 //新增数
  384. //- },
  385. //- ]
  386. },
  387. sevenday:{},
  388. fullyear:{},
  389. };
  390. },
  391. created(){
  392. this.toptitleisshow;
  393. this.getcreaterinfo();
  394. this.getcreaterdetail();
  395. this.getcreaterdetailfullytear();
  396. },
  397. beforeUpdate() {
  398. this.$nextTick(()=>{
  399. this.secendchart(this.ischeck);
  400. this.addmerchantbarchart(this.ischeck2);
  401. this.TradePercenttovalue(this.echartsdata.TradePercent);
  402. this.ActMerchantPercenttovalue(this.echartsdata.ActMerchantPercent);
  403. this.firstchart();
  404. })
  405. },
  406. methods: {
  407. speclick(){
  408. if(!isWeb){return};
  409. const id = PublicLib.getCookieInfo('querycreaterid');
  410. PublicLib.putCookieInfo('userId',id);
  411. PublicLib.Goto({Url:'index'});
  412. },
  413. onRefresh(){
  414. this.getcreaterinfo();
  415. this.getcreaterdetail();
  416. this.getcreaterdetailfullytear();
  417. this.isLoading = false;
  418. },
  419. checkbtn(index){
  420. this.ischeck = index;
  421. },
  422. checkbtn2(index){
  423. this.ischeck2 = index;
  424. },
  425. //- 分类交易占比(固定图表)
  426. firstchart(){
  427. pieechart(this.$refs.transactionclassification,this.echartsdata.TradePercent);
  428. pieechart(this.$refs.addmerchantpie,this.echartsdata.ActMerchantPercent);
  429. barechart(this.$refs.addmakerbar,this.MakerAddtovalue(this.echartsdata.MakerAdd)[0],this.MakerAddtovalue(this.echartsdata.MakerAdd)[1]);
  430. },
  431. //- 交易趋势图(随品牌切换)
  432. secendchart(index){
  433. barechart(this.$refs.secend,this.TradeTrendechart(this.echartsdata.TradeTrend,index)[0],this.TradeTrendechart(this.echartsdata.TradeTrend,index)[1])
  434. },
  435. //- 新增激活商户趋势图(随品牌切换)
  436. addmerchantbarchart(index){
  437. barechart(this.$refs.addmerchantbar,this.ActMerchantTrendechart(this.echartsdata.ActMerchantTrend,index)[0],this.ActMerchantTrendechart(this.echartsdata.ActMerchantTrend,index)[1]);
  438. },
  439. //- 数值转换为echarts所需数据
  440. TradePercenttovalue(arr){
  441. arr.forEach(item=>{item.value = item.TradeAmt;item.name = item.Name});
  442. },
  443. //- 数值转换为echarts所需数据
  444. ActMerchantPercenttovalue(arr){
  445. arr.forEach(item=>{item.value = item.ActCount;item.name = item.Name});
  446. },
  447. //- 新增创客趋势图
  448. MakerAddtovalue(arr){
  449. const newarr = [];
  450. const item1 = [];
  451. const item2 = [];
  452. arr.forEach(item=>{
  453. item1.push(item.TimeString)
  454. item2.push(item.AddCount)
  455. });
  456. newarr.push(item1,item2);
  457. return newarr;
  458. },
  459. //- 新增激活商户趋势图
  460. ActMerchantTrendechart(arr,index){
  461. const newarr = [];
  462. const item1 = [];
  463. const item2 = [];
  464. arr[index].Times.forEach(item=>{
  465. item1.push(item.TimeString);
  466. item2.push(item.ActCount);
  467. });
  468. newarr.push(item1,item2);
  469. return newarr;
  470. },
  471. //- 交易趋势图
  472. TradeTrendechart(arr,index){
  473. const newarr = [];
  474. const item1 = [];
  475. const item2 = [];
  476. arr[index].Times.forEach(item=>{
  477. item1.push(item.TimeString);
  478. item2.push(item.TradeAmt);
  479. });
  480. newarr.push(item1,item2);
  481. return newarr;
  482. },
  483. ActMerchantTrenditem(arr){
  484. const result = [];
  485. arr.forEach(item=>{
  486. result.push(item.Name);
  487. });
  488. return result;
  489. },
  490. backbtn(){
  491. PublicLib.GoBack({Level:1});
  492. },
  493. async getcreaterdetail(){
  494. const UserId= PublicLib.getCookieInfo('querycreaterid');
  495. const res = await getRequest('api/v1/users/mymakerdetail?t='+Math.random(6),JSON.stringify({Id:'',UserId,DateKind:1}));
  496. if(res.status !== '1') return tips('获取图表信息失败,请重试!');
  497. if(this.active === 1){
  498. res.data.MakerAdd.forEach(item=>{
  499. item.TimeString = item.TimeString.substr(4,6)
  500. });
  501. };
  502. this.sevenday = res.data
  503. if(this.active === 1) {
  504. this.echartsdata = this.sevenday
  505. };
  506. this.loading = false;
  507. },
  508. async getcreaterdetailfullytear(){
  509. const UserId= PublicLib.getCookieInfo('querycreaterid');
  510. const res = await getRequest('api/v1/users/mymakerdetail?t='+Math.random(6),JSON.stringify({Id:'',UserId,DateKind:2}));
  511. if(res.status !== '1') return tips('获取图表信息失败,请重试!');
  512. if(this.active === 1){
  513. res.data.MakerAdd.forEach(item=>{
  514. item.TimeString = item.TimeString.substr(4,6)
  515. });
  516. };
  517. this.fullyear = res.data
  518. if(this.active === 2) {
  519. this.echartsdata = this.fullyear
  520. };
  521. },
  522. async getcreaterinfo(){
  523. const Id = PublicLib.getCookieInfo('querycreaterid');
  524. const res = await getRequest('api/v1/users/personalinfo?t='+Math.random(6),JSON.stringify({Id}));
  525. if(res.status !== '1') return tips('获取创客信息失败,请重试!');
  526. res.data.phoneNum = hidemiddlenum(res.data.Mobile,3,4);
  527. this.createrinfo = res.data;
  528. },
  529. takephone(phonenum){
  530. PublicLib.PhoneCall(phonenum);
  531. },
  532. checktab(){
  533. this.ischeck = 0;
  534. this.ischeck2 = 0;
  535. if(this.active === 1) {
  536. this.echartsdata = this.sevenday
  537. }else{
  538. this.echartsdata = this.fullyear
  539. };
  540. },
  541. }
  542. });
  543. </script>
  544. </body>
  545. </html>