|
@@ -14,112 +14,24 @@
|
|
|
<rich-text :content="content"></rich-text>
|
|
|
<u-popup :show="show" :round="5" mode="bottom" :closeOnClickOverlay="true" :overlay="true" @close="popClose">
|
|
|
<view class="pop-form-content">
|
|
|
- <u--form
|
|
|
- labelPosition="left"
|
|
|
- :model="model1"
|
|
|
+ <RegistForm
|
|
|
+ v-if="rules"
|
|
|
:rules="rules"
|
|
|
- ref="uForm"
|
|
|
- @submit="onSubmit"
|
|
|
+ ref="registForm"
|
|
|
+ @onSubmitHandle="onFormSubmit"
|
|
|
+ :regist-info="model1.userInfo"
|
|
|
>
|
|
|
- <u-form-item
|
|
|
- label="姓名"
|
|
|
- prop="userInfo.usrName"
|
|
|
- borderBottom
|
|
|
- >
|
|
|
- <u--input
|
|
|
- placeholder="输入姓名"
|
|
|
- v-model="model1.userInfo.usrName"
|
|
|
- border="none"
|
|
|
- ></u--input>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item
|
|
|
- label="单位名称"
|
|
|
- prop="userInfo.orgUnitName"
|
|
|
- borderBottom
|
|
|
- >
|
|
|
- <u--input
|
|
|
- placeholder="输入单位名称"
|
|
|
- v-model="model1.userInfo.orgUnitName"
|
|
|
- border="none"
|
|
|
- ></u--input>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item
|
|
|
- label="职务"
|
|
|
- prop="userInfo.uniLevel"
|
|
|
- borderBottom
|
|
|
- >
|
|
|
- <u--input
|
|
|
- placeholder="输入职务"
|
|
|
- v-model="model1.userInfo.uniLevel"
|
|
|
- border="none"
|
|
|
- ></u--input>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item
|
|
|
- label="联系电话"
|
|
|
- prop="userInfo.tel"
|
|
|
- borderBottom
|
|
|
- >
|
|
|
- <u--input
|
|
|
- placeholder="输入联系电话"
|
|
|
- border="none"
|
|
|
- type="number"
|
|
|
- maxlength="11"
|
|
|
- v-model="model1.userInfo.tel"
|
|
|
- ></u--input>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item
|
|
|
- label="邮箱"
|
|
|
- prop="userInfo.email"
|
|
|
- borderBottom
|
|
|
- >
|
|
|
- <u--input
|
|
|
- placeholder="输入邮箱"
|
|
|
- border="none"
|
|
|
- v-model="model1.userInfo.email"
|
|
|
- ></u--input>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item
|
|
|
- label="人员类型"
|
|
|
- prop="userInfo.usrType"
|
|
|
- borderBottom
|
|
|
- >
|
|
|
- <u-radio-group
|
|
|
- v-model="model1.userInfo.usrType"
|
|
|
- placement="row"
|
|
|
- >
|
|
|
- <u-radio
|
|
|
- :style="{
|
|
|
- marginRight: '20rpx'
|
|
|
- }"
|
|
|
- v-for="(item, index) in USR_TYPE_LIST"
|
|
|
- :key="index"
|
|
|
- :label="item.name"
|
|
|
- :name="item.value"
|
|
|
- >
|
|
|
- </u-radio>
|
|
|
- </u-radio-group>
|
|
|
- </u-form-item>
|
|
|
- </u--form>
|
|
|
- <view class="review-msg" v-if="REVIEW_STATUS.noPass.value === model1.userInfo.reviewState">
|
|
|
- 审核备注:{{ model1.userInfo.reviewMsg }}
|
|
|
- </view>
|
|
|
- <u-button
|
|
|
- :style="{
|
|
|
- marginTop: 'auto',
|
|
|
- marginBottom: '80rpx'
|
|
|
- }"
|
|
|
- type="primary"
|
|
|
- text="提交"
|
|
|
- :disabled="loading"
|
|
|
- :loading="loading"
|
|
|
- loadingText="正在提交..."
|
|
|
- @click="onSubmit"
|
|
|
- >
|
|
|
- </u-button>
|
|
|
+ <template v-slot:footer>
|
|
|
+ <view class="review-msg" v-if="REVIEW_STATUS.noPass.value === model1.userInfo.reviewState">
|
|
|
+ 审核信息:{{ model1.userInfo.reviewMsg }}
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </RegistForm>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
<view class="regist-btn">
|
|
|
<u-button
|
|
|
+ v-if="REVIEW_STATUS[model1.userInfo.reviewState]"
|
|
|
:text="REVIEW_STATUS[model1.userInfo.reviewState].name"
|
|
|
size="normal"
|
|
|
type="primary"
|
|
@@ -141,12 +53,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { fetchUsrThemeMeetingInfo, putUsrRegist } from '@/common/api';
|
|
|
+import { fetchUsrThemeMeetingInfo, formCfg, putUsrRegist } from '@/common/api';
|
|
|
import { CONTENT_TYPE, MEETING_TYPE, REVIEW_STATUS, USR_TYPE_LIST } from '@/common/EnumConst';
|
|
|
+import RegistForm from '@/components/RegistForm/index.vue';
|
|
|
import RichText from '@/components/RichText/index.vue';
|
|
|
import SingleDropList from '@/components/SingleDropList/index.vue';
|
|
|
import { authLogin, getStorageObj, storageKey } from '@/util';
|
|
|
|
|
|
+const staticRules = {
|
|
|
+ 'userInfo.email': {
|
|
|
+ pattern: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
|
|
|
+ },
|
|
|
+};
|
|
|
export default {
|
|
|
name: 'content',
|
|
|
computed: {
|
|
@@ -157,6 +75,7 @@ export default {
|
|
|
components: {
|
|
|
SingleDropList,
|
|
|
RichText,
|
|
|
+ RegistForm,
|
|
|
},
|
|
|
props: {},
|
|
|
data() {
|
|
@@ -178,79 +97,39 @@ export default {
|
|
|
conferenceFlag: '1',
|
|
|
},
|
|
|
},
|
|
|
- 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'],
|
|
|
- },
|
|
|
- },
|
|
|
+ rules: null,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
},
|
|
|
- onLoad(res) {
|
|
|
+ async onLoad(res) {
|
|
|
// 登录返回之后的页面
|
|
|
this.queryParams = getStorageObj(storageKey.regtheme);
|
|
|
this.getUsrContent();
|
|
|
+
|
|
|
+ const { msg } = await formCfg('theme_form_cfg');
|
|
|
+ if (msg) {
|
|
|
+ const cfgJson = JSON.parse(msg);
|
|
|
+ Object.keys(staticRules).forEach(item => {
|
|
|
+ if (!cfgJson[item]) {
|
|
|
+ Object.assign(cfgJson[item], staticRules[item]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.rules = cfgJson;
|
|
|
+ }
|
|
|
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
|
|
- this.$refs.uForm.setRules(this.rules);
|
|
|
+ this.$refs.registForm?.setFormRules();
|
|
|
},
|
|
|
methods: {
|
|
|
- onSubmit() {
|
|
|
- this.loading = true;
|
|
|
- this.$refs.uForm.validate().then(async (res) => {
|
|
|
- const { code } = await putUsrRegist({
|
|
|
- ...this.model1.userInfo,
|
|
|
- contentId: this.id,
|
|
|
- }, this.queryParams.type);
|
|
|
- this.loading = false;
|
|
|
- if (code !== 200) {
|
|
|
- return;
|
|
|
- }
|
|
|
- uni.showToast({
|
|
|
- mask: true,
|
|
|
- title: '报名完成',
|
|
|
- icon: 'success',
|
|
|
- success: async () => {
|
|
|
- this.show = false;
|
|
|
- },
|
|
|
- });
|
|
|
- }).catch(errors => {
|
|
|
- this.loading = false;
|
|
|
+ async onFormSubmit(usrInfo) {
|
|
|
+ await putUsrRegist({
|
|
|
+ ...usrInfo,
|
|
|
+ contentId: this.id,
|
|
|
+ }, this.queryParams.type);
|
|
|
+ uni.showToast({
|
|
|
+ mask: true,
|
|
|
+ title: '报名完成',
|
|
|
+ icon: 'success',
|
|
|
});
|
|
|
},
|
|
|
popClose() {
|
|
@@ -289,7 +168,7 @@ export default {
|
|
|
onRegistClick() {
|
|
|
authLogin(async (usr) => {
|
|
|
this.show = true;
|
|
|
- this.$refs.uForm.clearValidate();
|
|
|
+ this.$refs.registForm?.clearValidate();
|
|
|
});
|
|
|
},
|
|
|
toRegistClick() {
|