product-myperformance.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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 class="bgc-back pb0">
  18. <div id="app" v-cloak>
  19. <van-nav-bar class="camp_title user_title_normal f16" title="我的业绩" @click-left="goback" v-if="toptitleisshow" left-arrow v-cloak>
  20. <template #left>
  21. <van-icon name="arrow-left" color="#fff" size="20"></van-icon>
  22. </template>
  23. </van-nav-bar>
  24. <div class="performance_toppanel ovh">
  25. <div class="title df cfff mt8">
  26. <div class="time"><span>{{nowdate}}</span>
  27. <van-icon name="arrow"> </van-icon>
  28. </div>
  29. <div class="tips f12">本月业绩每日上午统一更新(不含当日)</div>
  30. </div>
  31. </div>
  32. <div class="performance_panel bgcfff">
  33. <div class="title df">
  34. <div class="f14 c333 b">个人业绩</div>
  35. <div class="pic" @click="trendpic('个人业绩')"><span class="f12">趋势图</span>
  36. <van-icon class="f12" name="arrow"> </van-icon>
  37. </div>
  38. </div>
  39. <div class="maininfo">
  40. <div class="amount df" @click="gopersonalachievement">
  41. <div class="echarts" ref="echartpersonal"></div>
  42. <div class="data">
  43. <div class="f14 c999">总交易额(元)
  44. <van-icon name="arrow"> </van-icon>
  45. </div>
  46. <div class="money"> {{personelinfo.TradeAmount}}</div>
  47. </div>
  48. </div>
  49. <div class="detailinfo df">
  50. <div class="bycard">
  51. <div class="f12 c999"> <span class="roll dib"></span><span>大额交易(元)</span></div>
  52. <div class="f14 c666 money">{{personelinfo.CardAmount}}</div>
  53. </div>
  54. <div class="bycloud">
  55. <div class="f12 c999"> <span class="roll dib"></span><span>小额交易(元)</span></div>
  56. <div class="f14 c666 money">{{personelinfo.QrPayAmount}}</div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="user df rel" @click="mymerchant">
  61. <div class="bycard">
  62. <div class="f12 c999"> <span class="mr12">累计总创客(人)</span></div>
  63. <div class="f14 c666 all">{{personelinfo.MakerCount}}</div>
  64. </div>
  65. <div class="bycloud ml60">
  66. <div class="f12 c999"> <span>新增创客(人)</span></div>
  67. <div class="c666 add">+ {{personelinfo.AddMakerCount}}</div>
  68. <div class="abs righticon">
  69. <van-icon name="arrow"> </van-icon>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="user df rel" @click="gopersonalactive">
  74. <div class="bycard">
  75. <div class="f12 c999"> <span>累计活动商户(户)</span></div>
  76. <div class="f14 c666 all">{{personelinfo.ActMerchantCount}}</div>
  77. </div>
  78. <div class="bycloud ml60">
  79. <div class="f12 c999"> <span>新增活动商户(户)</span></div>
  80. <div class="c666 add">+ {{personelinfo.AddActMerchantCount}}</div>
  81. <div class="abs righticon">
  82. <van-icon name="arrow"> </van-icon>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="performance_panel bgcfff teampanel">
  88. <div class="title df">
  89. <div class="f14 c333 b">创客业绩</div>
  90. <div class="pic" @click="trendpic('团队业绩')"> <span class="f12">趋势图</span>
  91. <van-icon class="f12" name="arrow"> </van-icon>
  92. </div>
  93. </div>
  94. <div class="maininfo">
  95. <div class="amount df" @click="goteamachievement">
  96. <div class="echarts" ref="echartpersonal2team"></div>
  97. <div class="data">
  98. <div class="f14 c999">总交易额(元)
  99. <van-icon name="arrow"> </van-icon>
  100. </div>
  101. <div class="money">{{teaminfo.TradeAmount}}</div>
  102. </div>
  103. </div>
  104. <div class="detailinfo df">
  105. <div class="bycard">
  106. <div class="f12 c999"> <span class="roll dib"></span><span>大额交易(元)</span></div>
  107. <div class="f14 c666 money">{{teaminfo.CardAmount}}</div>
  108. </div>
  109. <div class="bycloud">
  110. <div class="f12 c999"> <span class="roll dib"></span><span>小额交易(元)</span></div>
  111. <div class="f14 c666 money">{{teaminfo.QrPayAmount}}</div>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="user df rel">
  116. <div class="bycard">
  117. <div class="f12 c999"> <span class="mr12">累计总创客(人)</span></div>
  118. <div class="f14 c666 all">{{teaminfo.MakerCount}}</div>
  119. </div>
  120. <div class="bycloud ml60">
  121. <div class="f12 c999"> <span>新增创客(人)</span></div>
  122. <div class="c666 add">+ {{teaminfo.AddMakerCount}}</div>
  123. </div>
  124. </div>
  125. <div class="user df rel" @click="goteamactive">
  126. <div class="bycard">
  127. <div class="f12 c999"> <span>累计活动商户(户)</span></div>
  128. <div class="f14 c666 all">{{teaminfo.ActMerchantCount}}</div>
  129. </div>
  130. <div class="bycloud ml60">
  131. <div class="f12 c999"> <span>新增活动商户(户)</span></div>
  132. <div class="c666 add">+ {{teaminfo.AddActMerchantCount}}</div>
  133. <div class="abs righticon">
  134. <van-icon name="arrow"> </van-icon>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <van-popup class="product_mymerchant_transaction" v-model="showDate" position="bottom" :style="{ height: '50%' }" v-cloak>
  140. <van-datetime-picker v-model="currentDate" type="year-month" :min-date="minDate" :max-date="maxDate" :formatter="formatter" @cancel="showDate = false" @confirm="onConfirmDate"></van-datetime-picker>
  141. </van-popup>
  142. </div>
  143. <script src="./static/js/klm-vv.min.js"></script>
  144. <script src="./static/js/echarts.min.js"></script>
  145. <script src="./static/js/klm-axios-config.js"></script>
  146. <script>
  147. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  148. // 可以通过下面的方式手动注册
  149. Vue.use(vant.Lazyload);
  150. // 在 #app 标签下渲染一个按钮组件
  151. let app = new Vue({
  152. el: '#app',
  153. data() {
  154. return {
  155. toptitleisshow:true,
  156. ecgart1: [
  157. { value: 0, name: '暂时没有数据' },
  158. ],
  159. personelinfo:{
  160. },
  161. teaminfo:{
  162. },
  163. ecgart2team: [
  164. //- 默认空数据
  165. { value: 0, name: '暂时没有数据' },
  166. ],
  167. showDate: false,
  168. currentDate: new Date(),
  169. minDate: new Date(new Date().getFullYear(),(new Date().getMonth() - 5)),
  170. maxDate: new Date(),
  171. nowdate: '',
  172. };
  173. },
  174. created(){
  175. this.onConfirmDate();
  176. },
  177. methods: {
  178. formatter(type, val) {
  179. if (type === 'year') {
  180. return `${val}年`;
  181. } else if (type === 'month') {
  182. return `${val}月`;
  183. } else if (type === 'day') {
  184. return `${val}日`;
  185. }
  186. return val;
  187. },
  188. onConfirmDate() {
  189. this.showDate = false;
  190. this.nowdate = this.currentDate.getFullYear() + '-' + (this.currentDate.getMonth() + 1);
  191. this.getperformanceinfo();
  192. this.getteaminfo();
  193. },
  194. onConformateDate(){
  195. return fillzero(formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1))
  196. },
  197. echartpersonal(){
  198. var myChart = echarts.init(this.$refs.echartpersonal);
  199. const option = {
  200. tooltip: {
  201. show:false,
  202. trigger: 'item'
  203. },
  204. legend: {
  205. show:false,
  206. top: 'center',
  207. left: 'center'
  208. },
  209. color:['#EDE9E9','#FF574D','#FFD320'],
  210. series: [
  211. {
  212. type: 'pie',
  213. radius: ['60%', '100%'],
  214. avoidLabelOverlap: false,
  215. label: {
  216. show: false,
  217. position: 'center'
  218. },
  219. emphasis: {
  220. label: {
  221. show: false,
  222. }
  223. },
  224. labelLine: {
  225. show: false
  226. },
  227. data:this.ecgart1
  228. }
  229. ]
  230. };
  231. myChart.setOption(option);
  232. },
  233. echartpersonal2team(){
  234. var myChart = echarts.init(this.$refs.echartpersonal2team);
  235. const option = {
  236. tooltip: {
  237. show:false,
  238. trigger: 'item'
  239. },
  240. legend: {
  241. show:false,
  242. top: 'center',
  243. left: 'center'
  244. },
  245. color:['#EDE9E9','#FF574D','#FFD320'],
  246. series: [
  247. {
  248. type: 'pie',
  249. radius: ['60%', '100%'],
  250. avoidLabelOverlap: false,
  251. label: {
  252. show: false,
  253. position: 'center'
  254. },
  255. emphasis: {
  256. label: {
  257. show: false,
  258. }
  259. },
  260. labelLine: {
  261. show: false
  262. },
  263. data:this.ecgart2team
  264. }
  265. ]
  266. };
  267. myChart.setOption(option);
  268. },
  269. async getperformanceinfo(){
  270. PublicLib.ShowLoading({Message:''});
  271. const UserId = PublicLib.getCookieInfo('userId');
  272. const res = await getRequest('/api/v1/usertradedaysummary/personalperformance',JSON.stringify({TradeMonth:this.onConformateDate(),UserId}));
  273. if(res.status !== '1')return tips('个人业绩获取失败!');
  274. PublicLib.HideLoading();
  275. this.personelinfo = res.data;
  276. if(this.nowdate === new Date().getFullYear()+'-'+ (new Date().getMonth()+1)) {
  277. this.personelinfo = {
  278. ActMerchantCount: 24,
  279. AddActMerchantCount: 3,
  280. AddMakerCount: 5,
  281. CardAmount: 45421.02,
  282. MakerCount: 35,
  283. QrPayAmount: 15421.52,
  284. TradeAmount:(15421.52 + 45421.02).toFixed(2),
  285. };
  286. };
  287. //- if(this.nowdate = this.)
  288. if(this.personelinfo.TradeAmount == 0) {
  289. return this.echartpersonal();
  290. };
  291. this.ecgart1 = [
  292. {value:0,name:'空'},
  293. {value:this.personelinfo.CardAmount,name:'大额'},
  294. {value:this.personelinfo.QrPayAmount,name:'小额'}
  295. ];
  296. this.echartpersonal();
  297. },
  298. async getteaminfo(){
  299. const UserId = PublicLib.getCookieInfo('userId');
  300. const res = await getRequest('/api/v1/usertradedaysummary/teamperformance',JSON.stringify({TradeMonth:this.onConformateDate(),UserId}));
  301. if(res.status !== '1')return tips('团队业绩获取失败!');
  302. this.teaminfo = res.data;
  303. this.teaminfo = res.data;
  304. console.log(this.currentDate == new Date())
  305. if(this.nowdate === new Date().getFullYear()+'-'+ (new Date().getMonth()+1)) {
  306. this.teaminfo = {
  307. ActMerchantCount: 85,
  308. AddActMerchantCount: 13,
  309. AddMakerCount: 12,
  310. CardAmount: 945421.02,
  311. MakerCount: 95,
  312. QrPayAmount: 515421.38,
  313. TradeAmount:(515421.38 + 945421.02).toFixed(2),
  314. };
  315. };
  316. //- if(this.nowdate = this.)
  317. if(this.teaminfo.TradeAmount == 0) {
  318. return this.echartpersonal2team();
  319. };
  320. this.ecgart2team = [
  321. {value:0,name:'空'},
  322. {value:this.teaminfo.CardAmount,name:'大额'},
  323. {value:this.teaminfo.QrPayAmount,name:'小额'}
  324. ];
  325. this.echartpersonal2team();
  326. },
  327. trendpic(val){
  328. PublicLib.putCookieInfo('trendtype', val);
  329. PublicLib.Goto({Url:'product-trendchart'});
  330. },
  331. gopersonalactive(){
  332. PublicLib.Goto({Url:'merchant-personal-active'});
  333. },
  334. mymerchant(){
  335. PublicLib.Goto({Url:'creater-list'});
  336. },
  337. goback(){
  338. PublicLib.GoBack({Level:1});
  339. },
  340. gopersonalachievement(){
  341. PublicLib.Goto({Url:'personal-achievement'});
  342. },
  343. goteamachievement(){
  344. PublicLib.Goto({Url:'team-achievement'});
  345. },
  346. goteamactive(){
  347. PublicLib.Goto({Url:'merchant-active'});
  348. }
  349. }
  350. });
  351. </script>
  352. </body>
  353. </html>