partner.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="container">
  3. <view class="partner">
  4. <image
  5. class="top-bg"
  6. :src="$mConfig.staticUrl + '/distribution-top-bg.png'"
  7. ></image>
  8. <view class="userInfo">
  9. <view class="u-plr30">
  10. <view class="head u-flex-sb">
  11. <view class="u-flex">
  12. <image
  13. v-if="accountInfo.head_photo"
  14. :src="accountInfo.head_photo"
  15. ></image>
  16. <image v-else :src="$defaultAvatar()" mode=""></image>
  17. <view class="u-ml30 u-mt10">
  18. <view class="u-font30 u-1A1A1A nickname u-text1">{{
  19. accountInfo.nickname
  20. }}</view>
  21. </view>
  22. </view>
  23. <view class="u-font24 u-999 u-mt10"
  24. >直接伙伴:<text class="u-FF0000">{{ num }}</text
  25. >人
  26. </view>
  27. </view>
  28. </view>
  29. <view class="partner-list">
  30. <image
  31. class="partner-bg"
  32. :src="$mConfig.staticUrl + '/partner-bg.png'"
  33. ></image>
  34. <view class="position-ab">
  35. <view v-if="partnerList.length > 0">
  36. <view
  37. class="item u-plr30"
  38. v-for="(item, index) in partnerList"
  39. :key="item.id"
  40. >
  41. <view class="u-flex u-border-one-one pd44">
  42. <image
  43. class="u-avatar106"
  44. v-if="item.head_photo"
  45. :src="item.head_photo"
  46. ></image>
  47. <image
  48. class="u-avatar106"
  49. v-else
  50. :src="$defaultAvatar()"
  51. ></image>
  52. <view class="u-font24 u-999">
  53. <view class="u-font28 u-1A1A1A ht36 u-text-width">{{
  54. item.nickname
  55. }}</view>
  56. <view>
  57. <rich-text
  58. :nodes="'*******' + $mUtil.cutOut(item.mobile)"
  59. ></rich-text>
  60. </view>
  61. <view>绑定时间:{{ item.register_time }}</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view
  67. class="nogoods u-mt30 u-flex-column-center"
  68. v-if="partnerList.length == 0"
  69. >
  70. <nodata :config="{ top: 5, content: '暂无数据~' }"></nodata>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script setup>
  79. import { ref } from "vue";
  80. import { onLoad } from "@dcloudio/uni-app";
  81. const num = ref(0);
  82. const partnerList = ref([]);
  83. const accountInfo = ref({});
  84. onLoad(() => {
  85. //获取用户信息
  86. uni.$http.get("/account/getAccountInfo").then((res) => {
  87. if (res && res.code == 200) {
  88. accountInfo.value = res.data;
  89. }
  90. });
  91. //获取伙伴列表
  92. uni.$http.get("/account/myPartner").then((res) => {
  93. if (res && res.code == 200) {
  94. num.value = res.num;
  95. partnerList.value = res.data;
  96. }
  97. });
  98. });
  99. </script>
  100. <style lang="scss">
  101. .nickname {
  102. width: 300rpx;
  103. }
  104. .u-flex-sb {
  105. display: flex;
  106. justify-content: space-between;
  107. }
  108. .ht36 {
  109. height: 36rpx;
  110. line-height: 36rpx;
  111. }
  112. .partner {
  113. position: relative;
  114. .top-bg {
  115. width: 100%;
  116. height: 238rpx;
  117. }
  118. .userInfo {
  119. position: absolute;
  120. top: 68rpx;
  121. width: 100%;
  122. .head {
  123. background-color: #fffaee;
  124. padding: 40rpx 30rpx 36rpx;
  125. border-radius: 20rpx;
  126. z-index: -1;
  127. image {
  128. width: 106rpx;
  129. height: 106rpx;
  130. border: 4rpx solid #ffffff;
  131. border-radius: 50%;
  132. }
  133. }
  134. }
  135. .partner-list {
  136. margin-top: -48rpx;
  137. position: relative;
  138. .partner-bg {
  139. height: 70vh;
  140. width: 100%;
  141. }
  142. .position-ab {
  143. position: absolute;
  144. top: 50rpx;
  145. width: 100%;
  146. }
  147. .pd44 {
  148. padding: 44rpx 0rpx;
  149. }
  150. }
  151. }
  152. </style>