裂变星小程序-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.

285 lines
6.4 KiB

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