personal-achievement1.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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 ovh">
  18. <div class="iphonetitle"> </div>
  19. <div class="merchant_achievement" id="app" v-cloak>
  20. <van-nav-bar class="camp_title user_title_normal titlef16 left_icon_cfff" left-arrow title="个人业绩" v-if="toptitleisshow" @click-left="goback">
  21. <template #left>
  22. <van-icon name="arrow-left" color="#333"> </van-icon>
  23. </template>
  24. </van-nav-bar>
  25. <div class="merchant_achievement_topblock"></div>
  26. <van-tabs class="toptab" v-model="active" @click="changetab" title-active-color="#FF5A32" title-inactive-color="#333" line-width="32" line-height="2">
  27. <van-tab>
  28. <template #title>
  29. <div @click="choosetime"><span>{{nowdate}}</span>
  30. <van-icon name="arrow"></van-icon>
  31. </div>
  32. </template>
  33. <van-row class="main ovh rel">
  34. <van-col class="infobox infobox_personal strong_colorroll">
  35. <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
  36. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  37. <div class="panel bgcfff" v-for="obj,index in data" :key="index">
  38. <div class="toppanel df">
  39. <div class="block"></div>
  40. <div class="f14 c333 b">{{obj.TradeDate}}</div>
  41. </div>
  42. <div class="mainpanel">
  43. <div class="title df c333 f16 flexsb">
  44. <div>总交易额</div>
  45. <div>{{obj.TradeAmount}}元</div>
  46. </div>
  47. <div class="type_panel df flexsb">
  48. <div>
  49. <div class="type c999">服务总交易额(元)</div>
  50. <div class="money f12">{{obj.QrPayAmount}}</div>
  51. </div>
  52. <div class="line"></div>
  53. <div>
  54. <div class="type c999">流水总交易(元)</div>
  55. <div class="money f12">{{obj.CardAmount}}</div>
  56. </div>
  57. </div>
  58. <div class="df c666 f12 flexsb" v-for="item in obj.ProductList" :key="item.Id">
  59. <div class="type">{{item.Name}}</div>
  60. <div class="num_personal df cm"><span>{{item.Amount}}</span></div>
  61. </div>
  62. </div>
  63. </div>
  64. </van-list>
  65. </van-pull-refresh>
  66. </van-col>
  67. </van-row>
  68. </van-tab>
  69. <van-tab>
  70. <template #title><span>近半年</span></template>
  71. <van-row class="main ovh rel">
  72. <van-col class="infobox infobox_personal">
  73. <div class="panel bgcfff" v-for="obj in data">
  74. <div class="toppanel df">
  75. <div class="block"></div>
  76. <div class="f14 c333 b">{{obj.TradeMonth}}</div>
  77. </div>
  78. <div class="mainpanel">
  79. <div class="title df c333 f16 flexsb">
  80. <div>总交易额</div>
  81. <div>{{obj.TradeAmount}}元</div>
  82. </div>
  83. <div class="type_panel df flexsb">
  84. <div>
  85. <div class="type c999">服务总交易额(元)</div>
  86. <div class="money f12">{{obj.QrPayAmount}}</div>
  87. </div>
  88. <div class="line"></div>
  89. <div>
  90. <div class="type c999">流水总交易(元)</div>
  91. <div class="money f12">{{obj.CardAmount}}</div>
  92. </div>
  93. </div>
  94. <div class="df c666 f12 flexsb" v-for="item in obj.ProductList" :key="item.Id">
  95. <div class="type">{{item.Name}}</div>
  96. <div class="num_personal df cm"><span>{{item.Amount}}</span></div>
  97. </div>
  98. </div>
  99. </div>
  100. </van-col>
  101. </van-row>
  102. </van-tab>
  103. </van-tabs>
  104. <van-popup class="product_mymerchant_transaction" v-model="showDate" position="bottom" :style="{ height: '50%' }" v-cloak>
  105. <van-datetime-picker v-model="currentDate" type="year-month" title="选择年月" :min-date="minDate" :max-date="maxDate" @cancel="showDate = false" :formatter="formatter" @confirm="onConfirmDate"></van-datetime-picker>
  106. </van-popup>
  107. </div>
  108. <script src="./static/js/klm-vv.min.js"></script>
  109. <script src="./static/js/appfunc.min.js"></script>
  110. <script src="./static/js/klm-axios-config.js"></script>
  111. <script src="./static/js/publicfn.js"></script>
  112. <script>
  113. function OnStart(){
  114. PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  115. };
  116. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  117. // 可以通过下面的方式手动注册
  118. Vue.use(vant.Lazyload);
  119. //--- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  120. // 在 #app 标签下渲染一个按钮组件
  121. let app = new Vue({
  122. el: '#app',
  123. data() {
  124. return {
  125. toptitleisshow:true,
  126. active:1,
  127. activeKey: 0,
  128. loading: false,
  129. finished: false,
  130. refreshing: false,
  131. data:[
  132. ],
  133. showDate: false,
  134. minDate: new Date(2020, 0, 1),
  135. maxDate: new Date(),
  136. currentDate: new Date(),
  137. nowdate:'',
  138. pageinfo:{
  139. PageSize:10,
  140. PageNum:1
  141. },
  142. ismonth:true,
  143. };
  144. },
  145. created() {
  146. this.onConfirmDate();
  147. },
  148. watch:{
  149. },
  150. methods: {
  151. changetab(){
  152. if(this.active === 1){
  153. this.data = [];
  154. this.gethalfyearinfo();
  155. this.ismonth = false;
  156. };
  157. if(this.active === 0 && !this.ismonth) {
  158. this.data = [];
  159. this.getmonthinfo();
  160. this.ismonth = true;
  161. };
  162. },
  163. choosetime(){
  164. if(this.active !== 0) return;
  165. this.showDate = true;
  166. },
  167. onLoad() {
  168. if (this.refreshing) {
  169. this.data = [];
  170. this.refreshing = false;
  171. this.pageinfo.PageNum = 0;
  172. }
  173. this.pageinfo.PageNum++;
  174. this.getmonthinfo();
  175. },
  176. onRefresh() {
  177. // 清空列表数据
  178. this.finished = false;
  179. // 重新加载数据
  180. // 将 loading 设置为 true,表示处于加载状态
  181. this.loading = true;
  182. this.onLoad();
  183. },
  184. goback(){
  185. PublicLib.GoBack({Level:1});
  186. },
  187. formatter(type, val) {
  188. if (type === 'year') {
  189. return `${val}年`;
  190. } else if (type === 'month') {
  191. return `${val}月`;
  192. } else if (type === 'day') {
  193. return `${val}日`;
  194. };
  195. return val;
  196. },
  197. onConformateDate(){
  198. return formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
  199. },
  200. onParamsDate(date){
  201. return formatDate(new Date(date).getFullYear(),new Date(date).getMonth() + 1);
  202. },
  203. onConfirmDate() {
  204. this.data = [];
  205. this.showDate = false;
  206. this.nowdate = this.currentDate.getFullYear() + '-' + fillzero((this.currentDate.getMonth() + 1));
  207. this.changetab();
  208. },
  209. async getmonthinfo(){
  210. PublicLib.ShowLoading({Message:''});
  211. const UserId = PublicLib.getCookieInfo('userId');
  212. const res = await getRequest('api/v1/usertradedaysummary/personalperformanceforday',JSON.stringify({...this.pageinfo,TradeMonth:this.onConformateDate(),UserId}));
  213. if(res.status !== '1')return tips('月个人业绩获取失败!');
  214. PublicLib.HideLoading();
  215. if(res.data.length < this.pageinfo.PageSize) {
  216. this.finished = true;
  217. };
  218. this.data.push(...res.data);
  219. this.loading = false;
  220. },
  221. async gethalfyearinfo(){
  222. PublicLib.ShowLoading({Message:''});
  223. const UserId = PublicLib.getCookieInfo('userId');
  224. const res = await getRequest('api/v1/usertradedaysummary/personalperformancehalfyear',JSON.stringify({...this.pageinfo,UserId}));
  225. if(res.status !== '1')return tips('半年个人业绩获取失败!');
  226. PublicLib.HideLoading();
  227. //- res.data[0].ProductList = [{Id:101,Name:'流水分润',Amount:20526541.10}];
  228. this.data = res.data;
  229. },
  230. gotransactiondetail(date,item){
  231. PublicLib.putCookieInfo('paramstime', this.onParamsDate(date));
  232. PublicLib.putCookieInfo('transactiontype', '个人业绩');
  233. PublicLib.putCookieInfo('topshowtimetime', date);
  234. PublicLib.putCookieInfo('merchantName', item.Name);
  235. PublicLib.putCookieInfo('merchantTypeId', item.Id);
  236. PublicLib.Goto({Url:'transaction-detail'});
  237. },
  238. }
  239. });
  240. </script>
  241. </body>
  242. </html>