spread_detail.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. {extend name="public/container"}
  2. {block name='title'}
  3. {if $type==0}
  4. 一级推广佣金记录
  5. {elseif $type==1}
  6. 二级推广佣金记录
  7. {else}
  8. 佣金提现记录
  9. {/if}
  10. {/block}
  11. {block name="content"}
  12. <div class="promotion-details withdrawals-record" id="app" ref="app">
  13. <div class="data acea-row row-middle" id="dateShowBtn">
  14. <input type="text" readonly="readonly" onfocus='this.blur();' id="dateSelectorTwo" :value=value>
  15. <span class="iconfont icon-xiala"></span>
  16. </div>
  17. <ul class="list" v-cloak="" ref="list">
  18. <li class="item acea-row row-column row-center" v-for="item in spreadList">
  19. <div class="acea-row row-between-wrapper">
  20. <div class="title line1" v-text="item.mark"></div>
  21. <div class="name line1" v-text="item.nickname"></div>
  22. </div>
  23. <div class="time acea-row row-between-wrapper">
  24. <div v-text="item.add_time"></div>
  25. <div class="money" v-if="item.pm==1">+{{item.number}}</div>
  26. <div class="money" style="color: #ea2f2f;" v-else-if="item.pm==0">-{{item.number}}</div>
  27. <div v-else>{{item.number}}</div>
  28. </div>
  29. </li>
  30. </ul>
  31. <p class="loading-line" style="background-color: #ffffff" v-cloak="">
  32. <span v-show="loading==true" class="fa fa-spinner loadingpic" style="font-size: 0.4rem"></span>
  33. <span v-text="loadTitle">加载更多</span>
  34. </p>
  35. <shortcut></shortcut>
  36. </div>
  37. <script src="{__WAP_PATH}zsff/js/iScroll.js"></script>
  38. <script src="{__WAP_PATH}zsff/js/Mdate.js"></script>
  39. {/block}
  40. {block name="foot"}
  41. <script>
  42. var type={$type};
  43. require(['vue','helper','store','{__WAP_PATH}zsff/js/shortcut.js'],function(Vue,$h,app) {
  44. new Vue({
  45. el: '#app',
  46. data: {
  47. value:'',
  48. spreadList:[],
  49. loadTitle:'上拉加载更多',
  50. loading:false,
  51. loaded:false,
  52. page:1,
  53. limit:10,
  54. type:type,
  55. },
  56. watch:{
  57. value:function (n) {
  58. this.page=1;
  59. this.loadend=false;
  60. this.$set(this,'spreadList',[]);
  61. this.getSpreadList();
  62. }
  63. },
  64. mounted:function(){
  65. this.datas();
  66. var year = new Date().getFullYear();
  67. var montho = new Date().getMonth()+1;
  68. var month = montho <10?'0'+montho : montho;
  69. this.value=year+'年'+month+'月';
  70. },
  71. methods:{
  72. datas:function(){
  73. var that=this;
  74. new Mdate("dateShowBtn", {
  75. acceptId:"dateSelectorTwo",
  76. beginYear: "2000",
  77. success:function (data) {
  78. that.value=data;
  79. }
  80. });
  81. },
  82. getSpreadList:function () {
  83. var that=this;
  84. if(this.loading) return;
  85. if(this.loadend) return;
  86. this.loadTitle='';
  87. this.loading=true;
  88. app.baseGet($h.U({c:'spread',a:'get_spread_list',q:{type:type,page:this.page,limit:this.limit,data:that.value}}),function (res) {
  89. var list=res.data.data.list;
  90. var spreadList=$h.SplitArray(list,that.spreadList);
  91. that.loadend=list.length < that.limit;
  92. that.loadTitle=that.loadend ? '已全部加载': '上拉加载更多';
  93. that.page=res.data.data.page;
  94. that.loading=false;
  95. that.$set(that,'spreadList',spreadList);
  96. that.$nextTick(function () {
  97. that.bScrollInit();
  98. });
  99. },function (res) {
  100. that.loadTitle='上拉加载更多';
  101. that.loading=false;
  102. });
  103. },
  104. //滑动底部加载
  105. bScrollInit:function(){
  106. var that = this;
  107. this.$refs.app.style.height =document.documentElement.clientHeight+'px';
  108. this.$refs.app.style.overflowY = 'scroll';
  109. $(this.$refs.app).on('scroll',function(){
  110. var scrollTop = $(this).scrollTop();
  111. var scrollHeight = $(that.$refs.list).height();
  112. var windowHeight = $(this).height();
  113. if ((scrollTop + windowHeight) >= scrollHeight) {
  114. that.loading == false && that.getSpreadList();
  115. }
  116. })
  117. }
  118. }
  119. });
  120. })
  121. </script>
  122. {/block}