个人中心文版通账号可复制功能实现

This commit is contained in:
2022-07-14 17:08:41 +08:00
parent 6f2087abec
commit 2416756a27
3 changed files with 2679 additions and 2472 deletions

View File

@@ -95,6 +95,12 @@
导出助记词 导出助记词
<uni-icons class="forward" type="forward" color="#999" /> <uni-icons class="forward" type="forward" color="#999" />
</view> </view>
<view class="btns-box-item" @click="onWbt">
<image class="icon" src="@/static/user/userIcon_02.png" mode="widthFix" />
文版通账号
<uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item" @click="resetPassword"> <view class="btns-box-item" @click="resetPassword">
<image class="icon" src="@/static/user/userIcon_13.png" mode="widthFix" /> <image class="icon" src="@/static/user/userIcon_13.png" mode="widthFix" />
{{hasPassword ? '修改' : '设置'}}支付密码 {{hasPassword ? '修改' : '设置'}}支付密码
@@ -152,7 +158,7 @@
<view>The total force ecological</view> <view>The total force ecological</view>
</view> </view>
<!-- 助记词弹出框 --> <!-- 助记词弹出框 -->
<u-modal :show="wordsShow" :zoom="false" confirmText="复制" @confirm="copyWord" confirmColor="#34CE98"> <u-modal :show="wordsShow" :zoom="false" confirmText="复制" @confirm="copyWord('zjc')" confirmColor="#34CE98">
<slot default> <slot default>
<view class="wordsCont"> <view class="wordsCont">
<view class="wordsCont-title">导出助记词</view> <view class="wordsCont-title">导出助记词</view>
@@ -163,6 +169,18 @@
</view> </view>
</slot> </slot>
</u-modal> </u-modal>
<!-- 查看文版通账号 -->
<u-modal :show="wbtShow" :zoom="false" confirmText="复制" @confirm="copyWord('wbt')" confirmColor="#34CE98">
<slot default>
<view class="wordsCont">
<view class="wordsCont-title">文版通账号</view>
<view class="wordsCont-tips">请务必抄下文版通账号并存在安全的地方若文版通账号丢失重装或换设备登录时将无法查看历史消息若文版通账号被他人获取将可能获取你的信息</view>
<view class="wordsCont-text">账号{{wbtAccount}}</view>
<image class="wordsCont-close" @click="wordsShow = false;wbtShow= false;" src="@/static/icon/userCloes.png"
mode="widthFix"></image>
</view>
</slot>
</u-modal>
<!-- 输入支付密码 --> <!-- 输入支付密码 -->
<u-modal :show="showIv" title="请输入钱包支付密码" :showCancelButton="true" confirmColor="#34CE98" negativeTop="160" <u-modal :show="showIv" title="请输入钱包支付密码" :showCancelButton="true" confirmColor="#34CE98" negativeTop="160"
@confirm="validationIv" @cancel="()=>{ this.showIv = false, this.iv = '' }"> @confirm="validationIv" @cancel="()=>{ this.showIv = false, this.iv = '' }">
@@ -223,7 +241,9 @@
walletNum: 0, walletNum: 0,
// 数据看板权限 // 数据看板权限
canSeeData: false, canSeeData: false,
messages:0, messages:0,
wbtAccount:'',
wbtShow:false,
}; };
}, },
onShow() { onShow() {
@@ -231,14 +251,29 @@
this.getInfo(); this.getInfo();
}, },
methods: { methods: {
zzz(){ onWbt(){
console.log('....'); console.log(this.wbtAccount);
if(this.wbtAccount === ''){
uni.showModal({
title:'温馨提示',
content:'当前账号没有绑定文版通账号,是否现在就去绑定',
confirmText:'立即绑定',
cancelText:'先不绑定',
success:(res) => {
if(res.confirm){
this.$Router.push({name:'WbtBind'})
}
}
})
}else{
console.log('....')
this.wbtShow = true;
}
}, },
// 用户信息 // 用户信息
getInfo() { getInfo() {
if (this.$store.state.token === '') return; if (this.$store.state.token === '') return;
info().then(res => { info().then(res => {
console.log(res)
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.nickname title: res.nickname
}); });
@@ -256,7 +291,8 @@
this.account = res.account; this.account = res.account;
this.serial = res.serial; this.serial = res.serial;
this.hasPassword = res.has_transfer_password; this.hasPassword = res.has_transfer_password;
this.messages = Number(res.messages); this.messages = Number(res.messages);
this.wbtAccount = res.wbt_account;
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
@@ -322,7 +358,6 @@
}, },
// 按钮导航 // 按钮导航
onBtn(name, params) { onBtn(name, params) {
console.log('name',name);
this.$Router.push({ this.$Router.push({
name, name,
params params
@@ -371,13 +406,14 @@
} }
}, },
// 复制助记词 // 复制助记词
copyWord() { copyWord(type) {
uni.setClipboardData({ uni.setClipboardData({
data: this.mnemonic, data: type === 'zjc'?this.mnemonic:this.wbtAccount,
success: () => { success: () => {
this.wordsShow = false this.wordsShow = false
this.wbtShow = false
uni.showToast({ uni.showToast({
title: '助记词已复制', title: type === 'zjc' ? '助记词已复制' : '文版通账号已复制',
icon: 'none', icon: 'none',
mask: true mask: true
}) })

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff