Browse Source

缺设置修改

lihuilin/feature-20251024095243-我的
lihuilin 4 weeks ago
parent
commit
0e578db56d
  1. 37
      api/member.js
  2. 11
      api/setting/general.js
  3. 16
      api/setting/nextPwd.js
  4. 45
      api/setting/password.js
  5. 2
      package-lock.json
  6. 7
      pages.json
  7. 199
      pages/home/member.vue
  8. 50
      pages/setting/account.vue
  9. 245
      pages/setting/createPwd.vue
  10. 59
      pages/setting/email.vue
  11. 38
      pages/setting/font.vue
  12. 131
      pages/setting/general.vue
  13. 2
      pages/setting/introduce.vue
  14. 1
      pages/setting/market.vue
  15. 9
      pages/setting/message.vue
  16. 109
      pages/setting/nextPwd.vue
  17. 94
      pages/setting/password.vue
  18. 54
      pages/setting/phone.vue
  19. 48
      pages/setting/push.vue
  20. 23
      pages/setting/server.vue
  21. 21
      pages/setting/theme.vue
  22. 14
      vue.config.js

37
api/member.js

@ -0,0 +1,37 @@
import util from '../common/util.js'
/*export const getUserInfo = (data = {}) => {
return util.request(
'/api/my/userInfo',
(res) => {
console.log('用户信息请求成功:', res);
},
{data},
(err) => {
console.log('用户信息请求失败:', err);
}
);
};
*/
import {
http
} from '../utils/http'
/**
* 用户信息获取接口
* @param data
* @returns {Promise<unknown>}
*/
export const getUserInfo = (data) => {
return http({
method: 'POST',
url: '/api/my/userInfo',
data: data,
header:{
token:'014de5283d2930af6481ede591afd087'
}
})
}

11
api/setting/general.js

@ -0,0 +1,11 @@
import { http } from '../../utils/http'
export const getSetting = (data) => {
return http({
method: 'POST',
url: '/api/my/getSetting',
data: data,
})
}

16
api/setting/nextPwd.js

@ -0,0 +1,16 @@
import {http} from '../../utils/http'
/**
* 修改密码
* @param data
* @returns {*}
*/
export const updatePassword = (data) => {
return http({
method: 'POST',
url: '/api/my/updatePassword',
data:
data
,
})
}

45
api/setting/password.js

@ -0,0 +1,45 @@
import {
http
} from '../../utils/http'
/**
* 验证码发送
* @param data
* @returns {*}
*/
export const sendEmail = (data) => {
return http({
method: 'POST',
url: '/UserLogin/sendEmail',
data: data,
})
}
/**
* 验证码验证
* @param data
* @returns {*}
*/
export const validateCode = (data) => {
return http({
method: 'POST',
url: '/api/my/validateCode',
data: data,
})
}
export const sendPhone = (data) => {
return http({
method: 'POST',
url: '/UserLogin/sendPhone',
data: data,
})
}
export const changeBind = (data) => {
return http({
method: 'POST',
url: '/api/my/bindEmailOrPhone',
data: data,
})
}

2
package-lock.json

@ -608,6 +608,8 @@
}, },
"node_modules/pinia-plugin-persistedstate": { "node_modules/pinia-plugin-persistedstate": {
"version": "4.5.0", "version": "4.5.0",
"resolved": "https://registry.npmjs.org/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-4.5.0.tgz",
"integrity": "sha512-QTkP1xJVyCdr2I2p3AKUZM84/e+IS+HktRxKGAIuDzkyaKKV48mQcYkJFVVDuvTxlI5j6X3oZObpqoVB8JnWpw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"deep-pick-omit": "^1.2.1", "deep-pick-omit": "^1.2.1",

7
pages.json

@ -299,6 +299,13 @@
{ {
"navigationBarTitleText": "选股策略" "navigationBarTitleText": "选股策略"
} }
},
{
"path" : "pages/setting/createPwd",
"style" :
{
"navigationBarTitleText" : "创建密码"
}
} }
], ],
"globalStyle": { "globalStyle": {

199
pages/home/member.vue

@ -16,54 +16,54 @@
<view class="userId">ID:{{ dccode }}</view> <view class="userId">ID:{{ dccode }}</view>
</view> </view>
<view class="msg-right"> <view class="msg-right">
<image class="image-attendance" src="/static/my/Check-in.png" />
<image class="image-attendance" src="/static/my/Check-in.png"/>
<span style="font-size:10px;">签到</span> <span style="font-size:10px;">签到</span>
</view> </view>
</view> </view>
<view class="settings-buttons"> <view class="settings-buttons">
<view class="setting-btn" @click="goToMarket"> <view class="setting-btn" @click="goToMarket">
<image src="/static/my/MarketSettings.png" class="setting-icon" />
<image src="/static/my/MarketSettings.png" class="setting-icon"/>
<text>行情设置</text> <text>行情设置</text>
</view> </view>
<view class="setting-btn" @click="goToGeneral"> <view class="setting-btn" @click="goToGeneral">
<image src="/static/my/Settings.png" class="setting-icon" />
<image src="/static/my/Settings.png" class="setting-icon"/>
<text>通用设置</text> <text>通用设置</text>
</view> </view>
</view> </view>
<view class="share" @click="goToShare"> <view class="share" @click="goToShare">
<image class="img-share" src="/static/my/share.png" mode="widthFix" />
<image class="img-share" src="/static/my/share.png" mode="widthFix"/>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="list-item" @click="goToAccount"> <view class="list-item" @click="goToAccount">
<image src="/static/my/security.png" class="list-icon" />
<image src="/static/my/security.png" class="list-icon"/>
<text>账号与安全</text> <text>账号与安全</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<uni-icons type="arrowright" size="16" class="arrow"/>
</view> </view>
<view class="list-item"> <view class="list-item">
<image src="/static/my/connection.png" class="list-icon" />
<image src="/static/my/connection.png" class="list-icon"/>
<text>联系我们</text> <text>联系我们</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<uni-icons type="arrowright" size="16" class="arrow"/>
</view> </view>
<view class="list-item" @click="goToNewVersion"> <view class="list-item" @click="goToNewVersion">
<image src="/static/my/update.png" class="list-icon" />
<image src="/static/my/update.png" class="list-icon"/>
<text>新版本更新</text> <text>新版本更新</text>
<view class="update-tip">有新版本可更新 <view class="update-tip">有新版本可更新
<view class="circle"></view> <view class="circle"></view>
</view> </view>
<uni-icons type="arrowright" size="16" class="arrow" />
<uni-icons type="arrowright" size="16" class="arrow"/>
</view> </view>
<view class="list-item"> <view class="list-item">
<image src="/static/my/opinion.png" class="list-icon" />
<image src="/static/my/opinion.png" class="list-icon"/>
<text>意见反馈</text> <text>意见反馈</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<uni-icons type="arrowright" size="16" class="arrow"/>
</view> </view>
<view class="list-item" @click="goToAbout"> <view class="list-item" @click="goToAbout">
<image src="/static/my/about.png" class="list-icon" />
<image src="/static/my/about.png" class="list-icon"/>
<text>关于DeepChart</text> <text>关于DeepChart</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<uni-icons type="arrowright" size="16" class="arrow"/>
</view> </view>
</view> </view>
<footerBar class="static-footer" :type="type"></footerBar> <footerBar class="static-footer" :type="type"></footerBar>
@ -71,148 +71,159 @@
</template> </template>
<script setup> <script setup>
import {
import {
ref, ref,
onMounted onMounted
} from 'vue'
import {
} from 'vue'
import {
ArrowRight ArrowRight
} from '@element-plus/icons-vue'
import footerBar from '../../components/footerBar.vue'
const type = ref('member')
const iSMT = ref(0)
const username = ref('演示机EVA')
const dccode = ref('90047681')
const goToGeneral = () => {
} from '@element-plus/icons-vue'
import footerBar from '../../components/footerBar.vue'
import {getUserInfo} from "@/api/member"
const type = ref('member')
const iSMT = ref(0)
const username = ref('')
const dccode = ref('')
const userInfoRes = ref()//
userInfoRes.value = getUserInfo()
userInfoRes.value.then(res => {
username.value = res.data.username
dccode.value = res.data.dccode
console.log('用户信息', userInfoRes.value)
})
const goToGeneral = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/setting/general' url: '/pages/setting/general'
}) })
}
}
const goToMarket = () => {
const goToMarket = () => {
uni.navigateTo({ uni.navigateTo({
url: '../setting/market' url: '../setting/market'
}) })
}
}
const goToAccount = () => {
const goToAccount = () => {
uni.navigateTo({ uni.navigateTo({
url:'../setting/account'
url: '../setting/account'
}) })
}
}
const goToNewVersion = () =>{
const goToNewVersion = () => {
uni.navigateTo({ uni.navigateTo({
url:'../setting/newVersion'
url: '../setting/newVersion'
}) })
}
}
const goToAbout = () =>{
const goToAbout = () => {
uni.navigateTo({ uni.navigateTo({
url:'../setting/about'
url: '../setting/about'
}) })
}
}
const goToShare = () =>{
const goToShare = () => {
uni.navigateTo({ uni.navigateTo({
url:'../setting/share'
url: '../setting/share'
}) })
}
}
onMounted(() => {
onMounted(() => {
// //
iSMT.value = uni.getSystemInfoSync().statusBarHeight iSMT.value = uni.getSystemInfoSync().statusBarHeight
console.log('??????????????', iSMT.value) console.log('??????????????', iSMT.value)
})
})
</script> </script>
<style scoped> <style scoped>
.static-footer {
.static-footer {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
}
}
.top {
.top {
height: 47vh; height: 47vh;
background-color: white; background-color: white;
}
}
.bell {
.bell {
height: 9.6vh; height: 9.6vh;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
justify-content: flex-end; justify-content: flex-end;
padding-right: 50rpx; padding-right: 50rpx;
}
}
.image-bell {
.image-bell {
width: 13px; width: 13px;
height: 16px; height: 16px;
}
}
.msg {
.msg {
height: 10.7vh; height: 10.7vh;
display: flex; display: flex;
margin-top: 3vh; margin-top: 3vh;
margin-bottom: 3vh; margin-bottom: 3vh;
}
}
.msg-left {
.msg-left {
width: 33.6vw; width: 33.6vw;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
}
}
.avatar {
.avatar {
width: 175rpx; width: 175rpx;
height: 175rpx; height: 175rpx;
border-radius: 50%; border-radius: 50%;
background-color: black; background-color: black;
}
}
.msg-center {
.msg-center {
width: 51.7vw; width: 51.7vw;
padding-left: 2.5vh; padding-left: 2.5vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
}
}
.userInfo {
.userInfo {
font-size: 20px; font-size: 20px;
}
}
.userId {
.userId {
font-size: 14px; font-size: 14px;
margin-top: 1vh; margin-top: 1vh;
}
}
.image-editName {
.image-editName {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-left: 2vw; margin-left: 2vw;
}
}
.msg-right {
.msg-right {
width: 14.7vw; width: 14.7vw;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
}
}
.image-attendance {
.image-attendance {
width: 43rpx; width: 43rpx;
height: 43rpx; height: 43rpx;
}
}
.settings-buttons {
.settings-buttons {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
}
}
.setting-btn {
.setting-btn {
width: 349rpx; width: 349rpx;
height: 135rpx; height: 135rpx;
display: flex; display: flex;
@ -220,75 +231,75 @@
justify-content: center; justify-content: center;
background-color: rgb(243, 243, 243); background-color: rgb(243, 243, 243);
border-radius: 8%; border-radius: 8%;
}
}
.setting-icon {
.setting-icon {
width: 64.7rpx; width: 64.7rpx;
height: 64.7rpx; height: 64.7rpx;
margin-right: 25rpx; margin-right: 25rpx;
}
}
.setting-btn text {
.setting-btn text {
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
}
}
.share {
.share {
height: 12.6vh; height: 12.6vh;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
}
}
.img-share {
.img-share {
width: 720rpx; width: 720rpx;
height: 160rpx; height: 160rpx;
}
}
.bottom {
.bottom {
height: 44.5vh; height: 44.5vh;
margin-top: 1vh; margin-top: 1vh;
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
}
}
.list-item {
.list-item {
width: 670rpx; width: 670rpx;
height: 7vh; height: 7vh;
display: flex; display: flex;
align-items: center; align-items: center;
margin: 0rpx 40rpx; margin: 0rpx 40rpx;
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
}
}
.list-item:last-child{
.list-item:last-child {
border-bottom: none; border-bottom: none;
}
}
.list-icon {
.list-icon {
width: 42rpx; width: 42rpx;
height: 42rpx; height: 42rpx;
margin-right: 18rpx; margin-right: 18rpx;
}
}
.arrow {
.arrow {
margin-left: auto; margin-left: auto;
}
}
.update-tip {
.update-tip {
display: flex; display: flex;
color: #999; color: #999;
font-size: 24rpx; font-size: 24rpx;
align-items: center; align-items: center;
margin-left: 200rpx; margin-left: 200rpx;
justify-content: center; justify-content: center;
}
}
.circle {
.circle {
width: 10rpx; width: 10rpx;
height: 10rpx; height: 10rpx;
border-radius: 50%; border-radius: 50%;
background-color: red; background-color: red;
margin-left: 10rpx; margin-left: 10rpx;
}
}
</style> </style>

50
pages/setting/account.vue

@ -9,41 +9,37 @@
<text class="item-label">头像</text> <text class="item-label">头像</text>
<view class="item-right"> <view class="item-right">
<image src="/static/avatar.png" class="avatar" mode="aspectFill"></image> <image src="/static/avatar.png" class="avatar" mode="aspectFill"></image>
<uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
<uni-icons type="arrowright" size="16"></uni-icons>
</view> </view>
</view> </view>
<view class="setting-item"> <view class="setting-item">
<text class="item-label">昵称</text> <text class="item-label">昵称</text>
<view class="item-right"> <view class="item-right">
<text class="item-text">DeepChart</text>
<uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
<text class="item-text">{{userInfoRes.dcname}}</text>
<uni-icons type="arrowright" size="16"></uni-icons>
</view> </view>
</view> </view>
<view class="setting-item"> <view class="setting-item">
<text class="item-label">ID</text> <text class="item-label">ID</text>
<view class="item-right"> <view class="item-right">
<text class="item-text">{{ jwcode }}</text>
<uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
</view>
</view>
<view class="setting-item">
<text class="item-label">密码</text>
<view class="item-right">
<text class="item-text">qwertyuiop</text>
<uni-icons type="eye" size="16" class="eye-icon"></uni-icons>
<text class="item-text">{{ userInfoRes.dccode }}</text>
</view> </view>
</view> </view>
<view class="setting-item" @click="goToPassword"> <view class="setting-item" @click="goToPassword">
<text class="item-label">修改密码</text>
<uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
<text class="item-label">
<template #default>
{{ userInfoRes.hasPwd === 0 ? '创建密码' : '修改密码' }}
</template>
</text>
<uni-icons type="arrowright" size="16"></uni-icons>
</view> </view>
<view class="setting-item"> <view class="setting-item">
<text class="item-label">注销账号</text> <text class="item-label">注销账号</text>
<uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
<uni-icons type="arrowright" size="16"></uni-icons>
</view> </view>
<view class="setting-item" @click="goToBind"> <view class="setting-item" @click="goToBind">
<text class="item-label">绑定账号</text> <text class="item-label">绑定账号</text>
<uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
<uni-icons type="arrowright" size="16"></uni-icons>
</view> </view>
</view> </view>
@ -73,8 +69,12 @@
} from 'vue' } from 'vue'
import {useUserStore} from "../../stores/modules/userInfo" import {useUserStore} from "../../stores/modules/userInfo"
import {
getUserInfo
} from "@/api/member";
const iSMT = ref(0) const iSMT = ref(0)
const jwcode = ref('90047681')
// const dccode = ref('')
const userInfoRes = ref({})
const showLogout = ref(false) const showLogout = ref(false)
const userStore = useUserStore() const userStore = useUserStore()
@ -92,17 +92,23 @@
}) })
} }
const goToBind = () =>{
const goToBind = () => {
uni.navigateTo({ uni.navigateTo({
url:'../setting/bind'
url: '../setting/bind'
}) })
} }
const goToPassword = () =>{
const goToPassword = () => {
if (userInfoRes.value.hasPwd === 0) {
uni.navigateTo({
url: '../setting/createPwd'
})
} else {
uni.navigateTo({ uni.navigateTo({
url:'../setting/password'
url: '../setting/password'
}) })
} }
}
onMounted(() => { onMounted(() => {
iSMT.value = uni.getSystemInfoSync().statusBarHeight; iSMT.value = uni.getSystemInfoSync().statusBarHeight;
@ -111,7 +117,7 @@
<style scoped> <style scoped>
.setting-list { .setting-list {
height: 49vh;
height: 42vh;
background-color: #fff; background-color: #fff;
} }

245
pages/setting/createPwd.vue

@ -0,0 +1,245 @@
<template>
<view class="main">
<view :style="{height:iSMT+'px'}"></view>
<view class="tab">
<view class="tab-item" :class="{active: activeTab === 'email'}" @click="activeTab = 'email'">邮箱</view>
<view class="tab-item" :class="{active: activeTab === 'phone'}" @click="activeTab = 'phone'">手机号</view>
</view>
<view class="switch-tab">
<view class="input-list" v-if="activeTab === 'email'">
<image src="/static/my/changeEmail.png" mode="aspectFit"></image>
<input type="text" placeholder="请输入邮箱" class="input" v-model="userEmail" />
<button class="code-btn" :class="{disabled: gettingCode}" @click="getCode" :disabled="gettingCode">
{{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }}
</button>
</view>
<view class="input-list" v-else>
<image src="/static/my/changeBindPhone.png" mode="aspectFit"></image>
<input type="number" placeholder="请输入手机号" class="input" v-model="userPhone" />
<button class="code-btn" :class="{disabled: gettingCode}" @click="getCode" :disabled="gettingCode">
{{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }}
</button>
</view>
<view class="input-list">
<image src="/static/my/verification.png" mode="aspectFit"></image>
<input type="text" placeholder="请输入验证码" class="input" v-model="verifyCode" />
</view>
</view>
<view class="btn-area">
<button class="next-btn" @click="goToPwdNext">下一步</button>
</view>
</view>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue'
import {
sendEmail,
validateCode,
sendPhone
} from "@/api/setting/password";
const iSMT = ref(0)
const activeTab = ref('email')
const gettingCode = ref(false)
const time = ref(60)
const userEmail = ref('')
const userPhone = ref('')
const verifyCode = ref('')
const getCode = () => {
if (gettingCode.value) return
gettingCode.value = true
time.value = 2
const timer = setInterval(() => {
time.value--
if (time.value <= 0) {
clearInterval(timer)
gettingCode.value = false
time.value = 2
}
}, 1000)
if (activeTab.value === 'email') {
sendEmail({
email: userEmail.value
})
} else {
sendPhone({
phone: userPhone.value
})
}
}
const goToPwdNext = async () => {
if (!userEmail.value) {
uni.showToast({
title: '请输入邮箱',
icon: 'none'
})
return
}
if (!verifyCode.value) {
uni.showToast({
title: '请输入验证码',
icon: 'none'
})
return
}
try {
let param;
if (activeTab.value === 'email') {
param = {
loginType: 'EMAIL',
account: userEmail.value,
verifyCode: verifyCode.value
}
} else {
param = {
loginType: 'PHONE',
account: userPhone.value,
verifyCode: verifyCode.value
}
}
const res = await validateCode(param)
console.log('看看参数', param)
console.log('看看结果', res)
//
if (res.code === 200) {
uni.showToast({
title: '验证成功',
icon: 'success'
})
uni.navigateTo({
url: '../setting/nextPwd'
})
} else {
uni.showToast({
title: res.msg || '验证失败',
icon: 'none'
})
}
} catch (err) {
console.error(err)
uni.showToast({
title: '请求出错',
icon: 'none'
})
}
}
onMounted(() => {
//
iSMT.value = uni.getSystemInfoSync().statusBarHeight;
})
</script>
<style>
.tab {
display: flex;
height: 8vh;
background-color: #fff;
border-bottom: 1rpx solid #eee;
}
.tab-item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
position: relative;
}
.tab-item.active {
color: #000;
font-weight: bold;
}
.tab-item.active::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 40rpx;
height: 6rpx;
background-color: #000;
/* ????? */
}
.switch-tab {
background-color: #fff;
padding: 0 60rpx;
}
.input-list {
display: flex;
align-items: center;
justify-content: center;
height: 7vh;
border-bottom: 1rpx solid #eee;
}
.input-list image {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
}
.input {
flex: 1;
height: 14vh;
font-size: 28rpx;
}
.code-btn {
width: 200rpx;
height: 60rpx;
font-size: 24rpx;
border-radius: 10rpx;
background-color: #eee;
color: #666;
display: flex;
align-items: center;
justify-content: center;
}
.code-btn.disabled {
background-color: #ccc;
color: #999;
}
.btn-area {
height: 8vh;
background-color: white;
padding-top: 120rpx;
}
.next-btn {
width: 610rpx;
height: 85rpx;
background-color: #000;
color: #fff;
font-size: 30rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

59
pages/setting/email.vue

@ -15,11 +15,10 @@
<view class="top-list"> <view class="top-list">
<view class="left"> <view class="left">
<img src="/static/my/changeEmail.png" /> <img src="/static/my/changeEmail.png" />
<text class="label">+86</text>
<input type="number" placeholder="请输入您的换绑邮箱" class="input" />
<input v-model="userEmail" placeholder="请输入您的换绑邮箱" class="input" />
</view> </view>
<view class="right"> <view class="right">
<button class="verification" :class="{ 'disabled': gettingCode }" @click="getVerification"
<button class="verification" :class="{ 'disabled': gettingCode }" @click="getCode"
:disabled="gettingCode"> :disabled="gettingCode">
{{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }} {{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }}
</button> </button>
@ -35,7 +34,7 @@
</view> </view>
<view class="bottom"> <view class="bottom">
<button class="change-btn">换绑</button>
<button class="change-btn" @click="changeAccount">换绑</button>
</view> </view>
</view> </view>
</template> </template>
@ -45,23 +44,67 @@
ref, ref,
onMounted onMounted
} from 'vue' } from 'vue'
import {
getUserInfo
} from "@/api/member"
import {
sendEmail,
changeBind
} from "@/api/setting/password"
const iSMT = ref(0) const iSMT = ref(0)
const email = ref('analsak@16.com')
const email = ref('')
const gettingCode = ref(false) const gettingCode = ref(false)
const time = ref(60) const time = ref(60)
const userEmail = ref('')
const userInfoPromise = getUserInfo()
userInfoPromise.then(res => {
if (res.code === 200) {
console.log('个人信息', res.data)
email.value = res.data.email
} else {
uni.showToast({
title: '用户信息请求失败',
icon: 'none',
})
}
})
const getVerification = () => {
const changeAccount = () => {
const res = changeBind({
verificateType: 0,
account: userEmail.value
})
if(res.code === 200){
uni.showToast({
title: '绑定成功',
icon: 'none',
})
}else {
uni.showToast({
title: '用户绑定失败',
icon: 'none',
})
}
}
const getCode = () => {
if (gettingCode.value) return if (gettingCode.value) return
gettingCode.value = true gettingCode.value = true
time.value = 60
time.value = 2
const timer = setInterval(() => { const timer = setInterval(() => {
time.value-- time.value--
if (time.value <= 0) { if (time.value <= 0) {
clearInterval(timer) clearInterval(timer)
gettingCode.value = false gettingCode.value = false
time.value = 2
} }
}, 1000) }, 1000)
sendEmail({
email: userEmail.value
})
} }
onMounted(() => { onMounted(() => {
@ -131,7 +174,7 @@
.change-btn { .change-btn {
height: 85rpx; height: 85rpx;
width: 610rpx; width: 610rpx;
padding:0 20rpx;
padding: 0 20rpx;
background-color: black; background-color: black;
color: white; color: white;
border-radius: 40rpx; border-radius: 40rpx;

38
pages/setting/font.vue

@ -4,18 +4,18 @@
<view class="top"> <view class="top">
<view class="top-list"> <view class="top-list">
<text>标准</text> <text>标准</text>
<radio value="0" class="radio-btn" activeBackgroundColor="red"
:checked="selectedIndex === 0" @click="selectFont(0)" />
<radio value="0" class="radio-btn" activeBackgroundColor="red" :checked="selectedIndex === 0"
@click="selectFont(0)" />
</view> </view>
<view class="top-list"> <view class="top-list">
<text>中号</text> <text>中号</text>
<radio value="1" class="radio-btn" activeBackgroundColor="red"
:checked="selectedIndex === 1" @click="selectFont(1)" />
<radio value="1" class="radio-btn" activeBackgroundColor="red" :checked="selectedIndex === 1"
@click="selectFont(1)" />
</view> </view>
<view class="top-list"> <view class="top-list">
<text>大号</text> <text>大号</text>
<radio value="2" class="radio-btn" activeBackgroundColor="red"
:checked="selectedIndex === 2" @click="selectFont(2)" />
<radio value="2" class="radio-btn" activeBackgroundColor="red" :checked="selectedIndex === 2"
@click="selectFont(2)" />
</view> </view>
</view> </view>
</view> </view>
@ -26,17 +26,39 @@
ref, ref,
onMounted onMounted
} from 'vue' } from 'vue'
import {
getSetting
} from "@/api/setting/general"
const iSMT = ref(0) const iSMT = ref(0)
const selectedIndex = ref(0) const selectedIndex = ref(0)
const getFont = async () => {
try {
const res = await getSetting()
if (res.code === 200) {
const fontSize = res.data.fontSize
const sizeMap = {
small: 0,
medium: 1,
large: 2
}
console.log('看看字体', res.data.fontSize)
selectedIndex.value = sizeMap[fontSize] ?? 0;
}
} catch (err) {
console.error("获取字体设置失败:", err);
}
}
const selectFont = (index) => { const selectFont = (index) => {
selectedIndex.value = index selectedIndex.value = index
console.log('看看选中状态',selectedIndex.value)
console.log('看看选中状态', selectedIndex.value)
} }
onMounted(() => { onMounted(() => {
// //
iSMT.value = uni.getSystemInfoSync().statusBarHeight; iSMT.value = uni.getSystemInfoSync().statusBarHeight;
console.log('看看高度', iSMT.value) console.log('看看高度', iSMT.value)
getFont()
}) })
</script> </script>
@ -53,7 +75,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
margin: 0 40rpx; margin: 0 40rpx;
padding:0 10rpx;
padding: 0 10rpx;
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
} }

131
pages/setting/general.vue

@ -3,98 +3,115 @@
<view :style="{height:iSMT+'px'}"></view> <view :style="{height:iSMT+'px'}"></view>
<view class="top"> <view class="top">
<view class="top-list"> <view class="top-list">
<text>语言</text>
<text class="language">中文简体</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<text class="label">语言</text>
<text class="language">{{settingRes.language}}</text>
<uni-icons type="arrowright" size="16" />
</view> </view>
<view class="top-list" @click="goToFont"> <view class="top-list" @click="goToFont">
<text>字体大小</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<text class="label">字体大小</text>
<uni-icons type="arrowright" size="16" />
</view> </view>
<view class="top-list" @click="goToTheme"> <view class="top-list" @click="goToTheme">
<text>主题切换</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<text class="label">主题切换</text>
<uni-icons type="arrowright" size="16" />
</view> </view>
</view> </view>
<view class="center"> <view class="center">
<view class="center-list" @click="goToMessage"> <view class="center-list" @click="goToMessage">
<text>消息推送</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<text class="label">消息推送</text>
<uni-icons type="arrowright" size="16" />
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="bottom-list" @click="goToServer"> <view class="bottom-list" @click="goToServer">
<text>切换服务器</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<text class="label">切换服务器</text>
<uni-icons type="arrowright" size="16" />
</view> </view>
<view class="bottom-list" @click="clearCache"> <view class="bottom-list" @click="clearCache">
<text>清理缓存</text>
<text class="label">清理缓存</text>
<text class="cache">{{ cache }}M</text> <text class="cache">{{ cache }}M</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<uni-icons type="arrowright" size="16" />
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import {
import {
ref, ref,
onMounted onMounted
} from 'vue'
const iSMT = ref(0)
const cache = ref('45.5')
} from 'vue'
import {getUserInfo} from "@/api/member";
const iSMT = ref(0)
const cache = ref('45.5')
const goToFont = () => {
const settingRes = ref({})
const settingPromise = getUserInfo()
settingPromise.then(res => {
if (res.code === 200){
settingRes.value.language = res.data.language;
settingRes.value.fontSize = res.data.fontSize;
settingRes.value.theme = res.data.theme;
settingRes.value.serverSelection = res.data.serverSelection;
console.log('用户信息', res.data)
}else {
console.log('用户信息请求失败:', res.message);
}
})
const goToFont = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/setting/font' url: '/pages/setting/font'
}) })
}
}
const goToTheme = () => {
const goToTheme = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/setting/theme' url: '/pages/setting/theme'
}) })
}
}
const goToMessage = () => {
const goToMessage = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/setting/message' url: '/pages/setting/message'
}) })
}
}
const goToServer = () => {
const goToServer = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/setting/server' url: '/pages/setting/server'
}) })
}
}
const clearCache = () => {
const clearCache = () => {
cache.value = 0 cache.value = 0
uni.showToast({ uni.showToast({
title: '清理成功', title: '清理成功',
icon: 'success', icon: 'success',
duration: 1500 duration: 1500
}) })
}
}
onMounted(() => {
onMounted(() => {
// //
iSMT.value = uni.getSystemInfoSync().statusBarHeight; iSMT.value = uni.getSystemInfoSync().statusBarHeight;
console.log('看看高度', iSMT.value) console.log('看看高度', iSMT.value)
})
})
</script> </script>
<style> <style>
.top {
.top {
margin-top: 1.5vh; margin-top: 1.5vh;
height: 21vh; height: 21vh;
background-color: white; background-color: white;
}
}
.top-list {
.top-list {
width: 630rpx; width: 630rpx;
height: 7vh; height: 7vh;
display: flex; display: flex;
@ -102,48 +119,48 @@
margin: 0 40rpx; margin: 0 40rpx;
padding: 0 10rpx; padding: 0 10rpx;
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
}
}
.top-list:last-child {
.top-list:last-child {
border-bottom: none; border-bottom: none;
}
}
.language {
margin-left: 55%;
.language {
margin-left: 70%;
font-size: 14px; font-size: 14px;
color: rgb(203, 203, 203); color: rgb(203, 203, 203);
}
}
.arrow {
.arrow {
margin-left: auto; margin-left: auto;
}
}
.center {
.center {
background-color: white; background-color: white;
height: 7vh; height: 7vh;
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 1vh; margin-top: 1vh;
}
}
.center-list {
.center-list {
width: 630rpx; width: 630rpx;
margin: 0rpx 40rpx; margin: 0rpx 40rpx;
display: flex; display: flex;
padding: 0 10rpx; padding: 0 10rpx;
}
}
.center-list>.arrow {
.center-list > .arrow {
margin-right: 0; margin-right: 0;
}
}
.bottom {
.bottom {
height: 13.5vh; height: 13.5vh;
background-color: white; background-color: white;
margin-top: 1vh; margin-top: 1vh;
}
}
.bottom-list {
.bottom-list {
width: 630rpx; width: 630rpx;
height: 7vh; height: 7vh;
display: flex; display: flex;
@ -151,15 +168,19 @@
margin: 0 40rpx; margin: 0 40rpx;
padding: 0 10rpx; padding: 0 10rpx;
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
}
}
.cache {
margin-left: 55%;
.cache {
font-size: 14px; font-size: 14px;
color: rgb(203, 203, 203); color: rgb(203, 203, 203);
}
}
.bottom-list:last-child {
.bottom-list:last-child {
border-bottom: none; border-bottom: none;
}
}
.label{
flex:1;
font-size:28rpx;
}
</style> </style>

2
pages/setting/introduce.vue

@ -13,7 +13,7 @@
的品牌标签DeepChart=全球最懂机构行为的AI主打"深度解读机构行为"的APP</view> 的品牌标签DeepChart=全球最懂机构行为的AI主打"深度解读机构行为"的APP</view>
<view class="title">2.产品介绍</view> <view class="title">2.产品介绍</view>
<view class="main-text">DeepChart是一款以"Al智能体为决策核心的智能投资分析平台
<view class="main-text">DeepChart是一款以"Al智能体"为决策核心的智能投资分析平台
专注于深度研究机构行为专为全球散户投资者量身打造它重新定义了人与投资工具之间的关系 专注于深度研究机构行为专为全球散户投资者量身打造它重新定义了人与投资工具之间的关系
是一个真正懂投资懂市场更懂用户的AI投资伙伴</view> 是一个真正懂投资懂市场更懂用户的AI投资伙伴</view>

1
pages/setting/market.vue

@ -206,6 +206,7 @@
.indicator-text { .indicator-text {
font-size: 28rpx; font-size: 28rpx;
flex:1;
} }
.indicator-icons { .indicator-icons {

9
pages/setting/message.vue

@ -3,10 +3,10 @@
<view :style="{height:iSMT+'px'}"></view> <view :style="{height:iSMT+'px'}"></view>
<view class="top"> <view class="top">
<view class="top-list" @click="goToPush"> <view class="top-list" @click="goToPush">
<text>语言</text>
<text class="text">消息推送</text>
<text class="message" v-if="isMessage">通知已开启</text> <text class="message" v-if="isMessage">通知已开启</text>
<text class="message" v-if="!isMessage">通知未开启</text> <text class="message" v-if="!isMessage">通知未开启</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<uni-icons type="arrowright" size="16" />
</view> </view>
</view> </view>
</view> </view>
@ -51,12 +51,11 @@
} }
.message { .message {
margin-left: 60%;
font-size: 14px; font-size: 14px;
color: rgb(203, 203, 203); color: rgb(203, 203, 203);
} }
.arrow {
margin-left: auto;
.text{
flex:1;
} }
</style> </style>

109
pages/setting/nextPwd.vue

@ -2,28 +2,31 @@
<view class="main"> <view class="main">
<view :style="{height:iSMT+'px'}"></view> <view :style="{height:iSMT+'px'}"></view>
<view style="height:1.5vh;" />
<view style="height:1.5vh;"/>
<view class="title"> <view class="title">
<text class="label">确认新密码</text> <text class="label">确认新密码</text>
</view> </view>
<view class="top"> <view class="top">
<view class="top-list"> <view class="top-list">
<view class="left"> <view class="left">
<img src="/static/my/unlock.png" />
<input type="password" :type="pwdType" placeholder="请输入新密码" class="input" />
<img src="/static/my/unlock.png"/>
<input type="password" :type="pwdType" placeholder="请输入新密码" class="input" v-model="oldPassword"
/>
<img :src="pwdType === 1 ? '/static/my/hideEye.png' : '/static/my/openEye.png'" <img :src="pwdType === 1 ? '/static/my/hideEye.png' : '/static/my/openEye.png'"
@click="changeEye(1)" />
@click="changeEye(1)"/>
</view> </view>
</view> </view>
<view class="top-list"> <view class="top-list">
<view class="left"> <view class="left">
<img src="/static/my/unlock.png" />
<input type="password" :type="pwdType2" placeholder="再次确认" class="input" />
<img src="/static/my/unlock.png"/>
<input type="password" :type="pwdType2" placeholder="再次确认" class="input" v-model="newPassword"/>
<img :src="pwdType === 1 ? '/static/my/hideEye.png' : '/static/my/openEye.png'" <img :src="pwdType === 1 ? '/static/my/hideEye.png' : '/static/my/openEye.png'"
@click="changeEye(2)" />
@click="changeEye(2)"/>
</view> </view>
</view> </view>
@ -31,90 +34,118 @@
</view> </view>
<view class="bottom"> <view class="bottom">
<button class="change-btn">确认</button>
<button class="change-btn" @click="confirmChange">确认</button>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import {
ref,
onMounted
} from 'vue'
import {onMounted, ref} from 'vue'
import {updatePassword} from "@/api/setting/nextPwd";
const iSMT = ref(0)
const pwdType = ref('password')
const pwdType2 = ref('password')
//
const oldPassword = ref('')
const newPassword = ref('')
//
const confirmChange = async () => {
if (newPassword.value !== oldPassword.value) {
uni.showToast({title: '两次输入的密码不一致', icon: 'none'})
return
}
const updatePasswordPromise = updatePassword({
oldPassword: oldPassword.value,
newPassword: newPassword.value
})
updatePasswordPromise
.then(res => {
if (res.code === 200) {
uni.showToast({ title: '修改成功', icon: 'success' });
} else {
uni.showToast({ title: res.message,icon: 'none' });
}
})
.catch(err => {
console.log('修改密码失败:', err);
});
}
const iSMT = ref(0)
const pwdType = ref('password')
const pwdType2 = ref('password')
const changeEye = (type) => {
const changeEye = (type) => {
if (type === 1) { if (type === 1) {
pwdType.value = pwdType.value === 'password' ? 'text' : 'password' pwdType.value = pwdType.value === 'password' ? 'text' : 'password'
} else { } else {
pwdType2.value = pwdType2.value === 'password' ? 'text' : 'password' pwdType2.value = pwdType2.value === 'password' ? 'text' : 'password'
} }
}
}
onMounted(() => {
onMounted(() => {
// //
iSMT.value = uni.getSystemInfoSync().statusBarHeight; iSMT.value = uni.getSystemInfoSync().statusBarHeight;
console.log('看看高度', iSMT.value) console.log('看看高度', iSMT.value)
})
})
</script> </script>
<style> <style>
.title {
.title {
height: 8.5vh; height: 8.5vh;
background-color: white; background-color: white;
}
}
.label {
.label {
height: 8.5vh; height: 8.5vh;
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 60rpx; padding: 0 60rpx;
}
}
.top {
.top {
height: auto; height: auto;
background-color: white; background-color: white;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
}
}
.top-list {
.top-list {
width: 630rpx; width: 630rpx;
height: 7vh; height: 7vh;
margin: 0rpx 40rpx; margin: 0rpx 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
}
}
.left {
.left {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
}
}
.input {
.input {
flex: 1; flex: 1;
height: 70rpx; height: 70rpx;
font-size: 29rpx; font-size: 29rpx;
margin-left: 20rpx; margin-left: 20rpx;
}
}
.bottom {
.bottom {
height: 22vh; height: 22vh;
background-color: white; background-color: white;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
}
}
.change-btn {
.change-btn {
height: 85rpx; height: 85rpx;
width: 610rpx; width: 610rpx;
padding: 0 20rpx; padding: 0 20rpx;
@ -124,21 +155,21 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
}
}
.img {
.img {
position: absolute; position: absolute;
right: 0; right: 0;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
}
}
.tips {
.tips {
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #999;
margin-top: 20rpx; margin-top: 20rpx;
margin-left: 60rpx; margin-left: 60rpx;
align-self: flex-start; align-self: flex-start;
/* 这是左对齐 */ /* 这是左对齐 */
}
}
</style> </style>

94
pages/setting/password.vue

@ -10,7 +10,7 @@
<view class="switch-tab"> <view class="switch-tab">
<view class="input-list" v-if="activeTab === 'email'"> <view class="input-list" v-if="activeTab === 'email'">
<image src="/static/my/changeEmail.png" mode="aspectFit"></image> <image src="/static/my/changeEmail.png" mode="aspectFit"></image>
<input type="text" placeholder="请输入邮箱" class="input" />
<input type="text" placeholder="请输入邮箱" class="input" v-model="userEmail" />
<button class="code-btn" :class="{disabled: gettingCode}" @click="getCode" :disabled="gettingCode"> <button class="code-btn" :class="{disabled: gettingCode}" @click="getCode" :disabled="gettingCode">
{{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }} {{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }}
</button> </button>
@ -18,7 +18,7 @@
<view class="input-list" v-else> <view class="input-list" v-else>
<image src="/static/my/changeBindPhone.png" mode="aspectFit"></image> <image src="/static/my/changeBindPhone.png" mode="aspectFit"></image>
<input type="number" placeholder="请输入手机号" class="input" />
<input type="number" placeholder="请输入手机号" class="input" v-model="userPhone" />
<button class="code-btn" :class="{disabled: gettingCode}" @click="getCode" :disabled="gettingCode"> <button class="code-btn" :class="{disabled: gettingCode}" @click="getCode" :disabled="gettingCode">
{{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }} {{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }}
</button> </button>
@ -26,7 +26,7 @@
<view class="input-list"> <view class="input-list">
<image src="/static/my/verification.png" mode="aspectFit"></image> <image src="/static/my/verification.png" mode="aspectFit"></image>
<input type="text" placeholder="请输入验证码" class="input" />
<input type="text" placeholder="请输入验证码" class="input" v-model="verifyCode" />
</view> </view>
</view> </view>
@ -41,33 +41,106 @@
ref, ref,
onMounted onMounted
} from 'vue' } from 'vue'
import {
sendEmail,
validateCode,
sendPhone
} from "@/api/setting/password";
const iSMT = ref(0) const iSMT = ref(0)
const activeTab = ref('email') const activeTab = ref('email')
const gettingCode = ref(false) const gettingCode = ref(false)
const time = ref(60) const time = ref(60)
const userEmail = ref('')
const userPhone = ref('')
const verifyCode = ref('')
const getCode = () => { const getCode = () => {
if (gettingCode.value) return if (gettingCode.value) return
gettingCode.value = true gettingCode.value = true
time.value = 60
time.value = 2
const timer = setInterval(() => { const timer = setInterval(() => {
time.value-- time.value--
if (time.value <= 0) { if (time.value <= 0) {
clearInterval(timer) clearInterval(timer)
gettingCode.value = false gettingCode.value = false
time.value = 60
time.value = 2
} }
}, 1000) }, 1000)
if (activeTab.value === 'email') {
sendEmail({
email: userEmail.value
})
} else {
sendPhone({
phone: userPhone.value
})
}
}
const goToPwdNext = async () => {
if (!userEmail.value) {
uni.showToast({
title: '请输入邮箱',
icon: 'none'
})
return
}
if (!verifyCode.value) {
uni.showToast({
title: '请输入验证码',
icon: 'none'
})
return
} }
const goToPwdNext = () =>{
try {
let param;
if (activeTab.value === 'email') {
param = {
loginType: 'EMAIL',
account: userEmail.value,
verifyCode: verifyCode.value
}
} else {
param = {
loginType: 'PHONE',
account: userPhone.value,
verifyCode: verifyCode.value
}
}
const res = await validateCode(param)
console.log('看看参数', param)
console.log('看看结果', res)
//
if (res.code === 200) {
uni.showToast({
title: '验证成功',
icon: 'success'
})
uni.navigateTo({ uni.navigateTo({
url:'../setting/nextPwd'
url: '../setting/nextPwd'
})
} else {
uni.showToast({
title: res.msg || '验证失败',
icon: 'none'
}) })
} }
} catch (err) {
console.error(err)
uni.showToast({
title: '请求出错',
icon: 'none'
})
}
}
onMounted(() => { onMounted(() => {
// //
@ -105,7 +178,8 @@
transform: translateX(-50%); transform: translateX(-50%);
width: 40rpx; width: 40rpx;
height: 6rpx; height: 6rpx;
background-color: #000;/* ????? */
background-color: #000;
/* ????? */
} }
.switch-tab { .switch-tab {
@ -150,8 +224,8 @@
color: #999; color: #999;
} }
.btn-area{
height:8vh;
.btn-area {
height: 8vh;
background-color: white; background-color: white;
padding-top: 120rpx; padding-top: 120rpx;
} }

54
pages/setting/phone.vue

@ -11,15 +11,14 @@
<text class="label">已绑手机号{{ phone }}</text> <text class="label">已绑手机号{{ phone }}</text>
</view> </view>
</view> </view>
<view class="top-list"> <view class="top-list">
<view class="left"> <view class="left">
<img src="/static/my/changeBindPhone.png" /> <img src="/static/my/changeBindPhone.png" />
<text class="label">+86</text> <text class="label">+86</text>
<input type="number" placeholder="请输入您的换绑手机号" class="input" />
<input type="number" v-model="userPhone" placeholder="请输入您的换绑手机号" class="input" />
</view> </view>
<view class="right"> <view class="right">
<button class="verification" :class="{ 'disabled': gettingCode }" @click="getVerification"
<button class="verification" :class="{ 'disabled': gettingCode }" @click="getCode"
:disabled="gettingCode"> :disabled="gettingCode">
{{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }} {{ gettingCode ? `重新发送 ${time}s` : '获取验证码' }}
</button> </button>
@ -35,7 +34,7 @@
</view> </view>
<view class="bottom"> <view class="bottom">
<button class="change-btn">换绑</button>
<button class="change-btn" @click="changeAccount">换绑</button>
</view> </view>
</view> </view>
</template> </template>
@ -45,12 +44,34 @@
ref, ref,
onMounted onMounted
} from 'vue' } from 'vue'
import {
sendPhone,
changeBind
} from "@/api/setting/password"
import {
getUserInfo
} from "@/api/member"
const iSMT = ref(0) const iSMT = ref(0)
const phone = ref('15105421566')
const phone = ref('')
const gettingCode = ref(false) const gettingCode = ref(false)
const time = ref(60) const time = ref(60)
const userPhone = ref('')
const userInfoPromise = getUserInfo()
userInfoPromise.then(res => {
if (res.code === 200) {
console.log('个人信息', res.data)
phone.value = res.data.phone
} else {
uni.showToast({
title: '用户信息请求失败',
icon: 'none',
})
}
})
const getVerification = () => {
const getCode = () => {
if (gettingCode.value) return if (gettingCode.value) return
gettingCode.value = true gettingCode.value = true
@ -63,6 +84,27 @@
gettingCode.value = false gettingCode.value = false
} }
}, 1000) }, 1000)
sendPhone({
phone: userPhone.value
})
}
const changeAccount = () => {
const res = changeBind({
verificateType: 1,
account: userPhone.value
})
if(res.code === 200){
uni.showToast({
title: '绑定成功',
icon: 'none',
})
}else {
uni.showToast({
title: '用户绑定失败',
icon: 'none',
})
}
} }
onMounted(() => { onMounted(() => {

48
pages/setting/push.vue

@ -3,25 +3,35 @@
<view :style="{height:iSMT+'px'}"></view> <view :style="{height:iSMT+'px'}"></view>
<view class="top"> <view class="top">
<view class="top-list"> <view class="top-list">
<text style="width:180rpx;">公共消息</text>
<text class="label">公共消息</text>
<view class="right">
<text class="public">重大咨询财经要闻等系统提醒</text> <text class="public">重大咨询财经要闻等系统提醒</text>
<switch class="arrow switch-btn" />
<switch class="switch-btn" />
</view>
</view> </view>
<view class="top-list"> <view class="top-list">
<text>字体大小</text>
<switch class="arrow switch-btn" />
<text class="label">指标消息提醒</text>
<view class="right">
<text class="public">所有指标消息的提醒</text>
<switch class="switch-btn" />
</view>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="bottom-list"> <view class="bottom-list">
<text>盯盘预警</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<text class="label">盯盘预警</text>
<view class="right">
<text class="public">自选股预警和个性化预警设置</text>
<uni-icons type="arrowright" size="16" />
</view>
</view> </view>
<view class="bottom-list"> <view class="bottom-list">
<text>订阅服务</text>
<text class="cache">45.5M</text>
<uni-icons type="arrowright" size="16" class="arrow" />
<text class="label">订阅服务</text>
<view class="right">
<text class="public">订阅你感兴趣的专题服务</text>
<uni-icons type="arrowright" size="16" />
</view>
</view> </view>
</view> </view>
</view> </view>
@ -53,7 +63,6 @@
height: 7vh; height: 7vh;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
margin: 0 40rpx; margin: 0 40rpx;
padding: 0 10rpx; padding: 0 10rpx;
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
@ -63,25 +72,24 @@
border-bottom: none; border-bottom: none;
} }
.right {
display: flex;
align-items: center;
gap: 10rpx;
}
.switch-btn { .switch-btn {
width: 100rpx;
transform: scale(0.6); transform: scale(0.6);
transform-origin: center right; transform-origin: center right;
} }
.public { .public {
width: 450rpx;
margin-left: auto;
font-size: 10px; font-size: 10px;
color: rgb(203, 203, 203); color: rgb(203, 203, 203);
} }
.arrow {
margin-left: auto;
}
.bottom { .bottom {
height: 13.5vh;
height: 14vh;
background-color: white; background-color: white;
margin-top: 1vh; margin-top: 1vh;
} }
@ -105,4 +113,8 @@
.bottom-list:last-child { .bottom-list:last-child {
border-bottom: none; border-bottom: none;
} }
.label {
flex: 1;
}
</style> </style>

23
pages/setting/server.vue

@ -26,9 +26,31 @@
ref, ref,
onMounted onMounted
} from 'vue' } from 'vue'
import {
getSetting
} from "@/api/setting/general"
const iSMT = ref(0) const iSMT = ref(0)
const selectedIndex = ref(0) const selectedIndex = ref(0)
const getServer = async () => {
try {
const res = await getSetting()
if (res.code === 200) {
const fontSize = res.data.fontSize
const sizeMap = {
'auto': 0,
'singapore': 1,
'hongkong': 2
}
console.log('看看服务器', res.data.fontSize)
selectedIndex.value = sizeMap[fontSize] ?? 0;
}
} catch (err) {
console.error("获取服务器设置失败:", err);
}
}
const selectFont = (index) => { const selectFont = (index) => {
selectedIndex.value = index selectedIndex.value = index
console.log('看看选中状态',selectedIndex.value) console.log('看看选中状态',selectedIndex.value)
@ -38,6 +60,7 @@
// //
iSMT.value = uni.getSystemInfoSync().statusBarHeight; iSMT.value = uni.getSystemInfoSync().statusBarHeight;
console.log('看看高度', iSMT.value) console.log('看看高度', iSMT.value)
getServer()
}) })
</script> </script>

21
pages/setting/theme.vue

@ -21,9 +21,29 @@
ref, ref,
onMounted onMounted
} from 'vue' } from 'vue'
import {
getSetting
} from "@/api/setting/general"
const iSMT = ref(0) const iSMT = ref(0)
const selectedIndex = ref(0) const selectedIndex = ref(0)
const getTheme = async () => {
try {
const res = await getSetting()
if (res.code === 200) {
const theme = res.data.theme
const sizeMap = {
'light': 0,
'dark': 1
}
console.log('看看主题', res.data.theme)
selectedIndex.value = sizeMap[theme] ?? 0;
}
} catch (err) {
console.error("获取主题设置失败:", err);
}
}
const selectFont = (index) => { const selectFont = (index) => {
selectedIndex.value = index selectedIndex.value = index
console.log('看看选中状态', selectedIndex.value) console.log('看看选中状态', selectedIndex.value)
@ -32,6 +52,7 @@
// //
iSMT.value = uni.getSystemInfoSync().statusBarHeight; iSMT.value = uni.getSystemInfoSync().statusBarHeight;
console.log('看看高度', iSMT.value) console.log('看看高度', iSMT.value)
getTheme()
}) })
</script> </script>

14
vue.config.js

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

Loading…
Cancel
Save