future 2 rokov pred
rodič
commit
ef05c52d6d

+ 12 - 4
pages/AI-draw/AI-draw.vue

@@ -1,6 +1,8 @@
 <template>
 	<view class="draw_container" :style="{'top': viewTop + 'px', 'height': viewHeight + 'px'}">
-		AI_画图
+		<view class="content">
+			AI_画图,暂未开放
+		</view>
 	</view>
 </template>
 
@@ -32,10 +34,16 @@
 		display: flex;
 		box-sizing: border-box;
 		position: fixed;
-		left: 0;
 		width: 100%;
-		height: 100%;
-		color: #ffffff;
 		background-color: #2A2832;
+		.content{
+			display: flex;
+			box-sizing: border-box;
+			width: 100%;
+			margin-top: 100px;
+			color: #ffffff;
+			font-size: 30px;
+			justify-content: center;
+		}
 	}
 </style>

+ 30 - 17
pages/enter/enter.vue

@@ -21,7 +21,37 @@
 				subviewHeight: 0,
 			}
 		},
+		mounted() {
+			let systemInfo = uni.getSystemInfoSync()
+			
+			this.subviewTop = 60
+			this.subviewHeight = systemInfo.screenHeight - this.subviewTop
+			
+			this.onNotification()
+		},
+		onUnload() {
+			this.offNotification()
+		},
 		methods: {
+			onNotification() {
+				let self = this
+				uni.$on(config.notification.switch_page_index, function(index) {
+					if(self.nav_current_index == index) {
+						return
+					}
+					self.nav_current_index = index
+				})
+				uni.$on(config.notification.login_success_goback_after_gotoAI, function() {
+					if(self.nav_current_index == config.page_index.ai_chat) {
+						return
+					}
+					self.nav_current_index = config.page_index.ai_chat
+				})
+			},
+			offNotification() {
+				uni.$off(config.notification.switch_page_index)
+				uni.$off(config.notification.login_success_goback_after_gotoAI)
+			},
 			homeNavigatorClick(index) {
 				if(index == config.page_index.ai_chat ||
 				   index == config.page_index.ai_draw) {
@@ -33,23 +63,6 @@
 				this.tools.current_navigator_page_index = index
 			}
 		},
-		mounted() {
-			let systemInfo = uni.getSystemInfoSync()
-			
-			this.subviewTop = 60
-			this.subviewHeight = systemInfo.screenHeight - this.subviewTop
-			
-			let self = this
-			uni.$on(config.notification.switch_page_index, function(index) {
-				if(self.nav_current_index == index) {
-					return
-				}
-				self.nav_current_index = index
-			})
-		},
-		onUnload() {
-			uni.$off(config.notification.switch_page_index)
-		},
 		components: {
 			enterNavigator,
 			home,

+ 6 - 1
pages/home/home-brief.vue

@@ -27,9 +27,14 @@
 			}
 		},
 		methods: {
+			// 18612221211
 			clickToTiyan() {
-				if(this.tools.is_login_gotoLogin()) {
+				if(this.tools.is_login()) {
 					uni.$emit(this.config.notification.switch_page_index, this.config.page_index.ai_chat)
+				} else {
+					uni.navigateTo({
+						url:'/pages/login/login' +'?login_success_goback_after_gotoAI=true'
+					})
 				}
 			}
 			

+ 10 - 2
pages/login/login.vue

@@ -27,15 +27,20 @@
 				hidden_password: true,
 				phone_value: '',
 				password_value: '',
+				login_success_goback_after_gotoAI: false
 			}
 		},
+		onLoad(option) {
+			this.login_success_goback_after_gotoAI = option.login_success_goback_after_gotoAI
+			// console.log('login_success_goback_after_gotoAI:', this.login_success_goback_after_gotoAI)
+		},
 		methods: {
 			clickToPasswordIsHidden() {
 				this.hidden_password = !this.hidden_password
 			},
 			clickToLogin() {
-				console.log('phone_value', this.phone_value)
-				console.log('password_value', this.password_value)
+				// console.log('phone_value', this.phone_value)
+				// console.log('password_value', this.password_value)
 				if(this.tools.isNull(this.phone_value)) {
 					uni.showModal({
 						title:'请输入手机号',
@@ -55,6 +60,9 @@
 				this.tools.request_login(self, this.phone_value, this.password_value, (success)=>{
 					if(success === true) {
 						uni.navigateBack()
+						if(self.login_success_goback_after_gotoAI) {
+							uni.$emit(self.config.notification.login_success_goback_after_gotoAI)
+						}
 						setTimeout(function() {
 							uni.showToast({
 								title:'登录成功',

+ 1 - 0
utils/config.js

@@ -10,6 +10,7 @@ const config = {
 	notification:{
 		login_state_changed:"login_state_changed",
 		switch_page_index: "switch_page_index",
+		login_success_goback_after_gotoAI:"login_success_goback_after_gotoAI", // 登录成功返回之后去AI
 	},
 	userData:"userData",
 };