Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
华
华夏模拟理财_20250701
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
华夏模拟理财_20250701
Commits
fb49a7d9
Commit
fb49a7d9
authored
Jul 07, 2025
by
俞嘉婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 产品列表回显
parent
b3a3612c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
16 deletions
+26
-16
main.ts
mock/main.ts
+9
-6
HomePage.tsx
src/pages/HomePage/HomePage.tsx
+14
-10
store.ts
src/store/store.ts
+3
-0
No files found.
mock/main.ts
View file @
fb49a7d9
...
@@ -113,15 +113,18 @@ export default [
...
@@ -113,15 +113,18 @@ export default [
"baiFenBiText"
:
"90%活动用户选购本产品t"
,
"baiFenBiText"
:
"90%活动用户选购本产品t"
,
"fengXian"
:
"中低风险"
,
"fengXian"
:
"中低风险"
,
"code"
:
"23112008P"
,
"code"
:
"23112008P"
,
"status"
:
index
%
2
===
0
?
'1'
:
'0'
,
"status"
:
(
index
+
1
)
%
2
===
0
?
'1'
:
'0'
,
"realBuyJumpUrl"
:
`https://www.baidu.com?t=
${
index
}
`
"mineProduct"
:
(
index
+
1
)
%
3
===
0
,
"realBuyJumpUrl"
:
`https://www.baidu.com?t=
${(
index
+
1
)}
`
,
"rate"
:
502
,
// 利率(需要除100展示)
"rateName"
:
`年化收益率
${
index
+
1
}
`
,
// 利率名称
}
}
}),
}),
"codeList"
:
[
"codeList"
:
[
"23112008P"
,
{
code
:
"23112008P"
,
type
:
0
}
,
"consectetur"
,
{
code
:
"consectetur"
,
type
:
1
}
,
"non"
,
{
code
:
"non"
,
type
:
1
}
,
"tempor"
{
code
:
"tempor"
,
type
:
1
},
],
],
}
}
}
}
...
...
src/pages/HomePage/HomePage.tsx
View file @
fb49a7d9
...
@@ -116,6 +116,13 @@ class HomePage extends React.Component<any, any> {
...
@@ -116,6 +116,13 @@ class HomePage extends React.Component<any, any> {
const
{
curTab
}
=
this
.
state
;
const
{
curTab
}
=
this
.
state
;
const
{
bigStartConfig
,
virtualAssets
,
checkIn
,
recommendProductConfig
,
myEndTime
,
currentTime
}
=
store
.
indexData
const
{
bigStartConfig
,
virtualAssets
,
checkIn
,
recommendProductConfig
,
myEndTime
,
currentTime
}
=
store
.
indexData
const
isReachEndT
=
myEndTime
<=
currentTime
const
isReachEndT
=
myEndTime
<=
currentTime
// 推荐产品
const
rProductList
=
recommendProductConfig
?.
filter
((
item
)
=>
item
.
status
==
1
)
// 我的持仓
const
mProductList
=
recommendProductConfig
?.
filter
((
item
)
=>
item
.
mineProduct
)
// 当前tab的产品列表
const
curTabProductList
=
curTab
==
1
?
recommendProductConfig
:
mProductList
return
(
return
(
<
div
className=
"com_Container"
ref=
{
(
el
)
=>
this
.
root
=
el
}
>
<
div
className=
"com_Container"
ref=
{
(
el
)
=>
this
.
root
=
el
}
>
<
div
className=
"homePage"
>
<
div
className=
"homePage"
>
...
@@ -134,7 +141,7 @@ class HomePage extends React.Component<any, any> {
...
@@ -134,7 +141,7 @@ class HomePage extends React.Component<any, any> {
</
div
>
</
div
>
</
div
>
}
</
div
>
}
{
/* 领奖banner */
}
{
/* 领奖banner */
}
{
isReachEndT
&&
<
div
className=
"prize_banner"
>
{
isReachEndT
&&
<
div
className=
"prize_banner"
>
<
span
className=
"prize_btn"
onClick=
{
this
.
prizeHandle
}
></
span
>
<
span
className=
"prize_btn"
onClick=
{
this
.
prizeHandle
}
></
span
>
</
div
>
}
</
div
>
}
{
/* 模拟资产 */
}
{
/* 模拟资产 */
}
...
@@ -198,7 +205,7 @@ class HomePage extends React.Component<any, any> {
...
@@ -198,7 +205,7 @@ class HomePage extends React.Component<any, any> {
<
div
className=
"recommend_products"
>
<
div
className=
"recommend_products"
>
<
span
className=
"r_products_title"
></
span
>
<
span
className=
"r_products_title"
></
span
>
<
div
className=
"r_products_list"
>
<
div
className=
"r_products_list"
>
{
r
ecommendProductConfig
?.
map
((
item
,
index
)
=>
(
{
r
ProductList
?.
map
((
item
,
index
)
=>
(
<
div
className=
"r_products_item"
key=
{
`r_prdct_${index}`
}
>
<
div
className=
"r_products_item"
key=
{
`r_prdct_${index}`
}
>
<
span
className=
"r_product_bg"
></
span
>
<
span
className=
"r_product_bg"
></
span
>
<
span
className=
"r_product_name"
>
{
item
.
name
}
</
span
>
<
span
className=
"r_product_name"
>
{
item
.
name
}
</
span
>
...
@@ -218,26 +225,23 @@ class HomePage extends React.Component<any, any> {
...
@@ -218,26 +225,23 @@ class HomePage extends React.Component<any, any> {
<
span
className=
"tab1_btn"
onClick=
{
()
=>
this
.
toggleTab
(
1
)
}
></
span
>
<
span
className=
"tab1_btn"
onClick=
{
()
=>
this
.
toggleTab
(
1
)
}
></
span
>
<
span
className=
"tab2_btn"
onClick=
{
()
=>
this
.
toggleTab
(
2
)
}
></
span
>
<
span
className=
"tab2_btn"
onClick=
{
()
=>
this
.
toggleTab
(
2
)
}
></
span
>
<
div
className=
"products_list"
>
<
div
className=
"products_list"
>
{
/* TODO 字段 */
}
{
curTabProductList
?.
map
((
item
,
index
)
=>
(
{
recommendProductConfig
?.
map
((
item
,
index
)
=>
(
<
div
className=
"b_product_item"
key=
{
`r_prdct_${index}`
}
onClick=
{
()
=>
this
.
jumpRealDetailHandle
(
item
.
realBuyJumpUrl
)
}
>
<
div
className=
"b_product_item"
key=
{
`r_prdct_${index}`
}
onClick=
{
()
=>
this
.
jumpRealDetailHandle
(
item
.
realBuyJumpUrl
)
}
>
<
span
className=
"b_product_name"
>
{
item
.
name
}
</
span
>
<
span
className=
"b_product_name"
>
{
item
.
name
}
</
span
>
<
div
className=
"b_product_rate"
>
<
div
className=
"b_product_rate"
>
<
span
className=
"b_product_rate_label"
>
年化收益率
</
span
>
<
span
className=
"b_product_rate_value"
>
{
(
item
.
rate
/
100
).
toFixed
(
2
)
}
%
</
span
>
{
/* TODO */
}
<
span
className=
"b_product_rate_label"
>
{
item
.
rateName
}
</
span
>
<
span
className=
"b_product_rate_value"
>
1.97%
</
span
>
</
div
>
</
div
>
<
div
className=
"b_product_shu"
>
<
div
className=
"b_product_shu"
>
<
span
className=
"b_product_shu_label"
>
{
item
.
fengXian
}
|
{
item
.
qigouText
}
</
span
>
<
span
className=
"b_product_shu_value"
>
{
item
.
shenShuGuiZei
}
</
span
>
<
span
className=
"b_product_shu_value"
>
{
item
.
shenShuGuiZei
}
</
span
>
<
span
className=
"b_product_shu_label"
>
{
item
.
fengXian
}
|
{
item
.
qigouText
}
</
span
>
</
div
>
</
div
>
<
Button
className=
"detail_btn_1"
onClick=
{
()
=>
this
.
jumpVirtualDetailHandle
(
item
)
}
></
Button
>
<
Button
className=
"detail_btn_1"
onClick=
{
()
=>
this
.
jumpVirtualDetailHandle
(
item
)
}
></
Button
>
<
span
className=
"b_product_line"
></
span
>
<
span
className=
"b_product_line"
></
span
>
</
div
>
</
div
>
))
}
))
}
</
div
>
</
div
>
{
/* TODO 字段 */
}
{
!
curTabProductList
?.
length
&&
curTab
==
2
&&
<
div
className=
"empty"
>
暂无持仓产品哦
</
div
>
}
{
!
recommendProductConfig
?.
length
&&
curTab
==
2
&&
<
div
className=
"empty"
>
暂无持仓产品哦
</
div
>
}
</
div
>
</
div
>
<
Button
className=
"rule_btn"
onClick=
{
this
.
ruleHandle
}
/>
<
Button
className=
"rule_btn"
onClick=
{
this
.
ruleHandle
}
/>
</
div
>
</
div
>
...
...
src/store/store.ts
View file @
fb49a7d9
...
@@ -103,6 +103,9 @@ class Store {
...
@@ -103,6 +103,9 @@ class Store {
code
?:
string
,
code
?:
string
,
status
?:
string
,
status
?:
string
,
realBuyJumpUrl
?:
string
,
realBuyJumpUrl
?:
string
,
mineProduct
?:
boolean
,
// 我的产品(true是)
rate
?:
number
,
// 利率(需要除100展示)
rateName
?:
string
,
// 利率名称
}
>
,
}
>
,
// 待存储产品code
// 待存储产品code
codeList
?:
Array
<
{
codeList
?:
Array
<
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment