register-for-invite.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div class="register-for-invite">
  3. <div class="">注册</div>
  4. <form>
  5. <input v-model="form.phone" label="phone" name="phone" />
  6. <input v-model="form.code" label="code" name="code" maxlength="6" />
  7. <div class="">
  8. <button @click="register()">注册</button>
  9. <button @click="sendSmsCode()">发送验证码</button>
  10. </div>
  11. </form>
  12. </div>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'RegisterForInvite',
  17. data() {
  18. return {
  19. form: {
  20. phone: '17603013019',
  21. code: '',
  22. invitationUserName: null,
  23. activityId: null,
  24. },
  25. };
  26. },
  27. fetch() {
  28. this.form.invitationUserName = this.$route.query.invitationUserName;
  29. this.form.activityId = this.$route.query.activityId;
  30. },
  31. head: {
  32. title: '注册',
  33. },
  34. methods: {
  35. async register() {
  36. await this.$api.user.registerForInvite(this.form);
  37. },
  38. async sendSmsCode() {
  39. const res = await this.$api.message.sendSmsCode({
  40. type: 'common',
  41. authorizationType: 4,
  42. phone: this.form.phone,
  43. });
  44. this.$message({ content: res.msg });
  45. },
  46. },
  47. };
  48. </script>