Selaa lähdekoodia

修改指导老师和指导机构字段,通过对象的对应字段控制显隐

lyb 4 vuotta sitten
vanhempi
commit
991ec80dc7
2 muutettua tiedostoa jossa 24 lisäystä ja 10 poistoa
  1. 23 9
      pages/apply/apply.vue
  2. 1 1
      pages/index/home.vue

+ 23 - 9
pages/apply/apply.vue

@@ -36,17 +36,17 @@
 				</view>
 			</view>
             
-            <view style="margin-bottom: 64rpx;" v-if="guide === 1">
-            	<text style="color: #010101; font-size: 28rpx; font-weight: bold;"> 指导老师</text>
+            <view style="margin-bottom: 64rpx;" v-if="!!activeSetting && activeSetting.personShow === 1">
+            	<text style="color: #010101; font-size: 28rpx; font-weight: bold;"><text style="color: #f00;">*</text> {{activeSetting.personText}}</text>
             	<view style="padding: 32rpx 0 0; border-bottom: 1rpx solid #E3E3E3;">
-            		<u-input placeholder="请输入指导老师" v-model="applyInfo.guideTeacher"></u-input>
+            		<u-input :placeholder="'请输入' + activeSetting.personText" v-model="applyInfo.guideTeacher"></u-input>
             	</view>
             </view>
             
-            <view style="margin-bottom: 64rpx;" v-if="guide === 1">
-            	<text style="color: #010101; font-size: 28rpx; font-weight: bold;"> 指导机构</text>
+            <view style="margin-bottom: 64rpx;" v-if="!!activeSetting && activeSetting.orgShow === 1">
+            	<text style="color: #010101; font-size: 28rpx; font-weight: bold;"><text style="color: #f00;">*</text> {{activeSetting.org}}</text>
             	<view style="padding: 32rpx 0 0; border-bottom: 1rpx solid #E3E3E3;">
-            		<u-input placeholder="请输入指导机构" v-model="applyInfo.guideSchool"></u-input>
+            		<u-input :placeholder="'请输入' + activeSetting.org" v-model="applyInfo.guideSchool"></u-input>
             	</view>
             </view>
 
@@ -109,10 +109,10 @@
 				activeType: '', //活动类型: VIDEO_TEXT视频图文 IMAGE_TEXT图片文本
 				updateProgress: '', //上传进度
 				tipsText: '',
-				guide: null, //是否需要指导老师和指导机构
+				activeSetting: '', //活动配置
 			};
 		},
-		onLoad(options) {
+		async onLoad(options) {
 			if (this.$isEmpty(this.vuex_userId) ||
 				this.$isEmpty(options.activeType) ||
 				this.$isEmpty(options.activeId)) {
@@ -121,6 +121,11 @@
 				})
 				return
 			}
+			let params = {
+				activeId: this.vuex_active_setting.defaultActiveId,
+				platformSettingEnum: 'ACTIVE_SETTING'
+			}
+			this.activeSetting = JSON.parse((await this.$api.platform.getPlatformValue(params)).data.data).guideRule[0];
 			this.initData(options)
 			
 		},
@@ -129,7 +134,6 @@
 			 * 初始化数据
 			 */
 			initData(options) {
-				this.guide = options.guide;
 				this.customStyle.background = this.vuex_theme.bgColor
 				this.activeType = options.activeType;
 				if(this.activeType === 'VIDEO_TEXT'){
@@ -322,6 +326,16 @@
 						return
 					}
 				}
+				if(!!this.activeSetting){
+					if (this.$isEmpty(this.applyInfo.guideTeacher)) {
+						this.$refs.toast.warn(`请输入${this.activeSetting.personText}`)
+						return
+					}
+					if (this.$isEmpty(this.applyInfo.guideSchool)) {
+						this.$refs.toast.warn(`请输入${this.activeSetting.org}`)
+						return
+					}
+				}
 				if (this.$isEmpty(this.applyInfo.title)) {
 					this.$refs.toast.warn('请输入标题内容')
 					return

+ 1 - 1
pages/index/home.vue

@@ -278,7 +278,7 @@
 				}
 				if (item.path == '/pages/apply/apply') {
 					//登录后才可以参赛
-					this.applyUrl = `${item.path}?activeId=${this.activeId}&activeType=${this.activeInfo.type}&guide=${this.activeInfo.guide}`
+					this.applyUrl = `${item.path}?activeId=${this.activeId}&activeType=${this.activeInfo.type}`
 					this.login()
 					return;
 				}