jiedian.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <view class="content">
  3. <!-- 头部 -->
  4. <view class="container">
  5. <view class="jiedianbackground"><image src="../../static/image/jiedian.png" mode=""></image></view>
  6. <view class="number-box">
  7. <view class="number">
  8. <text>{{ userInfo.A_count + userInfo.B_count + userInfo.C_count }}</text>
  9. </view>
  10. <view class="renshu">我的接点人数</view>
  11. </view>
  12. </view>
  13. <view class="message">
  14. <view class="yeji">
  15. <view class="yeji-a">
  16. <view class="yeji-top">A区业绩</view>
  17. <view class="yeji-buttom">¥{{ userInfo.A_achievement }}</view>
  18. </view>
  19. <view class="border"></view>
  20. <view class="yeji-a">
  21. <view class="yeji-top">B区业绩</view>
  22. <view class="yeji-buttom">¥{{ userInfo.B_achievement }}</view>
  23. </view>
  24. <view class="border"></view>
  25. <view class="yeji-a">
  26. <view class="yeji-top">C区业绩</view>
  27. <view class="yeji-buttom">¥{{ userInfo.C_achievement }}</view>
  28. </view>
  29. </view>
  30. <view class="relation-box">
  31. <view class="relation">
  32. <view class="headbox">
  33. <view class="head">
  34. <view class="photo"><image :src="avatar || '../../static/error/missing-face.png'"></image></view>
  35. </view>
  36. <view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
  37. </view>
  38. <view class="information">
  39. <view class="name clamp">{{ name }}</view>
  40. <view class="cell clamp">{{ phone }}</view>
  41. </view>
  42. </view>
  43. <view class="sanchaji"><image src="../../static/image/sanchaji.png" mode=""></image></view>
  44. <view class="subordinate">
  45. <view class="headbox" v-if="listA != ''" @click="nav('a')">
  46. <view class="head">
  47. <view class="photo"><image :src="listA.avatar" mode=""></image></view>
  48. </view>
  49. <view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
  50. </view>
  51. <view class="zhuce" v-if="listA == ''" @click="navto('a')">注册接点A</view>
  52. <view class="headbox" v-if="listB != ''" @click="nav('b')">
  53. <view class="head">
  54. <view class="photo"><image :src="listB.avatar" mode=""></image></view>
  55. </view>
  56. <view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
  57. </view>
  58. <view class="zhuce" v-if="listB == ''" @click="navto('b')">注册接点B</view>
  59. <view class="headbox" v-if="listC != ''" @click="nav('c')">
  60. <view class="head">
  61. <view class="photo"><image :src="listC.avatar" mode=""></image></view>
  62. </view>
  63. <view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
  64. </view>
  65. <view class="zhuce" v-if="listC == ''" @click="navto('c')">注册接点C</view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import { getjiedian } from '@/api/user.js';
  73. import { mapState, mapMutations } from 'vuex';
  74. export default {
  75. data() {
  76. return {
  77. a: 1,
  78. b: 2,
  79. c: 3,
  80. people: 255,
  81. listA: '',
  82. listB: '',
  83. listC: '',
  84. name: '',
  85. phone: '',
  86. avatar: '',
  87. id: ''
  88. };
  89. },
  90. computed: {
  91. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  92. },
  93. onLoad() {
  94. this.name = this.userInfo.nickname;
  95. this.phone = this.userInfo.phone;
  96. this.avatar = this.userInfo.avatar;
  97. this.id = this.userInfo.uid;
  98. this.loadData();
  99. },
  100. methods: {
  101. loadData() {
  102. const obj = this;
  103. getjiedian({}, this.id).then(({ data }) => {
  104. if (data.list.length != 0) {
  105. data.list.forEach(e => {
  106. console.log('e', e);
  107. if (e.parent_area == 'A') {
  108. this.listA = e;
  109. } else if (e.parent_area == 'B') {
  110. this.listB = e;
  111. } else if (e.parent_area == 'C') {
  112. this.listC = e;
  113. }
  114. });
  115. } else {
  116. return;
  117. }
  118. });
  119. },
  120. nav(type) {
  121. if (type == 'a') {
  122. this.name = this.listA.nickname;
  123. this.phone = this.listA.phone;
  124. this.avatar = this.listA.avatar;
  125. this.id = this.listA.uid;
  126. this.listA = '';
  127. this.listB = '';
  128. this.listC = '';
  129. this.loadData();
  130. } else if (type == 'b') {
  131. this.name = this.listB.nickname;
  132. this.phone = this.listB.phone;
  133. this.avatar = this.listB.avatar;
  134. this.id = this.listB.uid;
  135. this.listA = '';
  136. this.listB = '';
  137. this.listC = '';
  138. this.loadData();
  139. } else if (type == 'c') {
  140. this.name = this.listC.nickname;
  141. this.phone = this.listC.phone;
  142. this.avatar = this.listC.avatar;
  143. this.id = this.listC.uid;
  144. this.listA = '';
  145. this.listB = '';
  146. this.listC = '';
  147. this.loadData();
  148. }
  149. },
  150. navto(type) {
  151. if (type == 'a') {
  152. uni.navigateTo({
  153. url: '/pages/public/register?id=' + this.id + '&area=A'
  154. });
  155. } else if (type == 'b') {
  156. uni.navigateTo({
  157. url: '/pages/public/register?id=' + this.id + '&area=B'
  158. });
  159. } else if (type == 'c') {
  160. if (this.listA == '' || this.listB == '') {
  161. this.$api.msg('请先注册完接点A和接点B');
  162. } else {
  163. uni.navigateTo({
  164. url: '/pages/public/register?id=' + this.id + '&area=C'
  165. });
  166. }
  167. }
  168. }
  169. }
  170. };
  171. </script>
  172. <style lang="scss">
  173. page {
  174. padding: 0;
  175. margin: 0;
  176. height: 100%;
  177. background-color: #ffffff;
  178. }
  179. .container {
  180. width: 750rpx;
  181. height: 400rpx;
  182. position: relative;
  183. .jiedianbackground {
  184. position: absolute;
  185. width: 750rpx;
  186. height: 400rpx;
  187. image {
  188. width: 100%;
  189. height: 100%;
  190. }
  191. }
  192. .number-box {
  193. width: 750rpx;
  194. height: 400rpx;
  195. position: absolute;
  196. display: flex;
  197. justify-content: center;
  198. flex-direction: column;
  199. align-items: center;
  200. .number {
  201. font-size: 30rpx;
  202. font-family: PingFang SC;
  203. font-weight: 500;
  204. color: #3f7c1f;
  205. text {
  206. font-size: 72rpx;
  207. font-family: PingFang SC;
  208. font-weight: bold;
  209. color: #3f7c1f;
  210. line-height: 86rpx;
  211. }
  212. }
  213. .renshu {
  214. font-size: 30rpx;
  215. font-family: PingFang SC;
  216. font-weight: 500;
  217. color: #3f7c1f;
  218. }
  219. }
  220. }
  221. .message {
  222. padding: 0 30rpx;
  223. .relation-box {
  224. margin-top: 100rpx;
  225. display: flex;
  226. flex-direction: column;
  227. align-items: center;
  228. .relation {
  229. position: relative;
  230. display: flex;
  231. align-items: center;
  232. .headbox {
  233. position: absolute;
  234. width: 154rpx;
  235. height: 154rpx;
  236. .head {
  237. width: 154rpx;
  238. height: 154rpx;
  239. background: #ef9e20;
  240. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  241. border-radius: 50%;
  242. overflow: hidden;
  243. .photo {
  244. width: 154rpx;
  245. height: 154rpx;
  246. image {
  247. width: 100%;
  248. height: 100%;
  249. }
  250. }
  251. }
  252. .head-title {
  253. margin: -30rpx 30rpx 0 30rpx;
  254. width: 94rpx;
  255. height: 32rpx;
  256. image {
  257. width: 100%;
  258. height: 100%;
  259. }
  260. }
  261. }
  262. .information {
  263. margin-left: 77rpx;
  264. display: flex;
  265. padding: 20rpx 10rpx;
  266. flex-direction: column;
  267. width: 297rpx;
  268. height: 137rpx;
  269. background: #ffffff;
  270. border: 4rpx solid #6eab4e;
  271. border-radius: 10rpx;
  272. .name {
  273. text-align: left;
  274. margin-left: 70rpx;
  275. font-size: 32rpx;
  276. font-family: PingFang SC;
  277. font-weight: bold;
  278. color: #3f7c1f;
  279. }
  280. .cell {
  281. text-align: left;
  282. margin-left: 70rpx;
  283. font-size: 26rpx;
  284. font-family: PingFang SC;
  285. font-weight: 500;
  286. color: #abd56f;
  287. }
  288. }
  289. }
  290. .sanchaji {
  291. margin: 30rpx 0;
  292. width: 530rpx;
  293. height: 91rpx;
  294. image {
  295. width: 100%;
  296. height: 100%;
  297. }
  298. }
  299. .subordinate {
  300. width: 750rpx;
  301. display: flex;
  302. justify-content: space-around;
  303. .zhuce {
  304. padding: 10rpx;
  305. background: #abd56f;
  306. color: #fff;
  307. }
  308. .headbox {
  309. width: 154rpx;
  310. height: 154rpx;
  311. .head {
  312. width: 154rpx;
  313. height: 154rpx;
  314. background: #ef9e20;
  315. box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
  316. border-radius: 50%;
  317. overflow: hidden;
  318. .photo {
  319. width: 154rpx;
  320. height: 154rpx;
  321. image {
  322. width: 100%;
  323. height: 100%;
  324. }
  325. }
  326. }
  327. .head-title {
  328. margin: -30rpx 30rpx 0 30rpx;
  329. width: 94rpx;
  330. height: 32rpx;
  331. image {
  332. width: 100%;
  333. height: 100%;
  334. }
  335. }
  336. }
  337. }
  338. }
  339. .yeji {
  340. position: relative;
  341. margin-top: -72rpx;
  342. width: 690rpx;
  343. height: 143rpx;
  344. background: #ffffff;
  345. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  346. border-radius: 10rpx;
  347. display: flex;
  348. justify-content: space-around;
  349. align-items: center;
  350. .yeji-a {
  351. display: flex;
  352. flex-direction: column;
  353. justify-content: space-around;
  354. align-items: center;
  355. .yeji-top {
  356. font-size: 24rpx;
  357. font-family: PingFang SC;
  358. font-weight: bold;
  359. color: #333333;
  360. line-height: 35px;
  361. }
  362. .yeji-buttom {
  363. font-size: 34rpx;
  364. font-family: PingFang SC;
  365. font-weight: bold;
  366. color: #333333;
  367. line-height: 35px;
  368. }
  369. }
  370. .border {
  371. width: 1rpx;
  372. height: 51rpx;
  373. background: #dddddd;
  374. }
  375. }
  376. }
  377. </style>