scoreRecord.vue 5.2 KB

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