yuanyiming 1 anno fa
parent
commit
6409ca3e11

+ 3 - 4
App.vue

@@ -4,10 +4,9 @@
 		export default {
 			onLaunch: function() { 
 				
-				// uni.
-				uni.getAppBaseInfo({
-					
-				})
+
+				uni.setStorageSync('login', '0');
+				
 				
 				uni.getSystemInfo({
 					success: function (res) {

+ 49 - 15
components/teaching-case/teaching-case.vue

@@ -31,15 +31,15 @@
 				<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>
+							<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>
 					<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>
+							<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>
@@ -96,25 +96,59 @@
 		methods: {
 			gotoTeDetail() {
 				if (this.item.btn) {
+					const value = uni.getStorageSync('login');
+					if (value==0) {
+						uni.navigateTo({
+							url: "/pages/login/login"
+						})
+					} else {
+						uni.navigateTo({
+							url: "/pages/activityDetail/activityDetail"
+						})
+					}
+
+				} else {
+					const value = uni.getStorageSync('login');
+					if (value==0) {
+						uni.navigateTo({
+							url: "/pages/login/login"
+						})
+					} else {
+						uni.navigateTo({
+							url: "/pages/teachingDetail/teachingDetail"
+						})
+					}
+
+				}
+
+			},
+			join() {
+				const value = uni.getStorageSync('login');
+				if (value==0) {
 					uni.navigateTo({
-						url: "/pages/activityDetail/activityDetail"
+						url: "/pages/login/login"
 					})
+					return 1
 				} else {
 					uni.navigateTo({
-						url: "/pages/teachingDetail/teachingDetail"
+						url: '/pages/jys/jys'
 					})
 				}
 
 			},
-			join() {
-				uni.navigateTo({
-					url: '/pages/jys/jys'
-				})
-			},
 			actApply() {
-				uni.navigateTo({
-					url: '/pages/hd/hd'
-				})
+				const value = uni.getStorageSync('login');
+				if (value==0) {
+					uni.navigateTo({
+						url: "/pages/login/login"
+					})
+					return 1
+				} else {
+					uni.navigateTo({
+						url: '/pages/hd/hd'
+					})
+				}
+
 			}
 		}
 	}
@@ -127,7 +161,7 @@
 		// margin-bottom: 10px;
 		background-color: #ffffff;
 		padding: 20rpx 30rpx;
-		
+
 		// padding-bottom: 50rpx;
 		.img {
 			width: 160rpx;

+ 27 - 11
pages/activityPage/activityPage.vue

@@ -32,7 +32,8 @@
 
 								<!-- <view class="" style="display: flex;margin-right: 10rpx;align-items: center;"> -->
 								<view class="img">
-									<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke) (2).png" mode="aspectFill"></image>
+									<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke) (2).png"
+										mode="aspectFill"></image>
 								</view>
 								<text class="fz-font">收藏</text>
 
@@ -66,9 +67,9 @@
 		:direction="direction"
 		buttonColor="#0056a8"
 		@fabClick="fabClick" /> -->
-<view class="" style="height: 30rpx;width: 100%;">
-	
-</view>
+		<view class="" style="height: 30rpx;width: 100%;">
+
+		</view>
 		<view class="qiu" @click="fabClick">
 			<image src="/static/yym/jia.png" mode="aspectFill"></image>
 		</view>
@@ -147,15 +148,30 @@
 		},
 		methods: {
 			lookMore() {
-				uni.navigateTo({
-					url: '/pages/activityList/activityList'
-				})
+				const value = uni.getStorageSync('login');
+				if (value==0) {
+					uni.navigateTo({
+						url: "/pages/login/login"
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/activityList/activityList'
+					})
+				}
+
 			},
 			fabClick() {
-				// console.log(111);
-				uni.navigateTo({
-					url: '/pages/publish/publish'
-				})
+				const value = uni.getStorageSync('login');
+				if (value==0) {
+					uni.navigateTo({
+						url: "/pages/login/login"
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/publish/publish'
+					})
+				}
+				
 			},
 			onChange: function(e) {
 				this.old.x = e.detail.x

+ 60 - 19
pages/index/index.vue

@@ -40,9 +40,9 @@
 				<teaching-case v-for="(item,index) in classList" :key="index" :classList='item'></teaching-case>
 			</template>
 		</viewX-Case>
-<view class="" style="height: 30rpx;width: 100%;">
-	
-</view>
+		<view class="" style="height: 30rpx;width: 100%;">
+
+		</view>
 	</view>
 </template>
 
@@ -119,30 +119,71 @@
 		},
 		methods: {
 			teachmore() {
-				uni.navigateTo({
-					url: "/pages/teachingList/teachingList"
-				})
+				const value = uni.getStorageSync('login');
+				if (value == 0) {
+					uni.navigateTo({
+						url: "/pages/login/login"
+					})
+				} else {
+					uni.navigateTo({
+						url: "/pages/teachingList/teachingList"
+					})
+				}
+
 			},
 			gotoTeDetail() {
-				uni.navigateTo({
-					url: "/pages/teachingDetail/teachingDetail"
-				})
+				const value = uni.getStorageSync('login');
+				if (value == 0) {
+					uni.navigateTo({
+						url: "/pages/login/login"
+					})
+				} else {
+					uni.navigateTo({
+						url: "/pages/teachingDetail/teachingDetail"
+					})
+				}
+
 			},
 			gotoActivity() {
-				uni.navigateTo({
-					url: "/pages/activityList/activityList"
-				})
+				const value = uni.getStorageSync('login');
+				if (value == 0) {
+					uni.navigateTo({
+						url: "/pages/login/login"
+					})
+				} else {
+					uni.navigateTo({
+						url: "/pages/activityList/activityList"
+					})
+				}
+
 			},
 			gotoActivityDetail() {
-				uni.navigateTo({
-					url: '/pages/activityDetail/activityDetail'
-				})
+				const value = uni.getStorageSync('login');
+				if (value == 0) {
+					uni.navigateTo({
+						url: "/pages/login/login"
+					})
+				} else {
+					uni.navigateTo({
+						// url: "/pages/activityList/activityList"
+						url: '/pages/activityDetail/activityDetail'
+					})
+				}
 			},
 			gotoHd() {
-				uni.navigateTo({
-					// url: '/pages/hd/hd'
-					url:"/pages/login/login"
-				})
+				const value = uni.getStorageSync('login');
+				console.log(value == true);
+				if (value == 0) {
+					console.log(11);
+					uni.navigateTo({
+						url: "/pages/login/login"
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/hd/hd',
+					})
+				}
+
 			},
 
 		}

+ 40 - 25
pages/login/login.vue

@@ -2,9 +2,9 @@
 	<view class="login">
 		<statusBar :item='navBarData'></statusBar>
 		<view class="img">
-			<image src="http://43.139.158.220:5007/img/static/yym/image7.png"  mode="aspectFill"></image>
+			<image src="http://43.139.158.220:5007/img/static/yym/image7.png" mode="aspectFill"></image>
 		</view>
-		
+
 		<view class="mid">
 			<view class="quan"></view>
 			<!-- <radio value="r1" @click="radioCheck" size="10" :checked="isOK" /> -->
@@ -12,8 +12,8 @@
 				我已阅读并同意<text>《教育小程序服务条款》</text>和 <text>《 隐私协议》</text>新用户自动注册
 			</view>
 		</view>
-		
-		<button class="btn">一键登录</button>
+
+		<button class="btn" @click="gotoIndex">一键登录</button>
 		<view class="footer" @click="goto">
 			<text>手机号登录/账号密码登录</text>
 		</view>
@@ -24,55 +24,68 @@
 	export default {
 		data() {
 			return {
-				isOK:false,
-				navBarData:{
-					title:'首页',
-					btn:1  //判断是否显示返回按钮
+				isOK: false,
+				navBarData: {
+					title: '首页',
+					btn: 1 //判断是否显示返回按钮
 				},
 			};
 		},
-		methods:{
-			goto(){
+		methods: {
+			gotoIndex() {
+				const value = uni.setStorageSync('login', '1');
+
+				uni.switchTab({
+					url: '/pages/index/index'
+				})
+
+			},
+			goto() {
 				uni.navigateTo({
-					url:"/pages/login_two/login_two"
+					url: "/pages/login_two/login_two"
 				})
 			},
-			radioCheck(){
-				this.isOK=!this.isOK
+			radioCheck() {
+				this.isOK = !this.isOK
 			}
 		}
 	}
 </script>
 
 <style lang="scss">
-	.login{
+	.login {
 		background-color: #ffffff;
 		height: 100vh;
-		.img{
+
+		.img {
 			// margin-top: 150rpx;
 			// background-color: #ccc;
 			padding: 10vh 0;
 			width: 750rpx;
 			display: flex;
 			justify-content: center;
-			image{
+
+			image {
 				width: 200rpx;
 				height: 200rpx;
 				border-radius: 50%;
-				
+
 			}
 		}
-		.mid{
+
+		.mid {
 			display: flex;
 			justify-content: flex-start;
 			width: 750rpx;
 			padding: 0rpx 20rpx;
 			font-size: 13px;
-			::v-deep uni-radio .uni-radio-input{
+
+			::v-deep uni-radio .uni-radio-input {
 				width: 10rpx;
 				height: 10rpx;
 			}
-			.quan{
+
+			.quan {
 				flex-shrink: 0;
 				width: 15px;
 				height: 15px;
@@ -82,12 +95,13 @@
 				margin-right: 10rpx;
 				border: 1px #bdbdbd solid;
 			}
-			text{
+
+			text {
 				color: #4a97f2;
 			}
 		}
-		
-		.btn{
+
+		.btn {
 			background-color: #0056a8;
 			color: #ffffff;
 			border-radius: 30px;
@@ -95,7 +109,8 @@
 			// padding: 0rpx 10rpx;
 			font-size: 16px;
 		}
-		.footer{
+
+		.footer {
 			display: flex;
 			justify-content: center;
 			font-size: 14px;
@@ -103,4 +118,4 @@
 			color: #666666;
 		}
 	}
-</style>
+</style>

+ 139 - 72
pages/message/message.vue

@@ -1,70 +1,78 @@
 <template>
 	<view class="messBox">
 		<statusBar :item="navbarData"></statusBar>
-		
-		<view class="mesItem" @click="goToMesDetail">
-			<view class="leftBox" >
-				<view class="mesImg">
-					<image src="http://43.139.158.220:5007/img/static/message/notice.svg"  mode="aspectFill"></image>
-				</view>
-				
-				<view class="mesBrief">
-					<view class="tit">活动通知</view>
-					<view class="breif fz-font" style="line-height: 40rpx;">活动报名成功</view>
+		<view class="" v-if="isLogin==1">
+			<view class="mesItem" @click="goToMesDetail">
+				<view class="leftBox">
+					<view class="mesImg">
+						<image src="http://43.139.158.220:5007/img/static/message/notice.svg" mode="aspectFill"></image>
+					</view>
+
+					<view class="mesBrief">
+						<view class="tit">活动通知</view>
+						<view class="breif fz-font" style="line-height: 40rpx;">活动报名成功</view>
+					</view>
 				</view>
-			</view>
-			
-			<view class="right">
-				<view class="">
-					<view v-if="isAll" class="newMessage"></view>
+
+				<view class="right">
+					<view class="">
+						<view v-if="isAll" class="newMessage"></view>
+					</view>
+					<view class="mesTime fz-font">07-12</view>
 				</view>
-				<view class="mesTime fz-font">07-12</view>
 			</view>
-		</view>
-		
-		
-		<view class="mesItem" @click="goToMeGXt">
-			<view class="leftBox">
-				<view class="mesImg">
-					<image src="http://43.139.158.220:5007/img/static/message/system.svg" mode=""></image>
-				</view>
-				
-				<view class="mesBrief">
-					<view class="tit ">系统通知</view>
-					<view class="breif fz-font" style="line-height: 40rpx;">已加入xxxxxx教研室</view>
+
+
+			<view class="mesItem" @click="goToMeGXt">
+				<view class="leftBox">
+					<view class="mesImg">
+						<image src="http://43.139.158.220:5007/img/static/message/system.svg" mode=""></image>
+					</view>
+
+					<view class="mesBrief">
+						<view class="tit ">系统通知</view>
+						<view class="breif fz-font" style="line-height: 40rpx;">已加入xxxxxx教研室</view>
+					</view>
 				</view>
-			</view>
-			
-			<view class="right">
-				<view class="">
-					<view v-if="xt" class="newMessage"></view>
+
+				<view class="right">
+					<view class="">
+						<view v-if="xt" class="newMessage"></view>
+					</view>
+					<view class="mesTime fz-font">07-12</view>
 				</view>
-				<view class="mesTime fz-font" >07-12</view>
 			</view>
-		</view>
-		
-		<view class="mesItem" @click="goToMegDy">
-			<view class="leftBox">
-				<view class="mesImg">
-					<image src="http://43.139.158.220:5007/img/static/message/subscribe.svg" mode=""></image>
+
+			<view class="mesItem" @click="goToMegDy">
+				<view class="leftBox">
+					<view class="mesImg">
+						<image src="http://43.139.158.220:5007/img/static/message/subscribe.svg" mode=""></image>
+					</view>
+					<view class="mesBrief">
+						<view class="tit ">订阅消息</view>
+						<view class="breif fz-font" style="line-height: 40rpx;">xxx教研室更新了课程</view>
+					</view>
 				</view>
-				
-				<view class="mesBrief">
-					<view class="tit ">订阅消息</view>
-					<view class="breif fz-font" style="line-height: 40rpx;">xxx教研室更新了课程</view>
+				<view class="right">
+					<view class="">
+						<view v-if="dy" class="newMessage"></view>
+					</view>
+					<view class="mesTime fz-font">07-12</view>
 				</view>
 			</view>
-			
-			<view class="right">
-			
-				<view class="">
-					<view v-if="dy" class="newMessage"></view>
-				</view>
-				
-				<view class="mesTime fz-font">07-12</view>
+		</view>
+		<view v-else class="noLogin"> <!--  未登录展示样式 -->
+			<view class="mid">
+				<image src="http://43.139.158.220:5007/img/static/yym/Vector.png" mode="aspectFill"></image>
+				<view class="tit" style="">您暂时还没有消息</view>
+				<view class="brief fz-font" style="color: rgba(0, 0, 0, 0.4);">快去登录查看消息吧</view>
+				<view class="btn" @click="gotoLogin">去登录</view>
 			</view>
 		</view>
-		
+
+
+
+
 	</view>
 </template>
 
@@ -72,18 +80,19 @@
 	export default {
 		data() {
 			return {
-				navbarData:{
-					title:'消息'
+				navbarData: {
+					title: '消息'
 				},
 				// msgList:[
 				// 	{tit:'hd',isClick:0},
 				// 	{tit:'hd',isClick:0},
 				// 	{tit:'hd',isClick:0},
 				// ]
-				isAll:1,
-				xt:1,
-				dy:1
-				
+				isAll: 1,
+				xt: 1,
+				dy: 1,
+				isLogin: 0
+
 			};
 		},
 		methods: {
@@ -91,27 +100,34 @@
 				uni.navigateTo({
 					url: '/pages/hdxx/hdxx'
 				});
-				this.isAll=0
+				this.isAll = 0
 			},
-			goToMeGXt(){
+			goToMeGXt() {
 				uni.navigateTo({
 					url: '/pages/messageSystem/messageSystem'
 				});
-				this.xt=0
+				this.xt = 0
 			},
 			goToMegDy() {
 				uni.navigateTo({
 					url: '/pages/messageDy/messageDy'
 				});
-				this.dy=0
+				this.dy = 0
 			},
-
+			gotoLogin() {
+				uni.navigateTo({
+					url: '/pages/login/login'
+				});
+			}
+		},
+		onShow() {
+			this.isLogin = uni.getStorageSync('login');
 		}
+
 	}
 </script>
 
 <style lang="scss">
-	
 	.messBox {
 		background: #fff;
 		display: flex;
@@ -119,6 +135,51 @@
 		flex-wrap: nowrap;
 		// align-items: center;
 
+		// 未登录展示样式
+		.noLogin {
+			width: 750rpx;
+			height: 80vh;
+			background-color: #f0f2f5;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+
+			.mid {
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				height: 20vh;
+				justify-content: space-between;
+
+				.tit {
+					margin-top: 30rpx;
+					font-weight: 400;
+					color: rgba(0, 0, 0, 0.8);
+					line-height: 48rpx;
+					font-size: 34rpx;
+				}
+				.brief{
+					margin-top: 10rpx;
+				}
+				image {
+					width: 175rpx;
+					height: 148rpx;
+				}
+
+				.btn {
+					margin-top: 30rpx;
+					width: 160rpx;
+					height: 64rpx;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					background-color: rgba(0, 86, 168, 1);
+					border-radius: 100rpx;
+					color: #ffffff;
+				}
+			}
+		}
+
 		.mesItem {
 			display: flex;
 			// flex-direction: row;
@@ -141,7 +202,8 @@
 					height: 96rpx;
 					// padding: 30rpx 5rpx;
 					margin-right: 25rpx;
-					image{
+
+					image {
 						width: 100%;
 						height: 100%;
 					}
@@ -151,17 +213,20 @@
 					display: flex;
 					flex-direction: column;
 					justify-content: space-between;
-					.tit{
+
+					.tit {
 						font-size: 32rpx;
 						font-weight: 400;
 						line-height: 48rpx;
 						color: #333333;
 					}
-					.breif{
+
+					.breif {
 						// font-size: 16px;
 						color: rgba(51, 51, 51, 1);
 					}
 				}
+
 				// .mesBrief:nth-child(1){
 				// 	// font-size: 36rpx;
 				// }
@@ -170,17 +235,19 @@
 				// 	padding: 10rpx 0 0 0;
 				// }
 			}
-			.right{
+
+			.right {
 				display: flex;
 				flex-direction: column;
 				justify-content: space-between;
 				align-items: center;
 				padding-top: 10px;
+
 				.mesTime {
 					color: #999;
 					bottom: 30px;
 				}
-				
+
 				.newMessage {
 					width: 16rpx;
 					height: 16rpx;
@@ -189,7 +256,7 @@
 				}
 			}
 
-			
+
 		}
 	}
-</style>
+</style>

+ 18 - 5
pages/resource/resource.vue

@@ -38,7 +38,8 @@
 				<scroll-view scroll-y="true" :style="{height:swiper+'px'}">
 					<view class="contBox">
 						<!-- <view class="cont" v-for="i in 10"> -->
-						<view class="cont" v-for="(item, index) in classList" :index="index" :key="index">
+						<view class="cont" @click="gotoLogin" v-for="(item, index) in classList" :index="index"
+							:key="index">
 
 							<image class="image" :src="item.url" mode="aspectFill" />
 							<view class="tit btn-font">{{ item.className }}</view>
@@ -134,8 +135,7 @@
 
 
 				],
-				classList2: [
-					{
+				classList2: [{
 						url: 'http://43.139.158.220:5007/img/static/pubic/img1.jpg',
 						className: '创业者管理能力训练基础',
 						th_name: '主讲教师: 李芳'
@@ -155,7 +155,7 @@
 						className: '创新思维',
 						th_name: '主讲教师: 吴伟'
 					},
-					
+
 					{
 						url: 'http://43.139.158.220:5007/img/static/pubic/img7.jpg',
 						className: '跨境电商创业',
@@ -171,7 +171,7 @@
 						className: '创业经营',
 						th_name: '主讲教师: 黄伟贤'
 					},
-					
+
 					{
 						url: 'http://43.139.158.220:5007/img/static/pubic/img8.jpg',
 						className: '精益创业方法论',
@@ -193,6 +193,19 @@
 			};
 		},
 		methods: {
+			gotoLogin() {
+
+				uni.navigateTo({
+					url: "/pages/login/login"
+				})
+				// const value = uni.getStorageSync('login');
+				// if (value == 0) {
+
+				// } else {
+				// 	console.log(111);
+				// }
+
+			},
 			toggleActive1() {
 				this.isActive1 = true;
 				this.isActive2 = false;