Commit 6c59e854 authored by 天马流星拳's avatar 天马流星拳

feat: 优化排行榜展示和奖品领取逻辑

- 调整排行榜高度和展开时的显示数量
- 修改持仓弹窗标题为图片展示
- 优化奖品领取流程,直接展示奖品信息
- 更新mock数据,添加更多排行榜示例数据
- 修复排行榜排名显示逻辑
parent 8b274b4b
......@@ -341,41 +341,62 @@ export default [
score: 0, //收益率
meFlag: false //是否是我,为true是
},
// {
// index: 6, //排名,null表示未上榜,前端判断大于等于100,展示99+
// userName:'136xxxx7894', // 用户名
// userId:1, //用户id
// score: -123, //收益率
// meFlag: false //是否是我,为true是
// },
// {
// index: 7, //排名,null表示未上榜,前端判断大于等于100,展示99+
// userName:'136xxxx7894', // 用户名
// userId:1, //用户id
// score: 43.18, //收益率
// meFlag: false //是否是我,为true是
// },
// {
// index: 8, //排名,null表示未上榜,前端判断大于等于100,展示99+
// userName:'136xxxx7894', // 用户名
// userId:1, //用户id
// score: 43.18, //收益率
// meFlag: false //是否是我,为true是
// },
// {
// index: 9, //排名,null表示未上榜,前端判断大于等于100,展示99+
// userName:'136xxxx7894', // 用户名
// userId:1, //用户id
// score: 43.18, //收益率
// meFlag: false //是否是我,为true是
// },
// {
// index: 10, //排名,null表示未上榜,前端判断大于等于100,展示99+
// userName:'136xxxx7894', // 用户名
// userId:1, //用户id
// score: 43.18, //收益率
// meFlag: false //是否是我,为true是
// }
{
index: 6, //排名,null表示未上榜,前端判断大于等于100,展示99+
userName:'136xxxx7894', // 用户名
userId:1, //用户id
score: -123, //收益率
meFlag: false //是否是我,为true是
},
{
index: 7, //排名,null表示未上榜,前端判断大于等于100,展示99+
userName:'136xxxx7894', // 用户名
userId:1, //用户id
score: 43.18, //收益率
meFlag: false //是否是我,为true是
},
{
index: 8, //排名,null表示未上榜,前端判断大于等于100,展示99+
userName:'136xxxx7894', // 用户名
userId:1, //用户id
score: 43.18, //收益率
meFlag: false //是否是我,为true是
},
{
index: 9, //排名,null表示未上榜,前端判断大于等于100,展示99+
userName:'136xxxx7894', // 用户名
userId:1, //用户id
score: 43.18, //收益率
meFlag: false //是否是我,为true是
},
{
index: 10, //排名,null表示未上榜,前端判断大于等于100,展示99+
userName:'136xxxx7894', // 用户名
userId:1, //用户id
score: 43.18, //收益率
meFlag: false //是否是我,为true是
},
{
index: 11, //排名,null表示未上榜,前端判断大于等于100,展示99+
userName:'136xxxx7894', // 用户名
userId:1, //用户id
score: 43.18, //收益率
meFlag: false //是否是我,为true是
},
{
index: 12, //排名,null表示未上榜,前端判断大于等于100,展示99+
userName:'136xxxx7894', // 用户名
userId:1, //用户id
score: 43.18, //收益率
meFlag: false //是否是我,为true是
},
{
index: 13, //排名,null表示未上榜,前端判断大于等于100,展示99+
userName:'136xxxx7894', // 用户名
userId:1, //用户id
score: 43.18, //收益率
meFlag: false //是否是我,为true是
}
],
// 理财排行榜-我的排名
myRank:{
......@@ -442,7 +463,7 @@ export default [
"cycleStartTime":1765210868000, //理财周期起始时间(毫秒时间戳)
"cycleEndTime": 1765383668000, //理财周期结束时间(毫秒时间戳)"
"rank": 1 , //必须 收益率排名,返回null表示未上榜,前端判断是否大于等于100,大于等于100展示99+
"drawStatus": 2, // 抽奖状态,0-直接领奖,1-点击抽奖(盲盒形式),2-已领奖
"drawStatus": 0, // 抽奖状态,0-直接领奖,1-点击抽奖(盲盒形式),2-已领奖
"joinStatus": true, // 参与状态,true-当月已参与,false-当月未参与
"prizeInfo":{
"prizeId": 1, //奖品id
......
......@@ -332,7 +332,8 @@
.postRanking_item_box{
margin-top: 0.1rem;
margin-left: 14px;
height: 160px;
// height: 160px;
height: 170px;
overflow: hidden;
.postRanking_item{
width: 629px;
......
......@@ -261,7 +261,9 @@ class HomePage extends React.Component<any, any> {
</div>
<div className={`postRanking_item_box ${this.state.isExpand ? 'expandSty3' : ''}`}>
{(() => {
const filteredRanks = rankInfos.filter(item => item.index && item.index >= 4 && item.index <= 100);
const filteredRanks = rankInfos.filter(item => {
return item.index && item.index >= 4 && (this.state.isExpand ? item.index <= 100 : item.index <= 5);
});
return filteredRanks.length > 0 ? (
filteredRanks.map((item, index) => (
<div key={`rank_${item.index}`} className={`postRanking_item`}>
......@@ -282,7 +284,7 @@ class HomePage extends React.Component<any, any> {
</div>
{/* 我的排名 */}
<div className='postRanking_myRanking'>
<span className='span-1'>{myRank.index == null ? '未上榜' : myRank.index >= 100 ? '99+' : myRank.index}</span>
<span className='span-1'>{myRank.index == null ? '未上榜' : myRank.index > 100 ? '99+' : myRank.index}</span>
<span className='span-2'>{myRank.userName}(我)</span>
{/* <span className='span-3'>+{myRank.score}%</span> */}
<span className='span-3'>{myRank.score != null ? (myRank.score > 0 ? `+${myRank.score}` : myRank.score) : '-'}%</span>
......@@ -420,4 +422,4 @@ class HomePage extends React.Component<any, any> {
);
}
}
export default HomePage;
export default HomePage;
\ No newline at end of file
......@@ -43,27 +43,37 @@ class Myqradespage extends React.Component {
}
// 点击立即领取
clickClaim = _asyncThrottle(() => {
this.getdrawJoin();
const { prizeInfo } = this.state.info;
ModalCtrl.showModal(PrizePanel,
{
optionImg: prizeInfo.prizeImg,
optionName: prizeInfo.prizeName,
}
)
setTimeout(() => {
this.getdrawIndex();
}, 2000);
// this.getdrawJoin();
// Toast.show("领取成功");
})
// 领取奖品
getdrawJoin = async () => {
const {code, data, message, success} = await API.drawJoin({});
if (success) {
if(data.prizeId == 'thanks'){
ModalCtrl.showModal(NoPrizePanel);
}
else{
ModalCtrl.showModal(PrizePanel,
{
optionImg: data.optionImg,
optionName: data.optionName,
}
);
}
this.getdrawIndex();
}
}
// getdrawJoin = async () => {
// const {code, data, message, success} = await API.drawJoin({});
// if (success) {
// if(data.prizeId == 'thanks'){
// ModalCtrl.showModal(NoPrizePanel);
// }
// else{
// ModalCtrl.showModal(PrizePanel,
// {
// optionImg: data.optionImg,
// optionName: data.optionName,
// }
// );
// }
// this.getdrawIndex();
// }
// }
// 立即查看
clickView = () => {
const {url, recordId} = this.state.info.prizeInfo;
......@@ -79,7 +89,7 @@ class Myqradespage extends React.Component {
<span className="bg"></span>
<span className="back" onClick={() => this.clickBack()}></span>
{
this.state.info.drawStatus == 1 && (
(this.state.info.drawStatus == 0 || this.state.info.drawStatus == 1) && (
<>
<div className="lottery"></div>
<span className="icon3"></span>
......
......@@ -70,7 +70,7 @@ class Positionpop extends React.Component {
</div>
</div>
<span className="name">{this.state.info.userName}</span>
<span className="title">持仓情况</span>
<span className="title"></span>
{/* <span className="icon1"></span> */}
</div>
);
......
......@@ -180,14 +180,12 @@
}
.title {
width: 201px;
width: 191px;
height: 46px;
left: 144px;
top: 561px;
position: absolute;
font-size: 48px;
line-height: 46px;
color: rgba(91, 34, 0, 1);
.sparkBg("positionPop/title.png");
}
.icon1 {
......
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