invite.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="container" style="padding-top: 100rpx;">
  3. <topView :backg="'#1A1A17'"></topView>
  4. <view class="infoBox">
  5. <view class="navBack" @click="navTo('/pages/index/index')">
  6. <u-icon name="arrow-left" size="25" color="#fff" style="position: absolute;left: 0;top: 0;font-weight: bold;"></u-icon>
  7. <view class="title">我的邀请</view>
  8. </view>
  9. <view class="flex numBox">
  10. <view class="numTpl">
  11. <view class="name">直推人数</view>
  12. <view class="num">{{info.count}}</view>
  13. </view>
  14. <view class="partition"></view>
  15. <view class="numTpl">
  16. <view class="name">团队业绩</view>
  17. <view class="num">{{userInfo.achievement == null ? '0' : userInfo.achievement}}</view>
  18. </view>
  19. </view>
  20. <view class="listBox" v-if="list.length > 0">
  21. <view class="listTop flex">
  22. <view class="tip">链接地址</view>
  23. <view class="tip">收益</view>
  24. </view>
  25. <view class="listTpl flex" v-if="list.length > 0" v-for="item,index in list" :key="index">
  26. <view class="tpl">
  27. <view class="addr">{{item.address}}</view>
  28. <view class="time">{{item.spread_time}}</view>
  29. </view>
  30. <!-- <view class="num">231.2361</view> -->
  31. </view>
  32. </view>
  33. <view class="noDate" v-else>暂无数据</view>
  34. </view>
  35. <pagination v-if="list.length > 0" :total="page.total" :btnText="true"
  36. :forceEllipses="true" @change="change"></pagination>
  37. </view>
  38. </template>
  39. <script>
  40. import topView from '../components/topView.vue';
  41. import pagination from '@/components/page-pagination/components/page-pagination/page-pagination.vue';
  42. import { spreadList } from '@/api/index.js';
  43. import {mapState,mapActions,mapMutations} from "vuex";
  44. import{ getTime } from '@/utils/rocessor.js';
  45. export default {
  46. components: {
  47. pagination,
  48. topView
  49. },
  50. data () {
  51. return {
  52. list:[],
  53. info:'',
  54. page: {
  55. total: 100,
  56. pageSize: 8,
  57. currentPage: 1
  58. }
  59. }
  60. },
  61. onShow () {
  62. this.loadData();
  63. },
  64. computed: {
  65. ...mapState('user', ['userInfo']),
  66. },
  67. methods: {
  68. loadData () {
  69. let obj = this;
  70. spreadList({
  71. page: obj.page.currentPage,
  72. limit: obj.page.pageSize,
  73. }).then(({ data }) => {
  74. obj.page.total = data.data.count
  75. obj.info = data.data
  76. data.data.list.forEach(item => {
  77. item.spread_time = getTime(item.spread_time)
  78. })
  79. obj.list = data.data.list
  80. });
  81. },
  82. change(currentPage,type) {
  83. this.page.currentPage = currentPage;
  84. this.loadData()
  85. },
  86. navTo(url){
  87. uni.navigateTo({
  88. url:url
  89. })
  90. },
  91. },
  92. }
  93. </script>
  94. <style lang="scss">
  95. page {
  96. width: 100%;
  97. min-height: 100vh;
  98. .container {
  99. width: 100%;
  100. min-height: 100vh;
  101. }
  102. }
  103. .infoBox{
  104. padding: 0rpx 25rpx;
  105. color: #fff;
  106. .numBox{
  107. background: #1A1A17;
  108. padding: 35rpx 0rpx;
  109. .numTpl{
  110. width: 30%;
  111. text-align: center;
  112. .name{
  113. font-weight: bold;
  114. font-size: 30rpx;
  115. color: #FFFFFF;
  116. }
  117. .num{
  118. font-weight: bold;
  119. font-size: 42rpx;
  120. color: #7760EE;
  121. margin-top: 15rpx;
  122. background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
  123. -webkit-background-clip: text;
  124. -webkit-text-fill-color: transparent;
  125. }
  126. }
  127. .partition{
  128. width: 2rpx;
  129. height: 119rpx;
  130. background: linear-gradient(0deg, rgba(255,255,255,0), #FFFFFF, rgba(255,255,255,0));
  131. }
  132. }
  133. }
  134. .listBox{
  135. margin-top: 25rpx;
  136. background: #1A1A17;
  137. padding: 0rpx 25rpx;
  138. .listTop{
  139. padding: 25rpx 0rpx;
  140. border-bottom: 1rpx solid rgba(83, 72, 72, 0.3);
  141. }
  142. .listTpl{
  143. padding: 25rpx 0rpx;
  144. border-bottom: 1rpx solid rgba(83, 72, 72, 0.3);
  145. .tpl{
  146. .addr{
  147. }
  148. .time{
  149. font-weight: 500;
  150. font-size: 20rpx;
  151. color: #FFFFFF;
  152. opacity: 0.5;
  153. padding-top: 15rpx;
  154. }
  155. }
  156. .num{
  157. font-size: 30rpx;
  158. color: #7760EE;
  159. background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
  160. -webkit-background-clip: text;
  161. -webkit-text-fill-color: transparent;
  162. }
  163. }
  164. .listTpl:last-child{
  165. border-bottom: none !important;
  166. }
  167. }
  168. .navBack{
  169. position: relative;
  170. color: #fff;
  171. text-align: center;
  172. margin: 30rpx 0rpx 40rpx 0rpx;
  173. .title{
  174. font-weight: bold;
  175. font-size: 34rpx;
  176. }
  177. }
  178. .noDate{
  179. text-align: center;
  180. opacity: 0.3;
  181. padding-top: 50rpx;
  182. }
  183. </style>