|
@@ -14,11 +14,13 @@
|
|
|
<image :src="userInfo.avatar || '../../static/error/missing-face.png'" mode=""></image>
|
|
|
<view class="user-font">
|
|
|
<view class="name clamp">{{ userInfo.nickname }}</view>
|
|
|
- <view class="phone">{{ getPhone }}</view>
|
|
|
+ <view class="phone" v-if="isPhone=true">{{ getPhone }}</view>
|
|
|
+ <view class="phone">{{getFh}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="kpi" v-show="userInfo.level!=0">
|
|
|
- <image style="width: 34rpx; height: 34rpx; margin-right: 8rpx;" src="../../static/icon/vip.png" mode=""></image>会员VIP
|
|
|
+ <image style="width: 34rpx; height: 34rpx; margin-right: 8rpx;" src="../../static/icon/vip.png"
|
|
|
+ mode=""></image>会员VIP
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-right">
|
|
@@ -40,6 +42,10 @@
|
|
|
<view class="item-num">{{all || 0}}</view>
|
|
|
<view class="item-font">我的推广</view>
|
|
|
</view>
|
|
|
+ <view class="item-item">
|
|
|
+ <view class="item-num">{{(userInfo.ordsum).toFixed(2) || 0}}</view>
|
|
|
+ <view class="item-font">消费金额</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -71,14 +77,15 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<uni-list class="tool-list">
|
|
|
- <uni-list-item title="邀请有礼" @click="navTo('/pages/user/shareQrCode')" thumb="/static/user/user08.png">
|
|
|
+ <uni-list-item title="邀请有礼" @click="navToo('/pages/user/shareQrCode')" thumb="/static/user/user08.png">
|
|
|
</uni-list-item>
|
|
|
<uni-list-item title="我的收藏" @click="navTo('/pages/user/favorites')" thumb="/static/user/user11.png">
|
|
|
</uni-list-item>
|
|
|
<!-- <uni-list-item title="点击试试" @click="navTo('/pages/public/login')" thumb="/static/user/user11.png">
|
|
|
</uni-list-item> -->
|
|
|
<uni-list-item title="客服中心" @click="openKf()" thumb="/static/user/user09.png"></uni-list-item>
|
|
|
- <uni-list-item title="设置" @click="navTo('/pages/set/userinfo')" thumb="/static/user/user13.png"></uni-list-item>
|
|
|
+ <uni-list-item title="设置" @click="navTo('/pages/set/userinfo')" thumb="/static/user/user13.png">
|
|
|
+ </uni-list-item>
|
|
|
</uni-list>
|
|
|
<uni-popup ref="popupkf" type="center">
|
|
|
<view class="popup-box">
|
|
@@ -126,10 +133,11 @@
|
|
|
} from 'vuex';
|
|
|
import uniList from '@/components/uni-list/uni-list.vue';
|
|
|
import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
|
|
|
-
|
|
|
+
|
|
|
import {
|
|
|
orderData,
|
|
|
- getUserInfo,myspread
|
|
|
+ getUserInfo,
|
|
|
+ myspread
|
|
|
} from '@/api/user.js';
|
|
|
import {
|
|
|
saveUrl,
|
|
@@ -145,7 +153,8 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- all:0,//推荐人数
|
|
|
+ isPhone:false,
|
|
|
+ all: 0, //推荐人数
|
|
|
current: 4,
|
|
|
tabbar: tabbar1,
|
|
|
qded: false, //是否已签到
|
|
@@ -211,11 +220,12 @@
|
|
|
// 判断是否已经登录
|
|
|
if (this.hasLogin) {
|
|
|
this.loadBaseData();
|
|
|
- myspread({
|
|
|
- }).then(({ data }) => {
|
|
|
- console.log(data,'推荐人');
|
|
|
- this.all = data.total;
|
|
|
- })
|
|
|
+ myspread({}).then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ console.log(data, '推荐人');
|
|
|
+ this.all = data.total;
|
|
|
+ })
|
|
|
}
|
|
|
this.loadBaseData();
|
|
|
},
|
|
@@ -257,16 +267,32 @@
|
|
|
// #endif
|
|
|
computed: {
|
|
|
...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
|
|
|
- getPhone(){
|
|
|
- let reg= /^(\d{3})\d{4}(\d{4})$/;
|
|
|
- return this.userInfo.phone.replace(reg,'$1****$2')
|
|
|
+ getPhone() {
|
|
|
+ if(this.userInfo.phone){
|
|
|
+ this.isPhone=true
|
|
|
+ let reg = /^(\d{3})\d{4}(\d{4})$/;
|
|
|
+ return this.userInfo.phone.replace(reg, '$1****$2')
|
|
|
+ }else{
|
|
|
+ this.isPhone=false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getFh(){
|
|
|
+ //具体分红权益
|
|
|
+ if(isNaN(this.userInfo.vipsum)){
|
|
|
+ return this.userInfo.vipsum
|
|
|
+
|
|
|
+ }else{
|
|
|
+ return `距离分红权益相差${this.userInfo.vipsum}元`
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
|
|
|
// 加载初始数据
|
|
|
loadBaseData() {
|
|
|
- console.log(this.userInfo,'info');
|
|
|
+ console.log(this.userInfo, 'info');
|
|
|
getUserInfo({})
|
|
|
.then(({
|
|
|
data
|
|
@@ -300,11 +326,11 @@
|
|
|
navTo(url) {
|
|
|
console.log(url);
|
|
|
let pages = getCurrentPages();
|
|
|
- console.log(pages,'pages');
|
|
|
-
|
|
|
- let prevPage = pages[pages.length-2]
|
|
|
- console.log(prevPage,'pages2');
|
|
|
-
|
|
|
+ console.log(pages, 'pages');
|
|
|
+
|
|
|
+ let prevPage = pages[pages.length - 2]
|
|
|
+ console.log(prevPage, 'pages2');
|
|
|
+
|
|
|
// if (!this.hasLogin) {
|
|
|
// // 保存地址
|
|
|
// saveUrl();
|
|
@@ -316,6 +342,20 @@
|
|
|
});
|
|
|
// }
|
|
|
},
|
|
|
+ navToo(url){
|
|
|
+ // let pages = getCurrentPages();
|
|
|
+ // console.log(pages, 'pages');
|
|
|
+
|
|
|
+ // let prevPage = pages[pages.length - 2]
|
|
|
+ // console.log(prevPage, 'pages2');
|
|
|
+ if(this.userInfo.is_promoter != 0){
|
|
|
+ uni.navigateTo({
|
|
|
+ url
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$api.msg('需下单后成为推广员方可推广!')
|
|
|
+ }
|
|
|
+ },
|
|
|
useTool(e) {
|
|
|
this.navTo(e.path);
|
|
|
},
|