/
2step_pre_regist.vue
69 lines (66 loc) · 2 KB
/
2step_pre_regist.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
<div>
<div v-if="!presignupDone">
<form @submit.prevent="signup">
<p v-if="error" :style="{ color: 'red' }">
{{ error }}
</p>
<div>
<label>name</label>
<input v-model="user.name" name="name" type="text" placeholder="name">
</div>
<div>
<label>tel</label>
<input v-model="user.tel" name="tel" type="text" placeholder="tel">
</div>
<div>
<label>email</label>
<input v-model="email" name="email" type="email" placeholder="email">
</div>
<div>
<label>login_pwd</label>
<input v-model="user.login_pwd" name="login_pwd" type="password" placeholder="login_pwd">
</div>
<div>
<button type="submit">
Sign up
</button>
</div>
</form>
</div>
<div v-else-if="presignupDone">
Pre-registration is complete. Please check your email.
</div>
</div>
</template>
<script>
export default {
data() {
return {
presignupDone: false,
email: null,
user: {},
error: null
}
},
methods: {
async signup() {
try {
const payload = {
email: this.email,
ext_info: {
...this.user
},
}
// post data
// New Member Registration Request
await this.$axios.$post('/rcms-api/1/2step_member_invite', payload)
this.presignupDone = true
} catch (e) {
console.error(e)
this.error = 'An error has occurred.'
}
},
},
}
</script>