Browse Source
Merge branch 'wangyi/feature-20251026183100-deepmate王毅' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into dongqian/feature-20251022181325-deepmate简版
lihuilin/feature-20251024095243-我的
Merge branch 'wangyi/feature-20251026183100-deepmate王毅' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into dongqian/feature-20251022181325-deepmate简版
lihuilin/feature-20251024095243-我的
18 changed files with 701 additions and 529 deletions
-
28api/start/login.js
-
43components/footerBar.vue
-
20components/login-prompt.vue
-
133main.js
-
116main.js.bgk
-
41main1.js.bgk
-
435package-lock.json
-
4package.json
-
3pages/deepMate/deepMate.vue
-
64pages/home/deepExploration.vue
-
150pages/start/Registration/Registration.vue
-
13pages/start/index/index.vue
-
38pages/start/login/login.vue
-
48pages/start/recoverPassword/recoverPassword.vue
-
19pages/start/select/select.vue
-
28pages/start/startup/startup.vue
-
9utils/http.js
-
14vue.config.js
@ -1,41 +1,124 @@ |
|||
import App from './App' |
|||
import pinia from './stores/index.js' |
|||
import App from './App.vue' |
|||
|
|||
// #ifndef VUE3
|
|||
import Vue from 'vue' |
|||
import './uni.promisify.adaptor' |
|||
// #ifdef H5
|
|||
import { createSSRApp } from 'vue' |
|||
// 导入需要全局注册的组件
|
|||
import LoginPrompt from './components/login-prompt.vue' |
|||
|
|||
// 全局注册组件
|
|||
Vue.component('LoginPrompt', LoginPrompt) |
|||
export function createApp() { |
|||
const app = createSSRApp(App) |
|||
|
|||
Vue.config.productionTip = false |
|||
App.mpType = 'app' |
|||
const app = new Vue({ |
|||
...App, |
|||
// 挂载 store
|
|||
pinia |
|||
}) |
|||
app.$mount() |
|||
// 全局注册组件
|
|||
app.component('LoginPrompt', LoginPrompt) |
|||
|
|||
// 挂载 store
|
|||
app.use(pinia) |
|||
|
|||
return { |
|||
app |
|||
} |
|||
} |
|||
// #endif
|
|||
|
|||
// #ifdef VUE3
|
|||
// #ifdef APP-PLUS
|
|||
import { createSSRApp } from 'vue' |
|||
// 导入需要全局注册的组件
|
|||
import { createI18n } from 'vue-i18n' |
|||
import LoginPrompt from './components/login-prompt.vue' |
|||
|
|||
export function createApp() { |
|||
const app = createSSRApp(App) |
|||
|
|||
// 全局注册组件
|
|||
app.component('LoginPrompt', LoginPrompt) |
|||
// 导入语言文件
|
|||
import en from './static/language/en.js' |
|||
import ms from './static/language/ms.js' |
|||
import th from './static/language/th.js' |
|||
import vi from './static/language/vi.js' |
|||
import zh_CN from './static/language/zh_CN.js' |
|||
import zh_HK from './static/language/zh_HK.js' |
|||
|
|||
// 挂载 store
|
|||
app.use(pinia) |
|||
function getCurrentLocale() { |
|||
if (uni.getStorageSync('languageData') && uni.getStorageSync('languageData').code && uni |
|||
.getStorageSync('languageData').code != 'undefined') { |
|||
return uni.getStorageSync('languageData').code; |
|||
} else { |
|||
let language = uni.getSystemInfoSync().osLanguage; |
|||
// language = 'zh_CN'
|
|||
if (language.indexOf('th') != -1) { |
|||
language = 'th' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else if (language.indexOf('vi') != -1) { |
|||
language = 'vi' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else if (language.indexOf('zh') != -1) { |
|||
if (language.indexOf('CN') != -1) { |
|||
language = 'zh_CN' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else { |
|||
language = 'zh_HK' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} |
|||
} else if (language.indexOf('en') != -1) { |
|||
language = 'en' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else if (language.indexOf('ms') != -1) { |
|||
language = 'ms' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else { |
|||
language = 'en' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} |
|||
} |
|||
} |
|||
// 创建 i18n 实例
|
|||
const i18n = createI18n({ |
|||
locale: getCurrentLocale(), |
|||
legacy: false, // 使用 Composition API 模式
|
|||
globalInjection: true, // 全局注入 $t 函数
|
|||
messages: { |
|||
'en': en, |
|||
'ms': ms, |
|||
'th': th, |
|||
'vi': vi, |
|||
'zh_CN': zh_CN, |
|||
'zh_HK': zh_HK |
|||
} |
|||
}) |
|||
export function createApp() { |
|||
const app = createSSRApp(App) |
|||
app.component('LoginPrompt', LoginPrompt) |
|||
app.use(i18n) |
|||
// 挂载 store
|
|||
app.use(pinia) |
|||
|
|||
return { |
|||
app |
|||
} |
|||
return { |
|||
app |
|||
} |
|||
} |
|||
// #endif
|
|||
@ -1,116 +0,0 @@ |
|||
|
|||
// #ifndef VUE3 |
|||
import Vue from 'vue' |
|||
import App from './App' |
|||
import LoginPrompt from './components/login-prompt.vue' |
|||
|
|||
Vue.component('LoginPrompt', LoginPrompt) |
|||
Vue.config.productionTip = false |
|||
|
|||
App.mpType = 'app' |
|||
|
|||
const app = new Vue({ |
|||
...App |
|||
}) |
|||
app.$mount() |
|||
// #endif |
|||
|
|||
// #ifdef VUE3 |
|||
import { createSSRApp } from 'vue' |
|||
import App from './App.vue' |
|||
import { createI18n } from 'vue-i18n' |
|||
import LoginPrompt from './components/login-prompt.vue' |
|||
|
|||
|
|||
// 导入语言文件 |
|||
import en from './static/language/en.js' |
|||
import ms from './static/language/ms.js' |
|||
import th from './static/language/th.js' |
|||
import vi from './static/language/vi.js' |
|||
import zh_CN from './static/language/zh_CN.js' |
|||
import zh_HK from './static/language/zh_HK.js' |
|||
|
|||
function getCurrentLocale() { |
|||
if (uni.getStorageSync('languageData') && uni.getStorageSync('languageData').code && uni |
|||
.getStorageSync('languageData').code != 'undefined') { |
|||
return uni.getStorageSync('languageData').code; |
|||
} else { |
|||
let language = uni.getSystemInfoSync().osLanguage; |
|||
// language = 'zh_CN' |
|||
if (language.indexOf('th') != -1) { |
|||
language = 'th' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else if (language.indexOf('vi') != -1) { |
|||
language = 'vi' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else if (language.indexOf('zh') != -1) { |
|||
if (language.indexOf('CN') != -1) { |
|||
language = 'zh_CN' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else { |
|||
language = 'zh_HK' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} |
|||
} else if (language.indexOf('en') != -1) { |
|||
language = 'en' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else if (language.indexOf('ms') != -1) { |
|||
language = 'ms' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} else { |
|||
language = 'en' |
|||
uni.setStorageSync('languageData', { |
|||
code: language |
|||
}) |
|||
console.log(language); |
|||
return language |
|||
} |
|||
} |
|||
} |
|||
// 创建 i18n 实例 |
|||
const i18n = createI18n({ |
|||
locale: getCurrentLocale(), |
|||
legacy: false, // 使用 Composition API 模式 |
|||
globalInjection: true, // 全局注入 $t 函数 |
|||
messages: { |
|||
'en': en, |
|||
'ms': ms, |
|||
'th': th, |
|||
'vi': vi, |
|||
'zh_CN': zh_CN, |
|||
'zh_HK': zh_HK |
|||
} |
|||
}) |
|||
export function createApp() { |
|||
const app = createSSRApp(App) |
|||
app.component('LoginPrompt', LoginPrompt) |
|||
app.use(i18n) |
|||
return { |
|||
app |
|||
} |
|||
} |
|||
// #endif |
|||
@ -0,0 +1,41 @@ |
|||
import App from './App' |
|||
import pinia from './stores/index.js' |
|||
|
|||
// #ifndef VUE3 |
|||
import Vue from 'vue' |
|||
import './uni.promisify.adaptor' |
|||
// 导入需要全局注册的组件 |
|||
import LoginPrompt from './components/login-prompt.vue' |
|||
|
|||
// 全局注册组件 |
|||
Vue.component('LoginPrompt', LoginPrompt) |
|||
|
|||
Vue.config.productionTip = false |
|||
App.mpType = 'app' |
|||
const app = new Vue({ |
|||
...App, |
|||
// 挂载 store |
|||
pinia |
|||
}) |
|||
app.$mount() |
|||
// #endif |
|||
|
|||
// #ifdef VUE3 |
|||
import { createSSRApp } from 'vue' |
|||
// 导入需要全局注册的组件 |
|||
import LoginPrompt from './components/login-prompt.vue' |
|||
|
|||
export function createApp() { |
|||
const app = createSSRApp(App) |
|||
|
|||
// 全局注册组件 |
|||
app.component('LoginPrompt', LoginPrompt) |
|||
|
|||
// 挂载 store |
|||
app.use(pinia) |
|||
|
|||
return { |
|||
app |
|||
} |
|||
} |
|||
// #endif |
|||
435
package-lock.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,28 +1,56 @@ |
|||
<template> |
|||
<view class="main"> |
|||
<!-- 顶部状态栏占位 --> |
|||
<view class="top" :style="{height:iSMT+'px'}"></view> |
|||
<view>深度探索</view> |
|||
<footerBar class="static-footer" :type="type"></footerBar> |
|||
</view> |
|||
<view class="content"> |
|||
<view class="text-area"> |
|||
</view> |
|||
<LoginPrompt ref="loginPrompt"></LoginPrompt> |
|||
<button @click="showLoginPrompt">deepMate</button> |
|||
<text class="title" @click="showLoginPrompt">{{ title }}</text> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { ref,onMounted } from 'vue' |
|||
import footerBar from '../../components/footerBar.vue' |
|||
import { ref } from "vue"; |
|||
import { useUserStore } from "../../stores/modules/userInfo"; |
|||
const title = ref("请先登录"); |
|||
const loginPrompt = ref(null); |
|||
|
|||
const type = ref('deepExploration') |
|||
const iSMT = ref(0) |
|||
const userStore = useUserStore(); |
|||
function showLoginPrompt() { |
|||
userStore.clearUserInfo(); |
|||
} |
|||
|
|||
onMounted(() => { |
|||
// 状态栏高度 |
|||
iSMT.value = uni.getSystemInfoSync().statusBarHeight; |
|||
}) |
|||
function toDeepMate() { |
|||
uni.navigateTo({ |
|||
url: "/pages/deepMate/deepMate", |
|||
}); |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.static-footer { |
|||
position: fixed; |
|||
bottom: 0; |
|||
<style> |
|||
.content { |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.logo { |
|||
height: 200rpx; |
|||
width: 200rpx; |
|||
margin-top: 200rpx; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
margin-bottom: 50rpx; |
|||
} |
|||
|
|||
.text-area { |
|||
display: flex; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.title { |
|||
font-size: 36rpx; |
|||
color: #8f8f94; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,14 @@ |
|||
module.exports = { |
|||
devServer: { |
|||
proxy: { |
|||
'/api': { // 你的目标服务器的请求路径前缀
|
|||
target: 'https://hwjb.homilychart.com', // 目标服务器的地址
|
|||
changeOrigin: true, // 是否跨域
|
|||
secure: false, // 如果是https接口,需要配置这个参数
|
|||
pathRewrite: { |
|||
'^/': '/testApi' // 将 /api 替换为 /testApi,以便正确请求目标服务器的资源
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue