Prechádzať zdrojové kódy

Merge branch 'master' of http://120.79.128.142:3000/904118851/chatgpt

xy 2 rokov pred
rodič
commit
8905f673ca

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

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

+ 4 - 4
pages/AI_chat/AI_chat.vue

@@ -18,7 +18,7 @@
 								</view>
 								
 					
-								<view v-if="recvMsgQueue[index].isFinish==true" style="margin-left: 65%;">
+								<view v-if="false" style="margin-left: 65%;">
 									<image src="../../static/msg-opt-3.png" style="margin-left: 10upx;width: 30upx;height: 30upx;"></image>
 									<image src="../../static/msg-opt-4.png" style="margin-left: 10upx;width: 30upx;height: 30upx;"></image>
 								</view>
@@ -37,7 +37,7 @@
 									
 								</view>
 								
-								<view style="margin-left: 65%;">
+								<view v-if="false" style="margin-left: 65%;">
 									<image src="../../static/msg-opt-1.png" style="margin-left: 10upx; width: 30upx;height: 30upx;"></image>
 									<image src="../../static/msg-opt-2.png" style="margin-left: 10upx;width: 30upx;height: 30upx;"></image>
 									<image src="../../static/msg-opt-3.png" style="margin-left: 10upx;width: 30upx;height: 30upx;"></image>
@@ -92,7 +92,7 @@
 		},
 		data() {
 			return {
-				is_open_related:false,
+				is_open_related:true,
 				code:'',
 				title: 'Hello',
 				disabled: false,
@@ -109,7 +109,7 @@
 				all_src_list:[],
 				src_index:0,
 				scroll_top:0,
-				user_name:'ZYPX',  //用户名字
+				user_name:'ZYWZ',  //用户名字
 				ai_name:"SmartAssistant", //ai名字
 				user_mobile:"18612220000",//用户手机号
 				ani:'',

+ 3 - 1
pages/enter/enter-navigator.vue

@@ -21,6 +21,7 @@
 </template>
 
 <script>
+import { nextTick } from "vue"
 	export default {
 		data() {
 			return {
@@ -83,7 +84,7 @@
 			clickToLogout() {
 				let self = this
 				uni.showModal({
-					title:'是否退出登录',
+					content:'是否退出登录?',
 					success: function(res) {
 						if(res.confirm) {
 							self.tools.request_logout(self, (success)=>{
@@ -106,6 +107,7 @@
 <style lang="scss">
 	.container{
 		position: fixed;
+		z-index: 100;
 		width: 100%;
 		height: 60px;
 		top: 0%;

+ 29 - 22
pages/enter/enter.vue

@@ -1,9 +1,9 @@
 <template>
 	<view class="container">
 		<enterNavigator :selectedIndex="nav_current_index" @clickToIndex='homeNavigatorClick'/>
-		<home :viewTop="subviewTop" :viewHeight="subviewHeight" v-if="nav_current_index == config.page_index.home" />
-		<AIChat :viewTop="subviewTop" :viewHeight="subviewHeight" v-if="nav_current_index == config.page_index.ai_chat" />
-		<AIDraw :viewTop="subviewTop" :viewHeight="subviewHeight" v-if="nav_current_index == config.page_index.ai_draw" />
+		<home :viewTop="subviewTop" :viewHeight="subviewHeight" v-show="nav_current_index == config.page_index.home" />
+		<AIChat :viewTop="subviewTop" :viewHeight="subviewHeight" v-show="nav_current_index == config.page_index.ai_chat" />
+		<AIDraw :viewTop="subviewTop" :viewHeight="subviewHeight" v-show="nav_current_index == config.page_index.ai_draw" />
 	</view>
 </template>
 
@@ -21,11 +21,35 @@
 				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) {
+					// console.log('notification_index', index)
+					if(self.nav_current_index == index) {
+						return
+					}
+					self.nav_current_index = index
+				})
+			},
+			offNotification() {
+				uni.$off(config.notification.switch_page_index)
+			},
 			homeNavigatorClick(index) {
 				if(index == config.page_index.ai_chat ||
 				   index == config.page_index.ai_draw) {
-					if(this.tools.is_login_gotoLogin() == false) {
+					if(this.tools.is_login_gotoLogin(index) == false) {
 						return
 					}
 				}
@@ -33,23 +57,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,
@@ -61,6 +68,6 @@
 
 <style lang="scss">
 	.container{
-		
+		background-color: #2A2832;
 	}
 </style>

+ 3 - 3
pages/home/home-bottom.vue

@@ -13,7 +13,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="companyDescribe">xxxx网络有限公司粤ICP备18763546号-1粤公网安备3209875867489384628号</view>
+		<view class="companyDescribe">xxxx网络有限公司粤ICP备xxxxx号-1粤公网安备xxxxxxxxxxxxxxxxx号</view>
 	</view>
 </template>
 
@@ -21,9 +21,9 @@
 	export default {
 		data() {
 			return {
-				leftList: ["地址:广州市番禺区元岗大街1号七号小镇c栋",
+				leftList: ["地址:广东省广州市番禺区xxxxxxxxxx",
 				           "邮箱:xxxxxx@163.com", 
-						   "电话:010-53647364、010-54647765"],
+						   "电话:xxxxxxxxxx、xxxxxxxxxx"],
 				rightList:['关于我们', '服务条款', '隐私政策']
 			}
 		},	

+ 10 - 3
pages/home/home-brief.vue

@@ -28,9 +28,16 @@
 		},
 		methods: {
 			clickToTiyan() {
-				if(this.tools.is_login_gotoLogin()) {
+				if(this.tools.is_login_gotoLogin(this.config.page_index.ai_chat) == true) {
 					uni.$emit(this.config.notification.switch_page_index, this.config.page_index.ai_chat)
-				}
+				} 
+				// 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'
+				// 	})
+				// }
 			}
 			
 		}
@@ -42,7 +49,7 @@
 		display: flex;
 		box-sizing: border-box;
 		width: 100%;
-		background-color: red;
+		// background-color: red;
 		.briefContent{
 			display: flex;
 			width: 100%;

+ 1 - 0
pages/home/home-serviceTrait.vue

@@ -39,6 +39,7 @@
 		flex-direction: column;
 		width: 100%;
 		padding: 20px;
+		background-color: #ffffff;
 		.title {
 			display: flex;
 			font-size: 25px;

+ 1 - 0
pages/home/home.vue

@@ -45,5 +45,6 @@
 		flex-direction: column;
 		left: 0;
 		width: 100%;
+		height: 100%;
 	}
 </style>

+ 21 - 9
pages/login/login.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="container">
+	<view class="login_container">
 		<navback />
 		<view class="kuang">
 			<view class="loginText">欢迎登录</view>
@@ -27,15 +27,20 @@
 				hidden_password: true,
 				phone_value: '',
 				password_value: '',
+				login_success_goback_after_switch_index: -1,
 			}
 		},
+		onLoad(option) {
+			this.login_success_goback_after_switch_index = option.index
+			// console.log('login_success_goback_after_switch_index:', this.login_success_goback_after_switch_index)
+		},
 		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:'请输入手机号',
@@ -54,11 +59,17 @@
 				let self = this
 				this.tools.request_login(self, this.phone_value, this.password_value, (success)=>{
 					if(success === true) {
-						uni.showToast({
-							title:'登录成功',
-							duration:2000
-						})
 						uni.navigateBack()
+			            let index = self.login_success_goback_after_switch_index
+						if(index > -1) {
+							uni.$emit(self.config.notification.switch_page_index, parseInt(index))
+						}
+						setTimeout(function() {
+							uni.showToast({
+								title:'登录成功',
+								duration:1000
+							})
+						}, 100);
 					}
 				})
 			}
@@ -68,18 +79,19 @@
 		}
 	}
 </script>
+
 <style>
 	page{
 		background-color: #2A2832;
 	}
 </style>
+
 <style lang="scss">
-	.container{
+	.login_container{
 		display: flex;
 		box-sizing: border-box;
 		flex-direction: column;
 		width: 100%;
-		height: 100%;
 		align-items: center;
 		.kuang{
 			display: flex;

BIN
unpackage/dist/.DS_Store


+ 1 - 5
unpackage/dist/build/h5/index.html

@@ -1,6 +1,2 @@
 <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>chatgpd</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
-<<<<<<< HEAD
-            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.15388f02.js></script><script src=/static/js/index.9309ca3c.js></script></body></html>
-=======
-            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.091ebf81.js></script><script src=/static/js/index.9c62c02c.js></script></body></html>
->>>>>>> 250ea0f636824df4cca773ccbd5d90eb317d7314
+            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.091ebf81.js></script><script src=/static/js/index.bd4445ef.js></script></body></html>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/index.9309ca3c.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/index.9c62c02c.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/index.bd4445ef.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-enter-enter.11a8ff1d.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-enter-enter.ac3ba94d.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-enter-enter.d8fc198e.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-enter-enter~pages-index-index.2d163305.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-index-index.8a11332e.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-login-login.18d838d6.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-login-login.5f9ba7ff.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-login-login.fe46a986.js


+ 11 - 2
utils/tools.js

@@ -11,12 +11,19 @@ const tools = {
 		return true
 	},
 	// 是否登录并进入登录界面
-	is_login_gotoLogin() {
+	/*
+	* index: -1正常, 1:从AI聊天入口登录 2:从AI画图入口登录
+	*/
+	is_login_gotoLogin(index) {
 		if(this.is_login()) {
 			return true
 		}
+		let url = '/pages/login/login'
+		if(index > -1) {
+			url = '/pages/login/login' +'?index=' + index			
+		}
 		uni.navigateTo({
-			url:'/pages/login/login'
+			url:url
 		})
 		return false
 	},
@@ -66,12 +73,14 @@ const tools = {
 	
 	// 请求退出登录
 	request_logout(that, callback) {
+		uni.showLoading({title:"加载中..."})
 		let self = that
 		setTimeout(function() {
 			tools.set_user_info({})
 			uni.$emit(config.notification.login_state_changed)
 			uni.$emit(config.notification.switch_page_index, 0)
 			callback(true)
+			uni.hideLoading()
 		}, 1000);
 	}
 	

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov