xhj 2 роки тому
батько
коміт
6ff032e8d1
1 змінених файлів з 29 додано та 15 видалено
  1. 29 15
      match/activityEdit/activityEdit.vue

+ 29 - 15
match/activityEdit/activityEdit.vue

@@ -61,10 +61,13 @@
 				<view class="form-title">报名设置</view>
 				<view class="form-item-title">最大报名人数</view>
 				<view class="form-number-select ddflex">
-					<view>-</view>
+					<view @click="jian">-</view>
 					<input v-model="personLimit" type="number" placeholder="最大报名人数"
 						placeholder-class="form-input-placeholder" />
-					<view>+</view>
+					<view @click="jia">+</view>
+				</view>
+				<view class="form-item-title" style="color: red;font-size: 24rpx;margin-top: 20rpx;" v-if="checkNum==0">
+					*-1为不限制报名人数
 				</view>
 				<view class="form-item-title">报名时间</view>
 				<view class="ddflex" style="margin-top: 20rpx;">
@@ -298,10 +301,12 @@
 					this.enlistEndTime = this.formatTime(res.enlistEndTime)
 					this.startTime = this.formatTime(res.startTime)
 					this.endTime = this.formatTime(res.endTime)
-					this.house = res.house
-					this.regionCode = [res.province, res.city, res.country]
-					this.region = res.areaAdd.split(',')
-					this.address = res.address
+					this.house = res.house?res.house:''
+					if(res.province&&res.city&&res.country){
+						this.regionCode = [res.province, res.city, res.country]
+					}
+					this.region = res.areaAdd?res.areaAdd.split(','):[]
+					this.address = res.address?res.address:''
 					this.longitude = res.lng ? res.lng : null
 					this.latitude = res.lat ? res.lat : null
 					if(res.areaCodeList.length>0){
@@ -517,15 +522,15 @@
 				if (!this.endTime) {
 					return req.msg('请选择活动结束时间')
 				}
-				if (!this.house) {
-					return req.msg('请填写活动地址')
-				}
-				if (this.regionCode.length == 0) {
-					return req.msg('请选择活动所在城市')
-				}
-				if (!this.address) {
-					return req.msg('请填写详细地址')
-				}
+				// if (!this.house) {
+				// 	return req.msg('请填写活动地址')
+				// }
+				// if (this.regionCode.length == 0) {
+				// 	return req.msg('请选择活动所在城市')
+				// }
+				// if (!this.address) {
+				// 	return req.msg('请填写详细地址')
+				// }
 				
 				let areaCodeList = []
 				if(!this.isAllSee){
@@ -628,6 +633,15 @@
 				date = new Date(date.replace(/-/g, '/'))
 				return util.formatTime(date).t3
 			},
+			
+			jian(){
+				if(this.personLimit>0) this.personLimit = this.personLimit-1
+				if(this.personLimit==0) this.personLimit = -1
+			},
+			jia(){
+				if(this.personLimit==-1) this.personLimit = 1
+				else this.personLimit = this.personLimit+1
+			}
 		},
 		mounted() {