scoreRecord.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="box">
  3. <view class="topBox">
  4. <view class="topCont">
  5. <view class="kyjf">
  6. <view class="kyjfTitle">可用积分</view>
  7. <view class="kyjfCont">
  8. <view class="kyjfNum">{{avaIntegral?avaIntegral:0}}</view>
  9. <!-- <view class="kyjfDq">333积分即将过期</view> -->
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="itemHistory" v-for="(item,index) in itemData" :key="index">
  15. <view class="carPlate">
  16. <view class="plate" v-if="item.bizType==0">支付使用积分</view>
  17. <view class="plate" v-if="item.bizType==1">积分清理</view>
  18. <view class="plate" v-if="item.bizType==2">积分兑换</view>
  19. <view class="plate" v-if="item.bizType==3">积分调整</view>
  20. <view class="plate" v-if="item.bizType==4">下单送积分</view>
  21. <view class="plate" v-if="item.bizType==5">取消支付回收积分</view>
  22. <view class="plate" v-if="item.bizType==6">取消支付返回使用积分</view>
  23. <view class="plate" v-if="item.bizType==7">期初导入</view>
  24. <view class="plate" v-if="item.bizType==8">兑换取消</view>
  25. <view class="plate" v-if="item.bizType==9">每日签到</view>
  26. <view class="plate" v-if="item.bizType==10">积分过期</view>
  27. <view class="plate" v-if="item.bizType==12">评价积分</view>
  28. <view class="mileage" v-if="item.type==1">+{{item.integral}}</view>
  29. <view class="jian" v-if="item.type==2" style="font-weight: 500;">-{{item.integral}}</view>
  30. </view>
  31. <view class="time">{{item.createTime}}</view>
  32. </view>
  33. <!-- 上拉 加载更多 -->
  34. <view class="noMore" v-if="noMoreShow && (itemData.length!=0)">没有更多数据</view>
  35. <!-- 无数据空白页 -->
  36. <nodata v-if="itemData.length==0"></nodata>
  37. </view>
  38. </template>
  39. <script>
  40. import nodata from '../../components/nodata/nodata.vue'
  41. export default {
  42. components: {
  43. nodata,
  44. },
  45. data() {
  46. return {
  47. page: 1,
  48. itemData: [],
  49. noMoreShow: false,
  50. avaIntegral: '',
  51. }
  52. },
  53. onLoad(opt) {
  54. this.avaIntegral = opt.avaIntegral
  55. this.page = 1
  56. this.myOrderCoupon()
  57. },
  58. methods: {
  59. myOrderCoupon() {
  60. uni.showLoading({
  61. title: '加载中'
  62. })
  63. this.$http('openIntegralMall/integralRecord', {
  64. page: this.page,
  65. limit: 10,
  66. }, 'GET').then(res => {
  67. uni.hideLoading();
  68. // var list = res.data.Items
  69. var list = res.data.Items
  70. // 处理 undefined和null转为空白字符串
  71. // list.forEach((item, index) => {
  72. // for (const key in item) {
  73. // item[key] = this.$praseStrEmpty(item[key])
  74. // }
  75. // })
  76. if (this.page == 1) {
  77. this.itemData = list
  78. } else {
  79. this.itemData = this.itemData.concat(list)
  80. }
  81. if (list.length < 10) {
  82. this.noMoreShow = true
  83. } else {
  84. this.noMoreShow = false
  85. }
  86. })
  87. },
  88. },
  89. // 下拉刷新 上拉加载更多
  90. onPullDownRefresh() {
  91. this.page = 1
  92. this.myOrderCoupon()
  93. setTimeout(function() {
  94. uni.stopPullDownRefresh();
  95. }, 1000);
  96. },
  97. onReachBottom() {
  98. this.page++;
  99. this.myOrderCoupon()
  100. },
  101. }
  102. </script>
  103. <style>
  104. .box {
  105. min-height: 100vh;
  106. background-color: #ffffff;
  107. }
  108. .topBox {
  109. width: 100%;
  110. height: 200rpx;
  111. background: #ffffff;
  112. padding-top: 30rpx;
  113. position: relative;
  114. }
  115. .topCont {
  116. width: 702rpx;
  117. height: 200rpx;
  118. background: url('http://dmsphoto.66km.com.cn/thFiles/DCCDB197-4F64-4711-89C0-E5034B2F1788.png') no-repeat;
  119. background-size: 100% 100%;
  120. margin-left: 24rpx;
  121. position: relative;
  122. border-radius: 20rpx;
  123. overflow: hidden;
  124. }
  125. .kyjf {
  126. padding-top: 46rpx;
  127. padding-left: 40rpx;
  128. }
  129. .kyjfTitle {
  130. color: #523509;
  131. font-size: 28rpx;
  132. }
  133. .kyjfNum {
  134. font-size: 60rpx;
  135. font-family: PingFangSC-Medium, PingFang SC;
  136. font-weight: 500;
  137. color: #523509;
  138. line-height: 84rpx;
  139. }
  140. .kyjfDq {
  141. width: 224rpx;
  142. height: 44rpx;
  143. background: linear-gradient(135deg, #FFC81B 0%, #FFA800 100%);
  144. border-radius: 22rpx 22rpx 22rpx 0px;
  145. text-align: center;
  146. color: #573400;
  147. line-height: 44rpx;
  148. font-size: 24rpx;
  149. margin-left: 10rpx;
  150. margin-top: 22rpx;
  151. }
  152. .kyjfCont {
  153. display: flex;
  154. }
  155. .itemHistory {
  156. padding: 30rpx 24rpx;
  157. background-color: #FFFFFF;
  158. border-bottom: 1rpx solid #EEEEEE;
  159. }
  160. .time {
  161. font-size: 24rpx;
  162. color: #999999;
  163. margin-top: 8rpx;
  164. }
  165. .carPlate {
  166. display: flex;
  167. align-items: center;
  168. justify-content: space-between;
  169. }
  170. .plate {
  171. font-size: 30rpx;
  172. color: #3C3C3C;
  173. }
  174. .mileage {
  175. font-size: 30rpx;
  176. color: #FF0000;
  177. font-weight: bold;
  178. }
  179. .jian{
  180. font-size: 30rpx;
  181. color: #333333;
  182. }
  183. .noMore {
  184. text-align: center;
  185. line-height: 50rpx;
  186. color: #999999;
  187. font-size: 28rpx;
  188. }
  189. </style>