裂变星小程序-25.03.04
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

281 lines
6.2 KiB

  1. <template>
  2. <view class="page">
  3. <navbar title="分销" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="content">
  5. <view class="overview">
  6. <view class="title">我的推荐人</view>
  7. <view class="card flex referrer">
  8. <image class="avatar" :src="userInfoVip.pidInfo.headImage"></image>
  9. <view class="referrer-info">
  10. <view>
  11. <view class="nick-name">{{ userInfoVip.pidInfo.nickName }}</view>
  12. <view>{{ `ID:${userInfoVip.pidInfo.id}` }}</view>
  13. </view>
  14. <view>
  15. <view class="phone-label">手机号</view>
  16. <view>{{ userInfoVip.pidInfo.phone }}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="summary">
  21. <image class="bg" src="../static/center/overview-bg.png"></image>
  22. <view class="flex flex-column summary-info">
  23. <view class="flex summary-info-total">
  24. <view class="flex flex-column">
  25. <view class="value">{{ userInfoVip.user_sum }}</view>
  26. <view class="label">推荐总人数</view>
  27. </view>
  28. </view>
  29. <view class="flex summary-info-detail">
  30. <view class="flex flex-column">
  31. <view class="label">直接推荐</view>
  32. <view class="value">{{ userInfoVip.j_sum }}</view>
  33. </view>
  34. <view class="flex flex-column">
  35. <view class="label">间接推荐</view>
  36. <view class="value">{{ userInfoVip.z_sum }}</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="card" style="padding: 20rpx 10rpx 11rpx 0;">
  43. <uv-tabs :list="tabs"
  44. :inactiveStyle="{
  45. color: '#999999',
  46. fontSize: '30rpx',
  47. fontWeight: 500,
  48. whiteSpace: 'nowrap',
  49. }"
  50. :activeStyle="{
  51. color: '#1B1B1B',
  52. fontSize: '38rpx',
  53. fontWeight: 900,
  54. whiteSpace: 'nowrap',
  55. }"
  56. lineHeight="13rpx"
  57. lineWidth="77rpx"
  58. :lineColor="`url(${sliderBgUrl}) 100% 100%`"
  59. :scrollable="false"
  60. @click="clickTabs"
  61. >
  62. <template v-slot:right>
  63. <suspendDropdown
  64. v-model="queryParams.role"
  65. :options="roleOptions"
  66. @change="onRoleChange"
  67. ></suspendDropdown>
  68. </template>
  69. </uv-tabs>
  70. </view>
  71. <view class="card flex list-item"
  72. v-for="item in list"
  73. :key="item.id"
  74. >
  75. <image class="avatar" :src="item.headImage"></image>
  76. <view class="flex" style="flex: 1; justify-content: space-between;">
  77. <view class="flex flex-column left">
  78. <view class="highlight">{{ item.nickName }}</view>
  79. <view>{{ getRoleDesc(item.role) }}</view>
  80. </view>
  81. <view class="flex flex-column right">
  82. <view>{{ $dayjs(item.createTime).format('HH:mm:ss') }}</view>
  83. <view>{{ $dayjs(item.createDate).format('YYYY-MM-DD') }}</view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. import { mapState } from 'vuex'
  92. import mixinsList from '@/mixins/list.js'
  93. import suspendDropdown from '@/components/base/suspendDropdown.vue'
  94. export default {
  95. mixins : [mixinsList],
  96. components: {
  97. suspendDropdown,
  98. },
  99. data() {
  100. return {
  101. tabs: [{
  102. name: '直接推荐'
  103. },
  104. {
  105. name: '间接推荐'
  106. },
  107. ],
  108. roleOptions: [
  109. {
  110. label: '普通会员',
  111. value: 0,
  112. },
  113. {
  114. label: '代理商',
  115. value: 1,
  116. },
  117. ],
  118. queryParams: {
  119. pageNo: 1,
  120. pageSize: 10,
  121. state: 0,
  122. },
  123. // todo
  124. sliderBgUrl: '',
  125. mixinsListApi : 'getUserInfoVipList',
  126. }
  127. },
  128. computed: {
  129. ...mapState(['userInfo', 'userInfoVip']),
  130. },
  131. onShow() {
  132. this.$store.commit('getUserInfoVip')
  133. },
  134. methods: {
  135. getRoleDesc(role) {
  136. return this.roleOptions.find(item => item.value == role)?.label
  137. },
  138. //点击tab栏
  139. clickTabs(e) {
  140. this.queryParams.state = e.index
  141. this.queryParams.pageNo = 1
  142. this.queryParams.pageSize = 10
  143. this.getData()
  144. },
  145. onRoleChange(role) {
  146. if (role === null) {
  147. delete this.queryParams.role
  148. } else {
  149. this.queryParams.role = role
  150. }
  151. this.getData()
  152. }
  153. },
  154. }
  155. </script>
  156. <style scoped lang="scss">
  157. .page {
  158. background-color: $uni-bg-color;
  159. }
  160. .content {
  161. padding: 20rpx;
  162. }
  163. .overview {
  164. & > .title {
  165. color: #1B1B1B;
  166. font-size: 24rpx;
  167. }
  168. .referrer {
  169. color: #999999;
  170. font-size: 24rpx;
  171. padding: 20rpx;
  172. margin-top: 20rpx;
  173. .avatar {
  174. width: 84rpx;
  175. height: 84rpx;
  176. border-radius: 50%;
  177. margin-right: 20rpx;
  178. }
  179. &-info {
  180. flex: 1;
  181. display: inline-flex;
  182. align-items: center;
  183. justify-content: space-between;
  184. }
  185. .nick-name {
  186. color: #1B1B1B;
  187. font-size: 32rpx;
  188. font-weight: 700;
  189. }
  190. .phone-label {
  191. color: #1B1B1B;
  192. text-align: right;
  193. }
  194. }
  195. .summary {
  196. margin-top: 20rpx;
  197. position: relative;
  198. width: 100%;
  199. height: 373rpx;
  200. color: #04D6A3;
  201. & > .bg {
  202. width: 100%;
  203. height: 100%;
  204. }
  205. &-info {
  206. position: absolute;
  207. top: 0;
  208. left: 0;
  209. justify-content: space-between;
  210. width: 100%;
  211. height: 100%;
  212. padding: 32rpx 78rpx;
  213. box-sizing: border-box;
  214. &-detail {
  215. width: 100%;
  216. justify-content: space-between;
  217. }
  218. }
  219. .label {
  220. font-size: 24rpx;
  221. font-weight: 500;
  222. }
  223. .value {
  224. font-size: 78rpx;
  225. font-weight: 900;
  226. }
  227. }
  228. }
  229. .card {
  230. margin-top: 20rpx;
  231. }
  232. .list {
  233. &-item {
  234. color: #999999;
  235. font-size: 24rpx;
  236. .left {
  237. align-items: flex-start;
  238. }
  239. .right {
  240. align-items: flex-end;
  241. }
  242. .highlight {
  243. color: #1B1B1B;
  244. font-size: 32rpx;
  245. font-weight: 800;
  246. }
  247. .avatar {
  248. width: 84rpx;
  249. height: 84rpx;
  250. border-radius: 50%;
  251. margin-right: 20rpx;
  252. }
  253. }
  254. }
  255. </style>