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

feat: 弹窗ok

parent bcdaccbf
......@@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000">
<link rel="dns-prefetch" href="//yun.duiba.com.cn" />
<link rel="preconnect" href="//embedlog.duiba.com.cn">
<title>天天领积分</title>
<title>模拟理财 月度争霸赛</title>
<script type="text/javascript">
if (localStorage && localStorage.isWebp) {
document
......@@ -18,6 +18,8 @@
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- 华夏银行app文件 -->
<script src="//yun.duiba.com.cn/polaris/hxbExtLib.min.f2e3022c5ce5dd92689bff0a5b6c5cb0e9193cd1.js"></script>
<script>
var CFG = CFG || {};
CFG.projectId = location.pathname.split('/')[2] || '1';
......@@ -31,25 +33,20 @@
}
CFG.appID = '${APPID}';
// 新小程序会传version=hg 旧小程序不会传
CFG.version = getUrlParam('version') || sessionStorage.getItem('version');
CFG.version && sessionStorage.setItem("version", CFG.version);
CFG.isNewMiniVersion = CFG.version == 'hg';
CFG.subUrl = (CFG.isNewMiniVersion ? `/packages/activityCenter/subscibe` : `/pagesNews/subscribeMiddlePage/subscribeNews`) +
"?source=duiba&subId=1932371142070181890&activeNo=" + CFG.projectId + "&activityUrl=" + encodeURI(location.href)
CFG.index = '/projectx/' + CFG.projectId + '/index.html?appID=' + CFG.appID;
// 免登中间页id
CFG.loginMidId = "Did1NjAwMDc"; // 线上正式
if (location.href.indexOf("duibatest") > -1) {
CFG.loginMidId = "Did1MTM2NTU"; // 测试
} else if (CFG.projectId == 'p69bb35bf') { // TODO 线上测试id
CFG.loginMidId = "Did1NTk5OTk"; // 线上测试
CFG.domain = location.origin
// 渠道
CFG.channel = getUrlParam("channel");
// 首页
CFG.index = '/projectx/' + CFG.projectId + '/index.html?appID=' + CFG.appID + '&channel=' + CFG.channel;
// 提示弹窗二维码短链链接(目的页是 首页xx/index.html) 线上正式 TODO 域名记得改为dexfu的
CFG.prizePageQrcodeUrl = "https://hxlc90548.activity-29.m.duiba.com.cn/outActivity/12hy";
if (location.origin.indexOf("duibatest") > -1) {
// 测试环境
CFG.prizePageQrcodeUrl = CFG.domain + "/projectx/" + CFG.projectId + "/index.html?appID=" + CFG.appID + "&channel=9"
} else if (CFG.projectId == 'p5185b9f0') {
// 线上测试
CFG.prizePageQrcodeUrl = "https://hxlc90548.activity-29.m.duiba.com.cn/outActivity/12hw"
}
// 免登中间页
CFG.loginMidUrl = "/customShare/share?id=" + CFG.loginMidId + "&source=duiba&projectId=" + CFG.projectId + "&redirectUrl=";
if (!getUrlParam("appID")) {
......
export default [
{
url: "/customActivity/qrcode/getQrcode",
response: ({ query }) => {
return {
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1561085307121,
"data": "data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAIgAAACICAIAAACz2DQFAAADpklEQVR42u3cXVLDMAxG0bL/RYcFMLTRpys5AzfDU4H8+GRqW5L9er2+Oj/Xj+Pnr9588uY82b9nJ3xz5uYjx636EkYYYSKYq3KUno0yKzVWdvPZ+zFxCWGEEaYJc+f5s7ss3S7e1ZXuh3rkuFWFEUaYszDUcLlpX7pE1ns1H1kYYYR5IExzeNpsPqpfzDyEEUaYB8JQM//s23nuEtRgfSe4IIwwwmQwR77B//wn5xNlfiLM/4C56AMP9s2Nv7PJfHPycLcZhRFGGAgmu8vNhDTeQU40cZadEkYYYUowWfQQD0c2Mz1U4DVTxMO+wggjTB+mWZ7SLHyhRq54hpsax988szDCCFOCmXtaKjqAz8/x4Cw1bhZGGGEmYBY6m83J/NzovxnoFEYYYUAYfO49Nz+nQgkLIYk4PySMMMJkMM0mbt4Tvv7h7Ji4X/UojDDCZDDZ/HwhXTH3oiy8Q3EkVxhhhCnBUGtHKbNmLGDhrWq+TLM5f2GE+a8w1GWo0Taeh8YTPPgGBHejy8III0wvg9n8Dp2rF5xL91Jz+LgbE0YYYSgYqo9ZmJZTdSo7aeM7L4EwwghTgjnb6PhiidGlEez9fKiSEUYYYSowc+neuaq+5rC7OUbH0+EfgpjCCCPMDRhq1cSRSjsqwz33CsbPLowwwpRg8PK1uX9v9jHUYhKcs1zwJ4wwwkS1y/iWRnjg4OwCj4mld8III0wGQ+Vi52KOm1dvdlr97LUwwghTgsF3IKIKX46cOYPBx9bCCCPMaNj/SOwSr7Zp3gZePPShSkYYYYS5AUNVgWTnyV6CZhtlQ+HmtYAqGWGEEeZ3mOY+QUfqBSlyvMwFfEBhhBGmWe1PrUGd2xlkYUdOvEepnkcYYYQpwcx9q24mrfHtfTd30sw3khNGGGF+D/tvbiJJhSObHVtzRI7vMSeMMMLEMAu7dYxOlYfej4XN78pVMsIIIwy0DGNuLRaVoaFiqVR+vfouCiOMMBkMNUPGi2Oo0XZz4ItPHt7/jTDCCFOCmStYWTjPwl5LR3YQEEYYYaowF3RQS0/nFps9drD+ofMXRhhhbsDM7S85txkl1SFR7ThxP8III0wGg/comxV7VMB0QfpmIwgjjDBNmLmtkagkMb5N8FyHRIZkhBFGmEWYh8yi56qZqQ6yvO+yMMIIMw+zkADGq4epcfzEAjlhhBGmCUPdCvUAcyU1+N+AnZYwwgiTweDb4B7Be1qjxzl4YYQRpgRzeTzy+Ab6uj5St1Zt0AAAAABJRU5ErkJggg=="
}
}
}
]
\ No newline at end of file
export default [
{
url: '/main/index.do',
url: '/home/isWhiteUser.do',
response: ({ query }) => {
return {
success: true,
code: "60002",
// code: "60001",
message: "",
timeStamp: Date.now(),
data: null
}
},
},
{
url: '/home/index.do',
response: ({ query }) => {
const signDay = Math.random() * 7 >> 0;
return {
......@@ -10,59 +23,97 @@ export default [
message: "",
timeStamp: Date.now(),
data: {
actStartTime: Date.now() - 1000000,
actEndTime: Date.now() + 1000000,
currentTime: Date.now(),
guideFlag: true,
creditsNum: 923,
expireDays: 7,
currentStoreNum: 1000,
storeLimitNum: 1000,
continueSignDays: 3,
todaySignFlag: false,
signRecords: new Array(7).fill(1).map((_, index) => {
return {
id: index,
day: index + 1,
creditsNum: 100 + Math.random() * 100 >> 0,
boolSign: index < signDay,
actStartTime: Date.now() - 1 * 24 * 60 * 60 * 1000,
actEndTime: Date.now() + 3 * 24 * 60 * 60 * 1000,
myEndTime: Date.now() + 1 * 24 * 60 * 60 * 1000,
uid: '234234',
ruleText: 'rulerulerulerulerulerulerule',
"bigStartConfig": [
{
"prizeImg": "Duis Excepteur cupidatat",
"titleImg": "sint magna sunt dolore"
},
{
"prizeImg": "non fugiat culpa ad",
"titleImg": "cillum id ex laborum"
}
}),
overflowBubble: {
creditsNum: 700,
expireTime: 1747819895773,
id: 218093371,
],
"firstMoneyPop": {
"agreementText": "文案文案文案文案文案文案文案文案 文案文案文案文案",
"experienceNum": 59442359
},
bubbleRecords: new Array(1 + (Math.random() * 4 >> 0)).fill(1).map((_, index) => {
firstMoneyPop: null,
"virtualAssets": {
"preDayIncome": "pariatur labore esse enim nulla",
"availableFunds": "pariatur ullamco",
"totalMoney": "eu eiusmod aute nisi",
"realBuyJumpUrl": "anim consectetur dolor",
"totalIncome": "sunt non"
},
"checkIn": {
"totalCheckIn": "Excepteur",
"checkInConfig": [
{
"days": "tempor in esse",
"experienceNum": "et qui",
"status": "exercitation"
},
{
"days": "laborum",
"experienceNum": "voluptate ea",
"status": "culpa in quis consectetur"
}
]
},
"recommendProductConfig": new Array(7).fill(1).map((_, index) => {
return {
id: index,
creditsNum: 100 + Math.random() * 100 >> 0,
expireTime: Date.now() + 10000 + (Math.random() * 10 >> 0) * 1000,
type: 1 + Math.random() * 2 >> 0,
"name": `产品${index + 1}`,
"shenShuGuiZei": "elit eiusmod",
"touZiQiXianText": "non in id aliquip cillum",
"qigouText": "nisi velit ipsum",
"baiFenBiText": "veniam ut sunt",
"fengXian": "officia laborum reprehenderit enim",
"code": "adipisicing",
"status": "dolor cul",
"realBuyJumpUrl": `https://www.baidu.com?t=${index}`
}
}),
returnAwardCreditsNum: 0,
downGoldVo: {
creditsNum: 100,
multipleValue: 5,
taskId: "5555555",
url: "urlurlurlurlurlurl",
},
downGoldVo: null,
"codeList": [
"23112008P",
"consectetur",
"non",
"tempor"
],
}
}
},
},
{
url: '/main/completeGuide.do',
url: '/home/coop_sendCode.do',
method: 'post',
response: ({ query }) => {
return {
success: true,
code: "",
message: "",
data: {
creditsNum: 100,
"code": "magna laborum amet",
"data": {
"code": 0, // 状态码(0 表示成功 0100 短信验证码发送失败)
"errorMsg": '错误信息', // 错误信息
},
"message": "nostrud aliqua irure dolore mollit",
"success": true,
"timestamp": -15469760.648778364
}
},
},
{
url: '/home/coop_checkCode.do',
method: 'post',
response: ({ query }) => {
return {
"code": "magna laborum amet",
"data": 'http://localhost:5173/?t=1',
"message": "nostrud aliqua irure dolore mollit",
"success": true,
"timestamp": -15469760.648778364
}
},
},
......@@ -86,30 +137,5 @@ export default [
}
},
},
{
url: '/main/receiveBubble.do',
response: ({ query }) => {
return {
success: true,
code: "",
message: "",
data: {
creditNum: 888,
}
}
},
},
{
url: '/main/startVideo.do',
response: ({ query }) => {
return {
success: true,
code: "",
message: "",
data: {
creditNum: 888,
}
}
},
},
]
......@@ -80,6 +80,9 @@ importers:
less:
specifier: ^4.3.0
version: 4.3.0
light-sdk:
specifier: ^3.0.9
version: 3.0.9
mobx:
specifier: ^6.13.7
version: 6.13.7
......@@ -1662,7 +1665,7 @@ packages:
resolution: {integrity: sha512-lKTdfDhS38NrgEJaNagk1zgVX69hH8ZAi9vdpD3+G20EI5S+4W7bB/L+G9BpwsltJpeKAhOxnK0d31DGgD2zRg==}
'@spark/circle-turntable@1.0.3':
resolution: {integrity: sha512-oJBskZlBFmuNQRmg7/OfkZ+T903f9+XMosWklbhnRNKBEwckYXR+ml+c8m1YVhgGjixFwdxtGaIY8BHtYUxBbg==, tarball: http://npm.dui88.com:80/@spark%2fcircle-turntable/-/circle-turntable-1.0.3.tgz}
resolution: {integrity: sha512-oJBskZlBFmuNQRmg7/OfkZ+T903f9+XMosWklbhnRNKBEwckYXR+ml+c8m1YVhgGjixFwdxtGaIY8BHtYUxBbg==}
peerDependencies:
react: ^17.0.2
react-dom: 17.0.2
......@@ -2409,7 +2412,7 @@ packages:
resolution: {integrity: sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=}
db-react-helper@1.0.5:
resolution: {integrity: sha512-J4+DXr/Ah7t+/j96m73WzJ26VUfHzE5MxWj7kS62SV7iKCb5LTTcngWvn4jmpQnF54WAkhOjBt8sY6B+RkDPPA==, tarball: http://npm.dui88.com:80/db-react-helper/-/db-react-helper-1.0.5.tgz}
resolution: {integrity: sha512-J4+DXr/Ah7t+/j96m73WzJ26VUfHzE5MxWj7kS62SV7iKCb5LTTcngWvn4jmpQnF54WAkhOjBt8sY6B+RkDPPA==}
debug@2.6.9:
resolution: {integrity: sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=}
......@@ -3240,7 +3243,7 @@ packages:
engines: {node: '>=8'}
less-loader@11.1.4:
resolution: {integrity: sha512-6/GrYaB6QcW6Vj+/9ZPgKKs6G10YZai/l/eJ4SLwbzqNTBsAqt5hSLVF47TgsiBxV1P6eAU0GYRH3YRuQU9V3A==, tarball: http://npm.dui88.com:80/less-loader/-/less-loader-11.1.4.tgz}
resolution: {integrity: sha512-6/GrYaB6QcW6Vj+/9ZPgKKs6G10YZai/l/eJ4SLwbzqNTBsAqt5hSLVF47TgsiBxV1P6eAU0GYRH3YRuQU9V3A==}
engines: {node: '>= 14.15.0'}
peerDependencies:
less: ^3.5.0 || ^4.0.0
......@@ -3256,7 +3259,10 @@ packages:
engines: {node: '>= 0.8.0'}
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}
light-sdk@3.0.9:
resolution: {integrity: sha512-Bdj/9EfHXGpl8absBN02KJhkztbAVOFE70GgcTvMr1Qkc2LrvVOfAphjl7PSoIwkK/bN/un3xwhroh5NVUz/eA==, tarball: http://npm.dui88.com:80/light-sdk/-/light-sdk-3.0.9.tgz}
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}
......@@ -4426,7 +4432,7 @@ packages:
typescript: '>=4.8.4'
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==, tarball: http://npm.dui88.com:80/tslib/-/tslib-2.8.1.tgz}
type-check@0.4.0:
resolution: {integrity: sha1-B7ggO/pwVsBlcFDjzNLDdzC6uPE=}
......@@ -8021,6 +8027,8 @@ snapshots:
light-sdk@2.0.36: {}
light-sdk@3.0.9: {}
lightningcss-darwin-arm64@1.29.1:
optional: true
......
......@@ -29,8 +29,8 @@ class App extends Component {
const skinId = GetCurrSkinId() || getCustomShareId();
const defaultPage = {
myPrize: MyPrize, // TODO 举例子 新宿台奖品页
index: LoadingDemo,
}[skinId] || DetailPage;
index: HomePage,
}[skinId] || HomePage;
PageCtrl.changePage(defaultPage);
}
......@@ -38,7 +38,7 @@ class App extends Component {
this.showDefaultPage();
await store.getFrontVariable();
store.initShare()
// store.initShare()
}
componentWillUnmount() {
......
......@@ -18,18 +18,18 @@ 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",
// /** 三方合作APP-南粤银行 */
// NANYUE: "3",
// /** 三方合作APP-紫金 */
// ZIJIN: "4",
// /** 三方合作APP-中信 */
// ZHONGXIN: "5",
// /** 三方合作APP-河北 */
// HEBEI: "6",
// /** 三方合作APP-渤海 */
// BOHAI: "7",
// /** 母行备选渠道 手机号登录模式 投放母行app外 相当于三方合作APP */
// HXBANK_TEL: "8",
/** 下线弹窗二维码入口进入 */
OFFLINE_QRCODE: "9",
};
......@@ -38,25 +38,7 @@ export const CHANNEL = {
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 华夏理财APP 端内方法 start =========== */
/**
* 获取基金产品详情(app端/微信端)
* @returns
......@@ -99,7 +81,7 @@ function ready(callback) {
}
}
function bfSearchMenu(param, callback) {
function bfSearchMenu(param, callback?: any) {
window.AlipayJSBridge.call('BFSearchMenuHandler', {
param: param,
}, callback)
......@@ -118,15 +100,27 @@ export function appJump(url) {
}
/** 跳转行方页面-华夏理财 */
export function hxlcAppJump(fundcode) {
const navBarStyle = { 'backgroundColor': '#d20a10' }
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 华夏理财APP 端内方法 end =========== */
/** 跳转方法 区分app */
export function diffJump(url) {
if (CFG.channel == CHANNEL.BOHAI) { // 渤海银行
boHaiAppJump(url)
} else if (CFG.channel == CHANNEL.HXLC) { // 华夏理财
if (CFG.channel == CHANNEL.HXLC) { // 华夏理财
hxlcAppJump(url)
} else if (CFG.channel == CHANNEL.HXBANK) { // 华夏银行
appJump(url)
} else if (IS_OTHER_APP) { // 其他三方app
} else { // 其他三方app
location.href = url
}
}
......@@ -42,33 +42,32 @@ const API = generateAPI({
showMsg: false,
},
// 挑战-首页
getChallengeIndex: "challenge/index.do",
//挑战-基础首页
getChallengeBaseIndex: "challenge/baseIndex.do",
//挑战-获取邀请码
getChallengeInviteCode: "challenge/inviteCode.do",
// 挑战-助力
getChallengeAssist: {
uri: "challenge/assist.do",
/** 二维码 */
getQrcode: "/customActivity/qrcode/getQrcode",
// 首页
index: "home/index.do",
// 首页-产品参数更新
coop_codeUpdate: "home/coop_codeUpdate.do",
// 首页-白名单限制弹窗
isWhiteUser: {
uri: "home/isWhiteUser.do",
showMsg: false,
},
// 扣积分
queryStatus: "credits/queryStatus.do",
creditsCost: {
uri: "credits/creditsCost.do",
method: "post"
// 首页-校验验证码并登录
coop_checkCode: {
uri: 'home/coop_checkCode.do',
method: 'post',
},
// 奖品
queryOrder: "/customActivity/kouweiwang/prize/queryOrderNo",
index: "main/index.do",
sign: "main/sign.do",
// 首页-发送验证码
coop_sendCode: {
uri: 'home/coop_sendCode.do',
method: 'post',
},
// 签到-签到
doCheckIn: "home/doCheckIn.do",
// 签到-领奖
doRewards: "home/doRewards.do",
tradeRecords: "mncp/tradeRecords.do",
redeem: "mncp/redeem.do",
......
......@@ -24,7 +24,7 @@ interface IRes {
const mergeData = {
user_type: newUser ? '0' : '1',
is_from_share: isFromShare ? '0' : '1',
from: getUrlParam("channel"),
channel: getUrlParam("channel"),
}
// let tempCookieId = "";
......
......@@ -34,11 +34,8 @@ body {
overflow: hidden;
}
.com_banner {
position: fixed;
left: 35px;
bottom: 54px;
width: 684px;
height: 150px;
.webpBg("common/banner.png");
input {
outline: none;
border: none;
}
\ No newline at end of file
......@@ -4,8 +4,9 @@ import './HomePage.less';
import store from "@/store/store.ts";
import { Button, Toast } from "@grace/ui";
import MyPrize from '../MyPrize/MyPrize';
import Rule from '../RulePage/RulePage';
import Rulepop from '@/panels/rulepop/rulepop';
import { PageCtrl } from '@/core/ctrls/PageCtrl';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
@observer
class HomePage extends React.Component<any, any> {
......@@ -13,17 +14,8 @@ class HomePage extends React.Component<any, any> {
root: HTMLDivElement;
async componentDidMount() {
await store.doAssist();
store.updateIndex();
store.getTaskInfo()
store.getBaseIndex()
if (store.frontVariable?.homeTip?.length > 0) {
store.changeHomeTip()
}
// store.queryTask()
// if (getUrlParam('inviteCode')) {
// store.doAssist()
// }
await store.judgeIsWhiteUser();
}
clickPrize = () => {
......@@ -31,7 +23,7 @@ class HomePage extends React.Component<any, any> {
}
clickRule = () => {
PageCtrl.changePage(Rule);
ModalCtrl.showModal(Rulepop)
}
clickCredits = () => {
......@@ -47,7 +39,6 @@ class HomePage extends React.Component<any, any> {
}
componentWillUnmount(): void {
clearTimeout(store.homeTipsCon)
}
render() {
const { creditsNum, guideFlag, actStartTime, currentTime, actEndTime } = store.indexData
......
@import "../../res.less";
.rulepage {
width: 750px;
height: 100%;
left: 0px;
top: 0px;
position: absolute;
overflow-y: auto;
overflow-x: hidden;
.bg {
width: 750px;
height: 4882px;
left: 0px;
top: 0px;
position: absolute;
// .sparkBg("rulePage/bg.png");
}
.back {
left: 20px;
top: 60px;
width: 28px;
height: 43px;
position: absolute;
.webpBg("MyPrize/返回.png");
}
}
\ No newline at end of file
import React from 'react';
import { observer } from 'mobx-react';
import './RulePage.less';
import API from "@/api";
import { PageCtrl } from "@/core/ctrls/PageCtrl.tsx";
import store from "@/store/store.ts";
import HomePage from '../HomePage/HomePage';
@observer
class RulePage extends React.Component<any, any> {
clickBack = () => {
PageCtrl.changePage(HomePage);
}
render() {
const { ruleImg } = store.frontVariable;
return <div className="rulepage">
<img className="bg"
src={ruleImg}
/>
<span className="back" onClick={this.clickBack}></span>
</div>;
}
}
export default RulePage;
\ No newline at end of file
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './firstPop.less';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import { Button, Toast } from '@grace/ui';
import { _asyncThrottle, formatThousand } from '@/utils/utils';
/* 电话号码验证规则 **/
export const REG_TEL = /^1[0-9]{10}$/;
@observer
class FirstPop extends React.Component {
constructor(props) {
super(props);
this.state = {
privacyChecked: false
}
}
// 确认提交
handleSubmit = _asyncThrottle(() => {
const { agreementText } = this.props || {};
if (!!agreementText && !this.state.privacyChecked) { // 未勾选隐私协议
Toast.show(`请先勾选${agreementText}`)
return false
}
ModalCtrl.closeModal()
})
close = () => {
ModalCtrl.closeModal()
}
render() {
const { privacyChecked } = this.state;
const { experienceNum, agreementText } = this.props || {};
return (<>
<div className="firstPop modal_center">
<span className="bg"></span>
<span className="title">理财体验金</span>
<div className="amount">{formatThousand(experienceNum)}<span className="unit"></span></div>
{!!agreementText && <div className="check_box">
<div className={`check_icon ${privacyChecked ? 'checked' : ''}`} onClick={() => this.setState({ privacyChecked: !this.state.privacyChecked })}></div>
<div className="check_text">{agreementText}</div>
</div>}
<Button className="happy_btn" onClick={this.handleSubmit}></Button>
<Button className="close" onClick={this.close}></Button>
</div>
</>);
}
}
export default FirstPop;
@import "../../res.less";
.firstPop {
width: 750px;
height: 1624px;
left: 0;
top: 0;
position: absolute;
.bg {
left: 82px;
top: 488px;
width: 585px;
height: 611px;
position: absolute;
.sparkBg("firstPop/bg.png");
}
.title {
width: 585px;
position: absolute;
left: 82px;
top: 630px;
font-size: 36px;
color: rgba(1, 1, 1, 0.6);
text-align: center;
}
.amount {
width: 585px;
position: absolute;
left: 82px;
top: 700px;
font-size: 90px;
color: rgb(211, 26, 25);
font-weight: bold;
text-align: center;
line-height: 90px;
.unit {
font-size: 40px;
}
}
.happy_btn {
left: 120px;
top: 931px;
width: 510px;
height: 138px;
position: absolute;
.sparkBg("firstPop/happy_btn.png");
}
.check_box {
position: absolute;
left: 159px;
top: 857px;
height: 35px;
line-height: 35px;
font-size: 24px;
color: rgb(155, 155, 155);
margin-bottom: 28px;
font-weight: bold;
display: flex;
align-items: center;
.check_icon {
flex-shrink: 0;
position: relative;
width: 34px;
height: 34px;
.sparkBg("firstPop/check_bg.png");
margin-right: 14px;
&.checked::after {
content: "";
position: absolute;
left: 4px;
top: 3px;
width: 33px;
height: 24px;
.sparkBg("firstPop/checked.png");
}
}
.check_text {
width: 380px;
max-height: 70px;
overflow-y: auto;
}
}
.close {
left: 346px;
top: 1186px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("common/close.png");
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './invalidPop.less';
import store from '../../store/store';
import { Button } from '@grace/ui';
import { _asyncThrottle } from "../../utils/utils";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
import { Toast } from '@grace/ui';
@observer
class InvalidPop extends React.Component {
constructor(props) {
super(props);
}
async componentDidMount() {
store.initRule();
}
handleClose = _asyncThrottle(() => {
Toast.show('请退出活动哦~');
// ModalCtrl.closeModal()
})
render() {
return (
<div className="invalidPop modal_center">
<span className="bg"></span>
<div className="text">本次活动适用于零基础投资者<br />感谢您对本次模拟理财大赛的关注</div>
<Button className="know_btn" onClick={this.handleClose} />
{/* <Button className="close" onClick={this.handleClose} /> */}
</div>
);
}
}
export default InvalidPop;
@import "../../res.less";
.invalidPop {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
left: 82px;
top: 588px;
width: 585px;
height: 328px;
position: absolute;
.sparkBg("invalidPop/bg.png");
}
.know_btn {
position: absolute;
left: 120px;
top: 753px;
width: 510px;
height: 138px;
.sparkBg("invalidPop/know_btn.png");
}
.text {
width: 505px;
height: 90px;
left: 122px;
top: 644px;
position: absolute;
font-size: 30px;
line-height: 46px;
color: rgb(0, 0, 0);
text-align: center;
}
.close {
left: 346px;
top: 986px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("common/close.png");
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './loginpop.less';
import API from '@/api';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import { Button, Toast } from '@grace/ui';
import { _asyncThrottle } from '@/utils/utils';
import LightSDK from 'light-sdk/dist/index.umd'
import { CHANNEL } from '@/AppTools';
import Privacypop from '../privacypop/privacypop';
/* 电话号码验证规则 **/
export const REG_TEL = /^1[0-9]{10}$/;
@observer
class Loginpop extends React.Component {
constructor(props) {
super(props);
this.state = {
uid: "",
loginPhone: "",
loginCode: "",
countDown: 60, // 获取验证码倒计时
showCountDown: false, // 显示获取验证码
showSendAgain: false, // 显示再次发送按钮
showSend: true, // 显示发送按钮
showPrivacyPop: false, // 显示隐私协议弹窗
privacyChecked: false, // 隐私协议-是否勾选
}
}
componentDidMount() {
this.getUserInfo()
}
getUserInfo = () => {
LightSDK.native.readData({
key: "K_USERID",
component_scope: "global"
}, res => {
console.info("LightSDK 请求结果>>>>>>>>>>>>>>>>", res)
const uid = res.data?.result
this.setState({ uid })
})
}
/** 输入事件 */
changeEvent = async (e, type) => {
const value = e.target.value
switch (type) {
// 手机号
case "loginPhone":
const val = value.replace(/[^\d]/g, '')
this.setState({ loginPhone: val })
break;
// 验证码
case "loginCode":
this.setState({ loginCode: value.replace(/[^\d]/g, '') })
break;
default:
break;
}
}
// 点击获取验证码
clickGetCode = _asyncThrottle(() => {
// 已经开始倒计时
if (this.state.showCountDown) return false;
if (!this.state.loginPhone || this.state.loginPhone == "") {
Toast.show('请输入手机号')
} else if (!REG_TEL.test(this.state.loginPhone)) {
Toast.show('请输入正确手机号')
} else {
// 获取验证码
this.getCode(this.state.loginPhone)
}
})
// 获取验证码
getCode = async (phoneNum) => {
const params = {
phoneNumber: phoneNum,
}
const { success, data } = await API.coop_sendCode(params)
if (success) {
if (data?.code == 0) {
Toast.show("验证码已发送");
this.setState({
showSend: false,
showCountDown: true,
countDown: 60,
showSendAgain: false
})
this.codeCountDown()
} else {
data?.errorMsg && Toast.show(data.errorMsg)
}
}
}
// 验证码倒计时
codeCountDown = () => {
clearInterval(this.timer)
this.timer = setInterval(() => {
if (this.state.countDown == 0) {
clearInterval(this.timer)
this.setState({
showCountDown: false,
showSendAgain: true,
})
} else {
this.setState({
countDown: this.state.countDown - 1
})
}
}, 1000)
}
// 确认提交
handleSubmit = _asyncThrottle(() => {
const { loginPhone, loginCode } = this.state;
const { agreementTitle } = this.props || {};
if (!!agreementTitle && !this.state.privacyChecked) { // 未勾选隐私协议
Toast.show('请仔细阅读服务协议并勾选')
return false
} else if (!loginPhone) { // 未输入手机号
Toast.show('请输入手机号')
return false
} else if (!REG_TEL.test(loginPhone)) {
Toast.show('请输入正确手机号')
return false
} else if (!loginCode) { // 未输入验证码
Toast.show('请输入验证码')
return false
}
this.bindPhone();
})
// 绑定手机号
bindPhone = async () => {
const { loginPhone, loginCode, uid } = this.state;
const params = {
"phoneNumber": loginPhone,
"smsCode": loginCode,
"origenUid": uid,
}
const { success, data } = await API.coop_checkCode(params)
if (success) {
location.replace(data);
}
}
close = () => {
ModalCtrl.closeModal()
}
render() {
const { loginPhone, loginCode, showCountDown, countDown, showSendAgain, showSend } = this.state;
const { showPrivacyPop, privacyChecked } = this.state;
const { agreementTitle, agreementText, hideClose } = this.props || {};
return (<>
<div className={`loginpop modal_center ${!agreementTitle ? 'no_check' : ''}`}>
<span className="bg"></span>
<span className="title"></span>
{/* 手机号 */}
<div className="phone">
<input
className="phoneinput"
type="tel"
maxLength="11"
placeholder="请输入手机号"
value={loginPhone}
onChange={(e) => this.changeEvent(e, 'loginPhone')}
/>
</div>
{/* 验证码 */}
<div className="verification">
<input
className="verifyinput"
maxLength="6"
placeholder="请输入验证码"
value={loginCode}
onChange={(e) => this.changeEvent(e, 'loginCode')}
/>
{showSend && <span className="get_btn" onClick={this.clickGetCode}>获取验证码</span>}
{showSendAgain && <span className="get_btn resend" onClick={this.clickGetCode}>重新发送</span>}
{showCountDown && <span className="get_btn">{countDown}s</span>}
</div>
{!!agreementTitle && <div className="check_box">
<div className={`check_icon ${privacyChecked ? 'checked' : ''}`} onClick={() => this.setState({ privacyChecked: !this.state.privacyChecked })}></div>
<div>请仔细阅读
<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>
{!hideClose && <Button className="close" onClick={this.close}></Button>}
</div>
{/* 二级弹出遮罩 */}
{(showPrivacyPop) && <div className="mask"></div>}
{/* 隐私协议弹窗 */}
{showPrivacyPop && <Privacypop agreementText={agreementText} closeCb={() => this.setState({ showPrivacyPop: false })} />}
</>);
}
}
export default Loginpop;
@import "../../res.less";
.loginpop {
width: 750px;
height: 1624px;
left: 0;
top: 0;
position: absolute;
&.no_check {
.title {
top: 500px;
}
.phone {
top: 607px;
}
.verification {
top: 753px;
}
.btn {
top: 921px;
}
}
.bg {
left: 82px;
top: 434px;
width: 585px;
height: 665px;
position: absolute;
.sparkBg("loginPop/bg.png");
}
.title {
left: 239px;
top: 480px;
width: 274px;
height: 52px;
position: absolute;
.sparkBg("loginPop/title.png");
}
.btn {
left: 120px;
top: 931px;
width: 510px;
height: 138px;
position: absolute;
.sparkBg("loginPop/bind_btn.png");
&.enter_btn {
.sparkBg("loginPop/enter_btn.png");
}
}
input::placeholder {
color: rgb(155, 155, 155);
}
.phone {
left: 114px;
top: 577px;
width: 516px;
height: 96px;
position: absolute;
padding: 23px 30px;
box-sizing: border-box;
border: 2px solid rgb(244, 215, 211);
border-radius: 17px;
background-color: rgb(255, 255, 255);
.phoneinput {
width: 100%;
height: 100%;
color: rgb(0, 0, 0);
font-size: 28px;
}
}
.verification {
left: 114px;
top: 713px;
width: 279px;
height: 92px;
position: absolute;
.verifyinput {
width: 283px;
height: 96px;
left: 0px;
top: 0px;
position: absolute;
padding: 23px 30px;
color: rgb(0, 0, 0);
font-size: 28px;
box-sizing: border-box;
border: 2px solid rgb(244, 215, 211);
border-radius: 17px;
background-color: rgb(255, 255, 255);
}
.get_btn {
width: 207px;
height: 88px;
line-height: 88px;
left: 310px;
top: 5px;
position: absolute;
font-size: 28px;
color: rgb(255, 255, 255);
text-align: center;
background-image: linear-gradient(90deg, rgb(240, 87, 68) 0%, rgb(221, 42, 42) 100%);
border-radius: 17px;
&.resend {
text-decoration: underline;
}
}
}
.check_box {
position: absolute;
left: 159px;
top: 857px;
height: 35px;
line-height: 35px;
font-size: 24px;
color: rgb(155, 155, 155);
margin-bottom: 28px;
padding-left: 45px;
font-weight: bold;
.check_icon {
position: absolute;
left: 0;
top: 0;
width: 34px;
height: 34px;
.sparkBg("loginPop/check_bg.png");
&.checked::after {
content: "";
position: absolute;
left: 4px;
top: 3px;
width: 33px;
height: 24px;
.sparkBg("loginPop/checked.png");
}
}
.content_title {
color: #d62928;
text-decoration: underline;
}
}
.close {
left: 346px;
top: 1186px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("common/close.png");
}
}
.mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './privacypop.less';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import { Button } from '@grace/ui';
@observer
class Privacypop extends React.Component {
constructor(props) {
super(props);
}
close = () => {
const { closeCb } = this.props;
// 组件形式使用
if (closeCb) {
closeCb()
} else {
ModalCtrl.closeModal()
}
}
render() {
const { agreementText } = this.props || {}
return (
<div className="privacypop modal_center">
<span className="light"></span>
<span className="bg"></span>
<span className="title">个人信息收集声明</span>
<div className="text" dangerouslySetInnerHTML={{ __html: agreementText }}></div>
<Button className="close" onClick={this.close}></Button>
</div>
);
}
}
export default Privacypop;
@import "../../res.less";
.privacypop {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
left: 82px;
top: 406px;
width: 585px;
height: 711px;
position: absolute;
.sparkBg("privacyPop/bg.png");
}
.text {
width: 510px;
height: 540px;
left: 120px;
top: 530px;
position: absolute;
font-size: 24px;
line-height: 30px;
color: rgb(0, 0, 0);
word-wrap: break-word;
white-space: pre-wrap;
overflow-x: hidden;
overflow-y: auto;
}
.close {
left: 346px;
top: 1186px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("common/close.png");
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './rulepop.less';
import store from '../../store/store';
import { Button } from '@grace/ui';
import { _asyncThrottle } from "../../utils/utils";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
@observer
class Rulepop extends React.Component {
constructor(props) {
super(props);
}
async componentDidMount() {
store.initRule();
}
handleClose = _asyncThrottle(() => {
ModalCtrl.closeModal()
})
render() {
return (
<div className="rulepop modal_center">
<span className="bg"></span>
<div className="text" dangerouslySetInnerHTML={{ __html: store.ruleInfo }}></div>
<Button className="close" onClick={this.handleClose} />
</div>
);
}
}
export default Rulepop;
@import "../../res.less";
.rulepop {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
left: 82px;
top: 406px;
width: 585px;
height: 711px;
position: absolute;
.sparkBg("rulePop/bg.png");
}
.text {
width: 510px;
height: 540px;
left: 120px;
top: 530px;
position: absolute;
font-size: 24px;
line-height: 30px;
color: rgb(0, 0, 0);
word-wrap: break-word;
white-space: pre-wrap;
overflow-x: hidden;
overflow-y: auto;
}
.close {
left: 346px;
top: 1186px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("common/close.png");
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './tipspop.less';
import API from '@/api';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import { Button } from '@grace/ui';
import store from '@/store/store';
import { dateFormatter } from '@/utils/utils';
@observer
class Tipspop extends React.Component {
constructor(props) {
super(props);
this.state = {
qrcode: '', //二维码
}
}
async componentDidMount() {
await this.getCode()
}
/** 获取二维码 */
async getCode() {
const { success, data } = await API.getQrcode({
content: CFG.prizePageQrcodeUrl,
width: 150,
height: 150,
domain: encodeURIComponent('https://hxlc90548-activity.dexfu.cn'),
})
if (success) {
this.setState({
qrcode: data || ''
})
}
}
/** 关闭 */
closeHandle = () => {
ModalCtrl.closeModal()
}
render() {
const { actEndTime } = store.indexData || {}
return (
<div className="tipspop modal_center">
<span className="bg"></span>
<div className="text">本期活动将于<span className="date">{dateFormatter(actEndTime, 'MM月dd日')}</span>结束,请您及时兑换背包内立减金权益,做好兑奖规划!</div>
<div className="tips">可截图保存下方二维码,活动结束后扫码兑换权益</div>
<div className="code_bg">
<img className="code_img" src={this.state.qrcode} alt="" />
</div>
<Button className="btn" onClick={this.closeHandle}></Button>
<Button className="close" onClick={this.closeHandle}></Button>
</div>
);
}
}
export default Tipspop;
@import "../../res.less";
.tipspop {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
left: 82px;
top: 464px;
width: 585px;
height: 695px;
position: absolute;
.sparkBg("tipsPop/bg.png");
}
.text {
font-size: 28px;
color: rgb(0, 0, 0);
line-height: 1.607;
position: absolute;
left: 130px;
top: 590px;
width: 510px;
height: 73px;
font-weight: bold;
.date {
color: #ee4e32;
}
}
.tips {
font-size: 22px;
color: rgb(135, 135, 135);
line-height: 2.045;
text-align: center;
position: absolute;
left: 132px;
top: 702px;
}
.code_bg {
left: 275px;
top: 762px;
width: 201px;
height: 201px;
position: absolute;
.sparkBg("tipsPop/code_bg.png");
.code_img {
width: 197px;
height: 197px;
position: absolute;
left: 2px;
top: 2px;
border-radius: 14px;
}
}
.btn {
left: 120px;
top: 991px;
width: 510px;
height: 138px;
position: absolute;
.sparkBg("tipsPop/confirm_btn.png");
}
.close {
width: 60px;
height: 60px;
left: 345px;
top: 1248px;
position: absolute;
.sparkBg("common/close.png");
}
}
......@@ -170,3 +170,7 @@
}
}
}
.grey {
filter: grayscale(100%);
}
\ No newline at end of file
......@@ -7,6 +7,10 @@ import { PageCtrl } from '@/core/ctrls/PageCtrl';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import { getDomain } from '@spark/dbdomain';
import { showShareGuide } from '@spark/share';
import Loginpop from '@/panels/loginpop/loginpop';
import InvalidPop from '@/panels/invalidPop/invalidPop';
import FirstPop from '@/panels/firstPop/firstPop';
import Tipspop from '@/panels/tipspop/tipspop';
class Store {
......@@ -42,81 +46,105 @@ class Store {
this.ruleInfo = data;
}
homeTipIndex = 0;
homeTipsCon = null
changeHomeTip = () => {
console.log("changeHomeTip",toJS(this.homeTipIndex))
clearTimeout(this.homeTipsCon)
this.homeTipsCon = setTimeout(() => {
if (this.homeTipIndex < this.frontVariable.homeTip.length - 1) {
this.homeTipIndex++;
} else {
this.homeTipIndex = 0;
}
this.changeHomeTip()
}, 5000)
}
/** 获取前端配置项 */
async getFrontVariable() {
// 获取前端开发配置
const { data } = await API.getFrontVariable();
this.frontVariable = data || {};
console.log('前端开发配置', data)
if (data.homeTip?.length > 0) {
this.changeHomeTip()
}
}
indexData: {
actStartTime?: number,
actEndTime?: number,
currentTime?: number,
guideFlag?: boolean,
creditsNum?: number,
expireDays?: number,
currentStoreNum?: number,
storeLimitNum?: number,
continueSignDays?: number,
todaySignFlag?: boolean,
signRecords?: {
id: string,
day: number,
creditsNum: number,
boolSign: boolean,
}[],
returnAwardCreditsNum?: number,
// 我的终点时间
myEndTime?: number,
ruleText?: string,
uid?: string,
// 大明星配置
bigStartConfig?: Array<{
prizeImg?: string,
titleImg?: string,
}>,
// 首次体验金弹窗
firstMoneyPop?: {
agreementText?: string,
experienceNum?: number,
},
// 模拟资产
virtualAssets?: {
preDayIncome?: string,
availableFunds?: string,
totalMoney?: string,
realBuyJumpUrl?: string,
totalIncome?: string,
},
// 签到模块
checkIn?: {
totalCheckIn?: string,
checkInConfig?: Array<{
days?: string,
experienceNum?: string,
status?: string,
}>,
},
// 推荐产品配置
recommendProductConfig?: Array<{
name?: string,
shenShuGuiZei?: string,
touZiQiXianText?: string,
qigouText?: string,
baiFenBiText?: string,
fengXian?: string,
code?: string,
status?: string,
realBuyJumpUrl?: string,
}>,
// 待存储产品code
codeList?: Array<string>,
} = {};
downGoldVo?: {
creditsNum: number,
multipleValue: number,
taskId: string,
url: string,
async judgeIsWhiteUser() {
const { success, data, code, message } = await API.isWhiteUser();
if (success) {
if (data) {
location.replace(data);
} else {
await this.updateIndex();
}
} else if (code == 60001) {
// 非白名单用户
ModalCtrl.showModal(InvalidPop);
} else if (code == 60002) {
// 请绑定手机号
ModalCtrl.showModal(Loginpop, { agreementTitle: '《模拟理财服务协议》', agreementText: '您即将进入第三方服务页面,该服务由华夏理财有限责任公司提供。为了便于您使用本页面服务,需要您主动提供手机号信息,个人信息仅用于本活动登录及参与,无其他用途。相关信息保护责任由华夏理财承担。' }) // TODO 字段?
} else {
Toast.show(message || '网络异常,请稍后再试')
}
}
} = {};
async updateIndex() {
const { success, data } = await API.index();
const { success, data, timeStamp } = await API.index();
if (!success) {
return;
}
this.indexData = data;
}
const resData = data || {}
resData.currentTime = timeStamp;
this.indexData = resData;
/**
* 更新首页信息,给倒计时用的
*/
updateIndexThrottle = _debounce(async () => {
return await this.updateIndex();
}, 500);
const { firstMoneyPop, TODO } = resData
if (firstMoneyPop) {
ModalCtrl.showModal(FirstPop, firstMoneyPop);
}
if (TODO) {
ModalCtrl.showModal(Tipspop);
}
}
async doSign() {
const { success, data } = await API.sign();
const { success, data } = await API.doCheckIn();
this.updateIndex();
this.getTaskInfo();
if (!success) return;
const { boolLimit, newLuckCreditsNum } = data;
......@@ -135,77 +163,6 @@ class Store {
return true;
}
// 首页挑战信息
taskInfo: {
boolOpenChallenge?: boolean;
choosedChallengeId?: string;
challengeStartTime: number;
challengeEndTime: number;
hasChallengeDay?: number;
boolNeedResign?: boolean;
challengeConfigList?: Array<{
challengeId: string;
challengeTotalDay: number;
prizeName: string;
prizeImg: string;
resignJf: number;
resignQg: number;
}>;
taskInfoList?: Array<{
id: string | number;
code: string;
icon: string;
subTitle: string;
title: string;
completedSize: number;
intervalLimitSize: number;
intervalType: number;
jumpUrl?: string;
boolShowCompletePop?: boolean;
}>;
boolNeedChallengeCompletePop?: boolean;
latestChallengeSuccessTime?: number;
boolNeedResignPop?: boolean;
boolShowFailPop?: boolean;
challengeSuccessPopInfo?: {
prizeName: string;
prizeImg: string;
};
} = {
challengeStartTime: 0,
challengeEndTime: 0
};
async getBaseIndex() {
const { success, data } = await API.getChallengeBaseIndex()
if (!success) return;
this.baseInfo = data;
this.indexData.creditsNum = data.jfNum;
}
async getTaskInfo() {
const { success, data } = await API.getChallengeIndex();
if (success && data) {
this.taskInfo = data
const { boolOpenChallenge,
boolNeedResignPop,
challengeSuccessPopInfo,
boolShowFailPop,
choosedChallengeId = 0,
hasChallengeDay = 0,
// boolNeedResign,
challengeConfigList = [],
taskInfoList = [],
} = this?.taskInfo || {};
// 找到当前挑战信息项
const currentChallenge = challengeConfigList.find(
item => item.challengeId === choosedChallengeId
);
}
};
/** 普通分享 */
async initShare() {
......@@ -223,7 +180,6 @@ class Store {
link: url
};
option.link = (domain || location.origin) + CFG.loginMidUrl + encodeURIComponent(url);
initWx(option);
}
......@@ -245,7 +201,7 @@ class Store {
showShareGuide();
const res = await API.getChallengeInviteCode({ taskCode: taskCode })
const res = await API.getInviteCode({ taskCode: taskCode })
url += `&inviteCode=${res.data.inviteCode}`;
option.link = (domain || location.origin) + CFG.loginMidUrl + encodeURIComponent(url);
......@@ -255,8 +211,7 @@ class Store {
async doAssist() {
let inviteCode = getUrlParam('inviteCode')
if (!inviteCode || inviteCode == 'null' || inviteCode == 'undefined') return false;
const { success, message, code } = await API.getChallengeAssist({ inviteCode: inviteCode });
await this.getTaskInfo();
const { success, message, code } = await API.doAssist({ inviteCode: inviteCode });
history.replaceState({}, '', location.href.replace(new RegExp(`[?&]inviteCode=[^&]*`), ''));
}
......
......@@ -440,3 +440,12 @@ export const miniGoUrl = (url) => {
// @ts-ignore
wx.miniProgram.navigateTo({ url: url });
}
/**
* 千分位
*/
export const formatThousand = (num) => {
var reg = /\d{1,3}(?=(\d{3})+$)/g;
return (num + '').replace(reg, '$&,');
}
\ No newline at end of file
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