Browse Source

修改个人信息

lihuilin/feature-20251024095243-我的
lihuilin 3 weeks ago
parent
commit
aaf6bd62bc
  1. 11
      api/member.js
  2. 56
      pages/home/member.vue
  3. 6
      pages/setting/about.vue
  4. 16
      pages/setting/account.vue
  5. 4
      pages/setting/bind.vue
  6. 6
      pages/setting/createPwd.vue
  7. 20
      pages/setting/email.vue
  8. 10
      pages/setting/general.vue
  9. 32
      pages/setting/market.vue
  10. 2
      pages/setting/password.vue
  11. BIN
      static/my/Check-in.png
  12. BIN
      static/my/MarketSettings.png
  13. BIN
      static/my/Settings.png
  14. BIN
      static/my/aboutDC.png
  15. BIN
      static/my/bell.png
  16. BIN
      static/my/common.png
  17. BIN
      static/my/default-avatar.png
  18. BIN
      static/my/editName.png
  19. BIN
      static/my/outline.png
  20. BIN
      static/my/polylines.png
  21. BIN
      static/my/security.png
  22. BIN
      static/my/share.png

11
api/member.js

@ -29,9 +29,14 @@ export const getUserInfo = (data) => {
return http({
method: 'POST',
url: '/api/my/userInfo',
data: data,
header:{
token:'014de5283d2930af6481ede591afd087'
data: data
})
}
export const updateUserInfo = (data) => {
return http({
method: 'POST',
url: '/api/my/updateUserInfo',
data: data
})
}

56
pages/home/member.vue

@ -2,9 +2,9 @@
<LoginPrompt ref="loginwPrompt"></LoginPrompt>
<view class="main">
<view class="top">
<view class="bell">
<!-- <view class="bell">
<image class="image-bell" src="/static/my/bell.png"></image>
</view>
</view> -->
<view class="msg">
<view class="msg-left">
<view class="avatar"></view>
@ -43,7 +43,7 @@
<text>账号与安全</text>
<uni-icons type="arrowright" size="16" class="arrow" />
</view>
<view class="list-item">
<!-- <view class="list-item">
<image src="/static/my/connection.png" class="list-icon" />
<text>联系我们</text>
<uni-icons type="arrowright" size="16" class="arrow" />
@ -60,7 +60,7 @@
<image src="/static/my/opinion.png" class="list-icon" />
<text>意见反馈</text>
<uni-icons type="arrowright" size="16" class="arrow" />
</view>
</view> -->
<view class="list-item" @click="goToAbout">
<image src="/static/my/about.png" class="list-icon" />
<text>关于DeepChart</text>
@ -80,23 +80,60 @@ import {
ArrowRight
} from '@element-plus/icons-vue'
import footerBar from '../../components/footerBar.vue'
import {getUserInfo} from "@/api/member"
import { useUserStore } from "../../stores/modules/userInfo"
import {
getUserInfo,
updateUserInfo
} from "@/api/member"
import {
useUserStore
} from "../../stores/modules/userInfo"
const userStore = useUserStore()
const type = ref('member')
const iSMT = ref(0)
const username = ref('')
const dccode = ref('')
const avatarUrl = ref('')
const isEditingName = ref(false)
const editingName = ref('')
const userInfoRes = ref() //
userInfoRes.value = getUserInfo()
userInfoRes.value.then(res => {
username.value = res.data.dcname
dccode.value = res.data.dccode
avatarUrl.value = res.data.avatar
console.log('用户信息', userInfoRes.value)
})
const startEditName = () => {
isEditingName.value = true
editingName.value = username.value
}
const finishEditName = async () => {
if (editingName.value.trim() === '' || editingName.value === username.value) {
isEditingName.value = false
return
}
try {
await updateUserInfo({
dcname: editingName.value
})
uni.showToast({
title: '昵称修改成功',
icon: 'none'
})
} catch (err) {
uni.showToast({
title: '修改失败,请重试',
icon: 'none'
})
} finally {
isEditingName.value = false
}
}
const goToGeneral = () => {
uni.navigateTo({
@ -204,7 +241,8 @@ onMounted(() => {
}
.userInfo {
font-size: 20px;
font-size: 30rpx;
font-weight: bold;
}
.userId {
@ -314,4 +352,8 @@ onMounted(() => {
background-color: red;
margin-left: 10rpx;
}
.edit-input {
background-color: #999;
}
</style>

6
pages/setting/about.vue

@ -12,7 +12,7 @@
<text class="label">产品介绍</text>
<uni-icons type="arrowright" size="16" />
</view>
<view class="bottom-list">
<!-- <view class="bottom-list">
<text class="label">免责声明</text>
<uni-icons type="arrowright" size="16" />
</view>
@ -27,7 +27,7 @@
<view class="bottom-list">
<text class="label">鼓励一下</text>
<uni-icons type="arrowright" size="16" />
</view>
</view> -->
</view>
</view>
</template>
@ -61,7 +61,7 @@
}
.bottom {
height: 35vh;
height: 7vh;
background-color: white;
}

16
pages/setting/account.vue

@ -8,15 +8,15 @@
<view class="setting-item">
<text class="item-label">头像</text>
<view class="item-right">
<image src="/static/avatar.png" class="avatar" mode="aspectFill"></image>
<uni-icons type="arrowright" size="16"></uni-icons>
<image class="avatar" :src="avatarUrl || 'https://d31zlh4on95l9h.cloudfront.net/default/1961d9d2e31e78e47e885231e7514a35.png'" mode="aspectFill" />
<!-- <uni-icons type="arrowright" size="16"></uni-icons> -->
</view>
</view>
<view class="setting-item">
<text class="item-label">昵称</text>
<view class="item-right">
<text class="item-text">{{ userInfoRes.dcname }}</text>
<uni-icons type="arrowright" size="16"></uni-icons>
<!-- <uni-icons type="arrowright" size="16"></uni-icons> -->
</view>
</view>
<view class="setting-item">
@ -33,7 +33,7 @@
</view>
<view class="setting-item">
<text class="item-label">注销账号</text>
<uni-icons type="arrowright" size="16"></uni-icons>
<!-- <uni-icons type="arrowright" size="16"></uni-icons> -->
</view>
<view class="setting-item" @click="goToBind">
<text class="item-label">绑定账号</text>
@ -77,13 +77,15 @@
// const dccode = ref('')
const userInfoRes = ref({})
const showLogout = ref(false)
const avatarUrl = ref('')
const userInfoPromise = getUserInfo()
userInfoPromise.then(res => {
if (res.code === 200) {
userInfoRes.value.dccode = res.data.dccode;
userInfoRes.value.dcname = res.data.dcname;
userInfoRes.value.hasPwd = res.data.hasPassword;
userInfoRes.value.dccode = res.data.dccode
userInfoRes.value.dcname = res.data.dcname
userInfoRes.value.hasPwd = res.data.hasPassword
avatarUrl.value = res.data.avatar
console.log('用户信息', userInfoRes.value)
} else {
uni.showToast({

4
pages/setting/bind.vue

@ -5,7 +5,7 @@
<view style="height:1.5vh;" />
<view class="top">
<view class="top-list" @click="goToBindPhone">
<!-- <view class="top-list" @click="goToBindPhone">
<text class="label">手机号</text>
<view class="right">
<text style="font-size: 28rpx;">
@ -13,7 +13,7 @@
</text>
<uni-icons type="arrowright" size="16" />
</view>
</view>
</view> -->
<view class="top-list" @click="goToBindEmail">
<text class="label">邮箱</text>

6
pages/setting/createPwd.vue

@ -4,7 +4,7 @@
<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 class="tab-item" :class="{active: activeTab === 'phone'}" @click="activeTab = 'phone'">手机号</view> -->
</view>
<view class="switch-tab">
@ -84,7 +84,6 @@
}
const goToPwdNext = async () => {
console.log('发请求之前的activeTab', activeTab.value)
if (activeTab.value === 'email') {
if (!userEmail.value) {
uni.showToast({
@ -110,7 +109,6 @@
return
}
try {
let param;
if (activeTab.value === 'email') {
@ -140,7 +138,7 @@
})
} else {
uni.showToast({
title: res.msg || '验证失败',
title: res.message || '验证失败',
icon: 'none'
})
}

20
pages/setting/email.vue

@ -49,11 +49,9 @@
} from "@/api/member"
import {
sendEmail,
changeBind
changeBind,
validateCode
} from "@/api/setting/password"
import {
verifyCodeApi
} from "@/api/start/login"
const iSMT = ref(0)
const email = ref('')
@ -75,7 +73,7 @@
}
})
const changeAccount = () => {
const changeAccount = async () => {
if (!userEmail) {
uni.showToast({
title: '请输入邮箱',
@ -92,17 +90,18 @@
return
}
const res1 = verifyCodeApi({
const res1 = await validateCode({
loginType: 'EMAIL',
account: userEmail.value,
account: email.value,
verifyCode: verifyCode.value
})
console.log('校验码的结果',res1.code)
if (res1.code === 200) {
const res2 = changeBind({
const res2 = await changeBind({
verificateType: 0,
account: userEmail.value
})
console.log('换绑的结果',res2.code)
if (res2.code === 200) {
uni.showToast({
title: '绑定成功',
@ -111,6 +110,7 @@
uni.navigateTo({
url: '/pages/home/member'
})
} else {
uni.showToast({
title: '用户绑定失败',
@ -142,7 +142,7 @@
}
}, 1000)
sendEmail({
email: userEmail.value
email: email.value
})
}

10
pages/setting/general.vue

@ -2,11 +2,11 @@
<view class="main">
<view :style="{height:iSMT+'px'}"></view>
<view class="top">
<view class="top-list">
<!-- <view class="top-list">
<text class="label">语言</text>
<text class="language">{{settingRes.language}}</text>
<uni-icons type="arrowright" size="16" />
</view>
</view> -->
<view class="top-list" @click="goToFont">
<text class="label">字体大小</text>
<uni-icons type="arrowright" size="16" />
@ -18,12 +18,12 @@
</view>
<view class="center">
<!-- <view class="center">
<view class="center-list" @click="goToMessage">
<text class="label">消息推送</text>
<uni-icons type="arrowright" size="16" />
</view>
</view>
</view> -->
<view class="bottom">
<view class="bottom-list" @click="goToServer">
@ -107,7 +107,7 @@ onMounted(() => {
<style>
.top {
margin-top: 1.5vh;
height: 21vh;
height: 14vh;
background-color: white;
}

32
pages/setting/market.vue

@ -47,12 +47,12 @@
</view>
<view
class="option-btn"
:class="{ 'active': kStyle === 'Outline' }"
@click="handleKStyleChange('Outline')"
:class="{ 'active': kStyle === 'outline' }"
@click="handleKStyleChange('outline')"
>
<image src="../../static/my/outline.png" class="kline-icon" />
<text>轮廓图</text>
<view class="active-dot" v-if="kStyle === 'Outline'"></view>
<view class="active-dot" v-if="kStyle === 'outline'"></view>
</view>
<view
class="option-btn"
@ -85,11 +85,11 @@
</view>
<view
class="option-btn"
:class="{ 'active': exRights === 'Weighted' }"
@click="handleExRightsChange('Weighted')"
:class="{ 'active': exRights === 'weighted' }"
@click="handleExRightsChange('weighted')"
>
<text>加权</text>
<view class="active-dot" v-if="exRights === 'Weighted'"></view>
<view class="active-dot" v-if="exRights === 'weighted'"></view>
</view>
</view>
@ -97,14 +97,14 @@
<view class="top-options">
<view
class="option-btn"
:class="{ 'active': rfColor === 'green' }"
@click="handleRfColorChange('green')"
:class="{ 'active': rfColor === 'greenUp' }"
@click="handleRfColorChange('greenUp')"
>
<view class="color-icon">
<image src="../../static/my/greenRise.png" class="kline-icon" />
</view>
<text>绿涨红跌</text>
<view class="active-dot" v-if="rfColor === 'green'"></view>
<view class="active-dot" v-if="rfColor === 'greenUp'"></view>
</view>
<view
class="option-btn"
@ -115,7 +115,7 @@
<image src="../../static/my/redRise.png" class="kline-icon" />
</view>
<text>红涨绿跌</text>
<view class="active-dot" v-if="rfColor === 'red'"></view>
<view class="active-dot" v-if="rfColor === 'redUp'"></view>
</view>
</view>
@ -145,7 +145,7 @@
</view>
</view>
<view class="indicator-title">
<!-- <view class="indicator-title">
<text>指标设置</text>
</view>
<view class="indicator-list">
@ -157,7 +157,7 @@
</view>
</view>
<view style="height:10vh;background-color: white;"></view>
</view>
</view> -->
</view>
</template>
@ -167,9 +167,9 @@
const iSMT = ref(0)
const aStockBid = ref('auto') // Aauto/open/close
const kStyle = ref('common') // K线common/Outline/polylines
const exRights = ref('exRights') // exRights/normal/Weighted
const rfColor = ref('green') // green/red
const kStyle = ref('common') // K线common/outline/polylines
const exRights = ref('exRights') // exRights/normal/weighted
const rfColor = ref('greenUp') // greenUp/redUp
const indexCount = ref(1) // 1/2/3
const indicatorList = ref(['K线', '均线', '成交量', 'KDJ', 'MACD', 'RSI'])
@ -180,7 +180,7 @@
aStockBid.value = res.data.auctionDisplay ?? 'auto'
kStyle.value = res.data.klineStyle ?? 'common'
exRights.value = res.data.rightsIssueType ?? 'exRights'
rfColor.value = res.data.priceColorScheme ?? 'green'
rfColor.value = res.data.priceColorScheme ?? 'greenUp'
indexCount.value = res.data.subChartCount ?? 1
}
} catch (err) {

2
pages/setting/password.vue

@ -4,7 +4,7 @@
<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 class="tab-item" :class="{active: activeTab === 'phone'}" @click="activeTab = 'phone'">手机号</view> -->
</view>
<view class="switch-tab">

BIN
static/my/Check-in.png

Before

Width: 22  |  Height: 22  |  Size: 614 B

After

Width: 44  |  Height: 44  |  Size: 1.5 KiB

BIN
static/my/MarketSettings.png

Before

Width: 33  |  Height: 33  |  Size: 687 B

After

Width: 66  |  Height: 66  |  Size: 1.3 KiB

BIN
static/my/Settings.png

Before

Width: 27  |  Height: 27  |  Size: 1.2 KiB

After

Width: 54  |  Height: 54  |  Size: 3.3 KiB

BIN
static/my/aboutDC.png

Before

Width: 167  |  Height: 155  |  Size: 8.7 KiB

After

Width: 334  |  Height: 310  |  Size: 21 KiB

BIN
static/my/bell.png

Before

Width: 13  |  Height: 16  |  Size: 358 B

After

Width: 26  |  Height: 32  |  Size: 902 B

BIN
static/my/common.png

Before

Width: 31  |  Height: 23  |  Size: 237 B

After

Width: 62  |  Height: 46  |  Size: 355 B

BIN
static/my/default-avatar.png

After

Width: 216  |  Height: 216  |  Size: 58 KiB

BIN
static/my/editName.png

Before

Width: 15  |  Height: 15  |  Size: 424 B

After

Width: 30  |  Height: 30  |  Size: 1.1 KiB

BIN
static/my/outline.png

Before

Width: 31  |  Height: 25  |  Size: 1.3 KiB

After

Width: 62  |  Height: 49  |  Size: 4.3 KiB

BIN
static/my/polylines.png

Before

Width: 31  |  Height: 23  |  Size: 1.3 KiB

After

Width: 62  |  Height: 46  |  Size: 3.6 KiB

BIN
static/my/security.png

Before

Width: 23  |  Height: 23  |  Size: 669 B

After

Width: 46  |  Height: 46  |  Size: 1.6 KiB

BIN
static/my/share.png

Before

Width: 360  |  Height: 80  |  Size: 28 KiB

After

Width: 720  |  Height: 160  |  Size: 93 KiB

Loading…
Cancel
Save