integrallog.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view>
  3. <view class="integral-log-header">
  4. <image class="bg" :src="statics.integralLogHeader"></image>
  5. <view class="main pd24_20">
  6. <view class="flex alcenter space">
  7. <view>
  8. <view class="flex alcenter">
  9. <text class="ft14 cl-w">当前积分</text>
  10. <navigator open-type="redirect" url="/pages/client/integral/role">
  11. <text class="ml5 iconfont iconbtn_question cl-w ft20"></text>
  12. </navigator>
  13. </view>
  14. <view class="mt16 flex alcenter">
  15. <image :src="statics.integralImg01" style="width: 40rpx; height: 40rpx;"></image>
  16. <text class="ml10 ft20 cl-w ftw600">{{userinfo.score}}</text>
  17. </view>
  18. </view>
  19. <navigator open-type="redirect" url="/pages/client/vipcard/integraldh">
  20. <view class="btn-integral">积分兑换</view>
  21. </navigator>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="integral-log-main">
  26. <view class="pd16_15 bd-bottom flex alcenter">
  27. <text class="iconfont iconicon_integral_des ft20 cl-main"></text>
  28. <text class="ml10 ft16 ftw600 cl-main">积分明细</text>
  29. </view>
  30. <view class="pd16_15" v-if="listData.length>0">
  31. <block v-for="(item,index) in listData" :key="index">
  32. <view class="pb16 mb16 bd-bottom flex alcenter space">
  33. <view>
  34. <view class="ft14 cl-main">{{item.memo}}</view>
  35. <view class="mt8 ft12 cl-notice">{{item.createtime}}</view>
  36. </view>
  37. <view class="ft18 ftw600 cl-main">{{item.jzt}}{{item.score}}</view>
  38. </view>
  39. </block>
  40. <uni-load-more :status="status" :content-text="contentText" />
  41. </view>
  42. <com-empty v-else title="暂无积分记录"></com-empty>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default{
  48. data(){
  49. return {
  50. userinfo:[],
  51. listData: [],
  52. last_id: 0,
  53. reload: true,
  54. status: 'more',
  55. userinfo:[],
  56. contentText: {
  57. contentdown: '上拉加载更多',
  58. contentrefresh: '加载中',
  59. contentnomore: '没有数据了'
  60. }
  61. }
  62. },
  63. onReachBottom() {
  64. this.status = 'more';
  65. this.getList();
  66. },
  67. onLoad(){
  68. this.ongrzlTap()
  69. this.getList();
  70. },
  71. methods:{
  72. async ongrzlTap(){
  73. let data = {};
  74. data.token = uni.getStorageSync("userinfo").token;
  75. data.uid = uni.getStorageSync("userinfo").id;
  76. uni.request({
  77. url: this.configs.webUrl+'/api/user/index',
  78. data: data,
  79. success: res =>{
  80. if(res.data.code==1){
  81. let ionfo=res.data.data
  82. this.userinfo=ionfo
  83. }else{
  84. uni.showToast({ title: res.data.msg,icon:"none" });
  85. }
  86. },
  87. fail: (data, code) => {
  88. //console.log('fail' + JSON.stringify(data));
  89. }
  90. });
  91. },
  92. getList() {
  93. let data = {
  94. //column: 'id,post_id,title,author_name,cover,published_at' //需要的字段名
  95. };
  96. var limit=10;
  97. if (this.last_id>0) {
  98. //说明已有数据,目前处于上拉加载
  99. this.status = 'loading';
  100. data.offset = this.last_id*limit;
  101. data._ = new Date().getTime() + '';
  102. }
  103. data.limit=limit
  104. data.token = uni.getStorageSync("userinfo").token;
  105. uni.request({
  106. url: this.configs.webUrl+'/api/user/userscoreinfo',
  107. data: data,
  108. success: data => {
  109. console.log(data.data)
  110. if (data.data.total>0) {
  111. let list = data.data.rows;
  112. this.listData = this.reload ? list : this.listData.concat(list);
  113. this.reload = false;
  114. this.last_id = this.last_id+1;
  115. if(data.data.total<this.last_id*limit){
  116. this.status = '';
  117. }
  118. }else{
  119. this.contentText.contentdown='没有数据'
  120. }
  121. },
  122. fail: (data, code) => {
  123. //console.log('fail' + JSON.stringify(data));
  124. }
  125. });
  126. },
  127. }
  128. }
  129. </script>
  130. <style>
  131. .integral-log-header{
  132. position: relative;
  133. height: 252rpx;
  134. }
  135. .integral-log-header .bg{
  136. width: 100%;
  137. height: 252rpx;
  138. }
  139. .integral-log-header .main{
  140. height: 252rpx;
  141. width: 100%;
  142. position: absolute;
  143. left: 0;
  144. top: 0;
  145. }
  146. .btn-integral{
  147. width: 192rpx;
  148. height: 80rpx;
  149. background: #FFFFFF;
  150. box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(0, 0, 0, 0.04);
  151. border-radius: 40rpx;
  152. text-align: center;
  153. line-height: 80rpx;
  154. color:#6687EF;
  155. font-size: 28rpx;
  156. font-weight: 500;
  157. }
  158. .integral-log-main{
  159. background: #FFFFFF;
  160. min-height: 1400rpx;
  161. position: relative;
  162. margin-top: -32rpx;
  163. border-radius: 32rpx 32rpx 0rpx 0rpx;
  164. }
  165. </style>