points.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="container">
  3. <tui-tab :tabs="tabs" isSticky :current="currentTab" selectedColor="#E41F19" sliderBgColor="#E41F19"
  4. @change="change"></tui-tab>
  5. <view class="tui-points__list">
  6. <tui-list-cell :hover="false" v-for="(item,index) in datalist" :key="index">
  7. <view class="tui-points__item">
  8. <image v-if="item.prefix==2" class="tui-icon" src="/static/images/mall/wallet/icon_expend_3x.png">
  9. </image>
  10. <image v-if="item.prefix==1" class="tui-icon" src="/static/images/mall/wallet/icon_income_3x.png">
  11. </image>
  12. <view>
  13. <view class="tui-title">{{ item.description }}</view>
  14. <view class="tui-desc">{{ item.create_time }}</view>
  15. </view>
  16. <view class="tui-right__box">
  17. <view class="tui-amount" :class="{'tui-expend':item.prefix==2}">
  18. {{item.prefix==2?'-':'+'}}{{ item.points }}
  19. </view>
  20. <view class="tui-desc" v-if="item.order_num_alias">订单号: {{item.order_num_alias}}</view>
  21. </view>
  22. </view>
  23. </tui-list-cell>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. lang: {},
  32. tabs: ["全部", "收入", "支出"],
  33. currentTab: 0,
  34. datalist: []
  35. }
  36. },
  37. onLoad() {
  38. const _this = this;
  39. _this.$request.get('Lang.getlang').then(res => {
  40. if (res.errno == 0) {
  41. _this.lang = res.data;
  42. uni.setNavigationBarTitle({
  43. title: _this.lang.points + '明细'
  44. });
  45. }
  46. });
  47. this.getpointsList()
  48. },
  49. methods: {
  50. change(e) {
  51. this.currentTab = e.index;
  52. this.getpointsList();
  53. },
  54. getpointsList() {
  55. const _this = this
  56. _this.$request.post('Points.list', {
  57. prefix: this.currentTab,
  58. page: 1,
  59. pageSize: 50
  60. }).then(res => {
  61. if (res.errno == 0) {
  62. _this.datalist = res.data
  63. } else {
  64. _this.datalist = []
  65. }
  66. })
  67. }
  68. },
  69. /**
  70. * 页面相关事件处理函数--监听用户下拉动作
  71. */
  72. onPullDownRefresh: function() {
  73. setTimeout(() => {
  74. uni.stopPullDownRefresh()
  75. }, 200);
  76. },
  77. onReachBottom() {}
  78. }
  79. </script>
  80. <style>
  81. .container {
  82. padding-bottom: env(safe-area-inset-bottom);
  83. }
  84. .tui-points__list {
  85. margin-top: 20rpx;
  86. }
  87. .tui-points__item {
  88. width: 100%;
  89. display: flex;
  90. align-items: center;
  91. }
  92. .tui-icon {
  93. width: 72rpx;
  94. height: 72rpx;
  95. margin-right: 20rpx;
  96. }
  97. .tui-title {
  98. font-size: 30rpx;
  99. font-weight: 400;
  100. color: #333333;
  101. }
  102. .tui-desc {
  103. font-size: 24rpx;
  104. font-weight: 400;
  105. color: #888888;
  106. padding-top: 12rpx;
  107. }
  108. .tui-right__box {
  109. margin-left: auto;
  110. text-align: right;
  111. }
  112. .tui-amount {
  113. font-size: 30rpx;
  114. font-weight: 400;
  115. color: #EB0909;
  116. }
  117. .tui-expend {
  118. color: #19be6b !important;
  119. }
  120. </style>