team.vue 7.9 KB

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