jiedian.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  1. <template>
  2. <view class="content">
  3. <!-- 头部 -->
  4. <view class="container">
  5. <view class="jiedianbackground">
  6. <image src="../../static/image/jiedian.png" mode=""></image>
  7. </view>
  8. <view class="number-box">
  9. <view class="number">
  10. <text>{{ userInfo.A_count + userInfo.B_count + userInfo.C_count }}</text>
  11. </view>
  12. <view class="renshu">我的接点人数</view>
  13. </view>
  14. </view>
  15. <view class="message">
  16. <view class="yeji">
  17. <view class="yeji-a">
  18. <view class="yeji-top">A区业绩</view>
  19. <view class="yeji-buttom">¥{{ userInfo.A_achievement }}</view>
  20. </view>
  21. <view class="border"></view>
  22. <view class="yeji-a">
  23. <view class="yeji-top">B区业绩</view>
  24. <view class="yeji-buttom">¥{{ userInfo.B_achievement }}</view>
  25. </view>
  26. <view class="border"></view>
  27. <view class="yeji-a">
  28. <view class="yeji-top">C区业绩</view>
  29. <view class="yeji-buttom">¥{{ userInfo.C_achievement }}</view>
  30. </view>
  31. </view>
  32. <view class="back" @click="navBack()" v-if="parentList.length > 0">
  33. <image src="../../static/img/zhengyi10.png" mode=""></image>
  34. 返回
  35. </view>
  36. <view class="relation-box">
  37. <view class="relation">
  38. <view class="headbox">
  39. <view class="head">
  40. <view class="photo">
  41. <image v-if="avatar" :src="avatar"></image>
  42. </view>
  43. </view>
  44. <view class="head-title">
  45. <image src="../../static/image/jiedian1.png" mode=""></image>
  46. </view>
  47. </view>
  48. <view class="information">
  49. <view class="name clamp">{{ name }}</view>
  50. <view class="cell clamp">{{ phone }}</view>
  51. </view>
  52. </view>
  53. <view class="sanchaji">
  54. <image src="../../static/image/sanchaji.png" mode=""></image>
  55. </view>
  56. <view class="subordinate">
  57. <view class="headbox" v-if="listA" @click="nav('a')">
  58. <view class="head">
  59. <view class="photo">
  60. <image v-if='listA.avatar' :src="listA.avatar" mode="scaleToFill"></image>
  61. </view>
  62. </view>
  63. <view class="head-title">
  64. <image src="../../static/image/jiedian1.png" mode="scaleToFill"></image>
  65. </view>
  66. <view class="head-name">
  67. {{listA.nickname}}
  68. </view>
  69. <view class="head-phone">
  70. {{listA.phone}}
  71. </view>
  72. </view>
  73. <view class="zhuce" v-else @click="open('A')">
  74. <view class="jia">
  75. <view class="jia_photo">
  76. +
  77. <!-- <image v-if='!listA.avatar' class="imgbox" src="../../static/img/jiedian07.png" mode="scaleToFill"></image> -->
  78. </view>
  79. <view class="font">
  80. 点击添加
  81. </view>
  82. </view>
  83. </view>
  84. <view class="headbox" v-if="listB" @click="nav('b')">
  85. <view class="head">
  86. <view class="photo">
  87. <image :key='listB.id' :src="listB.avatar" mode="scaleToFill"></image>
  88. </view>
  89. </view>
  90. <view class="head-title">
  91. <image src="../../static/image/jiedian1.png" mode="scaleToFill"></image>
  92. </view>
  93. <view class="head-name">
  94. {{listB.nickname}}
  95. </view>
  96. <view class="head-phone">
  97. {{listB.phone}}
  98. </view>
  99. </view>
  100. <view class="zhuce" v-else @click="open('B')">
  101. <view class="jia">
  102. <view class="jia_photo">
  103. +
  104. <!-- <image v-if='!listB.avatar' class="imgbox" src="../../static/img/jiedian07.png" mode="scaleToFill"></image> -->
  105. </view>
  106. <view class="font">
  107. 点击添加
  108. </view>
  109. </view>
  110. </view>
  111. <view class="headbox" v-if="listC" @click="nav('c')">
  112. <view class="head">
  113. <view class="photo">
  114. <image v-if='listC.avatar' :src="listC.avatar" mode="scaleToFill"></image>
  115. </view>
  116. </view>
  117. <view class="head-title">
  118. <image src="../../static/image/jiedian1.png" mode="scaleToFill"></image>
  119. </view>
  120. <view class="head-name">
  121. {{listC.nickname}}
  122. </view>
  123. <view class="head-phone">
  124. {{listC.phone}}
  125. </view>
  126. </view>
  127. <view class="zhuce" v-else @click="open('C')">
  128. <view class="jia">
  129. <view class="jia_photo">
  130. +
  131. <!-- <image v-if='!listC.avatar' class="imgbox" src="../../static/img/jiedian07.png" mode="scaleToFill"></image> -->
  132. </view>
  133. <view class="font">
  134. 点击添加
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <uni-popup ref="popup" type="center">
  142. <view class="popup-box">
  143. <view class="backgroundimg">
  144. <image src="../../static/image/popup01.png" mode=""></image>
  145. </view>
  146. <view class="text">
  147. <view class="text-one">
  148. 添加类型
  149. </view>
  150. <view class="text-two">
  151. 请选择接点人添加类型
  152. </view>
  153. </view>
  154. <view class="box-choose">
  155. <view class="choose">
  156. <view class="zhuce">
  157. <view class="zhuce-img">
  158. <image src="../../static/image/popup03.png" mode="scaleToFill"></image>
  159. </view>
  160. <text>注册接点人</text>
  161. </view>
  162. <view class="radio">
  163. <radio value="2" :checked="bianhao==='3'" @click="radio('3')" color="#6EAB4E"></radio>
  164. </view>
  165. </view>
  166. <view class="choose">
  167. <view class="zhuce">
  168. <view class="zhuce-img">
  169. <image src="../../static/image/popup02.png" mode=""></image>
  170. </view>
  171. <text>选择接点人</text>
  172. </view>
  173. <view class="radio">
  174. <radio value="1" :checked="bianhao==='1'" color="#6EAB4E" @click="radio('1')">
  175. </radio>
  176. </view>
  177. </view>
  178. <view class="button" @click="navJiedian()">
  179. 确认
  180. </view>
  181. </view>
  182. </view>
  183. </uni-popup>
  184. </view>
  185. </template>
  186. <script>
  187. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  188. import {
  189. getjiedian,
  190. getReferralList,
  191. addJiedian
  192. } from '@/api/user.js';
  193. import {
  194. mapState,
  195. mapMutations
  196. } from 'vuex';
  197. export default {
  198. components: {
  199. uniPopup
  200. },
  201. data() {
  202. return {
  203. bianhao: '1',
  204. a: 1,
  205. b: 2,
  206. c: 3,
  207. listA: '', //节点A
  208. listB: '', //节点B
  209. listC: '', //节点C
  210. name: '', //当前节点姓名
  211. phone: '', //当前节点手机号
  212. avatar: '', //当前节点头像
  213. id: '',
  214. uid: '',
  215. jiedianList: [],
  216. parentList: [], //保存打开层级用户数据
  217. parent_area: ''
  218. };
  219. },
  220. computed: {
  221. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  222. },
  223. onLoad() {
  224. this.name = this.userInfo.nickname;
  225. this.phone = this.userInfo.phone;
  226. this.avatar = this.userInfo.avatar;
  227. this.id = this.userInfo.uid;
  228. this.loadData();
  229. },
  230. methods: {
  231. navJiedian() {
  232. this.$refs.popup.close();
  233. console.log(this.bianhao, 'bianhao')
  234. if (this.bianhao === '3') {
  235. uni.navigateTo({
  236. url: '/pages/public/register'
  237. })
  238. } else if (this.bianhao === '1') {
  239. uni.navigateTo({
  240. url: '/pages/user/selectList?patent=' + this.id + '&parent_area=' + this.parent_area
  241. })
  242. }
  243. },
  244. //切换按钮
  245. radio(e) {
  246. this.bianhao = e
  247. },
  248. //打开选择项
  249. open(are) {
  250. console.log(this.id)
  251. console.log('点击出现弹窗')
  252. this.$refs.popup.open();
  253. this.parent_area = are;
  254. console.log(this.parent_area);
  255. },
  256. //返回
  257. navBack() {
  258. const obj = this;
  259. // 删除
  260. let parent = obj.parentList.pop();
  261. console.log(parent);
  262. console.log(obj.parentList, 'navBack')
  263. // 保存回退后数据对象
  264. obj.name = parent.name;
  265. obj.phone = parent.phone;
  266. obj.avatar = parent.avatar;
  267. obj.id = parent.id;
  268. obj.listA = obj.listB = obj.listC = '';
  269. console.log(parent, '对象');
  270. obj.loadData();
  271. },
  272. loadData() {
  273. const obj = this;
  274. uni.showLoading({
  275. title: '加载中。。。',
  276. mask: true
  277. });
  278. getjiedian({}, this.id).then(({
  279. data
  280. }) => {
  281. uni.hideLoading()
  282. if (data.list.length != 0) {
  283. data.list.forEach(e => {
  284. console.log('e', e);
  285. let item = '';
  286. if (e.parent_area == 'A') {
  287. item = 'listA';
  288. } else if (e.parent_area == 'B') {
  289. item = 'listB';
  290. } else if (e.parent_area == 'C') {
  291. item = 'listC';
  292. }
  293. obj[item] = e;
  294. console.log(obj, '当前数据');
  295. });
  296. } else {
  297. return;
  298. }
  299. }).catch((e) => {
  300. uni.hideLoading()
  301. });
  302. },
  303. nav(type) {
  304. const obj = this;
  305. // 保存当前选中的对象
  306. let item = '';
  307. if (type == 'a') {
  308. item = 'listA'
  309. } else {
  310. if (type == 'b') {
  311. item = 'listB'
  312. } else if (type == 'c') {
  313. item = 'listC'
  314. }
  315. }
  316. obj.parentList.push({
  317. name: obj.name,
  318. phone: obj.phone,
  319. avatar: obj.avatar,
  320. id: obj.id,
  321. })
  322. console.log(obj.parentList, 's');
  323. obj.name = obj[item].nickname;
  324. obj.phone = obj[item].phone;
  325. obj.avatar = '';
  326. obj.$nextTick(function() {
  327. obj.avatar = obj[item].avatar;
  328. obj.id = obj[item].uid;
  329. obj.listA = '';
  330. obj.listB = '';
  331. obj.listC = '';
  332. obj.loadData();
  333. })
  334. },
  335. navto(type) {
  336. if (type == 'a') {
  337. uni.navigateTo({
  338. url: '/pages/public/register?id=' + this.id + '&area=A'
  339. });
  340. } else if (type == 'b') {
  341. uni.navigateTo({
  342. url: '/pages/public/register?id=' + this.id + '&area=B'
  343. });
  344. } else if (type == 'c') {
  345. if (this.listA == '' || this.listB == '') {
  346. this.$api.msg('请先注册完接点A和接点B');
  347. } else {
  348. uni.navigateTo({
  349. url: '/pages/public/register?id=' + this.id + '&area=C'
  350. });
  351. }
  352. }
  353. }
  354. }
  355. };
  356. </script>
  357. <style lang="scss">
  358. page {
  359. padding: 0;
  360. margin: 0;
  361. height: 100%;
  362. background-color: #ffffff;
  363. }
  364. .popup-box {
  365. width: 542rpx;
  366. height: 575rpx;
  367. background-color: #ffffff;
  368. border-radius: 20rpx;
  369. position: relative;
  370. margin: 0 auto;
  371. .backgroundimg {
  372. width: 542rpx;
  373. height: 138rpx;
  374. position: absolute;
  375. image {
  376. width: 100%;
  377. height: 100%;
  378. }
  379. }
  380. .text {
  381. display: flex;
  382. flex-direction: column;
  383. align-items: center;
  384. padding-top: 80rpx;
  385. margin-bottom: 50rpx;
  386. .text-one {
  387. font-size: 36rpx;
  388. font-family: PingFang SC;
  389. font-weight: bold;
  390. color: #333333;
  391. margin-bottom: 10rpx;
  392. }
  393. .text-two {
  394. font-size: 24rpx;
  395. font-family: PingFang SC;
  396. font-weight: 500;
  397. color: #808080;
  398. }
  399. }
  400. .box-choose {
  401. margin: 0 40rpx;
  402. display: flex;
  403. flex-direction: column;
  404. .choose {
  405. display: flex;
  406. justify-content: space-between;
  407. margin: 25rpx 0;
  408. .zhuce {
  409. display: flex;
  410. .zhuce-img {
  411. width: 42rpx;
  412. height: 43rpx;
  413. image {
  414. width: 100%;
  415. height: 100%;
  416. }
  417. }
  418. }
  419. text {
  420. margin-left: 10rpx;
  421. font-size: 28rpx;
  422. font-weight: 500;
  423. color: #333333;
  424. }
  425. .radio {}
  426. }
  427. .button {
  428. margin-top: 60rpx;
  429. width: 460rpx;
  430. text-align: center;
  431. line-height: 70rpx;
  432. height: 70rpx;
  433. background: #6EAB4E;
  434. border-radius: 10rpx;
  435. font-size: 28rpx;
  436. font-weight: 500;
  437. color: #FFFFFF;
  438. }
  439. }
  440. }
  441. .container {
  442. width: 750rpx;
  443. height: 400rpx;
  444. position: relative;
  445. .jiedianbackground {
  446. position: absolute;
  447. width: 750rpx;
  448. height: 400rpx;
  449. image {
  450. width: 100%;
  451. height: 100%;
  452. }
  453. }
  454. .number-box {
  455. width: 750rpx;
  456. height: 400rpx;
  457. position: absolute;
  458. display: flex;
  459. justify-content: center;
  460. flex-direction: column;
  461. align-items: center;
  462. .number {
  463. font-size: 30rpx;
  464. font-family: PingFang SC;
  465. font-weight: 500;
  466. color: #3f7c1f;
  467. text {
  468. font-size: 72rpx;
  469. font-family: PingFang SC;
  470. font-weight: bold;
  471. color: #3f7c1f;
  472. line-height: 86rpx;
  473. }
  474. }
  475. .renshu {
  476. font-size: 30rpx;
  477. font-family: PingFang SC;
  478. font-weight: 500;
  479. color: #3f7c1f;
  480. }
  481. }
  482. }
  483. .message {
  484. padding: 0 30rpx;
  485. .relation-box {
  486. margin-top: 100rpx;
  487. display: flex;
  488. flex-direction: column;
  489. align-items: center;
  490. .relation {
  491. position: relative;
  492. display: flex;
  493. align-items: center;
  494. .headbox {
  495. position: absolute;
  496. // width: 154rpx;
  497. // height: 154rpx;
  498. .head {
  499. width: 154rpx;
  500. height: 154rpx;
  501. background: #ef9e20;
  502. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  503. border-radius: 50%;
  504. overflow: hidden;
  505. .photo {
  506. width: 154rpx;
  507. height: 154rpx;
  508. image {
  509. width: 100%;
  510. height: 100%;
  511. }
  512. }
  513. }
  514. .head-title {
  515. margin: -30rpx 30rpx 0 30rpx;
  516. width: 94rpx;
  517. height: 32rpx;
  518. image {
  519. width: 100%;
  520. height: 100%;
  521. }
  522. }
  523. // .head-name{
  524. // max-width: 100%;
  525. // font-size: 32rpx;
  526. // font-weight: bold;
  527. // color: #333333;
  528. // }
  529. // .head-phone{
  530. // font-size: 26rpx;
  531. // font-weight: 500;
  532. // color: #999999;
  533. // }
  534. }
  535. .information {
  536. margin-left: 77rpx;
  537. display: flex;
  538. padding: 20rpx 10rpx;
  539. flex-direction: column;
  540. width: 297rpx;
  541. height: 137rpx;
  542. background: #ffffff;
  543. border: 4rpx solid #6eab4e;
  544. border-radius: 10rpx;
  545. .name {
  546. text-align: left;
  547. margin-left: 70rpx;
  548. font-size: 32rpx;
  549. font-family: PingFang SC;
  550. font-weight: bold;
  551. color: #3f7c1f;
  552. }
  553. .cell {
  554. text-align: left;
  555. margin-left: 70rpx;
  556. font-size: 26rpx;
  557. font-family: PingFang SC;
  558. font-weight: 500;
  559. color: #abd56f;
  560. }
  561. }
  562. }
  563. .sanchaji {
  564. margin: 30rpx 0;
  565. width: 530rpx;
  566. height: 91rpx;
  567. image {
  568. width: 100%;
  569. height: 100%;
  570. }
  571. }
  572. .subordinate {
  573. width: 750rpx;
  574. display: flex;
  575. justify-content: space-around;
  576. .zhuce {
  577. width: 154rpx;
  578. height: 154rpx;
  579. .jia {
  580. width: 154rpx;
  581. height: 154rpx;
  582. display: flex;
  583. flex-direction: column;
  584. align-items: center;
  585. justify-content: center;
  586. background: #E8E8E8;
  587. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  588. border-radius: 50%;
  589. overflow: hidden;
  590. .jia_photo {
  591. font-size: 80rpx;
  592. line-height: 1;
  593. color: #a3a3a3;
  594. }
  595. .font {
  596. font-size: 22rpx;
  597. font-weight: 500;
  598. color: #999999;
  599. }
  600. }
  601. }
  602. .headbox {
  603. width: 33.3%;
  604. // height: 154rpx;
  605. display: flex;
  606. flex-direction: column;
  607. // flex-wrap: nowrap;
  608. align-items: center;
  609. padding: 0 10rpx;
  610. .head {
  611. width: 154rpx;
  612. height: 154rpx;
  613. background: #ef9e20;
  614. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  615. border-radius: 50%;
  616. overflow: hidden;
  617. .photo {
  618. width: 154rpx;
  619. height: 154rpx;
  620. image {
  621. width: 100%;
  622. height: 100%;
  623. }
  624. }
  625. }
  626. .head-title {
  627. margin: -30rpx 30rpx 0 30rpx;
  628. width: 94rpx;
  629. height: 32rpx;
  630. image {
  631. width: 100%;
  632. height: 100%;
  633. }
  634. }
  635. .head-name {
  636. margin-top: 20rpx;
  637. white-space: nowrap;
  638. overflow: hidden;
  639. text-overflow: ellipsis;
  640. width: 150rpx;
  641. padding-top: 10rpx;
  642. text-align: center;
  643. // margin: 30rpx 0 0 0;
  644. font-size: 32rpx;
  645. font-weight: bold;
  646. color: #333333;
  647. }
  648. .head-phone {
  649. margin: 15rpx 0 0 0;
  650. font-size: 26rpx;
  651. font-weight: 500;
  652. color: #999999;
  653. }
  654. }
  655. }
  656. }
  657. .yeji {
  658. position: relative;
  659. margin-top: -72rpx;
  660. width: 690rpx;
  661. height: 143rpx;
  662. background: #ffffff;
  663. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  664. border-radius: 10rpx;
  665. display: flex;
  666. justify-content: space-around;
  667. align-items: center;
  668. .yeji-a {
  669. display: flex;
  670. flex-direction: column;
  671. justify-content: space-around;
  672. align-items: center;
  673. .yeji-top {
  674. font-size: 24rpx;
  675. font-family: PingFang SC;
  676. font-weight: bold;
  677. color: #333333;
  678. line-height: 35px;
  679. }
  680. .yeji-buttom {
  681. font-size: 34rpx;
  682. font-family: PingFang SC;
  683. font-weight: bold;
  684. color: #333333;
  685. line-height: 35px;
  686. }
  687. }
  688. .border {
  689. width: 1rpx;
  690. height: 51rpx;
  691. background: #dddddd;
  692. }
  693. }
  694. .back {
  695. float: right;
  696. margin-top: 40rpx;
  697. display: flex;
  698. align-items: center;
  699. justify-content: center;
  700. image {
  701. width: 24rpx;
  702. height: 23rpx;
  703. }
  704. width: 104rpx;
  705. height: 39rpx;
  706. border: 2rpx solid #6EAB4E;
  707. border-radius: 7rpx;
  708. font-size: 24rpx;
  709. font-family: PingFang SC;
  710. font-weight: 500;
  711. color: #6EAB4E;
  712. }
  713. }
  714. </style>