Commit fb49a7d9 authored by 俞嘉婷's avatar 俞嘉婷

feat: 产品列表回显

parent b3a3612c
...@@ -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 },
], ],
} }
} }
......
...@@ -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">
{recommendProductConfig?.map((item, index) => ( {rProductList?.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>
......
...@@ -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<{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment