myjiedian.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <template>
  2. <view class="content">
  3. <view class="status_bar"><!-- 这里是状态栏 --></view>
  4. <!-- 头部 -->
  5. <view class="container">
  6. <view class="body-title">
  7. <view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
  8. <view class="header">互助团队</view>
  9. </view>
  10. <view class="jiedianbackground"><image src="../../static/img/myJ-bg.png" mode=""></image></view>
  11. <view class="number-box">
  12. <view class="number">
  13. <text>{{ 100 }}</text>
  14. </view>
  15. <view class="renshu">我的互助团队人数</view>
  16. </view>
  17. </view>
  18. <view class="message">
  19. <view class="yeji">
  20. <view class="yeji-a">
  21. <view class="yeji-buttom">8000</view>
  22. <view class="yeji-top">收益</view>
  23. </view>
  24. <view class="border"></view>
  25. <view class="yeji-a">
  26. <view class="yeji-buttom">8000</view>
  27. <view class="yeji-top">支出</view>
  28. </view>
  29. </view>
  30. <view class="back" @click="navBack()" v-if="parentList.length > 0">
  31. <image src="../../static/img/zhengyi10.png" mode=""></image>
  32. 返回
  33. </view>
  34. <view class="relation-box">
  35. <view class="relation">
  36. <view class="headbox">
  37. <view class="head">
  38. <view class="photo"><image v-if="avatar" :src="avatar"></image></view>
  39. </view>
  40. </view>
  41. <view class="information">
  42. <view class="name clamp">{{ name }}</view>
  43. <view class="cell clamp">{{ phone }}</view>
  44. </view>
  45. </view>
  46. <view class="sanchaji"><image src="../../static/img/sanchaji.png" mode=""></image></view>
  47. <view class="subordinate">
  48. <view class="headbox" v-if="listA" @click="nav('a')">
  49. <view class="head">
  50. <view class="photo"><image v-if="listA.avatar" :src="listA.avatar" mode="scaleToFill"></image></view>
  51. </view>
  52. <view class="head-name">{{ listA.nickname }}</view>
  53. <view class="head-phone">{{ listA.phone }}</view>
  54. </view>
  55. <view class="zhuce" v-else @click="open('A')"><view class="jia"></view></view>
  56. <view class="headbox" v-if="listB" @click="nav('b')">
  57. <view class="head">
  58. <view class="photo"><image :key="listB.id" :src="listB.avatar" mode="scaleToFill"></image></view>
  59. </view>
  60. <view class="head-name">{{ listB.nickname }}</view>
  61. <view class="head-phone">{{ listB.phone }}</view>
  62. </view>
  63. <view class="zhuce" v-else @click="open('B')"><view class="jia"></view></view>
  64. <view class="headbox" v-if="listC" @click="nav('c')">
  65. <view class="head">
  66. <view class="photo"><image v-if="listC.avatar" :src="listC.avatar" mode="scaleToFill"></image></view>
  67. </view>
  68. <view class="head-name">{{ listC.nickname }}</view>
  69. <view class="head-phone">{{ listC.phone }}</view>
  70. </view>
  71. <view class="zhuce" v-else @click="open('C')"><view class="jia"></view></view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import { getjiedian, getReferralList, addJiedian } from '@/api/user.js';
  79. import { mapState, mapMutations } from 'vuex';
  80. export default {
  81. data() {
  82. return {
  83. bianhao: '1',
  84. a: 1,
  85. b: 2,
  86. c: 3,
  87. listA: '', //节点A
  88. listB: '', //节点B
  89. listC: '', //节点C
  90. name: '', //当前节点姓名
  91. phone: '', //当前节点手机号
  92. avatar: '', //当前节点头像
  93. id: '',
  94. uid: '',
  95. jiedianList: [],
  96. parentList: [], //保存打开层级用户数据
  97. parent_area: ''
  98. };
  99. },
  100. computed: {
  101. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  102. },
  103. onLoad() {
  104. this.name = this.userInfo.nickname;
  105. this.phone = this.userInfo.phone;
  106. this.avatar = this.userInfo.avatar;
  107. this.id = this.userInfo.uid;
  108. // this.loadData();
  109. },
  110. methods: {
  111. // 点击返回 我的页面
  112. toBack() {
  113. uni.navigateBack({
  114. })
  115. },
  116. //切换按钮
  117. radio(e) {
  118. this.bianhao = e;
  119. },
  120. //返回
  121. navBack() {
  122. const obj = this;
  123. // 删除
  124. let parent = obj.parentList.pop();
  125. console.log(parent);
  126. console.log(obj.parentList, 'navBack');
  127. // 保存回退后数据对象
  128. obj.name = parent.name;
  129. obj.avatar = parent.avatar;
  130. obj.id = parent.id;
  131. obj.listA = obj.listB = obj.listC = '';
  132. console.log(parent, '对象');
  133. obj.loadData();
  134. },
  135. loadData() {
  136. const obj = this;
  137. uni.showLoading({
  138. title: '加载中。。。',
  139. mask: true
  140. });
  141. getjiedian({}, this.id)
  142. .then(({ data }) => {
  143. uni.hideLoading();
  144. if (data.list.length != 0) {
  145. data.list.forEach(e => {
  146. console.log('e', e);
  147. let item = '';
  148. if (e.parent_area == 'A') {
  149. item = 'listA';
  150. } else if (e.parent_area == 'B') {
  151. item = 'listB';
  152. } else if (e.parent_area == 'C') {
  153. item = 'listC';
  154. }
  155. obj[item] = e;
  156. console.log(obj, '当前数据');
  157. });
  158. } else {
  159. return;
  160. }
  161. })
  162. .catch(e => {
  163. uni.hideLoading();
  164. });
  165. },
  166. nav(type) {
  167. const obj = this;
  168. // 保存当前选中的对象
  169. let item = '';
  170. if (type == 'a') {
  171. item = 'listA';
  172. } else {
  173. if (type == 'b') {
  174. item = 'listB';
  175. } else if (type == 'c') {
  176. item = 'listC';
  177. }
  178. }
  179. obj.parentList.push({
  180. name: obj.name,
  181. phone: obj.phone,
  182. avatar: obj.avatar,
  183. id: obj.id
  184. });
  185. console.log(obj.parentList, 's');
  186. obj.name = obj[item].nickname;
  187. obj.phone = obj[item].phone;
  188. obj.avatar = '';
  189. obj.$nextTick(function() {
  190. obj.avatar = obj[item].avatar;
  191. obj.id = obj[item].uid;
  192. obj.listA = '';
  193. obj.listB = '';
  194. obj.listC = '';
  195. obj.loadData();
  196. });
  197. }
  198. }
  199. };
  200. </script>
  201. <style lang="scss">
  202. page {
  203. padding: 0;
  204. margin: 0;
  205. height: 100%;
  206. background-color: #ffffff;
  207. }
  208. .status_bar {
  209. height: var(--status-bar-height);
  210. width: 100%;
  211. }
  212. .container {
  213. width: 750rpx;
  214. height: 460rpx;
  215. position: relative;
  216. .jiedianbackground {
  217. position: absolute;
  218. top: 0;
  219. left: 0;
  220. right: 0;
  221. width: 750rpx;
  222. height: 460rpx;
  223. image {
  224. width: 100%;
  225. height: 100%;
  226. }
  227. }
  228. .body-title {
  229. height: 80rpx;
  230. text-align: center;
  231. font-size: 35rpx;
  232. position: relative;
  233. .header {
  234. position: absolute;
  235. left: 0;
  236. top: 0;
  237. width: 100%;
  238. font-size: 36rpx;
  239. font-family: PingFang SC;
  240. font-weight: bold;
  241. color: #fffeff;
  242. height: 80rpx;
  243. font-size: 36rpx;
  244. font-weight: 700;
  245. z-index: 9;
  246. display: flex;
  247. justify-content: center;
  248. align-items: center;
  249. }
  250. .goback-box {
  251. position: absolute;
  252. left: 18rpx;
  253. top: 0;
  254. height: 80rpx;
  255. display: flex;
  256. align-items: center;
  257. }
  258. .goback {
  259. z-index: 100;
  260. width: 34rpx;
  261. height: 34rpx;
  262. }
  263. }
  264. .number-box {
  265. margin-top: 100rpx;
  266. width: 750rpx;
  267. height: 400rpx;
  268. position: absolute;
  269. display: flex;
  270. flex-direction: column;
  271. align-items: center;
  272. .number {
  273. font-size: 30rpx;
  274. font-family: PingFang SC;
  275. font-weight: 500;
  276. color: #ffffff;
  277. text {
  278. font-size: 72rpx;
  279. font-family: PingFang SC;
  280. font-weight: bold;
  281. color: #ffffff;
  282. line-height: 86rpx;
  283. }
  284. }
  285. .renshu {
  286. font-size: 30rpx;
  287. font-family: PingFang SC;
  288. font-weight: 500;
  289. color: #ffffff;
  290. }
  291. }
  292. }
  293. .message {
  294. padding: 0 30rpx;
  295. .relation-box {
  296. margin-top: 100rpx;
  297. display: flex;
  298. flex-direction: column;
  299. align-items: center;
  300. .relation {
  301. position: relative;
  302. display: flex;
  303. align-items: center;
  304. .headbox {
  305. position: absolute;
  306. // width: 154rpx;
  307. // height: 154rpx;
  308. .head {
  309. width: 154rpx;
  310. height: 154rpx;
  311. background: #2e58ff;
  312. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  313. border-radius: 50%;
  314. overflow: hidden;
  315. .photo {
  316. width: 154rpx;
  317. height: 154rpx;
  318. image {
  319. width: 100%;
  320. height: 100%;
  321. }
  322. }
  323. }
  324. .head-title {
  325. margin: -30rpx 30rpx 0 30rpx;
  326. width: 94rpx;
  327. height: 32rpx;
  328. image {
  329. width: 100%;
  330. height: 100%;
  331. }
  332. }
  333. // .head-name{
  334. // max-width: 100%;
  335. // font-size: 32rpx;
  336. // font-weight: bold;
  337. // color: #333333;
  338. // }
  339. // .head-phone{
  340. // font-size: 26rpx;
  341. // font-weight: 500;
  342. // color: #999999;
  343. // }
  344. }
  345. .information {
  346. margin-left: 77rpx;
  347. display: flex;
  348. padding: 20rpx 10rpx;
  349. flex-direction: column;
  350. width: 297rpx;
  351. height: 137rpx;
  352. background: #ffffff;
  353. border: 4rpx solid #2e58ff;
  354. border-radius: 10rpx;
  355. .name {
  356. text-align: left;
  357. margin-left: 80rpx;
  358. font-size: 32rpx;
  359. font-family: PingFang SC;
  360. font-weight: bold;
  361. color: #2e58ff;
  362. }
  363. .cell {
  364. text-align: left;
  365. margin-left: 80rpx;
  366. font-size: 26rpx;
  367. font-family: PingFang SC;
  368. font-weight: 500;
  369. color: #2e58ff;
  370. }
  371. }
  372. }
  373. .sanchaji {
  374. margin: 30rpx 0;
  375. width: 530rpx;
  376. height: 91rpx;
  377. image {
  378. width: 100%;
  379. height: 100%;
  380. }
  381. }
  382. .subordinate {
  383. width: 750rpx;
  384. display: flex;
  385. justify-content: space-around;
  386. .zhuce {
  387. width: 154rpx;
  388. height: 154rpx;
  389. .jia {
  390. width: 154rpx;
  391. height: 154rpx;
  392. display: flex;
  393. flex-direction: column;
  394. align-items: center;
  395. justify-content: center;
  396. background: #e8e8e8;
  397. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  398. border-radius: 50%;
  399. overflow: hidden;
  400. .jia_photo {
  401. font-size: 80rpx;
  402. line-height: 1;
  403. color: #a3a3a3;
  404. }
  405. .font {
  406. font-size: 22rpx;
  407. font-weight: 500;
  408. color: #999999;
  409. }
  410. }
  411. }
  412. .headbox {
  413. width: 33.3%;
  414. // height: 154rpx;
  415. display: flex;
  416. flex-direction: column;
  417. // flex-wrap: nowrap;
  418. align-items: center;
  419. padding: 0 10rpx;
  420. .head {
  421. width: 154rpx;
  422. height: 154rpx;
  423. background: #2e58ff;
  424. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  425. border-radius: 50%;
  426. overflow: hidden;
  427. .photo {
  428. width: 154rpx;
  429. height: 154rpx;
  430. image {
  431. width: 100%;
  432. height: 100%;
  433. }
  434. }
  435. }
  436. .head-title {
  437. margin: -30rpx 30rpx 0 30rpx;
  438. width: 94rpx;
  439. height: 32rpx;
  440. image {
  441. width: 100%;
  442. height: 100%;
  443. }
  444. }
  445. .head-name {
  446. margin-top: 20rpx;
  447. white-space: nowrap;
  448. overflow: hidden;
  449. text-overflow: ellipsis;
  450. width: 150rpx;
  451. padding-top: 10rpx;
  452. text-align: center;
  453. // margin: 30rpx 0 0 0;
  454. font-size: 32rpx;
  455. font-weight: bold;
  456. color: #333333;
  457. }
  458. .head-phone {
  459. margin: 15rpx 0 0 0;
  460. font-size: 26rpx;
  461. font-weight: 500;
  462. color: #999999;
  463. }
  464. }
  465. }
  466. }
  467. .yeji {
  468. position: relative;
  469. margin-top: -72rpx;
  470. width: 690rpx;
  471. height: 143rpx;
  472. background: #ffffff;
  473. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  474. border-radius: 10rpx;
  475. display: flex;
  476. align-items: center;
  477. .yeji-a {
  478. width: 50%;
  479. display: flex;
  480. flex-direction: column;
  481. justify-content: center;
  482. align-items: center;
  483. .yeji-top {
  484. font-size: 28rpx;
  485. font-family: PingFang SC;
  486. font-weight: bold;
  487. color: #333333;
  488. }
  489. .yeji-buttom {
  490. font-size: 42rpx;
  491. font-family: PingFang SC;
  492. font-weight: bold;
  493. color: #333333;
  494. }
  495. }
  496. .border {
  497. width: 1rpx;
  498. height: 51rpx;
  499. background: #dddddd;
  500. }
  501. }
  502. .back {
  503. float: right;
  504. margin-top: 40rpx;
  505. display: flex;
  506. align-items: center;
  507. justify-content: center;
  508. image {
  509. width: 24rpx;
  510. height: 23rpx;
  511. }
  512. width: 104rpx;
  513. height: 39rpx;
  514. border: 2rpx solid #6eab4e;
  515. border-radius: 7rpx;
  516. font-size: 24rpx;
  517. font-family: PingFang SC;
  518. font-weight: 500;
  519. color: #6eab4e;
  520. }
  521. }
  522. </style>