index.vue 17 KB

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