<template>
|
<view class="index-agent o-h" v-if="!loadding" :data-theme='theme()' :class="theme() || ''">
|
<!-- #ifdef MP-WEIXIN || APP-PLUS -->
|
<view class="ww100" :style="'height:'+topBarTop()+'px;'"></view>
|
<view class="tc head_top" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'">
|
<view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view>
|
<view class="fb">{{titel}}</view>
|
</view>
|
<!-- #endif -->
|
<!--头部图片-->
|
<view class="banner d-c-c d-c">
|
<image :src="top_background" mode="aspectFill"></image>
|
</view>
|
|
<!--是分销商-->
|
<template v-if="is_agent && isData">
|
<!--金额信息-->
|
<view class="agent-wrap pr m-0-20" style="margin-top: 300rpx;">
|
<view class="d-b-c border-b pb30 f28 lh150 user-info">
|
<view class="d-b-c">
|
<view class="photo">
|
<image :src="user.avatarUrl" mode="aspectFill"></image>
|
</view>
|
<view class="user-name">
|
<view class="gray3 f32">{{ user.nickName }}</view>
|
<view class="mt10">
|
<text class="gray3 f28">{{ info_words.index.words.referee.value }}:</text>
|
<text class="f28 gray3">{{ agent.referee ? agent.referee.nickName : '平台' }}</text>
|
</view>
|
</view>
|
|
</view>
|
<view v-if="agent.referee_code">
|
<text class="gray3 f28">{{ info_words.index.words.referee_code.value }}:</text>
|
<text class="f28 gray3">{{ agent.referee_code }}</text>
|
</view>
|
</view>
|
<view class="d-s-c p-30-0 top_dash">
|
<view class="flex-1 d-c-c d-c">
|
<view class="redF6">
|
<text class="f24">¥</text>
|
<text class="f40">{{ agent.money }}</text>
|
</view>
|
<view class="pt20 f26 gray3">{{ info_words.index.words.money.value }}</view>
|
</view>
|
<view class="flex-1 d-c-c d-c">
|
<view class="">
|
<text class="f24">¥</text>
|
<text class="f40">{{ agent.freeze_money }}</text>
|
</view>
|
<view class="pt20 f28 gray3">{{ info_words.index.words.freeze_money.value }}</view>
|
</view>
|
<view class="flex-1 d-c-c d-c">
|
<view class="">
|
<text class="f24">¥</text>
|
<text class="f40">{{ agent.total_money }}</text>
|
</view>
|
<view class="pt20 f28 gray3">{{ info_words.index.words.total_money.value }}</view>
|
</view>
|
</view>
|
<view class="d-c-c pt30">
|
<button type="primary" class="btn-gcred theme-btn flex-1" @click="gotoCash">{{ info_words.index.words.cash.value }}</button>
|
</view>
|
</view>
|
<!--图标入口-->
|
<view class="agent-wrap m-0-20 p30 d-s-c f-w mt20 bg-white">
|
<view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/cash/list/list')">
|
<view>
|
<image class="agent_index_img" src="../../../static/icon/icon-zijinmingxi.png" mode=""></image>
|
</view>
|
<text class="pt10 f26 mt20">{{ info_words.cash_list.title.value }}</text>
|
</view>
|
<view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/order/order')">
|
<view>
|
<image class="agent_index_img" src="../../../static/icon/icon-fenxiaodingdan.png" mode=""></image>
|
</view>
|
<text class="pt10 f26 mt20">{{ info_words.order.title.value }}</text>
|
</view>
|
<view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/team/team')">
|
<view>
|
<image class="agent_index_img" src="../../../static/icon/icon-tuandui.png" mode=""></image>
|
</view>
|
<text class="pt10 f26 mt20">{{ info_words.team.title.value }}</text>
|
</view>
|
<view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/qrcode/qrcode')">
|
<view>
|
<image class="agent_index_img" src="../../../static/icon/icon-erweima.png" mode=""></image>
|
</view>
|
<text class="pt10 f26 mt20">{{ info_words.qrcode.title.value }}</text>
|
</view>
|
</view>
|
</template>
|
<!--不是分销商-->
|
<template v-if="!is_agent && isData">
|
<view class="no-agent">
|
<view class="mt50 p-0-20 red f34 tc">{{ info_words.index.words.not_agent.value }}</view>
|
<view class="p30 f28" v-if="setting.become=='30'">您需要一次性消费满<text class="orange">{{setting.once_money}}元</text>才能成为{{ info_words.index.words.agent.value }},赶紧到商城下单吧!</view>
|
<view class="p30 f28" v-if="setting.become=='40'">您需要累计消费满<text class="orange">{{setting.total_money}}元</text>才能成为{{ info_words.index.words.agent.value }},您当前累计消费{{user.pay_money}}元,继续努力吧!</view>
|
<view class="p30 f28" v-if="setting.become=='50' && productList.length==0">您只需要在商城任意购买一款商品即可成为{{ info_words.index.words.agent.value }},赶紧去看看吧!</view>
|
<view class="section-product" v-if="setting.become=='50' && productList.length>0">
|
<view class="p30 f28 d-c-c">您需要购买以下任意一款商品才能成为{{ info_words.index.words.agent.value }}</view>
|
<view @click="gotoProductDetail(item.product_id)" class="item" :class="index==productList.length-1?'noborder':'border-b-e'" v-for="(item, index) in productList" :key="index">
|
<image :src="item.product_image" class="cover" mode="aspectFit"></image>
|
<view class="info">
|
<view class="title">{{ item.product_name }}</view>
|
<view class="describe">{{ item.product_sku.product_attr }}</view>
|
<view class="level-box count_choose">
|
<view class="price">
|
¥
|
<text class="num">{{ item.product_sku.product_price }}</text>
|
</view>
|
</view>
|
</view>
|
<view class="icon-box pl20">
|
<text class="icon iconfont icon-jiantou f50"></text>
|
</view>
|
</view>
|
</view>
|
<view class="p30 mt30" v-if="setting.become=='10' || setting.become=='20'">
|
<button type="primary" class="btn-gcred" @click="applyagent">{{ info_words.index.words.apply_now.value }}</button>
|
</view>
|
<view class="p30 mt30" v-else>
|
<button type="primary" class="btn-gcred" @click="gotoShop">{{ info_words.apply.words.goto_mall.value }}</button>
|
</view>
|
</view>
|
</template>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
/*是否加载完成*/
|
loadding: true,
|
indicatorDots: true,
|
autoplay: true,
|
interval: 2000,
|
duration: 500,
|
/*0:不是分销商,1:分销商申请中,2:已经是分销商*/
|
is_agent: false,
|
isData: false,
|
agent: {},
|
/*顶部背景*/
|
top_background: '',
|
/*基本信息*/
|
info_words: {},
|
words: {},
|
user: {},
|
titel: '',
|
productList: [],
|
setting: {}
|
};
|
},
|
onLoad(e) {
|
if (e.is_agent) {
|
this.is_agent = e.is_agent;
|
}
|
},
|
onShow() {
|
uni.showLoading({
|
title: '加载中'
|
});
|
/*获取个人中心数据*/
|
this.getData();
|
},
|
methods: {
|
/*获取数据*/
|
getData() {
|
let self = this;
|
self._get('user.agent/center', {}, function(data) {
|
self.info_words = data.data.words;
|
uni.setNavigationBarTitle({
|
title: self.info_words.index.title.value != '' ? self.info_words.index.title.value : self.info_words.index.title
|
.default
|
});
|
self.titel = data.data.words.index.title.value
|
self.is_agent = data.data.is_agent;
|
self.top_background = data.data.background;
|
self.agent = data.data.agent;
|
self.user = data.data.user;
|
self.setting = data.data.setting;
|
self.productList = data.data.productList;
|
self.isData = true;
|
self.loadding = false;
|
uni.hideLoading();
|
});
|
},
|
|
/*申请分销商*/
|
applyagent() {
|
this.gotoPage('/pages/agent/apply/apply');
|
},
|
|
/*去商城逛逛*/
|
gotoShop() {
|
this.gotoPage('/pages/index/index')
|
},
|
|
/*去提现*/
|
gotoCash() {
|
this.gotoPage('/pages/agent/cash/apply/apply');
|
},
|
|
goback() {
|
uni.navigateBack();
|
},
|
|
/*跳转产品详情*/
|
gotoProductDetail(e) {
|
let url = 'pages/product/detail/detail?product_id=' + e
|
this.gotoPage(url);
|
},
|
}
|
};
|
</script>
|
|
<style lang="scss">
|
page {
|
background-color: #f9f9f9;
|
}
|
|
.index-agent .banner {
|
position: absolute;
|
width: 750rpx;
|
height: 348rpx;
|
z-index: 0;
|
min-height: 167rpx;
|
/* padding-bottom: 60rpx; */
|
background-repeat: no-repeat;
|
background-size: 100%;
|
}
|
|
.index-agent .banner image {
|
width: 100%;
|
}
|
|
.no-agent {
|
// padding-top: 190rpx;
|
}
|
|
.no-agent-image {
|
padding-top: 20rpx;
|
margin: 0 auto;
|
}
|
|
.no-agent-image image {
|
width: 532rpx;
|
height: 340rpx;
|
|
}
|
|
.agent-wrap {
|
background: #FFFFFF;
|
background-size: 100% 100%;
|
padding: 31rpx 25rpx 36rpx 25rpx;
|
box-shadow: 0px 8rpx 3rpx 0px rgba(6,0,1,0.03);
|
border-radius: 20rpx;
|
}
|
|
.index-agent .agent-wrap .iconfont {
|
font-size: 60rpx;
|
}
|
|
.index-agent .btn-gcred {
|
height: 88rpx;
|
line-height: 88rpx;
|
border-radius: 44rpx;
|
background: #FF5649;
|
border-color: #FF5649;
|
}
|
|
.reg180 {
|
padding-right: 20rpx;
|
text-align: right;
|
transform: rotateY(180deg);
|
position: absolute;
|
bottom: 0;
|
}
|
|
.icon-jiantou {
|
|
color: #FFFFFF;
|
font-size: 30rpx;
|
}
|
|
.head_top {
|
position: absolute;
|
width: 100%;
|
padding-top: var(--status-bar-height);
|
height: 30px;
|
line-height: 30px;
|
color: #FFFFFF;
|
font-size: 32rpx;
|
z-index: 2;
|
}
|
|
.top_dash {
|
border-bottom: 1rpx dashed #D9D9D9;
|
padding-bottom: 9px;
|
|
}
|
|
.agent_index_img {
|
width: 78rpx;
|
height: 78rpx;
|
}
|
.info-top{
|
padding: 74rpx 0 63rpx 44rpx;
|
}
|
.info-ava {
|
width: 108rpx;
|
height: 108rpx;
|
border-radius: 50%;
|
position: relative;
|
margin-right: 30rpx;
|
}
|
.info-avatar {
|
width: 108rpx;
|
height: 108rpx;
|
border-radius: 50%;
|
}
|
|
.info-grade {
|
min-width: 114rpx;
|
height: 30rpx;
|
line-height: 30rpx;
|
padding: 0 22rpx;
|
box-sizing: border-box;
|
font-size: 18rpx;
|
color: #ffffff;
|
background: #FFC519;
|
box-shadow: 0px 3rpx 7rpx 0px rgba(0, 0, 0, 0.15);
|
border-radius: 15rpx;
|
text-align: center;
|
white-space: nowrap;
|
position: absolute;
|
left: 0;
|
right: 0;
|
bottom: -16rpx;
|
z-index: 2;
|
}
|
|
.section-product .price {
|
color: #F6220C;
|
font-size: 24rpx;
|
}
|
|
.section-product .price .num {
|
padding: 0 4rpx;
|
font-size: 32rpx;
|
}
|
|
.section-product .level-box {
|
margin-top: 20rpx;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.section-product .level-box .key {
|
font-size: 24rpx;
|
color: #999999;
|
}
|
|
.section-product .level-box .num-wrap {
|
display: flex;
|
justify-content: flex-end;
|
align-items: center;
|
}
|
|
.section-product .level-box .icon-box {
|
width: 33rpx;
|
height: 33rpx;
|
border: 1px solid #c5c5c5;
|
background: #f2f2f2;
|
}
|
|
.section-product .level-box .icon-box .gray {
|
color: #cccccc;
|
}
|
|
.section-product .level-box .icon-box .gray3 {
|
color: #333333;
|
}
|
|
.section-product .level-box .text-wrap {
|
margin: 0 20rpx;
|
height: 33rpx;
|
border: none;
|
background: none;
|
}
|
|
.section-product .level-box .text-wrap input {
|
padding: 0 4rpx;
|
height: 33rpx;
|
line-height: 1;
|
width: 40rpx;
|
font-size: 32rpx;
|
text-align: center;
|
display: flex;
|
align-items: center;
|
min-height: 33rpx;
|
}
|
|
.section-product .icon-jiantou {
|
color: #999;
|
}
|
|
.user-info .photo,
|
.user-info .photo image {
|
width: 100rpx;
|
height: 100rpx;
|
border-radius: 50%;
|
}
|
|
.user-info .photo {
|
padding-right: 20rpx;
|
}
|
</style>
|