invite-list.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <view class="web_box">
  3. <view class="top hflex acenter jbetween">
  4. <view class="top_item vflex acenter jcenter">
  5. <view class="num">{{total}}</view>
  6. <view class="text">已邀好友</view>
  7. </view>
  8. <view class="top_item vflex acenter jcenter">
  9. <view class="num">¥{{sum||0.0}}</view>
  10. <view class="hflex acenter">
  11. <view class="text">已获佣金</view>
  12. <u-icon name="question-circle" color="#fff" size="28" @click="show = true"></u-icon>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="list">
  17. <view class="tabs hflex acenter jbetween">
  18. <view class="tabs_item" :class="tab_active == index ? 'tab_active' : ''" v-for="(item,index) in tabs"
  19. :key="index" @click="changetab(index)">{{item.name}}</view>
  20. </view>
  21. <view class="table">
  22. <view class="head hflex acenter jbetween">
  23. <view class="text" style="width: 20%;">头像</view>
  24. <view class="text" style="width: 20%;">昵称</view>
  25. <view class="text" style="width: 50%;">时间</view>
  26. </view>
  27. <view class="item hflex acenter jbetween" v-for="(item,index) in list" :key="index">
  28. <view class="text hflex acenter jcenter" style="width: 20%;">
  29. <image :src="item.avatar" mode="aspectFill" class="avatar"></image>
  30. </view>
  31. <view class="text" style="width: 30%;">{{item.username}}</view>
  32. <view class="text" style="width: 40%;">{{item.createtime}}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <u-popup v-model="show" mode="bottom" :closeable="false" border-radius="20">
  37. <view class="popu">
  38. <view class="title">佣金说明</view>
  39. <view class="content">{{content}}</view>
  40. <button class="btn" @click="show = false">我知道了</button>
  41. </view>
  42. </u-popup>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. invite_list,
  48. get_agreement_detail,
  49. parent_info
  50. } from "@/units/inquire.js"
  51. export default {
  52. data() {
  53. return {
  54. page: 1,
  55. total: 0,
  56. list: [],
  57. sum: '',
  58. tabs: [{
  59. id: '1',
  60. name: '我的邀请人'
  61. },
  62. {
  63. id: '2',
  64. name: '上级邀请人'
  65. }
  66. ],
  67. tab_active: 0,
  68. content: '',
  69. show: false
  70. }
  71. },
  72. onLoad(options) {
  73. console.log(options.momey);
  74. this.sum = Number(options.money).toFixed(1)
  75. this.getlist()
  76. this.getconfig()
  77. },
  78. onReachBottom() {
  79. if (this.total != this.list.length) {
  80. this.page++
  81. this.getlist()
  82. }
  83. },
  84. methods: {
  85. getlist() {
  86. invite_list({
  87. page: this.page
  88. }).then((res) => {
  89. this.list = this.list.concat(res.data.data)
  90. this.total = res.data.total
  91. })
  92. },
  93. getdata() {
  94. parent_info().then((res) => {
  95. this.list = []
  96. this.list.push(res.data)
  97. })
  98. },
  99. getconfig() {
  100. get_agreement_detail({
  101. code: 'commission_balance'
  102. }).then((res) => {
  103. this.content = res.data.content
  104. })
  105. },
  106. changetab(index) {
  107. this.tab_active = index
  108. if (index == '0') {
  109. this.page = 1
  110. this.getlist()
  111. } else {
  112. this.getdata()
  113. }
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss">
  119. .web_box {
  120. padding: 18rpx 30rpx;
  121. .top {
  122. background: url('/pagesD/static/images/invite-bg.png') no-repeat;
  123. background-size: 100%;
  124. padding: 50rpx;
  125. .top_item {
  126. width: 50%;
  127. .num {
  128. font-size: 36rpx;
  129. font-family: JDZhengHT, JDZhengHT;
  130. font-weight: 400;
  131. color: #FFFFFF;
  132. padding: 0 0 28rpx;
  133. }
  134. .text {
  135. font-size: 24rpx;
  136. font-family: PingFangSC, PingFang SC;
  137. font-weight: 400;
  138. color: #FFFFFF;
  139. }
  140. }
  141. .top_item:nth-child(1) {
  142. border-right: 1rpx solid rgba(255, 255, 255, .2);
  143. }
  144. }
  145. .list {
  146. margin: 18rpx 0;
  147. background: #FFFFFF;
  148. border-radius: 20rpx;
  149. padding: 0 20rpx;
  150. .tabs {
  151. padding: 24rpx 0;
  152. .tabs_item {
  153. font-size: 30rpx;
  154. font-family: PingFangSC, PingFang SC;
  155. font-weight: 400;
  156. color: #444444;
  157. margin: 0 56rpx;
  158. }
  159. .tab_active {
  160. font-size: 30rpx;
  161. font-family: PingFangSC, PingFang SC;
  162. font-weight: 600;
  163. color: #141414;
  164. position: relative;
  165. }
  166. .tab_active::before {
  167. content: '';
  168. position: absolute;
  169. width: 44rpx;
  170. height: 8rpx;
  171. background: linear-gradient(270deg, #0C66C2 0%, #FFFFFF 100%);
  172. border-radius: 4rpx;
  173. bottom: 0;
  174. right: 0;
  175. opacity: 0.6;
  176. }
  177. }
  178. .table {
  179. .head {
  180. background: #F3F3F3;
  181. border-radius: 12rpx;
  182. padding: 16rpx 0;
  183. .text {
  184. font-size: 26rpx;
  185. font-family: PingFangTC, PingFangTC;
  186. font-weight: 400;
  187. color: #222222;
  188. text-align: center;
  189. }
  190. }
  191. .item {
  192. padding: 32rpx 0;
  193. border-bottom: 1px solid #F4F5F9;
  194. .text {
  195. font-size: 26rpx;
  196. font-family: PingFangTC, PingFangTC;
  197. font-weight: 400;
  198. color: #222222;
  199. word-wrap: break-word;
  200. }
  201. }
  202. .avatar {
  203. width: 60rpx;
  204. height: 60rpx;
  205. border-radius: 50%;
  206. }
  207. }
  208. }
  209. .popu {
  210. padding: 0 32rpx;
  211. .title {
  212. font-size: 36rpx;
  213. font-family: PingFangSC, PingFang SC;
  214. font-weight: 500;
  215. color: #222222;
  216. text-align: center;
  217. padding: 40rpx 0 28rpx;
  218. }
  219. .content {
  220. font-size: 26rpx;
  221. font-family: PingFangSC, PingFang SC;
  222. font-weight: 400;
  223. color: #444444;
  224. }
  225. .btn {
  226. margin: 58rpx 0;
  227. width: 686rpx;
  228. height: 92rpx;
  229. background: #0C66C2;
  230. border-radius: 20rpx;
  231. font-size: 36rpx;
  232. font-family: PingFangSC, PingFang SC;
  233. font-weight: 500;
  234. color: #FFFFFF;
  235. line-height: 92rpx;
  236. }
  237. }
  238. }
  239. </style>