yuanyiming 1 년 전
부모
커밋
1a1b2cc1e6
3개의 변경된 파일41개의 추가작업 그리고 48개의 파일을 삭제
  1. 1 1
      App.vue
  2. 39 46
      pages/publish/publish.vue
  3. 1 1
      store/index.js

+ 1 - 1
App.vue

@@ -18,7 +18,7 @@
 					}).then(res=>{ 
 						console.log(res);
 						uni.setStorageSync('oId',res.data)
-						
+						// uni.getStorageSync('oId')
 					})
 				}
 			})

+ 39 - 46
pages/publish/publish.vue

@@ -60,7 +60,7 @@
 							<view class="option_right">
 								<view class="input_details">
 									<view class="details">
-										<view class="uni-input text">{{classifyList[index]}}</view>
+										<view class="uni-input text">{{classifyList[index]==null?'请选择':classifyList[index]}}</view>
 									</view>
 									<view class="arrow">
 										<image
@@ -213,7 +213,7 @@
 						<view class="optionItem">
 							<view class="option_left">
 								<text class="option_text">
-									活动费用
+									活动费用(元)
 								</text>
 							</view>
 
@@ -296,9 +296,9 @@
 						</image>
 						<text style="margin-bottom: 24px;">{{ poptext }}成功</text>
 					</view>
-					<view class="footer" style="padding-top: 0px;">
+					<!-- <view class="footer" style="padding-top: 0px;">
 						<button class="confirm-btn_2" @click="closePopup">确认</button>
-					</view>
+					</view> -->
 				</view>
 			</view>
 		</view>
@@ -341,7 +341,7 @@
 				// 分类
 				classifyList: ['直播活动', '常规教研活动', '专题教研活动','推荐课程'],
 				// index判断选择分类  0       1                   2         3   ,对应上面
-				index:1,
+				index:null,
 				classify: '请选择',
 
 				// 人数
@@ -366,9 +366,11 @@
 
 				// activityDate: currentDate,
 				activityDate: '请选择',
-				deadlineDate: currentDate,
+				deadlineDate: '请选择',
 				activeList: [],
-				formData: {}
+				formData: {},
+				
+			
 			};
 		},
 		computed: {
@@ -380,9 +382,6 @@
 			}
 		},
 		methods: {
-			clearData() {
-				this.$store.commit('removeData');
-			},
 			confirm(e) {
 				console.log(e);
 				console.log(e[0], e[e.length - 1]);
@@ -438,11 +437,11 @@
 				const conditions = [
 					// 添加提示信息
 					{
-						value: this.activitytitle.trim(),
+						value: this.activitytitle,
 						message: '请填写活动标题'
 					},
 					{
-						value: this.activityintro.trim(),
+						value: this.activityintro,
 						message: '请填写活动内容'
 					},
 					{
@@ -489,6 +488,9 @@
 				// 取消操作
 				this.showPopup = false;
 				this.showPopupConfirm = false;
+				uni.switchTab({
+					url:'/pages/activityPage/activityPage'
+				})
 			},
 			// 上传发布
 			conf() {
@@ -508,12 +510,13 @@
 					funds: this.funds
 				};
 				
-				
-
 				this.showPopup = false;
 				this.showPopupConfirm = true
 				// return console.log(formData);
 				console.log(this.btntext);
+				
+				
+				
 				if (this.btntext === '修改发布') {
 					// formData.acId = this.acId
 					// console.log(formData);
@@ -530,7 +533,7 @@
 							this.activitytitle = ''
 							this.activityintro = ''
 							this.imageValue = ''
-							this.classify = '请选择'
+							this.index = null
 							this.recruitment = '请选择'
 							this.activityform = '请选择'
 							this.address = '请选择'
@@ -538,9 +541,10 @@
 							this.activityDate = '请选择'
 							this.deadlineDate = '请选择'
 							setTimeout(() => {
-								this.clearData()
-								uni.navigateBack();
-							}, 500)
+								uni.switchTab({
+									url:'/pages/activityPage/activityPage'
+								})
+							}, 2000)
 						}
 					})
 				}
@@ -634,36 +638,24 @@
 			}
 
 			this.formData = this.$store.state.formData
-			console.log(this.formData);
-			this.activitytitle = this.formData.activitytitle
-			this.activityintro = this.formData.activityintro
-			this.imageValue = this.formData.imageValue
-			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
+			let data =uni.getStorageSync('formData')
+			console.log(data);
+			this.activitytitle = data.activitytitle
+			this.activityintro = data.activityintro
+			this.imageValue = data.imageValue
+			this.index = data.classify
+			this.recruitment = data.recruitment
+			this.activityform = data.activityform
+			this.address = data.address
+			this.funds = data.funds
+			this.activityDate = data.activityDate
+			this.deadlineDate = data.deadlineDate
 			
 			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 中
-			this.formData = {
+			let data = {
 				activitytitle: this.activitytitle,
 				activityintro: this.activityintro,
 				imageValue: this.imageValue,
@@ -675,9 +667,10 @@
 				activityDate: this.activityDate,
 				deadlineDate: this.deadlineDate
 			}
-			this.$store.commit('saveformData', this.formData);
-			console.log('Submitted formData:', this.formData);
-			console.log('Current state.formData:', this.$store.state.formData);
+			uni.setStorageSync('formData',data)
+			// this.$store.commit('saveformData', this.formData);
+			// console.log('Submitted formData:', this.formData);
+			// console.log('Current state.formData:', this.$store.state.formData);
 		},
 	}
 </script>

+ 1 - 1
store/index.js

@@ -58,7 +58,7 @@ const store = new Vuex.Store({
 			_id: ""
 		},
 		// 聊天记录
-		message: [],
+		// message: [],
 		formData: {}
 	},
 	getters: {