Commit 4a9d57bd authored by haiyoucuv's avatar haiyoucuv

init

parent 4ab447f6
...@@ -65,6 +65,9 @@ importers: ...@@ -65,6 +65,9 @@ importers:
html2canvas: html2canvas:
specifier: ^1.4.1 specifier: ^1.4.1
version: 1.4.1 version: 1.4.1
hx-account-info:
specifier: ^1.0.3
version: 1.0.3
hx-product_detail-link: hx-product_detail-link:
specifier: ^1.0.6 specifier: ^1.0.6
version: 1.0.6 version: 1.0.6
...@@ -80,6 +83,9 @@ importers: ...@@ -80,6 +83,9 @@ importers:
mobx-react: mobx-react:
specifier: ^9.2.0 specifier: ^9.2.0
version: 9.2.0(mobx@6.13.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) version: 9.2.0(mobx@6.13.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
motion:
specifier: ^12.20.1
version: 12.20.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
postcss: postcss:
specifier: ^8.5.3 specifier: ^8.5.3
version: 8.5.3 version: 8.5.3
...@@ -2674,6 +2680,20 @@ packages: ...@@ -2674,6 +2680,20 @@ packages:
fraction.js@4.3.7: fraction.js@4.3.7:
resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==}
framer-motion@12.20.1:
resolution: {integrity: sha512-NW2t2GHQcNvLHq18JyNVY15VKrwru+nkNyhLdqf4MbxbGhxZcSDi68iNcAy6O1nG0yYAQJbLioBIH1Kmg8Xr1g==}
peerDependencies:
'@emotion/is-prop-valid': '*'
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
peerDependenciesMeta:
'@emotion/is-prop-valid':
optional: true
react:
optional: true
react-dom:
optional: true
fs-extra@11.3.0: fs-extra@11.3.0:
resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==} resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==}
engines: {node: '>=14.14'} engines: {node: '>=14.14'}
...@@ -2828,8 +2848,11 @@ packages: ...@@ -2828,8 +2848,11 @@ packages:
humanize-ms@1.2.1: humanize-ms@1.2.1:
resolution: {integrity: sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=} resolution: {integrity: sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=}
hx-account-info@1.0.3:
resolution: {integrity: sha512-MFuLR/RaQ6bgAEFF+h1WgZfN9XHeiuXXxeAxq7SnH2cAsttnTYwV+7EQ90z2f9fT/zRk3c2ya66qIgv8hdEWxA==, tarball: http://npm.dui88.com:80/hx-account-info/-/hx-account-info-1.0.3.tgz}
hx-product_detail-link@1.0.6: hx-product_detail-link@1.0.6:
resolution: {integrity: sha512-kiTuzysTJDPgCE/6Yl1sH5UmkpXRjWLZA2iG/QZGRFqON6jweHHA4QDxlVeYtLHf0LktuBsVese45cLx+bD4pw==, tarball: http://npm.dui88.com:80/hx-product_detail-link/-/hx-product_detail-link-1.0.6.tgz} resolution: {integrity: sha512-kiTuzysTJDPgCE/6Yl1sH5UmkpXRjWLZA2iG/QZGRFqON6jweHHA4QDxlVeYtLHf0LktuBsVese45cLx+bD4pw==}
iconv-lite@0.6.3: iconv-lite@0.6.3:
resolution: {integrity: sha1-pS+AvzjaGVLrXGgXkHGYcaGnJQE=} resolution: {integrity: sha1-pS+AvzjaGVLrXGgXkHGYcaGnJQE=}
...@@ -3106,7 +3129,7 @@ packages: ...@@ -3106,7 +3129,7 @@ packages:
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
light-sdk@2.0.36: light-sdk@2.0.36:
resolution: {integrity: sha512-r4OPZbYH9MEMUYXFd+gACyZLI41Jg+7OAwrh2jysKm3QayJqI5xOztJPrT7m1I+LHW56NVGSPpHvLd7wAXgbnw==} resolution: {integrity: sha512-r4OPZbYH9MEMUYXFd+gACyZLI41Jg+7OAwrh2jysKm3QayJqI5xOztJPrT7m1I+LHW56NVGSPpHvLd7wAXgbnw==, tarball: http://npm.dui88.com:80/light-sdk/-/light-sdk-2.0.36.tgz}
lightningcss-darwin-arm64@1.29.1: lightningcss-darwin-arm64@1.29.1:
resolution: {integrity: sha512-HtR5XJ5A0lvCqYAoSv2QdZZyoHNttBpa5EP9aNuzBQeKGfbyH5+UipLWvVzpP4Uml5ej4BYs5I9Lco9u1fECqw==, tarball: http://npm.dui88.com:80/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.29.1.tgz} resolution: {integrity: sha512-HtR5XJ5A0lvCqYAoSv2QdZZyoHNttBpa5EP9aNuzBQeKGfbyH5+UipLWvVzpP4Uml5ej4BYs5I9Lco9u1fECqw==, tarball: http://npm.dui88.com:80/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.29.1.tgz}
...@@ -3373,6 +3396,26 @@ packages: ...@@ -3373,6 +3396,26 @@ packages:
moment@2.30.1: moment@2.30.1:
resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}
motion-dom@12.20.1:
resolution: {integrity: sha512-XyveLJ9dmQTmaEsP9RlcuoNFxWlRIGdasdPJBB4aOwPr8bRcJdhltudAbiEjRQBmsGD30sjJdaEjhkHsAHapLQ==}
motion-utils@12.19.0:
resolution: {integrity: sha512-BuFTHINYmV07pdWs6lj6aI63vr2N4dg0vR+td0rtrdpWOhBzIkEklZyLcvKBoEtwSqx8Jg06vUB5RS0xDiUybw==}
motion@12.20.1:
resolution: {integrity: sha512-UPUsh8jVxmcTPWqcdU5ZcNhO8EU4sfG+UcvKAUXFIwUE1oZJFxtyDui9tD7zlVau1eIBXqZ4Qe0hK2r8pOjDcQ==}
peerDependencies:
'@emotion/is-prop-valid': '*'
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
peerDependenciesMeta:
'@emotion/is-prop-valid':
optional: true
react:
optional: true
react-dom:
optional: true
ms@2.0.0: ms@2.0.0:
resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=} resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=}
...@@ -4434,7 +4477,7 @@ packages: ...@@ -4434,7 +4477,7 @@ packages:
engines: {node: '>=8'} engines: {node: '>=8'}
wrap-ansi@7.0.0: wrap-ansi@7.0.0:
resolution: {integrity: sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=} resolution: {integrity: sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=, tarball: http://npm.dui88.com:80/wrap-ansi/-/wrap-ansi-7.0.0.tgz}
engines: {node: '>=10'} engines: {node: '>=10'}
wrap-ansi@8.1.0: wrap-ansi@8.1.0:
...@@ -7198,6 +7241,15 @@ snapshots: ...@@ -7198,6 +7241,15 @@ snapshots:
fraction.js@4.3.7: {} fraction.js@4.3.7: {}
framer-motion@12.20.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
motion-dom: 12.20.1
motion-utils: 12.19.0
tslib: 2.8.1
optionalDependencies:
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
fs-extra@11.3.0: fs-extra@11.3.0:
dependencies: dependencies:
graceful-fs: 4.2.11 graceful-fs: 4.2.11
...@@ -7372,6 +7424,10 @@ snapshots: ...@@ -7372,6 +7424,10 @@ snapshots:
dependencies: dependencies:
ms: 2.1.3 ms: 2.1.3
hx-account-info@1.0.3:
dependencies:
light-sdk: 2.0.36
hx-product_detail-link@1.0.6: {} hx-product_detail-link@1.0.6: {}
iconv-lite@0.6.3: iconv-lite@0.6.3:
...@@ -7834,6 +7890,20 @@ snapshots: ...@@ -7834,6 +7890,20 @@ snapshots:
moment@2.30.1: {} moment@2.30.1: {}
motion-dom@12.20.1:
dependencies:
motion-utils: 12.19.0
motion-utils@12.19.0: {}
motion@12.20.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
framer-motion: 12.20.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
tslib: 2.8.1
optionalDependencies:
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
ms@2.0.0: {} ms@2.0.0: {}
ms@2.1.3: {} ms@2.1.3: {}
......
...@@ -20,6 +20,7 @@ import LoadingDemo from "@/pages/LoadingDemo/LoadingDemo.tsx"; ...@@ -20,6 +20,7 @@ import LoadingDemo from "@/pages/LoadingDemo/LoadingDemo.tsx";
import { loadFont } from "@/core/preload.ts"; import { loadFont } from "@/core/preload.ts";
import zzgfyht from "@/assets/font/zzgfyht.ttf"; import zzgfyht from "@/assets/font/zzgfyht.ttf";
import DetailPage from "@/pages/DetailPage/DetailPage.tsx";
@observer @observer
...@@ -30,7 +31,7 @@ class App extends Component { ...@@ -30,7 +31,7 @@ class App extends Component {
const defaultPage = { const defaultPage = {
myPrize: MyPrize, // TODO 举例子 新宿台奖品页 myPrize: MyPrize, // TODO 举例子 新宿台奖品页
index: LoadingDemo, index: LoadingDemo,
}[skinId] || LoadingDemo; }[skinId] || DetailPage;
PageCtrl.changePage(defaultPage); PageCtrl.changePage(defaultPage);
} }
......
import hxAccountInfo from "hx-account-info";
export function isWeiXin() { export function isWeiXin() {
return /micromessenger/i.test(navigator.userAgent.toLowerCase()); return /micromessenger/i.test(navigator.userAgent.toLowerCase());
...@@ -10,3 +10,123 @@ export function isWeiXin() { ...@@ -10,3 +10,123 @@ export function isWeiXin() {
export function isIos() { export function isIos() {
return navigator.userAgent.match(/iphone|ipod|ipad/gi) return navigator.userAgent.match(/iphone|ipod|ipad/gi)
} }
/** 渠道 */
export const CHANNEL = {
/** 母行-华夏银行 */
HXBANK: "1",
/** 华夏理财 */
HXLC: "2",
/** 三方合作APP-南粤银行 */
NANYUE: "3",
/** 三方合作APP-紫金 */
ZIJIN: "4",
/** 三方合作APP-中信 */
ZHONGXIN: "5",
/** 三方合作APP-河北 */
HEBEI: "6",
/** 三方合作APP-渤海 */
BOHAI: "7",
/** 母行备选渠道 手机号登录模式 投放母行app外 相当于三方合作APP */
HXBANK_TEL: "8",
/** 下线弹窗二维码入口进入 */
OFFLINE_QRCODE: "9",
};
/** 是否为三方合作APP */
export const IS_OTHER_APP = ![CHANNEL.HXBANK, CHANNEL.HXLC].includes(CFG.channel);
/** 跳转行方页面 */
export function jump2AppPage(fundcode) {
// 有渠道参数1 说明是投放三方(微信公众号) 走新的跳转方法
if (CFG.channel == '1') {
window.location.href = `https://mobile.hxwm.com.cn/hxlch5/VUE/#/fund-detail?fundcode=${fundcode}&from=third`
return
}
const navBarStyle = { 'backgroundColor': '#d20a10' }
// eslint-disable-next-line @spark/best-practices/no-url-in-js
const target = "gmu://web?startPage=" +
encodeURIComponent(
`index.html#/fund-detail?fundcode=${fundcode}&from=third`
) +
`&navBarType=2&navBarStyle=${encodeURIComponent(JSON.stringify(navBarStyle))}`
console.info('目标地址=================>:', target);
window.location.href = target
}
/**
* 获取基金产品详情(app端/微信端)
* @returns
*/
export function queryAppFundDetail(fund) {
const fundcode = fund?.fundCode || ''
console.info('获取基金产品详情 ', fundcode);
return new Promise(resolve => {
// app获取
hxAccountInfo.fundNetWorth({ fundcode }).then((res) => {
console.info(fundcode, ": fundNetWorth fundcode 请求结果>>>>成功>>>>>>>>>>>>", res);
const { result } = res || {}
if (result && Object.keys(result).length > 0) {
resolve({
fundcode: result.fundcode || fundcode, // app文档中没有返回fundcode字段 自己兜底存一下
fundCode: result.fundcode || fundcode, // app文档中没有返回fundcode字段 自己兜底存一下
newDate: result.newDate, // 当前日期
totalnetValue: result.totalnetvalue, // 累计净值
pernetValue: result.pernetvalue, // 单位净值
incomeRate: fund?.productType == 1 ? result.incomeRate : result.incomeRateO, // 收益率
incomeRateName: fund?.productType == 1 ? result.incomeRateName : result.incomeRateNameO, // 收益率名称
path: result.path, // 产品详情地址
})
} else {
resolve(false)
}
}).catch(err => {
console.info(fundcode, ": fundNetWorth fundcode 请求结果>>>>失败>>>>>>>>>>>>", err);
resolve(false)
})
})
}
// 判断jsbridge加载完成
function ready(callback) {
if (window.AlipayJSBridge) {
callback && callback();
} else {
document.addEventListener("AlipayJSBridgeReady", callback, false);
}
}
function bfSearchMenu(param, callback) {
window.AlipayJSBridge.call('BFSearchMenuHandler', {
param: param,
}, callback)
}
/** 行方跳转方法-华夏银行 */
export function appJump(url) {
console.info("bfSearchMenu url", url)
// 判断端内,若在端内走回调
ready(() => {
// 跳转的路径,视具体修改
bfSearchMenu({
url
})
})
}
/** 跳转方法 区分app */
export function diffJump(url) {
if (CFG.channel == CHANNEL.BOHAI) { // 渤海银行
boHaiAppJump(url)
} else if (CFG.channel == CHANNEL.HXLC) { // 华夏理财
hxlcAppJump(url)
} else if (CFG.channel == CHANNEL.HXBANK) { // 华夏银行
appJump(url)
} else if (IS_OTHER_APP) { // 其他三方app
location.href = url
}
}
@import "../../res.less";
.DetailPage {
width: 100%;
height: 100%;
left: 0;
top: 0;
position: absolute;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.prodIframe {
width: 100%;
height: 100%;
//border: none;
border: 0px;
}
.options {
flex-shrink: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
.tab {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 91px;
color: #bc251c;
font-size: 28px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: space-around;
.tabItem {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.actBar {
background-color: rgb(188, 37, 28);
position: absolute;
left: 61.5px;
top: 85px;
width: 252px;
height: 6px;
}
}
.buy {
position: absolute;
top: 91px;
width: 634px;
margin-top: 28px;
margin-bottom: 61px;
.buyInfo {
display: flex;
align-items: center;
justify-content: space-between;
& > div {
font-size: 32px;
color: rgb(50, 50, 50);
text-align: center;
font-weight: bold;
}
& > span {
font-size: 29px;
color: rgb(155, 155, 155);
text-align: center;
}
}
.bugInput {
margin-top: 18px;
width: 100%;
border: 1px rgb(155, 155, 155) solid;
border-radius: 6px;
height: 78px;
padding: 10px;
padding-left: 30px;
box-sizing: border-box;
font-size: 29px;
}
.buyTip {
margin-top: 14px;
font-size: 24px;
color: rgb(155, 155, 155);
text-align: left;
}
.buyBtn {
width: 100%;
height: 82px;
border-radius: 41px;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
font-weight: bold;
}
.simulateBuy {
margin-top: 30px;
background-color: rgb(188, 37, 28);
color: white;
}
.reallyBuy {
margin-top: 29px;
background-color: white;
color: #bc251c;
border: 1px solid #bc251c;
}
}
.sell {
position: absolute;
top: 91px;
width: 634px;
margin-top: 28px;
margin-bottom: 61px;
.sellInfo {
display: flex;
align-items: center;
justify-content: space-between;
& > div {
font-size: 32px;
color: rgb(50, 50, 50);
text-align: center;
font-weight: bold;
}
& > span {
font-size: 29px;
color: rgb(155, 155, 155);
text-align: center;
}
}
.sellInput {
position: relative;
margin-top: 18px;
width: 100%;
height: 78px;
input {
width: 100%;
height: 100%;
border: 1px rgb(155, 155, 155) solid;
border-radius: 6px;
padding: 10px 10px 10px 30px;
box-sizing: border-box;
font-size: 29px;
}
.sellAll {
font-size: 29px;
position: absolute;
top: 24px;
right: 27px;
color: #bc251c;
font-weight: bold;
}
}
.sellBtn {
width: 100%;
height: 82px;
border-radius: 41px;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
font-weight: bold;
}
.simulateSell {
margin-top: 30px;
background-color: rgb(188, 37, 28);
color: white;
}
}
}
}
import React from 'react';
import { observer } from 'mobx-react';
import styles from './DetailPage.module.less';
import store from "@/store/store.ts";
import { Button, Toast } from "@grace/ui";
import MyPrize from '../MyPrize/MyPrize';
import { PageCtrl } from '@/core/ctrls/PageCtrl';
import { motion } from "motion/react"
import classNames from "classnames";
enum EOpType {
Buy = "buy",
Sell = "sell",
}
@observer
class DetailPage extends React.Component<any, any> {
state = {
tabType: EOpType.Buy
}
async componentDidMount() {
}
clickPrize = () => {
PageCtrl.changePage(MyPrize);
}
clickTab = (type: EOpType) => {
this.setState({
tabType: type,
});
}
render() {
const { creditsNum, guideFlag, actStartTime, currentTime, actEndTime } = store.indexData;
const { tabType } = this.state;
const testUrl = "https://mobile.hxwm.com.cn/hxlch5/VUE/#/fund-detail-nobuy?fundcode=1912121000101&from=third";
const isBuy = tabType == EOpType.Buy;
return <div className={styles.DetailPage}>
<iframe className={styles.prodIframe} src={testUrl}/>
<motion.div
className={styles.options}
initial={{ height: 570 * remScale }}
animate={{ height: (isBuy ? 570 : 400) * remScale }}
>
<div className={styles.tab}>
<div
className={styles.tabItem}
onClick={() => this.clickTab(EOpType.Buy)}
>购买
</div>
<div
className={styles.tabItem}
onClick={() => this.clickTab(EOpType.Sell)}
>赎回
</div>
<motion.div
className={styles.actBar}
animate={{ left: (isBuy ? 61.5 : 436.5) * remScale }}
/>
</div>
<motion.div
className={styles.buy}
initial={{ x: 0 }}
animate={{ x: isBuy ? 0 : 750 * remScale }}
>
<div className={styles.buyInfo}>
<div>买入金额</div>
<span>可用资金:100000000元</span>
</div>
<input
className={styles.bugInput}
placeholder="¥最低买入1.00元"
/>
<div className={styles.buyTip}>首次购买1.00元起 再次购买1.00元起 1.00元递增</div>
<Button className={classNames(styles.buyBtn, styles.simulateBuy)}>模拟买入</Button>
<Button className={classNames(styles.buyBtn, styles.reallyBuy)}>真实买入</Button>
</motion.div>
<motion.div
className={styles.sell}
initial={{ x: 750 * remScale }}
animate={{ x: isBuy ? 750 * remScale : 0 }}
>
<div className={styles.sellInfo}>
<div>赎回份额</div>
<span>持有份额:0份</span>
</div>
<div className={styles.sellInput}>
<input
placeholder="最多可赎回0份"
/>
<Button className={styles.sellAll}>全部</Button>
</div>
<Button className={classNames(styles.sellBtn, styles.simulateSell)}>模拟赎回</Button>
</motion.div>
</motion.div>
</div>;
}
}
export default DetailPage;
...@@ -8,6 +8,7 @@ declare module "*.svga" { ...@@ -8,6 +8,7 @@ declare module "*.svga" {
} }
declare const remScale: number; declare const remScale: number;
declare const AlipayJSBridge: any;
......
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