team.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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. const obj = this;
  92. children({}, this.id).then(({ data }) => {
  93. this.childList = data;
  94. console.log(data);
  95. });
  96. },
  97. async findChildren(item) {
  98. //存father
  99. this.fatherList.push({
  100. name: this.name,
  101. phone: this.phone,
  102. avatar: this.avatar,
  103. id: this.id
  104. });
  105. //设置新father
  106. this.id = item.id;
  107. await this.loadData();
  108. this.name = item.nickname;
  109. this.phone = item.mobile;
  110. this.avatar = item.avatar;
  111. },
  112. back() {
  113. let father = this.fatherList.pop();
  114. this.name = father.name;
  115. this.phone = father.phone;
  116. this.avatar = father.avatar;
  117. this.id = father.id;
  118. this.loadData();
  119. }
  120. }
  121. };
  122. </script>
  123. <style lang="scss">
  124. page {
  125. padding: 0;
  126. margin: 0;
  127. height: 100%;
  128. background-color: #000;
  129. }
  130. .container {
  131. width: 750rpx;
  132. height: 400rpx;
  133. position: relative;
  134. .jiedianbackground {
  135. position: absolute;
  136. width: 750rpx;
  137. height: 400rpx;
  138. image {
  139. width: 100%;
  140. height: 100%;
  141. }
  142. }
  143. .number-box {
  144. width: 750rpx;
  145. height: 400rpx;
  146. position: absolute;
  147. display: flex;
  148. justify-content: center;
  149. flex-direction: column;
  150. align-items: center;
  151. .number {
  152. font-size: 30rpx;
  153. font-family: PingFang SC;
  154. font-weight: 500;
  155. color: #fad6b0;
  156. text {
  157. font-size: 72rpx;
  158. font-family: PingFang SC;
  159. font-weight: bold;
  160. line-height: 86rpx;
  161. }
  162. }
  163. .renshu {
  164. font-size: 30rpx;
  165. font-family: PingFang SC;
  166. font-weight: 500;
  167. color: #fad6b0;
  168. }
  169. }
  170. }
  171. .message {
  172. padding: 0 30rpx;
  173. position: relative;
  174. .back-box {
  175. width: 100rpx;
  176. height: 50rpx;
  177. border: 1px solid #fad6b0;
  178. // background-color: red;
  179. position: absolute;
  180. top: 0;
  181. right: 20rpx;
  182. color: #fad6b0;
  183. line-height: 50rpx;
  184. text-align: center;
  185. border-radius: 10rpx;
  186. font-size: 28rpx;
  187. z-index: 9;
  188. }
  189. .relation-box {
  190. margin-top: 100rpx;
  191. display: flex;
  192. flex-direction: column;
  193. align-items: center;
  194. .relation {
  195. position: relative;
  196. display: flex;
  197. align-items: center;
  198. .headbox {
  199. position: absolute;
  200. // width: 154rpx;
  201. // height: 154rpx;
  202. .head {
  203. width: 154rpx;
  204. height: 154rpx;
  205. background: #fff;
  206. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  207. border-radius: 50%;
  208. overflow: hidden;
  209. .photo {
  210. width: 154rpx;
  211. height: 154rpx;
  212. image {
  213. width: 100%;
  214. height: 100%;
  215. }
  216. }
  217. }
  218. .head-title {
  219. margin: -30rpx 30rpx 0 30rpx;
  220. width: 94rpx;
  221. height: 32rpx;
  222. image {
  223. width: 100%;
  224. height: 100%;
  225. }
  226. }
  227. // .head-name{
  228. // max-width: 100%;
  229. // font-size: 32rpx;
  230. // font-weight: bold;
  231. // color: #333333;
  232. // }
  233. // .head-phone{
  234. // font-size: 26rpx;
  235. // font-weight: 500;
  236. // color: #999999;
  237. // }
  238. }
  239. .information {
  240. margin-left: 77rpx;
  241. display: flex;
  242. padding: 20rpx 10rpx;
  243. flex-direction: column;
  244. width: 297rpx;
  245. height: 137rpx;
  246. background: linear-gradient(90deg, #393326, #27221d);
  247. border: 4rpx solid #fad6b0;
  248. border-radius: 10rpx;
  249. .name {
  250. text-align: left;
  251. margin-left: 70rpx;
  252. font-size: 32rpx;
  253. font-family: PingFang SC;
  254. font-weight: bold;
  255. color: #fad6b0;
  256. }
  257. .cell {
  258. text-align: left;
  259. margin-left: 70rpx;
  260. font-size: 26rpx;
  261. font-family: PingFang SC;
  262. font-weight: 500;
  263. color: #fad6b0;
  264. }
  265. }
  266. }
  267. .sanchaji {
  268. margin: 30rpx 0;
  269. width: 90%;
  270. height: 91rpx;
  271. image {
  272. width: 100%;
  273. height: 100%;
  274. }
  275. }
  276. .subordinate {
  277. width: 750rpx;
  278. display: flex;
  279. justify-content: flex-start;
  280. align-items: flex-start;
  281. .subordinate-box {
  282. flex: 1;
  283. display: flex;
  284. flex-direction: column;
  285. align-items: center;
  286. .head1 {
  287. position: relative;
  288. border-radius: 50%;
  289. background: #fff;
  290. width: 120rpx;
  291. height: 120rpx;
  292. .vip {
  293. position: absolute;
  294. bottom: 0;
  295. left: 10%;
  296. width: 94rpx;
  297. height: 32rpx;
  298. image {
  299. width: 100%;
  300. height: 100%;
  301. border-radius: 0;
  302. }
  303. }
  304. image {
  305. width: 100%;
  306. height: 100%;
  307. border-radius: 50%;
  308. }
  309. }
  310. .name {
  311. max-width: 120rpx;
  312. margin-top: 10rpx;
  313. font-size: 26rpx;
  314. font-family: PingFang SC;
  315. font-weight: bold;
  316. color: #ffffff;
  317. }
  318. .phone {
  319. max-width: 120rpx;
  320. margin-top: 10rpx;
  321. font-size: 22rpx;
  322. font-family: PingFang SC;
  323. font-weight: 500;
  324. color: #999999;
  325. }
  326. }
  327. }
  328. }
  329. .back {
  330. float: right;
  331. margin-top: 40rpx;
  332. display: flex;
  333. align-items: center;
  334. justify-content: center;
  335. image {
  336. width: 24rpx;
  337. height: 23rpx;
  338. }
  339. width: 104rpx;
  340. height: 39rpx;
  341. border: 2rpx solid #6eab4e;
  342. border-radius: 7rpx;
  343. font-size: 24rpx;
  344. font-family: PingFang SC;
  345. font-weight: 500;
  346. color: #6eab4e;
  347. }
  348. }
  349. </style>