point.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view>
  3. <navbar v-model="screenHeight" title-color="#ffffff" background="#1b43c4" :iSimmersive="false" :placeholder="true" title="我的积分"></navbar>
  4. <mescroll-body
  5. ref="mescrollRef"
  6. @init="mescrollInit"
  7. @down="downCallback"
  8. @up="upCallback"
  9. :height="screenHeight+'px'"
  10. >
  11. <view class="top">
  12. <view class="top-box">
  13. <text>可用积分</text>
  14. <text>{{ point }}</text>
  15. </view>
  16. </view>
  17. <view class="list-wrap">
  18. <view class="point-list">
  19. <view class="point-item clear" v-for="(item,index) in result" :key="index">
  20. <view class="t">
  21. <text>{{item.time}}</text>
  22. <text>类型:{{item.operation}}</text>
  23. </view>
  24. <view class="m">
  25. {{item.description}}
  26. </view>
  27. <view class="b">
  28. <text>{{item.point}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </mescroll-body>
  34. </view>
  35. </template>
  36. <script>
  37. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  38. import navbar from "@/components/navbar/navbar";
  39. export default {
  40. mixins: [MescrollMixin],
  41. components: {
  42. navbar
  43. },
  44. data() {
  45. return {
  46. screenHeight: 0,
  47. point: 0,
  48. result: []
  49. }
  50. },
  51. onLoad() {
  52. let users = this.$storage.getJson("users");
  53. console.log(users);
  54. this.point = users.point;
  55. },
  56. methods: {
  57. downCallback(){
  58. setTimeout(()=>{
  59. this.mescroll.resetUpScroll();
  60. },1200);
  61. },
  62. triggerDownScroll(){
  63. this.mescroll.triggerDownScroll();
  64. },
  65. upCallback(page) {
  66. this.$http.getUcenterPointList({
  67. page: page.num
  68. }).then((result)=>{
  69. this.mescroll.endByPage(result.data.list.length, result.data.total);
  70. if(result.status==1){
  71. if(page.num == 1) this.result = [];
  72. this.point = result.data.point;
  73. console.log(result.data);
  74. this.result = this.result.concat(result.data.list);
  75. }else if(result.status == -1){
  76. this.mescroll.endErr();
  77. }
  78. }).catch(error=>{
  79. this.mescroll.endErr();
  80. });
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .online-box{ width: 90%; margin: 0 5%; margin-top: 20px; }
  87. .top{
  88. width: 100%;
  89. height: 270rpx;
  90. background-color: #fff;
  91. padding-top: 20rpx;
  92. border-top: 1px solid #ebedf0;
  93. .top-box{
  94. background-image: url(~@/static/images/point-bg.png);
  95. background-size: 100%;
  96. background-repeat: no-repeat;
  97. width: 90%;
  98. height: 250rpx;
  99. margin: 0 auto;
  100. border-radius: 20rpx;
  101. text-align: center;
  102. color: #fff;
  103. text {
  104. display: block;
  105. }
  106. text:first-child {
  107. padding-top: 60rpx;
  108. font-size: 28rpx;
  109. }
  110. text:last-child{
  111. padding-top: 40rpx;
  112. font-size: 50rpx;
  113. }
  114. }
  115. }
  116. .list-wrap{
  117. margin-top: 20rpx;
  118. .point-list{
  119. display: flex;
  120. flex-wrap: wrap;
  121. flex-direction: column;
  122. font-size: 28rpx;
  123. .point-item{
  124. width: 95%;
  125. margin: 0 auto;
  126. margin-bottom: 20rpx;
  127. border-radius: 12rpx;
  128. height: auto !important;
  129. height: 260rpx;
  130. min-height: 260rpx;
  131. background-color: #fff;
  132. border-bottom: 2rpx solid #eee;
  133. .t{
  134. height: 80rpx;
  135. line-height: 80rpx;
  136. border-bottom: 2rpx solid #eee;
  137. text:first-child{
  138. float: left;
  139. padding-left: 20rpx;
  140. }
  141. text:last-child{
  142. float: right;
  143. padding-right: 20rpx;
  144. }
  145. }
  146. .m{
  147. padding: 10rpx 20rpx;
  148. display: block;
  149. height: auto !important;
  150. height: 100rpx;
  151. min-height: 100rpx;
  152. }
  153. .b{
  154. height: 60rpx;
  155. line-height: 60rpx;
  156. border-top: 2rpx solid #eee;
  157. text{
  158. float: right;
  159. margin-right: 20rpx;
  160. }
  161. }
  162. }
  163. }
  164. }
  165. </style>