Commit b22942ef authored by haiyoucuv's avatar haiyoucuv

init

parent f5fd21af
import { AESDecrypt, AESEncrypt } from "./Crypto";
export default [ export default [
{ {
url: '/main/index.do', url: '/main/index.do',
response: ({ query }) => { response: ({ query }) => {
const signDay = Math.random() * 7 >> 0;
return { return {
success: true, success: true,
code: "", code: "",
...@@ -17,21 +17,28 @@ export default [ ...@@ -17,21 +17,28 @@ export default [
currentStoreNum: 123, currentStoreNum: 123,
storeLimitNum: 2222, storeLimitNum: 2222,
continueSignDays: 3, continueSignDays: 3,
todaySignFlag: true, todaySignFlag: false,
signRecords: [ signRecords: new Array(7).fill(1).map((_, index) => {
{ return {
id: 1, id: index,
day: 1, day: index + 1,
creditsNum: 100, creditsNum: 100 + Math.random() * 100 >> 0,
boolSign: false, boolSign: index < signDay,
} }
], }),
overflowBubble: { overflowBubble: {
id: 1, id: 1,
creditsNum: 100, creditsNum: 100,
expireTime: Date.now() + 10000000, expireTime: Date.now() + 10000000,
}, },
bubbleRecords: [], bubbleRecords: new Array(4).fill(1).map((_, index) => {
return {
id: index,
creditsNum: 100 + Math.random() * 100 >> 0,
expireTime: Date.now() + 10000000,
type: 1 + Math.random() * 2 >> 0,
}
}),
returnAwardCreditsNum: 1111, returnAwardCreditsNum: 1111,
downGoldVo: { downGoldVo: {
creditsNum: 100, creditsNum: 100,
...@@ -64,10 +71,10 @@ export default [ ...@@ -64,10 +71,10 @@ export default [
"code": "", "code": "",
"message": "", "message": "",
"data": { "data": {
signCredits: 111, signCredits: 100,
extraCredits: 120, extraCredits: 100,
boolLimit: true, boolLimit: true,
multupleValue: 11, multupleValue: 3,
url: "urlurlurlurlurl", url: "urlurlurlurlurl",
taskId: "taskId", taskId: "taskId",
newLuckCreditsNum: 33, newLuckCreditsNum: 33,
......
src/assets/WedExpPanel/金币堆.png

81 KB | W: | H:

src/assets/WedExpPanel/金币堆.png

81.7 KB | W: | H:

src/assets/WedExpPanel/金币堆.png
src/assets/WedExpPanel/金币堆.png
src/assets/WedExpPanel/金币堆.png
src/assets/WedExpPanel/金币堆.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -36,14 +36,14 @@ class HomePage extends React.Component<any, any> { ...@@ -36,14 +36,14 @@ class HomePage extends React.Component<any, any> {
root: HTMLDivElement; root: HTMLDivElement;
componentDidMount() { componentDidMount() {
// store.updateIndex(); store.updateIndex();
// store.queryTask() // store.queryTask()
// if (getUrlParam('inviteCode')) { // if (getUrlParam('inviteCode')) {
// store.doAssist() // store.doAssist()
// } // }
// ModalCtrl.showModal(Fail_challenge); // ModalCtrl.showModal(Fail_challenge);
ModalCtrl.showModal(WedExpPanel); ModalCtrl.showModal(SkyFullGoldPanel);
} }
clickPrize = () => { clickPrize = () => {
......
...@@ -5,6 +5,10 @@ import { Button } from "@grace/ui"; ...@@ -5,6 +5,10 @@ import { Button } from "@grace/ui";
import styles from "./Sign.module.less"; import styles from "./Sign.module.less";
import classNames from "classnames"; import classNames from "classnames";
import API from "@/api";
import { _asyncThrottle } from "@/utils/utils.ts";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl.tsx";
import WedExpPanel from "@/panels/WedExpPanel/WedExpPanel.tsx";
@observer @observer
...@@ -14,27 +18,49 @@ class Sign extends React.Component<any, any> { ...@@ -14,27 +18,49 @@ class Sign extends React.Component<any, any> {
} }
clickSign = _asyncThrottle(async () => {
const { todaySignFlag } = store.indexData;
if (todaySignFlag) return;
const { success, data } = await API.sign();
if (!success) return;
const { signCredits, extraCredits, boolLimit, multupleValue, url, taskId, newLuckCreditsNum } = data;
if (boolLimit) {
// 周三限时奖励
ModalCtrl.showModal(WedExpPanel, data);
}
});
render() { render() {
const {} = store.indexData const { signRecords, continueSignDays, todaySignFlag } = store.indexData;
const signedCount = signRecords?.filter((item) => item.boolSign).length || 0;
const signProgress = Math.max(signedCount - 1, 0);
return <div className={styles.sign}> return <div className={styles.sign}>
<div className={styles.title}>已连续签到<span>23</span></div> <div className={styles.title}>已连续签到<span>{continueSignDays}</span></div>
<div className={styles.tip}>断签7天后积分将清零</div> <div className={styles.tip}>断签7天后积分将清零</div>
<div className={styles.itemRoot}> <div className={styles.itemRoot}>
{ {
new Array(7).fill(0).map((item, index) => { signRecords?.map((item, index) => {
const { id, boolSign, creditsNum, day } = item;
const creditCls = classNames(styles.credits, { const creditCls = classNames(styles.credits, {
[styles.creditsSigned]: true, [styles.creditsSigned]: boolSign,
}); });
const dayCls = classNames(styles.day, { const dayCls = classNames(styles.day, {
[styles.daySigned]: true, [styles.daySigned]: boolSign,
}); });
return <div key={index} className={styles.item}> return <div key={id} className={styles.item}>
<div className={creditCls}> <div className={creditCls}>
<div className={styles.creditTxt}>最高<span>150</span></div> {!boolSign && <div className={styles.creditTxt}>最高<span>{creditsNum}</span></div>}
</div> </div>
<div className={dayCls}>{index + 1}</div> <div className={dayCls}>{day}</div>
</div> </div>
}) })
} }
...@@ -44,15 +70,17 @@ class Sign extends React.Component<any, any> { ...@@ -44,15 +70,17 @@ class Sign extends React.Component<any, any> {
<div <div
className={styles.progressFill} className={styles.progressFill}
style={{ style={{
width: `${100 / 6 * 1}%`, width: `${100 / 6 * signProgress}%`,
}} }}
/> />
</div> </div>
<div className={styles.progressPoint}/> <div className={styles.progressPoint}/>
<div className={styles.progressPoint} style={{
transform: `translateX(${signProgress * 0.99}rem)`,
}}/>
<Button className={styles.btn} onClick={this.clickSign}/>
<Button className={styles.btn}/>
</div>; </div>;
} }
} }
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
.logo { .logo {
position: absolute; position: absolute;
left: 149px; left: 144px;
top: 931px; top: 931px;
width: 95px; width: 95px;
height: 83px; height: 83px;
...@@ -77,17 +77,18 @@ ...@@ -77,17 +77,18 @@
} }
.txt { .txt {
font-size: 29px; font-size: 28px;
color: rgb(32, 16, 3); color: rgb(32, 16, 3);
position: absolute; position: absolute;
left: 247px; left: 243px;
top: 938px; top: 938px;
line-height: 1.2;
font-weight: bold; font-weight: bold;
} }
.btn { .btn {
position: absolute; position: absolute;
left: 479px; left: 485px;
top: 947px; top: 947px;
width: 128px; width: 128px;
height: 50px; height: 50px;
......
...@@ -45,6 +45,16 @@ ...@@ -45,6 +45,16 @@
height: 228px; height: 228px;
.webpBg("WedExpPanel/金币堆.png"); .webpBg("WedExpPanel/金币堆.png");
} }
.multuple {
position: absolute;
left: 460px;
top: 597px;
font-size: 28px;
color: #e70813;
font-weight: bold;
font-style: italic;
}
} }
.vip { .vip {
...@@ -56,6 +66,16 @@ ...@@ -56,6 +66,16 @@
height: 209px; height: 209px;
.webpBg("WedExpPanel/会员金币堆.png"); .webpBg("WedExpPanel/会员金币堆.png");
} }
.multuple {
position: absolute;
left: 350px;
top: 606px;
font-size: 28px;
color: #e70813;
font-weight: bold;
font-style: italic;
}
} }
.taskBg { .taskBg {
...@@ -69,7 +89,7 @@ ...@@ -69,7 +89,7 @@
.logo { .logo {
position: absolute; position: absolute;
left: 149px; left: 144px;
top: 931px; top: 931px;
width: 95px; width: 95px;
height: 83px; height: 83px;
...@@ -77,17 +97,18 @@ ...@@ -77,17 +97,18 @@
} }
.txt { .txt {
font-size: 29px; font-size: 28px;
color: rgb(32, 16, 3); color: rgb(32, 16, 3);
position: absolute; position: absolute;
left: 247px; left: 243px;
top: 938px; top: 938px;
line-height: 1.2;
font-weight: bold; font-weight: bold;
} }
.btn { .btn {
position: absolute; position: absolute;
left: 479px; left: 485px;
top: 947px; top: 947px;
width: 128px; width: 128px;
height: 50px; height: 50px;
......
...@@ -9,7 +9,13 @@ import { SvgaPlayer } from "@grace/svgaplayer"; ...@@ -9,7 +9,13 @@ import { SvgaPlayer } from "@grace/svgaplayer";
import bgEffectSvga from "@/assets/svga/2输出签到成功弹窗.svga"; import bgEffectSvga from "@/assets/svga/2输出签到成功弹窗.svga";
export interface IWedExpPanelProps { export interface IWedExpPanelProps {
signCredits: number;
extraCredits: number;
boolLimit: boolean;
multupleValue: number;
url: string;
taskId: string;
newLuckCreditsNum: number;
} }
@observer @observer
...@@ -28,26 +34,33 @@ class WedExpPanel extends React.Component<IWedExpPanelProps> { ...@@ -28,26 +34,33 @@ class WedExpPanel extends React.Component<IWedExpPanelProps> {
render() { render() {
const { signCredits, extraCredits, boolLimit, multupleValue, url, taskId, newLuckCreditsNum } = this.props;
return <div className="WedExpPanel modal_center"> return <div className="WedExpPanel modal_center">
<SvgaPlayer className="bgEffect" src={bgEffectSvga}/> <SvgaPlayer className="bgEffect" src={bgEffectSvga}/>
<div className="bg"/> <div className="bg"/>
<div className="tip"> <div className="tip">
获得50积分<br/> 获得{signCredits}积分<br/>
解锁周三限时奖励 解锁周三限时奖励
</div> </div>
<div className="vip"> {
<div className="img"/> !!extraCredits
</div> ? <div className="vip">
{/*<div className="normal">*/} <div className="img"/>
{/* <div className="img"/>*/} <div className="multuple">{multupleValue}x</div>
{/*</div>*/} </div>
: <div className="normal">
<div className="img"/>
<div className="multuple">{multupleValue}x</div>
</div>
}
<div className="taskBg"/> <div className="taskBg"/>
<div className="logo"/> <div className="logo"/>
<div className="txt"> <div className="txt">
观看品牌视频15s<br/> 观看品牌视频15s<br/>
积分膨胀至150 积分膨胀至{(signCredits + extraCredits) * multupleValue}积分
</div> </div>
<div className="com_banner"/> <div className="com_banner"/>
......
...@@ -12,15 +12,9 @@ class Store { ...@@ -12,15 +12,9 @@ class Store {
/** 前端开发配置 */ /** 前端开发配置 */
frontVariable: { frontVariable: {
privacyTxt: string,
prizeInfoAuthTxt: string,
shareInfo: IWxShareInfo, shareInfo: IWxShareInfo,
shopUrl?: string,
scanUrl?: string,
ruleImg?: string, ruleImg?: string,
} = { } = {
privacyTxt: "",
prizeInfoAuthTxt: "",
shareInfo: { shareInfo: {
title: "", title: "",
desc: "", desc: "",
...@@ -47,29 +41,58 @@ class Store { ...@@ -47,29 +41,58 @@ class Store {
} }
indexData: { indexData: {
remainTimes?: number, actStartTime?: number,
uid?: string, actEndTime?: number,
actEndTimestamp?: number, currentTime?: number,
timeStamp?: number,
actStartTimestamp?: number, guideFlag?: boolean,
remainDrawTimes?: number, currentStoreNum?: number,
newAssist?: number, storeLimitNum?: number,
continueSignDays?: number,
todaySignFlag?: boolean,
signRecords?: {
id: string,
day: number,
creditsNum: number,
boolSign: boolean,
}[],
overflowBubble?: {
id: number,
creditsNum: number,
expireTime: number,
},
bubbleRecords?: {
id: number,
creditsNum: number,
expireTime: number,
}[],
returnAwardCreditsNum?: number,
downGoldVo?: {
creditsNum: number,
multipleValue: number,
taskId: string,
url: string,
}
} = {}; } = {};
async updateIndex() { async updateIndex() {
// const { success, data, timeStamp } = await API.index(); const { success, data } = await API.index();
// if (!success) { if (!success) {
// return; return;
// } }
// this.indexData = data; this.indexData = data;
// this.indexData.timeStamp = timeStamp;
} }
judgeActTime(brakeStart = true, brakeEnd = true) { judgeActTime(brakeStart = true, brakeEnd = true) {
if (brakeStart && this.indexData.timeStamp < this.indexData.actStartTimestamp) { if (brakeStart && this.indexData.currentTime < this.indexData.actStartTime) {
Toast.show("活动未开始"); Toast.show("活动未开始");
return false return false
} else if (brakeEnd && this.indexData.timeStamp > this.indexData.actEndTimestamp) { } else if (brakeEnd && this.indexData.currentTime > this.indexData.actEndTime) {
Toast.show("活动已结束"); Toast.show("活动已结束");
return false return false
} }
......
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