Files
frontend-app/pages/rwa_binding/rwa_binding.vue
T
2025-08-05 15:25:23 +08:00

153 lines
3.5 KiB
Vue

<template>
<view class="rwa_add_warp">
<Header leftTitle="绑定交易所账户" left-path-type="navigateTo" left-path="/pages/rwa/rwa"/>
<view class="rwa_add_content">
<view class="rwa_add_form">
<view class="rwa_add_item">
<view class="rwa_add_item_title">交易所名称,示例值(ALPHACEX)</view>
<up-input
placeholder="请输入交易所名称"
border="surround"
v-model="form.name"
:customStyle="inputCss"
disabled
></up-input>
</view>
<view class="rwa_add_item">
<view class="rwa_add_item_title">输入邮箱</view>
<up-input
placeholder="请输入邮箱账户"
border="surround"
v-model="form.email"
:customStyle="inputCss"
></up-input>
</view>
</view>
<view class="add_but_css" @click="bindingRwa">
绑定
</view>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import Header from '@/components/header.vue';
import { bindExchUsers } from '@/api/finance.js';
import { getUserList } from '@/api/common.js';
import { SMS_TYPE } from '@/utils/enumUtils.js';
export default {
components:{Header},
data() {
return {
inputCss:{
"height":'80rpx',
"background": "#F5F5F5",
"border-radius": "20rpx",
"border": "0rpx",
"padding-left": "16px",
},
form:{
name:"ALPHACEX",
email:'',
},
countdown:false,// 清空倒计时
};
},
methods: {
async bindingRwa(){
const params = this.form;
if(!params.email){
this.$refs.uToastRef.show({
type: 'error',
message: "请输入邮箱账户",
});
return;
}
const resp = await bindExchUsers(params);
if(resp.bizcode === 100){
const data = resp.data;
if(data && data.status === 0){
this.$refs.uToastRef.show({
type: 'success',
message: "绑定成功",
});
setTimeout(()=>{
uni.navigateTo({
url:'/pages/rwa/rwa',
})
},2000)
}else{
this.$refs.uToastRef.show({
type: 'error',
message: "账号不存在,立即前往注册页面",
});
setTimeout(()=>{
uni.navigateTo({
url:'/pages/rwa_add/rwa_add?email='+params.email+"&name="+params.name,
})
},2000)
}
}
},
/**
* 获取手机验证码
*/
async getMobileCode(){
const form = this.form;
if(!form.name){
this.$refs.uToastRef.show({
type: 'error',
message: "请输入账号",
});
return;
}
this.countdown = true;
const params={
mobile:form.name,
type:SMS_TYPE.LOGIN,
}
const response = await getUserList(params);
console.log("responseresponseresponse",response);
if(response && response.bizcode === 100){
this.$refs.uToastRef.show({
type: 'success',
message: response.msg,
});
}else{
this.countdown = false;
}
},
}
}
</script>
<style lang="less">
.rwa_add_warp{
background: #F5F5F5;
.rwa_add_content{
padding: 20rpx;
height: calc(100vh - 198rpx);
}
.rwa_add_form{
background: #FFFFFF;
border-radius: 24rpx;
padding: 30rpx;
margin-bottom: 60rpx;
.rwa_add_item{
margin-bottom: 30rpx;
.rwa_add_item_title{
margin-bottom: 20rpx;
font-weight: bold;
font-size: 30rpx;
color: #333333;
}
}
}
}
</style>