3 /*margin-left: 135px;*/
11 /*.form-item-label-cn {*/
17 background-size: contain;
18 -webkit-clip-path: polygon(0 0, 100% 0, 100% 75%, 0% 100%);
19 clip-path: polygon(0 0, 100% 0, 100% 75%, 0% 100%);
25 margin:15px 20px 25px;
29 color: rgba(255,255,255,0.5);
50 .topbar .topbar-middle {
55 /*position: relative;*/
63 background: rgba(247,247,247,1);
66 border-bottom: 1px solid #E0E0E0;
67 /*padding-left: 20px;*/
71 color: rgba(255,255,255, 0.4);
78 color: rgba(255,255,255, 1);
95 vertical-align: middle;
98 border: 1px dashed #E0E0E0;
111 <div class="warp bg-gray">
112 <Header :title="$t('welcome.register')"></Header>
114 <div class="form panel">
115 <div class="form-item">
116 <label :class="formItemLabel">{{ $t('createAccount.accountAlias') }}</label>
117 <div :class="formItemContent">
118 <input type="text" v-model="formItem.accAlias" autofocus>
121 <div class="form-item">
122 <label :class="formItemLabel">{{ $t('createAccount.keyPassword') }}</label>
123 <div :class="formItemContent">
124 <input type="password" v-model="formItem.passwd1">
127 <div class="form-item">
128 <label :class="formItemLabel">{{ $t('createAccount.confirmPassword') }}</label>
129 <div :class="formItemContent">
130 <input type="password" v-model="formItem.passwd2">
133 <div class="form-checkbox">
134 <input type="checkbox" id="checkbox1" v-model="formItem.checked">
135 <label for="checkbox1">
136 {{ $t('welcome.term1') }}<a class="color-green" @click="$router.push({ name: 'welcome-protocol' })">{{ $t('welcome.term2')}}</a>
140 <div class="btn-group">
141 <div class="btn btn-primary" @click="create">{{ $t('createAccount.create') }}</div>
148 import account from "../../models/account";
149 import { getLanguage } from '@/assets/language'
150 import getLang from "../../assets/language/sdk";
151 import { mapActions, mapGetters, mapState } from 'vuex'
152 import * as Actions from '@/store/constants';
172 activeTab: 'register'
176 formItemLabel: function () {
177 if (this.i18n == "cn") {
178 return "form-item-label form-item-label-cn";
179 } else if (this.i18n == "en") {
180 return "form-item-label";
182 return "form-item-label form-item-label-cn";
184 formItemContent: function () {
185 if (this.i18n == "cn") {
186 return "form-item-content content-cn";
187 } else if (this.i18n == "en") {
188 return "form-item-content content";
190 return "form-item-label form-item-label-cn";
208 create: function () {
209 if (this.formItem.accAlias == "") {
211 body: this.$t("createAccount.inputAlias")
215 if (this.formItem.passwd1 == "") {
217 body: this.$t("createAccount.inputPass")
221 if (this.formItem.passwd1 != this.formItem.passwd2) {
223 body: this.$t('createAccount.passwordAgain'),
227 if (!this.formItem.checked) {
229 body: this.$t('createAccount.agreeService'),
233 let loader = this.$loading.show({
236 onCancel: this.onCancel
238 account.create(this.formItem.accAlias, null, this.formItem.passwd1).then(currentAccount => {
239 this[Actions.CREATE_NEW_BYTOM](this.selected.value).then(() =>{
242 this.$router.push('/');
251 tirggerFile: function (event) {
252 var reader = new FileReader();
253 reader.onload = e => {
254 this.restore.fileTxt = e.target.result;
257 var file = event.target.files[0];
258 reader.readAsText(file);
260 recovery: function () {
261 if (!this.restore.checked) {
263 body: this.$t('createAccount.agreeService'),
267 account.restore(this.restore.fileTxt).then(res => {
268 this[Actions.IMPORT_BYTOM]().then(() =>{
269 this.$router.push('/');
273 body: getLang(error.message, this.language)
278 Actions.CREATE_NEW_BYTOM,
279 Actions.IMPORT_BYTOM,
283 selected: function (value) {
284 account.setupNet(`${value.value}`);
288 mainNet = { label: this.$t('main.mainNet'), value: "mainnet" };
289 this.nets = [mainNet];
290 if (this.net != undefined) {
291 if (this.net == "mainnet") {
292 this.selected = mainNet;
295 this.selected = mainNet;
297 account.setupNet(`${this.selected.value}`);
298 this.i18n = getLanguage(this.language);