修复部分bug
This commit is contained in:
@@ -1,176 +1,172 @@
|
||||
<template>
|
||||
<view v-if='loding'>
|
||||
<block v-if="this.$store.state.token != ''">
|
||||
<!-- 用户信息 -->
|
||||
<view class="user">
|
||||
<view class="user-tool" @click="$Router.push({name:'Setting'})">
|
||||
<image src="@/static/icons/user_icon_00.png" mode="widthFix" />
|
||||
</view>
|
||||
<view class="user-content">
|
||||
<image class="info-cover" :src="base.avatar" mode="aspectFill" />
|
||||
<view class="info-nickname">{{base.nickname}}</view>
|
||||
<view class="info-signa">潮流就是我的态度</view>
|
||||
<view class="info-tags">
|
||||
<text class="info-tags-item identity" v-if="base.identity">{{base.identity.name}}</text>
|
||||
<text class="info-tags-item vip" v-if="base.company_level.name">{{base.company_level.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="user-tabs">
|
||||
<view class="user-tabs-item" :class="{'show': tabsIndex === 0}" @click="tabsIndex = 0">管理中心</view>
|
||||
<view class="user-tabs-item" :class="{'show': tabsIndex === 1}" @click="tabsIndex = 1">我的推广</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 消息 -->
|
||||
<view class="user-ad">
|
||||
<uni-icons class="user-ad-icon" type="sound-filled" color="#e93340"></uni-icons>
|
||||
<swiper class="user-ad-swiper" :interval="3000" autoplay vertical circular>
|
||||
<swiper-item v-for="(item,index) in message" :key='index'>
|
||||
<view class="user-ad-item">{{item}}</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<block v-if="tabsIndex === 0">
|
||||
<!-- 我的资产 -->
|
||||
<view class="user-group">
|
||||
<view class="title">
|
||||
<view class="title-text">我的资产</view>
|
||||
</view>
|
||||
<view class="group-flex group-flex-4">
|
||||
<view class="item" @click="showToast">
|
||||
<view class="item-num">{{base.account.token}}</view>
|
||||
<view class="item-title">原石</view>
|
||||
</view>
|
||||
<view class="item" @click="showToast">
|
||||
<view class="item-num">{{base.account.contribution}}</view>
|
||||
<view class="item-title">贡献值</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'Eb'})">
|
||||
<view class="item-num">{{base.account.eb}}</view>
|
||||
<view class="item-title">易币</view>
|
||||
</view>
|
||||
<view class="item" @click="showToast">
|
||||
<view class="item-num">{{base.account.money}}</view>
|
||||
<view class="item-title">零钱</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 我的权证 -->
|
||||
<view class="user-group">
|
||||
<view class="title" >
|
||||
<view class="title-text">我的权证</view>
|
||||
</view>
|
||||
<view class="group-flex group-flex-4">
|
||||
<view class="item" @click="$Router.push({name:'NumberWeight'})">
|
||||
<view class="item-num">{{count.warrnats}}</view>
|
||||
<view class="item-title">权证持有</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name: 'marketManag'})">
|
||||
<view class="item-num">{{count.warrnat_transfer}}</view>
|
||||
<view class="item-title">权证转让</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'ServicesOrder'})">
|
||||
<view class="item-num">{{count.shipment_fuwu_count}}</view>
|
||||
<view class="item-title">已使用</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'MallShipments'})">
|
||||
<view class="item-num">{{count.shipment_goods_count}}</view>
|
||||
<view class="item-title">已提货</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 我的权证 -->
|
||||
<view class="user-group">
|
||||
<view class="group-flex group-flex-4">
|
||||
<view class="item" @click="$Router.push({name:'Collection'})">
|
||||
<image class="item-cover" src="@/static/icons/user_icon_02.png" mode="aspectFill" />
|
||||
<view class="item-title">收藏的企业</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'CouponList'})">
|
||||
<image class="item-cover" src="@/static/icons/user_icon_03.png" mode="aspectFill" />
|
||||
<view class="item-title">我的优惠券</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'HistoryShop'})">
|
||||
<image class="item-cover" src="@/static/icons/user_icon_01.png" mode="aspectFill" />
|
||||
<view class="item-title">我的足迹</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'AddressList'})">
|
||||
<image class="item-cover" src="@/static/icons/user_icon_04.png" mode="aspectFill" />
|
||||
<view class="item-title">地址管理</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else-if="tabsIndex === 1">
|
||||
<!-- 我的权证 -->
|
||||
<view class="user-group">
|
||||
<view class="title">
|
||||
<view class="title-text">推广数据</view>
|
||||
</view>
|
||||
<view class="group-flex group-flex-2">
|
||||
<view class="item">
|
||||
<view class="item-num">{{relations.children}}</view>
|
||||
<view class="item-title">推广人数</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="item-num">{{relations.company}}</view>
|
||||
<view class="item-title">推广企业</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 排名信息 -->
|
||||
<view class="user-group">
|
||||
<view class="title">
|
||||
<view class="title-text">推广排名</view>
|
||||
</view>
|
||||
<view class="ranking ranking-after">
|
||||
<view class="ranking-title">
|
||||
<view class="ranking-text">全站推广人数</view>
|
||||
<view class="ranking-number">{{relations.childrenRank}}</view>
|
||||
</view>
|
||||
<image class="tips" src="../../static/icons/property_icon_00.png" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="ranking">
|
||||
<view class="ranking-title">
|
||||
<view class="ranking-text">推广企业</view>
|
||||
<view class="ranking-number">{{relations.companyRank}}</view>
|
||||
</view>
|
||||
<image class="tips" src="../../static/icons/property_icon_01.png" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 推广海报 -->
|
||||
<view class="poster-text">推广海报</view>
|
||||
|
||||
<!-- <carousel :img-list="imgList" url-key="url" @selected="selectedBanner"/> -->
|
||||
<view class="code">
|
||||
<image class="code-img-bg" src="/static/images/share_bg_3.png" mode="aspectFill" />
|
||||
<image class='code-img' :src="shareCode" mode="widthFix" />
|
||||
</view>
|
||||
|
||||
</block>
|
||||
<!-- 弹窗 -->
|
||||
<u-toast ref="uToast" />
|
||||
<!-- 版权信息 -->
|
||||
<view class="copyright">易品新境 beta 1.0.0</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="statusBar">
|
||||
<view class="statusBar-title">我的资产</view>
|
||||
</view>
|
||||
<view class="store-login">
|
||||
<image class="icon" src="@/static/icons/login-icon.png" mode="widthFix"></image>
|
||||
<view class="sub-title">一键开启您的易货之旅</view>
|
||||
<button type="default" @click="login">登录</button>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 用户信息 -->
|
||||
<view class="user">
|
||||
<view class="user-tool" @click="$Router.push({name:'Setting'})">
|
||||
<image src="@/static/icons/user_icon_00.png" mode="widthFix" />
|
||||
</view>
|
||||
<view class="user-content">
|
||||
<image class="info-cover" :src="base.avatar || require('@/static/images/boss.png')" mode="aspectFill" />
|
||||
<view class="info-nickname">{{base.nickname}}</view>
|
||||
<view class="info-signa">潮流就是我的态度</view>
|
||||
<view class="info-tags" v-if="this.$store.state.token != ''">
|
||||
<text class="info-tags-item identity" v-if="base.identity">{{base.identity.name}}</text>
|
||||
<text class="info-tags-item vip" v-if="base.company_level.name">{{base.company_level.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="user-tabs">
|
||||
<view class="user-tabs-item" :class="{'show': tabsIndex === 0}" @click="tabsIndex = 0">管理中心</view>
|
||||
<view class="user-tabs-item" :class="{'show': tabsIndex === 1}" @click="tabsIndex = 1">我的推广</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 消息 -->
|
||||
<view class="user-ad" v-if="message.length > 0">
|
||||
<uni-icons class="user-ad-icon" type="sound-filled" color="#e93340"></uni-icons>
|
||||
<swiper class="user-ad-swiper" :interval="3000" autoplay vertical circular>
|
||||
<swiper-item v-for="(item,index) in message" :key='index'>
|
||||
<view class="user-ad-item">{{item}}</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<block v-if="tabsIndex === 0">
|
||||
<!-- 我的资产 -->
|
||||
<view class="user-group">
|
||||
<view class="title">
|
||||
<view class="title-text">我的资产</view>
|
||||
</view>
|
||||
<view class="group-flex group-flex-4">
|
||||
<view class="item" @click="showToast">
|
||||
<view class="item-num">{{base.account.token}}</view>
|
||||
<view class="item-title">原石</view>
|
||||
</view>
|
||||
<view class="item" @click="showToast">
|
||||
<view class="item-num">{{base.account.contribution}}</view>
|
||||
<view class="item-title">贡献值</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'Eb'})">
|
||||
<view class="item-num">{{base.account.eb}}</view>
|
||||
<view class="item-title">易币</view>
|
||||
</view>
|
||||
<view class="item" @click="showToast">
|
||||
<view class="item-num">{{base.account.money}}</view>
|
||||
<view class="item-title">零钱</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 我的权证 -->
|
||||
<view class="user-group">
|
||||
<view class="title" >
|
||||
<view class="title-text">我的权证</view>
|
||||
</view>
|
||||
<view class="group-flex group-flex-4">
|
||||
<view class="item" @click="$Router.push({name:'NumberWeight'})">
|
||||
<view class="item-num">{{count.warrnats}}</view>
|
||||
<view class="item-title">权证持有</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name: 'marketManag'})">
|
||||
<view class="item-num">{{count.warrnat_transfer}}</view>
|
||||
<view class="item-title">权证转让</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'ServicesOrder'})">
|
||||
<view class="item-num">{{count.shipment_fuwu_count}}</view>
|
||||
<view class="item-title">已使用</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'MallShipments'})">
|
||||
<view class="item-num">{{count.shipment_goods_count}}</view>
|
||||
<view class="item-title">已提货</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 我的权证 -->
|
||||
<view class="user-group">
|
||||
<view class="group-flex group-flex-4">
|
||||
<view class="item" @click="$Router.push({name:'Collection'})">
|
||||
<image class="item-cover" src="@/static/icons/user_icon_02.png" mode="aspectFill" />
|
||||
<view class="item-title">收藏的企业</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'CouponList'})">
|
||||
<image class="item-cover" src="@/static/icons/user_icon_03.png" mode="aspectFill" />
|
||||
<view class="item-title">我的优惠券</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'HistoryShop'})">
|
||||
<image class="item-cover" src="@/static/icons/user_icon_01.png" mode="aspectFill" />
|
||||
<view class="item-title">我的足迹</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'AddressList'})">
|
||||
<image class="item-cover" src="@/static/icons/user_icon_04.png" mode="aspectFill" />
|
||||
<view class="item-title">地址管理</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else-if="tabsIndex === 1">
|
||||
<!-- 我的权证 -->
|
||||
<view class="user-group">
|
||||
<view class="title">
|
||||
<view class="title-text">推广数据</view>
|
||||
</view>
|
||||
<view class="group-flex group-flex-2">
|
||||
<view class="item">
|
||||
<view class="item-num">{{relations.children}}</view>
|
||||
<view class="item-title">推广人数</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="item-num">{{relations.company}}</view>
|
||||
<view class="item-title">推广企业</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 排名信息 -->
|
||||
<view class="user-group">
|
||||
<view class="title">
|
||||
<view class="title-text">推广排名</view>
|
||||
</view>
|
||||
<view class="ranking ranking-after">
|
||||
<view class="ranking-title">
|
||||
<view class="ranking-text">全站推广人数</view>
|
||||
<view class="ranking-number">{{relations.childrenRank}}</view>
|
||||
</view>
|
||||
<image class="tips" src="../../static/icons/property_icon_00.png" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="ranking">
|
||||
<view class="ranking-title">
|
||||
<view class="ranking-text">推广企业</view>
|
||||
<view class="ranking-number">{{relations.companyRank}}</view>
|
||||
</view>
|
||||
<image class="tips" src="../../static/icons/property_icon_01.png" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 推广海报 -->
|
||||
<view class="poster-text">推广海报</view>
|
||||
<view class="code">
|
||||
<image class="code-img-bg" src="/static/images/share_bg_3.png" mode="aspectFill" />
|
||||
<image class='code-img' :src="shareCode" mode="widthFix" />
|
||||
</view>
|
||||
|
||||
</block>
|
||||
<!-- 弹窗 -->
|
||||
<u-toast ref="uToast" />
|
||||
<!-- 版权信息 -->
|
||||
<view class="copyright">易品新境 beta 1.0.0</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="statusBar">
|
||||
<view class="statusBar-title">我的资产</view>
|
||||
</view>
|
||||
<view class="store-login">
|
||||
<image class="icon" src="@/static/icons/login-icon.png" mode="widthFix"></image>
|
||||
<view class="sub-title">一键开启您的易货之旅</view>
|
||||
<button type="default" @click="login">登录</button>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import carousel from '@/components/vear-carousel/vear-carousel'
|
||||
import {getUserInfo , appcode} from '@/apis/interfaces/mine'
|
||||
import { getUserInfo , appcode } from '@/apis/interfaces/mine'
|
||||
import userAuth from '@/public/userAuth'
|
||||
export default {
|
||||
components: {
|
||||
@@ -178,65 +174,54 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabsIndex: 0,
|
||||
imgList: [{
|
||||
url: 'https://img9.51tietu.net/pic/2019-091200/vgkpidei2tjvgkpidei2tj.jpg',
|
||||
id: 1
|
||||
},{
|
||||
url: 'https://img9.51tietu.net/pic/2019-091200/euzekmi5m23euzekmi5m23.jpg',
|
||||
id: 2
|
||||
},{
|
||||
url: 'https://img9.51tietu.net/pic/2019-091200/143tt0ta4sr143tt0ta4sr.jpg',
|
||||
id: 3
|
||||
}],
|
||||
base:'',
|
||||
count:'',
|
||||
relations:'',
|
||||
message:'',
|
||||
loding:true,
|
||||
shareCode:''
|
||||
tabsIndex : 0,
|
||||
base : {
|
||||
avatar : '',
|
||||
nickname: '',
|
||||
account : {
|
||||
token : 0,
|
||||
contribution: 0,
|
||||
eb : 0,
|
||||
money : 0
|
||||
}
|
||||
},
|
||||
count : {
|
||||
warrnats : 0,
|
||||
warrnat_transfer : 0,
|
||||
shipment_fuwu_count : 0,
|
||||
shipment_goods_count: 0
|
||||
},
|
||||
relations : '',
|
||||
message : [],
|
||||
shareCode : '',
|
||||
loding : false
|
||||
}
|
||||
},
|
||||
onShow(){
|
||||
console.log(this.$store.state.token)
|
||||
if(this.$store.state.token != ''){
|
||||
this.getUserInfo()
|
||||
}
|
||||
if(this.$store.state.token != '') this.userInfo()
|
||||
else this.loding = true
|
||||
},
|
||||
methods: {
|
||||
// 获取用户的基本信息
|
||||
getUserInfo(){
|
||||
getUserInfo().then(res => {
|
||||
this.base = res.base
|
||||
this.count = res.count
|
||||
this.message = res.message
|
||||
this.relations = res.relations
|
||||
userInfo(){
|
||||
Promise.all([getUserInfo(), appcode()]).then(res => {
|
||||
let userInfoData = res[0],
|
||||
appcodeData = res[1]
|
||||
|
||||
this.base = userInfoData.base
|
||||
this.count = userInfoData.count
|
||||
this.message = userInfoData.message
|
||||
this.relations = userInfoData.relations
|
||||
this.shareCode = appcodeData.code
|
||||
this.loding = true
|
||||
}).catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
type: 'error',
|
||||
icon:false,
|
||||
duration: 3000
|
||||
})
|
||||
})
|
||||
appcode().then(res => {
|
||||
this.shareCode = res.code
|
||||
}).catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
title: err.message,
|
||||
type: 'error',
|
||||
icon:false,
|
||||
duration: 3000
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
outLogin(){
|
||||
this.$store.commit('setToken', '')
|
||||
},
|
||||
selectedBanner(item, index) {
|
||||
console.log('🥒', item, index)
|
||||
},
|
||||
|
||||
// 努力开发中,,,
|
||||
showToast(){
|
||||
this.$refs.uToast.show({
|
||||
|
||||
@@ -25,16 +25,12 @@
|
||||
<view @click="loginOut" class="list-item">
|
||||
<view class="list-item-left">
|
||||
<image src="/static/images/reset-info.png" mode="widthFix" />
|
||||
<span>切换账户</span>
|
||||
<span>退出登录</span>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部banner -->
|
||||
|
||||
<!-- <u-toast ref="uToast" /> -->
|
||||
<u-toast ref="uToast" />
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -81,14 +77,16 @@
|
||||
})
|
||||
},
|
||||
loginOut() {
|
||||
uni.removeStorageSync('token')
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
this.$store.commit('setToken', '')
|
||||
this.$Router.replaceAll({name: 'Equity'})
|
||||
},
|
||||
// 上传头像
|
||||
updImgs(type) {
|
||||
uni.chooseImage({
|
||||
crop: {
|
||||
width: 80,
|
||||
height: 80
|
||||
},
|
||||
success: res => {
|
||||
let path = res.tempFiles.map((val, index) => {
|
||||
return {
|
||||
@@ -166,7 +164,6 @@
|
||||
margin: 0 40rpx;
|
||||
padding: 30rpx 0;
|
||||
width: calc(100% - 80rpx);
|
||||
|
||||
button::after {
|
||||
border: none;
|
||||
background-color: none;
|
||||
|
||||
Reference in New Issue
Block a user