Browse Source

* 增加报名信息

chen.cheng 10 months ago
parent
commit
633ddda3f5
5 changed files with 44 additions and 50 deletions
  1. 4 0
      common/api.js
  2. 15 0
      common/common.scss
  3. 2 2
      manifest.json
  4. 1 0
      pasb/pages/regist/index.scss
  5. 22 48
      pasb/pages/regist/index.vue

+ 4 - 0
common/api.js

@@ -125,3 +125,7 @@ export const fetchUsrTrip = () => {
     },
   });
 };
+export const formCfg = (key) => {
+  return http.get(
+    `/system/config/configKey/${key}`);
+};

+ 15 - 0
common/common.scss

@@ -96,3 +96,18 @@
     border-radius: 0 !important;
   }
 }
+
+.u-form{
+  .u-form-item{
+    &.require{
+      /deep/ .u-form-item__body__left{
+        &::before{
+          content:"*";
+          color: #ff0000;
+          margin-right: 10rpx;
+          display: inline-block;
+        }
+      }
+    }
+  }
+}

+ 2 - 2
manifest.json

@@ -96,11 +96,11 @@
     },
     "quickapp" : {},
     "mp-weixin" : {
-        "appid" : "wxf385eefdd03327fd",
+        "appid" : "wxf5aeb6ded4e4488b",
         "setting" : {
             "urlCheck" : false,
             "es6" : false,
-            "minified" : false,
+            "minified" : true,
             "postcss" : false
         },
         "optimization" : {

+ 1 - 0
pasb/pages/regist/index.scss

@@ -1,3 +1,4 @@
+@import "common/common.scss";
 .register-bg {
   width: 100%;
   height: 100%;

+ 22 - 48
pasb/pages/regist/index.vue

@@ -16,6 +16,7 @@
               label="姓名"
               prop="userInfo.usrName"
               borderBottom
+              class="require"
           >
             <u--input
                 placeholder="输入姓名"
@@ -27,6 +28,7 @@
               label="单位名称"
               prop="userInfo.orgUnitName"
               borderBottom
+              class="require"
           >
             <u--input
                 placeholder="输入单位名称"
@@ -38,6 +40,7 @@
               label="职务"
               prop="userInfo.uniLevel"
               borderBottom
+              class="require"
           >
             <u--input
                 placeholder="输入职务"
@@ -49,6 +52,7 @@
               label="联系电话"
               prop="userInfo.tel"
               borderBottom
+              class="require"
           >
             <u--input
                 placeholder="输入联系电话"
@@ -154,12 +158,17 @@
 
 <script>
 
-import { fetchContentInfo, fetchUsrInfo, putUsrRegist } from '@/common/api';
+import { fetchContentInfo, fetchUsrInfo, formCfg, putUsrRegist } from '@/common/api';
 import { CONTENT_TYPE, ICON_CFG, MEETING_TYPE, USR_TYPE_LIST } from '@/common/EnumConst';
 import AuthWrap from '@/components/AuthComp/index.vue';
 import SingleDropList from '@/components/SingleDropList/index.vue';
 import { getImageUrl, getUserInfo, setUserInfo } from '@/util';
 
+const staticRules = {
+  'userInfo.email': {
+    pattern: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
+  },
+};
 export default {
   name: 'login',
   components: {
@@ -181,59 +190,24 @@ export default {
       },
       conferenceHall: [],
       tripList: [],
-      rules: {
-        'userInfo.usrName': {
-          type: 'string',
-          required: true,
-          message: '请填写姓名',
-          trigger: ['blur', 'change'],
-        },
-        'userInfo.tel': {
-          type: 'string',
-          len: 11,
-          required: true,
-          message: '请填写11位手机号',
-          trigger: ['blur', 'change'],
-        },
-        'userInfo.email': {
-          type: 'string',
-          required: true,
-          message: '请填写邮箱',
-          pattern: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
-          trigger: ['blur', 'change'],
-        },
-        'userInfo.orgUnitName': {
-          type: 'string',
-          required: true,
-          message: '请填写单位名称',
-          trigger: ['blur', 'change'],
-        },
-        'userInfo.uniLevel': {
-          type: 'string',
-          required: true,
-          message: '请填写职务',
-          trigger: ['blur', 'change'],
-        },
-        'userInfo.usrType': {
-          type: 'string',
-          required: true,
-          message: '请填写人员类型',
-          trigger: ['blur', 'change'],
-        },
-        'userInfo.contentId': {
-          type: 'number',
-          required: true,
-          message: '请选择会场',
-          trigger: ['blur', 'change'],
-        },
-      },
+      rules: {},
     };
   },
   created() {
+
   },
   onLoad() {
+    formCfg('meet_form_cfg').then(res => {
+      if (res.data.cfgJson) {
+        const cfgJson = JSON.parse(res.data.cfgJson);
+        Object.keys(staticRules).forEach(item => {
+          Object.assign(cfgJson[item], staticRules[item]);
+        });
+        this.rules = cfgJson;
+        this.$refs.uForm.setRules(this.rules);
+      }
+    });
     //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
-    this.$refs.uForm.setRules(this.rules);
     this.$refs.authWrap.reloadPage();
     const user = getUserInfo();
     if (user) {