yuanyiming 1 year ago
parent
commit
a1376287f1

+ 1 - 0
App.vue

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

+ 22 - 9
components/teaching-case/teaching-case.vue

@@ -125,12 +125,21 @@
 		},
 		methods: {
 			gotoTeDetail(e) {
-				// console.log(e.currentTarget.dataset['index'], 123);
+				
+				
+				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/1210",//产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举
+					// "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209", //打造双创“金课” | 丽湖职教双创教
+					// "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",//赛创融合、协同育人—高职院校双创大赛赛事组织| 丽湖职教双创教育国际虚拟教研室常规研活动第2期
+					// "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
+					
+					
 					// "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
 					// "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
 					// "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
@@ -144,7 +153,7 @@
 				if (value == '') {
 					// console.log(111);
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					switch (edata) {
@@ -185,15 +194,19 @@
 				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",
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",//产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209", //打造双创“金课” | 丽湖职教双创教
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",//赛创融合、协同育人—高职院校双创大赛赛事组织| 丽湖职教双创教育国际虚拟教研室常规研活动第2期
+					"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",//丽湖职教双创教育国际虚拟教研室2023年常规教研
+					// "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",
 				];
 				if (value == '') {
 					console.log(111);
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					uni.navigateTo({
@@ -301,7 +314,7 @@
 				const value = this.$store.state.user.openid;
 				if (value == '') {
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 					return 1;
 				} else {
@@ -325,7 +338,7 @@
 				const value = this.$store.state.user.openid;
 				if (value == '') {
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 					return 1;
 				} else {

+ 9 - 0
pages.json

@@ -15,6 +15,15 @@
 
 			}
 		},
+		{
+		    "path" : "pages/login_Wechat/login_Wechat",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		},
 		{
 			"path": "pages/publish/publish",
 			"style": {

+ 7 - 7
pages/activityPage/activityPage.vue

@@ -106,7 +106,7 @@
 				const value = this.$store.state.user.openid;
 				if (value == '') {
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					uni.navigateTo({
@@ -123,7 +123,7 @@
 				const value = this.$store.state.user.openid;
 				if (value == '') {
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					uni.navigateTo({
@@ -135,14 +135,14 @@
 				const value = this.$store.state.user.openid;
 				if (value == '') {
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					const urls = [
-						"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
-						"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
-						"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
-						"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
+						"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",//丽湖职教双创教育国际虚拟教研室启动大会暨双创教育国际论坛圆满举行
+						"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",//丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期
+						"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",//产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行
+						"https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",//打造双创“金课” | 丽湖职教双创教育国际虚拟教研室常规
 					];
 					if (index >= 0 && index < urls.length) {
 						const url = urls[index];

+ 18 - 6
pages/index/index.vue

@@ -82,25 +82,37 @@
 					// 	className: "丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期",
 					// },
 				],
-				classList: [{
+				classList: [
+					
+					// "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",
+					
+					
+					{
 						img: "http://43.139.158.220:5007/img/static/img/jiaoxueship.jpg",
 						className: "教学视频",
 						intro: "课程简介:丽湖职教双创教育国际虚拟教研室教学视频",
+						url:'https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210'
 					},
 					{
 						img: "http://43.139.158.220:5007/img/static/img/jiaoxuedagang.jpg",
 						className: "教学大纲",
 						intro: "课程简介:丽湖职教双创教育国际虚拟教研室教学大纲",
+						url:'https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210'
 					},
 					{
 						img: "http://43.139.158.220:5007/img/static/img/peiyangfangan.jpg",
 						className: "培养方案",
 						intro: "课程简介:丽湖职教双创教育国际虚拟教研室培养方案",
+						url:'https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210'
 					},
 					{
 						img: "http://43.139.158.220:5007/img/static/img/xitishiti.jpg",
 						className: "习题试题",
 						intro: "课程简介:丽湖职教双创教育国际虚拟教研室习题试题",
+						url:'https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210'
 					},
 				],
 			};
@@ -121,7 +133,7 @@
 				const value = this.$store.state.user.openid;
 				if (value == '') {
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					uni.navigateTo({
@@ -133,7 +145,7 @@
 				const value = this.$store.state.user.openid;
 				if (value == '') {
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					uni.navigateTo({
@@ -145,7 +157,7 @@
 				const value = this.$store.state.user.openid;
 				if (value == '') {
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					uni.navigateTo({
@@ -157,7 +169,7 @@
 				const value = this.$store.state.user.openid;
 				if (value == '') {
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					const urls = [
@@ -180,7 +192,7 @@
 				if (value=='') {
 					console.log(11);
 					uni.navigateTo({
-						url: "/pages/login/login",
+						url: "/pages/login_Wechat/login_Wechat",
 					});
 				} else {
 					const urls = [

+ 5 - 5
pages/login/login.vue

@@ -17,16 +17,15 @@
 				</view>
 			</view>
 		</view>
-<!-- 
-		<button class="btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
-			<image class="avatar" :src="avatarUrl"></image>
+
+	<!-- 	<button class="btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
+			一键登录
 		</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>
 
@@ -46,6 +45,8 @@
 		},
 		methods: {
 			onChooseAvatar(e) {
+							
+				
 				console.log(e);
 				const {
 					avatarUrl
@@ -97,7 +98,6 @@
 				console.log(e.detail.errno) // 错误码(失败时返回)
 			},
 			gotoIndex() {
-				
 				let oId=uni.getStorageSync('oId')
 				console.log('gotoIndex:',oId);
 				let all=[]

+ 266 - 0
pages/login_Wechat/login_Wechat.vue

@@ -0,0 +1,266 @@
+<template>
+	<view class="login_Wechat">
+		<statusBar :item='navBarData'></statusBar>
+		<view class="block">
+			<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
+				<image class="avatar" :src="avatarUrl"></image>
+			</button>
+		</view>
+
+		<view class="inp">
+			<view class="nc">昵称:</view>
+			<input type="nickname" class="weui-input" :value="nickname" @blur="inpvalue" placeholder="请输入昵称" />
+		</view>
+
+		<view class="mid">
+			<!-- <radio value="r1" @click="radioCheck" size="10" :checked="isOK" /> -->
+			<view class="" style="position: relative;padding-left:30rpx;">
+				我已阅读并同意<text>《教育小程序服务条款》</text>和 <text>《 隐私协议》</text>新用户自动注册
+				<view class="quan" @click="isDui">
+					<image v-if="isShow" class="dui" src="http://43.139.158.220:5007/img/static/yym/dui.png"
+						mode="aspectFill"></image>
+				</view>
+			</view>
+		</view>
+
+
+
+		<button class="btn" @click="gotoIndex">一键登录</button>
+		<view class="footer" @click="goto">
+			<text>手机号登录/账号密码登录</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				avatarUrl: '',
+				nickname: '',
+				isShow: false,
+				navBarData: {
+					title: '登录页',
+					btn: 1 //判断是否显示返回按钮
+				},
+			};
+		},
+		methods: {
+			inpvalue(e) {
+				console.log(e.detail.value, '1111111');
+				this.nickname = e.detail.value
+			},
+			onChooseAvatar(e) {
+				const {
+					avatarUrl
+				} = e.detail
+				console.log(avatarUrl);
+
+				let that = this
+				const uploadTask = uni.uploadFile({
+					url: 'http://139.159.246.165:7006/img', // post请求地址
+					// url: 'https://cxcy.ssti.net.cn/api/UploadFirmFile', // post请求地址
+					// filePath: tempFilePaths,
+					filePath: avatarUrl,
+					name: 'file', // 待确认
+					header: {
+						// 不要写这个不然报错
+						// 'Content-Type': 'multipart/form-data',
+					},
+					success: function(res) {
+						console.log(res);
+						that.avatarUrl = res.data
+					},
+					fail: function(uploadFileFail) {
+						console.log('Error:', uploadFileFail.data);
+					},
+					complete: () => {
+						// 接口调用结束的回调函数(调用成功、失败都会执行)
+						// console.log('Complete:');
+					}
+				});
+
+
+				// this.avatarUrl = avatarUrl
+			},
+			gotoIndex() {
+				if (this.avatarUrl ==
+					'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
+				) {
+					uni.showToast({
+						title: '请选择头像',
+						icon: 'error',
+						duration: 1000
+					});
+					return
+				}
+				if (this.nickname == '') {
+					uni.showToast({
+						title: '请输入昵称',
+						icon: 'error',
+						duration: 1000
+					});
+					return
+				}
+				
+				
+				
+				
+				
+				
+				let oId = uni.getStorageSync('oId')
+				console.log('gotoIndex:', oId);
+				// let all = []
+				// 检查是否注册过
+				this.$request('/selectUser', 'POST', {
+					oId: oId,
+				}).then(res => {
+					console.log('selectUser', res[0]);
+
+					console.log(res[0] == false);
+					// 账号第一次登录,还没注册过
+					if (res[0] == false) {
+						console.log('还未注册过,开始注册');
+						this.$request('/login', 'POST', {
+							openid: oId,
+							Nme: this.nickname,
+							// avatar: 'http://43.139.158.220:5007/img/static/mine/Avatar_default.png'
+							avatar: this.avatarUrl
+						}).then(res => {
+							console.log('注册成功', res);
+							uni.setStorageSync('token', res.token)
+							// 注册过后重新登录
+							this.gotoIndex()
+						})
+					} else {
+						console.log('已注册过直接登录', res[0][0]);
+						// 修改昵称头像
+						this.$request('/updateUser',"POST",{
+							openid: oId,
+							Nme: this.nickname,
+							avatar: this.avatarUrl
+						}).then(res=>{
+							console.log('updateUser',res);
+							this.$request('/selectUser', 'POST', {
+								oId: oId,
+							}).then(res => {
+								this.$store.dispatch('asyncUpdateUser', res[0][0])
+							})
+						})
+					}
+				})
+				uni.switchTab({
+					url: '/pages/index/index'
+				})
+
+			},
+			goto() {
+				uni.navigateTo({
+					url: "/pages/login_two/login_two"
+				})
+			},
+			isDui() {
+				this.isShow = !this.isShow
+			}
+		},
+		onLoad() {
+			this.avatarUrl =
+				'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
+		}
+	}
+</script>
+
+<style lang="scss">
+	.login_Wechat {
+		width: 750rpx;
+		height: 100vh;
+		background-color: #ffffff;
+	}
+
+	.block {
+		width: 750rpx;
+		height: 30vh;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.footer {
+		display: flex;
+		justify-content: center;
+		font-size: 14px;
+		margin: auto;
+		color: #666666;
+	}
+
+	.avatar-wrapper {
+		width: 200rpx;
+		height: 200rpx;
+		padding: 0;
+
+		image {
+			width: 200rpx;
+			height: 200rpx;
+		}
+	}
+
+	.inp {
+		display: flex;
+		align-items: center;
+		padding: 0rpx 50rpx;
+		.nc {
+			// width: 150rpx;
+			text-align: left;
+		}
+
+		.weui-input {}
+	}
+
+	.mid {
+		display: flex;
+		justify-content: flex-start;
+		width: 750rpx;
+		padding: 0rpx 50rpx;
+		font-size: 13px;
+		margin-top: 80rpx;
+		
+		.quan {
+			position: absolute;
+			flex-shrink: 0;
+			top: 0;
+			left: -10rpx;
+			width: 32rpx;
+			height: 32rpx;
+			border-radius: 50%;
+			margin-top: 5rpx;
+			margin-right: 10rpx;
+			border: 1px #bdbdbd solid;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+
+			.dui {
+				width: 32rpx;
+				height: 32rpx;
+			}
+		}
+
+		text {
+			color: #4a97f2;
+		}
+	}
+
+	.btn {
+		background-color: #0056a8;
+		color: #ffffff;
+		border-radius: 30px;
+		margin: 30rpx 55rpx;
+		// padding: 10rpx 0;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		margin-top: 30rpx;
+		// padding: 0rpx 10rpx;
+		font-size: 16px;
+	}
+</style>

+ 1 - 1
pages/message/message.vue

@@ -131,7 +131,7 @@ export default {
     },
     gotoLogin() {
       uni.navigateTo({
-        url: "/pages/login/login?id=1",
+        url: "/pages/login_Wechat/login_Wechat",
       });
     },
   },

+ 8 - 6
pages/mine/mine.vue

@@ -5,13 +5,13 @@
 			<view class="userInformation" @click="gotoMineEdit">
 				<view class="userAvatar">
 					<image
-						:src="isManage!=='' ? userAvatar : 'http://43.139.158.220:5007/img/static/mine/Avatar_default.png'"
+						:src="userAvatar!=='' ? 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!=='' ? username : '未登录' }}</text>
-						<span v-if="isManage!==''" class="manage bq-font">管理员</span>
+						<text class="twoZ-font">{{ username!=='' ? 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>
@@ -120,7 +120,7 @@
 					title: '我的',
 					btn: 0
 				},
-				username: '刘雨潼',
+				username: '',
 				userAvatar: 'http://43.139.158.220:5007/img/static/mine/Avatar.png',
 				isManage: ''
 			};
@@ -176,7 +176,9 @@
 			}
 		},
 		onShow() {
-			console.log(this.$store.state.user.openid, 11111);
+			console.log(this.$store.state);
+			this.userAvatar=this.$store.state.user.avatar;
+			this.username=this.$store.state.user.username;
 			this.isManage = this.$store.state.user.openid;
 			console.log(this.isManage == "");
 		}
@@ -200,13 +202,13 @@
 			.userAvatar {
 				flex: 1;
 				// height: 80%;
-
 				display: flex;
 				align-items: center;
 
 				image {
 					width: 128rpx;
 					height: 128rpx;
+					border-radius: 50%;
 				}
 			}
 

+ 25 - 4
pages/mineEdit/mineEdit.vue

@@ -8,7 +8,7 @@
 					<text>头像</text>
 				</view>
 				<view class="userAvatar">
-					<image src="http://43.139.158.220:5007/img/static/mine/Rectangle 1547.png" mode="aspectFill"></image>
+					<image :src="userAvatar"></image>
 				</view>
 			</view>
 			<view class="setName">
@@ -18,7 +18,7 @@
 				<view class="input_details">
 					<view class="nickname">
 						<input type="text" style=" text-align: right;" maxlength="10" placeholder="请输入一个昵称"
-							placeholder-style="font-size: 28rpx; color: rgb(153, 153, 153);" v-model="nickname" />
+							placeholder-style="font-size: 28rpx; color: rgb(153, 153, 153);" v-model="username" />
 					</view>
 				</view>
 			</view>
@@ -122,7 +122,8 @@
 					title: '个人资料',
 					btn: 1
 				},
-				nickname: '',
+				userAvatar:'',
+				username: '',
 				selfdomintro: '',
 
 				genderList: ['男', '女'],
@@ -174,10 +175,30 @@
 				return `${year}-${month}-${day}`;
 			},
 			gotoLogin(){
+				let  user= {
+					openid:'',
+					avatar: "",
+					desc: "",
+					email: "",
+					phone: "",
+					sex: "",
+					token: "",
+					username: "暂无",
+					__v: 0,
+					_id: ""
+				}
+				this.$store.dispatch('asyncUpdateUser', user)
 				uni.navigateTo({
-					url:'/pages/login/login'
+					url:'/pages/login_Wechat/login_Wechat'
 				})
 			},
+		},
+		onShow() {
+			console.log(this.$store.state);
+			this.userAvatar=this.$store.state.user.avatar;
+			this.username=this.$store.state.user.username;
+			// this.isManage = this.$store.state.user.openid;
+			// console.log(this.isManage == "");
 		}
 	}
 </script>

+ 1 - 1
pages/publish/publish.vue

@@ -402,7 +402,7 @@
 						const uploadTask = uni.uploadFile({
 							url: 'http://139.159.246.165:7006/img', // post请求地址
 							// url: 'https://cxcy.ssti.net.cn/api/UploadFirmFile', // post请求地址
-							filePath: tempFilePaths,
+							// filePath: tempFilePaths,
 							filePath: tempFilePaths,
 							name: 'file', // 待确认
 							header: {

+ 2 - 2
store/index.js

@@ -45,9 +45,9 @@ const store = new Vuex.Store({
 			phone: "",
 			sex: "",
 			token: "",
-			username: "666",
+			username: "暂无",
 			__v: 0,
-			_id: "6523ac0dd4e4de99a9e86da2"
+			_id: ""
 		},
 		// 聊天记录
 		message:[]