yuanyiming před 1 rokem
rodič
revize
7ba7d9762f

+ 4 - 9
App.vue

@@ -6,22 +6,17 @@
 			// 微信登录
 			wx.login({
 				success({code}) {
-					// console.log('code:'+code);
-					// this.$request('/weChatCode','GET',{data:code})
 					uni.request({
-						url:'http://10.3.13.84:7003/api/pbl/weChatCode',
+						url:'http://localhost:7003/api/pbl/weChatCode',
 						method:'GET',
-						data:{code}
+						data:{codes:code}
 					}).then(res=>{
-						console.log(res.data);
-						uni.setStorageSync('SESSION',res.data)
+						// console.log(res);
+						uni.setStorageSync('oId',res.data)
 					})
 				}
 			})
  
-			uni.setStorageSync('login', '0');
-			// uni.setStorageSync('msgLogin', '0');
-
 
 			uni.getSystemInfo({
 				success: function(res) {

+ 16 - 14
api/request.js

@@ -7,27 +7,29 @@ const request = (url = '', method = 'GET', data = {}, header = {   //这里这
 	return new Promise((resolve, reject) => {
 		// console.log(header);
 		uni.request({
-			url: 'http://10.3.13.84:7003/api/pbl' + url, //接口地址:前缀+方法中传入的地址
+			url: 'http://localhost:7003/api/pbl' + url, //接口地址:前缀+方法中传入的地址
 			method: method, //请求方法
 			data: data, //传递参数
 			header: header, //自定义头部,和后端商同后编写
 			success: (res) => {
+				// console.log(res);
 				// console.log('request.js文件的通用接口请求封装返回的结果数据',res);
 				//注:因为这里对请求成功的没有统一设置抛错提示,所以后续具体组件中使用接口请求的res除200(实际以后端同事定好的为准)成功外的其他code需要额外写抛错提示
 				if (res.data.code == 405) { //自定请求失败的情况,这里以常见的token失效或过期为例
-					uni.removeStorageSync('token');
-					uni.showModal({
-						showCancel: false,
-						title: '温馨提示',
-						content: res.data.msg,
-						success: function(result) {
-							if (result.confirm) {
-								uni.reLaunch({
-									url: '/pages/login/login'    //这里需用绝对路径才可
-								});
-							}
-						}
-					});
+				console.log('token过期了');
+					// uni.removeStorageSync('token');
+					// uni.showModal({
+					// 	showCancel: false,
+					// 	title: '温馨提示',
+					// 	content: res.data.msg,
+					// 	success: function(result) {
+					// 		if (result.confirm) {
+					// 			uni.reLaunch({
+					// 				url: '/pages/login/login'    //这里需用绝对路径才可
+					// 			});
+					// 		}
+					// 	}
+					// });
 				}
 				resolve(res.data) //成功
 			},

+ 249 - 122
components/teaching-case/teaching-case.vue

@@ -1,64 +1,93 @@
 <template>
-	<view class="teaching_case" @click="gotoTeDetail">
-		<view class="img cell-img">
-			<!-- <slot name="img"></slot> -->
-			<image :src="classList.img" v-if="!item.btn" mode="aspectFill"></image>
-			<image :src="activeList.img" v-else mode="aspectFill"></image>
-		</view>
+	<view>
 
-		<view class="right">
-			<view class="">
-				<view class="title">
-					<view v-if="!item.btn" class="tag bqZ-font">类型</view>
-					<view v-else class="tag bqZ-font">类型</view>
 
-					<text class="btn-font" v-if="!item.btn" style="">{{
-            classList.className
-          }}</text>
-					<text class="three-font" v-else>{{ activeList.className }}</text>
-				</view>
+		<view class="teaching_case" v-for="(i,index) in classList" :key="i+'b'" @click="gotoTeDetail" :data-index="index">
+			<view class="img cell-img">
+				<image :src="i.img" v-if="!item.btn" mode="aspectFill"></image>
+			</view>
+
+			<view class="right">
+				<view class="">
+					<view class="title">
+						<view v-if="!item.btn" class="tag bqZ-font">类型</view>
+
+						<text class="btn-font" v-if="!item.btn" style="">{{i.className}}</text>
+					</view>
+
+					<view v-if="!item.btn" class="introduce fwb-font">
+						{{ i.intro }}
+					</view>
 
-				<view v-if="!item.btn" class="introduce fwb-font">
-					{{ classList.intro }}
-				</view>
-				<view v-else class="introduce fwb-font">
-					{{ activeList.intro }}
 				</view>
-			</view>
 
-			<view class="operate" v-if="!item.btn">
-				<view class="left">
-					<view class="opr" style="padding-right: 25rpx">
-						<view class="icon">
-							<image src="http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png"
-								style="width: 28rpx; height: 26rpx" mode="aspectFill"></image>
+				<view class="operate">
+					<view class="left">
+						<view class="opr" style="padding-right: 25rpx">
+							<view class="icon">
+								<image src="http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png"
+									style="width: 28rpx; height: 26rpx" mode="aspectFill"></image>
+							</view>
+							<text class="fz-font">收藏</text>
 						</view>
-						<text class="fz-font">收藏</text>
-					</view>
-					<view class="opr">
-						<view class="icon">
-							<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png"
-								style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
+						<view class="opr">
+							<view class="icon">
+								<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png"
+									style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
+							</view>
+							<text class="fz-font">订阅</text>
 						</view>
-						<text class="fz-font">订阅</text>
+					</view>
+					<view class="">
+						<button class="btn sBtn-font" disableEventPropagation="true" @click.stop="join">
+							立即参与
+						</button>
 					</view>
 				</view>
-				<view class="">
-					<button class="btn sBtn-font" disableEventPropagation="true" @click.stop="join">
-						立即参与
-					</button>
-				</view>
+
 			</view>
-			<view class="operate" v-else>
-				<view class="left">
-					<view class="price num-font"><text class="three-font">¥</text>{{ activeList.price }}</view>
-					<view class="pernum fz-font">已报名{{ activeList.count }}人</view>
-				</view>
+		</view>
+
+
+
+
+		<!-- 活动列表 -->
+		<view class="teaching_case" v-for="(i,index) in activeList" @click="gotoACdetail" :data-index="index"
+			:key="index+'a'">
+
+
+			<view class="img cell-img">
+				<image :src="i.pic" mode="aspectFill"></image>
+			</view>
+
+			<view class="right">
 				<view class="">
-					<button class="btn sBtn-font" @click.stop="actApply">立即报名</button>
+					<view class="title">
+						<view class="tag bqZ-font">类型</view>
+
+
+						<text class="three-font">{{ i.acName }}</text>
+					</view>
+
+
+					<view class="introduce fwb-font">
+						{{ i.brief }}
+					</view>
+				</view>
+
+				<view class="operate">
+					<view class="left">
+						<view class="price num-font"><text class="three-font">¥</text>{{ i.cost }}</view>
+						<view class="pernum fz-font">已报名{{ i.pers }}人</view>
+					</view>
+					<view class="">
+						<button class="btn sBtn-font" @click.stop="actApply">立即报名</button>
+					</view>
 				</view>
 			</view>
 		</view>
+
+
 		<!-- <view class="" style="height: 50rpx;width: 100%;background-color: #ffffff;"></view> -->
 	</view>
 </template>
@@ -76,13 +105,13 @@
 				},
 			},
 			classList: {
-				type: Object,
+				type: Array,
 				default () {
 					return [];
 				},
 			},
 			activeList: {
-				type: Object,
+				type: Array,
 				default () {
 					return [];
 				},
@@ -95,72 +124,174 @@
 			return {};
 		},
 		methods: {
-			gotoTeDetail() {
-				if (this.item.btn) {
-					const value = uni.getStorageSync("login");
-					if (value == 0) {
-						uni.navigateTo({
-							url: "/pages/login/login",
-						});
-					} else {
-						if(this.item.btn_2 === 1){
-							const urls = [
-								"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
-								"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
-								"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
-								"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
-							];
-							let index = this.indexId;
-							if (index >= 0 && index < urls.length) {
-								const url = urls[index];
-								uni.navigateTo({
-									url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
-								});
-							}
-						}else{
-							//常规教研活动
-							const urls = [
-								"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
-								"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
-								"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
-								"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
-							];
-							let index = this.indexId;
-							if (index >= 0 && index < urls.length) {
-								const url = urls[index];
-								uni.navigateTo({
-									url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
-								});
-							}
-						}
+			gotoTeDetail(e) {
+				console.log(e.currentTarget.dataset['index'], 123);
+				let edata = e.currentTarget.dataset['index']
+
+				const value = this.$store.state.user.openid;
+
+				const urls = [
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
+				];
+				console.log(value);
+				if (value == '') {
+					console.log(111);
+					uni.navigateTo({
+						url: "/pages/login/login",
+					});
+				} else {
+					switch (edata) {
+						case 0:
+							uni.navigateTo({
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[0]),
+							});
+							break;
+						case 1:
+							uni.navigateTo({
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[1]),
+							});
+							break;
+						case 2:
+							uni.navigateTo({
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[2]),
+							});
+							break;
+						case 3:
+							uni.navigateTo({
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
+							});
+							break;
+						default:
+							uni.navigateTo({
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
+							});
+							break;
 					}
+				}
+
+			},
+			gotoACdetail(e) {
+				console.log(e.currentTarget.dataset['index'], 123);
+				let edata = e.currentTarget.dataset['index']
+
+				const value = this.$store.state.user.openid;
+
+				const urls = [
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
+				];
+				console.log(value);
+				if (value == '') {
+					console.log(111);
+					uni.navigateTo({
+						url: "/pages/login/login",
+					});
 				} else {
-					const value = uni.getStorageSync("login");
-					if (value == 0) {
-						uni.navigateTo({
-							url: "/pages/login/login",
-						});
-					} else {
-						//推荐课程
-						const urls = [
-							"https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
-							"https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
-							"https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
-							"https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
-						];
-						let index = this.indexId;
-						if (index >= 0 && index < urls.length) {
-							const url = urls[index];
+					switch (edata) {
+						case 0:
 							uni.navigateTo({
-								url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[0]),
 							});
-						}
+							break;
+						case 1:
+							uni.navigateTo({
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[1]),
+							});
+							break;
+						case 2:
+							uni.navigateTo({
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[2]),
+							});
+							break;
+						case 3:
+							uni.navigateTo({
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
+							});
+							break;
+						default:
+							uni.navigateTo({
+								url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
+							});
+							break;
 					}
 				}
+
+
+
+
+
+
+
+
+				// if (this.item.btn) {
+				// 	if (value == '') {
+				// 		uni.navigateTo({
+				// 			url: "/pages/login/login",
+				// 		});
+				// 	} else {
+				// 		if (this.item.btn_2 === 1) {
+				// 			const urls = [
+				// 				"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
+				// 				"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
+				// 				"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
+				// 				"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
+				// 			];
+				// 			let index = this.indexId;
+				// 			if (index >= 0 && index < urls.length) {
+				// 				const url = urls[index];
+				// 				uni.navigateTo({
+				// 					url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
+				// 				});
+				// 			}
+				// 		} else {
+				// 			//常规教研活动
+				// 			const urls = [
+				// 				"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
+				// 				"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
+				// 				"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
+				// 				"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
+				// 			];
+				// 			let index = this.indexId;
+				// 			if (index >= 0 && index < urls.length) {
+				// 				const url = urls[index];
+				// 				uni.navigateTo({
+				// 					url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
+				// 				});
+				// 			}
+				// 		}
+				// 	}
+				// } else {
+				// 	const value = this.$store.state.user.openid;
+				// 	if (value == '') {
+				// 		uni.navigateTo({
+				// 			url: "/pages/login/login",
+				// 		});
+				// 	} else {
+				// 		//推荐课程
+				// 		const urls = [
+				// 			"https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
+				// 			"https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
+				// 			"https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
+				// 			"https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
+				// 		];
+				// 		let index = this.indexId;
+				// 		if (index >= 0 && index < urls.length) {
+				// 			const url = urls[index];
+				// 			uni.navigateTo({
+				// 				url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
+				// 			});
+				// 		}
+				// 	}
+				// }
 			},
 			join() {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				const value = this.$store.state.user.openid;
+				if (value == '') {
 					uni.navigateTo({
 						url: "/pages/login/login",
 					});
@@ -183,14 +314,14 @@
 				}
 			},
 			actApply() {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				const value = this.$store.state.user.openid;
+				if (value == '') {
 					uni.navigateTo({
 						url: "/pages/login/login",
 					});
 					return 1;
 				} else {
-					if(this.item.btn_2 === 1){
+					if (this.item.btn_2 === 1) {
 						const urls = [
 							"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
 							"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
@@ -204,7 +335,7 @@
 								url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
 							});
 						}
-					}else{
+					} else {
 						//常规教研活动
 						const urls = [
 							"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
@@ -227,6 +358,14 @@
 </script>
 
 <style lang="scss">
+	.AClist {
+		display: flex;
+		justify-content: space-between;
+		background-color: #ffffff;
+		padding: 20rpx 30rpx;
+	}
+
+
 	.teaching_case {
 		display: flex;
 		justify-content: space-between;
@@ -278,18 +417,6 @@
 					margin-right: 10rpx;
 					color: #00b2b6;
 					line-height: 32rpx;
-					// border: 1px #00b2b6 solid;
-					// font-size: 20rpx;
-					// width: 94rpx;
-					// display: flex;
-					// height: 36rpx;
-					// white-space: nowrap;
-					// justify-content: center;
-					// align-items: center;
-					// // padding: 4px 12px 4px 12px;
-					// border-radius: 5rpx;
-					// margin-right: 10rpx;
-					// color: #00b2b6;
 				}
 
 				text {

+ 6 - 0
main.js

@@ -5,9 +5,15 @@ import Vue from 'vue'
 import './uni.promisify.adaptor'
 Vue.config.productionTip = false
 
+
+
 import request from './api/request.js'
 Vue.prototype.$request=request
 
+import store from './store/index.js'
+Vue.prototype.$store = store
+
+
 App.mpType = 'app'
 const app = new Vue({
   ...App

+ 22 - 11
package-lock.json

@@ -1,17 +1,28 @@
 {
-  "name": "teaching-uniapp",
-  "lockfileVersion": 3,
   "requires": true,
-  "packages": {
-    "": {
-      "dependencies": {
-        "@dcloudio/uni-ui": "^1.4.28"
-      }
+  "lockfileVersion": 1,
+  "dependencies": {
+    "@dcloudio/uni-ui": {
+      "version": "1.4.28"
+    },
+    "deepmerge": {
+      "version": "4.3.1",
+      "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz",
+      "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
     },
-    "node_modules/@dcloudio/uni-ui": {
-      "version": "1.4.28",
-      "resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.4.28.tgz",
-      "integrity": "sha512-e/lSbvR79KH9+d3D4ueNbvD6szigjO/5IyjBNmiTqaj0PTS324fBV3L6f3s1qpkYonM4rdOl000hVOcAg6Gh/A=="
+    "shvl": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmmirror.com/shvl/-/shvl-2.0.3.tgz",
+      "integrity": "sha512-V7C6S9Hlol6SzOJPnQ7qzOVEWUQImt3BNmmzh40wObhla3XOYMe4gGiYzLrJd5TFa+cI2f9LKIRJTTKZSTbWgw=="
+    },
+    "vuex-persistedstate": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmmirror.com/vuex-persistedstate/-/vuex-persistedstate-4.1.0.tgz",
+      "integrity": "sha512-3SkEj4NqwM69ikJdFVw6gObeB0NHyspRYMYkR/EbhR0hbvAKyR5gksVhtAfY1UYuWUOCCA0QNGwv9pOwdj+XUQ==",
+      "requires": {
+        "deepmerge": "^4.2.2",
+        "shvl": "^2.0.3"
+      }
     }
   }
 }

+ 2 - 1
package.json

@@ -1,5 +1,6 @@
 {
   "dependencies": {
-    "@dcloudio/uni-ui": "^1.4.28"
+    "@dcloudio/uni-ui": "^1.4.28",
+    "vuex-persistedstate": "^4.1.0"
   }
 }

+ 9 - 8
pages.json

@@ -7,7 +7,7 @@
 		}
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-
+		
 		{
 			"path": "pages/index/index",
 			"style": {
@@ -15,6 +15,14 @@
 
 			}
 		},
+		{
+			"path": "pages/publish/publish",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+		
+		},
 		{
 			"path": "pages/login/login",
 			"style": {
@@ -123,13 +131,6 @@
 				"enablePullDownRefresh": false
 			}
 
-		}, {
-			"path": "pages/publish/publish",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false
-			}
-
 		}, {
 			"path": "pages/hdxx/hdxx",
 			"style": {

+ 51 - 47
pages/activityPage/activityPage.vue

@@ -49,18 +49,11 @@
 			</template>
 			<template #activeBlock>
 				<!-- <activity-case v-for="i in 10" :key="i"></activity-case> -->
-				<teaching-case v-for="(item, index) in activeList" :item="actData" :key="index" :activeList="item"
-					:indexId="index"></teaching-case>
+				<teaching-case :activeList="activeList"></teaching-case>
 			</template>
 		</viewX-Case>
 
-		<!-- 		<uni-fab ref="fab" 
-		:pattern="pattern" 
-		:horizontal="horizontal" 
-		:vertical="vertical"
-		:direction="direction"
-		buttonColor="#0056a8"
-		@fabClick="fabClick" /> -->
+		
 		<view class="" style="height: 30rpx; width: 100%"> </view>
 		<view class="qiu" @click="fabClick">
 			<image src="/static/yym/jia.png" mode="aspectFill"></image>
@@ -105,41 +98,52 @@
 						name: "杨广",
 					},
 				],
-				activeList: [{
-						img: "http://43.139.158.220:5007/img/static/img/img1.png",
-						count: "17",
-						price: "188",
-						className: "丽湖职教双创教育国际虚拟教研室2023年常规教研活动安排",
-						intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
-					},
-					{
-						img: "http://43.139.158.220:5007/img/static/img/img2.png",
-						count: "6",
-						price: "188",
-						className: "赛创融合、协同育人—高职院校双创大赛赛事组织| 丽湖职教双创教育国际虚拟教研室常规教研活动第3期顺利举",
-						intro: " 为全面落实双创教育“以赛促教、以赛促学、以赛促创”,提升学校双创大赛的组织效果和参赛成绩,促进更多教育成果落地,实现赛创融合育人的目标,丽湖职教双创教育国际虚拟教研室于4月26日组织举办了第3期线上教研活动,活动主题为“赛",
-					},
-					{
-						img: "http://43.139.158.220:5007/img/static/img/img3.png",
-						count: "1",
-						price: "188",
-						className: "产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行",
-						intro: "【图片】为提升职业院校双创课程建设水平,促进双创课程的改革与发展,丽湖职教双创教育国际虚拟教研室于3月29日组织举办了以“产教融合情境下的双创通识课程建设”为主题的第2期线上教研活动,来自全国各职业院校的60多位教师参会。本",
-					},
-					{
-						img: "http://43.139.158.220:5007/img/static/img/img4.png",
-						count: "0",
-						price: "188",
-						className: "打造双创“金课” | 丽湖职教双创教育国际虚拟教研室常规教研活动第1期顺利举行",
-						intro: "为推动高职院校双创课程建设,打造更多的双创精品课程和金课,丽湖职教双创教育国际虚拟教研室于2月22日组织举办了以“如何打造高职双创金课”为主题的第1期教研活动,来自全国各高职院校的80多位教师参会。本次活动由",
-					},
+				activeList: [
+					// {
+					// 	pic: "http://43.139.158.220:5007/img/static/img/img1.png",
+					// 	pers: "17",
+					// 	cost: "188",
+					// 	acName: "丽湖职教双创教育国际虚拟教研室2023年常规教研活动安排",
+					// 	brief: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
+					// },
+					// {
+					// 	pic: "http://43.139.158.220:5007/img/static/img/img2.png",
+					// 	pers: "6",
+					// 	cost: "188",
+					// 	acName: "赛创融合、协同育人—高职院校双创大赛赛事组织| 丽湖职教双创教育国际虚拟教研室常规教研活动第3期顺利举",
+					// 	brief: " 为全面落实双创教育“以赛促教、以赛促学、以赛促创”,提升学校双创大赛的组织效果和参赛成绩,促进更多教育成果落地,实现赛创融合育人的目标,丽湖职教双创教育国际虚拟教研室于4月26日组织举办了第3期线上教研活动,活动主题为“赛",
+					// },
+					// {
+					// 	pic: "http://43.139.158.220:5007/img/static/img/img3.png",
+					// 	pers: "1",
+					// 	cost: "188",
+					// 	acName: "产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行",
+					// 	brief: "【图片】为提升职业院校双创课程建设水平,促进双创课程的改革与发展,丽湖职教双创教育国际虚拟教研室于3月29日组织举办了以“产教融合情境下的双创通识课程建设”为主题的第2期线上教研活动,来自全国各职业院校的60多位教师参会。本",
+					// },
+					// {
+					// 	pic: "http://43.139.158.220:5007/img/static/img/img4.png",
+					// 	pers: "0",
+					// 	cost: "188",
+					// 	acName: "打造双创“金课” | 丽湖职教双创教育国际虚拟教研室常规教研活动第1期顺利举行",
+					// 	brief: "为推动高职院校双创课程建设,打造更多的双创精品课程和金课,丽湖职教双创教育国际虚拟教研室于2月22日组织举办了以“如何打造高职双创金课”为主题的第1期教研活动,来自全国各高职院校的80多位教师参会。本次活动由",
+					// },
 				],
 			};
 		},
 		methods: {
+			getData(){
+				let data={
+					openid:uni.getStorageSync('oId')
+				}
+					this.$request('/selectActivity',"POST",data).then(res=>{
+						console.log(res[0]);
+						// this.activeList=[...this.activeList,...res[0]]
+						this.activeList=res[0]
+					})
+			},
 			lookMore() {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				const value = this.$store.state.user.openid;
+				if (value == '') {
 					uni.navigateTo({
 						url: "/pages/login/login",
 					});
@@ -150,8 +154,8 @@
 				}
 			},
 			fabClick() {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				const value = this.$store.state.user.openid;
+				if (value == '') {
 					uni.navigateTo({
 						url: "/pages/login/login",
 					});
@@ -162,8 +166,8 @@
 				}
 			},
 			gotoAnnoun(index) {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				const value = this.$store.state.user.openid;
+				if (value == '') {
 					uni.navigateTo({
 						url: "/pages/login/login",
 					});
@@ -182,11 +186,11 @@
 					}
 				}
 			},
-			onChange: function(e) {
-				this.old.x = e.detail.x;
-				this.old.y = e.detail.y;
-			},
+			
 		},
+		onShow() {
+			this.getData()
+		}
 	};
 </script>
 

+ 12 - 11
pages/index/index.vue

@@ -42,7 +42,7 @@
 				<view class="lookMore fz-font" @click="teachmore">查看更多</view>
 			</template>
 			<template #teaching>
-				<teaching-case v-for="(item, index) in classList" :key="index" :classList="item" :indexId="index"></teaching-case>
+				<teaching-case :classList="classList"></teaching-case>
 			</template>
 		</viewX-Case>
 		<view class="" style="height: 30rpx; width: 100%"> </view>
@@ -107,8 +107,8 @@
 		onLoad() {},
 		methods: {
 			teachmore() {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				const value = this.$store.state.user.openid;
+				if (value == '') {
 					uni.navigateTo({
 						url: "/pages/login/login",
 					});
@@ -119,8 +119,8 @@
 				}
 			},
 			gotoTeDetail() {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				const value = this.$store.state.user.openid;
+				if (value == '') {
 					uni.navigateTo({
 						url: "/pages/login/login",
 					});
@@ -131,8 +131,8 @@
 				}
 			},
 			gotoActivity() {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				const value = this.$store.state.user.openid;
+				if (value == '') {
 					uni.navigateTo({
 						url: "/pages/login/login",
 					});
@@ -143,8 +143,8 @@
 				}
 			},
 			gotoActivityDetail(index) {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				const value = this.$store.state.user.openid;
+				if (value == '') {
 					uni.navigateTo({
 						url: "/pages/login/login",
 					});
@@ -164,8 +164,9 @@
 				}
 			},
 			gotoHd(index) {
-				const value = uni.getStorageSync("login");
-				if (value == 0) {
+				// console.log(this.$store.state.user.openid,33333333333333333);
+				const value = this.$store.state.user.openid;
+				if (value=='') {
 					console.log(11);
 					uni.navigateTo({
 						url: "/pages/login/login",

+ 72 - 21
pages/login/login.vue

@@ -17,15 +17,16 @@
 				</view>
 			</view>
 		</view>
-
+<!-- 
 		<button class="btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
 			<image class="avatar" :src="avatarUrl"></image>
-		</button>
+		</button> -->
 		<button class="btn" @click="gotoIndex">一键登录</button>
 		<!-- <button class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">一键登录</button> -->
 		<view class="footer" @click="goto">
 			<text>手机号登录/账号密码登录</text>
 		</view>
+		<!-- <button @click="kk">111</button> -->
 	</view>
 </template>
 
@@ -51,20 +52,47 @@
 				} = e.detail
 				this.avatarUrl = avatarUrl
 
-				//对临时图片链接进行base64编码
-				var avatarUrl_base64 = 'data:image/jpeg;base64,' + wx.getFileSystemManager().readFileSync(this.avatarUrl,
-					'base64')
-				console.log(avatarUrl_base64);
+				// //对临时图片链接进行base64编码
+				// var avatarUrl_base64 = 'data:image/jpeg;base64,' + wx.getFileSystemManager().readFileSync(this.avatarUrl,
+				// 	'base64')
+				// console.log(avatarUrl_base64);
+				let openid=uni.getStorageSync('oId')
+				const uploadTask = uni.uploadFile({
+					url: 'http://localhost:3001/img', // post请求地址
+					filePath: avatarUrl,
+					name: 'file', // 待确认
+					header: {
+						// 不要写这个不然报错
+						// 'Content-Type': 'multipart/form-data',
+					},
+					formData: {
+						// 携带的用户数据
+						userId: openid, // 用户ID
+					},
+					success: function(res) {
+						return res
+						let url = JSON.parse(res.data)
+						console.log(url.data);
+
+						url.data = url.data.replace(/\\/g, '/')
+
+						that.$store.commit('updateAvatar', url.data)
+						uni.showToast({
+							title: '修改成功',
+							duration: 2000
+						});
+					},
+					fail: function(uploadFileFail) {
+						console.log('Error:', uploadFileFail.data);
+					},
+					complete: () => {
+						// 接口调用结束的回调函数(调用成功、失败都会执行)
+						// console.log('Complete:');
+					}
+				});
+
 
 
-				uni.request({
-					url: 'http://localhost:3001/login2',
-					method: 'POST',
-					data: avatarUrl_base64,
-					success(res) {
-						console.log(res);
-					}
-				})
 			},
 			getPhoneNumber(e) {
 				console.log(e.detail.code) // 动态令牌
@@ -72,14 +100,36 @@
 				console.log(e.detail.errno) // 错误码(失败时返回)
 			},
 			gotoIndex() {
-				const value = uni.setStorageSync('login', '1');
-
-				// this.$request('/a','GET',{u:1}).then(res=>{
-				// 	console.log(res);
-				// })
-				this.$request('/insertActive','POST',{insertActive:1}).then(res=>{
-					console.log(res);
+				
+				let oId=uni.getStorageSync('oId')
+				let all=[]
+				// 检查是否注册过
+				this.$request('/selectUser', 'POST', {
+					oId:oId,
+				}).then(res => {
+					console.log(res[0]);
+					this.$store.dispatch('asyncUpdateUser',res[0][0])
+					if (!res[0]) {
+						this.$request('/login', 'POST', {
+							openid:9999,
+							Nme:'默认名称'
+						}).then(res => {
+							console.log(res);
+							uni.setStorageSync('token',res.token)
+						})
+					}
+				})
+				uni.switchTab({
+					url:'/pages/index/index'
 				})
+				
+			},
+			kk(){
+					this.$request('/a', 'POST', {
+						oId:2222,
+					}).then(res => {
+						console.log(res);
+					})
 			},
 			goto() {
 				uni.navigateTo({
@@ -96,6 +146,7 @@
 		onLoad(opt) {
 			console.log(opt);
 			this.isMsg = opt.id
+			console.log(this.$store.state);
 		}
 	}
 </script>

+ 3 - 3
pages/message/message.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="messBox">
     <statusBar :item="navbarData"></statusBar>
-    <view class="" v-if="msgLogin == 1">
+    <view class="" v-if="msgLogin !==''">
       <view class="mesItem" @click="goToMesDetail">
         <view class="leftBox">
           <view class="mesImg">
@@ -107,7 +107,7 @@ export default {
       isAll: 1,
       xt: 1,
       dy: 1,
-      msgLogin: 0,
+      msgLogin: '',
     };
   },
   methods: {
@@ -137,7 +137,7 @@ export default {
   },
   onShow() {
     // this.msgLogin = uni.getStorageSync('msgLogin');
-    this.msgLogin = uni.getStorageSync("login");
+    this.msgLogin = this.$store.state.user.openid;
   },
 };
 </script>

+ 7 - 6
pages/mine/mine.vue

@@ -4,12 +4,12 @@
 		<view class="mineBox">
 			<view class="userInformation" @click="gotoMineEdit">
 				<view class="userAvatar">
-					<image :src="isManage==1 ? userAvatar : 'http://43.139.158.220:5007/img/static/mine/Avatar_default.png'" mode="aspectFill"></image>
+					<image :src="isManage!=='' ? userAvatar : 'http://43.139.158.220:5007/img/static/mine/Avatar_default.png'" mode="aspectFill"></image>
 				</view>
 				<view class="userInfo">
 					<view class="infoTextone">
-						<text class="twoZ-font">{{ isManage==1 ? username : '未登录' }}</text>
-						<span v-if="isManage==1" class="manage bq-font">管理员</span>
+						<text class="twoZ-font">{{ isManage!=='' ? username : '未登录' }}</text>
+						<span v-if="isManage!==''" class="manage bq-font">管理员</span>
 					</view>
 					<view class="infoTexttwo">
 						<text style="font-size: 26rpx;font-weight: 400;line-height: 42rpx;color: #999999;">个性签名</text>
@@ -102,7 +102,7 @@ export default {
 			},
 			username: '刘雨潼',
 			userAvatar: 'http://43.139.158.220:5007/img/static/mine/Avatar.png',
-			isManage: 1
+			isManage: ''
 		};
 	},
 	methods: {
@@ -139,8 +139,9 @@ export default {
 		}
 	},
 	onShow() {
-		this.isManage=uni.getStorageSync('login')
-		
+		console.log(this.$store.state.user.openid);
+		this.isManage =this.$store.state.user.openid;
+		console.log(this.isManage=="");
 	}
 };
 </script>

+ 424 - 126
pages/publish/publish.vue

@@ -1,151 +1,389 @@
 <template>
 	<view class="publish">
 		<statusBar :item="navBarData"></statusBar>
-		
+
 		<view class="" style="background-color: #ffffff;">
-			
-		
-		<view class="pubTitle">
-			<input class="title" style="" placeholder="活动标题" />
-		</view>	
-		
-		<view class="pubMid">
-			<view class="mid">
-				<view class="txt">
-					<textarea class="txtClass" value="" placeholder="请输入内容" />
-				</view>
-				<view class="pic">
-					<view class="picCont">
-						<image src="../../static/publish/photo.png" mode="aspectFill"></image>
-						<view style="font-size: 24rpx;line-height: 40rpx;font-weight: 400;color: rgba(0, 0, 0, 0.6);">
-							添加图片
+
+
+			<view class="pubTitle">
+				<input class="title" style="" placeholder="活动标题" v-model="activitytitle" />
+			</view>
+
+			<view class="pubMid">
+				<view class="mid">
+					<view class="txt">
+						<textarea class="txtClass" value="" placeholder="请输入内容" v-model="activityintro" />
+					</view>
+					<!-- <uni-file-picker :v-model="imageValue" fileMediatype="image" file-extname="png,jpg,jpeg"
+						@select="select" @success="success" limit="1"> -->
+					<!-- 上传图片 -->
+
+					<view class="pic" @click="uploadPic">
+						<view class="picCont">
+							<image :src="pic" mode="aspectFill"></image>
+							<view
+								style="font-size: 24rpx;line-height: 40rpx;font-weight: 400;color: rgba(0, 0, 0, 0.6);">
+								添加图片
+							</view>
+							<view
+								style="font-size: 20rpx;line-height: 36rpx;font-weight: 400;color: rgba(0, 0, 0, 0.4);">
+								(0/1)
+							</view>
 						</view>
-						<view style="font-size: 20rpx;line-height: 36rpx;font-weight: 400;color: rgba(0, 0, 0, 0.4);">
-							(0/9)
+						<view class="pic_show" v-if="imageValue!==''">
+							<image :src="imageValue" mode="aspectFill"></image>
 						</view>
 					</view>
+					<!-- <view class="pic_show">
+						<image :src="imageValue" mode="aspectFill"></image>
+					</view> -->
+
+					<!-- </uni-file-picker> -->
+
+					<!-- <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept" :progress="progress"></beUpload> -->
+
+
 				</view>
 			</view>
-		</view>
-		
+
 			<view class="userOptionsBox">
 				<view class="optionsItemBox">
-					<view class="optionItem">
-						<view class="option_left">
-							<text class="option_text">
-								招募人数
-							</text>
-						</view>
-						<view class="option_right">
-							<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+					<picker mode="selector" :range="recruitmentList" @change="handelRecruitment">
+						<view class="optionItem">
+							<view class="option_left">
+								<text class="option_text">
+									招募人数
+								</text>
+							</view>
+
+							<view class="option_right">
+								<view class="input_details">
+									<view class="details">
+										<view class="uni-input text">{{recruitment}}</view>
+									</view>
+									<view class="arrow">
+										<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+									</view>
+								</view>
+							</view>
 						</view>
-					</view>
+					</picker>
 
 				</view>
 			</view>
 			<view class="userOptionsBox">
 				<view class="optionsItemBox">
-					<view class="optionItem">
-						<view class="option_left">
-							<text class="option_text">
-								活动形式
-							</text>
-						</view>
-						<view class="option_right">
-							<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+					<picker mode="selector" :range="activityformList" @change="handelActivityform">
+						<view class="optionItem">
+							<view class="option_left">
+								<text class="option_text">
+									活动形式
+								</text>
+							</view>
+
+							<view class="option_right">
+								<view class="input_details">
+									<view class="details">
+										<view class="uni-input text">{{activityform}}</view>
+									</view>
+									<view class="arrow">
+										<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+									</view>
+								</view>
+							</view>
 						</view>
-					</view>
-			
+					</picker>
 				</view>
 			</view>
 			<view class="userOptionsBox">
 				<view class="optionsItemBox">
-					<view class="optionItem">
-						<view class="option_left">
-							<text class="option_text">
-								活动地址
-							</text>
-						</view>
-						<view class="option_right">
-							<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+					<picker mode="selector" :range="addressList" @change="handeladdress">
+						<view class="optionItem">
+							<view class="option_left">
+								<text class="option_text">
+									活动地址
+								</text>
+							</view>
+
+							<view class="option_right">
+								<view class="input_details">
+									<view class="details">
+										<view class="uni-input text">{{address}}</view>
+									</view>
+									<view class="arrow">
+										<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+									</view>
+								</view>
+							</view>
 						</view>
-					</view>
-			
+					</picker>
+
 				</view>
 			</view>
 			<view class="userOptionsBox">
 				<view class="optionsItemBox">
-					<view class="optionItem">
-						<view class="option_left">
-							<text class="option_text">
-								活动时间
-							</text>
-						</view>
-						<view class="option_right">
-							<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+					<picker mode="date" :value="activityDate" :start="startDate" :end="endDate"
+						@change="activityDateChange">
+						<view class="optionItem">
+							<view class="option_left">
+								<text class="option_text">
+									活动时间
+								</text>
+							</view>
+
+							<view class="option_right">
+								<view class="input_details">
+									<view class="details">
+										<view class="uni-input text">{{ activityDate }}</view>
+									</view>
+									<view class="arrow">
+										<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+									</view>
+								</view>
+							</view>
 						</view>
-					</view>
-			
+					</picker>
+
 				</view>
 			</view>
 			<view class="userOptionsBox">
 				<view class="optionsItemBox">
-					<view class="optionItem">
-						<view class="option_left">
-							<text class="option_text">
-								活动费用
-							</text>
-						</view>
-						<view class="option_right">
-							<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+					<picker mode="selector" :range="fundsList" @change="handelFunds">
+						<view class="optionItem">
+							<view class="option_left">
+								<text class="option_text">
+									活动费用
+								</text>
+							</view>
+
+							<view class="option_right">
+								<view class="input_details">
+									<view class="details">
+										<view class="uni-input text">{{funds}}</view>
+									</view>
+									<view class="arrow">
+										<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+									</view>
+								</view>
+							</view>
 						</view>
-					</view>
-			
+					</picker>
+
 				</view>
 			</view>
 			<view class="userOptionsBox">
 				<view class="optionsItemBox">
-					<view class="optionItem">
-						<view class="option_left">
-							<text class="option_text">
-								报名截止
-							</text>
-						</view>
-						<view class="option_right">
-							<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+					<picker mode="date" :value="deadlineDate" :start="startDate" :end="endDate"
+						@change="deadlineDateChange">
+						<view class="optionItem">
+							<view class="option_left">
+								<text class="option_text">
+									报名截止
+								</text>
+							</view>
+
+							<view class="option_right">
+								<view class="input_details">
+									<view class="details">
+										<view class="uni-input text">{{ deadlineDate }}</view>
+									</view>
+									<view class="arrow">
+										<image src="../../static/mine/arrow-right.png" mode="aspectFill"></image>
+									</view>
+								</view>
+							</view>
 						</view>
-					</view>
-			
+					</picker>
 				</view>
 			</view>
-			
-			
+
+
 		</view>
+
+		<view class="" style="height: 10vh;width: 750rpx;position: relative;">
 			<view class="publish_now">
-				<button class="btn">立即发布</button>
-			</view>
-			<view class="liu">
-				
+				<button class="btn" @click="submitForm">立即发布</button>
 			</view>
+		</view>
+
 	</view>
 </template>
 
 <script>
 	export default {
 		data() {
+			const currentDate = this.getDate({
+				format: true
+			})
 			return {
-				navBarData:{
-					title:'发布', //导航栏标题
-					btn:1        //是否显示返回按钮 0不显示  1 显示
+				navBarData: {
+					title: '发布', //导航栏标题
+					btn: 1 //是否显示返回按钮 0不显示  1 显示
 				},
+				// 标题
+				activitytitle: '',
+				// 内容
+				activityintro: '',
+				// 图片
+				pic: '../../static/publish/photo.png',
+				imageValue: '',
+
+				// 人数
+				recruitmentList: Array.from({
+					length: 100
+				}, (_, index) => index + 1), //100人
+				recruitment: '无',
+				// 活动形式
+				activityformList: ['户外活动', 'xxxx', 'xxxx'],
+				activityform: '无',
+
+				// 活动地址
+				addressList: ['深圳xxxx大学', '深圳xxxx大学', '深圳xxxx大学'],
+				address: '无',
+				// 活动费用
+				fundsList: Array.from({
+					length: 30
+				}, (_, index) => (index + 1) * 100).map(item => item),
+				funds: '无',
+
+
+				activityDate: currentDate,
+				deadlineDate: currentDate,
+				activeList: []
 			};
-		}
+		},
+		computed: {
+			startDate() {
+				return this.getDate('start');
+			},
+			endDate() {
+				return this.getDate('end');
+			}
+		},
+		methods: {
+			uploadPic() {
+				uni.chooseImage({
+					count: 1, // 图片数量
+					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['album', 'camera'], //从相册选择或者拍照
+					success: (res) => {
+						const tempFilePaths = res.tempFilePaths[0];
+						console.log(this);
+						let that=this
+						const uploadTask = uni.uploadFile({
+							url: 'http://139.159.246.165:7006/img', // post请求地址
+							filePath: tempFilePaths,
+							name: 'file', // 待确认
+							header: {
+								// 不要写这个不然报错
+								// 'Content-Type': 'multipart/form-data',
+							},
+							success: function(res) {
+								// console.log(res.data);
+								that.imageValue = res.data
+								// let url = JSON.parse(res.data)
+								// console.log(url.data);
+							},
+							fail: function(uploadFileFail) {
+								console.log('Error:', uploadFileFail.data);
+							},
+							complete: () => {
+								// 接口调用结束的回调函数(调用成功、失败都会执行)
+								// console.log('Complete:');
+							}
+						});
+					}
+				});
+
+			},
+
+			submitForm() {
+				if (
+					this.activitytitle.trim() === '' ||
+					this.activityintro.trim() === '' ||
+					this.imageValue == '' ||
+					this.recruitment.value === '无' ||
+					this.activityform.trim() === '无' ||
+					this.address.trim() === '无' ||
+					this.funds === '无'
+				) {
+					// 弹出弹框或其他处理逻辑
+					uni.showToast({
+						title: '请填写完整的表单内容',
+						icon: 'none'
+					});
+					return;
+				}
+				// 将文本框内容和图片链接存储在一个对象中
+				const formData = {
+					id: this.$store.state.user.openid,
+					activitytitle: this.activitytitle,
+					activityintro: this.activityintro,
+					img: this.imageValue,
+					recruitment: this.recruitment,
+					activityform: this.activityform,
+					address: this.address,
+					funds: this.funds,
+					activityDate: this.activityDate,
+					deadlineDate: this.deadlineDate,
+					// price: "188",
+					// count: "6",
+				};
+				console.log(formData);
+
+
+				this.$request('/insertActive', 'POST', formData).then(res => {
+					console.log(res.data);
+					if(res.code==200){
+						uni.switchTab({
+							url:"/pages/activityPage/activityPage"
+						})
+					}
+					
+				})
+
+			},
+			handelRecruitment(e) {
+				this.recruitment = this.recruitmentList[e.detail.value]
+				console.log(this.imageValue);
+			},
+			handelActivityform(e) {
+				this.activityform = this.activityformList[e.detail.value]
+			},
+			handeladdress(e) {
+				this.address = this.addressList[e.detail.value]
+			},
+			handelFunds(e) {
+				this.funds = this.fundsList[e.detail.value]
+			},
+			activityDateChange: function(e) {
+				this.activityDate = e.detail.value
+			},
+			deadlineDateChange: function(e) {
+				this.deadlineDate = e.detail.value
+			},
+			getDate(type) {
+				const date = new Date();
+				let year = date.getFullYear();
+				let month = date.getMonth() + 1;
+				let day = date.getDate();
+
+				if (type === 'start') {
+					year = year - 60;
+				} else if (type === 'end') {
+					year = year + 2;
+				}
+				month = month > 9 ? month : '0' + month;
+				day = day > 9 ? day : '0' + day;
+				return `${year}-${month}-${day}`;
+			},
+		},
 	}
 </script>
 
 <style lang="scss" scoped>
-	.publish{
-		.liu{
+	.publish {
+		.liu {
 			//留白
 			width: 750rpx;
 			height: 68rpx;
@@ -153,29 +391,35 @@
 			bottom: 0;
 			background-color: #ffffff;
 		}
-		.pubTitle{
+
+		.pubTitle {
 			width: 750rpx;
 			height: 96rpx;
 			padding: 24rpx 30rpx 0 30rpx;
-			.title{
+
+			.title {
 				font-size: 32rpx;
 				line-height: 48rpx;
 				font-weight: 500;
 			}
 		}
-		.pubMid{
+
+		.pubMid {
 			width: 750rpx;
 			// height: 504rpx;
 			padding: 24rpx 30rpx 0 30rpx;
+
 			// background-color: #8BBEFF;
-			.mid{
+			.mid {
 				width: 690rpx;
 				height: 440rpx;
+
 				// background-color: #f2f2f2;
-				.txt{
+				.txt {
 					width: 690rpx;
 					height: 192rpx;
-					.txtClass{
+
+					.txtClass {
 						width: 100%;
 						height: 100%;
 						font-size: 28rpx;
@@ -183,20 +427,38 @@
 						line-height: 48rpx;
 					}
 				}
-				.pic{
+
+				.pic {
 					width: 224rpx;
 					height: 224rpx;
 					background-color: rgba(242, 242, 242, 1);
 					display: flex;
-					
+					position: relative;
 					justify-content: center;
 					align-items: center;
-					.picCont{
+
+					.pic_show {
+						position: absolute;
+						top: 0;
+						left: 0;
+						width: 100%;
+						height: 100%;
+						z-index: 10;
+						background-color: #8BBEFF;
+
+						image {
+							width: 100%;
+							height: 100%;
+						}
+					}
+
+					.picCont {
 						display: flex;
 						flex-direction: column;
 						justify-content: center;
 						align-items: center;
-						image{
+
+						image {
 							width: 56rpx;
 							height: 66rpx;
 						}
@@ -204,16 +466,17 @@
 				}
 			}
 		}
-		
-		
+
+
 		// background-color: #fff;
 		height: 100vh;
-		
-		
-		.textCont{
+
+
+		.textCont {
 			padding: 16px;
 		}
-		.addPhoto{
+
+		.addPhoto {
 			background-color: #f2f2f2;
 			width: 224rpx;
 			height: 224rpx;
@@ -223,36 +486,43 @@
 			align-items: center;
 			justify-content: center;
 			margin-left: 30rpx;
-			image{
+
+			image {
 				width: 50px;
 				height: 50px;
 				// margin-left: 48px;
 			}
-			.photo{
+
+			.photo {
 				color: #000000A3;
 				// padding-left: 44px;
 				// font-size: 14px;
 			}
-			.num{
-				color:  #919191;
+
+			.num {
+				color: #919191;
 				// padding-left: 56px;
 				// font-size: 14px;
 			}
-			
+
 		}
+
 		.userOptionsBox {
-			
+
 			width: 750rpx;
 			height: 96rpx;
 			display: flex;
 			justify-content: center;
 			align-items: center;
+
 			.optionsItemBox {
 				width: 690rpx;
+
 				.optionItem {
 					display: flex;
 					justify-content: space-between;
 					align-items: center;
+
 					.option_left {
 						display: flex;
 						align-items: center;
@@ -260,33 +530,61 @@
 						line-height: 48rpx;
 						font-weight: 400;
 					}
-		
+
 					.option_right {
 						height: 40rpx;
-		
-						image {
-							height: 32rpx;
-							width: 32rpx;
+
+						.input_details {
+							display: flex;
+							align-items: center;
+
+							.details {
+								display: flex;
+								flex-direction: row;
+
+								.text {
+									font-size: 28rpx;
+									color: rgb(153, 153, 153);
+								}
+							}
+
+							.arrow {
+								display: flex;
+
+								image {
+									width: 32rpx;
+									height: 32rpx;
+								}
+							}
 						}
+
 					}
 				}
 			}
 		}
-		.publish_now{
+
+		.publish_now {
 			position: absolute;
-			bottom: 100rpx;
+			// bottom: 100rpx;
 			display: flex;
 			width: 750rpx;
 			justify-content: center;
-			
-			.btn{
+			padding-bottom: 50rpx;
+
+			.btn {
 				width: 432rpx;
 				height: 88rpx;
-				background-color: #8BBEFF;
+				line-height: 88rpx;
+				// background-color: #8BBEFF;
+				background: rgba(0, 86, 168, 1);
+
 				color: #fff;
+				display: flex;
+				flex-direction: column;
+				align-items: center;
 				margin-top: 20px;
 			}
 		}
-		
+
 	}
-</style>
+</style>

+ 73 - 0
store/index.js

@@ -0,0 +1,73 @@
+// 页面路径:store/index.js
+
+import Vue from 'vue'
+import Vuex from 'vuex'
+import persistedstate from 'vuex-persistedstate'
+
+
+Vue.use(Vuex); //vue的插件机制
+
+//Vuex.Store 构造器选项
+
+const store = new Vuex.Store({
+
+	actions: {
+		//相当于异步的操作,不能直接改变state的值,只能通过触发mutations的方法才能改变
+		asyncUpdateUser(context, user) {
+			context.commit('updateUser',user);
+		}
+	},
+	mutations: {
+		//相当于同步的操作
+		updateUser(state, user) {
+			state.user = user;
+		},
+		// 修改头像
+		updateAvatar(state, data) {
+			state.user.avatar = data;
+		},
+		// 修改昵称nc
+		updateNc(state, data) {
+			state.user.nc = data;
+		},
+		// 添加聊天信息
+		addMsg(state, data) {
+			state.message.push(data)
+		}
+	},
+	state: {
+		//公共的变量,存储数据,这里的变量不能随便修改,只能通过触发mutations的方法才能改变
+		user: {
+			openid:'',
+			avatar: "",
+			desc: "",
+			email: "",
+			phone: "",
+			sex: "",
+			token: "",
+			username: "666",
+			__v: 0,
+			_id: "6523ac0dd4e4de99a9e86da2"
+		},
+		// 聊天记录
+		message:[]
+	},
+	getters: {
+		getUser(state) {
+			return state.user;
+		},
+		getMsg(state){
+			return state.message;
+		}
+	},
+	 plugins: [persistedstate({
+	 // 传入参数
+	 		storage: {
+	 			getItem: (key) => uni.getStorageSync(key),
+	 			setItem: (key, val) => uni.setStorageSync(key,val),
+	 			removeItem: (key) => uni.removeStorageSync(key)
+	 		}
+	 })]
+})
+
+export default store