Commit d7e39f2d authored by 天马流星拳's avatar 天马流星拳

fix(sharePage): 修复对话框文本溢出和错误码处理逻辑

修复对话框文本溢出问题,添加滚动和高度限制。更新错误码处理逻辑,替换旧的错误码并添加新的错误提示信息。同时优化奖品领取流程,直接调用API而非模拟弹窗。
parent 39c98012
......@@ -302,13 +302,10 @@ class HomePage extends React.Component<any, any> {
<span className='span-4-1'></span>
</span>
</div>
{/* 展开 */}
{
rankInfos.length > 3 && <div className='postRanking_expand'>
{/* 展开 rankInfos.length > 3 && */}
<div className='postRanking_expand'>
<span className={this.state.isExpand ? 'expandSty-1' : 'expandSty-2'} onClick={() => this.setState({isExpand: !this.state.isExpand})}></span>
</div>
}
</div>
</div>
......
......@@ -43,37 +43,39 @@ class Myqradespage extends React.Component {
}
// 点击立即领取
clickClaim = _asyncThrottle(() => {
const { prizeInfo } = this.state.info;
ModalCtrl.showModal(PrizePanel,
{
optionImg: prizeInfo.prizeImg,
optionName: prizeInfo.prizeName,
}
)
setTimeout(() => {
this.getdrawIndex();
}, 2000);
// 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,
}
);
}
setTimeout(() => {
this.getdrawIndex();
}, 2000);
}
}
// 立即查看
clickView = () => {
const {url, recordId} = this.state.info.prizeInfo;
......
......@@ -71,15 +71,36 @@ class SharePage extends React.Component {
btn: 2
})
} else {
if (code === '900002') {
if (code === '20002') {
Toast.show('活动已结束,感谢您的关注~')
} else {
if (['300002', '300003', '300004', '300005'].includes(code)) {
switch (code) {
case '300002':
Toast.show('助力失败,不能给自己助力哦~')
break;
case '200303':
Toast.show('助力机会已用完,一起来参与活动吧~')
break;
case '200304':
Toast.show('好友今日任务已完成,明天再来助力吧~')
break;
case '200305':
Toast.show('已为好友助力哦~')
break;
default:
break;
}
if (['300002', '200303', '200304', '200305'].includes(code)) {
this.setState({
btn: 2
})
}
Toast.show(message)
// if (['300002', '300003', '300004', '300005'].includes(code)) {
// this.setState({
// btn: 2
// })
// }
// Toast.show(message)
}
}
......
......@@ -73,10 +73,15 @@
position: absolute;
padding: 20px 40px;
box-sizing: border-box;
.sparkBg("sharePage/dialog.png");
.text{
display: inline-block;
color: #fff;
font-size: 28px;
overflow-x: hidden;
overflow-y: auto;
height: 63px;
}
}
......
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