myjiedian.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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>{{ count }}</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">{{ shouru * 1 || 0 }}</view>
  22. <view class="yeji-top">收益</view>
  23. </view>
  24. <view class="border"></view>
  25. <view class="yeji-a">
  26. <view class="yeji-buttom">{{ zhichu * 1 || 0 }}</view>
  27. <view class="yeji-top">支出</view>
  28. </view>
  29. </view>
  30. <view class="back" @click="navBack()" v-if="fatherList.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 flex">
  48. <view class="subordinate-box" v-for="(item, index) in childList" @click="findChildren(item)">
  49. <view class="head1"><image :src="item.avatar || '/static/error/missing-face.png'" mode=""></image></view>
  50. <view class="name clamp">{{ item.nickname }}</view>
  51. <view class="phone clamp">{{ item.mobile }}</view>
  52. </view>
  53. <template v-if="childList.length < 3">
  54. <view class="subordinate-box" v-for="item in 3 - childList.length">
  55. <view class="head1"></view>
  56. <view class="name clamp"></view>
  57. <view class="phone clamp"></view>
  58. </view>
  59. </template>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import { myActivity, activityDetail } from '@/api/market.js';
  67. import { mapState, mapMutations } from 'vuex';
  68. export default {
  69. data() {
  70. return {
  71. count: '', //互助人数
  72. shouru: '', //我的收入
  73. zhichu: '', //我的支持
  74. name: '', //当前节点姓名
  75. phone: '', //当前节点手机号
  76. avatar: '', //当前节点头像
  77. id: '',
  78. childList: [], //当前节点的下级
  79. fatherList: []
  80. };
  81. },
  82. computed: {
  83. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  84. },
  85. onLoad() {
  86. this.name = this.userInfo.nickname;
  87. this.phone = this.userInfo.phone;
  88. this.avatar = this.userInfo.avatar;
  89. this.id = this.userInfo.uid;
  90. activityDetail({}, 1).then(({ data }) => {
  91. if (data.expend.length != 0) {
  92. this.zhichu = data.expend[0].money;
  93. } else {
  94. this.zhichu = 0;
  95. }
  96. if (data.income.length != 0) {
  97. this.shouru = data.income[0].money;
  98. } else {
  99. this.shouru = 0;
  100. }
  101. });
  102. this.loadData();
  103. },
  104. methods: {
  105. // 点击返回 我的页面
  106. toBack() {
  107. uni.navigateBack({});
  108. },
  109. async findChildren(item) {
  110. //存father
  111. this.fatherList.push({
  112. name: this.name,
  113. phone: this.phone,
  114. avatar: this.avatar,
  115. id: this.id
  116. });
  117. //设置新father
  118. this.id = item.id;
  119. await this.loadData();
  120. this.name = item.nickname;
  121. this.phone = item.mobile;
  122. this.avatar = item.avatar;
  123. },
  124. back() {
  125. let father = this.fatherList.pop();
  126. this.name = father.name;
  127. this.phone = father.phone;
  128. this.avatar = father.avatar;
  129. this.id = father.id;
  130. this.loadData();
  131. },
  132. loadData() {
  133. const obj = this;
  134. uni.showLoading({
  135. title: '加载中。。。',
  136. mask: true
  137. });
  138. myActivity({ uid: obj.id }, 1)
  139. .then(({ data }) => {
  140. obj.count = data.count;
  141. console.log(data);
  142. uni.hideLoading();
  143. if (data.list.length != 0) {
  144. data.list.forEach(e => {
  145. console.log('e', e);
  146. let item = '';
  147. if (e.parent_area == 'A') {
  148. item = 'listA';
  149. } else if (e.parent_area == 'B') {
  150. item = 'listB';
  151. } else if (e.parent_area == 'C') {
  152. item = 'listC';
  153. }
  154. obj[item] = e;
  155. console.log(obj, '当前数据');
  156. });
  157. } else {
  158. return;
  159. }
  160. })
  161. .catch(e => {
  162. uni.hideLoading();
  163. });
  164. }
  165. }
  166. };
  167. </script>
  168. <style lang="scss">
  169. page {
  170. padding: 0;
  171. margin: 0;
  172. height: 100%;
  173. background-color: #ffffff;
  174. }
  175. .status_bar {
  176. height: var(--status-bar-height);
  177. width: 100%;
  178. }
  179. .container {
  180. width: 750rpx;
  181. height: 460rpx;
  182. position: relative;
  183. .jiedianbackground {
  184. position: absolute;
  185. top: 0;
  186. left: 0;
  187. right: 0;
  188. width: 750rpx;
  189. height: 460rpx;
  190. image {
  191. width: 100%;
  192. height: 100%;
  193. }
  194. }
  195. .body-title {
  196. height: 80rpx;
  197. text-align: center;
  198. font-size: 35rpx;
  199. position: relative;
  200. .header {
  201. position: absolute;
  202. left: 0;
  203. top: 0;
  204. width: 100%;
  205. font-size: 36rpx;
  206. font-family: PingFang SC;
  207. font-weight: bold;
  208. color: #fffeff;
  209. height: 80rpx;
  210. font-size: 36rpx;
  211. font-weight: 700;
  212. z-index: 9;
  213. display: flex;
  214. justify-content: center;
  215. align-items: center;
  216. }
  217. .goback-box {
  218. position: absolute;
  219. left: 18rpx;
  220. top: 0;
  221. height: 80rpx;
  222. display: flex;
  223. align-items: center;
  224. }
  225. .goback {
  226. z-index: 100;
  227. width: 34rpx;
  228. height: 34rpx;
  229. }
  230. }
  231. .number-box {
  232. margin-top: 100rpx;
  233. width: 750rpx;
  234. height: 400rpx;
  235. position: absolute;
  236. display: flex;
  237. flex-direction: column;
  238. align-items: center;
  239. .number {
  240. font-size: 30rpx;
  241. font-family: PingFang SC;
  242. font-weight: 500;
  243. color: #ffffff;
  244. text {
  245. font-size: 72rpx;
  246. font-family: PingFang SC;
  247. font-weight: bold;
  248. color: #ffffff;
  249. line-height: 86rpx;
  250. }
  251. }
  252. .renshu {
  253. font-size: 30rpx;
  254. font-family: PingFang SC;
  255. font-weight: 500;
  256. color: #ffffff;
  257. }
  258. }
  259. }
  260. .message {
  261. padding: 0 30rpx;
  262. .relation-box {
  263. margin-top: 100rpx;
  264. display: flex;
  265. flex-direction: column;
  266. align-items: center;
  267. .relation {
  268. position: relative;
  269. display: flex;
  270. align-items: center;
  271. .headbox {
  272. position: absolute;
  273. // width: 154rpx;
  274. // height: 154rpx;
  275. .head {
  276. width: 154rpx;
  277. height: 154rpx;
  278. background: #2e58ff;
  279. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  280. border-radius: 50%;
  281. overflow: hidden;
  282. .photo {
  283. width: 154rpx;
  284. height: 154rpx;
  285. image {
  286. width: 100%;
  287. height: 100%;
  288. }
  289. }
  290. }
  291. .head-title {
  292. margin: -30rpx 30rpx 0 30rpx;
  293. width: 94rpx;
  294. height: 32rpx;
  295. image {
  296. width: 100%;
  297. height: 100%;
  298. }
  299. }
  300. // .head-name{
  301. // max-width: 100%;
  302. // font-size: 32rpx;
  303. // font-weight: bold;
  304. // color: #333333;
  305. // }
  306. // .head-phone{
  307. // font-size: 26rpx;
  308. // font-weight: 500;
  309. // color: #999999;
  310. // }
  311. }
  312. .information {
  313. margin-left: 77rpx;
  314. display: flex;
  315. padding: 20rpx 10rpx;
  316. flex-direction: column;
  317. width: 297rpx;
  318. height: 137rpx;
  319. background: #ffffff;
  320. border: 4rpx solid #2e58ff;
  321. border-radius: 10rpx;
  322. .name {
  323. text-align: left;
  324. margin-left: 80rpx;
  325. font-size: 32rpx;
  326. font-family: PingFang SC;
  327. font-weight: bold;
  328. color: #2e58ff;
  329. }
  330. .cell {
  331. text-align: left;
  332. margin-left: 80rpx;
  333. font-size: 26rpx;
  334. font-family: PingFang SC;
  335. font-weight: 500;
  336. color: #2e58ff;
  337. }
  338. }
  339. }
  340. .sanchaji {
  341. margin: 30rpx 0;
  342. width: 530rpx;
  343. height: 91rpx;
  344. image {
  345. width: 100%;
  346. height: 100%;
  347. }
  348. }
  349. .subordinate {
  350. width: 750rpx;
  351. display: flex;
  352. justify-content: flex-start;
  353. align-items: flex-start;
  354. .subordinate-box {
  355. flex: 1;
  356. display: flex;
  357. flex-direction: column;
  358. align-items: center;
  359. .head1 {
  360. position: relative;
  361. border-radius: 50%;
  362. background: #f1f1f1;
  363. width: 120rpx;
  364. height: 120rpx;
  365. .vip {
  366. position: absolute;
  367. bottom: 0;
  368. left: 10%;
  369. width: 94rpx;
  370. height: 32rpx;
  371. image {
  372. width: 100%;
  373. height: 100%;
  374. border-radius: 0;
  375. }
  376. }
  377. image {
  378. width: 100%;
  379. height: 100%;
  380. border-radius: 50%;
  381. }
  382. }
  383. .name {
  384. max-width: 120rpx;
  385. margin-top: 10rpx;
  386. font-size: 26rpx;
  387. font-family: PingFang SC;
  388. font-weight: bold;
  389. color: #ffffff;
  390. }
  391. .phone {
  392. max-width: 120rpx;
  393. margin-top: 10rpx;
  394. font-size: 22rpx;
  395. font-family: PingFang SC;
  396. font-weight: 500;
  397. color: #999999;
  398. }
  399. }
  400. }
  401. }
  402. .yeji {
  403. position: relative;
  404. margin-top: -72rpx;
  405. width: 690rpx;
  406. height: 143rpx;
  407. background: #ffffff;
  408. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  409. border-radius: 10rpx;
  410. display: flex;
  411. align-items: center;
  412. .yeji-a {
  413. width: 50%;
  414. display: flex;
  415. flex-direction: column;
  416. justify-content: center;
  417. align-items: center;
  418. .yeji-top {
  419. font-size: 28rpx;
  420. font-family: PingFang SC;
  421. font-weight: bold;
  422. color: #333333;
  423. }
  424. .yeji-buttom {
  425. font-size: 42rpx;
  426. font-family: PingFang SC;
  427. font-weight: bold;
  428. color: #333333;
  429. }
  430. }
  431. .border {
  432. width: 1rpx;
  433. height: 51rpx;
  434. background: #dddddd;
  435. }
  436. }
  437. .back {
  438. float: right;
  439. margin-top: 40rpx;
  440. display: flex;
  441. align-items: center;
  442. justify-content: center;
  443. image {
  444. width: 24rpx;
  445. height: 23rpx;
  446. }
  447. width: 104rpx;
  448. height: 39rpx;
  449. border: 2rpx solid #6eab4e;
  450. border-radius: 7rpx;
  451. font-size: 24rpx;
  452. font-family: PingFang SC;
  453. font-weight: 500;
  454. color: #6eab4e;
  455. }
  456. }
  457. </style>