team-achievement2.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. .infobox::-webkit-scrollbar {
  18. display: none;
  19. }
  20. .infobox{
  21. height:calc(100vh - 4.3333rem) !important;
  22. }
  23. .main .strong_colorroll .van-pull-refresh{
  24. height:calc(100vh - 4.3333rem) !important;
  25. }
  26. .main .peoname{
  27. height:calc(100vh - 4.3333rem) !important;
  28. }
  29. </style>
  30. </head>
  31. <body class="bgc-back pb0 h100p ovh">
  32. <div class="iphonetitle"> </div>
  33. <div class="merchant_achievement" id="app" v-cloak>
  34. <van-nav-bar class="camp_title user_title_normal titlef16 left_icon_cfff" left-arrow title="计奖交易" v-if="toptitleisshow" @click-left="goback">
  35. <template #left>
  36. <van-icon name="arrow-left" color="#333"> </van-icon>
  37. </template>
  38. </van-nav-bar>
  39. <div class="merchant_achievement_topblock"></div>
  40. <van-tabs class="toptab" v-model="active" swipeable animated @change="changetab" title-active-color="#FF5A32" title-inactive-color="#333" line-width="32" line-height="2">
  41. <van-tab>
  42. <template #title>
  43. <div @click="choosetime"><span>{{nowdate}}</span>
  44. <van-icon name="arrow"></van-icon>
  45. </div>
  46. </template>
  47. <van-row class="main rel" v-if="active === 0">
  48. <van-col class="bgcfff peoname abs">
  49. <van-sidebar v-model="activeKey" @change="onChange">
  50. <div class="merchant_active">
  51. <van-pull-refresh v-model="refreshing2" @refresh="onRefresh2" style="min-height: 50vh;">
  52. <van-list v-model="loading2" :finished="finished2" finished-text="" @load="onLoad2" :immediate-check="false">
  53. <van-sidebar-item v-for="item in nameList" :title="item.RealName"></van-sidebar-item>
  54. </van-list>
  55. </van-pull-refresh>
  56. </div>
  57. </van-sidebar>
  58. </van-col>
  59. <van-col class="infobox">
  60. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height: 100%;">
  61. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  62. <div class="panel bgcfff" v-for="obj,index in data" :key="index">
  63. <div class="toppanel df">
  64. <div class="block"></div>
  65. <div class="f14 c333 b">{{obj.TradeDate}}</div>
  66. </div>
  67. <div class="mainpanel">
  68. <div class="title df c333 f16 flexsb">
  69. <div>总交易额(元)</div>
  70. <div>{{obj.TradeAmount | tofixed2}}</div>
  71. </div>
  72. <div class="type_panel df flexsb">
  73. <div style="flex:1">
  74. <div class="type c999">POS机刷卡交易额</div>
  75. <div class="money f12">{{obj.TotalPosAmount | tofixed2}}</div>
  76. </div>
  77. <div style="flex:.2">
  78. <div class="line"></div>
  79. </div>
  80. <div style="flex:1">
  81. <div class="type c999">云闪付小额交易额</div>
  82. <div class="money f12">{{obj.TotalCloudPayAmount | tofixed2}}</div>
  83. </div>
  84. </div>
  85. <div class="type_panel df flexsb">
  86. <div style="flex:1">
  87. <div class="type c999">码牌活动交易</div>
  88. <div class="money f12">{{obj.TotalActiveAmount | tofixed2}}</div>
  89. </div>
  90. <div style="flex:.2">
  91. <div class="line"></div>
  92. </div>
  93. <div style="flex:1">
  94. <div class="type c999">码牌非活动交易</div>
  95. <div class="money f12">{{obj.TotalUnActiveAmount | tofixed2}}</div>
  96. </div>
  97. </div>
  98. <div class="df c666 f12 flexsb" v-for="item in obj.ProductList">
  99. <div class="type">{{item.Name}}</div>
  100. <div class="num_personal df cm"><span>{{item.Amount}}元</span></div>
  101. </div>
  102. </div>
  103. </div>
  104. </van-list>
  105. </van-pull-refresh>
  106. </van-col>
  107. </van-row>
  108. </van-tab>
  109. <van-tab>
  110. <template #title><span>近半年</span></template>
  111. <van-row class="main ovh rel" v-if="active === 1">
  112. <van-col class="bgcfff peoname abs">
  113. <van-sidebar v-model="activeKey" @change="onChange">
  114. <div class="merchant_active">
  115. <van-pull-refresh v-model="refreshing2" @refresh="onRefresh2" style="min-height: 50vh;">
  116. <van-list v-model="loading2" :finished="finished2" finished-text="" @load="onLoad2">
  117. <van-sidebar-item v-for="item in nameList" :title="item.RealName"></van-sidebar-item>
  118. </van-list>
  119. </van-pull-refresh>
  120. </div>
  121. </van-sidebar>
  122. </van-col>
  123. <van-col class="infobox marginleft">
  124. <div class="panel bgcfff" v-for="obj,index in data" :key="index">
  125. <div class="toppanel df">
  126. <div class="block"></div>
  127. <div class="f14 c333 b">{{obj.TradeMonth}}</div>
  128. </div>
  129. <div class="mainpanel">
  130. <div class="title df c333 f16 flexsb">
  131. <div>总交易额(元)</div>
  132. <div>{{obj.TradeAmount | tofixed2}}</div>
  133. </div>
  134. <div class="type_panel df flexsb">
  135. <div style="flex:1">
  136. <div class="type c999">POS机刷卡交易额</div>
  137. <div class="money f12">{{obj.TotalPosAmount | tofixed2}}</div>
  138. </div>
  139. <div style="flex:.2">
  140. <div class="line"></div>
  141. </div>
  142. <div style="flex:1">
  143. <div class="type c999">云闪付小额交易额</div>
  144. <div class="money f12">{{obj.TotalCloudPayAmount | tofixed2}}</div>
  145. </div>
  146. </div>
  147. <div class="type_panel df flexsb">
  148. <div style="flex:1">
  149. <div class="type c999">码牌活动交易</div>
  150. <div class="money f12">{{obj.TotalActiveAmount | tofixed2}}</div>
  151. </div>
  152. <div style="flex:.2">
  153. <div class="line"></div>
  154. </div>
  155. <div style="flex:1">
  156. <div class="type c999">码牌非活动交易</div>
  157. <div class="money f12">{{obj.TotalUnActiveAmount | tofixed2}}</div>
  158. </div>
  159. </div>
  160. <div class="df c666 f12 flexsb" v-for="item in obj.ProductList">
  161. <div class="type">{{item.Name}}</div>
  162. <div class="num_personal df cm"><span>{{item.Amount}}元</span></div>
  163. </div>
  164. </div>
  165. </div>
  166. </van-col>
  167. </van-row>
  168. </van-tab>
  169. </van-tabs>
  170. <van-popup class="product_mymerchant_transaction" v-model="showDate" position="bottom" :style="{ height: '50%' }" v-cloak>
  171. <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>
  172. </van-popup>
  173. </div>
  174. <script src="./static/js/klm-vv.min.js"></script>
  175. <script src="./static/js/appfunc.min.js"></script>
  176. <script src="./static/js/klm-axios-config.js"></script>
  177. <script src="./static/js/publicfn.js"></script>
  178. <script>
  179. function OnStart(){
  180. PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  181. };
  182. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  183. // 可以通过下面的方式手动注册
  184. Vue.use(vant.Lazyload);
  185. //--- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  186. // 在 #app 标签下渲染一个按钮组件
  187. let app = new Vue({
  188. el: '#app',
  189. data() {
  190. return {
  191. toptitleisshow:true,
  192. active:1,
  193. activeKey: 0,
  194. loading: false,
  195. finished: false,
  196. loading2: false,
  197. refreshing2: false,
  198. finished2: false,
  199. refreshing:false,
  200. pageinfo:{
  201. PageSize:10,
  202. PageNum:1
  203. },
  204. pageinfo2:{
  205. PageSize:20,
  206. PageNum:1
  207. },
  208. minDate: new Date(2020, 0, 1),
  209. maxDate: new Date(),
  210. currentDate: new Date(),
  211. nowdate:'',
  212. showDate: false,
  213. nameList:[
  214. {RealName:'总业绩',Id:''}
  215. ],
  216. data:[
  217. ],
  218. ismonth:false,
  219. merchantId:'',
  220. Id:'',
  221. };
  222. },
  223. created() {
  224. this.onConfirmDate();
  225. this.getmerchantlist();
  226. },
  227. methods: {
  228. onChange(index) {
  229. const people = this.nameList.find((item,ind)=>ind === index);
  230. //- this.data = [];
  231. this.merchantId = people.Id;
  232. if(this.active === 0) {
  233. this.pageinfo.PageNum = 1;
  234. this.getmonthinfo('refresh',this.merchantId);
  235. }else{
  236. this.gethalfyearinfo(people.Id);
  237. };
  238. },
  239. onLoad() {
  240. if(this.refreshing){
  241. this.refreshing = false;
  242. };
  243. this.pageinfo.PageNum++;
  244. this.getmonthinfo('onload',this.Id);
  245. },
  246. onLoad2() {
  247. if(this.refreshing2){
  248. this.refreshing2 = false;
  249. }
  250. this.pageinfo2.PageNum++;
  251. this.getmerchantlist();
  252. },
  253. changetab(){
  254. this.pageinfo.PageNum = 1;
  255. this.pageinfo2.PageNum = 1;
  256. //- this.activeKey = 0;
  257. //- this.nameList = [{RealName:'全部',Id:''}];
  258. //- this.getmerchantlist();
  259. console.log(this.active,'active')
  260. console.log(this.activeKey,'activeKey')
  261. if(this.active === 0 && !this.ismonth) {
  262. //- this.data = []
  263. this.getmonthinfo('refresh',this.Id);
  264. this.ismonth = true;
  265. };
  266. if(this.active === 1){
  267. //- this.data = []
  268. this.gethalfyearinfo(this.Id);
  269. this.ismonth = false;
  270. };
  271. },
  272. onRefresh() {
  273. this.pageinfo.PageNum = 1;
  274. // 清空列表数据
  275. this.finished = false;
  276. this.getmonthinfo('refresh',this.Id);
  277. //- this.data = [];
  278. // 重新加载数据
  279. // 将 loading 设置为 true,表示处于加载状态
  280. //- this.onLoad();
  281. },
  282. onRefresh2(){
  283. this.pageinfo2.PageNum = 0;
  284. // 清空列表数据
  285. this.finished = false;
  286. //- this.nameList = [];
  287. // 重新加载数据
  288. // 将 loading 设置为 true,表示处于加载状态
  289. this.onLoad2();
  290. this.loading2 = true;
  291. },
  292. choosetime(e){
  293. if(this.active === 0) {
  294. e.stopPropagation();
  295. }
  296. if(this.active !== 0) return;
  297. this.showDate = true;
  298. },
  299. formatter(type, val) {
  300. if (type === 'year') {
  301. return `${val}年`;
  302. } else if (type === 'month') {
  303. return `${val}月`;
  304. } else if (type === 'day') {
  305. return `${val}日`;
  306. }
  307. return val;
  308. },
  309. onConformateDate(){
  310. return formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
  311. },
  312. onParamsDate(date){
  313. return formatDate(new Date(date).getFullYear(),new Date(date).getMonth() + 1);
  314. },
  315. onConfirmDate() {
  316. //- this.data = [];
  317. this.showDate = false;
  318. this.nowdate = this.currentDate.getFullYear() + '-' + (this.currentDate.getMonth() + 1);
  319. this.ismonth = false;
  320. this.changetab();
  321. },
  322. async getmonthinfo(type,UserId){
  323. this.finished = false;
  324. //- const UserId = PublicLib.getCookieInfo('userId');
  325. const MerchantId = this.nameList[this.activeKey].Id
  326. this.Id = UserId ? UserId : PublicLib.getCookieInfo('userId');
  327. const res = await getRequest('api/v1/usertradedaysummary/teamperformanceforday?t='+Math.random(6),JSON.stringify({...this.pageinfo,TradeMonth:this.onConformateDate(),UserId:this.Id,MerchantId}));
  328. if(res.status !== '1')return tips('月计奖交易获取失败!');
  329. if(res.data.length < this.pageinfo.PageSize - 1) {
  330. this.finished = true;
  331. };
  332. if(type === 'refresh'){
  333. this.data = res.data
  334. this.refreshing = false;
  335. }else{
  336. this.data.push(...res.data);
  337. }
  338. this.loading = false;
  339. },
  340. async gethalfyearinfo(UserId){
  341. this.Id = UserId ? UserId : PublicLib.getCookieInfo('userId');
  342. const MerchantId = this.nameList[this.activeKey].Id
  343. console.log(this.nameList[this.activeKey].Id,'xxxxxxxxxxxxxxxxxx')
  344. const res = await getRequest('api/v1/usertradedaysummary/teamperformancehalfyear?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserId:this.Id,MerchantId}));
  345. if(res.status !== '1')return tips('半年计奖交易获取失败!');
  346. this.data = res.data;
  347. },
  348. async getmerchantlist(){
  349. //- PublicLib.ShowLoading({Message:''});
  350. this.finished2 = false;
  351. const UserId = PublicLib.getCookieInfo('userId');
  352. const res = await getRequest('api/v1/users/mymakerlist?t='+Math.random(6),JSON.stringify({...this.pageinfo2,UserLevel:'',RealName:'',UserId,Sort:1}));
  353. if(res.status !== '1')return tips('创客列表获取失败!');
  354. //- PublicLib.HideLoading();
  355. if(res.data.length < this.pageinfo2.PageSize) {
  356. this.finished2 = true;
  357. };
  358. if(this.pageinfo2.PageNum === 1){
  359. this.nameList = [
  360. {RealName:'总业绩',Id:''},
  361. ];
  362. };
  363. this.nameList.push(...res.data);
  364. this.loading2 = false;
  365. },
  366. goback(){
  367. PublicLib.GoBack({Level:1});
  368. },
  369. gotransactiondetail(date,item){
  370. PublicLib.putCookieInfo('paramstime', this.onParamsDate(date));
  371. PublicLib.putCookieInfo('transactiontype', '计奖交易');
  372. PublicLib.putCookieInfo('topshowtimetime', date);
  373. PublicLib.putCookieInfo('merchantName', item.Name);
  374. PublicLib.putCookieInfo('merchantTypeId', item.Id);
  375. PublicLib.Goto({Url:'transaction-detail'});
  376. }
  377. }
  378. });
  379. </script>
  380. </body>
  381. </html>