record.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div class="xuefen">
  3. <div class="top">
  4. <div class="card">
  5. <div class="my_nums">我的学分:<span class="num">{{useInfo.xuefen}}</span></div>
  6. <image src="@/static/images/mine/icon_6.png" mode="" class="icon_6"></image>
  7. </div>
  8. </div>
  9. <div class="list">
  10. <div class="title">
  11. <div>记录明细</div>
  12. <div class="line"></div>
  13. </div>
  14. <div v-if="list.length>0">
  15. <div class="item" v-for="item in list" :key="item.id" @click="recordDetail(item)">
  16. <image v-if="item.is_reward==1" src="@/static/images/xitong.png" mode="" class="item_icon"></image>
  17. <image v-if="item.is_reward==0" src="@/static/images/maihuo.png" mode="" class="item_icon"></image>
  18. </image>
  19. <div class="middle">
  20. <div class="name">{{item.reward_type_name}}</div>
  21. <div class="time">{{formatTime(item.updated_at)}}</div>
  22. </div>
  23. <div class="total_nums">+{{item.xuefen}}</div>
  24. </div>
  25. </div>
  26. <div class="empty_image" v-else>
  27. <u-empty text="暂无记录"></u-empty>
  28. </div>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. page: 1,
  37. last: false,
  38. list: [],
  39. useInfo: {}
  40. }
  41. },
  42. onReachBottom() {
  43. if (!this.last) {
  44. this.page++
  45. }
  46. this.getList()
  47. },
  48. onShow() {
  49. this.useInfo = this.vuex_user
  50. this.page = 1
  51. this.last = false
  52. this.list=[]
  53. this.getList()
  54. },
  55. methods: {
  56. getList() {
  57. this.$u.get('/dwbs/xuefens', {
  58. page: this.page,
  59. user_id: this.vuex_user.id
  60. }).then(res => {
  61. console.log(res, 'list')
  62. let data = res.data.data
  63. if (this.page > 1 && data.length == 0) {
  64. uni.showToast({
  65. title: '暂无更多',
  66. icon: 'none'
  67. })
  68. this.last = true
  69. } else {
  70. this.list = this.list.concat(data)
  71. }
  72. })
  73. },
  74. //格式化时间
  75. formatTime(time) {
  76. return time.replace(/-/g, '/');
  77. },
  78. recordDetail(item) {
  79. if(item.is_reward==1) return
  80. uni.navigateTo({
  81. url: '/pages/xuefen/detail?id=' + item.id
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. page {
  89. background-color: #f5f5ff;
  90. }
  91. .top {
  92. background-color: #fff;
  93. padding: 12px;
  94. .card {
  95. padding: 7px 12px;
  96. display: flex;
  97. align-items: center;
  98. background: linear-gradient(270deg, #FF571B 0%, #F5222D 100%);
  99. border-radius: 10px;
  100. .my_nums {
  101. font-weight: 400;
  102. font-size: 20px;
  103. color: #fff;
  104. flex: 1;
  105. text-align: left;
  106. margin-left: 20px;
  107. .num {
  108. font-size: 22px;
  109. }
  110. }
  111. .icon_6 {
  112. width: 64px;
  113. height: 64px;
  114. }
  115. }
  116. }
  117. .list {
  118. margin-top: 4px;
  119. border-radius: 8px 8px 0px 0px;
  120. padding: 12px;
  121. background: #FFFFFF;
  122. .title {
  123. position: relative;
  124. font-size: 17px;
  125. color: #FB231F;
  126. text-align: center;
  127. .line {
  128. position: absolute;
  129. width: 16px;
  130. height: 2px;
  131. left: calc(50% - 8px);
  132. ;
  133. bottom: -4px;
  134. border-radius: 2px;
  135. // margin: 0 auto;
  136. background: linear-gradient(180deg, #F30000 0%, #FE4815 100%);
  137. }
  138. }
  139. .item {
  140. display: flex;
  141. align-items: center;
  142. padding: 16px 0;
  143. border-bottom: 1px solid #EEEEEE;
  144. .item_icon {
  145. width: 40px;
  146. height: 40px;
  147. margin-right: 10px;
  148. }
  149. .middle {
  150. flex: 1;
  151. .name {
  152. font-size: 15px;
  153. color: #333333;
  154. }
  155. .time {
  156. margin-top: 8px;
  157. font-size: 14px;
  158. color: #999999;
  159. }
  160. }
  161. .total_nums {
  162. font-size: 18px;
  163. font-weight: 500;
  164. color: #FB231F;
  165. }
  166. }
  167. }
  168. </style>