index.vue 1.7 KB

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