communityDetail.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view class="container">
  3. <view class="centerBox ">
  4. <view class="itemList border-linear-gradient">
  5. <view class="list">
  6. <view class="item" v-for="(item,index) in listAll">
  7. <view class="leftItem">
  8. <view class="itemName flex">
  9. <view class="itemType">
  10. <view class="num text-linear-gradient">
  11. {{item.num}}
  12. </view>
  13. <view class="type">
  14. {{$t('home.认购数1')}}
  15. </view>
  16. </view>
  17. <view class="jg"></view>
  18. <view class="itemType">
  19. <view class="num text-linear-gradient">
  20. {{item.award_num}}
  21. </view>
  22. <view class="">
  23. {{$t('home.总量')}}
  24. </view>
  25. </view>
  26. <view class="jg"></view>
  27. <view class="itemType">
  28. <view class="num text-linear-gradient">
  29. {{item.wait_num}}
  30. </view>
  31. <view class="">
  32. {{$t('home.待释放')}}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="itemTime margin-t-10">
  37. {{item.createtime|dateFormat}}
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <u-loadmore :status="loading" line :loadmoreText="$t('base.加载更多')" :loadingText="$t('base.正在加载')"
  44. :nomoreText="$t('base.没有更多了')" />
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. mapMutations
  51. } from "vuex";
  52. import {
  53. orderList
  54. } from '@/api/index.js';
  55. import dayjs from '@/libs/dayjs/dayjs.min.js';
  56. export default {
  57. data() {
  58. return {
  59. listAll: [],
  60. loading: 'loadmore', //'上拉加載更多','加載中','沒有更多'
  61. page: 1,
  62. limit: 10,
  63. shareNum: 0,
  64. itemNum: 0,
  65. }
  66. },
  67. filters: {
  68. dateFormat: function(value) {
  69. return dayjs(value * 1000).format('YYYY/MM/DD hh:mm:ss');
  70. },
  71. },
  72. onLoad(option) {
  73. this.getList();
  74. },
  75. onReachBottom() {
  76. this.getList()
  77. },
  78. methods: {
  79. ...mapMutations('user', ['setUserInfo']),
  80. // 获取列表
  81. getList() {
  82. const that = this;
  83. if (that.loading == 'nomore' || that.loding == "loading") {
  84. return
  85. }
  86. that.loading = 'loading';
  87. orderList({
  88. page: that.page,
  89. limit: that.limit,
  90. }).then((res) => {
  91. const list = res.data.list.map((rs) => {
  92. rs.num = +rs.num;
  93. rs.award_num = +rs.award_num;
  94. rs.wait_num = +rs.wait_num;
  95. return rs
  96. })
  97. that.listAll = that.listAll.concat(list);
  98. if (list.length != that.limit) {
  99. that.loading = 'nomore'
  100. } else {
  101. that.page++
  102. that.loading = 'loadmore'
  103. }
  104. }).catch((res) => {
  105. console.log(res);
  106. })
  107. },
  108. },
  109. }
  110. </script>
  111. <style lang="scss">
  112. .container {
  113. width: 100%;
  114. line-height: 1;
  115. background-color: rgb(12, 8, 21);
  116. min-height: 100vh;
  117. }
  118. .centerBox {
  119. padding: 30rpx;
  120. color: #FFF;
  121. .itemList {
  122. border-radius: 20rpx;
  123. padding: 20rpx 30rpx 40rpx;
  124. .list {
  125. min-height: 700rpx;
  126. .item {
  127. border-bottom: 1px solid rgba(240, 240, 240, .3);
  128. padding: 20rpx 0;
  129. }
  130. .leftItem {
  131. .itemName {
  132. font-size: 24rpx;
  133. .itemType {
  134. .num {
  135. padding-bottom: 10rpx;
  136. font-weight: bold;
  137. font-size: 32rpx;
  138. }
  139. }
  140. }
  141. .itemTime {
  142. font-weight: 500;
  143. font-size: 22rpx;
  144. color: #FFFFFF;
  145. opacity: 0.5;
  146. }
  147. .itemType {
  148. text-align: center;
  149. flex-grow: 1;
  150. }
  151. .jg {
  152. height: 80rpx;
  153. width: 1px;
  154. background: linear-gradient(0deg, rgba(255, 255, 255, 0), #FFFFFF, rgba(255, 255, 255, 0));
  155. }
  156. }
  157. }
  158. }
  159. }
  160. </style>