scoreRecord.vue 4.7 KB

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