index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="register-bg">
  3. <view class="bg-container">
  4. 参会报名
  5. </view>
  6. <auth-wrap class="register-container" ref="authWrap">
  7. <view class="form-content" slot="content">
  8. <RegistForm v-if="rules" :rules="rules" ref="registForm"></RegistForm>
  9. </view>
  10. </auth-wrap>
  11. </view>
  12. </template>
  13. <script>
  14. import { formCfg } from '@/common/api';
  15. import { ICON_CFG, USR_TYPE_LIST } from '@/common/EnumConst';
  16. import AuthWrap from '@/components/AuthComp/index.vue';
  17. import SingleDropList from '@/components/SingleDropList/index.vue';
  18. import RegistForm from '@/pasb/pages/regist/RegistForm.vue';
  19. const staticRules = {
  20. 'userInfo.email': {
  21. pattern: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
  22. },
  23. };
  24. export default {
  25. name: 'login',
  26. components: {
  27. RegistForm,
  28. AuthWrap,
  29. SingleDropList,
  30. },
  31. props: {},
  32. data() {
  33. return {
  34. ICON_CFG,
  35. USR_TYPE_LIST,
  36. showEnterprise: false,
  37. loading: false,
  38. model1: {
  39. userInfo: {
  40. usrName: '',
  41. conferenceFlag: '1',
  42. },
  43. },
  44. rules: null,
  45. };
  46. },
  47. created() {
  48. },
  49. async onLoad() {
  50. const { msg } = await formCfg('meet_form_cfg');
  51. if (msg) {
  52. const cfgJson = JSON.parse(msg);
  53. Object.keys(staticRules).forEach(item => {
  54. Object.assign(cfgJson[item], staticRules[item]);
  55. });
  56. this.rules = cfgJson;
  57. }
  58. //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
  59. this.$refs.authWrap.reloadPage();
  60. this.$refs.registForm?.setFormRules();
  61. },
  62. onReady() {
  63. },
  64. methods: {
  65. hideKeyboard() {
  66. uni.hideKeyboard();
  67. },
  68. },
  69. };
  70. </script>
  71. <style lang="scss" src="./index.scss" />;