recordList.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="page">
  3. <view class="topBody">
  4. <view class="header">
  5. </view>
  6. <view class="myinfo">
  7. <view class="line"></view>
  8. <view class="numlist" v-if="type == 'GMM'">
  9. <view class="left">
  10. <view class="num">
  11. <text>{{num}}</text>
  12. <view class="name">{{$t('txt.M币数量')}}</view>
  13. </view>
  14. </view>
  15. <view class="right">
  16. <view class="buyBtn" @click="goPage('/pages/my/M_purchase')">
  17. <text>{{$t('txt.立即充值')}}</text>
  18. </view>
  19. </view>
  20. <image class="icon" src="../../static/me/M_coin_bg1.png" mode="heightFix" />
  21. </view>
  22. <view style="padding-top: 20rpx;margin-left: 40rpx;">
  23. <text style="color:#FFFFFF;font-size: 32rpx;">{{$t('txt.进出明细')}}</text>
  24. </view>
  25. <view class="mingxiList" v-if="false">
  26. <view class="left">
  27. <text style="font-size: 28rpx;color: #999999;">{{$t('txt.明细类型')}}</text>
  28. <image class="icon" src="../../static/me/arrow_down_gray.png" mode="heightFix" />
  29. </view>
  30. <view class="right">
  31. <text style="font-size: 28rpx;color: #999999;">{{$t('txt.开始时间-结束时间')}}</text>
  32. <image class="icon" src="../../static/me/arrow_down_gray.png" mode="heightFix" />
  33. </view>
  34. </view>
  35. <view class="numlist2">
  36. <view class="item" v-for="(item, index) in list" :key="index">
  37. <view class="left">
  38. <view class="num">
  39. <text>{{ $t(item.name) }}</text>
  40. <view class="data">{{item.create_time}}</view>
  41. </view>
  42. </view>
  43. <view class="right">
  44. <view v-if="item.num>0" class="num1">
  45. <text>+{{ item.num }}</text>
  46. </view>
  47. <view v-else class="num1 num2">
  48. <text>-{{ item.num }}</text>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="no-content" v-if="hasNo">
  54. <image class="icon" mode="widthFix" src="../../static/home/no.png"></image>
  55. <text>还没有消息</text>
  56. </view>
  57. </view>
  58. <view class="blankHeight"></view>
  59. </view>
  60. <!-- 提示框 -->
  61. <DialogBox ref="DialogBox"></DialogBox>
  62. </view>
  63. </template>
  64. <script>
  65. export default {
  66. components: {},
  67. data() {
  68. return {
  69. type: 'GMM',
  70. num: '0',
  71. sel: 1,
  72. M_coinInfo: {
  73. myMcoin: 0
  74. },
  75. list: [],
  76. page: 1,
  77. hasNo: true,
  78. }
  79. },
  80. onLoad(parms) {
  81. this.type = parms.type || 'GMM';
  82. },
  83. onShow() {
  84. this.loadData();
  85. },
  86. methods: {
  87. onBack() {},
  88. goPage(page) {
  89. uni.navigateTo({
  90. url: page,
  91. })
  92. },
  93. chkSel() {
  94. if (this.sel == 1) {
  95. this.sel = 0;
  96. } else {
  97. this.sel = 1;
  98. }
  99. },
  100. loadData() {
  101. var offset = (this.page - 1) * 20;
  102. uni.request({
  103. url: this.$apiHost + '/My/recordlist',
  104. data: {
  105. uuid: getApp().globalData.uuid,
  106. type: this.type,
  107. offset: offset,
  108. },
  109. header: {
  110. 'content-type': 'application/json'
  111. },
  112. success: (res) => {
  113. console.log("res", res.data)
  114. this.num = res.data.num;
  115. if (res.data.list != null && res.data.list != undefined) {
  116. if (res.data.list.length > 0) {
  117. this.hasNo = false;
  118. }
  119. if (this.page <= 1) {
  120. this.list = res.data.list;
  121. } else {
  122. this.list = this.list.concat(res.data.list);
  123. }
  124. }
  125. uni.setNavigationBarTitle({
  126. title: res.data.name
  127. })
  128. }
  129. });
  130. },
  131. }
  132. }
  133. </script>
  134. <style scoped lang="scss">
  135. @import 'recordList.scss';
  136. </style>