extension.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. <template>
  2. <view class="content">
  3. <view class="status_bar"><!-- 这里是状态栏 --></view>
  4. <view class="content-money">
  5. <view class="money-box">
  6. <view class="goback-box" @click="toBack"><image class="goback" src="../../static/img/fanhui.png" mode=""></image></view>
  7. <view class="header">我的推广</view>
  8. <image class="tuiguang_bg" src="../../static/img/share-bg.png"></image>
  9. <!-- <view class="money_img"><image :src="list.avatar || img"></image></view> -->
  10. <view class="user">
  11. <view class="avtor">
  12. <image class="portrait" :src="userInfo.avatar || '/static/img/missing-face.png'"></image>
  13. <view class="he"><image class="image" v-if="userInfo.point" src="../../static/img/hehuoren.png"></image></view>
  14. </view>
  15. <view class="">
  16. <view class="name">
  17. <view class="name-left clamp">{{ userInfo.phone || userInfo.email || '游客' }}</view>
  18. <view class="name-right">
  19. <image class="image" src="../../static/img/img28.png"></image>
  20. <view class="level" v-if="userInfo.level">{{ userInfo.level_info.name }}</view>
  21. <view class="level" v-else>V0</view>
  22. </view>
  23. </view>
  24. <!-- <view class="id">uid:{{ userInfo.uid }}</view> -->
  25. </view>
  26. </view>
  27. <view class="right">
  28. <view class="right-num">
  29. {{team}}
  30. </view>
  31. <view class="right-font ">
  32. 团队总人数
  33. </view>
  34. <view class="time ">
  35. {{today}}
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="main flex">
  41. <view class="main-box flex">
  42. <view class="item">
  43. <view class="num">{{myPerformance || 0}}</view>
  44. <view class="font ">我的历史业绩</view>
  45. </view>
  46. <view class="item bottom">
  47. <view class="num">{{plotPerformance || 0}}</view>
  48. <view class="font ">历史小区业绩</view>
  49. </view>
  50. </view>
  51. <view class="main-box flex">
  52. <view class="item">
  53. <view class="num">{{push || 0}}</view>
  54. <view class="font ">直推人数</view>
  55. </view>
  56. <view class="item bottom">
  57. <view class="num">{{team || 0}}</view>
  58. <view class="font ">团队人数</view>
  59. </view>
  60. </view>
  61. <view class="main-box flex">
  62. <view class="item">
  63. <view class="num">{{achievement_month || 0}}</view>
  64. <view class="font ">本月新增业绩</view>
  65. </view>
  66. <view class="item bottom">
  67. <view class="num">{{small_achivement_month || 0}}</view>
  68. <view class="font ">本月新增小区业绩</view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="box">
  73. <view class="box-item flex">
  74. <view class="box-left">昨日拼购奖励</view>
  75. <view class="box-right">{{yesterday.pink*1 || 0}}USDT</view>
  76. </view>
  77. <view class="box-item flex">
  78. <view class="box-left">昨日分享奖励</view>
  79. <view class="box-right">{{yesterday.recommend*1 || 0}}USDT</view>
  80. </view>
  81. <view class="box-item flex">
  82. <view class="box-left">昨日团队奖励</view>
  83. <view class="box-right">{{yesterday.group*1 || 0}}USDT</view>
  84. </view>
  85. <view class="box-item flex">
  86. <view class="box-left" style="color:#44969D;">昨日累计奖励</view>
  87. <view class="box-right" style="color:#44969D;">{{yesterday.all*1 || 0}}USDT</view>
  88. </view>
  89. </view>
  90. <view class="box">
  91. <view class="box-item flex">
  92. <view class="box-left">累计拼购奖励</view>
  93. <view class="box-right">{{all.pink*1 || 0}}USDT</view>
  94. </view>
  95. <view class="box-item flex">
  96. <view class="box-left">累计分享奖励</view>
  97. <view class="box-right">{{all.recommend*1 || 0}}USDT</view>
  98. </view>
  99. <view class="box-item flex">
  100. <view class="box-left">累计团队奖励</view>
  101. <view class="box-right">{{all.group*1 || 0}}USDT</view>
  102. </view>
  103. <view class="box-item flex">
  104. <view class="box-left" style="color:#44969D;">历史累计奖励</view>
  105. <view class="box-right" style="color:#44969D;">{{all.all*1 || 0}}USDT</view>
  106. </view>
  107. </view>
  108. <view class="liebiao flex" @click="navto('/pages/user/extensionList')">
  109. <view class="left flex">
  110. <image src="../../static/img/myTeam.png" mode=""></image>
  111. <view class="leibiao-font">推广列表</view>
  112. </view>
  113. <image src="../../static/img/jiantou.png" mode=""></image>
  114. </view>
  115. </view>
  116. </template>
  117. <script>
  118. import { spread } from '@/api/finance.js';
  119. import { mapState, mapMutations } from 'vuex';
  120. import { gitExtension } from '@/api/user.js';
  121. export default {
  122. onReady() {
  123. // 初始化获取页面宽度
  124. uni.createSelectorQuery()
  125. .select('.content')
  126. .fields(
  127. {
  128. size: true
  129. },
  130. data => {
  131. // console.log(data);
  132. // console.log(Math.floor((data.width / 750) * 300));
  133. // 保存头部高度
  134. this.maxheight = data.height - Math.floor((data.width / 750) * 470) - 44;
  135. // console.log(this.maxheight);
  136. }
  137. )
  138. .exec();
  139. },
  140. computed: {
  141. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  142. },
  143. data() {
  144. return {
  145. // 头部图高度
  146. maxheight: '',
  147. myPerformance:'',//我的业绩
  148. plotPerformance:'',//小区业绩
  149. push:'',//直推人数
  150. team:'',//团队人数
  151. achievement_month:'',//本月新增业绩
  152. small_achivement_month:'',// 本月新增小区业绩
  153. all: '', //累计奖励
  154. yesterday:'',//昨日
  155. today:'',//日期
  156. };
  157. },
  158. onLoad(options) {
  159. var myDate = new Date();
  160. this.today = myDate.getFullYear() + '年' + (myDate.getMonth()+1) + '月' + myDate.getDate() +'日';
  161. console.log(this.today)
  162. this.loadData(); //onload只是在第一次进入页面会刷新数据,从二级页面回来不会重新加载数据
  163. },
  164. onShow() {
  165. //onShow没有参数
  166. this.loadData(); //onshow在每次打开页面都会加载数据,可以用于数据在需要刷新的环境下
  167. },
  168. methods: {
  169. async loadData() {
  170. gitExtension({}).then(({data}) => {
  171. console.log(data)
  172. this.myPerformance = data.achievement;
  173. this.plotPerformance = data.small_achivement;
  174. this.push = data.recommend_num;
  175. this.team = data.group_num;
  176. this.achievement_month = data.achievement_month;
  177. this.small_achivement_month = data.small_achivement_month;
  178. this.all = data.all;
  179. this.all.all = this.all.pink*1 + this.all.recommend*1 + this.all.group*1;
  180. this.yesterday = data.yesterday;
  181. this.yesterday.all = this.yesterday.pink*1 + this.yesterday.recommend*1 + this.yesterday.group*1;
  182. })
  183. },
  184. // 页面跳转
  185. navto(e) {
  186. uni.navigateTo({
  187. url: e
  188. });
  189. },
  190. // 点击返回 我的页面
  191. toBack() {
  192. uni.switchTab({
  193. url: '/pages/user/user'
  194. });
  195. },
  196. }
  197. };
  198. </script>
  199. <style lang="scss">
  200. .status_bar {
  201. height: var(--status-bar-height);
  202. width: 100%;
  203. background: linear-gradient(90deg, #60bab0, #45969b);
  204. }
  205. page {
  206. background: #f8f8f8;
  207. height: 100%;
  208. }
  209. .content-money {
  210. padding-bottom: 30rpx;
  211. background: $page-color-base;
  212. .buttom-box {
  213. position: relative;
  214. background-color: #ffffff;
  215. text-align: center;
  216. margin: 0 30rpx;
  217. padding: 30rpx 0;
  218. border-radius: $border-radius-sm;
  219. margin-top: -80rpx;
  220. .buttom {
  221. font-size: $font-lg;
  222. flex-grow: 1;
  223. .money {
  224. font-weight: bold;
  225. font-size: 32rpx;
  226. color: #ff0000;
  227. }
  228. }
  229. .text {
  230. color: #666666;
  231. }
  232. .interval {
  233. width: 2rpx;
  234. height: 60rpx;
  235. background-color: #eeeeee;
  236. }
  237. .icon {
  238. height: 50rpx;
  239. width: 48rpx;
  240. margin: 0 auto;
  241. .icon-img {
  242. width: 100%;
  243. height: 100%;
  244. }
  245. }
  246. }
  247. }
  248. .money-box {
  249. // background: $base-color;
  250. height: 424rpx;
  251. color: #ffffff;
  252. text-align: center;
  253. font-size: 35rpx;
  254. position: relative;
  255. // padding-top: 60rpx;
  256. .header {
  257. position: absolute;
  258. left: 0;
  259. top: 0;
  260. width: 100%;
  261. height: 80rpx;
  262. font-size: 32rpx;
  263. font-weight: 700;
  264. z-index: 99;
  265. display: flex;
  266. justify-content: center;
  267. align-items: center;
  268. }
  269. .goback-box {
  270. position: absolute;
  271. left: 18rpx;
  272. top: 0;
  273. height: 80rpx;
  274. display: flex;
  275. align-items: center;
  276. }
  277. .goback {
  278. z-index: 100;
  279. width: 34rpx;
  280. height: 34rpx;
  281. }
  282. .tuiguang_bg {
  283. width: 750rpx;
  284. height: 424rpx;
  285. position: relative;
  286. }
  287. .right {
  288. position: absolute;
  289. top: 140rpx;
  290. right: 40rpx;
  291. text-align: right;
  292. line-height: 1;
  293. .right-num {
  294. font-size: 50rpx;
  295. font-family: PingFang SC;
  296. font-weight: bold;
  297. color: #FFFFFF;
  298. }
  299. .right-font {
  300. margin-top: 10rpx;
  301. font-size: 24rpx;
  302. font-family: PingFang SC;
  303. font-weight: 400;
  304. color: #FFFFFF;
  305. }
  306. .time {
  307. font-size: 26rpx;
  308. font-family: PingFang SC;
  309. font-weight: 500;
  310. color: #FFFFFF;
  311. line-height: 35px;
  312. }
  313. }
  314. .user {
  315. position: absolute;
  316. top: 140rpx;
  317. left: 34rpx;
  318. display: flex;
  319. justify-content: flex-start;
  320. align-items: center;
  321. z-index: 10;
  322. .avtor {
  323. width: 102rpx;
  324. height: 102rpx;
  325. border-radius: 50%;
  326. position: relative;
  327. .portrait {
  328. width: 100%;
  329. height: 100%;
  330. border-radius: 50%;
  331. }
  332. .he {
  333. position: absolute;
  334. height: 30rpx;
  335. bottom: -4rpx;
  336. left: 0;
  337. .image {
  338. width: 102rpx;
  339. height: 30rpx;
  340. }
  341. }
  342. }
  343. .name {
  344. margin-left: 30rpx;
  345. font-size: 36rpx;
  346. font-family: PingFang SC;
  347. font-weight: 500;
  348. color: #ffffff;
  349. display: flex;
  350. justify-content: start;
  351. .name-left {
  352. width: 220rpx;
  353. }
  354. .name-right {
  355. margin-left: 20rpx;
  356. width: 50rpx;
  357. height: 60rpx;
  358. position: relative;
  359. image {
  360. width: 100%;
  361. height: 100%;
  362. }
  363. .level {
  364. position: absolute;
  365. top: 35%;
  366. left: 50%;
  367. margin-left: -12rpx;
  368. font-size: 20rpx;
  369. }
  370. }
  371. }
  372. .id {
  373. margin-left: 30rpx;
  374. font-size: 30rpx;
  375. font-family: PingFang SC;
  376. font-weight: 500;
  377. color: #ffffff;
  378. }
  379. }
  380. .money_img {
  381. width: 100%;
  382. height: 120rpx;
  383. text-align: center;
  384. padding-top: 50rpx;
  385. padding-bottom: 135rpx;
  386. image {
  387. width: 120rpx;
  388. height: 120rpx;
  389. border: 4rpx solid #fd5f6f;
  390. border-radius: 50%;
  391. }
  392. }
  393. .money-frame {
  394. position: absolute;
  395. top: 0;
  396. width: 100%;
  397. padding-top: 120rpx;
  398. // left: 30rpx;
  399. // height: 460rpx;
  400. // display: flex;
  401. // align-items: flex-start;
  402. // flex-direction: column;
  403. // justify-content: center;
  404. }
  405. .money_name {
  406. width: 100%;
  407. text-align: center;
  408. font-size: 32rpx;
  409. font-family: PingFang SC;
  410. font-weight: bold;
  411. color: #ffffff;
  412. }
  413. .money_num {
  414. font-size: 72rpx;
  415. font-family: PingFang SC;
  416. font-weight: bold;
  417. color: #ffffff;
  418. .money_ren {
  419. font-size: 36rpx;
  420. }
  421. }
  422. }
  423. .navbar {
  424. display: flex;
  425. height: 40px;
  426. padding: 0 5px;
  427. background: #fff;
  428. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  429. position: relative;
  430. z-index: 10;
  431. .nav-item {
  432. flex: 1;
  433. display: flex;
  434. justify-content: center;
  435. align-items: center;
  436. height: 100%;
  437. font-size: 15px;
  438. color: $font-color-dark;
  439. position: relative;
  440. &.current {
  441. color: #ff0000;
  442. &:after {
  443. content: '';
  444. position: absolute;
  445. left: 50%;
  446. bottom: 0;
  447. transform: translateX(-50%);
  448. width: 44px;
  449. height: 0;
  450. border-bottom: 2px solid #ff0000;
  451. }
  452. }
  453. }
  454. }
  455. .main {
  456. position: relative;
  457. z-index: 10;
  458. width: 691rpx;
  459. height: auto;
  460. background: #ffffff;
  461. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  462. border-radius: 20rpx;
  463. margin: -160rpx auto 0;
  464. padding: 40rpx 40rpx;
  465. .today {
  466. position: absolute;
  467. top: -50rpx;
  468. right: 20rpx;
  469. color: #fff;
  470. }
  471. .main-box {
  472. flex-direction: column;
  473. align-items: center;
  474. .bottom {
  475. margin-top: 20rpx;
  476. }
  477. .item {
  478. display: flex;
  479. flex-direction: column;
  480. align-items: center;
  481. .num {
  482. font-size: 38rpx;
  483. font-family: PingFang SC;
  484. font-weight: bold;
  485. color: #0f253a;
  486. }
  487. .font {
  488. font-size: 24rpx;
  489. font-family: PingFang SC;
  490. font-weight: bold;
  491. color: #6d7c88;
  492. margin-top: 18rpx;
  493. }
  494. }
  495. }
  496. }
  497. .box {
  498. width: 690rpx;
  499. background: #FFFFFF;
  500. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  501. border-radius: 20rpx;
  502. margin: 20rpx auto;
  503. padding: 34rpx;
  504. .box-item:first-child{
  505. margin-top: 0;
  506. }
  507. .box-item {
  508. margin-top: 20rpx;
  509. justify-content: space-between;
  510. align-items: center;
  511. .box-left {
  512. font-size: 26rpx;
  513. font-family: PingFang SC;
  514. font-weight: 500;
  515. color: #6D7C88;
  516. }
  517. .box-right {
  518. font-size: 26rpx;
  519. font-family: PingFang SC;
  520. font-weight: bold;
  521. color: #0F253A;
  522. }
  523. }
  524. }
  525. .liebiao {
  526. width: 692rpx;
  527. background: #FFFFFF;
  528. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  529. border-radius: 20rpx;
  530. padding: 34rpx;
  531. margin: 24rpx auto 0;
  532. align-items: center;
  533. .left {
  534. justify-content: flex-start;
  535. align-items: center;
  536. image {
  537. width: 46rpx;
  538. height: 36rpx;
  539. }
  540. .leibiao-font{
  541. margin-left: 10rpx;
  542. font-size: 32rpx;
  543. font-family: PingFang SC;
  544. font-weight: bold;
  545. color: #333333;
  546. }
  547. }
  548. image {
  549. width: 15rpx;
  550. height: 27rpx;
  551. }
  552. }
  553. </style>