Commit cb6087ad authored by zhangyuan's avatar zhangyuan

提交

parent 934bae44
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
<script> <script>
if (typeof window.queueMicrotask !== "function") { if (typeof window.queueMicrotask !== "function") {
window.queueMicrotask = function(callback) { window.queueMicrotask = function (callback) {
Promise.resolve().then(callback).catch(function(error) { Promise.resolve().then(callback).catch(function (error) {
setTimeout(function() { throw error; }); setTimeout(function () { throw error; });
}); });
}; };
} }
...@@ -55,11 +55,15 @@ ...@@ -55,11 +55,15 @@
CFG.prize = '/projectx/' + CFG.projectId + '/prize.html?appID=' + CFG.appID + '&channel=' + CFG.channel; CFG.prize = '/projectx/' + CFG.projectId + '/prize.html?appID=' + CFG.appID + '&channel=' + CFG.channel;
// 提示弹窗二维码短链链接(目的页是 首页xx/index.html?off=1) 线上正式 TODO 域名记得改为dexfu的 // 提示弹窗二维码短链链接(目的页是 首页xx/index.html?off=1) 线上正式 TODO 域名记得改为dexfu的
CFG.prizePageQrcodeUrl = CFG.domain + CFG.prize + "&off=1"; CFG.prizePageQrcodeUrl = CFG.domain + CFG.prize + "&off=1";
// 分享落地页
CFG.shareUrl = "/projectx/" + CFG.projectId + "/share.html?appID=" + CFG.appID + '&channel=' + CFG.channel;
CFG.inviteCode = getUrlParam('inviteCode');
if (!getUrlParam("appID")) { if (!getUrlParam("appID")) {
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。") // alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
} }
</script> </script>
</head> </head>
...@@ -68,4 +72,4 @@ ...@@ -68,4 +72,4 @@
<script type="module" src="/src/App.tsx"></script> <script type="module" src="/src/App.tsx"></script>
</body> </body>
</html> </html>
\ No newline at end of file
This diff is collapsed.
...@@ -50,9 +50,9 @@ export default [ ...@@ -50,9 +50,9 @@ export default [
message: "", message: "",
data: { data: {
haveMore: true, haveMore: true,
list: new Array(50).fill(1).map((_, i) => { list: new Array(20).fill(1).map((_, i) => {
return { return {
desc: "descdescdescdescdesc", desc: "模拟交易记录页--" + i,
gmtCreate: Date.now() + Math.random() * 1000000000, gmtCreate: Date.now() + Math.random() * 1000000000,
amount: Math.random() * 10000000 >> 0, amount: Math.random() * 10000000 >> 0,
tradeStatus: Math.random() * 3 >> 0, tradeStatus: Math.random() * 3 >> 0,
......
import React, {Component} from 'react' import React, { Component } from 'react'
import {observer} from "mobx-react"; import { observer } from "mobx-react";
import {createRoot} from "react-dom/client"; import { createRoot } from "react-dom/client";
import store from "./store/store"; import store from "./store/store";
import "./core/checkwebp.ts"; import "./core/checkwebp.ts";
...@@ -21,6 +21,7 @@ import DetailPage from "@/pages/DetailPage/DetailPage.tsx"; ...@@ -21,6 +21,7 @@ import DetailPage from "@/pages/DetailPage/DetailPage.tsx";
import RecordPage from "@/pages/RecordPage/RecordPage.tsx"; import RecordPage from "@/pages/RecordPage/RecordPage.tsx";
import ResPage from "@/pages/ResPage/ResPage.tsx"; import ResPage from "@/pages/ResPage/ResPage.tsx";
import PrizePage from "@/pages/PrizePage/PrizePage.tsx"; import PrizePage from "@/pages/PrizePage/PrizePage.tsx";
import SharePage from "@/pages/sharePage/sharePage.tsx";
@observer @observer
...@@ -32,6 +33,7 @@ class App extends Component { ...@@ -32,6 +33,7 @@ class App extends Component {
auth: Auth, // TODO 举例子 新宿台奖品页 auth: Auth, // TODO 举例子 新宿台奖品页
index: HomePage, index: HomePage,
prize: PrizePage, prize: PrizePage,
share: SharePage
}[skinId] || HomePage; }[skinId] || HomePage;
PageCtrl.changePage(defaultPage); PageCtrl.changePage(defaultPage);
} }
...@@ -44,19 +46,19 @@ class App extends Component { ...@@ -44,19 +46,19 @@ class App extends Component {
} }
componentWillUnmount() { componentWillUnmount() {
} }
render() { render() {
return <> return <>
<PageCtrl/> <PageCtrl />
<ModalCtrl/> <ModalCtrl />
</>; </>;
} }
} }
const root = createRoot(document.getElementById('root')!); const root = createRoot(document.getElementById('root')!);
root.render( root.render(
<App/> <App />
); );
...@@ -81,6 +81,8 @@ const API = generateAPI({ ...@@ -81,6 +81,8 @@ const API = generateAPI({
doRewards: "home/doRewards.do", doRewards: "home/doRewards.do",
tradeRecords: "mncp/tradeRecords.do", tradeRecords: "mncp/tradeRecords.do",
queryWealthRecords: "home/queryWealthRecords.do",
redeem: "mncp/redeem.do", redeem: "mncp/redeem.do",
buy: "mncp/buy.do", buy: "mncp/buy.do",
mncpIndex: "mncp/index.do", mncpIndex: "mncp/index.do",
...@@ -96,7 +98,39 @@ const API = generateAPI({ ...@@ -96,7 +98,39 @@ const API = generateAPI({
// 红包雨提交 // 红包雨提交
redSubmitGame: `redRain/submitGame.do`, redSubmitGame: `redRain/submitGame.do`,
/** 分享落地页接口 */
getSharePageInfo: "invite/coop_queryRecommand.do",
// 获取任务列表的接口
getTaskList: "task/queryTasks.do",
// 查询题目
queryQS: "answer_1/query.do",
// 开始答题
startQS: {
uri: "answer_1/start.do",
method: 'post',
withToken: true,
},
// 获取题目
getQS: {
uri: "answer_1/getQuestion.do",
method: 'post',
withToken: true,
},
// 提交题目
submitQS: {
uri: "answer_1/submit.do",
method: 'post',
withToken: true,
},
// 完成答题
completeQS: {
uri: "answer_1/doCompleted.do",
method: 'post',
withToken: true,
}
}) })
// console.log('======', API) // console.log('======', API)
......
src/assets/RecordPage/backBtn.png

295 Bytes | W: | H:

src/assets/RecordPage/backBtn.png

295 Bytes | W: | H:

src/assets/RecordPage/backBtn.png
src/assets/RecordPage/backBtn.png
src/assets/RecordPage/backBtn.png
src/assets/RecordPage/backBtn.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/detail_btn.png

3.17 KB | W: | H:

src/assets/homePage/detail_btn.png

2.84 KB | W: | H:

src/assets/homePage/detail_btn.png
src/assets/homePage/detail_btn.png
src/assets/homePage/detail_btn.png
src/assets/homePage/detail_btn.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/prize_locked.png

3.95 KB | W: | H:

src/assets/homePage/prize_locked.png

3.74 KB | W: | H:

src/assets/homePage/prize_locked.png
src/assets/homePage/prize_locked.png
src/assets/homePage/prize_locked.png
src/assets/homePage/prize_locked.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/prize_received.png

4.77 KB | W: | H:

src/assets/homePage/prize_received.png

4.48 KB | W: | H:

src/assets/homePage/prize_received.png
src/assets/homePage/prize_received.png
src/assets/homePage/prize_received.png
src/assets/homePage/prize_received.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/r_product_like_bg.png

915 Bytes | W: | H:

src/assets/homePage/r_product_like_bg.png

1.42 KB | W: | H:

src/assets/homePage/r_product_like_bg.png
src/assets/homePage/r_product_like_bg.png
src/assets/homePage/r_product_like_bg.png
src/assets/homePage/r_product_like_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/rule_btn.png

2.78 KB | W: | H:

src/assets/homePage/rule_btn.png

1.96 KB | W: | H:

src/assets/homePage/rule_btn.png
src/assets/homePage/rule_btn.png
src/assets/homePage/rule_btn.png
src/assets/homePage/rule_btn.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/sign_btn_bg.png

1.17 KB | W: | H:

src/assets/homePage/sign_btn_bg.png

12.2 KB | W: | H:

src/assets/homePage/sign_btn_bg.png
src/assets/homePage/sign_btn_bg.png
src/assets/homePage/sign_btn_bg.png
src/assets/homePage/sign_btn_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/sign_section_bg.png

33.1 KB | W: | H:

src/assets/homePage/sign_section_bg.png

18.5 KB | W: | H:

src/assets/homePage/sign_section_bg.png
src/assets/homePage/sign_section_bg.png
src/assets/homePage/sign_section_bg.png
src/assets/homePage/sign_section_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/signed_btn_bg.png

1.26 KB | W: | H:

src/assets/homePage/signed_btn_bg.png

3.16 KB | W: | H:

src/assets/homePage/signed_btn_bg.png
src/assets/homePage/signed_btn_bg.png
src/assets/homePage/signed_btn_bg.png
src/assets/homePage/signed_btn_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/tab1_bg.png

11.5 KB | W: | H:

src/assets/homePage/tab1_bg.png

12.8 KB | W: | H:

src/assets/homePage/tab1_bg.png
src/assets/homePage/tab1_bg.png
src/assets/homePage/tab1_bg.png
src/assets/homePage/tab1_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/homePage/tab2_bg.png

11.1 KB | W: | H:

src/assets/homePage/tab2_bg.png

11 KB | W: | H:

src/assets/homePage/tab2_bg.png
src/assets/homePage/tab2_bg.png
src/assets/homePage/tab2_bg.png
src/assets/homePage/tab2_bg.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './index.less';
import { _throttle } from '@/utils/utils';
import { Button } from '@grace/ui';
import { PageCtrl } from '@/core/ctrls/PageCtrl';
import { dateFormatter } from "@/utils/utils.ts";
import HomePage from "@/pages/HomePage/HomePage.tsx";
import API from '@/api';
@observer
class NewRecordPage extends React.Component {
constructor(props) {
super(props);
this.state = {
list: [],
tab: 1
}
this.pageNum = 1;
this.pageSize = 20;
this.haveMore = true;
this.API = API.tradeRecords;
}
clickBack = () => {
PageCtrl.changePage(HomePage);
}
componentDidMount() {
this.updateList();
}
async updateList() {
const { pageNum, pageSize, haveMore } = this;
if (!haveMore) return;
const { success, data } = await this.API({ pageNum, pageSize });
if (!success) return;
this.pageNum++;
this.haveMore = data.haveMore;
const list = this.state.list.concat(data.list);
this.setState({ list })
}
handleScroll = (e) => {
if (e.target.scrollHeight - e.target.scrollTop <= e.target.clientHeight) {
this.updateList();
}
}
tabChange(tab) {
this.setState({
tab: tab,
list: []
})
this.pageNum = 1;
this.pageSize = 20;
this.haveMore = true;
this.API = tab === 1 ? API.tradeRecords : API.queryWealthRecords;
this.updateList();
}
render() {
const { list } = this.state;
return (
<div className="newRecordPage">
<span className="bg"></span>
<Button className="backBtn" onClick={this.clickBack} />
<div className={`tab-con tab-${this.state.tab}`}>
<div className='tab-btn-1' onClick={_throttle(() => {
this.tabChange(1)
})}></div>
<div className='tab-btn-2' onClick={_throttle(() => {
this.tabChange(2)
})}></div>
</div>
<div>
{list?.length
? <div className="list" onScroll={this.handleScroll}>
{
list.map((item, index) => {
const state = {
0: { txt: "购买待确认", color: "rgba(0,0,0,0.6)" },
1: { txt: "购买成功", color: "#ee4e32" },
2: { txt: "赎回成功", color: "#1b8a4f" },
3: { txt: "购买失败", color: "rgba(0,0,0,0.6)" },
}[item.tradeStatus];
return <div className="item" key={index}>
<div className="title">{item.desc}</div>
<div
className="date">{dateFormatter(item.gmtCreate, "yyyy.MM.dd hh:mm:ss")}</div>
<div className="num">¥{item.amount / 100}</div>
{/*<div className={styles.num}>¥0000000.00</div>*/}
<div className="state" style={{ color: state.color }}>{state.txt}</div>
</div>
})
}
</div>
: <div className="listNone">暂无交易记录哦</div>
}
</div>
</div>
);
}
}
export default NewRecordPage;
@import "../../res.less";
.newRecordPage {
width: 750px;
height: 100vh;
left: 0px;
top: 0px;
position: absolute;
.backBtn {
position: absolute;
left: 28px;
top: 58px;
width: 18px;
height: 32px;
.sparkBg("RecordPage/backBtn.png");
}
.bg {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("RecordPage/recordPageBg.png");
}
.tab-con {
position: absolute;
left: 19px;
top: 120px;
width: 713px;
height: 1041px;
}
.tab-1 {
.sparkBg("RecordPage/tab1.png");
}
.tab-2 {
.sparkBg("RecordPage/tab2.png");
}
.tab-btn-1 {
position: absolute;
left: 0px;
top: 5px;
width: 50%;
height: 70px;
// background-color: aqua;
}
.tab-btn-2 {
position: absolute;
right: 0px;
width: 50%;
top: 5px;
height: 70px;
// background-color: rgb(158, 64, 109);
}
.listNone {
position: absolute;
top: 400px;
left: 0;
width: 100%;
font-size: 32px;
color: #d62928;
text-align: center;
font-weight: bold;
}
.list {
position: absolute;
top: 203px;
height: 900px;
width: 710px;
border-top-left-radius: 30px;
border-top-right-radius: 30px;
overflow-x: hidden;
overflow-y: auto;
.item {
position: relative;
width: 100%;
height: 141px;
.title {
position: absolute;
left: 56px;
top: 57px;
font-size: 30px;
color: black;
font-weight: bold;
width: 390px;
.lineClamp1();
}
.date {
position: absolute;
left: 56px;
top: 104px;
font-size: 24px;
color: rgba(0, 0, 0, 0.6);
}
.num {
position: absolute;
right: 60px;
top: 61px;
font-size: 30px;
color: black;
font-weight: bold;
}
.state {
position: absolute;
right: 60px;
top: 100px;
font-size: 24px;
color: rgba(0, 0, 0, 0.6);
// #ee4e32
// #1b8a4f
}
}
}
}
\ No newline at end of file
@import "../../res.less";
.sharePage {
width: 750px;
height: 100vh;
left: 0px;
top: 0px;
position: absolute;
overflow-y: scroll;
overflow-x: hidden;
.bg {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("sharePage/sharePageBg.png");
}
.title1 {
display: inline-block;
width: 426px;
height: 294px;
left: 159px;
top: 129px;
position: absolute;
.sparkBg("sharePage/title1.png");
font-size: 90px;
color: rgb(255, 243, 228);
line-height: 294px;
text-align: center;
font-weight: bolder;
font-style: italic;
text-shadow: -2px -2px 0 #fe9d3a, 2px -2px 0 #fe9d3a, -2px 2px 0 #fe9d3a, 2px 2px 0 #fe9d3a;
}
.title2 {
display: inline-block;
width: 568px;
height: 289px;
left: 91px;
top: 108px;
position: absolute;
.sparkBg("sharePage/title2.png");
}
.doAssitBtn {
display: inline-block;
width: 425px;
height: 98px;
left: 162px;
top: 787px;
position: absolute;
.sparkBg("sharePage/btn.png");
}
.content {
display: inline-block;
position: absolute;
width: 635px;
height: 462px;
left: 57px;
top: 983px;
.proItem {
width: 635px;
height: 146px;
margin-bottom: 20px;
position: relative;
.pro_name {
display: inline-block;
width: 635px;
height: 30px;
line-height: 30px;
font-weight: bold;
font-size: 28px;
color: rgb(1, 1, 1);
.lineClamp1();
}
.info_con {
width: 635px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
margin-top: 15px;
p {
height: 40px;
line-height: 40px;
}
.rate_con,
.guize_con,
.btn_con {
box-sizing: border-box;
width: 33%;
position: relative;
font-size: 20px;
color: rgba(1, 1, 1, 0.6);
}
.pro_rate {
font-size: 32px;
color: rgb(191, 49, 39);
font-weight: bold;
}
.pro_guize {
font-size: 28px;
color: rgb(0, 0, 0);
font-weight: bold;
}
.check-btn {
display: inline-block;
width: 137px;
height: 48px;
position: absolute;
right: 0px;
.sparkBg("sharePage/checkbtn.png");
}
}
.line {
display: inline-block;
width: 635px;
height: 2px;
position: absolute;
bottom: 5px;
.sparkBg("sharePage/line.png");
}
}
}
}
\ No newline at end of file
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './sharePage.less';
import { _throttle, windowJumpUrl, CHANNEL } from '@/utils/utils';
import { copyToClipboard } from '@spark/utils';
import { Toast } from "@grace/ui";
import API from '@/api';
import { isIos, isWeChat } from '@/utils/share';
import { showShareGuide } from '@spark/share';
@observer
class SharePage extends React.Component {
constructor(props) {
super(props);
this.state = {
pageInfo: {}
}
}
componentDidMount() {
this.getPageInfo()
}
getPageInfo = async () => {
const { success, data } = await API.getSharePageInfo()
if (success) {
this.setState({
pageInfo: data || {}
})
}
}
/** 唤端 */
toApp = _throttle(() => {
if (CFG.inviteCode) {
copyToClipboard(CFG.inviteCode);
Toast.show("复制成功")
}
if (CFG.channel === CHANNEL.HXBANK) {
// 华夏银行 可唤端 不可带参
} else if (CFG.channel === CHANNEL.HXLC) {
// 华夏理财 无唤端方法
} else {
// 其他三方渠道 无唤端方法
}
setTimeout(() => {
if (this.state.pageInfo?.jumpUrl) {
windowJumpUrl(this.state.pageInfo.jumpUrl)
}
}, 300)
})
render() {
const { boolWealth, recommendProductConfig, amount } = this.state.pageInfo || {}
return (
<div className="sharePage">
<span className="bg"></span>
{!boolWealth && <span className="title1">
{`${amount}元`}
</span>}
{boolWealth && <span className="title2"></span>}
<span className="doAssitBtn" onClick={() => {
this.toApp()
}}></span>
<div className="content">
{
(recommendProductConfig || []).map((el, index) => {
return <div className='proItem' key={index}>
<span className='pro_name'>{el.name}</span>
<div className='info_con'>
<div className='rate_con'>
<p className='pro_rate'>{Number(el.rate / 100).toFixed(2) + '%'}</p>
<p className='pro_rate_label'>{`年化收益率`}</p>
</div>
<div className='guize_con'>
<p className='pro_guize'>{el.shenShuGuiZei}</p>
<p className='pro_fengxian'>
<span style={{ marginRight: '10px' }}>{`${el.fengXian}`}</span>
|
<span style={{ marginLeft: '10px' }}>{`${el.qigouText}`}</span>
</p>
</div>
<div className='btn_con'>
<span className='check-btn' onClick={_throttle(() => {
windowJumpUrl(el.realBuyJumpUrl)
})}></span>
</div>
</div>
{index !== (recommendProductConfig || []).length - 1 && <span className='line'></span>}
</div>
})
}
</div>
</div>
);
}
}
export default SharePage;
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './index.less';
import store from '../../store/store';
import { Button } from '@grace/ui';
import { _asyncThrottle } from "../../utils/utils";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
import AnswerPrizePanel from "@/panels/answerPrizePanel/index";
import API from '@/api';
@observer
class AnswerPanel extends React.Component {
constructor(props) {
super(props);
this.startId = null;
this.state = {
qsInfo: {},
correctAnswers: [],
selAnswer: null
}
}
componentDidMount() {
this.getQuestion();
}
getQuestion = async () => {
const { success } = await API.queryQS();
if (success) {
this.startQuestion();
}
}
startQuestion = async () => {
const { success, data } = await API.startQS();
if (success) {
this.startId = data.startId;
this.getQsDesc();
}
}
getQsDesc = async () => {
const { success, data } = await API.getQS({
startId: this.startId
});
if (success) {
this.setState({
qsInfo: data
})
}
}
async submit(index) {
if (this.state.selAnswer) return;
const { success, data } = await API.submitQS({
startId: this.startId,
answer: index + ''
})
this.setState({
selAnswer: index + ''
})
if (success) {
if (data.answer) {
this.setState({
correctAnswers: data.answer?.correctAnswers || []
})
}
this.completeQS();
}
}
async completeQS() {
const { success, data } = await API.completeQS({
startId: this.startId,
})
if (success) {
setTimeout(() => {
this.handleClose();
ModalCtrl.showModal(AnswerPrizePanel, data.options[0] || {});
}, 2000)
}
}
handleClose = _asyncThrottle(() => {
ModalCtrl.closeModal()
})
render() {
const qsInfo = this.state.qsInfo || {};
const correctAnswers = this.state.correctAnswers || [];
const selAnswer = this.state.selAnswer;
return (
<div className="answerPanel modal_center">
<span className="bg"></span>
<div className='question-title'>{qsInfo.content || ''}</div>
<div className='answer-con'>
{(qsInfo.answers || []).map((el, index) => {
return <div className={`answer-item ${selAnswer === index + '' && correctAnswers.length > 0 && !correctAnswers.includes(index + '') ? 'error' : ''} ${correctAnswers.includes(index + '') ? 'correct' : ''}`} key={index} onClick={_asyncThrottle(() => {
this.submit(index)
})}>{el}
{selAnswer === index + '' && correctAnswers.length > 0 && !correctAnswers.includes(index + '') && <span className='error-icon'></span>}
{correctAnswers.includes(index + '') && <span className='correct-icon'></span>}
</div>
})}
</div>
<Button className="close" onClick={this.handleClose} />
</div>
);
}
}
export default AnswerPanel;
@import "../../res.less";
.answerPanel {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
left: 82px;
top: 406px;
width: 585px;
height: 711px;
position: absolute;
.sparkBg("answerPanel/answerPanelBg.png");
}
.question-title {
top: 600px;
left: 105px;
position: absolute;
width: 545px;
font-size: 30px;
color: rgb(40, 25, 25);
font-weight: bold;
line-height: 1.2;
}
.answer-con {
width: 492px;
height: 360px;
position: absolute;
top: 740px;
left: 129px;
.answer-item {
width: 492px;
height: 80px;
line-height: 80px;
text-align: center;
color: rgb(88, 88, 88);
font-size: 30px;
font-weight: bold;
margin-bottom: 6px;
.sparkBg("answerPanel/normalBg.png");
position: relative;
}
.error {
.sparkBg("answerPanel/errorBg.png");
}
.correct {
.sparkBg("answerPanel/correctBg.png");
}
.correct-icon {
display: inline-block;
position: absolute;
width: 61px;
height: 60px;
right: -20px;
top: -10px;
.sparkBg("answerPanel/correctIcon.png");
}
.error-icon {
position: absolute;
width: 58px;
height: 54px;
right: -20px;
top: -10px;
display: inline-block;
.sparkBg("answerPanel/errorIcon.png");
}
}
.close {
left: 346px;
top: 1186px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("common/close.png");
}
}
\ No newline at end of file
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './index.less';
import store from '../../store/store';
import { Button } from '@grace/ui';
import { _asyncThrottle } from "../../utils/utils";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
import API from '@/api';
@observer
class AnswerPrizePanel extends React.Component {
constructor(props) {
super(props);
}
handleClose = _asyncThrottle(() => {
ModalCtrl.closeModal()
})
render() {
const { optionName, optionImg } = this.props
return (
<div className="answerPrizePanel modal_center">
<span className="bg"></span>
<div className='prizeimg-con'>
<img className='prizeimg' src={optionImg}></img>
</div>
<div className='prize-name'>{optionName}</div>
<div className='receive' onClick={this.handleClose} ></div>
<div className='tip'></div>
<Button className="close" onClick={this.handleClose} />
</div>
);
}
}
export default AnswerPrizePanel;
@import "../../res.less";
.answerPrizePanel {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
left: 82px;
top: 406px;
width: 585px;
height: 671px;
position: absolute;
.sparkBg("ansPrizePanel/ansPrizePanelBg.png");
}
.prizeimg-con {
width: 230px;
height: 230px;
left: 270px;
top: 586px;
position: absolute;
.sparkBg("ansPrizePanel/prizebg.png");
.prizeimg {
width: 210px;
height: 210px;
left: 10px;
top: 10px;
position: absolute;
}
}
.prize-name {
text-align: center;
width: 540px;
height: 210px;
left: 105px;
top: 835px;
position: absolute;
font-size: 24px;
color: rgb(1, 1, 1);
}
.receive {
width: 510px;
height: 138px;
left: 120px;
top: 885px;
position: absolute;
.sparkBg("ansPrizePanel/receivedBtn.png");
}
.tip {
width: 410px;
height: 23px;
left: 170px;
top: 1020px;
position: absolute;
.sparkBg("ansPrizePanel/tip.png");
}
.close {
left: 346px;
top: 1186px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("ansPrizePanel/closeBtn.png");
}
}
\ No newline at end of file
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './index.less';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import { Button, Toast } from '@grace/ui';
import { _asyncThrottle, formatThousand } from '@/utils/utils';
import Countdown from '@/core/components/ComCountdown/index.jsx';
import store from '@/store/store';
/* 电话号码验证规则 **/
export const REG_TEL = /^1[0-9]{10}$/;
@observer
class RedPackCountPanel extends React.Component {
constructor(props) {
super(props);
}
close = () => {
ModalCtrl.closeModal()
}
render() {
const { redRainCountDownTime } = store.indexData
return (<>
<div className="redPackCountPanel modal_center">
<span className="bg"></span>
<div>
<Countdown
leftT={redRainCountDownTime * 1000}
renderText={data => {
let { day, hour, minute, second } = data
let hourNum = Number(day) * 24 + Number(hour);
hourNum = hourNum >= 10 ? hourNum + "" : '0' + hourNum;
minute = minute + "";
second = second + ""
return <div className="panel_time_box">
{hourNum.split('').map((el, index) => {
return <span className='panel_time_num' key={index}>{el}</span>
})}
<span>:</span>
{minute.split('').map((el, index) => {
return <span className='panel_time_num' key={index}>{el}</span>
})}
<span>:</span>
{second.split('').map((el, index) => {
return <span className='panel_time_num' key={index}>{el}</span>
})}
</div>
}}
countdownOver={() => store.updateIndex()}
/>
</div>
<Button className="iknow" onClick={this.close}></Button>
<Button className="close" onClick={this.close}></Button>
</div>
</>);
}
}
export default RedPackCountPanel;
@import "../../res.less";
.redPackCountPanel {
left: 82px;
top: 320px;
width: 585px;
height: 656px;
position: absolute;
.bg {
left: 0px;
top: 0px;
width: 585px;
height: 656px;
position: absolute;
.sparkBg("redPackCountPanel/redPackCountPanelBg.png");
// background-size: 585px 611px;
// background-color: #ffffff;
// border-radius: 36px;
}
.panel_time_box {
position: absolute;
width: 550px;
height: 87px;
left: 23px;
top: 251px;
text-align: center;
font-weight: bold;
font-size: 40px;
color: #d26654;
span {
margin: 0 2px;
}
.panel_time_num {
display: inline-block;
width: 60px;
height: 80px;
background-color: #d26654;
border-radius: 20px;
color: rgb(255, 255, 255);
font-weight: bold;
text-align: center;
font-size: 45px;
line-height: 80px;
}
}
.close {
left: 264px;
top: 756px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("redPackCountPanel/closeBtn.png");
}
.iknow {
left: 38px;
top: 504px;
width: 510px;
height: 138px;
position: absolute;
.sparkBg("redPackCountPanel/iknowBtn.png");
}
}
\ No newline at end of file
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './signCom.less';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import { Button, Toast } from '@grace/ui';
import { _asyncThrottle, formatThousand } from '@/utils/utils';
import store from '@/store/store';
import API from '@/api';
import TaskPanel from '@/panels/taskPanel/index.jsx';
@observer
class SignCom extends React.Component {
constructor(props) {
super(props);
}
/** 已签到 */
signedHandle = _asyncThrottle(async () => {
if (!store.judgeActTime()) return
Toast.show("今日已签到")
})
/** 签到 */
signHandle = _asyncThrottle(async () => {
if (!store.judgeActTime()) return
const { success } = await API.doCheckIn();
if (success) {
Toast.show("签到成功")
}
await store.updateIndex();
})
/** 签到-领奖 */
signPrizeHandle = _asyncThrottle(async (item) => {
// 已领奖
if (item.status) return false
// 未签到
const { checkIn } = store.indexData
if (item.days > checkIn?.totalCheckIn) return false
if (!store.judgeActTime()) return
const { endPoint, currentTime } = store.indexData || {}
if (endPoint <= currentTime) {
Toast.show("模拟理财已结束~")
return false
}
const { success } = await API.doRewards({ checkInConfigId: item.id });
if (success) {
Toast.show("领取成功")
}
await store.updateIndex();
})
render() {
const { checkIn } = store.indexData
return (
<div className="sign_section">
<span className="sign_section_bg"></span>
<span className="sign_tips">最高可得{((checkIn?.totalExperienceNum || 0) / 10000).toFixed(0)}万理财体验金</span>
{checkIn?.todayCheckIn
? <Button className="signed_btn md8" onClick={this.signedHandle}></Button>
: <Button className="sign_btn md8" onClick={this.signHandle}></Button>
}
<span className="sign_total_tips">{`已累计签到${checkIn?.totalCheckIn}天`}</span>
<span className="sign_big_btn" onClick={() => {
if (!store.judgeActTime()) return;
ModalCtrl.showModal(TaskPanel)
}}>{`再领${checkIn?.totalCheckIn}万理财体验金`}</span>
<div className="sign_progress">
<span className="progress_bg"></span>
<div className="progress_bar_box">
<div className="progress_bar" style={{ width: `${store.percent}%` }}></div>
</div>
{checkIn?.checkInConfig?.map((item, index) => {
return (
<div
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 || 0) / 10000).toFixed(0)}<span className="unit"></span></div>
<span className="prize_day">累计{item.days}</span>
</div>
)
})}
</div>
</div>
);
}
}
export default SignCom;
@import "../../res.less";
.sign_section {
width: 713px;
height: 433px;
left: 19px;
// top: 1521px;
position: relative;
margin-top: 21px;
.sign_section_bg {
width: 712px;
height: 433px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("homePage/sign_section_bg.png");
}
.sign_tips {
width: 434px;
height: 24px;
left: 180px;
top: 50px;
position: absolute;
font-size: 24px;
line-height: 24px;
color: rgb(145, 99, 38);
}
.sign_btn {
width: 204px;
height: 73px;
left: 490px;
top: 20px;
position: absolute;
.sparkBg("homePage/sign_btn_bg.png");
font-size: 26px;
line-height: 25px;
color: rgba(220, 80, 63, 1);
font-weight: bold;
.flex_center();
// .breathAnimation();
}
.signed_btn {
width: 211px;
height: 75px;
left: 490px;
top: 20px;
position: absolute;
.sparkBg("homePage/signed_btn_bg.png");
font-size: 26px;
line-height: 25px;
color: rgba(108, 108, 108, 1);
font-weight: bold;
.flex_center();
}
.sign_total_tips {
display: inline-block;
width: 172px;
height: 30px;
left: 27px;
top: 110px;
position: absolute;
font-size: 20px;
color: rgb(145, 99, 38);
line-height: 30px;
text-align: center;
// background-color: #ff3333;
}
.sign_big_btn {
width: 425px;
text-align: center;
height: 98px;
line-height: 98px;
color: #ffffff;
font-weight: bold;
left: 143px;
bottom: 20px;
position: absolute;
font-size: 32px;
.sparkBg("homePage/signBigBtn.png");
}
.sign_progress {
width: 591px;
height: 109px;
left: 60px;
top: 158px;
position: absolute;
.progress_bg {
width: 576px;
height: 20px;
left: 0px;
top: 35px;
position: absolute;
background-color: #f8cec6;
border-radius: 10px;
}
.progress_bar_box {
width: 576px;
height: 20px;
left: 0px;
top: 35px;
position: absolute;
.progress_bar {
width: 0%;
height: 20px;
left: 0px;
top: 0px;
position: absolute;
background-image: linear-gradient(90deg, rgb(253, 118, 95) 8%, #ff3333 100%);
border-radius: 10px 10px 10px 10px;
}
}
.step_item {
width: 71px;
height: 109px;
left: 72px;
top: 0px;
position: absolute;
&.step_item2 {
left: 216px;
}
&.step_item3 {
left: 359px;
}
&.step_item4 {
left: 510px;
}
&.locked .prize_bg {
.sparkBg("homePage/prize_locked.png");
}
&.signed .prize_bg {
.sparkBg("homePage/prize_to_receive.png");
}
&.received .prize_bg {
.sparkBg("homePage/prize_received.png");
}
&.locked,
&.received {
.prize_amount {
opacity: 0.7;
}
}
.prize_bg {
width: 71px;
height: 77px;
left: 0px;
top: 0px;
position: absolute;
}
.prize_amount {
width: 100%;
height: 21px;
left: 0px;
top: 12px;
position: absolute;
font-size: 28px;
color: rgba(238, 78, 50, 1);
font-weight: bold;
.flex_center();
.unit {
height: 30px;
font-size: 18px;
line-height: 34px;
}
}
.prize_day {
width: 91px;
height: 19px;
left: -10px;
top: 90px;
position: absolute;
opacity: 0.6;
font-size: 20px;
line-height: 19px;
color: rgba(0, 0, 0, 1);
text-align: center;
}
}
}
}
\ No newline at end of file
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './index.less';
import store from '../../store/store';
import { Button } from '@grace/ui';
import { _asyncThrottle, _throttle } from "../../utils/utils";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
import SignCom from './signCom/signCom';
import API from '@/api';
import taskStore from '@/store/task';
@observer
class TaskPanel extends React.Component {
constructor(props) {
super(props);
this.state = {
taskList: []
}
}
componentDidMount() {
taskStore.queryTaskInfo();
}
// getTaskList = _asyncThrottle(async () => {
// const { success, data } = await API.getTaskList();
// if (success) {
// this.setState({
// taskList: data.item || []
// })
// }
// })
handleClose = _asyncThrottle(() => {
ModalCtrl.closeModal()
})
render() {
const { taskList } = taskStore;
return (
<div className="taskPanel modal_center">
<span className="bg">
<div className='sign-con'>
<SignCom></SignCom>
</div>
<div className='taskList'>
{
taskList.map((el, index) => {
return <div className='taskItem' key={index}>
<img src={el.icon} className='taskIcon' />
<span className='taskTitle'>{`${el.title}(${el.completedSize}/${el.intervalLimit})`}</span>
<span className='taskSubTitle'>{el.subTitle}</span>
{el.taskStatus == 0 && <Button className='goToBtn' onClick={_throttle(() => {
taskStore.doComplete(el)
})}></Button>}
{el.taskStatus == 1 && <Button className='dailingqu'></Button>}
{el.taskStatus == 2 && <Button className='completed'></Button>}
</div>
})
}
</div>
<Button className="close" onClick={this.handleClose} />
</span>
</div>
);
}
}
export default TaskPanel;
@import "../../res.less";
.taskPanel {
width: 750px;
height: 100vh;
left: 0px;
top: 0px;
position: absolute;
.bg {
left: 0px;
bottom: 0px;
width: 750px;
height: 1132px;
position: absolute;
.sparkBg("taskPop/taskBg.png");
}
.sign-con {
left: 18px;
top: 308px;
width: 716px;
height: 323px;
position: absolute;
}
.taskList {
position: absolute;
width: 716px;
left: 18px;
top: 632px;
height: 500px;
overflow-y: scroll;
overflow-x: hidden;
.taskItem {
position: relative;
width: 716px;
height: 133px;
.sparkBg("taskPop/taskItemBg.png");
.taskIcon {
position: absolute;
width: 92px;
height: 92px;
left: 23px;
top: 15px;
border-radius: 46px;
}
.taskTitle {
position: absolute;
width: 430px;
height: 35px;
line-height: 35px;
left: 125px;
top: 25px;
font-size: 29px;
font-weight: bold;
color: rgb(111, 55, 17);
overflow: hidden;
}
.taskSubTitle {
position: absolute;
width: 430px;
height: 35px;
line-height: 35px;
left: 125px;
top: 65px;
font-size: 29px;
color: rgb(137, 101, 50);
font-size: 24px;
overflow: hidden;
}
.goToBtn {
right: 20px;
top: 40px;
width: 127px;
height: 47px;
position: absolute;
.sparkBg("taskPop/goToBtn.png");
}
.dailingqu {
right: 20px;
top: 40px;
width: 127px;
height: 47px;
position: absolute;
.sparkBg("taskPop/receiveBtn.png");
}
.completed {
right: 20px;
top: 40px;
width: 127px;
height: 47px;
position: absolute;
.sparkBg("taskPop/completedBtn.png");
}
}
}
.close {
left: 665px;
top: 99px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("taskPop/closeBtn.png");
}
}
\ No newline at end of file
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './signCom.less';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import { Button, Toast } from '@grace/ui';
import { _asyncThrottle, formatThousand } from '@/utils/utils';
import store from '@/store/store';
import API from '@/api';
import TaskPanel from '@/panels/taskPanel/index.jsx';
@observer
class SignCom extends React.Component {
constructor(props) {
super(props);
}
/** 已签到 */
signedHandle = _asyncThrottle(async () => {
if (!store.judgeActTime()) return
Toast.show("今日已签到")
})
/** 签到 */
signHandle = _asyncThrottle(async () => {
if (!store.judgeActTime()) return
const { success } = await API.doCheckIn();
if (success) {
Toast.show("签到成功")
}
await store.updateIndex();
})
/** 签到-领奖 */
signPrizeHandle = _asyncThrottle(async (item) => {
// 已领奖
if (item.status) return false
// 未签到
const { checkIn } = store.indexData
if (item.days > checkIn?.totalCheckIn) return false
if (!store.judgeActTime()) return
const { endPoint, currentTime } = store.indexData || {}
if (endPoint <= currentTime) {
Toast.show("模拟理财已结束~")
return false
}
const { success } = await API.doRewards({ checkInConfigId: item.id });
if (success) {
Toast.show("领取成功")
}
await store.updateIndex();
})
render() {
const { checkIn } = store.indexData
return (
<div className="task_sign_section">
<span className="sign_section_bg"></span>
<span className="sign_tips">最高可得{((checkIn?.totalExperienceNum || 0) / 10000).toFixed(0)}万理财体验金</span>
{checkIn?.todayCheckIn
? <Button className="signed_btn md8" onClick={this.signedHandle}></Button>
: <Button className="sign_btn md8" onClick={this.signHandle}></Button>
}
<div className="sign_progress">
<span className="progress_bg"></span>
<div className="progress_bar_box">
<div className="progress_bar" style={{ width: `${store.percent}%` }}></div>
</div>
{checkIn?.checkInConfig?.map((item, index) => {
return (
<div
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 || 0) / 10000).toFixed(0)}<span className="unit"></span></div>
<span className="prize_day">累计{item.days}</span>
</div>
)
})}
</div>
</div>
);
}
}
export default SignCom;
@import "../../../res.less";
.task_sign_section {
width: 712px;
height: 323px;
position: relative;
.sign_section_bg {
width: 712px;
height: 323px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("taskPop/signPartBg.png");
}
.sign_tips {
width: 434px;
height: 24px;
left: 25px;
top: 70px;
position: absolute;
font-size: 24px;
line-height: 24px;
color: rgb(145, 99, 38);
}
.sign_btn {
width: 202px;
height: 72px;
left: 478px;
top: 22px;
position: absolute;
.sparkBg("taskPop/signBtn.png");
}
.signed_btn {
width: 202px;
height: 72px;
left: 478px;
top: 22px;
position: absolute;
.sparkBg("taskPop/signedBtn.png");
}
.sign_total_tips {
display: inline-block;
width: 172px;
height: 30px;
left: 27px;
top: 110px;
position: absolute;
font-size: 20px;
color: rgb(145, 99, 38);
line-height: 30px;
text-align: center;
// background-color: #ff3333;
}
.sign_progress {
width: 591px;
height: 109px;
left: 60px;
top: 158px;
position: absolute;
.progress_bg {
width: 576px;
height: 20px;
left: 0px;
top: 35px;
position: absolute;
background-color: #f8cec6;
border-radius: 10px;
}
.progress_bar_box {
width: 576px;
height: 20px;
left: 0px;
top: 35px;
position: absolute;
.progress_bar {
width: 0%;
height: 20px;
left: 0px;
top: 0px;
position: absolute;
background-image: linear-gradient(90deg, rgb(253, 118, 95) 8%, #ff3333 100%);
border-radius: 10px 10px 10px 10px;
}
}
.step_item {
width: 71px;
height: 109px;
left: 72px;
top: 0px;
position: absolute;
&.step_item2 {
left: 216px;
}
&.step_item3 {
left: 359px;
}
&.step_item4 {
left: 510px;
}
&.locked .prize_bg {
.sparkBg("taskPop/lockIcon.png");
}
&.signed .prize_bg {
.sparkBg("taskPop/daiLingquIcon.png");
}
&.received .prize_bg {
.sparkBg("taskPop/receivedIcon.png");
}
&.locked,
&.received {
.prize_amount {
opacity: 0.7;
}
}
.prize_bg {
width: 68px;
height: 73px;
left: 0px;
top: 0px;
position: absolute;
}
.prize_amount {
width: 100%;
height: 21px;
left: 0px;
top: 12px;
position: absolute;
font-size: 28px;
color: rgba(238, 78, 50, 1);
font-weight: bold;
.flex_center();
.unit {
height: 30px;
font-size: 18px;
line-height: 34px;
}
}
.prize_day {
width: 91px;
height: 19px;
left: -10px;
top: 90px;
position: absolute;
opacity: 0.6;
font-size: 20px;
line-height: 19px;
color: rgba(0, 0, 0, 1);
text-align: center;
}
}
}
}
\ No newline at end of file
import { PAGE_MAP, SEND_TYPE, SHARE_TYPE } from '@src/utils/constants';
import { isWeChat, onUpdateShare } from '@src/utils/share';
import store from '.';
import API from '../api/index';
import { makeAutoObservable } from 'mobx';
import { getQRCode, getUrlParam } from '@src/utils/utils';
import { Toast } from '@spark/ui';
import { appShare } from '@src/AppTool';
import modalStore from './modal';
const shareStore = makeAutoObservable({
/**
* 分享
*/
qrLinkImg: "",
async doShare(type, posterFlag = false, callback = () => { }) {
// 分享邀请链接
const defaultShareUrl = `${CFG.domain}${CFG.shareUrl}`
const {
// 普通分享分享信息
title,
content,
thumbnail,
// 邀请分享信息
invite_title,
invite_content,
invite_thumbnail,
} = store.frontVariable?.shareInfo || {}
let params = {
title: title, // 标题
content: content, // 描述
thumbnail: thumbnail, // 图片
url: defaultShareUrl // 链接
};
let resData = {};
switch (type) {
// 普通分享
case SHARE_TYPE.SHARE:
break;
// 邀请分享
case SHARE_TYPE.INVITE:
resData = await API.getInviteCode()
if (resData?.success) {
const url = resData?.data?.inviteCode
? `${CFG.domain}${CFG.shareUrl}&type=${SHARE_TYPE.INVITE}&inviteCode=${resData.data.inviteCode}`
: defaultShareUrl // 链接
params = {
title: invite_title, // 标题
content: invite_content, // 描述
thumbnail: invite_thumbnail, // 图片
url: url
}
shareStore.qrLinkImg = await getQRCode(url);
} else {
shareStore.qrLinkImg = await getQRCode(defaultShareUrl);
}
break;
default:
break;
}
console.info('分享信息', params);
!posterFlag && appShare(params)
callback()
},
/** 落地页-二次分享初始化 */
async initSharePageShare() {
const {
// 普通分享分享信息
title,
content,
thumbnail,
// 邀请分享信息
invite_title,
invite_content,
invite_thumbnail,
} = store.frontVariable?.shareInfo || {}
let params = {}
const inviteCode = getUrlParam("inviteCode")
if (inviteCode) {
params = {
title: invite_title, // 标题
content: invite_content, // 描述
thumbnail: invite_thumbnail, // 图片
url: window.location.href // 链接
}
} else {
params = {
title: title, // 标题
content: content, // 描述
thumbnail: thumbnail, // 图片
url: window.location.href // 链接
}
}
onUpdateShare(params)
},
/**
* 清空链接上的分享参数 助力码/卡片id/分享类型
*/
async clearShareParams() {
CFG.type = '';
let _url = location.href.replace(new RegExp(`[?&]inviteCode=[^&]*`), '')
history.replaceState({}, '', _url);
},
/**
* 唤端后自动处理助力/收卡
*/
async toAutoHelp() {
const inviteCode = getUrlParam("inviteCode")
if (!!inviteCode) {
shareStore.toAssist(inviteCode)
}
},
/**
* 助力
*/
async toAssist(inviteCode) {
if (inviteCode) {
const { success, data } = await API.doAssist({ inviteCode });
if (success) {
const obj = data.extra ? JSON.parse(data.extra) : {};
if (data.options && Array.isArray(data.options) && data.options[0]) {
obj.optionName = data.options[0].optionName;
obj.optionImg = data.options[0].optionImg;
}
modalStore.pushPop('Pkmaindialog', { data: obj, result: obj.result == 0 ? obj.result : obj.result == 1 ? -1 : 1 });
}
// if (success) {
// todo PK
// Toast("助力成功,一起参加活动吧~")
// }
this.clearShareParams();
}
},
});
export default shareStore;
...@@ -72,6 +72,9 @@ class Store { ...@@ -72,6 +72,9 @@ class Store {
bigStartConfig?: Array<{ bigStartConfig?: Array<{
prizeImg?: string, prizeImg?: string,
titleImg?: string, titleImg?: string,
min?: number,
max?: number,
unlockedPrizeImg?: string,
}>, }>,
// 首次体验金弹窗 // 首次体验金弹窗
firstMoneyPop?: { firstMoneyPop?: {
...@@ -181,46 +184,46 @@ class Store { ...@@ -181,46 +184,46 @@ class Store {
this.updateFundInfo(codeList) this.updateFundInfo(codeList)
} }
if(giftPop && !this.showGiftPop) { if (giftPop && !this.showGiftPop) {
this.showGiftPop = true; this.showGiftPop = true;
ModalCtrl.showModal(NewbieModal, {type: giftPop?.type, actPrizeVO: giftPop?.actPrizeVO}) ModalCtrl.showModal(NewbieModal, { type: giftPop?.type, actPrizeVO: giftPop?.actPrizeVO })
} }
} }
judgeRedModal() { judgeRedModal() {
const redRainConfig = this.indexData?.redRainConfig const redRainConfig = this.indexData?.redRainConfig
// 红包雨时间段判断 // 红包雨时间段判断
const everyJoinStatus = redRainConfig?.some(item => !item?.joinStatus); const everyJoinStatus = redRainConfig?.some(item => !item?.joinStatus);
if(everyJoinStatus) { if (everyJoinStatus) {
const len = redRainConfig?.length; const len = redRainConfig?.length;
for(let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
const redItem = redRainConfig?.[i]; const redItem = redRainConfig?.[i];
const redStart = getTimeStamp(redItem?.startTime); const redStart = getTimeStamp(redItem?.startTime);
const redEnd = getTimeStamp(redItem?.endTime); const redEnd = getTimeStamp(redItem?.endTime);
// 看看是不是在开始的场次之前 那就直接等最开始的倒计时就行了 // 看看是不是在开始的场次之前 那就直接等最开始的倒计时就行了
if(this.indexData.currentTime < redStart) { if (this.indexData.currentTime < redStart) {
this.leftOpenTime = redStart - this.indexData.currentTime; this.leftOpenTime = redStart - this.indexData.currentTime;
break; break;
} }
if(this.indexData.currentTime >= redStart && this.indexData.currentTime <= redEnd && !redItem?.joinStatus) { if (this.indexData.currentTime >= redStart && this.indexData.currentTime <= redEnd && !redItem?.joinStatus) {
// 在时间段内,显示红包雨弹窗 // 在时间段内,显示红包雨弹窗
ModalCtrl.showModal(RedPackRainModal, {redRainId: redItem?.rainId}); ModalCtrl.showModal(RedPackRainModal, { redRainId: redItem?.rainId });
break; break;
} }
// 看看是不是最后一场之后 那就直接等第二天的时间 // 看看是不是最后一场之后 那就直接等第二天的时间
if(this.indexData.currentTime > redEnd && i == len - 1) { if (this.indexData.currentTime > redEnd && i == len - 1) {
const firstStart = getTimeStamp(redRainConfig?.[0]?.startTime); const firstStart = getTimeStamp(redRainConfig?.[0]?.startTime);
this.leftOpenTime = firstStart + 24 * 60 * 60 * 1000 - this.indexData.currentTime; this.leftOpenTime = firstStart + 24 * 60 * 60 * 1000 - this.indexData.currentTime;
break; break;
} }
} }
if(this.leftOpenTime > 0) { if (this.leftOpenTime > 0) {
this.leftOpenId = setTimeout(async() => { this.leftOpenId = setTimeout(async () => {
await this.updateIndex(); await this.updateIndex();
this.judgeRedModal(); this.judgeRedModal();
clearTimeout(this.leftOpenId); clearTimeout(this.leftOpenId);
......
import API from '@/api';
import { makeAutoObservable } from 'mobx';
import store from './store';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import AnswerPanel from '@/panels/answerPanel';
const taskStore = makeAutoObservable({
// 任务列表
taskInfo: {},
taskList: [],
setTaskInfo(data) {
this.taskInfo = data || {};
},
async queryTaskInfo() {
const { data, success } = await API.getTaskList();
if (data && success) {
this.setTaskInfo(data || {});
const arr1 = data.item.filter((el) => { return Number(el.taskStatus) === 1; });
const arr2 = data.item.filter((el) => { return Number(el.taskStatus) === 0; });
const arr3 = data.item.filter((el) => { return Number(el.taskStatus) === 2; });
this.taskList = arr1.concat(arr2, arr3);
}
},
// 完成任务
completeInfo: {},
setCompleteInfo(data) {
this.completeInfo = data || {};
},
async doComplete(item) {
if (!store.judgeActTime()) return;
const { code, jumpUrl, extra, id } = item;
if (code === 'invite') {
// 邀请
}
if (code === 'answer') {
// 答题
ModalCtrl.showModal(AnswerPanel)
}
if (code === 'fxcp') {
// 风险测评
}
if (code === 'csbj') {
// 花完初始本金
}
},
async completeTask(code, id) {
const { success, data } = await API.doCompleted({ taskCode: code, id: id });
if (success) {
this.setCompleteInfo(data || {});
await this.queryTaskInfo();
}
},
// 领奖
sendPrizeInfo: {},
setSendPrizeInfo(data) {
this.sendPrizeInfo = data || {};
},
async sendPrize(prizecode, taskcode) {
const { success, data } = await API.sendPrize({ prizePendingCode: prizecode, taskCode: taskcode });
if (success) {
this.setSendPrizeInfo(data);
} else {
this.sendPrizeInfo = {};
}
},
});
export default taskStore;
import {
start,
updateShare,
callShare,
Weixin,
} from "@spark/share"
/**
* @description: 小程序跳转
* @param {*}
* @return {*}
*/
export const miniGoUrl = (url) => {
wx.miniProgram.navigateTo({ url: url });
}
/**
* 判断是否为ios系统
*/
export function isIos() {
return navigator.userAgent.match(/iphone|ipod|ipad/gi)
}
/** 判断微信环境 */
export function isWeChat() {
const ua = window.navigator.userAgent.toLowerCase()
return ua.match(/MicroMessenger/i) == 'micromessenger'
}
/**
* 初始化分享
*/
export async function onInitShare(cb) {
await start([Weixin], function (success) {
console.log("share result:----", success)
cb && cb()
})
}
/**
* 更新分享
* @param {*} shareParams
* @param {*} justUpdate
*/
export function onUpdateShare(shareParams) {
console.info("更新分享", shareParams)
updateShare(shareParams)
}
/**
* 被动分享 - 北京银行
* @param {*} shareParams
*/
export function onCallShare(shareParams) {
console.info("分享链接", shareParams)
callShare(shareParams);
}
/**
* @description: 分享处理中心
* @param {Object} 分享信息
*/
export const requireShare = (opts) => {
const shareData = {
title: opts.shareTitle,
content: opts.shareContent,
url: opts.shareUrl,
images: [{ image: opts.shareThumbnail, type: "url" }],
};
console.log('分享数据', opts);
const shareStr = JSON.stringify(shareData);
return shareStr;
};
/**
* @description: 小程序分享
* @param {*}
* @return {*}
*/
export const miniDoShare = (opts) => {
console.log(opts);
wx.miniProgram.postMessage({
data: {
title: opts.title, // 标题
desc: opts.desc, // 描述
imgUrl: opts.imgUrl, // 图片
link: opts.link // 链接
}
});
}
......
...@@ -209,7 +209,7 @@ export const dealTime2 = (msTime) => { ...@@ -209,7 +209,7 @@ export const dealTime2 = (msTime) => {
let hour: number | string = Math.floor(time / 60 / 60) % 24; let hour: number | string = Math.floor(time / 60 / 60) % 24;
let minute: number | string = Math.floor(time / 60) % 60; let minute: number | string = Math.floor(time / 60) % 60;
let second: number | string = Math.floor(time) % 60; let second: number | string = Math.floor(time) % 60;
day = day > 9? day : "0" + day; day = day > 9 ? day : "0" + day;
hour = hour > 9 ? hour : "0" + hour; hour = hour > 9 ? hour : "0" + hour;
minute = minute > 9 ? minute : "0" + minute; minute = minute > 9 ? minute : "0" + minute;
second = second > 9 ? second : "0" + second; second = second > 9 ? second : "0" + second;
...@@ -452,17 +452,43 @@ export const formatThousand = (num) => { ...@@ -452,17 +452,43 @@ export const formatThousand = (num) => {
// 将时间点转换为今天的时间戳 // 将时间点转换为今天的时间戳
export const getTimeStamp = (timeStr) => { export const getTimeStamp = (timeStr) => {
if(!timeStr) return if (!timeStr) return
const today = new Date(); const today = new Date();
const [hours, minutes, seconds = '00'] = timeStr.split(':'); const [hours, minutes, seconds = '00'] = timeStr.split(':');
today.setHours(parseInt(hours, 10)); today.setHours(parseInt(hours, 10));
today.setMinutes(parseInt(minutes, 10)); today.setMinutes(parseInt(minutes, 10));
today.setSeconds(parseInt(seconds, 10)); today.setSeconds(parseInt(seconds, 10));
today.setMilliseconds(0); today.setMilliseconds(0);
console.error("123", today.getTime()) console.error("123", today.getTime())
return today.getTime(); return today.getTime();
} }
/** 跳转 */
export const windowJumpUrl = (url) => {
url && (location.href = url);
};
/** 渠道 */
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",
};
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