fill_info.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. {extend name="public/base"/}
  2. {block name="css"}
  3. {/block}
  4. {block name="body"}
  5. <van-nav-bar
  6. class="nav-theme"
  7. :fixed="true"
  8. :placeholder="true"
  9. >
  10. <template #title>
  11. <span class="text-white">信息填写</span>
  12. </template>
  13. </van-nav-bar>
  14. <van-form @submit="onSubmit">
  15. <van-cell-group>
  16. <van-field
  17. v-model="form.name"
  18. required
  19. type="text"
  20. label="姓名"
  21. placeholder="请输入参会人姓名"
  22. :rules="[{ required: true, message: '请输入姓名' }]"
  23. ></van-field>
  24. <van-field
  25. v-model="form.mobile"
  26. required
  27. type="mobile"
  28. label="手机号"
  29. placeholder="请输入参会人手机号"
  30. :rules="[{ required: true, message: '请输入手机号' }]"
  31. ></van-field>
  32. </van-cell-group>
  33. <div style="margin: 16px;">
  34. <van-button round block type="primary" native-type="submit">
  35. 提交
  36. </van-button>
  37. </div>
  38. </van-form>
  39. {/block}
  40. {block name="script"}
  41. <script>
  42. function v_setup() {
  43. let base = {};
  44. base.form = Vue.reactive({
  45. name: '',
  46. mobile: '',
  47. });
  48. base.flag = false;
  49. //表单提交
  50. base.onSubmit = () => {
  51. if (base.flag) {
  52. return;
  53. }
  54. base.flag = true;
  55. postJson('/seat/fillInfoPost',base.form,function(data) {
  56. vant.showToast(data.msg);
  57. base.flag = false;
  58. }).then(() => {
  59. vant.showDialog({
  60. title: '提示',
  61. message: '报名成功',
  62. }).then(() => {
  63. location.href = "{:url('seat/showSeat')}";
  64. });
  65. });
  66. };
  67. return base;
  68. }
  69. </script>
  70. {/block}