Browse Source

修改选股策略手机模拟器滚动和颜色修改

dongqian/feature-20251022181325-deepmate简版
dongqian 4 weeks ago
parent
commit
b171b88fac
  1. 7
      pages/deepExploration/deepExploration.vue
  2. 10
      pages/deepExploration/stockSelectDetail.vue

7
pages/deepExploration/deepExploration.vue

@ -284,8 +284,11 @@ const searchStock = () => {
<style scoped lang="scss">
.main {
width: 100%;
height: 100vh;
min-height: 100vh; //
height: auto; //
overflow-y: auto; //
background-color: #fff;
padding-bottom: 120rpx; //
.search {
position: relative;
@ -518,6 +521,8 @@ const searchStock = () => {
.static-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
}

10
pages/deepExploration/stockSelectDetail.vue

@ -122,6 +122,8 @@
const sign = num > 0 ? '+' : ''
return `${sign}${num.toFixed(2)}%`
}
// ( pctChg )
const sortByPctDesc = (arr) => arr.sort((a, b) => (Number(b.pctChg) || -Infinity) - (Number(a.pctChg) || -Infinity))
// ///
const loadByName = async (apiName) => {
@ -146,6 +148,8 @@
if ((!Array.isArray(list) || !list.length) && Array.isArray(raw)) {
list = raw
}
//
if (Array.isArray(list)) list = sortByPctDesc(list)
if (Array.isArray(list) && list.length) {
strategyData.value = list.map(item => ({
name: item.tsCode ?? item.tscode ?? '',
@ -191,6 +195,8 @@
const arrays = Object.values(raw).filter(Array.isArray)
if (arrays.length) list = arrays.flat()
}
//
if (Array.isArray(list)) list = sortByPctDesc(list)
if (Array.isArray(list) && list.length) {
strategyData.value = list.map(item => ({
name: item.tsCode ?? item.tscode ?? '',
@ -205,7 +211,7 @@
highestPrice: item.high ?? '',
lowestPrice: item.low ?? ''
}))
console.log('stockSelectDetail 加载成功,条数:', strategyData.value.length, '首项:', strategyData.value[0])
console.log('stockSelectDetail 加载成功(已按涨幅降序),条数:', strategyData.value.length, '首项:', strategyData.value[0])
} else {
console.warn('stockSelectDetail 接口返回空列表或结构不匹配', raw)
}
@ -262,7 +268,7 @@
.tableContent {
width: 100%;
background-color: #fff;
position: relative;
.showAll {

Loading…
Cancel
Save