新增“我的”
1922
package-lock.json
generated
@@ -53,6 +53,7 @@
|
||||
"@dcloudio/uni-mp-xhs": "3.0.0-4070520250711001",
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4070520250711001",
|
||||
"@dcloudio/uni-ui": "^1.5.10",
|
||||
"echarts": "^6.0.0",
|
||||
"vue": "^3.4.21",
|
||||
"vue-i18n": "^9.14.5"
|
||||
},
|
||||
@@ -63,7 +64,9 @@
|
||||
"@dcloudio/uni-stacktracey": "3.0.0-4070520250711001",
|
||||
"@dcloudio/vite-plugin-uni": "3.0.0-4070520250711001",
|
||||
"@vue/runtime-core": "^3.4.21",
|
||||
"node-sass": "^9.0.0",
|
||||
"sass": "^1.89.2",
|
||||
"sass-loader": "^16.0.5",
|
||||
"vite": "5.2.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,14 +15,54 @@
|
||||
{
|
||||
"path": "pages/home/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页"
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/more/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "uni-app",
|
||||
"navigationBarBackgroundColor": "#F8F8F8",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
}
|
||||
"navigationStyle": "custom"
|
||||
},
|
||||
"tabBar": {
|
||||
"backgroundColor": "#ffffff",
|
||||
"color": "#B4B4B4",
|
||||
"selectedColor": "#4C4AEF",
|
||||
"list": [
|
||||
{
|
||||
"iconPath": "static/pic/tab/index.png",
|
||||
"selectedIconPath": "static/pic/tab/index-active01.png",
|
||||
"pagePath": "pages/home/index",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"iconPath": "static/pic/tab/jijin.png",
|
||||
"selectedIconPath": "static/pic/tab/jijin-active01.png",
|
||||
"pagePath": "pages/fund/fund",
|
||||
"text": "基金"
|
||||
},
|
||||
{
|
||||
"iconPath": "static/pic/tab/gupiao.png",
|
||||
"selectedIconPath": "static/pic/tab/gupiao-active01.png",
|
||||
"pagePath": "pages/user/order-list",
|
||||
"text": "股票"
|
||||
},
|
||||
{
|
||||
"iconPath": "static/pic/tab/zichan.png",
|
||||
"selectedIconPath": "static/pic/tab/zichan-active01.png",
|
||||
"pagePath": "pages/home/home",
|
||||
"text": "资产"
|
||||
},
|
||||
{
|
||||
"iconPath": "static/pic/tab/more.png",
|
||||
"selectedIconPath": "static/pic/tab/more-active01.png",
|
||||
"pagePath": "pages/more/index",
|
||||
"text": "更多"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -5,20 +5,17 @@
|
||||
<view class="user-info">
|
||||
<image class="avatar" src="/static/images/avatar.png" mode="aspectFill"></image>
|
||||
<view class="user-details">
|
||||
<text class="username">Welcome, {{userName}}</text>
|
||||
<text class="account-id">Account ID: {{accountId}}</text>
|
||||
<text class="username">{{$t('home.welcome')}}</text>
|
||||
<text class="username">{{userName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="account-summary">
|
||||
<text class="label">{{$t('home.totalAssets')}}</text>
|
||||
<text class="total-assets">${{formatNumber(totalAssets)}}</text>
|
||||
<text class="asset-change" :class="{'positive': dailyChange >= 0, 'negative': dailyChange < 0}">
|
||||
{{dailyChange >= 0 ? '+' : ''}}{{formatNumber(dailyChange)}} ({{dailyChangePercent >= 0 ? '+' : ''}}{{dailyChangePercent}}%)
|
||||
</text>
|
||||
</view>
|
||||
<!-- 登出按钮 -->
|
||||
<view class="logout-btn" @click="logout">
|
||||
<text class="logout-text">登出</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 主要功能入口 -->
|
||||
@@ -59,21 +56,39 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 市场指数 -->
|
||||
<!-- 市场指数(左右布局:数据在左,图在右) -->
|
||||
<view class="market-indices">
|
||||
<view class="section-header">
|
||||
<text class="section-title">Market Indices</text>
|
||||
<text class="section-more" @click="navigateTo('markets')">More ></text>
|
||||
</view>
|
||||
<view class="indices-container">
|
||||
<view class="index-item" v-for="(index, i) in marketIndices" :key="i">
|
||||
<text class="index-name">{{index.name}}</text>
|
||||
<text class="index-value">{{index.value}}</text>
|
||||
<text class="index-change" :class="{'positive': index.change >= 0, 'negative': index.change < 0}">
|
||||
{{index.change >= 0 ? '+' : ''}}{{index.change}}%
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<swiper class="indices-swiper" :indicator-dots="true" :autoplay="true" :interval="5000" :duration="1000" @change="handleSwiperChange">
|
||||
<swiper-item v-for="(index, i) in marketIndices" :key="i">
|
||||
<view class="index-item">
|
||||
<!-- 左右布局容器 -->
|
||||
<view class="index-content">
|
||||
<!-- 左侧数据区域 -->
|
||||
<view class="index-data">
|
||||
<text class="index-name">{{index.name}}</text>
|
||||
<text class="index-value">{{index.value}}</text>
|
||||
<text class="index-change" :class="{'positive': index.change >= 0, 'negative': index.change < 0}">
|
||||
{{index.change >= 0 ? '+' : ''}}{{index.change}}%
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<!-- 右侧图表区域 -->
|
||||
<view class="chart-container">
|
||||
<canvas
|
||||
type="2d"
|
||||
:canvas-id="'index-chart-' + i"
|
||||
class="index-chart"
|
||||
@init="onCanvasInit(i)"
|
||||
></canvas>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
<!-- 新闻资讯 -->
|
||||
@@ -96,13 +111,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import loginService from '@/api/login.js'
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userName: "Guest",
|
||||
accountId: "未登录",
|
||||
userName: "John Doe",
|
||||
accountId: "EU20230001",
|
||||
totalAssets: 125430.56,
|
||||
dailyChange: 1254.32,
|
||||
dailyChangePercent: 1.01,
|
||||
@@ -114,10 +129,30 @@ export default {
|
||||
{ symbol: "GOOGL", name: "Alphabet", price: 125.67, change: -0.45 }
|
||||
],
|
||||
marketIndices: [
|
||||
{ name: "S&P 500", value: 4524.09, change: 0.42 },
|
||||
{ name: "NASDAQ", value: 14019.31, change: 0.85 },
|
||||
{ name: "Dow 30", value: 34721.12, change: -0.12 },
|
||||
{ name: "FTSE 100", value: 7527.53, change: 0.23 }
|
||||
{
|
||||
name: "S&P 500",
|
||||
value: 4524.09,
|
||||
change: 0.42,
|
||||
historyData: [4480, 4495, 4510, 4490, 4505, 4520, 4524.09]
|
||||
},
|
||||
{
|
||||
name: "NASDAQ",
|
||||
value: 14019.31,
|
||||
change: 0.85,
|
||||
historyData: [13850, 13890, 13920, 13970, 13990, 14005, 14019.31]
|
||||
},
|
||||
{
|
||||
name: "Dow 30",
|
||||
value: 34721.12,
|
||||
change: -0.12,
|
||||
historyData: [34750, 34780, 34800, 34760, 34740, 34730, 34721.12]
|
||||
},
|
||||
{
|
||||
name: "FTSE 100",
|
||||
value: 7527.53,
|
||||
change: 0.23,
|
||||
historyData: [7490, 7505, 7510, 7500, 7515, 7520, 7527.53]
|
||||
}
|
||||
],
|
||||
marketNews: [
|
||||
{
|
||||
@@ -135,96 +170,149 @@ export default {
|
||||
imageUrl: "/static/images/news3.jpg",
|
||||
time: "2023-06-15T07:15:00Z"
|
||||
}
|
||||
]
|
||||
],
|
||||
charts: [], // 存储图表实例
|
||||
canvasElements: [] // 存储canvas元素
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadUserInfo()
|
||||
},
|
||||
onShow() {
|
||||
// 每次显示页面时检查登录状态
|
||||
this.checkLoginStatus()
|
||||
onReady() {
|
||||
// 页面初次渲染完成后初始化可见的图表
|
||||
this.initVisibleCharts();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 检查登录状态
|
||||
*/
|
||||
checkLoginStatus() {
|
||||
if (!loginService.isLoggedIn()) {
|
||||
console.log('用户未登录,跳转到登录页')
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载用户信息
|
||||
*/
|
||||
loadUserInfo() {
|
||||
const userInfo = loginService.getUserInfo()
|
||||
if (userInfo) {
|
||||
this.userName = userInfo.nickname || userInfo.username
|
||||
this.accountId = userInfo.id || userInfo.username
|
||||
console.log('用户信息已加载:', userInfo)
|
||||
} else {
|
||||
console.log('未找到用户信息')
|
||||
this.checkLoginStatus()
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 登出功能
|
||||
*/
|
||||
logout() {
|
||||
uni.showModal({
|
||||
title: '确认登出',
|
||||
content: '确定要退出登录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
loginService.logout()
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('登出失败:', error)
|
||||
uni.showToast({
|
||||
title: '登出失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
formatNumber(num) {
|
||||
return num.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
},
|
||||
|
||||
formatTime(timeString) {
|
||||
const date = new Date(timeString);
|
||||
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
||||
},
|
||||
|
||||
navigateTo(page) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/${page}/${page}`
|
||||
});
|
||||
const isTabBarPage = ['trade', 'deposit', 'withdraw', 'transfer', 'watchlist', 'markets', 'news'].includes(page);
|
||||
if (isTabBarPage) {
|
||||
uni.switchTab({
|
||||
url: `/pages/${page}/${page}`
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pages/${page}/${page}`
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
viewStockDetail(stock) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/stock/detail?symbol=${stock.symbol}`
|
||||
});
|
||||
},
|
||||
|
||||
viewNewsDetail(news) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/news/detail?title=${encodeURIComponent(news.title)}`
|
||||
});
|
||||
},
|
||||
// 保存canvas初始化信息
|
||||
onCanvasInit(index) {
|
||||
return (canvas, width, height) => {
|
||||
this.canvasElements[index] = { canvas, width, height };
|
||||
// 如果是当前显示的图表,立即初始化
|
||||
if (index === 0) { // 默认显示第一个
|
||||
this.initChart(index);
|
||||
}
|
||||
};
|
||||
},
|
||||
// 初始化指定索引的图表
|
||||
initChart(index) {
|
||||
if (!this.canvasElements[index]) return;
|
||||
|
||||
const { canvas, width, height } = this.canvasElements[index];
|
||||
const chart = echarts.init(canvas, null, {
|
||||
width: width,
|
||||
height: height
|
||||
});
|
||||
canvas.setChart(chart);
|
||||
|
||||
// 获取当前指数的历史数据
|
||||
const indexData = this.marketIndices[index];
|
||||
|
||||
// 设置图表配置
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'line'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '0%',
|
||||
right: '0%',
|
||||
bottom: '0%',
|
||||
top: '0%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
show: false,
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
show: false
|
||||
},
|
||||
series: [{
|
||||
data: indexData.historyData,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
color: indexData.change >= 0 ? '#4CAF50' : '#F44336'
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: indexData.change >= 0 ? 'rgba(76, 175, 80, 0.3)' : 'rgba(244, 67, 54, 0.3)'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgba(255, 255, 255, 0)'
|
||||
}
|
||||
])
|
||||
},
|
||||
symbol: 'none'
|
||||
}]
|
||||
};
|
||||
|
||||
chart.setOption(option);
|
||||
this.charts[index] = chart;
|
||||
|
||||
return chart;
|
||||
},
|
||||
// 初始化可见的图表
|
||||
initVisibleCharts() {
|
||||
// 初始化第一个图表(默认显示的)
|
||||
this.initChart(0);
|
||||
},
|
||||
// 轮播图切换时处理
|
||||
handleSwiperChange(e) {
|
||||
const current = e.detail.current;
|
||||
// 确保图表在切换时已初始化并重新绘制
|
||||
if (!this.charts[current]) {
|
||||
// 如果图表尚未初始化,则初始化它
|
||||
this.initChart(current);
|
||||
} else {
|
||||
// 否则重新调整大小
|
||||
this.charts[current].resize();
|
||||
}
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
// 页面卸载时销毁图表实例,释放资源
|
||||
this.charts.forEach(chart => {
|
||||
if (chart) {
|
||||
chart.dispose();
|
||||
}
|
||||
});
|
||||
this.charts = [];
|
||||
this.canvasElements = [];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -243,22 +331,6 @@ export default {
|
||||
padding: 30rpx;
|
||||
color: white;
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 20rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.logout-text {
|
||||
font-size: 24rpx;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
@@ -284,16 +356,15 @@ export default {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.account-id {
|
||||
font-size: 24rpx;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.account-summary {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.label{
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.total-assets {
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
@@ -391,30 +462,63 @@ export default {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.indices-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
/* 市场指数左右布局样式 */
|
||||
.indices-swiper {
|
||||
width: 100%;
|
||||
height: 300rpx; /* 调整高度适应左右布局 */
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.index-item {
|
||||
background-color: white;
|
||||
border-radius: 12rpx;
|
||||
padding: 20rpx;
|
||||
width: 48%;
|
||||
margin-bottom: 15rpx;
|
||||
padding: 25rpx;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 左右布局容器 */
|
||||
.index-content {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 左侧数据区域 - 占30%宽度 */
|
||||
.index-data {
|
||||
flex: 0 0 30%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding-right: 20rpx;
|
||||
border-right: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.index-name {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.index-value {
|
||||
font-size: 32rpx;
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
margin: 10rpx 0;
|
||||
display: block;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.index-change {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
/* 右侧图表区域 - 占70%宽度 */
|
||||
.chart-container {
|
||||
flex: 0 0 70%;
|
||||
padding-left: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.index-chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.news-list {
|
||||
@@ -455,4 +559,4 @@ export default {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -239,7 +239,7 @@ export default {
|
||||
this.isLoading = false
|
||||
|
||||
// 确保只跳转一次
|
||||
uni.redirectTo({
|
||||
uni.reLaunch({
|
||||
url: '/pages/home/index',
|
||||
success: () => {
|
||||
console.log('跳转成功')
|
||||
@@ -252,7 +252,7 @@ export default {
|
||||
},
|
||||
|
||||
navigateToRegister() {
|
||||
uni.redirectTo({ url: '/pages/register/register' })
|
||||
uni.navigateTo({ url: '/pages/register/register' })
|
||||
},
|
||||
|
||||
openAgreement(type) {
|
||||
@@ -393,11 +393,12 @@ export default {
|
||||
}
|
||||
|
||||
.app-title {
|
||||
font-size: 48rpx;
|
||||
font-size: 60rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
display: block;
|
||||
margin-bottom: 20rpx;
|
||||
margin-top: 60rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
@@ -471,6 +472,7 @@ export default {
|
||||
align-items: center;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
}
|
||||
|
||||
.remember-check {
|
||||
|
||||
270
src/pages/more/index.vue
Normal file
@@ -0,0 +1,270 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 顶部标题栏 -->
|
||||
<view class="header">
|
||||
<text class="title">设置</text>
|
||||
</view>
|
||||
|
||||
<!-- 顶部用户信息 -->
|
||||
<view class="user-info" @click="navigateTo('/pages/user/profile')">
|
||||
<view class="avatar">
|
||||
<image :src="userInfo.avatar || '/static/default-avatar.png'" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text class="name">{{userInfo.nickname || '未登录'}}</text>
|
||||
<text class="phone">{{userInfo.phone ? hidePhone(userInfo.phone) : '点击登录'}}</text>
|
||||
</view>
|
||||
<view class="arrow">
|
||||
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 功能列表 -->
|
||||
<view class="menu-list">
|
||||
<!-- 银行卡 -->
|
||||
<view class="menu-item" @click="navigateTo('/pages/user/bankCard')">
|
||||
<view class="item-left">
|
||||
<uni-icons type="wallet" size="20" color="#4a7dff"></uni-icons>
|
||||
<text class="text">我的银行卡</text>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<text class="tips" v-if="userInfo.bankCardCount > 0">{{userInfo.bankCardCount}}张</text>
|
||||
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 实名认证 -->
|
||||
<view class="menu-item" @click="navigateTo('/pages/user/realAuth')">
|
||||
<view class="item-left">
|
||||
<uni-icons type="person" size="20" color="#4a7dff"></uni-icons>
|
||||
<text class="text">实名认证</text>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<text class="tips" :style="{color: userInfo.authStatus === 1 ? '#4a7dff' : '#ff5a5f'}">
|
||||
{{authStatusText[userInfo.authStatus] || '未认证'}}
|
||||
</text>
|
||||
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 语言选择 -->
|
||||
<view class="menu-item" @click="navigateTo('/pages/user/language')">
|
||||
<view class="item-left">
|
||||
<uni-icons type="compose" size="20" color="#4a7dff"></uni-icons>
|
||||
<text class="text">语言设置</text>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<text class="tips">{{languageText[userInfo.language] || '简体中文'}}</text>
|
||||
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 设置 -->
|
||||
<view class="menu-item" @click="navigateTo('/pages/user/settings')">
|
||||
<view class="item-left">
|
||||
<uni-icons type="gear" size="20" color="#4a7dff"></uni-icons>
|
||||
<text class="text">系统设置</text>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退出登录按钮 -->
|
||||
<view class="logout-btn" @click="handleLogout" v-if="userInfo.isLogin">
|
||||
<text>退出登录</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: {
|
||||
avatar: '/static/avatar.jpg',
|
||||
nickname: '张三',
|
||||
phone: '13800138000',
|
||||
bankCardCount: 2,
|
||||
authStatus: 1, // 0-未认证 1-已认证 2-认证中 3-认证失败
|
||||
language: 'zh-CN',
|
||||
isLogin: true
|
||||
},
|
||||
authStatusText: {
|
||||
0: '未认证',
|
||||
1: '已认证',
|
||||
2: '认证中',
|
||||
3: '认证失败'
|
||||
},
|
||||
languageText: {
|
||||
'zh-CN': '简体中文',
|
||||
'en-US': 'English',
|
||||
'zh-TW': '繁體中文'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 隐藏手机号中间四位
|
||||
hidePhone(phone) {
|
||||
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
|
||||
},
|
||||
|
||||
// 路由跳转
|
||||
navigateTo(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
|
||||
// 退出登录
|
||||
handleLogout() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要退出登录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 这里调用退出登录接口
|
||||
uni.showLoading({
|
||||
title: '正在退出...'
|
||||
})
|
||||
|
||||
// 模拟退出登录
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
this.userInfo.isLogin = false
|
||||
this.userInfo.nickname = ''
|
||||
this.userInfo.phone = ''
|
||||
uni.showToast({
|
||||
title: '退出成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
// 跳转到登录页或其他页面
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 40rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.avatar {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
margin-right: 30rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.name {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.phone {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.arrow {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-list {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 100rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.item-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.text {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.tips {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
color: #ff5a5f;
|
||||
font-size: 32rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -475,11 +475,12 @@ export default {
|
||||
}
|
||||
|
||||
.app-title {
|
||||
font-size: 48rpx;
|
||||
font-size: 60rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
display: block;
|
||||
margin-bottom: 20rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.register-desc {
|
||||
@@ -577,7 +578,7 @@ export default {
|
||||
/* 协议勾选区域 */
|
||||
.agreement-check {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
padding: 20rpx 30rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
@@ -585,7 +586,6 @@ export default {
|
||||
.agree-checkbox {
|
||||
transform: scale(0.8);
|
||||
margin-right: 15rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.agree-text {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
|
||||
{
|
||||
|
||||
//登录
|
||||
"index.Loading": "加载中...",
|
||||
"index.errMsg": "加载失败",
|
||||
"login.loginButton": "登录",
|
||||
@@ -25,7 +27,7 @@
|
||||
"login.errors.invalidIdCard": "请输入正确身份证号码的后六位",
|
||||
"login.errors.emptyPassword": "请输入密码",
|
||||
|
||||
|
||||
//注册
|
||||
"register.chooseLanguage": "选择语言",
|
||||
"register.languagechangeclose": "完成",
|
||||
"register.appTitle": "欧洲股票软件",
|
||||
@@ -60,7 +62,12 @@
|
||||
"register.registerButton": "注 册",
|
||||
"register.hasAccount": "已有账号?",
|
||||
"register.loginNow": "立即登录",
|
||||
"register.registerSuccess": "注册成功"
|
||||
"register.registerSuccess": "注册成功",
|
||||
|
||||
|
||||
//首页
|
||||
"home.welcome":"欢迎",
|
||||
"home.totalAssets":"总资产"
|
||||
|
||||
|
||||
}
|
||||
BIN
src/static/pic/alert/bj.png
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
src/static/pic/alert/btn-bj.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
src/static/pic/alert/close.png
Normal file
|
After Width: | Height: | Size: 976 B |
BIN
src/static/pic/dayTrade/change_icon.png
Normal file
|
After Width: | Height: | Size: 783 B |
BIN
src/static/pic/dayTrade/dayTrade-2.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
src/static/pic/dayTrade/dayTrade-3.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
src/static/pic/dayTrade/dayTrade.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
src/static/pic/dayTrade/dog.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
BIN
src/static/pic/dayTrade/finish_hg.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
src/static/pic/dayTrade/finish_icon.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
src/static/pic/dayTrade/icon-card-2.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
src/static/pic/dayTrade/icon-card-3.png
Normal file
|
After Width: | Height: | Size: 279 KiB |
BIN
src/static/pic/dayTrade/icon-card.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
src/static/pic/dayTrade/line.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/static/pic/dayTrade/order_card.png
Normal file
|
After Width: | Height: | Size: 463 KiB |
BIN
src/static/pic/dayTrade/order_card_1.png
Normal file
|
After Width: | Height: | Size: 341 KiB |
BIN
src/static/pic/dayTrade/order_card_icon.png
Normal file
|
After Width: | Height: | Size: 308 KiB |
BIN
src/static/pic/dayTrade/record_icon.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
src/static/pic/dayTrade/record_icon_2.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
src/static/pic/dayTrade/record_icon_3.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/static/pic/dayTrade/rollout_icon.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
src/static/pic/dayTrade/rollout_icon_2.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/static/pic/dayTrade/rollout_icon_3.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/static/pic/dayTrade/success-2.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
src/static/pic/dayTrade/success.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
src/static/pic/dayTrade/wallet_icon.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/static/pic/dayTrade/wallet_icon_2.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
src/static/pic/dayTrade/wallet_icon_3.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/static/pic/dayTrade/watch.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
src/static/pic/fund/aifund-buy1.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/static/pic/fund/aifund-buy2.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/static/pic/fund/aifund-buy3.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
src/static/pic/fund/aifund-cover.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/static/pic/fund/dialog-back.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
src/static/pic/fund/fund-cover.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src/static/pic/fund/up.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
src/static/pic/home/banner-jk.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/static/pic/home/bg-01.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
src/static/pic/home/bg.png
Normal file
|
After Width: | Height: | Size: 166 KiB |
BIN
src/static/pic/home/fund-cz.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/static/pic/home/fund-top-back.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
src/static/pic/home/fund-zc.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/static/pic/home/fund-zjmx.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
src/static/pic/home/icn-01.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
src/static/pic/home/icn.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
src/static/pic/home/icon10-01.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/static/pic/home/icon10.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
src/static/pic/home/icon2.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
src/static/pic/home/icon201.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src/static/pic/home/icon3-01.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
src/static/pic/home/icon3.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/static/pic/home/icon4-01.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/static/pic/home/icon4.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/static/pic/home/icon5-01.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/static/pic/home/icon5.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
src/static/pic/home/icon6-01.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
src/static/pic/home/icon6.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/static/pic/home/icon7.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/static/pic/home/icon8-01.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/static/pic/home/icon8.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/static/pic/home/icon9.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/static/pic/home/jk-bottom.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
src/static/pic/home/jq-dialog-close.png
Normal file
|
After Width: | Height: | Size: 499 B |
BIN
src/static/pic/home/menu_09.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
src/static/pic/home/menu_10.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/static/pic/home/search.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/static/pic/home/stock-mx.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
src/static/pic/home/user.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
src/static/pic/home/you-jt.png
Normal file
|
After Width: | Height: | Size: 328 B |
BIN
src/static/pic/ico/bg-zhisu-red.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/static/pic/ico/bg-zhisu.png
Normal file
|
After Width: | Height: | Size: 160 KiB |
BIN
src/static/pic/ico/chongzhi.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/static/pic/ico/common/arrow-right.png
Normal file
|
After Width: | Height: | Size: 255 B |
BIN
src/static/pic/ico/common/avatar.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
src/static/pic/ico/common/back.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/static/pic/ico/common/dustbin.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/static/pic/ico/common/fangdajing.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src/static/pic/ico/common/fangdajing2.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/static/pic/ico/common/look-2.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/static/pic/ico/common/look.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/static/pic/ico/common/more.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/static/pic/ico/common/nolook.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/static/pic/ico/common/set_market.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
src/static/pic/ico/common/xinghao.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/static/pic/ico/customer.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/static/pic/ico/die.png
Normal file
|
After Width: | Height: | Size: 973 B |
BIN
src/static/pic/ico/fangdajing.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/static/pic/ico/gaimima.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/static/pic/ico/gengduo-red.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/static/pic/ico/gengduo.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/static/pic/ico/guani-red.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/static/pic/ico/guani.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |