team.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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>{{ childList.length }}</text>
  9. {{ $t('hea.ren') }}
  10. </view>
  11. <view class="renshu">{{ $t('hea.wdtdrs') }}</view>
  12. </view>
  13. </view>
  14. <view class="message">
  15. <view class="back-box" @click="back()" v-if="id != userInfo.id">{{ $t('hea.fh') }}</view>
  16. <view class="relation-box">
  17. <view class="relation">
  18. <view class="headbox">
  19. <view class="head">
  20. <view class="photo"><image v-if="avatar" :src="avatar || '/static/error/missing-face.png'"></image></view>
  21. </view>
  22. </view>
  23. <view class="information">
  24. <view class="name clamp">{{ name }}</view>
  25. <view class="cell clamp">{{ phone }}</view>
  26. </view>
  27. </view>
  28. <view class="sanchaji"><image src="../../static/img/sanchaji.png" mode=""></image></view>
  29. <view class="subordinate flex">
  30. <view class="subordinate-box" v-for="(item, index) in childList" @click="findChildren(item)">
  31. <view class="head1">
  32. <image :src="item.avatar || '/static/error/missing-face.png'" mode=""></image>
  33. <view class="" v-if="item.activity[0].my_join != null">
  34. <view class="vip" v-if="item.activity[0].my_join.status == '1'"><image src="../../static/img/cjyg.png" mode=""></image></view>
  35. </view>
  36. <view class="" v-if="item.activity[1].my_join != null">
  37. <view class="vip" v-if="item.activity[1].my_join.status == '1'"><image src="../../static/img/v1.png" mode=""></image></view>
  38. <view class="vip" v-if="item.activity[1].my_join.status == '2'"><image src="../../static/img/v2.png" mode=""></image></view>
  39. </view>
  40. </view>
  41. <view class="name clamp">{{ item.nickname }}</view>
  42. <view class="phone clamp">{{ item.mobile }}</view>
  43. </view>
  44. <template v-if="childList.length < 5">
  45. <view class="subordinate-box" v-for="item in 5 - childList.length">
  46. <view class="head1"></view>
  47. <view class="name clamp"></view>
  48. <view class="phone clamp"></view>
  49. </view>
  50. </template>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  58. import { children } from '@/api/user.js';
  59. import { mapState, mapMutations } from 'vuex';
  60. export default {
  61. components: {
  62. uniPopup
  63. },
  64. data() {
  65. return {
  66. name: '', //当前节点姓名
  67. phone: '', //当前节点手机号
  68. avatar: '', //当前节点头像
  69. id: '',
  70. childList: [], //当前节点的下级
  71. fatherList: []
  72. };
  73. },
  74. computed: {
  75. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  76. },
  77. onLoad() {
  78. uni.setNavigationBarTitle({
  79. title: this.$t('foo.wdtd')
  80. });
  81. console.log(this.userInfo);
  82. this.name = this.userInfo.nickname;
  83. this.phone = this.userInfo.mobile;
  84. this.avatar = this.userInfo.avatar;
  85. this.id = this.userInfo.id;
  86. this.loadData();
  87. },
  88. methods: {
  89. //返回
  90. loadData() {
  91. uni.showLoading({
  92. title: '加载中。。。',
  93. mask: true
  94. });
  95. const obj = this;
  96. children({}, this.id).then(({ data }) => {
  97. this.childList = data;
  98. console.log(data);
  99. uni.hideLoading()
  100. });
  101. },
  102. async findChildren(item) {
  103. //存father
  104. this.fatherList.push({
  105. name: this.name,
  106. phone: this.phone,
  107. avatar: this.avatar,
  108. id: this.id
  109. });
  110. //设置新father
  111. this.id = item.id;
  112. await this.loadData();
  113. this.name = item.nickname;
  114. this.phone = item.mobile;
  115. this.avatar = item.avatar;
  116. },
  117. back() {
  118. let father = this.fatherList.pop();
  119. this.name = father.name;
  120. this.phone = father.phone;
  121. this.avatar = father.avatar;
  122. this.id = father.id;
  123. this.loadData();
  124. }
  125. }
  126. };
  127. </script>
  128. <style lang="scss">
  129. page {
  130. padding: 0;
  131. margin: 0;
  132. height: 100%;
  133. background-color: #000;
  134. }
  135. .container {
  136. width: 750rpx;
  137. height: 400rpx;
  138. position: relative;
  139. .jiedianbackground {
  140. position: absolute;
  141. width: 750rpx;
  142. height: 400rpx;
  143. image {
  144. width: 100%;
  145. height: 100%;
  146. }
  147. }
  148. .number-box {
  149. width: 750rpx;
  150. height: 400rpx;
  151. position: absolute;
  152. display: flex;
  153. justify-content: center;
  154. flex-direction: column;
  155. align-items: center;
  156. .number {
  157. font-size: 30rpx;
  158. font-family: PingFang SC;
  159. font-weight: 500;
  160. color: #fad6b0;
  161. text {
  162. font-size: 72rpx;
  163. font-family: PingFang SC;
  164. font-weight: bold;
  165. line-height: 86rpx;
  166. }
  167. }
  168. .renshu {
  169. font-size: 30rpx;
  170. font-family: PingFang SC;
  171. font-weight: 500;
  172. color: #fad6b0;
  173. }
  174. }
  175. }
  176. .message {
  177. padding: 0 30rpx;
  178. position: relative;
  179. .back-box {
  180. width: 100rpx;
  181. height: 50rpx;
  182. border: 1px solid #fad6b0;
  183. // background-color: red;
  184. position: absolute;
  185. top: 0;
  186. right: 20rpx;
  187. color: #fad6b0;
  188. line-height: 50rpx;
  189. text-align: center;
  190. border-radius: 10rpx;
  191. font-size: 28rpx;
  192. z-index: 9;
  193. }
  194. .relation-box {
  195. margin-top: 100rpx;
  196. display: flex;
  197. flex-direction: column;
  198. align-items: center;
  199. .relation {
  200. position: relative;
  201. display: flex;
  202. align-items: center;
  203. .headbox {
  204. position: absolute;
  205. // width: 154rpx;
  206. // height: 154rpx;
  207. .head {
  208. width: 154rpx;
  209. height: 154rpx;
  210. background: #fff;
  211. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  212. border-radius: 50%;
  213. overflow: hidden;
  214. .photo {
  215. width: 154rpx;
  216. height: 154rpx;
  217. image {
  218. width: 100%;
  219. height: 100%;
  220. }
  221. }
  222. }
  223. .head-title {
  224. margin: -30rpx 30rpx 0 30rpx;
  225. width: 94rpx;
  226. height: 32rpx;
  227. image {
  228. width: 100%;
  229. height: 100%;
  230. }
  231. }
  232. // .head-name{
  233. // max-width: 100%;
  234. // font-size: 32rpx;
  235. // font-weight: bold;
  236. // color: #333333;
  237. // }
  238. // .head-phone{
  239. // font-size: 26rpx;
  240. // font-weight: 500;
  241. // color: #999999;
  242. // }
  243. }
  244. .information {
  245. margin-left: 77rpx;
  246. display: flex;
  247. padding: 20rpx 10rpx;
  248. flex-direction: column;
  249. width: 297rpx;
  250. height: 137rpx;
  251. background: linear-gradient(90deg, #393326, #27221d);
  252. border: 4rpx solid #fad6b0;
  253. border-radius: 10rpx;
  254. .name {
  255. text-align: left;
  256. margin-left: 70rpx;
  257. font-size: 32rpx;
  258. font-family: PingFang SC;
  259. font-weight: bold;
  260. color: #fad6b0;
  261. }
  262. .cell {
  263. text-align: left;
  264. margin-left: 70rpx;
  265. font-size: 26rpx;
  266. font-family: PingFang SC;
  267. font-weight: 500;
  268. color: #fad6b0;
  269. }
  270. }
  271. }
  272. .sanchaji {
  273. margin: 30rpx 0;
  274. width: 90%;
  275. height: 91rpx;
  276. image {
  277. width: 100%;
  278. height: 100%;
  279. }
  280. }
  281. .subordinate {
  282. width: 750rpx;
  283. display: flex;
  284. justify-content: flex-start;
  285. align-items: flex-start;
  286. .subordinate-box {
  287. flex: 1;
  288. display: flex;
  289. flex-direction: column;
  290. align-items: center;
  291. .head1 {
  292. position: relative;
  293. border-radius: 50%;
  294. background: #fff;
  295. width: 120rpx;
  296. height: 120rpx;
  297. .vip {
  298. position: absolute;
  299. bottom: 0;
  300. left: 10%;
  301. width: 94rpx;
  302. height: 32rpx;
  303. image {
  304. width: 100%;
  305. height: 100%;
  306. border-radius: 0;
  307. }
  308. }
  309. image {
  310. width: 100%;
  311. height: 100%;
  312. border-radius: 50%;
  313. }
  314. }
  315. .name {
  316. max-width: 120rpx;
  317. margin-top: 10rpx;
  318. font-size: 26rpx;
  319. font-family: PingFang SC;
  320. font-weight: bold;
  321. color: #ffffff;
  322. }
  323. .phone {
  324. max-width: 120rpx;
  325. margin-top: 10rpx;
  326. font-size: 22rpx;
  327. font-family: PingFang SC;
  328. font-weight: 500;
  329. color: #999999;
  330. }
  331. }
  332. }
  333. }
  334. .back {
  335. float: right;
  336. margin-top: 40rpx;
  337. display: flex;
  338. align-items: center;
  339. justify-content: center;
  340. image {
  341. width: 24rpx;
  342. height: 23rpx;
  343. }
  344. width: 104rpx;
  345. height: 39rpx;
  346. border: 2rpx solid #6eab4e;
  347. border-radius: 7rpx;
  348. font-size: 24rpx;
  349. font-family: PingFang SC;
  350. font-weight: 500;
  351. color: #6eab4e;
  352. }
  353. }
  354. </style>