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-我的
wangyetao 4 weeks ago
parent
commit
874b264a2b
  1. 28
      api/start/login.js
  2. 43
      components/footerBar.vue
  3. 20
      components/login-prompt.vue
  4. 119
      main.js
  5. 116
      main.js.bgk
  6. 41
      main1.js.bgk
  7. 435
      package-lock.json
  8. 4
      package.json
  9. 3
      pages/deepMate/deepMate.vue
  10. 62
      pages/home/deepExploration.vue
  11. 146
      pages/start/Registration/Registration.vue
  12. 9
      pages/start/index/index.vue
  13. 38
      pages/start/login/login.vue
  14. 48
      pages/start/recoverPassword/recoverPassword.vue
  15. 15
      pages/start/select/select.vue
  16. 16
      pages/start/startup/startup.vue
  17. 9
      utils/http.js
  18. 14
      vue.config.js

28
api/start/login.js

@ -15,13 +15,11 @@ import { http } from '../../utils/http'
*/ */
export const LoginApi = (data) => { export const LoginApi = (data) => {
return http({ return http({
// method: 'POST',
// url: '/UserLogin/login',
method: 'GET',
url: '/loginSuccessByEmail',
data: {
method: 'POST',
url: '/UserLogin/login',
data:
data data
},
,
}) })
} }
@ -36,9 +34,7 @@ export const SendEmailCodeApi = (data) => {
return http({ return http({
method: 'POST', method: 'POST',
url: '/UserLogin/sendEmail', url: '/UserLogin/sendEmail',
data:{
data
}
data: data
}) })
} }
@ -53,9 +49,7 @@ export const SendPhoneCodeApi = (data) => {
return http({ return http({
method: 'POST', method: 'POST',
url: '/UserLogin/sendPhone', url: '/UserLogin/sendPhone',
data:{
data
}
data:data
}) })
} }
@ -65,13 +59,11 @@ export const SendPhoneCodeApi = (data) => {
* 注册 * 注册
*/ */
export const register = (data) => {
export const registerApi = (data) => {
return http({ return http({
method: 'GET',
url: '/register',
data: {
data
},
method: 'POST',
url: '/UserLogin/register',
data: data,
}) })
} }

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);

119
main.js

@ -1,36 +1,119 @@
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)
// 全局注册组件
app.component('LoginPrompt', LoginPrompt)
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App,
// 挂载 store // 挂载 store
pinia
})
app.$mount()
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) const app = createSSRApp(App)
// 全局注册组件
app.component('LoginPrompt', LoginPrompt) app.component('LoginPrompt', LoginPrompt)
app.use(i18n)
// 挂载 store // 挂载 store
app.use(pinia) app.use(pinia)

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

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

4
package.json

@ -3,7 +3,9 @@
"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"
} }
} }

3
pages/deepMate/deepMate.vue

@ -1015,6 +1015,9 @@ const onBackTopClick = () => {
.message-content { .message-content {
max-width: 70%; max-width: 70%;
position: relative; position: relative;
word-wrap: break-word;
word-break: break-all;
overflow-wrap: break-word;
} }
.user-message .message-content { .user-message .message-content {

62
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 class="content">
<view class="text-area">
</view>
<LoginPrompt ref="loginPrompt"></LoginPrompt>
<button @click="showLoginPrompt">deepMate</button>
<text class="title" @click="showLoginPrompt">{{ title }}</text>
</view> </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>

146
pages/start/Registration/Registration.vue

@ -149,7 +149,8 @@
<button class="register-btn" @click="register">注册</button> <button class="register-btn" @click="register">注册</button>
<!-- 或者 --> <!-- 或者 -->
<text class="or-text" @click="goToLogin">已有账号
<text class="or-text" @click="goToLogin"
>已有账号
<text class="link">登录</text> <text class="link">登录</text>
</text> </text>
@ -181,9 +182,14 @@
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 {
registerApi,
SendEmailCodeApi,
SendPhoneCodeApi,
} from "../../../api/start/login";
const type = ref("member"); const type = ref("member");
const email = ref(""); const email = ref("");
@ -247,39 +253,76 @@ function switchPhone() {
verifyCode.value = ""; verifyCode.value = "";
} }
// function register() {
// if (switchType.value === "Email") {
// //
// if (!email.value) {
// uni.showToast({
// title: "",
// icon: "none",
// });
// return;
// }
// //
// console.log(":", email.value);
// }
// if (switchType.value === "Phone") {
// //
// if (!phone.value) {
// uni.showToast({
// title: "",
// icon: "none",
// });
// return;
// }
// //
// console.log(":", phone.value);
// }
// }
function register() {
//
async function register() {
if (!basicVerification()) { if (!basicVerification()) {
return; return;
} }
const account = changeAccount();
const registerType = changeLoginType();
const res = await registerApi({
registerType: registerType,
account: account,
verifyCode: verifyCode.value,
agree: agreed.value,
});
const message = res.message;
if (res.code === 200) {
//
uni.showToast({
title: "注册成功",
icon: "success",
});
const userStore = useUserStore();
userStore.setUserInfo(res.data);
console.log("userInfo为", userStore.userInfo);
//
uni.redirectTo({
url: "/pages/home/home",
});
} else {
//
uni.showToast({
title: message,
icon: "none",
});
}
}
//
function changeAccount() {
if (switchType.value === "User") {
account.value = deepChartID.value;
}
if (switchType.value === "Phone") {
account.value = `${country.value}${phone.value}`;
}
if (switchType.value === "Email") {
account.value = email.value;
}
return account.value;
}
// type
function changeLoginType() {
if (switchType.value === "User") {
return "DCCODE";
}
if (switchType.value === "Phone") {
return "PHONE";
}
if (switchType.value === "Email") {
return "EMAIL";
}
} }
// //
@ -432,16 +475,47 @@ function onPhoneInput(e) {
} }
} }
function sendCode() {
async function sendCode() {
if (!VerCodeVerfifcation()) { if (!VerCodeVerfifcation()) {
return ;
return;
} }
// //
if (isCodeBtnDisabled.value) return; if (isCodeBtnDisabled.value) return;
console.log("发送验证码");
if (switchType.value === "Phone") {
//
const phoneAll = `${country.value}${phone.value}`;
const res = await SendPhoneCodeApi({
phone: phoneAll,
});
console.log("手机验证码:", res.message);
if (!res) {
uni.showToast({
title: "请求失败",
icon: "none",
});
}
}
if (switchType.value === "Email") {
//
const res = await SendEmailCodeApi({
email: email.value,
});
console.log("邮箱验证码:", res.message);
if (!res) {
uni.showToast({
title: "请求失败",
icon: "none",
});
}
}
// //
isCodeBtnDisabled.value = true; isCodeBtnDisabled.value = true;
codeBtnText.value = "重新发送"; codeBtnText.value = "重新发送";

9
pages/start/index/index.vue

@ -11,18 +11,19 @@
<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);
const userStore = useUserStore();
function showLoginPrompt() { function showLoginPrompt() {
loginPrompt.value.show();
userStore.clearUserInfo();
} }
function toDeepMate() { function toDeepMate() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/deepMate/deepMate'
})
url: "/pages/deepMate/deepMate",
});
} }
</script> </script>

38
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";
@ -340,9 +340,10 @@ async function Login() {
} }
const account = changeAccount(); const account = changeAccount();
const loginType = changeLoginType();
const res = await LoginApi({ const res = await LoginApi({
loginType: switchType.value,
loginType: loginType,
account: account, account: account,
verifyCode: verifyCode.value, verifyCode: verifyCode.value,
password: password.value, password: password.value,
@ -359,13 +360,13 @@ async function Login() {
}); });
const userStore = useUserStore(); const userStore = useUserStore();
userStore.setUserInfo(res.data)
userStore.setUserInfo(res.data);
console.log("userInfo为",userStore.userInfo);
console.log("userInfo为", userStore.userInfo);
// //
uni.switchTab({
url: "/pages/start/index/index",
uni.redirectTo({
url: "/pages/home/home",
}); });
} else { } else {
// //
@ -508,6 +509,7 @@ function VerCodeVerfifcation() {
return true; return true;
} }
//
function changeAccount() { function changeAccount() {
if (switchType.value === "User") { if (switchType.value === "User") {
account.value = deepChartID.value; account.value = deepChartID.value;
@ -523,6 +525,20 @@ function changeAccount() {
return account.value; return account.value;
} }
// type
function changeLoginType() {
if (switchType.value === "User") {
return "DCCODE";
}
if (switchType.value === "Phone") {
return "PHONE";
}
if (switchType.value === "Email") {
return "EMAIL";
}
}
// //
const agreementPopup = ref(null); const agreementPopup = ref(null);
@ -622,10 +638,9 @@ async function sendCode() {
}); });
console.log("手机验证码:", res.message); console.log("手机验证码:", res.message);
const message = res.message;
if (res.code === 200) {
if (!res) {
uni.showToast({ uni.showToast({
title: message,
title: "请求失败",
icon: "none", icon: "none",
}); });
} }
@ -637,10 +652,9 @@ async function sendCode() {
}); });
console.log("邮箱验证码:", res.message); console.log("邮箱验证码:", res.message);
const message = res.message;
if (res.code === 200) {
if (!res) {
uni.showToast({ uni.showToast({
title: message,
title: "请求失败",
icon: "none", icon: "none",
}); });
} }

48
pages/start/recoverPassword/recoverPassword.vue

@ -46,7 +46,7 @@
<view v-else class="switch-container-occupy"> </view> <view v-else class="switch-container-occupy"> </view>
<!-- 输入框 --> <!-- 输入框 -->
<view v-if="isRecovering" class="input-container"> <view v-if="isRecovering" class="input-container">
<view >
<view>
<!-- 修改邮箱输入框容器将图标包含在内 --> <!-- 修改邮箱输入框容器将图标包含在内 -->
<view class="input-with-icon"> <view class="input-with-icon">
<image <image
@ -56,7 +56,6 @@
/> />
<input <input
class="input-field" class="input-field"
:type="newPasswordLookFirst ? 'text' : 'password'" :type="newPasswordLookFirst ? 'text' : 'password'"
placeholder="输入新密码" placeholder="输入新密码"
v-model="newPasswordFirst" v-model="newPasswordFirst"
@ -79,7 +78,6 @@
alt="" alt=""
/> />
<input <input
class="input-field" class="input-field"
:type="newPasswordLookSecond ? 'text' : 'password'" :type="newPasswordLookSecond ? 'text' : 'password'"
placeholder="再次确认" placeholder="再次确认"
@ -211,7 +209,10 @@
</text> </text>
<!-- 或者 --> <!-- 或者 -->
<text class="or-text" @click="goToLogin">已有账号登录 </text>
<text class="or-text" @click="goToLogin">已有账号
<text class="link">登录
</text>
</text>
<!-- 同意弹窗 --> <!-- 同意弹窗 -->
<uniPopup ref="agreementPopup" type="dialog"> <uniPopup ref="agreementPopup" type="dialog">
@ -231,9 +232,10 @@
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";
const type = ref("member"); const type = ref("member");
const email = ref(""); const email = ref("");
@ -333,7 +335,6 @@ function register() {
console.log("123"); console.log("123");
const phoneAll = `${country.value}${phone.value}`; const phoneAll = `${country.value}${phone.value}`;
console.log("完整手机号" + phoneAll); console.log("完整手机号" + phoneAll);
if (!validatePhoneNumber(country.value, phone.value)) { if (!validatePhoneNumber(country.value, phone.value)) {
@ -399,6 +400,13 @@ function goToLogin() {
}); });
} }
function goToRegistration() {
//
uni.navigateTo({
url: "/pages/start/Registration/Registration",
});
}
function onPhoneInput(e) { function onPhoneInput(e) {
// //
const value = e.detail.value; const value = e.detail.value;
@ -466,6 +474,34 @@ function sendCode() {
// //
if (isCodeBtnDisabled.value) return; if (isCodeBtnDisabled.value) return;
console.log("发送验证码");
//
if (switchType.value === "Email") {
const res = SendEmailCodeApi({
email: email.value,
});
if (!res) {
uni.showToast({
title: "发送失败",
icon: "none",
});
}
}
if (switchType.value === "Phone") {
const phoneAll = `${country.value}${phone.value}`;
const res = SendPhoneCodeApi({
phone: phoneAll,
});
if (!res) {
uni.showToast({
title: "发送失败",
icon: "none",
});
}
}
// //
isCodeBtnDisabled.value = true; isCodeBtnDisabled.value = true;
codeBtnText.value = "重新发送"; codeBtnText.value = "重新发送";

15
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",
}); });
} }

16
pages/start/startup/startup.vue

@ -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(() => {
const userStore = useUserStore();
if (!userStore.userInfo)
uni.redirectTo({ uni.redirectTo({
url: "/pages/start/select/select", url: "/pages/start/select/select",
animationType: "slide-in-right", animationType: "slide-in-right",
animationDuration: 1000, 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;

9
utils/http.js

@ -1,8 +1,6 @@
import { useUserStore } from "../stores/modules/userInfo/" import { useUserStore } from "../stores/modules/userInfo/"
// 移除本地 mock 前缀,默认不拼接任何 baseURL。
// 如需指定真实后端,请将此值改为对应域名,例如:
const baseURL = "https://hwjb.homilychart.com"
const baseURL = "https://hwjb.homilychart.com/testApi"
const httpInterceptor = { const httpInterceptor = {
@ -42,10 +40,7 @@ const httpInterceptor = {
// const token = memberStore.userInfo?.token // const token = memberStore.userInfo?.token
const token = '6d818cda701590750245ce69393f2c32' const token = '6d818cda701590750245ce69393f2c32'
if (token) { if (token) {
// 根据接口文档,token应该作为独立的header字段
options.header.Authorization = {
'token': token
}
options.header.Authorization = token
} }
return options return options
} }

14
vue.config.js

@ -0,0 +1,14 @@
module.exports = {
devServer: {
proxy: {
'/api': { // 你的目标服务器的请求路径前缀
target: 'https://hwjb.homilychart.com', // 目标服务器的地址
changeOrigin: true, // 是否跨域
secure: false, // 如果是https接口,需要配置这个参数
pathRewrite: {
'^/': '/testApi' // 将 /api 替换为 /testApi,以便正确请求目标服务器的资源
}
}
}
}
}
Loading…
Cancel
Save