index.vue 17 KB

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