12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <template>
- <div class="register-for-invite">
- <div class="">注册</div>
- <form>
- <input v-model="form.phone" label="phone" name="phone" />
- <input v-model="form.code" label="code" name="code" maxlength="6" />
- <div class="">
- <button @click="register()">注册</button>
- <button @click="sendSmsCode()">发送验证码</button>
- </div>
- </form>
- </div>
- </template>
- <script>
- export default {
- name: 'RegisterForInvite',
- data() {
- return {
- form: {
- phone: '17603013019',
- code: '',
- invitationUserName: null,
- activityId: null,
- },
- };
- },
- fetch() {
- this.form.invitationUserName = this.$route.query.invitationUserName;
- this.form.activityId = this.$route.query.activityId;
- },
- head: {
- title: '注册',
- },
- methods: {
- async register() {
- await this.$api.user.registerForInvite(this.form);
- },
- async sendSmsCode() {
- const res = await this.$api.message.sendSmsCode({
- type: 'common',
- authorizationType: 4,
- phone: this.form.phone,
- });
- this.$message({ content: res.msg });
- },
- },
- };
- </script>
|