shareItem.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="container">
  3. <navBar :show-title="true" :title="$t("home.我的邀請")" url="/pages/index/index"></navBar>
  4. <view class="centerBox">
  5. <view class="topBox background-linear-gradient">
  6. <view class="title">
  7. {{$t('user.数据统计')}}
  8. <view class="tip">
  9. </view>
  10. </view>
  11. <view class="flex numBox">
  12. <view class="ls">
  13. <view class="type">
  14. {{$t('user.直推人数')}}
  15. </view>
  16. <view class="num text-linear-gradient">
  17. {{shareNum}}
  18. </view>
  19. </view>
  20. <view class="jg">
  21. </view>
  22. <view class="ls">
  23. <view class="type">
  24. {{$t('user.团队人数')}}
  25. </view>
  26. <view class="flex-center">
  27. <view class="num text-linear-gradient">
  28. {{itemNum}}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="itemList margin-t-30 background-linear-gradient">
  35. <view class="title">
  36. {{$t('user.链接地址')}}
  37. <view class="tip">
  38. </view>
  39. </view>
  40. <view class="list">
  41. <view class="item flex" v-for="(item,index) in listAll">
  42. <view class="leftItem">
  43. <view class="itemName">
  44. {{item.address|hideCenter}}
  45. </view>
  46. <view class="itemTime margin-t-10">
  47. {{item.spread_time|dateFormat}}
  48. </view>
  49. </view>
  50. <view class="rightItem">
  51. <view class="on text-linear-gradient" v-if="item.order_num>0">
  52. {{$t('user.已购买')}}
  53. </view>
  54. <view class="off" v-else>
  55. {{$t('user.未购买')}}
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <u-loadmore :status="loading" line :loadmoreText="$t('base.加载更多')" :loadingText="$t('base.正在加载')"
  62. :nomoreText="$t('base.没有更多了')" />
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import {
  68. mapMutations
  69. } from "vuex";
  70. import {
  71. spreadList
  72. } from '@/api/index.js';
  73. import navBar from "@/components/nav/nav.vue"
  74. import dayjs from '@/libs/dayjs/dayjs.min.js';
  75. export default {
  76. data() {
  77. return {
  78. listAll: [],
  79. loading: 'loadmore', //'上拉加載更多','加載中','沒有更多'
  80. page: 1,
  81. limit: 10,
  82. shareNum:0,
  83. itemNum:0,
  84. }
  85. },
  86. filters: {
  87. dateFormat: function (value) {
  88. return dayjs(value * 1000).format('YYYY/MM/DD hh:mm:ss');
  89. },
  90. hideCenter: function(value) {
  91. const st = value.slice(7, value.length - 7);
  92. const sr = value.replace(st, '...')
  93. return sr;
  94. },
  95. },
  96. components: {
  97. navBar
  98. },
  99. onLoad(option) {
  100. this.getList();
  101. },
  102. onReachBottom() {
  103. this.getList()
  104. },
  105. methods: {
  106. ...mapMutations('user', ['setUserInfo']),
  107. // 获取列表
  108. getList() {
  109. const that = this;
  110. if (that.loading == 'nomore' || that.loding == "loading") {
  111. return
  112. }
  113. that.loading = 'loading';
  114. spreadList({
  115. page: that.page,
  116. limit: that.limit,
  117. }).then((res) => {
  118. that.shareNum = res.data.data.count;
  119. that.itemNum = res.data.data.group_count;
  120. const list = res.data.data.list.map((rs) => {
  121. return rs
  122. })
  123. that.listAll = that.listAll.concat(list);
  124. if (list.length != that.limit) {
  125. that.loading = 'nomore'
  126. } else {
  127. that.page++
  128. that.loading = 'loadmore'
  129. }
  130. }).catch((res) => {
  131. console.log(res);
  132. })
  133. },
  134. },
  135. }
  136. </script>
  137. <style lang="scss">
  138. .container {
  139. width: 100%;
  140. line-height: 1;
  141. background-color: rgb(12, 8, 21);
  142. min-height: 100vh;
  143. }
  144. .centerBox {
  145. padding: 30rpx;
  146. color: #FFF;
  147. .title {
  148. font-weight: bold;
  149. font-size: 27rpx;
  150. padding-bottom: 40rpx;
  151. .tip {
  152. width: 2em;
  153. height: 7rpx;
  154. background: linear-gradient(90deg, #7D32FF, #3EE0FF);
  155. border-radius: 4px;
  156. margin-top: -5rpx;
  157. }
  158. }
  159. .topBox {
  160. padding: 40rpx 30rpx;
  161. border-radius: 20rpx;
  162. .numBox {
  163. align-items: inherit;
  164. .ls {
  165. text-align: center;
  166. flex-grow: 1;
  167. font-weight: bold;
  168. .type {
  169. font-size: 30rpx;
  170. }
  171. .num {
  172. font-size: 42rpx;
  173. margin-top: 30rpx;
  174. }
  175. }
  176. .jg {
  177. width: 2px;
  178. background: linear-gradient(0deg, rgba(255, 255, 255, 0), #FFFFFF, rgba(255, 255, 255, 0));
  179. }
  180. }
  181. }
  182. .itemList{
  183. border-radius: 20rpx;
  184. padding: 40rpx 30rpx;
  185. .list{
  186. .leftItem{
  187. .itemName{
  188. font-weight: bold;
  189. font-size: 29rpx;
  190. }
  191. .itemTime{
  192. font-weight: 500;
  193. font-size: 20rpx;
  194. color: #FFFFFF;
  195. opacity: 0.5;
  196. }
  197. }
  198. .rightItem{
  199. font-weight: 500;
  200. font-size: 30rpx;
  201. }
  202. }
  203. }
  204. }
  205. </style>