14 Commits

Author SHA1 Message Date
ZhangYong 0546fcbfb0 跳转问题 3 weeks ago
ZhangYong 8d27e32da1 Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into milestone-20251031-简版功能开发 3 weeks ago
lihui 4f232b233e Merge branch 'refs/heads/lihuilin/feature-20251024095243-我的' into milestone-20251031-简版功能开发 3 weeks ago
lihui ffb3c13093 fix:登录也无法点击分享 3 weeks ago
lihuilin aaf6bd62bc 修改个人信息 3 weeks ago
lihui 59091f14f2 Merge remote-tracking branch 'origin/lihuilin/feature-20251024095243-我的' into lihuilin/feature-20251024095243-我的 3 weeks ago
lihuilin 08e4c415b5 个人信息修改 3 weeks ago
hongxilin 9d4682267c Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into hongxilin/feature-20251023103318-行情数据及页面 3 weeks ago
hongxilin d6e20a1ec5 加入loading动画,修改marketDetail页面数据加载函数作用生命周期 3 weeks ago
ZhangYong e107af4e1c Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into milestone-20251031-简版功能开发 3 weeks ago
ZhangYong 29078a9058 横屏适配 3 weeks ago
ZhangYong b840b569ba Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into milestone-20251031-简版功能开发 3 weeks ago
ZhangYong 38c9d774c1 横屏适配 3 weeks ago
hongxilin f440802c59 股票卡片加缩略分时图 3 weeks ago
  1. 11
      api/member.js
  2. 53
      components/IndexCard.vue
  3. 54
      components/h-loading.vue
  4. 157
      pages/deepExploration/MainForceActions.vue
  5. 68
      pages/home/member.vue
  6. 8
      pages/marketSituation/globalIndex.vue
  7. 29
      pages/marketSituation/marketDetail.vue
  8. 32
      pages/marketSituation/marketOverview.vue
  9. 6
      pages/setting/about.vue
  10. 16
      pages/setting/account.vue
  11. 4
      pages/setting/bind.vue
  12. 6
      pages/setting/createPwd.vue
  13. 20
      pages/setting/email.vue
  14. 10
      pages/setting/general.vue
  15. 32
      pages/setting/market.vue
  16. 2
      pages/setting/password.vue
  17. BIN
      static/loading-gif.gif
  18. BIN
      static/marketSituation-image/downTimeChart.png
  19. BIN
      static/marketSituation-image/upTimeChart.png
  20. BIN
      static/my/Check-in.png
  21. BIN
      static/my/MarketSettings.png
  22. BIN
      static/my/Settings.png
  23. BIN
      static/my/aboutDC.png
  24. BIN
      static/my/bell.png
  25. BIN
      static/my/common.png
  26. BIN
      static/my/default-avatar.png
  27. BIN
      static/my/editName.png
  28. BIN
      static/my/outline.png
  29. BIN
      static/my/polylines.png
  30. BIN
      static/my/security.png
  31. BIN
      static/my/share.png

11
api/member.js

@ -29,9 +29,14 @@ export const getUserInfo = (data) => {
return http({ return http({
method: 'POST', method: 'POST',
url: '/api/my/userInfo', 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
}) })
} }

53
components/IndexCard.vue

@ -18,9 +18,8 @@
</view> </view>
<view class="chart-container"> <view class="chart-container">
<view class="mini-chart" :style="{ backgroundColor: chartBgColor }">
<!-- 这里可以放置实际的图表组件目前用简单的波浪线表示 -->
<view class="chart-line" :style="{ borderColor: priceColor }"></view>
<view class="mini-chart" >
<image class="time-chart" :src="timeChart" mode="aspectFit"></image>
</view> </view>
</view> </view>
</view> </view>
@ -97,10 +96,14 @@ const priceColor = computed(() => {
return props.isRising ? "#00C853" : "#FF1744"; return props.isRising ? "#00C853" : "#FF1744";
}); });
//
const chartBgColor = computed(() => {
return props.isRising ? "#E8F5E8" : "#FFEBEE";
const timeChart = computed(() => {
return props.isRising ? "/static/marketSituation-image/upTimeChart.png" : "/static/marketSituation-image/downTimeChart.png";
}); });
//
// const chartBgColor = computed(() => {
// return props.isRising ? "#E8F5E8" : "#FFEBEE";
// });
</script> </script>
<style scoped> <style scoped>
@ -182,40 +185,8 @@ const chartBgColor = computed(() => {
border-radius: 8rpx; border-radius: 8rpx;
} }
.chart-line {
position: absolute;
bottom: 20rpx;
left: 10rpx;
right: 10rpx;
height: 2rpx;
border-top: 2rpx solid;
border-style: solid;
}
/* 添加一些波浪效果 */
.chart-line::before {
content: "";
position: absolute;
top: -10rpx;
left: 20%;
width: 20rpx;
height: 20rpx;
border: 2rpx solid;
border-color: inherit;
border-radius: 50%;
background: transparent;
}
.chart-line::after {
content: "";
position: absolute;
top: -6rpx;
right: 30%;
width: 12rpx;
height: 12rpx;
border: 2rpx solid;
border-color: inherit;
border-radius: 50%;
background: transparent;
.time-chart {
width: 100%;
height: 100%;
} }
</style> </style>

54
components/h-loading.vue

@ -0,0 +1,54 @@
<!-- @format -->
<template>
<view v-if="loading" class="loading">
<image class="loadingGif" src="/static/loading-gif.gif" mode=""></image>
</view>
</template>
<script setup>
import { ref, computed, onMounted,watch } from "vue";
// props
const props = defineProps({
loading: {
type: Boolean,
default: false,
},
});
const loading = ref(false);
// props.loading
watch(() => props.loading, (newVal) => {
loading.value = newVal;
});
//
onMounted(() => {
loading.value = props.loading;
});
</script>
<style scoped>
.loading {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
}
.loadingGif {
width: 100rpx;
height: 100rpx;
}
</style>

157
pages/deepExploration/MainForceActions.vue

@ -41,7 +41,30 @@
<qiun-data-charts type="candle" :opts="opts" :chartData="chartData" :disableScroll="true" <qiun-data-charts type="candle" :opts="opts" :chartData="chartData" :disableScroll="true"
:ontouch="true" :onzoom="true" :key="chartKey" /> :ontouch="true" :onzoom="true" :key="chartKey" />
</view> </view>
<image src="/static/deepExploration-images/kLineAll.png" mode="aspectFill"></image>
<image @click.stop="showFullscreenKline" src="/static/deepExploration-images/kLineAll.png"
mode="aspectFill"></image>
</view>
</view>
<!-- 全屏横屏弹窗 -->
<view class="fullscreen-mask" v-if="isFullscreen" @click="closeFullscreen">
<view class="fullscreen-container" :style="{ transform: isLandscape ? 'rotate(90deg)' : '' }">
<!-- 关闭按钮 -->
<view class="fullscreen-close" @click.stop="closeFullscreen">
<image src="/static/icons/close.png" mode="widthFix"></image>
</view>
<!-- 横屏切换按钮 -->
<view class="fullscreen-rotate" @click.stop="toggleOrientation">
<image src="/static/icons/rotate.png" mode="widthFix"></image>
</view>
<!-- 全屏K线图 -->
<view class="fullscreen-chart">
<qiun-data-charts type="candle" :opts="fullscreenOpts" :chartData="chartData"
:key="fullscreenChartKey" />
</view>
</view> </view>
</view> </view>
<view class="txt"> <view class="txt">
@ -107,6 +130,37 @@
//ref //ref
const loginPrompt = ref(null) const loginPrompt = ref(null)
//
const isFullscreen = ref(false); //
const isLandscape = ref(true); //
const fullscreenChartKey = ref(0); //
// K线
const showFullscreenKline = () => {
isFullscreen.value = true;
isLandscape.value = true; //
//
setTimeout(() => {
fullscreenChartKey.value++;
}, 100);
};
//
const closeFullscreen = () => {
isFullscreen.value = false;
};
//
const toggleOrientation = () => {
isLandscape.value = !isLandscape.value;
//
setTimeout(() => {
fullscreenChartKey.value++;
}, 300);
};
// //
const type = ref('deepExploration') const type = ref('deepExploration')
const iSMT = ref(0) const iSMT = ref(0)
@ -495,6 +549,28 @@
} }
}) })
//
const fullscreenOpts = ref({
...opts.value, //
padding: [30, 30, 30, 30],
xAxis: {
...opts.value.xAxis,
labelCount: 8, //
fontSize: 12
},
yAxis: {
...opts.value.yAxis,
fontSize: 12
},
extra: {
...opts.value.extra,
candle: {
...opts.value.extra.candle,
width: 12 // K线
}
}
});
// 2. K线 // 2. K线
const chartData = ref({ const chartData = ref({
categories: [], categories: [],
@ -548,6 +624,7 @@
let unwatch = null; let unwatch = null;
// onReady // onReady
onMounted(async () => { onMounted(async () => {
iSMT.value = uni.getSystemInfoSync().statusBarHeight iSMT.value = uni.getSystemInfoSync().statusBarHeight
getUserInfo() getUserInfo()
await handleModels() await handleModels()
@ -571,7 +648,8 @@
//k线 //k线
if (historyData.value.stockData.chartData.categories.length > 1) { // if (historyData.value.stockData.chartData.categories.length > 1) { //
historyData.value.stockData.chartData.categories[historyData.value.stockData.chartData.categories.length - 1] = ''; //
historyData.value.stockData.chartData.categories[historyData.value.stockData.chartData
.categories.length - 1] = ''; //
} }
chartData.value = { chartData.value = {
...JSON.parse(JSON.stringify(historyData.value.stockData.chartData)) ...JSON.parse(JSON.stringify(historyData.value.stockData.chartData))
@ -597,7 +675,7 @@
// //
onLoad((e) => { onLoad((e) => {
if (e.index) { if (e.index) {
// currentIndex.value = e.index - 1
currentIndex.value = e.index - 1
console.log('模块:', currentIndex.value) console.log('模块:', currentIndex.value)
} }
if (e.stockName) { if (e.stockName) {
@ -787,6 +865,79 @@
} }
} }
/* 横屏按钮样式 */
.rotate-btn {
background: transparent;
padding: 0 10rpx;
margin-left: 15rpx;
.btn-icon {
width: 36rpx;
height: 36rpx;
vertical-align: middle;
}
}
/* 全屏遮罩 */
.fullscreen-mask {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: #000;
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
}
/* 全屏容器 */
.fullscreen-container {
width: 100vh; /* 横屏时宽度等于屏幕高度 */
height: 100vw; /* 横屏时高度等于屏幕宽度 */
transition: transform 0.3s ease;
position: relative;
}
/* 关闭按钮 */
.fullscreen-close {
position: absolute;
top: 20rpx;
right: 20rpx;
z-index: 10;
image {
width: 48rpx;
height: 48rpx;
}
}
/* 旋转按钮 */
.fullscreen-rotate {
position: absolute;
top: 20rpx;
left: 20rpx;
z-index: 10;
image {
width: 48rpx;
height: 48rpx;
}
}
/* 全屏图表容器 */
.fullscreen-chart {
width: 100%;
height: 100%;
}
/* 竖屏模式适配 */
:deep(.fullscreen-container:not([style*="rotate(90deg)"])) {
width: 100vw;
height: 100vh;
}
.txt { .txt {
background-color: #F3F3F3; background-color: #F3F3F3;
margin-top: 48rpx; margin-top: 48rpx;

68
pages/home/member.vue

@ -1,18 +1,26 @@
<template> <template>
<LoginPrompt ref="loginwPrompt"></LoginPrompt>
<LoginPrompt ref="loginPrompt"></LoginPrompt>
<view class="main"> <view class="main">
<view class="top"> <view class="top">
<view class="bell"> <view class="bell">
<image class="image-bell" src="/static/my/bell.png"></image>
<!-- <image class="image-bell" src="/static/my/bell.png" /> -->
</view> </view>
<view class="msg"> <view class="msg">
<view class="msg-left"> <view class="msg-left">
<view class="avatar"></view>
<image class="avatar"
:src="avatarUrl || 'https://d31zlh4on95l9h.cloudfront.net/default/1961d9d2e31e78e47e885231e7514a35.png'"
mode="aspectFill" />
</view> </view>
<view class=" msg-center"> <view class=" msg-center">
<view style="display: flex;"> <view style="display: flex;">
<template v-if="!isEditingName">
<view class="userInfo">{{ username }}</view> <view class="userInfo">{{ username }}</view>
<image class="image-editName" src="/static/my/editName.png"></image>
<image class="image-editName" src="/static/my/editName.png" @click="startEditName" />
</template>
<template v-else>
<input v-model="editingName" class="edit-input" @blur="finishEditName"
@keyup.enter="finishEditName" autofocus placeholder="请输入用户名" />
</template>
</view> </view>
<view class="userId">ID:{{ dccode }}</view> <view class="userId">ID:{{ dccode }}</view>
</view> </view>
@ -43,7 +51,7 @@
<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" />
@ -60,7 +68,7 @@
<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>
@ -80,23 +88,60 @@ import {
ArrowRight ArrowRight
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import footerBar from '../../components/footerBar.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 userStore = useUserStore()
const type = ref('member') const type = ref('member')
const iSMT = ref(0) const iSMT = ref(0)
const username = ref('') const username = ref('')
const dccode = ref('') const dccode = ref('')
const avatarUrl = ref('')
const isEditingName = ref(false)
const editingName = ref('')
const userInfoRes = ref() // const userInfoRes = ref() //
userInfoRes.value = getUserInfo() userInfoRes.value = getUserInfo()
userInfoRes.value.then(res => { userInfoRes.value.then(res => {
username.value = res.data.dcname username.value = res.data.dcname
dccode.value = res.data.dccode dccode.value = res.data.dccode
avatarUrl.value = res.data.avatar
console.log('用户信息', userInfoRes.value) 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 = () => { const goToGeneral = () => {
uni.navigateTo({ uni.navigateTo({
@ -204,7 +249,8 @@ onMounted(() => {
} }
.userInfo { .userInfo {
font-size: 20px;
font-size: 30rpx;
font-weight: bold;
} }
.userId { .userId {
@ -314,4 +360,8 @@ onMounted(() => {
background-color: red; background-color: red;
margin-left: 10rpx; margin-left: 10rpx;
} }
.edit-input {
background-color: #999;
}
</style> </style>

8
pages/marketSituation/globalIndex.vue

@ -2,6 +2,8 @@
<template> <template>
<view class="main"> <view class="main">
<!-- 加载中 -->
<h-loading :loading="loading"></h-loading>
<!-- 固定头部 --> <!-- 固定头部 -->
<view class="header_fixed" :style="{ top: iSMT + 'px' }"> <view class="header_fixed" :style="{ top: iSMT + 'px' }">
<view class="header_content"> <view class="header_content">
@ -69,6 +71,7 @@ import { ref, onMounted, onUnmounted, computed, nextTick, watch } from "vue";
import { onShow, onHide } from "@dcloudio/uni-app"; import { onShow, onHide } from "@dcloudio/uni-app";
import footerBar from "../../components/footerBar.vue"; import footerBar from "../../components/footerBar.vue";
import IndexCard from "../../components/IndexCard.vue"; import IndexCard from "../../components/IndexCard.vue";
import hLoading from "@/components/h-loading.vue";
import { getRegionalGroupAPI } from "../../api/marketSituation/marketSituation.js"; import { getRegionalGroupAPI } from "../../api/marketSituation/marketSituation.js";
import { useMarketSituationStore } from "../../stores/modules/marketSituation.js"; import { useMarketSituationStore } from "../../stores/modules/marketSituation.js";
const marketSituationStore = useMarketSituationStore(); const marketSituationStore = useMarketSituationStore();
@ -78,7 +81,7 @@ const contentHeight = ref(0);
const headerHeight = ref(0); // const headerHeight = ref(0); //
const searchValue = ref(""); // const searchValue = ref(""); //
const isWarnTextOverflow = ref(false); // warn const isWarnTextOverflow = ref(false); // warn
const loading = ref(false);
// //
const isDataLoaded = ref(false); const isDataLoaded = ref(false);
@ -160,11 +163,14 @@ const viewIndexDetail = (item, parentIndex, index) => {
const getRegionalGroup = async () => { const getRegionalGroup = async () => {
try { try {
loading.value = true;
const result = await getRegionalGroupAPI(); const result = await getRegionalGroupAPI();
globalIndexArray.value = result.data; globalIndexArray.value = result.data;
marketSituationStore.gloablCardData = result.data; marketSituationStore.gloablCardData = result.data;
loading.value = false;
} catch (e) { } catch (e) {
console.log("获取区域指数失败", e); console.log("获取区域指数失败", e);
loading.value = false;
} }
}; };

29
pages/marketSituation/marketDetail.vue

@ -2,6 +2,8 @@
<template> <template>
<view class="main"> <view class="main">
<!-- 加载中 -->
<h-loading :loading="loading"></h-loading>
<!-- 自定义导航栏 --> <!-- 自定义导航栏 -->
<view class="header_fixed" :style="{ top: iSMT + 'px' }"> <view class="header_fixed" :style="{ top: iSMT + 'px' }">
<view class="header-content"> <view class="header-content">
@ -65,8 +67,9 @@
<script setup> <script setup>
import { ref, computed, onMounted, onUnmounted, nextTick, watch } from "vue"; import { ref, computed, onMounted, onUnmounted, nextTick, watch } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { onLoad, onShow, onHide } from "@dcloudio/uni-app";
import footerBar from "@/components/footerBar.vue"; import footerBar from "@/components/footerBar.vue";
import hLoading from "@/components/h-loading.vue";
import { getRegionalGroupListAPI } from "../../api/marketSituation/marketSituation.js"; import { getRegionalGroupListAPI } from "../../api/marketSituation/marketSituation.js";
import { useMarketSituationStore } from "../../stores/modules/marketSituation.js"; import { useMarketSituationStore } from "../../stores/modules/marketSituation.js";
const marketSituationStore = useMarketSituationStore(); const marketSituationStore = useMarketSituationStore();
@ -77,7 +80,7 @@ const headerHeight = ref(80);
const marketTitle = ref(); const marketTitle = ref();
const sortType = ref(""); // 'price' 'change' const sortType = ref(""); // 'price' 'change'
const sortOrder = ref("desc"); // 'asc' 'desc' const sortOrder = ref("desc"); // 'asc' 'desc'
const loading = ref(false);
const regionalGroupArray = ref([]); const regionalGroupArray = ref([]);
// //
@ -111,13 +114,16 @@ const judgeSymbol = (num) => {
const getRegionalGroupList = async () => { const getRegionalGroupList = async () => {
try { try {
loading.value = true;
const result = await getRegionalGroupListAPI({ const result = await getRegionalGroupListAPI({
name: marketTitle.value, name: marketTitle.value,
}); });
regionalGroupArray.value = result.data; regionalGroupArray.value = result.data;
marketSituationStore.marketDetailCardData = result.data; marketSituationStore.marketDetailCardData = result.data;
loading.value = false;
} catch (e) { } catch (e) {
console.error("获取区域分组列表失败:", e); console.error("获取区域分组列表失败:", e);
loading.value = false;
} }
}; };
@ -430,15 +436,26 @@ const startTcp = () => {
} }
}; };
//
onLoad(async (options) => {
if (options && options.market) {
marketTitle.value = options.market;
onShow(async () => {
console.log("显示页面");
await getRegionalGroupList(); await getRegionalGroupList();
initTcpListeners(); initTcpListeners();
await nextTick(); await nextTick();
// //
startTcp(); startTcp();
});
onHide(() => {
console.log("隐藏页面");
sendTcpMessage("stop_real_time");
removeTcpListeners();
disconnectTcp();
});
//
onLoad(async (options) => {
if (options && options.market) {
marketTitle.value = options.market;
} }
}); });

32
pages/marketSituation/marketOverview.vue

@ -2,14 +2,23 @@
<template> <template>
<view class="main"> <view class="main">
<h-loading :loading="loading"></h-loading>
<!-- 可滚动内容区域 --> <!-- 可滚动内容区域 -->
<scroll-view class="content_scroll" scroll-y="true" :style="{ top: contentTopPosition + 'px' }"> <scroll-view class="content_scroll" scroll-y="true" :style="{ top: contentTopPosition + 'px' }">
<view class="content"> <view class="content">
<view class="map"> <view class="map">
<view class="INDU">道琼斯<view :class="getSignClass(INDU.value)">{{ judgeSymbol(INDU.value) }}</view></view>
<view class="NDX">纳斯达克<view :class="getSignClass(NDX.value)">{{ judgeSymbol(NDX.value) }}</view></view>
<view class="HSI">恒生指数<view :class="getSignClass(HSI.value)">{{ judgeSymbol(HSI.value) }}</view></view>
<view class="CN">上证指数<view :class="getSignClass(CN.value)">{{ judgeSymbol(CN.value) }}</view></view>
<view class="INDU"
>道琼斯<view :class="getSignClass(INDU.value)">{{ judgeSymbol(INDU.value) }}</view></view
>
<view class="NDX"
>纳斯达克<view :class="getSignClass(NDX.value)">{{ judgeSymbol(NDX.value) }}</view></view
>
<view class="HSI"
>恒生指数<view :class="getSignClass(HSI.value)">{{ judgeSymbol(HSI.value) }}</view></view
>
<view class="CN"
>上证指数<view :class="getSignClass(CN.value)">{{ judgeSymbol(CN.value) }}</view></view
>
<image src="/static/marketSituation-image/map.png" mode="widthFix"></image> <image src="/static/marketSituation-image/map.png" mode="widthFix"></image>
</view> </view>
<view class="global_index"> <view class="global_index">
@ -54,6 +63,7 @@ import { ref, onMounted, onUnmounted, watch, nextTick, computed } from "vue";
import { onShow, onHide } from "@dcloudio/uni-app"; import { onShow, onHide } from "@dcloudio/uni-app";
import util from "../../common/util.js"; import util from "../../common/util.js";
import IndexCard from "../../components/IndexCard.vue"; import IndexCard from "../../components/IndexCard.vue";
import hLoading from "@/components/h-loading.vue";
import { useMarketSituationStore } from "../../stores/modules/marketSituation.js"; import { useMarketSituationStore } from "../../stores/modules/marketSituation.js";
const marketSituationStore = useMarketSituationStore(); const marketSituationStore = useMarketSituationStore();
import { getGlobalIndexAPI } from "../../api/marketSituation/marketSituation.js"; import { getGlobalIndexAPI } from "../../api/marketSituation/marketSituation.js";
@ -63,6 +73,7 @@ const searchValue = ref("");
const contentHeight = ref(0); const contentHeight = ref(0);
const headerHeight = ref(0); // header const headerHeight = ref(0); // header
const isWarnTextOverflow = ref(false); // warn const isWarnTextOverflow = ref(false); // warn
const loading = ref(false);
const INDU = ref({ stockName: "道琼斯", stockCode: "INDU", value: "" }); const INDU = ref({ stockName: "道琼斯", stockCode: "INDU", value: "" });
const NDX = ref({ stockName: "纳斯达克", stockCode: "513300", value: "" }); const NDX = ref({ stockName: "纳斯达克", stockCode: "513300", value: "" });
@ -91,13 +102,13 @@ const judgeSymbol = (num) => {
}; };
function getSignClass(value) { function getSignClass(value) {
const s = typeof value === 'string' ? value : String(value ?? '');
const s = typeof value === "string" ? value : String(value ?? "");
const trimmed = s.trim(); const trimmed = s.trim();
if (trimmed.startsWith('-')) return 'index-down';
if (trimmed.startsWith('+')) return 'index-up';
if (trimmed.startsWith("-")) return "index-down";
if (trimmed.startsWith("+")) return "index-up";
const n = parseFloat(trimmed); const n = parseFloat(trimmed);
if (!isNaN(n)) return n >= 0 ? 'index-up' : 'index-down';
return '';
if (!isNaN(n)) return n >= 0 ? "index-up" : "index-down";
return "";
} }
// //
@ -185,10 +196,13 @@ const goToGlobalIndex = () => {
const getGlobalIndex = async () => { const getGlobalIndex = async () => {
try { try {
loading.value = true;
const result = await getGlobalIndexAPI(); const result = await getGlobalIndexAPI();
globalIndexArray.value = result.data; globalIndexArray.value = result.data;
loading.value = false;
} catch (e) { } catch (e) {
console.log("获取全球指数失败", e); console.log("获取全球指数失败", e);
loading.value = false;
} }
}; };

6
pages/setting/about.vue

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

16
pages/setting/account.vue

@ -8,15 +8,15 @@
<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">
<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> </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">{{ userInfoRes.dcname }}</text> <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> </view>
<view class="setting-item"> <view class="setting-item">
@ -33,7 +33,7 @@
</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"></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>
@ -77,13 +77,15 @@
// const dccode = ref('') // const dccode = ref('')
const userInfoRes = ref({}) const userInfoRes = ref({})
const showLogout = ref(false) const showLogout = ref(false)
const avatarUrl = ref('')
const userInfoPromise = getUserInfo() const userInfoPromise = getUserInfo()
userInfoPromise.then(res => { userInfoPromise.then(res => {
if (res.code === 200) { 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) console.log('用户信息', userInfoRes.value)
} else { } else {
uni.showToast({ uni.showToast({

4
pages/setting/bind.vue

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

6
pages/setting/createPwd.vue

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

20
pages/setting/email.vue

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

10
pages/setting/general.vue

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

32
pages/setting/market.vue

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

2
pages/setting/password.vue

@ -4,7 +4,7 @@
<view class="tab"> <view class="tab">
<view class="tab-item" :class="{active: activeTab === 'email'}" @click="activeTab = 'email'">邮箱</view> <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>
<view class="switch-tab"> <view class="switch-tab">

BIN
static/loading-gif.gif

After

Width: 120  |  Height: 120  |  Size: 134 KiB

BIN
static/marketSituation-image/downTimeChart.png

After

Width: 160  |  Height: 62  |  Size: 8.4 KiB

BIN
static/marketSituation-image/upTimeChart.png

After

Width: 160  |  Height: 62  |  Size: 9.1 KiB

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