index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. <template>
  2. <view :style="colorStyle">
  3. <view class='my-promotion'>
  4. <view class="header header-height">
  5. <view class="user-msg">
  6. <view class="acator">
  7. <image :src="userInfo.avatar" mode=""></image>
  8. </view>
  9. <view class="msg">
  10. <view class="name">{{userInfo.nickname}}</view>
  11. <view class="process" v-if="levelList.length">
  12. <view :style="{width: `${speedAll}%`}" class="fill"></view>
  13. </view>
  14. <view class="level-info" v-if="levelInfo.id">
  15. <text class="mr20">一级上浮 {{levelInfo.one_brokerage}}%</text>
  16. <text>二级上浮 {{levelInfo.two_brokerage}}%</text>
  17. </view>
  18. <view v-else class="level-info">普通用户</view>
  19. </view>
  20. <view class="invite" @click="jumbPath(5)">
  21. <view class="poster-in">
  22. <image src="../static/gz.png" mode=""></image>
  23. </view>
  24. <text class="text">活动规则</text>
  25. </view>
  26. </view>
  27. <view class="tesk" v-if="levelList.length">
  28. <view class="tesk-l">
  29. <view class="upgrade">
  30. <image src="../static/sj.png" mode=""></image>
  31. </view>
  32. <view class="line"></view>
  33. <view class="">
  34. <view class="fx-leavel" @click="jumbPath(10)">
  35. <view class="">
  36. {{levelInfo.name || '等级未解锁'}}
  37. </view>
  38. <view class="point"></view>
  39. </view>
  40. <view class="fx-trip">
  41. 下单、邀请好友等均可提高等级
  42. </view>
  43. </view>
  44. </view>
  45. <view class="tesk-r" @click="taskShow = true">
  46. 做任务
  47. </view>
  48. </view>
  49. </view>
  50. <view class="price-box" :class="!headerStatus ? 'header-height':''">
  51. <view class="box-top">
  52. <view class="" @click="jumbPath(0)">
  53. 可提现金额
  54. <text class="iconfont icon-xiangyou"></text>
  55. </view>
  56. <view class="" @click="jumbPath(7)">
  57. 提现记录
  58. <text class="iconfont icon-xiangyou"></text>
  59. </view>
  60. </view>
  61. <view class="com-count" @click="jumbPath(6)">
  62. {{userInfo.commissionCount || 0.00}}
  63. </view>
  64. <view class="box-btn">
  65. <view class="item">
  66. <view class="text">
  67. 待提现佣金
  68. </view>
  69. <view class="num">
  70. {{userInfo.brokerage_price || 0.00}}
  71. </view>
  72. </view>
  73. <view class="item in">
  74. <view class="item-cn">
  75. <view class="text">
  76. 已提现佣金
  77. </view>
  78. <view class="num">
  79. {{userInfo.extract_price || 0.00}}
  80. </view>
  81. </view>
  82. </view>
  83. <view class="item in">
  84. <view class="item-cn">
  85. <view class="text">
  86. 冻结佣金
  87. </view>
  88. <view class="num">
  89. {{userInfo.broken_commission || 0.00}}
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <view class="btn" @click="jumbPath(0)">
  95. 立即提现
  96. </view>
  97. </view>
  98. <view class="price-box" >
  99. <view class="box-top">
  100. <view >
  101. 团队业绩
  102. </view>
  103. </view>
  104. <view class="com-count">
  105. {{userInfo.achievement || 0.00}}
  106. </view>
  107. </view>
  108. <view class="statistics">
  109. <view class="item mb" @click="jumbPath(9)">
  110. <view class="img">
  111. <text class="iconfont icon-wodetuandui"></text>
  112. </view>
  113. <view class="item-r">
  114. <view class="text">我的团队</view>
  115. <view class="trip">{{userInfo.spread_count || 0}}人</view>
  116. </view>
  117. </view>
  118. <view class="item mb" @click="jumbPath(8)">
  119. <view class="img">
  120. <text class="iconfont icon-fenxiaodingdan"></text>
  121. </view>
  122. <view class="item-r">
  123. <view class="text">分销订单</view>
  124. <view class="trip">{{userInfo.spread_order_count || 0}}笔</view>
  125. </view>
  126. </view>
  127. <view class="item mb" @click="jumbPath(5)">
  128. <view class="img">
  129. <text class="iconfont icon-yaoqinghaoyou1"></text>
  130. </view>
  131. <view class="item-r">
  132. <view class="text">邀请好友</view>
  133. <view class="trip">邀请好友赚奖励</view>
  134. </view>
  135. </view>
  136. <view class="item mb" @click="jumbPath(10)">
  137. <view class="img">
  138. <text class="iconfont icon-xingzhuangjiehe"></text>
  139. </view>
  140. <view class="item-r">
  141. <view class="text">等级说明</view>
  142. <view class="trip">分销等级说明</view>
  143. </view>
  144. </view>
  145. <!-- <view class="item" @click="jumbPath(2)">
  146. <view class="img">
  147. <text class="iconfont icon-yongjinpaihang1"></text>
  148. </view>
  149. <view class="item-r">
  150. <view class="text">佣金排行</view>
  151. <view class="trip">您的排名为{{userInfo.position_count || '-'}}</view>
  152. </view>
  153. </view> -->
  154. <!-- <view class="item" @click="jumbPath(1)">
  155. <view class="img">
  156. <text class="iconfont icon-tuiguangrenpaihang1"></text>
  157. </view>
  158. <view class="item-r">
  159. <view class="text">推广人排行</view>
  160. <view class="trip">您的排名为{{userInfo.rank_count || '-'}}</view>
  161. </view>
  162. </view> -->
  163. </view>
  164. </view>
  165. <task :inv-show="taskShow" :task="task" @inv-close="()=>{taskShow= false}"></task>
  166. <!-- #ifdef MP -->
  167. <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
  168. <!-- #endif -->
  169. </view>
  170. </template>
  171. <script>
  172. import {
  173. getUserInfo,
  174. agentLevelList,
  175. agentLevelTaskList,
  176. moneyList,
  177. spreadOrder,
  178. spreadPeople
  179. } from '@/api/user.js';
  180. import {
  181. openExtrctSubscribe
  182. } from '@/utils/SubscribeMessage.js';
  183. import {
  184. toLogin
  185. } from '@/libs/login.js';
  186. import task from './components/task.vue'
  187. import {
  188. mapGetters
  189. } from "vuex";
  190. import home from '@/components/home';
  191. import colors from '@/mixins/color.js'
  192. export default {
  193. components: {
  194. home,
  195. task
  196. },
  197. mixins: [colors],
  198. data() {
  199. return {
  200. userInfo: {},
  201. taskShow: false,
  202. yesterdayPrice: 0.00,
  203. isAuto: false, //没有授权的不会自动授权
  204. isShowAuth: false, //是否隐藏授权
  205. distributionLevel: [],
  206. levelList: [],
  207. task: [],
  208. levelInfo: {},
  209. tabs: [{
  210. name: '佣金',
  211. }, {
  212. name: '订单'
  213. }, {
  214. name: '推广人'
  215. }],
  216. listData: [],
  217. sel: 0,
  218. speedAll: 0,
  219. headerStatus: false
  220. };
  221. },
  222. computed: mapGetters(['isLogin']),
  223. watch: {
  224. isLogin: {
  225. handler: function(newV, oldV) {
  226. if (newV) {
  227. //this.getUserInfo();
  228. }
  229. },
  230. deep: true
  231. }
  232. },
  233. onLoad() {
  234. if (this.isLogin) {
  235. this.agentLevelList()
  236. // this.getUserInfo()
  237. this.clickTab(0);
  238. } else {
  239. toLogin()
  240. }
  241. },
  242. onShow() {
  243. uni.removeStorageSync('form_type_cart');
  244. },
  245. methods: {
  246. agentLevelList() {
  247. agentLevelList().then(res => {
  248. const {
  249. level_info,
  250. level_list,
  251. task,
  252. user
  253. } = res.data;
  254. this.levelInfo = level_info;
  255. this.userInfo = user;
  256. this.taskInfo = task;
  257. this.levelList = level_list;
  258. this.headerStatus = level_list.length ? true : false;
  259. this.level_id = level_info.id || 0;
  260. const index = level_list.findIndex((
  261. grade, v
  262. ) =>
  263. grade.id === user.agent_level
  264. );
  265. if (index !== -1) {
  266. this.swiperIndex = index === -1 ? 0 : (index + 1);
  267. }
  268. let info = this.levelList[index === -1 ? 0 : (index + 1)];
  269. this.level_id = (info !== undefined ? info.id : 0) || 0;
  270. this.getTask()
  271. });
  272. },
  273. /**
  274. * 获取任务要求
  275. */
  276. getTask() {
  277. let that = this;
  278. that.taskNum = 0
  279. agentLevelTaskList(that.level_id).then(res => {
  280. that.task = res.data.list
  281. that.speedAll = res.data.speedAll
  282. });
  283. },
  284. onLoadFun() {
  285. this.agentLevelList()
  286. this.clickTab(0);
  287. this.isShowAuth = false;
  288. },
  289. //跳转
  290. jumbPath(type) {
  291. let path = [
  292. '/pages/users/user_cash/index',
  293. '/pages/users/promoter_rank/index',
  294. '/pages/users/commission_rank/index',
  295. '/pages/users/user_spread_code/index',
  296. '/pages/users/user_vip/index',
  297. '/pages/extension/invite_friend/index',
  298. '/pages/users/user_spread_money/index?type=1',
  299. '/pages/users/user_spread_money/index?type=4',
  300. '/pages/users/promoter-order/index',
  301. '/pages/users/promoter-list/index',
  302. '/pages/users/user_distribution_level/index',
  303. ]
  304. uni.navigateTo({
  305. url: path[type]
  306. })
  307. },
  308. // 授权关闭
  309. authColse(e) {
  310. this.isShowAuth = e
  311. },
  312. openSubscribe(page) {
  313. uni.showLoading({
  314. title: '正在加载',
  315. })
  316. openExtrctSubscribe().then(res => {
  317. uni.hideLoading();
  318. uni.navigateTo({
  319. url: page,
  320. });
  321. }).catch(() => {
  322. uni.hideLoading();
  323. });
  324. },
  325. /**
  326. * 获取个人用户信息
  327. */
  328. getUserInfo() {
  329. let that = this;
  330. getUserInfo().then(res => {
  331. that.$set(that, 'userInfo', res.data);
  332. if (!res.data.spread_status) {
  333. that.$util.Tips({
  334. title: "您目前暂无推广权限"
  335. }, {
  336. tab: 4,
  337. url: '/pages/index/index'
  338. });
  339. }
  340. });
  341. },
  342. clickTab(index) {
  343. this.sel = index
  344. let mets = [moneyList, spreadOrder, spreadPeople]
  345. let data = {
  346. keyword: "",
  347. start: 0,
  348. stop: 0,
  349. page: 1,
  350. limit: 10
  351. }
  352. if (index == 2) {
  353. data = {
  354. ...data,
  355. grade: 0,
  356. sort: '',
  357. }
  358. }
  359. mets[index](data, 3).then(res => {
  360. this.listData = res.data.list
  361. })
  362. // if (index == 0) {} else if (index == 1) {
  363. // this.getRecordOrderList()
  364. // } else {
  365. // this.userSpreadNewList()
  366. // }
  367. },
  368. }
  369. }
  370. </script>
  371. <style scoped lang="scss">
  372. .my-promotion {
  373. .header {
  374. background: #212230 url('../static/fxbg.png') no-repeat;
  375. background-size: 100% 100%;
  376. padding: 48rpx 30rpx;
  377. color: #fff;
  378. position: relative;
  379. height: 328rpx;
  380. .user-msg {
  381. display: flex;
  382. align-items: flex-start;
  383. width: 100%;
  384. .acator {
  385. width: 90rpx;
  386. height: 90rpx;
  387. margin-right: 20rpx;
  388. image {
  389. width: 100%;
  390. height: 100%;
  391. border-radius: 50%;
  392. }
  393. }
  394. .msg {
  395. display: flex;
  396. flex-direction: column;
  397. .name {
  398. font-size: 30rpx;
  399. font-weight: bold;
  400. }
  401. .process {
  402. width: 380rpx;
  403. height: 6rpx;
  404. border-radius: 6rpx;
  405. background: #4D4E59;
  406. margin: 20rpx 0;
  407. .fill {
  408. height: 100%;
  409. border-radius: 6rpx;
  410. background-color: #fff;
  411. }
  412. }
  413. .level-info {
  414. font-size: 20rpx;
  415. .mr20 {
  416. margin-right: 40rpx;
  417. }
  418. }
  419. }
  420. .invite {
  421. display: flex;
  422. align-items: center;
  423. position: absolute;
  424. right: 0rpx;
  425. background: rgba(255, 255, 255, 0.14);
  426. border-radius: 32px 0px 0px 32px;
  427. color: #FFFFFF;
  428. padding: 10rpx 16rpx 10rpx 8rpx;
  429. .poster-in {
  430. width: 20rpx;
  431. height: 20rpx;
  432. display: flex;
  433. align-items: center;
  434. margin-right: 8rpx;
  435. image {
  436. width: 100%;
  437. height: 100%;
  438. }
  439. }
  440. .text {
  441. font-size: 20rpx;
  442. }
  443. }
  444. }
  445. .tesk {
  446. position: absolute;
  447. bottom: 0;
  448. width: 690rpx;
  449. height: 128rpx;
  450. background: linear-gradient(135deg, #FEE8C7 0%, #FFBD6B 100%);
  451. border-radius: 6px 6px 0px 0px;
  452. padding: 24rpx 30rpx;
  453. display: flex;
  454. justify-content: space-between;
  455. align-items: center;
  456. .line {
  457. width: 1px;
  458. height: 74rpx;
  459. background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #9B5900 52%, rgba(255, 255, 255, 0) 100%);
  460. opacity: 0.2;
  461. margin: 0 26rpx;
  462. }
  463. .tesk-l {
  464. display: flex;
  465. align-items: center;
  466. .fx-leavel {
  467. display: flex;
  468. align-items: center;
  469. color: #9B5900;
  470. font-size: 30rpx;
  471. font-weight: bold;
  472. .point {
  473. margin-left: 20rpx;
  474. width: 0;
  475. height: 0;
  476. border-top: 8rpx solid transparent;
  477. border-left: 8rpx solid #9B5900;
  478. border-bottom: 8rpx solid transparent;
  479. }
  480. }
  481. .fx-trip {
  482. color: #9B5900;
  483. font-size: 24rpx;
  484. margin-top: 14rpx;
  485. }
  486. .upgrade {
  487. width: 68rpx;
  488. height: 68rpx;
  489. image {
  490. width: 100%;
  491. height: 100%;
  492. }
  493. }
  494. }
  495. .tesk-r {
  496. padding: 10rpx 20rpx;
  497. color: #9B5900;
  498. font-size: 24rpx;
  499. font-weight: 400;
  500. text-align: center;
  501. background: #FFFFFF;
  502. border-radius: 40rpx;
  503. }
  504. }
  505. }
  506. .price-box.header-height {
  507. position: relative;
  508. margin-top: -150rpx;
  509. }
  510. .price-box {
  511. padding: 48rpx 32rpx;
  512. background-color: #fff;
  513. margin: 24rpx 30rpx;
  514. border-radius: 12px;
  515. .box-top {
  516. display: flex;
  517. justify-content: space-between;
  518. color: #777777;
  519. font-size: 24rpx;
  520. .icon-xiangyou {
  521. font-size: 24rpx;
  522. }
  523. }
  524. .com-count {
  525. color: #EB0000;
  526. font-size: 42rpx;
  527. font-weight: bold;
  528. margin-top: 16rpx;
  529. }
  530. .box-btn {
  531. display: flex;
  532. justify-content: space-between;
  533. margin-top: 44rpx;
  534. .in {
  535. display: flex;
  536. justify-content: center;
  537. align-items: center;
  538. flex-direction: column;
  539. }
  540. .item {
  541. width: 100%;
  542. .item-cn {
  543. display: flex;
  544. justify-content: center;
  545. flex-direction: column;
  546. }
  547. .text {
  548. color: #777777;
  549. font-size: 24rpx;
  550. margin-bottom: 20rpx;
  551. }
  552. .num {
  553. color: #333333;
  554. font-size: 36rpx;
  555. font-weight: bold;
  556. }
  557. }
  558. }
  559. .btn {
  560. display: flex;
  561. color: #9B5900;
  562. background: linear-gradient(135deg, #FEE8C7 0%, #FFBD6B 100%);
  563. border-radius: 46px;
  564. align-items: center;
  565. justify-content: center;
  566. padding: 32rpx 0;
  567. margin-top: 48rpx;
  568. font-size: 30rpx;
  569. line-height: 30rpx;
  570. font-weight: bold;
  571. margin: 48rpx 10rpx 0 10rpx;
  572. }
  573. }
  574. .statistics {
  575. display: flex;
  576. flex-wrap: wrap;
  577. background-color: #fff;
  578. margin: 24rpx 30rpx;
  579. border-radius: 12px;
  580. padding: 40rpx 46rpx 40rpx 0;
  581. .mb {
  582. margin-bottom: 64rpx;
  583. }
  584. .item {
  585. width: 50%;
  586. display: flex;
  587. align-items: center;
  588. padding-left: 50rpx;
  589. .img {
  590. width: 46rpx;
  591. height: 46rpx;
  592. margin-right: 22rpx;
  593. .iconfont {
  594. font-size: 40rpx !important;
  595. font-weight: bold;
  596. }
  597. }
  598. .item-r {
  599. .text {
  600. font-size: 26rpx;
  601. color: #333333;
  602. margin-bottom: 12rpx;
  603. }
  604. .trip {
  605. color: #999999;
  606. font-size: 22rpx;
  607. }
  608. }
  609. }
  610. }
  611. // ---------------------------------------
  612. .data {
  613. margin: 28rpx 30rpx;
  614. background-color: #fff;
  615. width: 690rpx;
  616. border-radius: 12rpx;
  617. .data-num {
  618. height: 168rpx;
  619. background: url('../static/data-num.png') no-repeat;
  620. background-size: 100% 100%;
  621. display: flex;
  622. align-items: center;
  623. justify-content: space-around;
  624. color: #fff;
  625. font-size: 24rpx;
  626. .num {}
  627. .num-color {
  628. margin-top: 20rpx;
  629. font-weight: bold;
  630. font-size: 36rpx;
  631. }
  632. }
  633. .data-money {
  634. display: flex;
  635. justify-content: space-between;
  636. color: #333;
  637. padding: 16rpx 30rpx;
  638. font-size: 24rpx;
  639. .money {
  640. display: flex;
  641. align-items: center;
  642. color: #333333;
  643. }
  644. .money-num {
  645. color: #E93323;
  646. font-size: 28rpx;
  647. font-weight: bold;
  648. padding-left: 20rpx;
  649. }
  650. .btn {
  651. width: 160rpx;
  652. background: linear-gradient(135deg, #FEA21F 0%, #FE7A18 100%);
  653. border-radius: 38rpx;
  654. color: #fff;
  655. text-align: center;
  656. padding: 16rpx 0;
  657. font-size: 26rpx;
  658. }
  659. }
  660. }
  661. .invites {
  662. width: 690rpx;
  663. margin: 28rpx 30rpx;
  664. background-color: #fff;
  665. border-radius: 12rpx;
  666. font-size: 26rpx;
  667. color: #333;
  668. padding: 40rpx 46rpx;
  669. .invite-list {
  670. display: flex;
  671. .item {
  672. margin-right: 48rpx;
  673. display: flex;
  674. flex-direction: column;
  675. align-items: center;
  676. .img {
  677. width: 60rpx;
  678. height: 60rpx;
  679. margin-bottom: 24rpx;
  680. image {
  681. width: 100%;
  682. height: 100%;
  683. border-radius: 50%;
  684. }
  685. }
  686. }
  687. }
  688. }
  689. .list {
  690. width: 690rpx;
  691. margin: 28rpx 30rpx;
  692. background-color: #fff;
  693. border-radius: 12rpx;
  694. font-size: 28rpx;
  695. .tab-list {
  696. display: flex;
  697. justify-content: space-between;
  698. padding: 32rpx 30rpx 0 30rpx;
  699. color: #999999;
  700. .tab {
  701. display: flex;
  702. .item {
  703. margin-right: 48rpx;
  704. transition: all 0.3s;
  705. .item-text {}
  706. .line {
  707. width: 54rpx;
  708. height: 4rpx;
  709. margin: 12rpx auto 0 auto;
  710. border-radius: 4px;
  711. }
  712. .line.on {
  713. background-color: #E93323;
  714. }
  715. }
  716. .item .on {
  717. font-size: 32rpx;
  718. font-weight: bold;
  719. color: #E93323;
  720. }
  721. }
  722. }
  723. .more {
  724. display: flex;
  725. align-items: center;
  726. font-size: 26rpx;
  727. .icon-xiangyou {
  728. font-size: 24rpx;
  729. }
  730. }
  731. }
  732. }
  733. </style>