product-profit-activation.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 h100p ovh pt0" style="padding-top:0;">
  18. <div id="app">
  19. <van-nav-bar class="user_rank_explan_title user_title_normal titlef16" left-arrow :title="'激活奖励-'+title" v-if="toptitleisshow" @click-left="goback">
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <van-tabs v-model="active" animated swipeable line-width="20" @change="changetab" title-active-color="#ff502a" line-height="2" :ellipsis="false" sticky v-cloak>
  23. <van-tab title="按日查询">
  24. <div class="bgcfff">
  25. <div class="ovh-x" ref="wrapper1">
  26. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;" :class="transactions.length === 0 ? 'isnodata':''">
  27. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  28. <div style="min-height:70vh;">
  29. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  30. <van-cell-group :border="false">
  31. <van-cell v-for="item,index in transactions" :title="item.ActDate" @click="activedetail(item.ActDateValue,item.ActDate)" :value="'¥'+item.RewardAmount" title-class="f12 c333" value-class="f12" center is-link></van-cell>
  32. </van-cell-group>
  33. </van-list>
  34. </div>
  35. </van-pull-refresh>
  36. </div>
  37. </div>
  38. </van-tab>
  39. <van-tab title="按月查询">
  40. <div class="bgcfff">
  41. <div class="ovh-x" ref="wrapper1">
  42. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;" :class="transactions.length === 0 ? 'isnodata':''">
  43. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  44. <div style="min-height:70vh;">
  45. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  46. <van-cell-group :border="false">
  47. <van-cell v-for="item,index in transactions" :title="item.ActDate" :value="'¥'+item.RewardAmount" title-class="f12 c333" value-class="f12" center></van-cell>
  48. </van-cell-group>
  49. </van-list>
  50. </div>
  51. </van-pull-refresh>
  52. </div>
  53. </div>
  54. </van-tab>
  55. </van-tabs>
  56. </div>
  57. <script src="./static/js/klm-vv.min.js"></script>
  58. <script src="./static/js/appfunc.min.js"></script>
  59. <script src="./static/js/klm-axios-config.js"></script>
  60. <script src="./static/js/publicfn.js"></script>
  61. <script>
  62. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  63. // 可以通过下面的方式手动注册
  64. Vue.use(vant.Lazyload);
  65. //- PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  66. // 在 #app 标签下渲染一个按钮组件
  67. let app = new Vue({
  68. el: '#app',
  69. data() {
  70. return {
  71. isnodata:false,
  72. toptitleisshow:false,
  73. active: 0,
  74. title:'',
  75. transactions: [
  76. ],
  77. loading: false,
  78. finished: false,
  79. refreshing: false,
  80. pageinfo:{
  81. PageSize:20,
  82. PageNum:1
  83. }
  84. };
  85. },
  86. created() {
  87. this.toptitleisshow = toptitleisshow;
  88. this.title = PublicLib.getCookieInfo('productMachineType');
  89. this.getactivedetail('refresh');
  90. PublicLib.SetTitle({Title:'激活奖励-'+ PublicLib.getCookieInfo('productMachineType')});
  91. },
  92. beforeUpdate(){
  93. this.$nextTick(() => {
  94. this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 44}px`;
  95. });
  96. },
  97. methods: {
  98. onLoad() {
  99. if (this.refreshing) {
  100. //- this.transactions = [];
  101. this.refreshing = false;
  102. this.pageinfo.PageNum = 0;
  103. };
  104. this.pageinfo.PageNum++;
  105. this.getactivedetail();
  106. },
  107. onRefresh() {
  108. // 清空列表数据
  109. this.finished = false;
  110. // 重新加载数据
  111. // 将 loading 设置为 true,表示处于加载状态
  112. this.loading = true;
  113. this.pageinfo.PageNum = 1;
  114. this.getactivedetail('refresh');
  115. },
  116. changetab(){
  117. this.transactions = [];
  118. this.pageinfo.PageNum = 1;
  119. this.getactivedetail('refresh');
  120. },
  121. activedetail(time,time2){
  122. PublicLib.putCookieInfo('activeDetailTime', time);
  123. PublicLib.putCookieInfo('activeTime', time2);
  124. PublicLib.Goto({Url:'product-profit-activation-detail'});
  125. },
  126. async getactivedetail(type = 'onload'){
  127. const ProductType = PublicLib.getCookieInfo('productMachineId');
  128. const UserId = PublicLib.getCookieInfo('userId');
  129. const Kind = this.active === 0 ? 1 : 2;
  130. const res = await getRequest('api/v1/pos/activereward/statlist?t='+Math.random(6),JSON.stringify({...this.pageinfo,ProductType,UserId,Kind}));
  131. if(res.status !== '1')return tips('激活奖励列表获取失败!');
  132. if(res.data.length < this.pageinfo.PageSize) {
  133. this.finished = true;
  134. };
  135. if(type === 'refresh'){
  136. this.transactions = res.data
  137. this.refreshing = false;
  138. }else{
  139. this.transactions.push(...res.data);
  140. }
  141. this.loading = false;
  142. if(this.transactions.length === 0) {this.isnodata = true}else{this.isnodata = false};
  143. },
  144. goback(){
  145. PublicLib.GoBack({Level:1});
  146. }
  147. }
  148. });
  149. </script>
  150. </body>
  151. </html>