yuanyiming 1 yıl önce
ebeveyn
işleme
3b87c47ad7

+ 5 - 0
pages/activityList_2/activityList_2.vue

@@ -27,10 +27,12 @@
 					title: '专题教研活动',
 					btn: 1
 				},
+				
 				teaData: {
 					btn: 1,
 					btn_2: 1,
 				},
+				// 渲染数据
 				activeList: [],
 				// 触底加载动画提示
 				newsLoading: 1, //0默认值  1加载中 2没有更多了
@@ -38,6 +40,7 @@
 			};
 		},
 		methods: {
+			// 获取页面数据
 			getData() {
 				let data = {
 					openid: uni.getStorageSync('oId'),
@@ -68,7 +71,9 @@
 			setTimeout(this.getData,2000)
 			
 		},
+		
 		onLoad() {
+			// 一进页面就加载数据
 			this.getData()
 		}
 	}

+ 35 - 33
pages/publish/publish.vue

@@ -49,7 +49,7 @@
 
 			<view class="userOptionsBox">
 				<view class="optionsItemBox">
-					<picker mode="selector" :range="classifyList" @change="handelclassify">
+					<picker mode="selector" :range="classifyList" :value="index" @change="handelclassify">
 						<view class="optionItem">
 							<view class="option_left">
 								<text class="option_text">
@@ -60,7 +60,7 @@
 							<view class="option_right">
 								<view class="input_details">
 									<view class="details">
-										<view class="uni-input text">{{classify}}</view>
+										<view class="uni-input text">{{classifyList[index]}}</view>
 									</view>
 									<view class="arrow">
 										<image
@@ -339,7 +339,9 @@
 				imageValue: '',
 
 				// 分类
-				classifyList: ['直播活动', '常规教研活动', '专题教研活动'],
+				classifyList: ['直播活动', '常规教研活动', '专题教研活动','推荐课程'],
+				// index判断选择分类  0       1                   2         3   ,对应上面
+				index:1,
 				classify: '请选择',
 
 				// 人数
@@ -387,6 +389,7 @@
 				this.activityDate = e[0] + '~' + e[e.length - 1]
 				this.show = false
 			},
+			
 			editPublish() {
 				const routes = getCurrentPages()
 				console.log(routes);
@@ -443,7 +446,7 @@
 						message: '请填写活动内容'
 					},
 					{
-						value: this.classify,
+						value: this.index,
 						message: '请填写活动分类'
 					},
 					{
@@ -487,16 +490,9 @@
 				this.showPopup = false;
 				this.showPopupConfirm = false;
 			},
+			// 上传发布
 			conf() {
-				// 确认操作
-				if (this.classify == "直播活动") {
-					this.classify = 0
-				} else if (this.classify == "常规教研活动") {
-					this.classify = 1
-				} else {
-					this.classify = 2
-				}
-				// 将文本框内容和图片链接存储在一个对象中
+				
 				this.formData = {
 					// id: this.$store.state.user.openid,
 					id: this.btntext === '修改发布' ? this.acId : this.$store.state.user.openid,
@@ -506,13 +502,13 @@
 					recruitment: this.recruitment,
 					activityform: this.activityform,
 					address: this.address,
-					classify: this.classify,
+					classify: this.index,
 					activityDate: this.activityDate,
 					deadlineDate: this.deadlineDate,
 					funds: this.funds
-					// price: "188",
-					// count: "6",
 				};
+				
+				
 
 				this.showPopup = false;
 				this.showPopupConfirm = true
@@ -551,8 +547,12 @@
 
 			},
 			handelclassify(e) {
-				this.classify = this.classifyList[e.detail.value]
-				console.log(this.classify);
+				// console.log(e);
+				
+				this.index=e.detail.value
+				console.log(this.index);
+				// this.classify = this.classifyList[e.detail.value]
+				// console.log(this.classify);
 			},
 			handelRecruitment(e) {
 				this.recruitment = this.recruitmentList[e.detail.value]
@@ -638,26 +638,28 @@
 			this.activitytitle = this.formData.activitytitle
 			this.activityintro = this.formData.activityintro
 			this.imageValue = this.formData.imageValue
-			this.classify = this.formData.classify
+			this.index = this.formData.classify
 			this.recruitment = this.formData.recruitment
 			this.activityform = this.formData.activityform
 			this.address = this.formData.address
 			this.funds = this.formData.funds
 			this.activityDate = this.formData.activityDate
 			this.deadlineDate = this.formData.deadlineDate
-			switch (this.classify) {
-				case 0:
-					this.classify = "直播活动";
-					break;
-				case 1:
-					this.classify = "常规教研活动";
-					break;
-				case 2:
-					this.classify = "专题教研活动";
-					break;
-				default:
-					this.classify = "请选择";
-			}
+			
+			console.log(this.index);
+			// switch (this.classify) {
+			// 	case 0:
+			// 		this.classify = "直播活动";
+			// 		break;
+			// 	case 1:
+			// 		this.classify = "常规教研活动";
+			// 		break;
+			// 	case 2:
+			// 		this.classify = "专题教研活动";
+			// 		break;
+			// 	default:
+			// 		this.classify = "请选择";
+			// }
 		},
 		beforeDestroy() {
 			// 在组件销毁之前保存表单数据到 Vuex 中
@@ -665,7 +667,7 @@
 				activitytitle: this.activitytitle,
 				activityintro: this.activityintro,
 				imageValue: this.imageValue,
-				classify: this.classify,
+				classify: this.index,
 				recruitment: this.recruitment,
 				activityform: this.activityform,
 				address: this.address,