team.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <view class="content">
  3. <!-- 头部 -->
  4. <view class="container">
  5. <view class="jiedianbackground"><image src="../../static/img/jiedian.png" mode=""></image></view>
  6. <view class="number-box">
  7. <view class="number">
  8. <text>100</text>
  9. </view>
  10. <view class="renshu">我的团队人数</view>
  11. </view>
  12. </view>
  13. <view class="message">
  14. <!-- <view class="back" @click="navBack()" v-if="parentList.length > 0">
  15. <image src="../../static/img/zhengyi10.png" mode=""></image>
  16. 返回
  17. </view> -->
  18. <view class="relation-box">
  19. <view class="relation">
  20. <view class="headbox">
  21. <view class="head">
  22. <view class="photo"><image v-if="avatar" :src="avatar || '/static/error/missing-face.png'"></image></view>
  23. </view>
  24. </view>
  25. <view class="information">
  26. <view class="name clamp">{{ name }}</view>
  27. <view class="cell clamp">{{ phone }}</view>
  28. </view>
  29. </view>
  30. <view class="sanchaji"><image src="../../static/img/sanchaji.png" mode=""></image></view>
  31. <view class="subordinate flex">
  32. <view class="subordinate-box" v-for="(item, index) in childList">
  33. <view class="head"><image :src="item.avter || '/static/error/missing-face.png'" mode=""></image></view>
  34. <view class="name clamp">{{ item.name }}</view>
  35. <view class="phone clamp">{{ item.phone }}</view>
  36. </view>
  37. <template v-if="childList.length < 5">
  38. <view class="subordinate-box" v-for="item in (5-childList.length)">
  39. <view class="head"></view>
  40. <view class="name clamp"></view>
  41. <view class="phone clamp"></view>
  42. </view>
  43. </template>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  51. import { children } from '@/api/user.js';
  52. import { mapState, mapMutations } from 'vuex';
  53. export default {
  54. components: {
  55. uniPopup
  56. },
  57. data() {
  58. return {
  59. name: '', //当前节点姓名
  60. phone: '', //当前节点手机号
  61. avatar: '', //当前节点头像
  62. id: '',
  63. childList: [] //当前节点的下级
  64. };
  65. },
  66. computed: {
  67. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  68. },
  69. onLoad() {
  70. this.name = this.userInfo.nickname;
  71. this.phone = this.userInfo.phone;
  72. this.avatar = this.userInfo.avatar;
  73. this.id = this.userInfo.id;
  74. this.loadData();
  75. },
  76. methods: {
  77. //返回
  78. loadData() {
  79. const obj = this;
  80. children({},this.id).then(({data}) =>{
  81. this.childList = data
  82. console.log(data)
  83. })
  84. }
  85. }
  86. };
  87. </script>
  88. <style lang="scss">
  89. page {
  90. padding: 0;
  91. margin: 0;
  92. height: 100%;
  93. background-color: #000;
  94. }
  95. .container {
  96. width: 750rpx;
  97. height: 400rpx;
  98. position: relative;
  99. .jiedianbackground {
  100. position: absolute;
  101. width: 750rpx;
  102. height: 400rpx;
  103. image {
  104. width: 100%;
  105. height: 100%;
  106. }
  107. }
  108. .number-box {
  109. width: 750rpx;
  110. height: 400rpx;
  111. position: absolute;
  112. display: flex;
  113. justify-content: center;
  114. flex-direction: column;
  115. align-items: center;
  116. .number {
  117. font-size: 30rpx;
  118. font-family: PingFang SC;
  119. font-weight: 500;
  120. color: #fad6b0;
  121. text {
  122. font-size: 72rpx;
  123. font-family: PingFang SC;
  124. font-weight: bold;
  125. line-height: 86rpx;
  126. }
  127. }
  128. .renshu {
  129. font-size: 30rpx;
  130. font-family: PingFang SC;
  131. font-weight: 500;
  132. color: #fad6b0;
  133. }
  134. }
  135. }
  136. .message {
  137. padding: 0 30rpx;
  138. .relation-box {
  139. margin-top: 100rpx;
  140. display: flex;
  141. flex-direction: column;
  142. align-items: center;
  143. .relation {
  144. position: relative;
  145. display: flex;
  146. align-items: center;
  147. .headbox {
  148. position: absolute;
  149. // width: 154rpx;
  150. // height: 154rpx;
  151. .head {
  152. width: 154rpx;
  153. height: 154rpx;
  154. background: #fff;
  155. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  156. border-radius: 50%;
  157. overflow: hidden;
  158. .photo {
  159. width: 154rpx;
  160. height: 154rpx;
  161. image {
  162. width: 100%;
  163. height: 100%;
  164. }
  165. }
  166. }
  167. .head-title {
  168. margin: -30rpx 30rpx 0 30rpx;
  169. width: 94rpx;
  170. height: 32rpx;
  171. image {
  172. width: 100%;
  173. height: 100%;
  174. }
  175. }
  176. // .head-name{
  177. // max-width: 100%;
  178. // font-size: 32rpx;
  179. // font-weight: bold;
  180. // color: #333333;
  181. // }
  182. // .head-phone{
  183. // font-size: 26rpx;
  184. // font-weight: 500;
  185. // color: #999999;
  186. // }
  187. }
  188. .information {
  189. margin-left: 77rpx;
  190. display: flex;
  191. padding: 20rpx 10rpx;
  192. flex-direction: column;
  193. width: 297rpx;
  194. height: 137rpx;
  195. background: linear-gradient(90deg, #393326, #27221d);
  196. border: 4rpx solid #fad6b0;
  197. border-radius: 10rpx;
  198. .name {
  199. text-align: left;
  200. margin-left: 70rpx;
  201. font-size: 32rpx;
  202. font-family: PingFang SC;
  203. font-weight: bold;
  204. color: #fad6b0;
  205. }
  206. .cell {
  207. text-align: left;
  208. margin-left: 70rpx;
  209. font-size: 26rpx;
  210. font-family: PingFang SC;
  211. font-weight: 500;
  212. color: #fad6b0;
  213. }
  214. }
  215. }
  216. .sanchaji {
  217. margin: 30rpx 0;
  218. width: 90%;
  219. height: 91rpx;
  220. image {
  221. width: 100%;
  222. height: 100%;
  223. }
  224. }
  225. .subordinate {
  226. width: 750rpx;
  227. display: flex;
  228. justify-content: flex-start;
  229. align-items: flex-start;
  230. .subordinate-box {
  231. flex: 1;
  232. display: flex;
  233. flex-direction: column;
  234. align-items: center;
  235. .head {
  236. border-radius: 50%;
  237. background: #fff;
  238. width: 120rpx;
  239. height: 120rpx;
  240. image {
  241. width: 100%;
  242. height: 100%;
  243. }
  244. }
  245. .name {
  246. max-width: 120rpx;
  247. margin-top: 10rpx;
  248. font-size: 26rpx;
  249. font-family: PingFang SC;
  250. font-weight: bold;
  251. color: #FFFFFF;
  252. }
  253. .phone {
  254. max-width: 120rpx;
  255. margin-top: 10rpx;
  256. font-size: 22rpx;
  257. font-family: PingFang SC;
  258. font-weight: 500;
  259. color: #999999;
  260. }
  261. }
  262. }
  263. }
  264. .back {
  265. float: right;
  266. margin-top: 40rpx;
  267. display: flex;
  268. align-items: center;
  269. justify-content: center;
  270. image {
  271. width: 24rpx;
  272. height: 23rpx;
  273. }
  274. width: 104rpx;
  275. height: 39rpx;
  276. border: 2rpx solid #6eab4e;
  277. border-radius: 7rpx;
  278. font-size: 24rpx;
  279. font-family: PingFang SC;
  280. font-weight: 500;
  281. color: #6eab4e;
  282. }
  283. }
  284. </style>