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

feat: 字段对了下 补充逻辑

parent 3607892f
......@@ -25,6 +25,21 @@ export default [
}
},
},
{
url: '/home/coop_queryAgreement.do',
response: ({ query }) => {
return {
success: true,
code: "",
message: "",
timeStamp: Date.now(),
data: {
agreementTitle: '服务协议',
agreementText: '服务协议内容',
}
}
},
},
{
url: '/home/index.do',
response: ({ query }) => {
......@@ -37,6 +52,7 @@ export default [
actStartTime: Date.now() - 1 * 24 * 60 * 60 * 1000,
actEndTime: Date.now() + 3 * 24 * 60 * 60 * 1000,
myEndTime: Date.now() + 1 * 24 * 60 * 60 * 1000,
endPop: false,
uid: '234234',
ruleText: 'rulerulerulerulerulerulerule',
"bigStartConfig": new Array(5).fill(1).map((_, index) => {
......@@ -58,31 +74,33 @@ export default [
"totalIncome": "8390.22"
},
"checkIn": {
"totalCheckIn": "4",
"totalCheckIn": 6,
"todayCheckIn": false,
"totalExperienceNum": 1420000,
"checkInConfig": [
{
"id": 1,
"days": "3",
"experienceNum": "1",
"status": '2'
"days": 3,
"experienceNum": 10000,
"status": true
},
{
"id": 2,
"days": "5",
"experienceNum": "3",
"status": '1'
"days": 5,
"experienceNum": 30000,
"status": false
},
{
"id": 3,
"days": "10",
"experienceNum": "6",
"status": '0'
"days": 10,
"experienceNum": 60000,
"status": false
},
{
"id": 4,
"days": "20",
"experienceNum": "9",
"status": '0'
"days": 20,
"experienceNum": 90000,
"status": false
},
]
},
......
......@@ -54,6 +54,8 @@ const API = generateAPI({
uri: "home/isWhiteUser.do",
showMsg: false,
},
// 首页-查询服务协议
coop_queryAgreement: "home/coop_queryAgreement.do",
// 首页-校验验证码并登录
coop_checkCode: {
uri: 'home/coop_checkCode.do',
......
......@@ -416,24 +416,24 @@
}
.r_product_name {
width: 520px;
height: 27px;
height: 28px;
left: 32px;
top: 31px;
top: 30px;
position: absolute;
font-size: 28px;
line-height: 27px;
line-height: 28px;
color: rgba(1, 1, 1, 1);
font-weight: bold;
.lineClamp1();
}
.r_product_risk {
width: 360px;
height: 30px;
height: 32px;
left: 31px;
top: 79px;
top: 77px;
position: absolute;
font-size: 32px;
line-height: 30px;
line-height: 32px;
color: rgba(211, 26, 25, 1);
font-weight: bold;
.lineClamp1();
......@@ -567,13 +567,13 @@
width: 200px;
height: 63px;
left: 0px;
top: 59px;
top: 57px;
position: absolute;
.b_product_rate_label {
width: 100%;
height: 20px;
left: 0px;
top: 43px;
top: 46px;
position: absolute;
opacity: 0.6;
font-size: 20px;
......@@ -583,12 +583,12 @@
}
.b_product_rate_value {
width: 100%;
height: 24px;
height: 32px;
left: 2px;
top: 0px;
position: absolute;
font-size: 32px;
line-height: 24px;
line-height: 32px;
color: rgba(211, 26, 25, 1);
font-weight: bold;
.lineClamp1();
......@@ -598,13 +598,13 @@
width: 280px;
height: 63px;
left: 222px;
top: 60px;
top: 57px;
position: absolute;
.b_product_shu_label {
width: 100%;
height: 20px;
left: 1px;
top: 43px;
top: 45px;
position: absolute;
opacity: 0.6;
font-size: 20px;
......@@ -614,12 +614,12 @@
}
.b_product_shu_value {
width: 100%;
height: 27px;
height: 28px;
left: 0px;
top: 0px;
position: absolute;
font-size: 28px;
line-height: 27px;
line-height: 28px;
color: rgba(0, 0, 0, 1);
font-weight: bold;
.lineClamp1();
......
......@@ -61,10 +61,19 @@ class HomePage extends React.Component<any, any> {
ModalCtrl.showModal(Rulepop)
})
/** 已签到 */
signedHandle = _asyncThrottle(async () => {
if (!store.judgeActTime()) return
Toast.show("今日已签到")
})
/** 签到 */
signHandle = _asyncThrottle(async () => {
if (!store.judgeActTime()) return
await API.doCheckIn();
const { success } = await API.doCheckIn();
if (success) {
Toast.show("签到成功")
}
await store.updateIndex();
})
......@@ -147,9 +156,9 @@ class HomePage extends React.Component<any, any> {
{/* 签到区 */}
<div className="sign_section">
<span className="sign_section_bg"></span>
<span className="sign_tips">累计签到,最高可得{checkIn?.TODO || 0}万资金</span>
{checkIn?.TODO
? <div className="signed_btn">已签到</div>
<span className="sign_tips">累计签到,最高可得{((checkIn?.totalExperienceNum || 0) / 10000).toFixed(0)}万资金</span>
{checkIn?.todayCheckIn
? <Button className="signed_btn" onClick={this.signedHandle}>已签到</Button>
: <Button className="sign_btn" onClick={this.signHandle}>签到得1万资金</Button>
}
<div className="sign_progress">
......@@ -161,12 +170,12 @@ class HomePage extends React.Component<any, any> {
{checkIn?.checkInConfig?.map((item, index) => {
return (
<div
className={`step_item step_item${index + 1} ${item.status == '0' ? 'locked' : item.status == '1' ? 'signed' : 'received'}`}
className={`step_item step_item${index + 1} ${item.days > checkIn?.totalCheckIn ? 'locked' : item.status ? 'received' : 'signed'}`}
key={`sign_${index}`}
onClick={() => this.signPrizeHandle(item)}
>
<span className="prize_bg"></span>
<div className="prize_amount">{item.experienceNum}<span className="unit"></span></div>
<div className="prize_amount">{((item.experienceNum || 0) / 10000).toFixed(0)}<span className="unit"></span></div>
<span className="prize_day">累计{item.days}</span>
</div>
)
......
......@@ -34,7 +34,20 @@ class Loginpop extends React.Component {
}
componentDidMount() {
this.getUserInfo()
this.queryAgreement()
if (CFG.channel === CHANNEL.HXLC) {
this.getUserInfo()
}
}
// 查询服务协议
queryAgreement = async () => {
const { success, data } = await API.coop_queryAgreement()
if (success) {
this.setState({
agreementInfo: data || {},
})
}
}
getUserInfo = () => {
......@@ -123,7 +136,7 @@ class Loginpop extends React.Component {
// 确认提交
handleSubmit = _asyncThrottle(() => {
const { loginPhone, loginCode } = this.state;
const { agreementTitle } = this.props || {};
const { agreementTitle } = this.state.agreementInfo || {};
if (!!agreementTitle && !this.state.privacyChecked) { // 未勾选隐私协议
Toast.show('请仔细阅读服务协议并勾选')
......@@ -147,7 +160,7 @@ class Loginpop extends React.Component {
const params = {
"phoneNumber": loginPhone,
"smsCode": loginCode,
"origenUid": uid,
"origenUid": uid || '', // 华夏理财渠道才拿得到 其他渠道不用传
}
const { success, data } = await API.coop_checkCode(params)
if (success) {
......@@ -163,7 +176,7 @@ class Loginpop extends React.Component {
const { loginPhone, loginCode, showCountDown, countDown, showSendAgain, showSend } = this.state;
const { showPrivacyPop, privacyChecked } = this.state;
const { agreementTitle, agreementText, hideClose } = this.props || {};
const { agreementTitle, agreementText, hideClose } = this.state.agreementInfo || {};
return (<>
<div className={`loginpop modal_center ${!agreementTitle ? 'no_check' : ''}`}>
<span className="bg"></span>
......@@ -198,7 +211,7 @@ class Loginpop extends React.Component {
<span className="content_title" onClick={() => this.setState({ showPrivacyPop: true })} dangerouslySetInnerHTML={{ __html: agreementTitle }}></span>
</div>
</div>}
<Button className={`btn ${CFG.channel === CHANNEL.OFFLINE_QRCODE ? 'enter_btn' : '' }`} onClick={this.handleSubmit}></Button>
<Button className={`btn ${CFG.channel === CHANNEL.OFFLINE_QRCODE ? 'enter_btn' : ''}`} onClick={this.handleSubmit}></Button>
{!hideClose && <Button className="close" onClick={this.close}></Button>}
</div>
......
......@@ -82,12 +82,14 @@ class Store {
},
// 签到模块
checkIn?: {
totalCheckIn?: string,
totalCheckIn?: number,
todayCheckIn?: boolean, // 今日是否签到(true签到)
totalExperienceNum?: number, // 累计可获得最高体验金数量
checkInConfig?: Array<{
id?: number,
days?: string,
experienceNum?: string,
status?: string,
days?: number,
experienceNum?: number,
status?: boolean, // true已领奖
}>,
},
// 推荐产品配置
......@@ -103,7 +105,11 @@ class Store {
realBuyJumpUrl?: string,
}>,
// 待存储产品code
codeList?: Array<string>,
codeList?: Array<{
code?: string,
type?: number, // 产品类型(0-非现金,1-现金)
}>,
endPop?: boolean,
} = {};
async judgeIsWhiteUser() {
......@@ -119,7 +125,7 @@ class Store {
ModalCtrl.showModal(InvalidPop);
} else if (code == 60002) {
// 请绑定手机号
ModalCtrl.showModal(Loginpop, { agreementTitle: '《模拟理财服务协议》', agreementText: '您即将进入第三方服务页面,该服务由华夏理财有限责任公司提供。为了便于您使用本页面服务,需要您主动提供手机号信息,个人信息仅用于本活动登录及参与,无其他用途。相关信息保护责任由华夏理财承担。' }) // TODO 字段?
ModalCtrl.showModal(Loginpop)
} else {
Toast.show(message || '网络异常,请稍后再试')
}
......@@ -130,16 +136,16 @@ class Store {
if (!success) {
return;
}
const resData = data || {}
const resData = data || {}
resData.currentTime = timeStamp;
this.indexData = resData;
const { firstMoneyPop, TODO } = resData
const { firstMoneyPop, endPop } = resData
if (firstMoneyPop) {
ModalCtrl.showModal(FirstPop, firstMoneyPop);
}
if (TODO) {
if (endPop) {
ModalCtrl.showModal(Tipspop);
}
}
......
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