Browse Source

整合里程碑

lihuilin/feature-20251024095243-我的
Ethereal 4 weeks ago
parent
commit
04065312d6
  1. 43
      components/footerBar.vue
  2. 20
      components/login-prompt.vue
  3. 137
      main.js
  4. 116
      main.js.bgk
  5. 41
      main1.js.bgk
  6. 1486
      package-lock.json
  7. 3
      package.json
  8. 64
      pages/home/deepExploration.vue
  9. 4
      pages/start/Registration/Registration.vue
  10. 17
      pages/start/index/index.vue
  11. 4
      pages/start/login/login.vue
  12. 2
      pages/start/recoverPassword/recoverPassword.vue
  13. 19
      pages/start/select/select.vue
  14. 28
      pages/start/startup/startup.vue

43
components/footerBar.vue

@ -1,4 +1,45 @@
<template> <template>
<!-- #ifdef H5 -->
<view class="static-footer-bar" :style="{ 'padding-bottom': safeAreaInsets.bottom + 'px' }">
<view class="static-footer-li" @click="tabChange(1)">
<image src="../static/footBar-image/home.png" class="static-footer-li-icon" v-if="type != 'home'"></image>
<image src="../static/footBar-image/home-selected.png" class="static-footer-li-icon" v-if="type == 'home'"></image>
<view :class="type == 'home' ? 'static-footer-li-title1' : 'static-footer-li-title'">
首页</view>
</view>
<view class="static-footer-li" @click="tabChange(2)">
<image src="../static/footBar-image/marketSituation.png" class="static-footer-li-icon" v-if="type != 'marketSituation'">
</image>
<image src="../static/footBar-image/marketSituation-selected.png" class="static-footer-li-icon"
v-if="type == 'marketSituation'"></image>
<view :class="type == 'marketSituation' ? 'static-footer-li-title1' : 'static-footer-li-title'">
行情</view>
</view>
<view class="static-footer-li static-footer-li-special" @click="tabChange(3)">
<image src="../static/footBar-image/deepMate.png" class="static-footer-li-icon static-footer-li-icon-special" v-if="type != 'deepMate'"></image>
<image src="../static/footBar-image/deepMate-selected.png" class="static-footer-li-icon static-footer-li-icon-special" v-if="type == 'deepMate'">
</image>
<view :class="type == 'deepMate' ? 'static-footer-li-title1' : 'static-footer-li-title'">
DeepMate</view>
</view>
<view class="static-footer-li" @click="tabChange(4)">
<image src="../static/footBar-image/deepExploration.png" class="static-footer-li-icon" v-if="type != 'deepExploration'">
</image>
<image src="../static/footBar-image/deepExploration-selected.png" class="static-footer-li-icon"
v-if="type == 'deepExploration'"></image>
<view :class="type == 'deepExploration' ? 'static-footer-li-title1' : 'static-footer-li-title'">
深度探索</view>
</view>
<view class="static-footer-li" @click="tabChange(5)">
<image src="../static/footBar-image/member.png" class="static-footer-li-icon" v-if="type != 'member'"></image>
<image src="../static/footBar-image/member-selected.png" class="static-footer-li-icon" v-if="type == 'member'"></image>
<view :class="type == 'member' ? 'static-footer-li-title1' : 'static-footer-li-title'">
我的</view>
</view>
</view>
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="static-footer-bar" :style="{ 'padding-bottom': safeAreaInsets.bottom + 'px' }"> <view class="static-footer-bar" :style="{ 'padding-bottom': safeAreaInsets.bottom + 'px' }">
<view class="static-footer-li" @click="tabChange(1)"> <view class="static-footer-li" @click="tabChange(1)">
<image src="../static/footBar-image/home.png" class="static-footer-li-icon" v-if="type != 'home'"></image> <image src="../static/footBar-image/home.png" class="static-footer-li-icon" v-if="type != 'home'"></image>
@ -36,6 +77,8 @@
{{ $t('components.footerBar.member') }}</view> {{ $t('components.footerBar.member') }}</view>
</view> </view>
</view> </view>
<!-- #endif -->
</template> </template>
<script setup> <script setup>

20
components/login-prompt.vue

@ -1,22 +1,30 @@
<template> <template>
<view class="login-prompt" v-if="showPrompt"> <view class="login-prompt" v-if="showPrompt">
<view
class="mask"
:class="{ 'mask-show': showAnimation }"
></view>
<view class="mask" :class="{ 'mask-show': showAnimation }"></view>
<view class="prompt-content" :class="{ 'slide-up': showAnimation }"> <view class="prompt-content" :class="{ 'slide-up': showAnimation }">
<text class="prompt-title">登录以获得更好的体验</text> <text class="prompt-title">登录以获得更好的体验</text>
<button class="login-btn" @click="goLogin">登录</button> <button class="login-btn" @click="goLogin">登录</button>
<button class="visitor-btn" @click="continueAsVisitor"> <button class="visitor-btn" @click="continueAsVisitor">
以访客身份继续 以访客身份继续
</button> </button>
<text class="prompt-title-small" @click="goRegister">如果您还没有账号点击注册</text>
<text class="prompt-title-small" @click="goRegister"
>如果您还没有账号点击注册</text
>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref, nextTick } from "vue";
import { ref, nextTick, onMounted } from "vue";
import { useUserStore } from "../stores/modules/userInfo";
const userStore = useUserStore();
//
onMounted(() => {
if (!userStore.userInfo) {
show();
}
});
// //
const showPrompt = ref(false); const showPrompt = ref(false);

137
main.js

@ -1,41 +1,124 @@
import App from './App'
import pinia from './stores/index.js' 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' 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 // #endif
// #ifdef VUE3
// #ifdef APP-PLUS
import { createSSRApp } from 'vue' import { createSSRApp } from 'vue'
// 导入需要全局注册的组件
import { createI18n } from 'vue-i18n'
import LoginPrompt from './components/login-prompt.vue' 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() { export function createApp() {
const app = createSSRApp(App)
// 全局注册组件
app.component('LoginPrompt', LoginPrompt)
// 挂载 store
app.use(pinia)
return {
app
}
const app = createSSRApp(App)
app.component('LoginPrompt', LoginPrompt)
app.use(i18n)
// 挂载 store
app.use(pinia)
return {
app
}
} }
// #endif // #endif

116
main.js.bgk

@ -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

41
main1.js.bgk

@ -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

1486
package-lock.json
File diff suppressed because it is too large
View File

3
package.json

@ -3,7 +3,8 @@
"json-server": "^1.0.0-beta.3", "json-server": "^1.0.0-beta.3",
"marked": "^2.0.1", "marked": "^2.0.1",
"pinia": "^3.0.3", "pinia": "^3.0.3",
"pinia-plugin-persistedstate": "^4.5.0"
"pinia-plugin-persistedstate": "^4.5.0",
"vue-i18n": "^11.1.12"
}, },
"scripts": { "scripts": {
"server-login": "json-server ./server/login.json --port 8888", "server-login": "json-server ./server/login.json --port 8888",

64
pages/home/deepExploration.vue

@ -1,28 +1,56 @@
<template> <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> </template>
<script setup> <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> </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> </style>

4
pages/start/Registration/Registration.vue

@ -182,7 +182,7 @@
import { ref } from "vue"; import { ref } from "vue";
// //
import countryList from "../login/list"; import countryList from "../login/list";
import footerBar from "../../../components/footerBar-cn.vue";
import footerBar from "../../../components/footerBar";
import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
import { verificationPhone, verificationEmail } from "../login/verification"; import { verificationPhone, verificationEmail } from "../login/verification";
import { import {
@ -283,7 +283,7 @@ async function register() {
console.log("userInfo为", userStore.userInfo); console.log("userInfo为", userStore.userInfo);
// //
uni.navigateTo({
uni.redirectTo({
url: "/pages/home/home", url: "/pages/home/home",
}); });
} else { } else {

17
pages/start/index/index.vue

@ -5,24 +5,25 @@
<text class="title" @click="showLoginPrompt">{{ title }}</text> <text class="title" @click="showLoginPrompt">{{ title }}</text>
</view> </view>
<LoginPrompt ref="loginPrompt"></LoginPrompt> <LoginPrompt ref="loginPrompt"></LoginPrompt>
<button @click="toDeepMate">deepMate</button>
<button @click="toDeepMate">deepMate</button>
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
import { useUserStore } from "../../../stores/modules/userInfo";
const title = ref("请先登录"); const title = ref("请先登录");
const loginPrompt = ref(null); const loginPrompt = ref(null);
function showLoginPrompt() {
loginPrompt.value.show();
const userStore = useUserStore();
function showLoginPrompt() {
userStore.clearUserInfo();
} }
function toDeepMate() {
uni.navigateTo({
url: '/pages/deepMate/deepMate'
})
function toDeepMate() {
uni.navigateTo({
url: "/pages/deepMate/deepMate",
});
} }
</script> </script>

4
pages/start/login/login.vue

@ -248,7 +248,7 @@
import { ref } from "vue"; import { ref } from "vue";
// //
import countryList from "./list.js"; import countryList from "./list.js";
import footerBar from "../../../components/footerBar-cn";
import footerBar from "../../../components/footerBar";
import uniPopupDialogVue from "../../../uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue"; import uniPopupDialogVue from "../../../uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue";
import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
import { verificationPhone, verificationEmail } from "../login/verification"; import { verificationPhone, verificationEmail } from "../login/verification";
@ -365,7 +365,7 @@ async function Login() {
console.log("userInfo为", userStore.userInfo); console.log("userInfo为", userStore.userInfo);
// //
uni.navigateTo({
uni.redirectTo({
url: "/pages/home/home", url: "/pages/home/home",
}); });
} else { } else {

2
pages/start/recoverPassword/recoverPassword.vue

@ -232,7 +232,7 @@
import { ref } from "vue"; import { ref } from "vue";
// //
import countryList from "../login/list"; import countryList from "../login/list";
import footerBar from "../../../components/footerBar-cn.vue";
import footerBar from "../../../components/footerBar";
import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
import { verificationPhone, verificationEmail } from "../login/verification"; import { verificationPhone, verificationEmail } from "../login/verification";
import { SendEmailCodeApi, SendPhoneCodeApi } from "../../../api/start/login"; import { SendEmailCodeApi, SendPhoneCodeApi } from "../../../api/start/login";

19
pages/start/select/select.vue

@ -18,29 +18,24 @@
</view> </view>
<footerBar class="static-footer" :type="type"></footerBar> <footerBar class="static-footer" :type="type"></footerBar>
</view> </view>
</template> </template>
<script setup> <script setup>
import footerBar from "../../../components/footerBar";
import { ref, reactive, toRefs, watch } from "vue";
import footerBar from '../../../components/footerBar-cn'
import { ref, reactive, toRefs, watch } from 'vue'
const type = ref('member')
const type = ref("member");
function toRegistration() { function toRegistration() {
uni.navigateTo({
uni.redirectTo({
url: "/pages/start/Registration/Registration", url: "/pages/start/Registration/Registration",
}); });
} }
function toLogin() { function toLogin() {
uni.navigateTo({
uni.redirectTo({
url: "/pages/start/login/login", url: "/pages/start/login/login",
}); });
} }
@ -167,8 +162,8 @@ function toLogin() {
} }
.static-footer { .static-footer {
position: fixed;
bottom: 0;
position: fixed;
bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
} }

28
pages/start/startup/startup.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="background"> <view class="background">
<image <image
class="logo"
class="logo"
src="../../../static/icons/start-logo.png" src="../../../static/icons/start-logo.png"
mode="scaleToFill" mode="scaleToFill"
/> />
@ -11,23 +11,31 @@
<script setup> <script setup>
import { onShow } from "@dcloudio/uni-app"; import { onShow } from "@dcloudio/uni-app";
import { useUserStore } from "../../../stores/modules/userInfo";
onShow(() => { onShow(() => {
setTimeout(() => { setTimeout(() => {
uni.redirectTo({
url: "/pages/start/select/select",
animationType: "slide-in-right",
animationDuration: 1000,
});
const userStore = useUserStore();
if (!userStore.userInfo)
uni.redirectTo({
url: "/pages/start/select/select",
animationType: "slide-in-right",
animationDuration: 1000,
});
else {
uni.redirectTo({
url: "/pages/home/home",
animationType: "slide-in-right",
animationDuration: 1000,
});
}
}, 1500); }, 1500);
}); });
</script> </script>
<style> <style>
.background { .background {
background: linear-gradient(180deg, #FB6967, #FB6967);
background: linear-gradient(180deg, #fb6967, #fb6967);
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
} }
@ -45,7 +53,7 @@ onShow(() => {
transform: translateX(-50%); transform: translateX(-50%);
} }
.logo{
.logo {
width: 320rpx; width: 320rpx;
height: 200rpx; height: 200rpx;
position: absolute; position: absolute;

Loading…
Cancel
Save