[消息中心图片处理]

This commit is contained in:
2021-09-27 11:45:21 +08:00
parent fd1759b4a3
commit d6af7dca6c
24 changed files with 688 additions and 1449 deletions

263
pages/login/guide.vue Normal file
View File

@@ -0,0 +1,263 @@
<template>
<view class="content">
<!-- <view class="title">易品新境</view> -->
<view class="login-top">
<view class="top-logo-content">
<image class="top-logo" fit="contain" src="/static/imgs/top_logo.png" />
链商星球(中国)
</view>
<image class="top-bg" fit="contain" src="/static/imgs/top_bg.png" />
</view>
<!-- 输入手机号相关 -->
<view class="inputs phone">
<label class="label">+86</label>
<input type="number" placeholder="输入您的手机号码" v-model="phone" />
</view>
<view class="inputs sms">
<input type="number" placeholder="输入短信验证码" v-model="code" />
<button class="sms-btn" type="default" size="mini" :disabled="phone == '' || getSms"
@click="getPhoneCode">{{getSms ? '重新发送' + smsTime + 's': '发送验证码'}}</button>
</view>
<button class="btn" type="default" :disabled="phone == '' || code == ''" @click="login">登录</button>
<!-- 快捷登录 -->
<view class="quick">
<view class="quick-title">快捷登录</view>
<view class="quick-box">
<image class="quick-icon" src="@/static/icons/wechat.png" mode="widthFix"></image>
</view>
</view>
<!-- 用户登录注册协议 -->
<view class="agreement">未注册的手机号验证后将自动创建账号登录即表示同意接收<navigator url="">用户隐私规格</navigator><navigator url="">用户服务协议
</navigator>
</view>
</view>
</template>
<script>
import {
getSms,
smsAuth
} from '@/apis/interfaces/auth'
export default {
data() {
return {
phone: "18245180131",
code: "",
smsTime: 60,
getSms: false
}
},
methods: {
// 用户登录
login() {
smsAuth({
mobileNo: this.phone,
code: this.code
}).then(res => {
this.$store.commit('setToken', res.token_type + ' ' + res.access_token)
this.$Router.back()
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 获取验证码
getPhoneCode() {
let outTime
getSms({
mobileNo: this.phone
}).then(res => {
uni.showToast({
title: res,
icon: "none"
})
this.getSms = true
outTime = setInterval(() => {
if (this.smsTime <= 1) {
this.getSms = false
this.smsTime = 60
clearInterval('outTime')
}
this.smsTime -= 1
}, 1000)
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
height: 100vh;
width: 100vw;
padding: $padding * 3;
box-sizing: border-box;
background: white;
.login-top {
height: 36vh;
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: center;
box-sizing: border-box;
position: relative;
padding-bottom: 160rpx;
.top-bg {
position: absolute;
bottom: 30rpx;
// left: 2rpx;
z-index: 2;
width: 740rpx;
margin-left: 40rpx;
}
.top-logo-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
color: #7f56a4;
font-size: 18px;
.top-logo {
margin-bottom: 20rpx;
width: 240rpx;
height: 240rpx;
}
}
}
.inputs {
background:rgba($color: $mian-color, $alpha: 0.05);
border: solid 1rpx $border-color;
position: relative;
margin-top: $margin;
height: 80rpx;
line-height: 80rpx;
input {
width: 100%;
height: 80rpx;
line-height: 80rpx;
padding: 0 $padding;
border: none;
box-sizing: border-box;
font-size: $title-size-lg;
}
&.phone {
padding-left: 120rpx;
.label {
position: absolute;
left: 0;
top: 0;
width: 120rpx;
text-align: center;
border-right: solid 1rpx $border-color;
font-size: $title-size-lg;
}
}
&.sms {
padding-right: 200rpx;
.sms-btn[size='mini'] {
width: 200rpx;
height: 80rpx;
line-height: 80rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
border-radius: 0;
border-left: solid 1rpx $border-color;
color: $text-price;
font-size: $title-size-lg;
&::after {
border: none;
}
&[disabled] {
color: rgba($color: $text-price, $alpha: .6);
background: $border-color-lg;
}
}
}
}
.title {
text-align: center;
font-size: $title-size + 6;
font-weight: bold;
color: $text-color;
margin-bottom: 100rpx;
}
.btn {
background: $mian-color;
color: white;
border-radius: 0;
margin-top: $margin;
font-size: $title-size;
line-height: 90rpx;
height: 90rpx;
font-weight: bold;
&::after {
border: none;
}
&[disabled] {
background: rgba($color: $mian-color, $alpha: .6);
}
}
.quick {
padding-top: $padding * 3;
text-align: center;
.quick-title {
text-align: center;
color: $text-gray;
font-size: $title-size-sm;
padding-bottom: $padding;
}
.quick-box {
display: flex;
justify-content: center;
.quick-icon {
width: 78rpx;
}
}
}
.agreement {
padding-top: $padding * 2;
font-size: $title-size-sm;
color: $text-gray;
navigator {
color: $text-price;
display: inline-block;
padding: 0 10rpx;
}
}
}
</style>

View File

@@ -249,7 +249,7 @@
}
.agreement {
padding-top: $padding * 4;
padding-top: $padding * 2;
font-size: $title-size-sm;
color: $text-gray;

View File

@@ -3,7 +3,7 @@
<view class="item" v-for="(item,index) in items" :key="index" v-if="items.length>0"
@click="item.read_at === ''?read(index,item):noread(item)">
<view class="top">
<image src="/static/images/news_2_1.png" mode="widthFix"></image>
<image src="/static/imgs/news_2_1.png" mode="widthFix" />
<!-- <image v-if="index===1" src="/static/img/news_1_1.png" mode="widthFix"></image>
<image v-if="index===2" src="/static/img/news_3_1.png" mode="widthFix"></image> -->
<view :style="item.read_at=== '' ?'flex:1;':'flex:1;color:#808080;'">{{item.title}}</view>

View File

@@ -1,65 +0,0 @@
<template>
<view class="content webkit-box">
<!-- logo -->
<image class="logo" src="@/static/img/oc-logo.png" mode="widthFix"></image>
<!-- 副标题 -->
<view class="sub-title">激活您的OC Chain区块链钱包地址</br>地址可以理解为您的个人银行卡卡号与他人转账时是区块链上两个地址的交易行为</view>
<!-- 按钮 -->
<navigator class="wallet-btn" url="./mnemonic" open-type="redirect">激活钱包</navigator>
<!-- <navigator class="wallet-btn hollow" url="./guide">导入钱包</navigator> -->
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
page {
background-color: white;
}
</style>
<style lang="scss" scoped>
.content{
position: relative;
height: 100vh;
padding: 0 15vw;
text-align: center;
.logo{
width: 138rpx;
vertical-align: top;
margin-bottom: 30vh;
}
.sub-title{
font-size: $title-size-m;
color: $text-gray;
}
.wallet-btn{
width: 100%;
background-color: $mian-color;
height: 90rpx;
line-height: 90rpx;
margin-top: $margin * 2;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
&.hollow{
background-color: white;
color: $mian-color;
border:solid 2rpx $mian-color;
box-sizing: border-box;
}
}
}
</style>

View File

@@ -1,136 +0,0 @@
<template>
<view class="webkit-box code">
<view class="webkit-box code-content">
<view class="sub-title">扫码转入OC COIN</view>
<view class="code-img">
<image :src="code" mode="widthFix" />
</view>
<view class="hr"></view>
<view class="sub-title">钱包地址</view>
<view class="hash">{{address || '-'}}</view>
<view class="buttons">
<button class="item red" type="default" @click="showShare()">分享</button>
<button class="item greed" type="default" @click="copyAddress">复制</button>
</view>
</view>
<view class="footer">OC CHNIA</view>
</view>
</template>
<script>
import { code } from '@/apis/interfaces/wallet'
export default {
data() {
return {
address: '',
code: ''
};
},
mounted() {
code().then(res=>{
this.code = res.image
this.address = res.address
}).catch(err=>{
uni.showToast({
icon: 'none',
title: err.message
})
})
},
methods:{
copyAddress(){
uni.setClipboardData({
data: this.address
})
},
showShare(){
uni.share({
provider: 'weixin',
title: '我正在使用ocChain钱包收款',
scene: 'WXSceneSession',
href: 'https://live.funnyzhibo.com/blockdownload',
imageUrl: 'https://live.funnyzhibo.com/oc-chain.png',
summary: '我的收款地址' + this.address
})
}
}
}
</script>
<style lang="scss" scoped>
.code{
height: 100vh;
background:linear-gradient(to bottom, $mian-color, $mian-color-deep);
padding-bottom: env(safe-area-inset-bottom);
padding-bottom: constant(safe-area-inset-bottom);
box-sizing: border-box;
// 收款码
.code-content{
text-align: center;
background: white;
margin: 0 8vw;
border-radius: $radius;
padding: $padding * 2;
height: 70vh;
box-shadow: 0 0 6rpx 6rpx rgba($color: #000000, $alpha: .02);
box-sizing: border-box;
.sub-title{
font-size: $title-size + 8;
}
.code-img{
width: 20vh;
height: 20vh;
margin: $margin * 3 0 $margin * 2;
display: inline-block;
background-image: url(../../static/background/wallet-code-background.png);
padding: $padding;
box-sizing: border-box;
background-position: center;
background-size: cover;
image{
width: 100%;
}
}
.hr{
height: 1rpx;
background: $border-color;
margin: $margin * 2 0;
}
.hash{
word-wrap: break-word;
font-size: $title-size;
padding: $padding 0;
}
.buttons{
display: flex;
padding-top: $padding * 2;
.item{
width: 40%;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: $title-size;
color: white;
&::after{
border: none;
}
&.red{
background: $red-color;
}
&.greed{
background: $mian-color;
}
}
}
}
// 底部
.footer{
height: 10vh;
line-height: 10vh;
text-align: center;
font-size: $title-size + 10;
font-weight: bold;
color: #58876e;
}
}
</style>

View File

@@ -1,138 +0,0 @@
<template>
<view>
<!-- 设置钱包密码 -->
<view class="password">
<view class="prompt">请设置6位数字密码建议不要使用连续的数字</view>
<view class="group">
<view class="inputs">
<label>密码</label>
<input type="digit" v-model="password" maxlength="6" placeholder="请设置密码" />
</view>
<view class="inputs">
<label>确认密码</label>
<input type="digit" v-model="verify" maxlength="6" placeholder="请确认密码" />
</view>
</view>
</view>
<!-- 按钮 -->
<view class="buttons">
<button type="default" form-type="submit" @click="createWallet">确认</button>
</view>
</view>
</template>
<script>
import {
security
} from '@/apis/interfaces/wallet'
export default {
data() {
return {
password: '',
verify: ''
}
},
methods: {
// 激活钱包
createWallet() {
if (this.password === '' || this.verify === '') {
uni.showToast({
icon: 'none',
title: '请设置密码'
})
return
}
if (this.password !== this.verify) {
uni.showToast({
icon: 'none',
title: '两次输入密码不一致'
})
return
}
security({
code: this.password
}).then(res => {
uni.navigateBack()
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
}
}
}
</script>
<style lang="scss" scoped>
// 副标题
.sub-title {
color: $text-gray;
text-align: center;
margin: $margin * 2 $margin;
font-size: $title-size-m;
}
// 设置密码
.password {
padding: 0 $padding * 2;
.prompt {
margin-top: $margin * 2;
font-size: $title-size-m;
color: $mian-color;
}
.group {
margin-top: $margin;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
.inputs {
padding: $padding $padding + 10;
border-bottom: solid 1rpx $border-color;
&:last-child {
border-bottom: none;
}
label {
color: $text-gray;
font-size: $title-size-m;
}
input {
height: 70rpx;
line-height: 70rpx;
font-size: $title-size;
}
}
}
}
// 按钮
.buttons {
padding: $padding * 2;
.text {
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $mian-color;
font-weight: bold;
}
button {
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

View File

@@ -1,125 +0,0 @@
<template>
<view>
<form>
<!-- 副标题 -->
<view class="sub-title">输入您的钱包助记词导入</view>
<!-- 助记词 -->
<view class="word">
<textarea placeholder="输入助记词"></textarea>
</view>
<!-- 设置钱包密码 -->
<view class="password">
<view class="group">
<view class="inputs">
<label>钱包名称</label>
<input type="text" placeholder="输入钱包名称" />
</view>
</view>
<view class="title">不少于8个字符建议包含大小写符号特殊字符</view>
<view class="group">
<view class="inputs">
<label>密码</label>
<input type="password" placeholder="请设置密码" />
</view>
<view class="inputs">
<label>确认密码</label>
<input type="password" placeholder="请确认密码" />
</view>
</view>
</view>
<!-- 按钮 -->
<view class="buttons">
<view class="text">什么是助记词</view>
<button type="default" form-type="submit">开始导入</button>
</view>
</form>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
// 副标题
.sub-title{
line-height: 90rpx;
color: $text-gray;
text-align: center;
margin: $margin;
font-size: $title-size-m;
}
// 助记词
.word{
background-color: white;
margin: $margin * 2;
padding: $padding + 10;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
& textarea{
height: 200rpx;
}
}
// 设置密码
.password{
padding: 0 $padding * 2;
.title{
margin-top: $margin * 2;
font-size: $title-size-m;
color: $mian-color;
}
.group{
margin-top: $margin;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
.inputs{
padding: $padding $padding + 10;
border-bottom: solid 1rpx $border-color;
&:last-child{
border-bottom: none;
}
label{
color: $text-gray;
font-size: $title-size-m;
}
input{
height: 70rpx;
line-height: 70rpx;
font-size: $title-size;
}
}
}
}
// 按钮
.buttons{
padding: $padding * 2;
.text{
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $mian-color;
font-weight: bold;
}
button{
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

View File

@@ -1,144 +0,0 @@
<template>
<view class="animate__animated animate__fadeInRight">
<!-- 数字资产 -->
<view class="property">
<view class="title">总资产()</view>
<view class="number">0.00</view>
</view>
<!-- 资产列表 -->
<view class="lists">
<view class="lists-header">
资产列表
<uni-icons type="plus" size="24" color="#aa55ff"></uni-icons>
</view>
<view class="item" v-for="(item, index) in 2" :key="index" @click="propertyInfo(item)">
<view class="cost">
<image class="logo" src="" mode="" />
<view class="title ellipsis">OC COIN</view>
<view class="text ellipsis">0.21</view>
</view>
<view class="balance">
<view class="title ellipsis">120,330.00</view>
<view class="text ellipsis">25269.3000</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods:{
propertyInfo(e){
console.log(e)
uni.navigateTo({
url: './property'
})
}
}
}
</script>
<style scoped>
</style>
<style lang="scss" scoped>
// 数字资产
.property{
overflow: hidden;
position: relative;
margin-top: $margin;
margin-left: $margin + ($margin / 2);
background-color: $mian-color;
border-radius: $radius 0 0 $radius;
padding: ($padding * 3) ($padding * 3) ($padding * 3) ($padding * 2);
color: white;
font-weight: bold;
&::before,&::after{
background-color: rgba($color: $red-color, $alpha: .03);
border-radius: 50%;
content: " ";
position: absolute;
}
&::before{
top: -300rpx;
left: 40%;
height: 400rpx;
width: 400rpx;
}
&::after{
bottom: -200rpx;
left: -100rpx;
height: 300rpx;
width: 300rpx;
}
.title{
font-size: $title-size;
}
.number{
font-size: $title-size + 18;
}
}
// 资产列表
.lists{
padding: $margin + ($margin / 2);
.lists-header{
display: flex;
font-size: $title-size + 2;
color: $text-color;
font-weight: bold;
padding: $padding 0 ($padding/2) 0;
justify-content: space-between;
justify-items: center;
align-items: center;
}
.item{
background-color: white;
border-radius: $radius;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
margin-top: $margin;
padding: $padding * 2;
display: flex;
&:first-child{
margin-top: 0;
}
.cost{
position: relative;
margin-right: $margin;
padding-left: 108rpx;
width: 50%;
box-sizing: border-box;
.logo{
position: absolute;
left: 0;
top: 0;
width: 88rpx;
height: 88rpx;
border-radius: 50%;
background-color: $border-color;
margin-right: $margin;
}
}
.balance{
padding-left: $padding;
width: 50%;
text-align: right;
box-sizing: border-box;
}
.title{
font-weight: bold;
font-size: $title-size;
}
.text{
font-size: $title-size-m;
color: $text-gray;
}
}
}
</style>

View File

@@ -1,108 +0,0 @@
<template>
<view>
<!-- 提示信息 -->
<view class="prompt">
请按照顺序记录并确保正确备份助记词
</view>
<!-- 助记词 -->
<ul class="mnemonic">
<li v-for="(item, index) in mnemonic" :key="index">{{item}}</li>
</ul>
<!-- 按钮 -->
<view class="buttons">
<view class="text">助记词是用户账户的唯一标识不能分享给他人掌握该助记词即可控制该账户与钱包</view>
<button type="default" @click="goto('/pages/wallet/validation')">验证助记词</button>
</view>
<!-- <view class="skip">暂时不验证<navigator url="/pages/index/index" open-type="switchTab">点此跳过</navigator></view> -->
</view>
</template>
<script>
import { seed } from "../../apis/interfaces/wallet"
export default {
data() {
return {
mnemonic: [], // 助记词
sign : '' // 校验签名
}
},
onLoad() {
seed().then(res => {
this.mnemonic = res.seed.split(' ')
this.sign = res.sign
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
methods: {
goto(url){
uni.redirectTo({
url: url + '?seed=' + this.mnemonic + '&sign=' + this.sign
})
}
}
}
</script>
<style lang="scss" scoped>
// 提示信息
.prompt{
color: $text-gray;
text-align: center;
line-height: 90rpx;
font-size: $title-size-m;
}
// 跳过
.skip{
padding: $padding * 2;
text-align: center;
color: $text-gray;
navigator{
color: $mian-color;
margin-left: $margin/2;
display: inline-block;
}
}
// 助记词
.mnemonic{
margin: $margin $margin * 2;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
padding: $padding;
list-style: none;
display: flex;
flex-wrap: wrap;
li{
text-align: center;
height: 58rpx;
line-height: 58rpx;
width: 58rpx;
margin: $margin / 2;
color: $text-color;
background: rgba($color: $border-color, $alpha: .4);
}
}
// 按钮
.buttons{
padding: $padding $padding * 2;
.text{
text-align: center;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $red-color;
}
button{
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

View File

@@ -1,108 +0,0 @@
<template>
<view>
<!-- 私钥 -->
<view class="keys">
<view class="title">您已接收OC Chain托管</view>
<view class="key">{{key || '-'}}</view>
<view class="copykey" @click="copykey">复制我的私钥</view>
</view>
<!-- 疑问 -->
<view class="doubt" v-if="rules.length > 0">
<view class="doubt-item" v-for="(item, index) in rules" :key="index">
<view class="title">{{item.title || '-'}}</view>
<view class="content">{{item.description || '-'}}</view>
</view>
</view>
<!-- 免责说明 -->
<view class="liability">
<navigator url="/pages/wallet/cmsWithDraw">免责条款</navigator>
</view>
</view>
</template>
<script>
import { privatekey, keyrules } from '@/apis/interfaces/wallet'
export default {
data() {
return {
key: "",
rules: []
};
},
mounted() {
Promise.all([privatekey(this.$Route.query.password), keyrules()]).then(res => {
let privatekey = res[0],
keyrules = res[1]
this.key = privatekey.private_key
this.rules = keyrules
})
},
methods:{
copykey(){
uni.setClipboardData({
data: this.key
})
}
}
}
</script>
<style lang="scss">
.keys{
margin: $margin * 2;
background: white;
padding: $padding * 2;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
border-radius: $radius;
.title{
text-align: center;
font-weight: bold;
font-size: $title-size + 4;
color: $text-color;
}
.key{
padding: $padding * 2 0;
text-align: center;
color: $mian-color;
word-wrap: break-word;
}
.copykey{
background-color: $mian-color;
color: white;
height: 95rpx;
line-height: 95rpx;
text-align: center;
font-size: $title-size;
border-radius: $radius-m;
font-weight: bold;
}
}
.doubt{
margin: $margin $margin * 2;
.doubt-item{
padding: $padding 0;
.title{
font-weight: bold;
color: $text-color;
line-height: 50rpx;
font-size: $title-size + 2;
}
.content{
color: $text-gray-lg;
font-size: $title-size-m;
line-height: 40rpx;
}
}
}
.liability{
text-align: center;
color: $text-gray;
@extend .ios-bottom;
navigator{
font-size: $title-size-sm;
display: inline-block;
line-height: 90rpx;
padding: 0 ($padding * 2);
}
}
</style>

View File

@@ -1,150 +0,0 @@
<template>
<view>
<!-- 设置钱包密码 -->
<view class="password">
<view class="prompt">请设置6位数字密码建议不要使用连续的数字</view>
<view class="group">
<view class="inputs">
<label>密码</label>
<input type="digit" v-model="password" maxlength="6" password placeholder="请设置新密码" />
</view>
<view class="inputs">
<label>确认密码</label>
<input type="digit" v-model="verify" maxlength="6" password placeholder="请确认新密码" />
</view>
</view>
</view>
<!-- 按钮 -->
<view class="buttons">
<button type="default" form-type="submit" @click="createWallet">确认</button>
</view>
</view>
</template>
<script>
import {
securityReset
} from '@/apis/interfaces/wallet'
export default {
data() {
return {
password: '',
verify: '',
oldPassword: ''
}
},
onLoad() {
this.oldPassword = this.$Route.query.password
},
methods: {
// 激活钱包
createWallet() {
if (this.password === '' || this.verify === '') {
uni.showToast({
icon: 'none',
title: '请设置密码'
})
return
}
if (this.password !== this.verify) {
uni.showToast({
icon: 'none',
title: '两次输入密码不一致'
})
return
}
securityReset({
new_code: this.password,
old_code: this.oldPassword
}).then(res => {
uni.showModal({
title: '提示',
content: '密码已重置',
showCancel:false,
success: res=> {
uni.navigateBack()
}
})
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
}
}
}
</script>
<style lang="scss" scoped>
// 副标题
.sub-title {
color: $text-gray;
text-align: center;
margin: $margin * 2 $margin;
font-size: $title-size-m;
}
// 设置密码
.password {
padding: 0 $padding * 2;
.prompt {
margin-top: $margin * 2;
font-size: $title-size-m;
color: $mian-color;
}
.group {
margin-top: $margin;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
.inputs {
padding: $padding $padding + 10;
border-bottom: solid 1rpx $border-color;
&:last-child {
border-bottom: none;
}
label {
color: $text-gray;
font-size: $title-size-m;
}
input {
height: 70rpx;
line-height: 70rpx;
font-size: $title-size;
}
}
}
}
// 按钮
.buttons {
padding: $padding * 2;
.text {
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $mian-color;
font-weight: bold;
}
button {
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

View File

@@ -1,77 +0,0 @@
<template>
<view>
<view class="webkit-box results">
<uni-icons type="checkbox-filled" size="88" color="#009b69"></uni-icons>
<view class="title">交易已提交</view>
<view class="sub-title">预计10秒内到账可在交易记录中查询以实际到账时间为准</view>
<view class="hash">
<view class="hash-title">交易哈希</view>
<view class="hash-text">{{hash}}</view>
</view>
<button class="results-button" type="default" @click="navBack">返回</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
hash: ''
};
},
onLoad(e){
this.hash = e.hash
},
methods:{
navBack(){
uni.navigateBack()
}
}
}
</script>
<style lang="scss" scoped>
.results{
height: 100vh;
box-sizing: border-box;
text-align: center;
padding-left: $padding * 3;
padding-right: $padding * 3;
padding-bottom: 20vh;
.title{
font-size: $title-size + 8;
color: $text-color;
font-weight: bold;
line-height: 80rpx;
padding: $padding 0;
}
.sub-title{
color: $text-gray;
line-height: 40rpx;
}
.hash{
background-color: white;
padding: $padding * 2;
border-radius: $radius-lg;
margin-top: $margin * 2;
font-size: $title-size;
color: $text-color;
.hash-title{
padding-bottom: $padding;
}
.hash-text{
word-break:break-all;
}
}
.results-button{
margin-top: $margin * 3;
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
color: white;
font-size: $title-size;
font-weight: bold;
}
}
</style>

View File

@@ -1,216 +0,0 @@
<template>
<view>
<!-- 账户余额 -->
<view class="transfer-block">
<view class="unit">OCC</view>
<view class="transfer-flex">
<view class="item ellipsis">
<label>数量</label>{{balance.balance || '0.00'}}
</view>
<view class="item ellipsis">
<label>估值(CNY)</label>{{cny || '0.00'}}
</view>
</view>
</view>
<view class="sub-title">
<text>请认真确认地址及数量地址错误无法找回</text>
</view>
<!-- 转账信息 -->
<view class="password">
<view class="group">
<view class="inputs input-scan">
<label>接收地址</label>
<input type="text" placeholder="请输入接收地址" v-model="address" />
<view class="input-scan-icon" @click="scanCode">
<uni-icons type="scan" size="22" color="#009b69"></uni-icons>
</view>
</view>
<view class="inputs">
<label>转账数量</label>
<input type="number" placeholder="请输入转账数量" v-model="number" />
</view>
</view>
<view class="group">
<view class="inputs">
<label>交易密码</label>
<input type="password" placeholder="请输入安全密码" v-model="password" />
</view>
</view>
</view>
<!-- 按钮 -->
<view class="buttons">
<button type="default" @click="submitTransfer">转账</button>
</view>
</view>
</template>
<script>
import { sum, price, transfer } from '@/apis/interfaces/wallet'
export default {
data() {
return {
balance: {},
cny: '0.00',
address: '',
number: '',
password: ''
}
},
onLoad(e){
if(e.hashAddress) this.address = e.hashAddress
},
mounted() {
Promise.all([
sum(),
price()
]).then(res => {
this.balance = res[0]
if (res[0].balance > 0) this.cny = (res[1] * res[0].balance).toFixed(2)
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
methods: {
// 转账
submitTransfer(){
if(this.address === '' || this.number === '' || this.password === ''){
let messageText
if(this.address === '') messageText = '请输入接收地址'
else if(this.number === '') messageText = '请输入转账数量'
else if(this.password === '') messageText = '请输入安全密码'
uni.showToast({
icon: 'none',
title: messageText
})
return
}
// 提交转账信息
transfer({
to: this.address,
amount: this.number,
security_code: this.password
}).then(res => {
uni.redirectTo({
url: './results?hash=' + res.txHash + '&number=' + this.number
})
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
// 扫码
scanCode(){
uni.scanCode({
scanType: ['qrCode'],
success: res=> {
this.address = res.result
}
})
}
}
}
</script>
<style lang="scss" scoped>
// 账户余额
.transfer-block{
background-color: white;
margin: $margin * 2;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
padding: $padding $padding + 10;
.unit{
font-weight: bold;
font-size: $title-size + 10;
line-height: 90rpx;
color: $text-color;
}
.transfer-flex{
display: flex;
padding: $padding 0;
border-top: solid 1rpx $border-color;
.item{
width: 50%;
font-size: $title-size-m;
& > label{
color: $text-gray;
padding-right: $padding/2;
}
}
}
}
// 提示信息
.sub-title{
color: $text-gray;
text-align: center;
margin: $margin * 2 $margin;
font-size: $title-size-m;
}
// 转账信息
.password{
padding: 0 $padding * 2;
.group{
margin-top: $margin;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
.inputs{
padding: $padding $padding + 10;
border-bottom: solid 1rpx $border-color;
&:last-child{
border-bottom: none;
}
label{
color: $text-gray;
font-size: $title-size-m;
}
input{
height: 70rpx;
line-height: 70rpx;
font-size: $title-size;
}
}
.input-scan{
position: relative;
padding-right: ($padding*2) + 70;
.input-scan-icon{
position: absolute;
bottom: $padding;
right: $padding;
height: 70rpx;
width: 70rpx;
line-height: 70rpx;
text-align: center;
}
}
}
}
// 按钮
.buttons{
padding: $padding * 2;
.text{
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $mian-color;
font-weight: bold;
}
button{
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

View File

@@ -1,169 +0,0 @@
<template>
<view>
<!-- 提示信息 -->
<view class="prompt">
验证您的钱包助记词
</view>
<!-- 助记词 -->
<view class="mnemonic">
<view
class="item"
v-for="(item, index) in validation"
:key="index"
:class="item === null ? 'hide': ''"
@click="onKeys('removeKey', index)"
>{{ item }}</view>
</view>
<!-- 选择助记词 -->
<block v-if="mnemonic.length > 0">
<view class="mnemonic-title">
按顺序填写助记词
</view>
<view class="mnemonic-select">
<view class="item" v-for="(item, index) in mnemonic" :key="index" @click="onKeys('addKey', index)">{{ item }}</view>
</view>
</block>
<!-- 按钮 -->
<view class="buttons">
<button type="default" @click="verifyMnemonic">验证</button>
</view>
</view>
</template>
<script>
import { hash } from "../../apis/interfaces/wallet"
export default {
data() {
return {
validation : new Array(15).fill(null), // 验证key
mnemonic : [], // 助记词key
sign : '', // 助记词校验签名
seedString : '', // 助记词原词
}
},
onLoad(e) {
let seed = e.seed.split(',')
seed.sort(() => {
return Math.random() - .5
});
this.mnemonic = seed
this.sign = e.sign
this.seedString = e.seed
},
methods: {
// 填写助记词
onKeys(type, index){
if(type === 'addKey') {
this.$set(this.validation, this.validation.findIndex(val => val === null), this.mnemonic[index])
this.$delete(this.mnemonic, index)
return
}
if(type === 'removeKey' && this.validation[index] !== null) {
this.mnemonic.push(this.validation[index])
this.$delete(this.validation, index)
this.validation.push(null)
}
},
// 验证助记词
verifyMnemonic(){
if(this.validation.findIndex(val => val === null) > -1){
uni.showToast({
title: '请完整填写助记词',
icon : 'none'
})
return
}
let seed = this.validation.toString().replace(/,/g, ',')
if (this.seedString !== seed) {
uni.showToast({
title: '验证失败,请确认您的助记词',
icon : 'none'
})
return
}
uni.redirectTo({
url: './create'
})
}
}
}
</script>
<style lang="scss" scoped>
// 提示信息
.prompt{
color: $text-gray;
text-align: center;
line-height: 90rpx;
font-size: $title-size-m;
}
// 选择助记词
.mnemonic-title{
padding-top: $padding * 2;
margin: 0 $margin * 2;
font-size: $title-size-m;
color: $mian-color;
}
.mnemonic-select{
display: flex;
flex-wrap: wrap;
padding: $padding $padding + $padding / 2;
.item{
background-color: white;
line-height: 68rpx;
height: 68rpx;
width: 68rpx;
text-align: center;
margin: $margin / 2;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
}
}
// 助记词
.mnemonic{
margin: $margin ($margin * 2);
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
padding: $padding;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
.item{
background: rgba($color: $border-color, $alpha: .4);
width: 58rpx;
height: 58rpx;
line-height: 58rpx;
text-align: center;
color: $text-color;
margin: $margin / 2;
&.hide{
border:dashed 1px $border-color;
box-sizing: border-box;
background-color: white;
}
}
}
// 按钮
.buttons{
padding: $padding $padding * 2;
.text{
text-align: center;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $red-color;
}
button{
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
&[disabled]{
background: rgba($color: $mian-color, $alpha: .8);
}
}
}
</style>