merchant-personal-active.html 8.7 KB

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