Commit 753fc539 authored by 俞嘉婷's avatar 俞嘉婷

feat: 端内查询收益率

parent 2de67253
...@@ -111,7 +111,7 @@ export default [ ...@@ -111,7 +111,7 @@ export default [
"qigouText": "1元起购", "qigouText": "1元起购",
"baiFenBiText": "90%活动用户选购本产品t", "baiFenBiText": "90%活动用户选购本产品t",
"fengXian": "中低风险", "fengXian": "中低风险",
"code": "23112008P", "code": index === 0 ? "23112008P" : "consectetur",
"status": (index + 1) % 2 === 0 ? '1' : '0', "status": (index + 1) % 2 === 0 ? '1' : '0',
"mineProduct": (index + 1) % 3 === 0, "mineProduct": (index + 1) % 3 === 0,
"realBuyJumpUrl": `https://www.baidu.com?t=${(index + 1)}`, "realBuyJumpUrl": `https://www.baidu.com?t=${(index + 1)}`,
......
{"proSetting":{"projectxIDs":{"testId":[{"label":"test","value":"p476a83d1"}],"prodId":[{"label":"线上测试","value":"p69bb35bf"},{"label":"正式","value":"p16480c32"}]},"skinVariables":[],"mockSetting":{"projectId":"","pageId":""}},"envSetting":{},"psdSetting":{"psdFSSetting":true,"psdCenterSetting":true}} {"proSetting":{"projectxIDs":{"testId":[{"label":"test","value":"p476a83d1"}],"prodId":[{"label":"线上测试","value":"pf909ff04"},{"label":"正式","value":"p16480c32"}]},"skinVariables":[],"mockSetting":{"projectId":"","pageId":""}},"envSetting":{},"psdSetting":{"psdFSSetting":true,"psdCenterSetting":true}}
...@@ -49,7 +49,10 @@ const API = generateAPI({ ...@@ -49,7 +49,10 @@ const API = generateAPI({
// 首页 // 首页
index: "home/index.do", index: "home/index.do",
// 首页-产品参数更新 // 首页-产品参数更新
coop_codeUpdate: "home/coop_codeUpdate.do", coop_codeUpdate: {
uri: "home/coop_codeUpdate.do",
method: 'post',
},
// 首页-白名单限制弹窗 // 首页-白名单限制弹窗
isWhiteUser: { isWhiteUser: {
uri: "home/isWhiteUser.do", uri: "home/isWhiteUser.do",
......
...@@ -206,7 +206,7 @@ class HomePage extends React.Component<any, any> { ...@@ -206,7 +206,7 @@ class HomePage extends React.Component<any, any> {
<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>
<span className="r_product_risk">{(item.rate / 100).toFixed(2)}%</span> {!!item.rate && <span className="r_product_risk">{(item.rate / 100).toFixed(2)}%</span>}
<span className="r_product_rate">{RATE_NAME[item.type] || '年化收益率'}</span> <span className="r_product_rate">{RATE_NAME[item.type] || '年化收益率'}</span>
<Button className="detail_btn" onClick={() => this.jumpVirtualDetailHandle(item)}></Button> <Button className="detail_btn" onClick={() => this.jumpVirtualDetailHandle(item)}></Button>
<div className="r_product_like"> <div className="r_product_like">
......
...@@ -11,6 +11,8 @@ import Loginpop from '@/panels/loginpop/loginpop'; ...@@ -11,6 +11,8 @@ import Loginpop from '@/panels/loginpop/loginpop';
import InvalidPop from '@/panels/invalidPop/invalidPop'; import InvalidPop from '@/panels/invalidPop/invalidPop';
import FirstPop from '@/panels/firstPop/firstPop'; import FirstPop from '@/panels/firstPop/firstPop';
import Tipspop from '@/panels/tipspop/tipspop'; import Tipspop from '@/panels/tipspop/tipspop';
import { queryAppFundDetail } from '@/AppTools';
import { CHANNEL } from '@/AppTools';
class Store { class Store {
...@@ -145,7 +147,7 @@ class Store { ...@@ -145,7 +147,7 @@ class Store {
resData.currentTime = timeStamp; resData.currentTime = timeStamp;
this.indexData = resData; this.indexData = resData;
const { firstMoneyPop, endPop, checkIn } = resData const { firstMoneyPop, endPop, checkIn, codeList } = resData
// 计算进度条百分比 // 计算进度条百分比
if (checkIn?.checkInConfig && checkIn?.totalCheckIn !== undefined) { if (checkIn?.checkInConfig && checkIn?.totalCheckIn !== undefined) {
...@@ -161,6 +163,52 @@ class Store { ...@@ -161,6 +163,52 @@ class Store {
if (endPop) { if (endPop) {
ModalCtrl.showModal(Tipspop); ModalCtrl.showModal(Tipspop);
} }
// 更新产品信息
if (codeList?.length && CFG.channel == CHANNEL.HXLC) {
this.updateFundInfo(codeList)
}
}
/**
* 更新某些基金信息
* @param fundcodeList 需要查询的基金code列表
*/
async updateFundInfo(fundcodeList) {
console.info('需要查询的基金code列表, ', fundcodeList.map(item => item.code))
// 调客户端方法 查询产品的收益率等信息
const adInfos = []
for (let len = fundcodeList.length, i = 0; i < len; i++) {
const res = await queryAppFundDetail(fundcodeList[i])
if (res) adInfos.push(res)
}
// 将客户端查到的收益率 更新到产品列表中
const _temp = JSON.parse(JSON.stringify(this.indexData))
_temp.recommendProductConfig = _temp.recommendProductConfig?.map(item => {
const _adInfo = adInfos.find(adInfo => adInfo.fundcode == item.code)
if (_adInfo) {
item.rate = (_adInfo.incomeRate || 0) * 100
return item
}
return item
})
this.indexData = _temp;
console.info('基金产品收益率信息(客户端更新后的), ', toJS(this.indexData))
if (!adInfos?.length) return
// 将客户端查到的收益率 更新我们后端
const _codeList = adInfos.map(item => {
return {
code: item.fundcode, // 产品code
incomeRate: (item.incomeRate || 0) * 100, // 年化率(单位:分),例如:1.78%传递178
netValue: (item.pernetValue || 0) * 100, // 净值(单位:分),例如:1.66传递166
}
})
const params = {
codeList: _codeList,
}
API.coop_codeUpdate(params)
} }
/** /**
......
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