解决merge

This commit is contained in:
2022-06-11 11:28:48 +08:00
117 changed files with 19519 additions and 13458 deletions

View File

@@ -4,32 +4,18 @@
<view class="info-box">
<image src="@/static/user/user_back.png" mode="aspectFill" />
<view class="user-flex">
<image class="cover" @click="goSetting" :src="userInfo.avatar || require('@/static/user/cover.png')"
<image class="cover" @click="onBtn('Setting', {})" :src="userInfo.avatar || require('@/static/user/cover.png')"
mode="aspectFill" />
<view class="user-content">
<block v-if="$store.state.token != ''">
<view class="name">{{ userInfo.nickname }}</view>
<view class="tabs" v-if="userInfo.identity.length !== 0">
<view class="tabs-item">
<image src="@/static/user/icon_07.png" />
VIP会员
</view>
<view class="name">{{ userInfo.nickname }}</view>
<view class="tabs">
<view class="tabs-item">
<image :src="identity.cover_url" mode="heightFix" />{{identity.identity_text}}
</view>
<view class="tabs" v-else>
<view class="tabs-item">
<image src="@/static/user/icon_07.png" />
普通用户
</view>
</view>
<view class="chainAddress" v-if="userInfo.chain_address">
<!-- <u-icon labelPos="left" @click="copy(userInfo.chain_address)" labelSize="14"
labelColor="#fff" :label="userInfo.chain_address.substr(0, 20)+'...'" space="10"
:name="require('@/static/imgs/copy.png')" size="16" /> -->
</view>
</block>
<block v-else>
<view class="name">未登录</view>
</block>
</view>
<view class="chainAddress" v-if="userInfo.addr">
<text @click="copy(userInfo.addr)">区块地址:{{userInfo.addr.substring(0,5) + '****' + userInfo.addr.substring(userInfo.addr.length - 5)}}</text>
</view>
</view>
</view>
</view>
@@ -38,25 +24,24 @@
<view class="vip-card">
<view class="title">
<image src="@/static/user/icon_06.png" mode="widthFix" />
会员
共力会员
</view>
<view class="subtitle">
<u-notice-bar :text="cardText" icon="" bgColor="" duration="3000" color="#fcc692" direction="column">
</u-notice-bar>
</view>
<!-- v-if="userInfo.identity.length === 0" -->
<view class="btn" @click="openVip">开通</view>
<view class="btn" @click="onBtn('Vip', {})">{{userInfo.isOpenVip ? '开通': '续费'}}</view>
</view>
<!-- 健康数据 -->
<view class="health-flex">
<view class="health-flex-item" @click="onBtn('AccountIntegral', {})">
<view class="title">共力值</view>
<view class="num">0.00</view>
<view class="num">{{account.glz}}</view>
</view>
<view class="health-flex-item" @click="onBtn('AccountDt', {})">
<view class="title">DT积分</view>
<view class="num">0.00</view>
<view class="num">{{account.dt}}</view>
</view>
</view>
<!-- 订单 -->
@@ -84,7 +69,7 @@
</view>
<!-- 功能块 -->
<view class="btns-box">
<view class="btns-box-item">
<view class="btns-box-item" @click="onMnemonic">
<image class="icon" src="@/static/user/userIcon_02.png" mode="widthFix" />
导出助记词
<uni-icons class="forward" type="forward" color="#999" />
@@ -94,18 +79,11 @@
地址管理
<uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item">
<view class="btns-box-item" @click="onBtn('Invitation', {})">
<image class="icon" src="@/static/user/userIcon_03.png" mode="widthFix" />
分享邀请
<uni-icons class="forward" type="forward" color="#999" />
</view>
</view>
<view class="btns-box">
<view class="btns-box-item">
<image class="icon" src="@/static/user/userIcon_03.png" mode="widthFix" />
供应商申请
<uni-icons class="forward" type="forward" color="#999" />
</view>
</view>
</view>
<view class="btns-box">
<view class="btns-box-item">
@@ -127,25 +105,48 @@
<view class="footer-text">
<view>共力生态</view>
<view>The total force ecological</view>
</view>
</view>
<!-- 助记词弹出框 -->
<u-modal :show="wordsShow" :zoom="false" confirmText="复制" @confirm="copyWord" confirmColor="#34CE98">
<slot default>
<view class="wordsCont">
<view class="wordsCont-title">导出助记词</view>
<view class="wordsCont-tips">请务必抄下助记词并存在安全的地方若助记词丢失重装或换设备登录时将无法查看历史消息若助记词被他人获取将可能获取你的信息</view>
<view class="wordsCont-text">{{mnemonic}}</view>
<image class="wordsCont-close" @click="wordsShow = false" src="@/static/icon/userCloes.png" mode="widthFix"></image>
</view>
</slot>
</u-modal>
</view>
</template>
<script>
import {
info
} from '@/apis/interfaces/user';
import userAuth from '@/public/userAuth';
info,
chainSeed
} from '@/apis/interfaces/user';
export default {
data() {
return {
cardText: ['开通会员加速共力值增长', '前10000名用户专享阶段折扣价格'],
cardText: [],
userInfo: {
nickname: '',
avatar: '',
identity: []
}
nickname : '',
addr : '',
avatar : '',
isOpenVip : '',
},
identity : {
button_cover_url: '',
cover_url : '',
identity_text : ''
},
account : {
glz : 0.00,
dt : 0.00
},
mnemonic : '',
wordsShow: false
};
},
onShow() {
@@ -153,25 +154,40 @@
},
methods: {
// 用户信息
getInfo() {
getInfo() {
if (this.$store.state.token === '') return;
info()
.then(res => {
uni.setNavigationBarTitle({
title: res.nickname
});
this.userInfo = res;
})
.catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
});
info().then(res => {
uni.setNavigationBarTitle({
title: res.nickname
});
},
// 开通会员
openVip() {
this.$Router.push({name: 'Vip'})
this.cardText = res.identity_array
this.userInfo = {
nickname : res.nickname,
addr : res.addr,
avatar : res.avatar,
isOpenVip : res.is_open_vip,
}
this.identity = res.identity
this.account = res.account
})
.catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
});
});
},
// 导出助记词
onMnemonic(){
chainSeed().then(res => {
this.mnemonic = res.seed
this.wordsShow = true
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 按钮导航
onBtn(name, params) {
@@ -180,17 +196,17 @@
params
});
},
goSetting() {
this.$Router.push({
name: 'Setting'
})
},
// 退出登录
logOut() {
this.$store.commit('setToken', '');
this.$store.commit('setIsNew', '');
this.$Router.replaceAll({name: 'Auth'})
},
logOut() {
uni.removeStorage({
key: 'isnew',
success: () =>{
this.$store.commit('setToken', '');
this.$Router.replaceAll({name: 'Auth'})
}
})
},
// 复制
copy(data) {
uni.setClipboardData({
data: data,
@@ -203,7 +219,21 @@
})
}
});
}
},
// 复制助记词
copyWord() {
uni.setClipboardData({
data: this.mnemonic,
success: () => {
this.wordsShow = false
uni.showToast({
title: '助记词已复制',
icon: 'none',
mask: true
})
}
});
},
}
};
</script>
@@ -281,26 +311,24 @@
font-size: $title-size + 8;
@extend .nowrap;
}
.tabs {
padding-top: 10rpx;
&-item {
background: rgba($color: #000000, $alpha: 0.3);
font-size: $title-size-sm - 4;
display: inline-block;
line-height: 36rpx;
padding: 0 20rpx;
border-radius: 20rpx;
image {
width: 26rpx;
height: 26rpx;
vertical-align: middle;
margin-bottom: 2rpx;
margin-right: 8rpx;
}
}
padding-top: 10rpx;
&-item {
background: rgba($color: #000000, $alpha: 0.3);
font-size: $title-size-sm - 4;
display: inline-block;
line-height: 36rpx;
padding: 0 20rpx;
border-radius: 20rpx;
image {
width: 38rpx;
height: 38rpx;
vertical-align: middle;
margin-bottom: 2rpx;
margin-right: 8rpx;
}
}
}
}
}
@@ -456,5 +484,38 @@
margin-bottom: 8rpx;
}
}
}
/* 助记词弹框 */
.wordsCont {
width: 100%;
position: relative;
text-align: center;
}
.wordsCont-title {
width: 100%;
font-weight: 600;
font-size: 44rpx;
}
.wordsCont-tips {
padding: 30rpx 0;
box-sizing: border-box;
color: #de5660;
line-height: 48rpx;
font-size: 30rpx;
}
.wordsCont-text {
font-weight: 500;
margin-top: 10rpx;
}
.wordsCont-close {
position: absolute;
top: 0;
right: 0;
width: 44rpx;
height: 44rpx;
}
</style>