feat: 前端全量更新 - 含所有本次需求
- 移除秒合约页面及UI - 合约页Tab改为Position Held/Transaction Record - 存款/提款/转账页增加BTC/ETH - 资产页重构(用户信息+盈亏+多语言) - 注册页改版(匹配新设计稿) - 日文全面翻译+首页菜单多语言 - 代理专属注册链接支持(?code=) - 10个locale文件同步更新
This commit is contained in:
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<view class="regPage" :style="'background-color: '+theme.bg+';color: '+theme.text">
|
||||
<myNav :title="''"></myNav>
|
||||
<view class="regBody">
|
||||
<!-- 标题 -->
|
||||
<text class="regTitle">{{i18n.regist.navTitle}}</text>
|
||||
|
||||
<!-- Tab -->
|
||||
<view class="regTabs">
|
||||
<view class="regTab regTabActive">
|
||||
<text class="font-26 color-white">{{i18n.regist.phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 邮箱 -->
|
||||
<view class="regField">
|
||||
<text class="regLabel">{{i18n.regist.phone}}</text>
|
||||
<view class="regInputBox">
|
||||
<input class="regInput" type="text" v-model="email" :placeholder="i18n.regist.phoneTag" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 手机号(可选) -->
|
||||
<view class="regField">
|
||||
<text class="regLabel">{{i18n.regist.mobile}}</text>
|
||||
<view class="regInputBox">
|
||||
<input class="regInput" type="text" v-model="mobile" :placeholder="i18n.regist.mobileTag" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 密码 -->
|
||||
<view class="regField">
|
||||
<text class="regLabel">{{i18n.regist.login}}</text>
|
||||
<view class="regInputBox">
|
||||
<input class="regInput" type="text" v-model="password" password :placeholder="i18n.regist.loginTag" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 确认密码 -->
|
||||
<view class="regField">
|
||||
<text class="regLabel">{{i18n.regist.confirm}}</text>
|
||||
<view class="regInputBox">
|
||||
<input class="regInput" type="text" v-model="password2" password :placeholder="i18n.regist.confirmTag" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 邀请码 -->
|
||||
<view class="regField">
|
||||
<text class="regLabel">{{i18n.regist.invitation}}</text>
|
||||
<view class="regInputBox">
|
||||
<input class="regInput" type="text" v-model="referral_code" :placeholder="i18n.regist.invitationTag" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 验证码 -->
|
||||
<view class="regField">
|
||||
<text class="regLabel">{{i18n.regist.code}}</text>
|
||||
<view class="regInputBox regInputRow">
|
||||
<input class="regInput" type="text" v-model="code" :placeholder="i18n.regist.codeTag" />
|
||||
<text class="regCodeBtn" @click="cutTime()">{{codeText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 协议 -->
|
||||
<view class="regAgree" @click="agreed=!agreed">
|
||||
<view class="regCheckbox" :class="agreed?'regChecked':''">
|
||||
<text v-if="agreed" class="font-24 color-white">✓</text>
|
||||
</view>
|
||||
<text class="font-24 color-999">{{i18n.login.tag}}</text>
|
||||
<text class="font-24 regLink" @click.stop="router.push('/pages/my/aboutUs/agreement')">{{i18n.login.tag1}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 注册按钮 -->
|
||||
<button @click="register" class="cu-btn regBtn">{{i18n.regist.navTitle}}</button>
|
||||
|
||||
<!-- 已有账号 -->
|
||||
<view class="regFooter">
|
||||
<text class="font-26 color-999">{{i18n.login.noAccount}}</text>
|
||||
<text class="font-26 regLink" @click="router.push('/pages/login/index')">{{i18n.login.login}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
email: '',
|
||||
mobile: '',
|
||||
password: '',
|
||||
password2: '',
|
||||
code: '',
|
||||
referral_code: '',
|
||||
flag: true,
|
||||
time: '获取验证码',
|
||||
timeFlag: true,
|
||||
agreed: false,
|
||||
theme: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
i18n() {
|
||||
return this.$t('message');
|
||||
},
|
||||
codeText() {
|
||||
if (this.time > 0) {
|
||||
return this.time + " s"
|
||||
} else {
|
||||
return this.i18n.regist.get
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
// 代理专属注册链接: 自动填入邀请码
|
||||
if (e && e.code) {
|
||||
this.referral_code = e.code
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
if (uni.getStorageSync("theme") == "dark") {
|
||||
this.theme = this.$store.state.darkTheme
|
||||
} else {
|
||||
this.theme = this.$store.state.lightTheme
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onClose() {
|
||||
uni.navigateBack({ delta: 1 })
|
||||
},
|
||||
register() {
|
||||
if (!this.flag) return
|
||||
if (this.email == '') {
|
||||
this.tos(this.i18n.regist.phoneTag)
|
||||
return
|
||||
}
|
||||
if (this.code == '') {
|
||||
this.tos(this.i18n.regist.codeTag)
|
||||
return
|
||||
}
|
||||
if (this.password == '') {
|
||||
this.tos(this.i18n.regist.loginTag)
|
||||
return
|
||||
}
|
||||
if (this.password2 == '') {
|
||||
this.tos(this.i18n.regist.confirmTag)
|
||||
return
|
||||
}
|
||||
if (this.password != this.password2) {
|
||||
this.tos(this.i18n.regist.tos1)
|
||||
return
|
||||
}
|
||||
if (!this.agreed) {
|
||||
this.tos(this.i18n.login.tos1)
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.i18n.regist.loading,
|
||||
mask: true
|
||||
})
|
||||
this.flag = false
|
||||
var obj = {
|
||||
email: this.email,
|
||||
password: this.password,
|
||||
code: this.code,
|
||||
referral_code: this.referral_code,
|
||||
}
|
||||
if (this.mobile) {
|
||||
obj.mobile = this.mobile
|
||||
}
|
||||
this.post('/user/register', obj).then(res => {
|
||||
console.log(res)
|
||||
uni.hideLoading()
|
||||
this.flag = true
|
||||
if (res.code == 1) {
|
||||
this.tos(res.msg)
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/index?email=' + this.email
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
},
|
||||
cutTime() {
|
||||
if (!this.timeFlag) return
|
||||
if (this.email == "") {
|
||||
this.tos(this.i18n.regist.phoneTag)
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.i18n.regist.loading,
|
||||
mask: true
|
||||
})
|
||||
this.timeFlag = false
|
||||
this.post('/ems/send', {
|
||||
email: this.email,
|
||||
event: "register",
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 1) {
|
||||
this.tos(res.msg)
|
||||
this.time = 120
|
||||
var that = this
|
||||
let timeName = setInterval(() => {
|
||||
if (that.time > 0) {
|
||||
that.time--
|
||||
} else {
|
||||
that.time = 0
|
||||
that.timeFlag = true
|
||||
clearInterval(timeName)
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
this.timeFlag = true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.regPage {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.regBody {
|
||||
padding: 30rpx 50rpx 60rpx;
|
||||
}
|
||||
|
||||
.regTitle {
|
||||
font-size: 48rpx;
|
||||
font-weight: 700;
|
||||
color: #111111;
|
||||
display: block;
|
||||
margin-bottom: 36rpx;
|
||||
}
|
||||
|
||||
.regTabs {
|
||||
display: flex;
|
||||
margin-bottom: 36rpx;
|
||||
}
|
||||
|
||||
.regTab {
|
||||
height: 60rpx;
|
||||
padding: 0 30rpx;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #D1D3D8;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.regTabActive {
|
||||
background: #10C7A0;
|
||||
}
|
||||
|
||||
.regField {
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
|
||||
.regLabel {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #333333;
|
||||
margin-bottom: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.regInputBox {
|
||||
height: 88rpx;
|
||||
background: #F0F4FA;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.regInputRow {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.regInput {
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
font-size: 28rpx;
|
||||
color: #111111;
|
||||
}
|
||||
|
||||
.regCodeBtn {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #1A74FF;
|
||||
margin-left: 18rpx;
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.regAgree {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
|
||||
.regCheckbox {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
border: 2rpx solid #CCCCCC;
|
||||
border-radius: 50%;
|
||||
margin-right: 14rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.regChecked {
|
||||
background: #1A74FF;
|
||||
border-color: #1A74FF;
|
||||
}
|
||||
|
||||
.regLink {
|
||||
color: #1A74FF;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.regBtn {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background: #1A74FF !important;
|
||||
border-radius: 10rpx;
|
||||
line-height: 90rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.regFooter {
|
||||
text-align: center;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user