123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801 |
- <template>
- <view :style="colorStyle">
- <view class='my-promotion'>
- <view class="header header-height">
- <view class="user-msg">
- <view class="acator">
- <image :src="userInfo.avatar" mode=""></image>
- </view>
- <view class="msg">
- <view class="name">{{userInfo.nickname}}</view>
- <view class="process" v-if="levelList.length">
- <view :style="{width: `${speedAll}%`}" class="fill"></view>
- </view>
- <view class="level-info" v-if="levelInfo.id">
- <text class="mr20">一级上浮 {{levelInfo.one_brokerage}}%</text>
- <text>二级上浮 {{levelInfo.two_brokerage}}%</text>
- </view>
- <view v-else class="level-info">普通用户</view>
- </view>
- <view class="invite" @click="jumbPath(5)">
- <view class="poster-in">
- <image src="../static/gz.png" mode=""></image>
- </view>
- <text class="text">活动规则</text>
- </view>
- </view>
- <view class="tesk" v-if="levelList.length">
- <view class="tesk-l">
- <view class="upgrade">
- <image src="../static/sj.png" mode=""></image>
- </view>
- <view class="line"></view>
- <view class="">
- <view class="fx-leavel" @click="jumbPath(10)">
- <view class="">
- {{levelInfo.name || '等级未解锁'}}
- </view>
- <view class="point"></view>
- </view>
- <view class="fx-trip">
- 下单、邀请好友等均可提高等级
- </view>
- </view>
- </view>
- <view class="tesk-r" @click="taskShow = true">
- 做任务
- </view>
- </view>
- </view>
- <view class="price-box" :class="!headerStatus ? 'header-height':''">
- <view class="box-top">
- <view class="" @click="jumbPath(6)">
- 可提现金额
- <text class="iconfont icon-xiangyou"></text>
- </view>
- <view class="" @click="jumbPath(7)">
- 提现记录
- <text class="iconfont icon-xiangyou"></text>
- </view>
- </view>
- <view class="com-count" @click="jumbPath(6)">
- {{userInfo.commissionCount || 0.00}}
- </view>
- <view class="box-btn">
- <view class="item">
- <view class="text">
- 待提现佣金
- </view>
- <view class="num">
- {{userInfo.brokerage_price || 0.00}}
- </view>
- </view>
- <view class="item in">
- <view class="item-cn">
- <view class="text">
- 已提现佣金
- </view>
- <view class="num">
- {{userInfo.extract_price || 0.00}}
- </view>
- </view>
- </view>
- <view class="item in">
- <view class="item-cn">
- <view class="text">
- 冻结佣金
- </view>
- <view class="num">
- {{userInfo.broken_commission || 0.00}}
- </view>
- </view>
- </view>
- </view>
- <view class="btn" @click="jumbPath(0)">
- 立即提现
- </view>
- </view>
- <view class="statistics">
- <view class="item mb" @click="jumbPath(9)">
- <view class="img">
- <text class="iconfont icon-wodetuandui"></text>
- </view>
- <view class="item-r">
- <view class="text">我的团队</view>
- <view class="trip">{{userInfo.spread_count || 0}}人</view>
- </view>
- </view>
- <view class="item mb" @click="jumbPath(8)">
- <view class="img">
- <text class="iconfont icon-fenxiaodingdan"></text>
- </view>
- <view class="item-r">
- <view class="text">分销订单</view>
- <view class="trip">{{userInfo.spread_order_count || 0}}笔</view>
- </view>
- </view>
- <view class="item mb" @click="jumbPath(5)">
- <view class="img">
- <text class="iconfont icon-yaoqinghaoyou1"></text>
- </view>
- <view class="item-r">
- <view class="text">邀请好友</view>
- <view class="trip">邀请好友赚奖励</view>
- </view>
- </view>
- <view class="item mb" @click="jumbPath(10)">
- <view class="img">
- <text class="iconfont icon-xingzhuangjiehe"></text>
- </view>
- <view class="item-r">
- <view class="text">等级说明</view>
- <view class="trip">分销等级说明</view>
- </view>
- </view>
- <!-- <view class="item" @click="jumbPath(2)">
- <view class="img">
- <text class="iconfont icon-yongjinpaihang1"></text>
- </view>
- <view class="item-r">
- <view class="text">佣金排行</view>
- <view class="trip">您的排名为{{userInfo.position_coun || '-'}}</view>
- </view>
- </view>
- <view class="item" @click="jumbPath(1)">
- <view class="img">
- <text class="iconfont icon-tuiguangrenpaihang1"></text>
- </view>
- <view class="item-r">
- <view class="text">推广人排行</view>
- <view class="trip">您的排名为{{userInfo.rank_count || '-'}}</view>
- </view>
- </view> -->
- </view>
- </view>
- <task :inv-show="taskShow" :task="task" @inv-close="()=>{taskShow= false}"></task>
- <!-- #ifdef MP -->
- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
- <!-- #endif -->
- </view>
- </template>
- <script>
- import {
- getUserInfo,
- agentLevelList,
- agentLevelTaskList,
- moneyList,
- spreadOrder,
- spreadPeople
- } from '@/api/user.js';
- import {
- openExtrctSubscribe
- } from '@/utils/SubscribeMessage.js';
- import {
- toLogin
- } from '@/libs/login.js';
- import task from './components/task.vue'
- import {
- mapGetters
- } from "vuex";
- import home from '@/components/home';
- import colors from '@/mixins/color.js'
- export default {
- components: {
- home,
- task
- },
- mixins: [colors],
- data() {
- return {
- userInfo: {},
- taskShow: false,
- yesterdayPrice: 0.00,
- isAuto: false, //没有授权的不会自动授权
- isShowAuth: false, //是否隐藏授权
- distributionLevel: [],
- levelList: [],
- task: [],
- levelInfo: {},
- tabs: [{
- name: '佣金',
- }, {
- name: '订单'
- }, {
- name: '推广人'
- }],
- listData: [],
- sel: 0,
- speedAll: 0,
- headerStatus: false
- };
- },
- computed: mapGetters(['isLogin']),
- watch: {
- isLogin: {
- handler: function(newV, oldV) {
- if (newV) {
- //this.getUserInfo();
- }
- },
- deep: true
- }
- },
- onLoad() {
- if (this.isLogin) {
- this.agentLevelList()
- // this.getUserInfo()
- this.clickTab(0);
- } else {
- // #ifdef H5 || APP-PLUS
- toLogin()
- // #endif
- // #ifdef MP
- this.isShowAuth = true;
- // #endif
- }
- },
- onShow() {
- uni.removeStorageSync('form_type_cart');
- },
- methods: {
- agentLevelList() {
- agentLevelList().then(res => {
- const {
- level_info,
- level_list,
- task,
- user
- } = res.data;
- this.levelInfo = level_info;
- this.userInfo = user;
- this.taskInfo = task;
- this.levelList = level_list;
- this.headerStatus = level_list.length ? true : false;
- this.level_id = level_info.id || 0;
- const index = level_list.findIndex((
- grade, v
- ) =>
- grade.id === user.agent_level
- );
- console.log(index)
- if (index !== -1) {
- this.swiperIndex = index === -1 ? 0 : (index + 1);
- }
- this.level_id = this.levelList[index === -1 ? 0 : (index + 1)].id || 0;
- this.getTask()
- });
- },
- /**
- * 获取任务要求
- */
- getTask() {
- let that = this;
- that.taskNum = 0
- agentLevelTaskList(that.level_id).then(res => {
- that.task = res.data.list
- that.speedAll = res.data.speedAll
- });
- },
- onLoadFun() {
- this.agentLevelList()
- this.clickTab(0);
- this.isShowAuth = false;
- },
- //跳转
- jumbPath(type) {
- let path = [
- '/pages/users/user_cash/index',
- '/pages/users/promoter_rank/index',
- '/pages/users/commission_rank/index',
- '/pages/users/user_spread_code/index',
- '/pages/users/user_vip/index',
- '/pages/extension/invite_friend/index',
- '/pages/users/user_spread_money/index?type=1',
- '/pages/users/user_spread_money/index?type=4',
- '/pages/users/promoter-order/index',
- '/pages/users/promoter-list/index',
- '/pages/users/user_distribution_level/index',
- ]
- uni.navigateTo({
- url: path[type]
- })
- },
- // 授权关闭
- authColse(e) {
- this.isShowAuth = e
- },
- openSubscribe(page) {
- uni.showLoading({
- title: '正在加载',
- })
- openExtrctSubscribe().then(res => {
- uni.hideLoading();
- uni.navigateTo({
- url: page,
- });
- }).catch(() => {
- uni.hideLoading();
- });
- },
- /**
- * 获取个人用户信息
- */
- getUserInfo() {
- let that = this;
- getUserInfo().then(res => {
- that.$set(that, 'userInfo', res.data);
- if (!res.data.spread_status) {
- that.$util.Tips({
- title: "您目前暂无推广权限"
- }, {
- tab: 4,
- url: '/pages/index/index'
- });
- }
- });
- },
- clickTab(index) {
- this.sel = index
- let mets = [moneyList, spreadOrder, spreadPeople]
- let data = {
- keyword: "",
- start: 0,
- stop: 0,
- page: 1,
- limit: 10
- }
- if (index == 2) {
- data = {
- ...data,
- grade: 0,
- sort: '',
- }
- }
- mets[index](data, 3).then(res => {
- this.listData = res.data.list
- })
- // if (index == 0) {} else if (index == 1) {
- // this.getRecordOrderList()
- // } else {
- // this.userSpreadNewList()
- // }
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .my-promotion {
- .header {
- background: #212230 url('../static/fxbg.png') no-repeat;
- background-size: 100% 100%;
- padding: 48rpx 30rpx;
- color: #fff;
- position: relative;
- height: 328rpx;
- .user-msg {
- display: flex;
- align-items: flex-start;
- width: 100%;
- .acator {
- width: 90rpx;
- height: 90rpx;
- margin-right: 20rpx;
- image {
- width: 100%;
- height: 100%;
- border-radius: 50%;
- }
- }
- .msg {
- display: flex;
- flex-direction: column;
- .name {
- font-size: 30rpx;
- font-weight: bold;
- }
- .process {
- width: 380rpx;
- height: 6rpx;
- border-radius: 6rpx;
- background: #4D4E59;
- margin: 20rpx 0;
- .fill {
- height: 100%;
- border-radius: 6rpx;
- background-color: #fff;
- }
- }
- .level-info {
- font-size: 20rpx;
- .mr20 {
- margin-right: 40rpx;
- }
- }
- }
- .invite {
- display: flex;
- align-items: center;
- position: absolute;
- right: 0rpx;
- background: rgba(255, 255, 255, 0.14);
- border-radius: 32px 0px 0px 32px;
- color: #FFFFFF;
- padding: 10rpx 16rpx 10rpx 8rpx;
- .poster-in {
- width: 20rpx;
- height: 20rpx;
- display: flex;
- align-items: center;
- margin-right: 8rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .text {
- font-size: 20rpx;
- }
- }
- }
- .tesk {
- position: absolute;
- bottom: 0;
- width: 690rpx;
- height: 128rpx;
- background: linear-gradient(135deg, #FEE8C7 0%, #FFBD6B 100%);
- border-radius: 6px 6px 0px 0px;
- padding: 24rpx 30rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .line {
- width: 1px;
- height: 74rpx;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #9B5900 52%, rgba(255, 255, 255, 0) 100%);
- opacity: 0.2;
- margin: 0 26rpx;
- }
- .tesk-l {
- display: flex;
- align-items: center;
- .fx-leavel {
- display: flex;
- align-items: center;
- color: #9B5900;
- font-size: 30rpx;
- font-weight: bold;
- .point {
- margin-left: 20rpx;
- width: 0;
- height: 0;
- border-top: 8rpx solid transparent;
- border-left: 8rpx solid #9B5900;
- border-bottom: 8rpx solid transparent;
- }
- }
- .fx-trip {
- color: #9B5900;
- font-size: 24rpx;
- margin-top: 14rpx;
- }
- .upgrade {
- width: 68rpx;
- height: 68rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .tesk-r {
- padding: 10rpx 20rpx;
- color: #9B5900;
- font-size: 24rpx;
- font-weight: 400;
- text-align: center;
- background: #FFFFFF;
- border-radius: 40rpx;
- }
- }
- }
- .price-box.header-height {
- position: relative;
- margin-top: -150rpx;
- }
- .price-box {
- padding: 48rpx 32rpx;
- background-color: #fff;
- margin: 24rpx 30rpx;
- border-radius: 12px;
- .box-top {
- display: flex;
- justify-content: space-between;
- color: #777777;
- font-size: 24rpx;
- .icon-xiangyou {
- font-size: 24rpx;
- }
- }
- .com-count {
- color: #EB0000;
- font-size: 42rpx;
- font-weight: bold;
- margin-top: 16rpx;
- }
- .box-btn {
- display: flex;
- justify-content: space-between;
- margin-top: 44rpx;
- .in {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- }
- .item {
- width: 100%;
- .item-cn {
- display: flex;
- justify-content: center;
- flex-direction: column;
- }
- .text {
- color: #777777;
- font-size: 24rpx;
- margin-bottom: 20rpx;
- }
- .num {
- color: #333333;
- font-size: 36rpx;
- font-weight: bold;
- }
- }
- }
- .btn {
- display: flex;
- color: #9B5900;
- background: linear-gradient(135deg, #FEE8C7 0%, #FFBD6B 100%);
- border-radius: 46px;
- align-items: center;
- justify-content: center;
- padding: 32rpx 0;
- margin-top: 48rpx;
- font-size: 30rpx;
- line-height: 30rpx;
- font-weight: bold;
- margin: 48rpx 10rpx 0 10rpx;
- }
- }
- .statistics {
- display: flex;
- flex-wrap: wrap;
- background-color: #fff;
- margin: 24rpx 30rpx;
- border-radius: 12px;
- padding: 40rpx 46rpx 40rpx 0;
- .mb {
- margin-bottom: 64rpx;
- }
- .item {
- width: 50%;
- display: flex;
- align-items: center;
- padding-left: 50rpx;
- .img {
- width: 46rpx;
- height: 46rpx;
- margin-right: 22rpx;
- .iconfont {
- font-size: 40rpx !important;
- font-weight: bold;
- }
- }
- .item-r {
- .text {
- font-size: 26rpx;
- color: #333333;
- margin-bottom: 12rpx;
- }
- .trip {
- color: #999999;
- font-size: 22rpx;
- }
- }
- }
- }
- // ---------------------------------------
- .data {
- margin: 28rpx 30rpx;
- background-color: #fff;
- width: 690rpx;
- border-radius: 12rpx;
- .data-num {
- height: 168rpx;
- background: url('../static/data-num.png') no-repeat;
- background-size: 100% 100%;
- display: flex;
- align-items: center;
- justify-content: space-around;
- color: #fff;
- font-size: 24rpx;
- .num {}
- .num-color {
- margin-top: 20rpx;
- font-weight: bold;
- font-size: 36rpx;
- }
- }
- .data-money {
- display: flex;
- justify-content: space-between;
- color: #333;
- padding: 16rpx 30rpx;
- font-size: 24rpx;
- .money {
- display: flex;
- align-items: center;
- color: #333333;
- }
- .money-num {
- color: #E93323;
- font-size: 28rpx;
- font-weight: bold;
- padding-left: 20rpx;
- }
- .btn {
- width: 160rpx;
- background: linear-gradient(135deg, #FEA21F 0%, #FE7A18 100%);
- border-radius: 38rpx;
- color: #fff;
- text-align: center;
- padding: 16rpx 0;
- font-size: 26rpx;
- }
- }
- }
- .invites {
- width: 690rpx;
- margin: 28rpx 30rpx;
- background-color: #fff;
- border-radius: 12rpx;
- font-size: 26rpx;
- color: #333;
- padding: 40rpx 46rpx;
- .invite-list {
- display: flex;
- .item {
- margin-right: 48rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- .img {
- width: 60rpx;
- height: 60rpx;
- margin-bottom: 24rpx;
- image {
- width: 100%;
- height: 100%;
- border-radius: 50%;
- }
- }
- }
- }
- }
- .list {
- width: 690rpx;
- margin: 28rpx 30rpx;
- background-color: #fff;
- border-radius: 12rpx;
- font-size: 28rpx;
- .tab-list {
- display: flex;
- justify-content: space-between;
- padding: 32rpx 30rpx 0 30rpx;
- color: #999999;
- .tab {
- display: flex;
- .item {
- margin-right: 48rpx;
- transition: all 0.3s;
- .item-text {}
- .line {
- width: 54rpx;
- height: 4rpx;
- margin: 12rpx auto 0 auto;
- border-radius: 4px;
- }
- .line.on {
- background-color: #E93323;
- }
- }
- .item .on {
- font-size: 32rpx;
- font-weight: bold;
- color: #E93323;
- }
- }
- }
- .more {
- display: flex;
- align-items: center;
- font-size: 26rpx;
- .icon-xiangyou {
- font-size: 24rpx;
- }
- }
- }
- }
- </style>
|