You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
179 lines
4.0 KiB
179 lines
4.0 KiB
<template>
|
|
<view class="">
|
|
<navigation :showBack="true">
|
|
{{i18n.backupMneTit}}
|
|
</navigation>
|
|
<view class="main">
|
|
<view class="title">
|
|
{{i18n.conMne}}
|
|
</view>
|
|
<view class="title2">
|
|
{{i18n.boosterword}}
|
|
</view>
|
|
<view class="textareaa">
|
|
<view class="mnemonicBlock u-rela item" v-for="(item,index) in wordArr" :key="index">
|
|
<text @click="returnWord(item,index)">{{ item }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="mnemonic">
|
|
<view class="mnemonicBlock u-rela" v-for="(item,index) in mnemonics" :key="index">
|
|
<text @click="toWrod(item,index)" class="item">{{ item }}</text>
|
|
<view class="number u-abso" v-text="index+1<10 ? ((index+1)) : index+1"></view>
|
|
</view>
|
|
</view>
|
|
|
|
<u-button class="custom-style" @click="confirm">{{i18n.Confirm}}</u-button>
|
|
|
|
|
|
<view class="info_con" v-if="show">
|
|
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img2" @click="show=false"></image>
|
|
<image src="../../../../static/tongyonh/Frame60.png" mode="aspectFit" class="img"></image>
|
|
<view class="info">
|
|
{{i18n.Successful}}
|
|
</view>
|
|
<view class="text">
|
|
{{i18n.backCom}}
|
|
</view>
|
|
<view class="btn" @click="goTranPaw">
|
|
{{i18n.Confirm}}
|
|
</view>
|
|
</view>
|
|
|
|
<view class="info_con" v-if="show2">
|
|
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img2" @click="show2=false"></image>
|
|
<image src="../../../../static/tongyonh/Subtract.png" mode="aspectFit" class="img"></image>
|
|
<view class="info">
|
|
{{i18n.seed}}
|
|
</view>
|
|
<view class="text">
|
|
{{i18n.wrongWord}} <br>{{i18n.wrongWord2}}
|
|
</view>
|
|
<view class="btncon">
|
|
<view class="can" @click="show2=false">
|
|
{{i18n.Cancel}}
|
|
</view>
|
|
<view class="con" @click="restart">
|
|
{{i18n.Confirm}}
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<u-mask :show="show" z-index="10"></u-mask>
|
|
<u-mask :show="show2" z-index="10"></u-mask>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import cont from "@/components/navigation/navigation.vue"
|
|
export default {
|
|
data() {
|
|
return {
|
|
mnemonics:[],
|
|
wordArr:[],
|
|
show: false,
|
|
index:0,
|
|
returnIndex:0,
|
|
// 拿来对比的
|
|
mnemonics2:[],
|
|
show2:false,
|
|
};
|
|
},
|
|
methods: {
|
|
// 成功去到设置交易密码
|
|
goTranPaw(){
|
|
uni.navigateTo({
|
|
url:'/pages/menu/backUp/transPaw/index'
|
|
})
|
|
},
|
|
// 失败重刷新
|
|
restart(){
|
|
uni.redirectTo({
|
|
url:'../backUp3/index'
|
|
})
|
|
},
|
|
// 提交
|
|
confirm(){
|
|
var go=false;
|
|
for(var i=0;i<this.mnemonics2.length;i++){
|
|
if(this.mnemonics2[i]==this.wordArr[i]){
|
|
go=true;
|
|
}else{
|
|
go=false;
|
|
}
|
|
|
|
};
|
|
if(go){
|
|
this.show=true;
|
|
}else{
|
|
this.show2=true
|
|
}
|
|
},
|
|
// 获取词语
|
|
getWrod(){
|
|
var walletInfo = uni.getStorageSync('word');
|
|
this.mnemonics=walletInfo.split(' ')
|
|
// 词语数组打乱顺序
|
|
this.mnemonics.sort(function() {
|
|
return (0.5-Math.random());
|
|
});
|
|
this.mnemonics2=walletInfo.split(' ')
|
|
},
|
|
returnWord(item,index){
|
|
this.wordArr.splice(index,1);
|
|
this.mnemonics.splice(this.returnIndex,0,item);
|
|
console.log(this.mnemonics,'return')
|
|
console.log(this.returnIndex,'return')
|
|
this.index--
|
|
},
|
|
// 给词到文本框
|
|
toWrod(word,index){
|
|
console.log(word,index,11111)
|
|
this.mnemonics.splice(index,1);
|
|
console.log(this.mnemonics,'to')
|
|
this.wordArr[this.index]=word
|
|
this.returnIndex=index
|
|
console.log(this.wordArr)
|
|
this.index++
|
|
this.$forceUpdate()
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.getWrod()
|
|
},
|
|
computed: {
|
|
i18n() {
|
|
return this.$t('index')
|
|
|
|
},
|
|
}
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
.custom-style {
|
|
height: 112rpx;
|
|
text-align: center;
|
|
color: #fff;
|
|
background-color: #5B53FF !important;
|
|
border-radius: 40rpx;
|
|
margin-top: 50rpx;
|
|
}
|
|
.u-default-hover{
|
|
background-color: #5B53FF !important;
|
|
border-radius: 40rpx !important;
|
|
color: #fff !important;
|
|
border: none;
|
|
}
|
|
</style>
|
|
|
|
<style>
|
|
|
|
@import './index.css';
|
|
|
|
</style>
|
|
|