product-profit-subsidy.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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" 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. <div class="pt16 pb8 pl16 pr16 bgcfff van-hairline--bottom">
  23. <div class="f12 more">提示:分润补贴仅展示有数据的月份</div>
  24. </div>
  25. <div class="bgcfff">
  26. <div class="ovh-x" ref="wrapper1">
  27. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;" :class="transactions.length === 0 ? 'isnodata':''">
  28. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  29. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  30. <van-cell-group class="subsidy-list" v-for="item,index in transactions" :border="false">
  31. <van-cell :title="item.TradeMonth" :value="item.SubsidyDirectProfit + '元'" title-class="f14 c333" value-class="f14 c333" :border="false" center></van-cell>
  32. <van-cell title="自营分润补贴" :value="item.SubsidyDirectProfit + '元'" title-class="f12 c999" value-class="f12" :border="false" center></van-cell>
  33. </van-cell-group>
  34. </van-list>
  35. </van-pull-refresh>
  36. </div>
  37. </div>
  38. </div>
  39. <script src="./static/js/klm-vv.min.js"></script>
  40. <script src="./static/js/appfunc.min.js"></script>
  41. <script src="./static/js/klm-axios-config.js"></script>
  42. <script src="./static/js/publicfn.js"></script>
  43. <script>
  44. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  45. // 可以通过下面的方式手动注册
  46. Vue.use(vant.Lazyload);
  47. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  48. // 在 #app 标签下渲染一个按钮组件
  49. let app = new Vue({
  50. el: '#app',
  51. data() {
  52. return {
  53. isnodata:false,
  54. toptitleisshow:false,
  55. transactions: [
  56. ],
  57. pageinfo:{
  58. PageSize:10,
  59. PageNum:1
  60. },
  61. loading: false,
  62. finished: false,
  63. refreshing: false,
  64. };
  65. },
  66. created(){
  67. this.toptitleisshow = toptitleisshow;
  68. this.title = PublicLib.getCookieInfo('productMachineType');
  69. this.getsubsidylist('refresh');
  70. PublicLib.SetTitle({Title:'分润补贴-'+ PublicLib.getCookieInfo('productMachineType')});
  71. },
  72. beforeUpdate() {
  73. this.$nextTick(() => {
  74. this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 44}px`;
  75. });
  76. },
  77. methods: {
  78. onLoad() {
  79. if (this.refreshing) {
  80. //- this.transactions = [];
  81. this.refreshing = false;
  82. this.pageinfo.PageNum = 0;
  83. };
  84. this.pageinfo.PageNum++;
  85. this.getsubsidylist();
  86. },
  87. onRefresh() {
  88. this.finished = false;
  89. this.loading = true;
  90. this.pageinfo.PageNum = 1;
  91. this.getsubsidylist('refresh');
  92. },
  93. goback(){
  94. PublicLib.GoBack({Level:1});
  95. },
  96. async getsubsidylist(type = 'onload'){
  97. //- PublicLib.ShowLoading({Message:''});
  98. const ProductType = PublicLib.getCookieInfo('productMachineId');
  99. const UserId = PublicLib.getCookieInfo('userId');
  100. const res = await getRequest('api/v1/pos/userprofitsubsidysummary/list?t='+Math.random(6),JSON.stringify({...this.pageinfo,ProductType,UserId}));
  101. if(res.status !== '1')return tips('分润补贴列表获取失败!');
  102. //- PublicLib.HideLoading();
  103. if(res.data.length < this.pageinfo.PageSize) {
  104. this.finished = true;
  105. };
  106. if(type === 'refresh'){
  107. this.transactions = res.data
  108. this.refreshing = false;
  109. }else{
  110. this.transactions.push(...res.data);
  111. }
  112. this.loading = false;
  113. if(this.transactions.length === 0) {this.isnodata = true}else{this.isnodata = false};
  114. },
  115. }
  116. });
  117. </script>
  118. </body>
  119. </html>