Commit c7d8d6d3 authored by 徐士卿's avatar 徐士卿

merge

parent 1cde35b5
......@@ -9,6 +9,8 @@ export default [
"message": "dolor reprehenderit ex culpa veniam",
"data": {
"choosedChallengeId": "2",
"challengeStartTime": 27404105.225178465,
"challengeEndTime": -87229323.37597737,
"challengeConfigList": [
{
"challengeId": "1",
......@@ -17,8 +19,6 @@ export default [
"prizeImg": "//yun.duiba.com.cn/polaris/045CCBB8-F6C7-43DB-9F81-45F52430A878.441c8f13daf61c48b85fe383e764d9089f1d4a66.png",
"resignJf": 666,
"resignQg": 666,
"challengeStartTime": 27404105.225178465,
"challengeEndTime": -87229323.37597737
},
{
"challengeId": "2",
......@@ -27,8 +27,6 @@ export default [
"prizeImg": "//yun.duiba.com.cn/polaris/045CCBB8-F6C7-43DB-9F81-45F52430A878.441c8f13daf61c48b85fe383e764d9089f1d4a66.png",
"resignJf": 888,
"resignQg": 888,
"challengeStartTime": 27404105.225178465,
"challengeEndTime": -87229323.37597737
},
{
"challengeId": "3",
......@@ -37,8 +35,6 @@ export default [
"prizeImg": "//yun.duiba.com.cn/polaris/045CCBB8-F6C7-43DB-9F81-45F52430A878.441c8f13daf61c48b85fe383e764d9089f1d4a66.png",
"resignJf": 999,
"resignQg": 999,
"challengeStartTime": 27404105.225178465,
"challengeEndTime": -87229323.37597737
},
{
"challengeId": "4",
......@@ -47,14 +43,12 @@ export default [
"prizeImg": "//yun.duiba.com.cn/polaris/045CCBB8-F6C7-43DB-9F81-45F52430A878.441c8f13daf61c48b85fe383e764d9089f1d4a66.png",
"resignJf": 999,
"resignQg": 999,
"challengeStartTime": 27404105.225178465,
"challengeEndTime": -87229323.37597737
}
],
"hasChallengeDay": 5,
"latestChallengeSuccessTime": 5,
"boolNeedResign": false,
"boolNeedResignPop": false,
"boolNeedResign": true,
"boolNeedResignPop": true,
"taskInfoList": [
{
"code": "sign",
......@@ -104,10 +98,10 @@ export default [
{
"code": "scan_{n}",
"icon": "//yun.duiba.com.cn/polaris/credits.55f43bd9eece2d29fd077bbad5f38ea147938c45.png",
"subTitle": "看视频",
"title": "看视频",
"subTitle": "扫码",
"title": "扫码",
"completedSize": 3,
"intervalLimitSize": 3,
"intervalLimitSize": 6,
"intervalType": -54395962.26549375
},
{
......
......@@ -203,139 +203,7 @@ export default [
"success": true,
"message": "message",
"timeStamp": Date.now(),
"data": [
{
"extra": {
"name": "现金奖励——发放成功",
"icon": "//yun.dui88.com/images/201907/tua0um9jjp.jpg",
"refType": "coupon",
"refId": "49354",
"type": 2
},
"strategyId": 11,
"gmtCreate": 1565213353000,
"id": 331,
"prizeId": "g4c4c3edd",
"type": 4,
"moneyStatus": 1,
"moneyCanReissueStartTimestamp": 1565213353000,
"moneyCanReissueEndTimestamp": 1565213353000,
},
{
"extra": {
"name": "现金奖励——可以补发",
"icon": "//yun.duiba.com.cn/polaris/%E6%95%B0%E6%8D%AE%E5%86%B3%E7%AD%96%E5%B7%A5%E5%85%B7.531c2dae250ab379fd6216eb038e60bc12ab9dd6.png",
"refType": "coupon",
"refId": "49354",
"type": 2
},
"strategyId": 11,
"gmtCreate": 1565213116000,
"id": 330,
"prizeId": "g0e432eeb",
"type": 4,
"moneyStatus": 11,
"moneyCanReissueStartTimestamp": 1565213353000,
"moneyCanReissueEndTimestamp": 1565213353000,
},
{
"extra": {
"name": "现金奖励——发放中",
"icon": "//yun.dui88.com/images/201907/tua0um9jjp.jpg",
"refType": "coupon",
"refId": "49354",
"type": 2
},
"strategyId": 11,
"gmtCreate": 1565212826000,
"id": 329,
"prizeId": "g900c8442",
"type": 4,
"moneyStatus": 11,
"moneyCanReissueStartTimestamp": 1565213353000,
"moneyCanReissueEndTimestamp": 1565213353000,
},
{
"extra": {
"name": "优惠券-大转盘01",
"icon": "//yun.dui88.com/images/201907/tua0um9jjp.jpg",
"refType": "coupon",
"refId": "49354",
"type": 2
},
"gmtCreate": 1565205625000,
"id": 328,
"strategyId": 11,
"prizeId": "g4c7ba888",
"type": 1,
"moneyStatus": 1,
"moneyCanReissueStartTimestamp": 1565213353000,
"moneyCanReissueEndTimestamp": 1565213353000,
},
{
"extra": {
"name": "优惠券-大转盘05",
"icon": "//yun.dui88.com/images/201907/tua0um9jjp.jpg",
"refType": "coupon",
"refId": "49354",
"type": 2
},
"strategyId": 11,
"gmtCreate": 1565203101000,
"id": 327,
"prizeId": "g900c8442",
"type": 1,
"moneyStatus": 1,
"moneyCanReissueStartTimestamp": 1565213353000,
"moneyCanReissueEndTimestamp": 1565213353000,
},
{
"extra": {
"name": "优惠券-大转盘03",
"icon": "//yun.dui88.com/images/201907/tua0um9jjp.jpg",
"refType": "coupon",
"refId": "49354",
"type": 2
},
"strategyId": 11,
"gmtCreate": 1565203040000,
"id": 326,
"prizeId": "g0e432eeb",
"type": 1,
"moneyStatus": 1,
"moneyCanReissueStartTimestamp": 1565213353000,
"moneyCanReissueEndTimestamp": 1565213353000,
},
{
"extra": {
"name": "优惠券-大转盘04",
"icon": "//yun.dui88.com/images/201907/tua0um9jjp.jpg",
"refType": "coupon",
"refId": "49354",
"type": 2
},
"gmtCreate": 1565197386000,
"id": 325,
"prizeId": "gc1a8c03c"
},
{
"extra": {
"name": "last",
"icon": "//yun.dui88.com/images/201907/tua0um9jjp.jpg",
"refType": "coupon",
"refId": "49354",
"type": 2
},
"gmtCreate": 1565197080000,
"id": 324,
"strategyId": 11,
"prizeId": "g0e432eeb",
"type": 1,
"moneyStatus": 1,
"moneyCanReissueStartTimestamp": 1565213353000,
"moneyCanReissueEndTimestamp": 1565213353000,
},
],
"data": {}
}
},
},
......
'use strict';
"use strict";
import React from 'react';
import { observer } from 'mobx-react';
import './finish_challenge.less';
import { Button } from '@grace/ui';
import { PageCtrl } from '@/core/ctrls/PageCtrl';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import React from "react";
import { observer } from "mobx-react";
import "./finish_challenge.less";
import { Button } from "@grace/ui";
import { PageCtrl } from "@/core/ctrls/PageCtrl";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
@observer
class Finish_challenge extends React.Component {
......@@ -15,22 +15,23 @@ class Finish_challenge extends React.Component {
handleclose = () => {
ModalCtrl.closeModal();
}
};
handlehappy = () => {
ModalCtrl.closeModal();
}
};
render() {
const { prizeName, prizeImg } = this.props;
return (
<div className="finish_challenge modal_center">
<span className="dongxiao"></span>
<span className="bg"></span>
<span className="title"></span>
<span className="tip">获得xxx奖励</span>
<span className="tip">获得{prizeName}奖励</span>
<Button className="close" onClick={this.handleclose} />
<Button className="happy" onClick={this.handlehappy} />
<span className="icon"></span>
<img className="icon" src={prizeImg} />
<span className="ditu"></span>
</div>
);
......
......@@ -87,6 +87,7 @@
left: 238px;
top: 527px;
position: absolute;
border-radius: 15px;
.sparkBg("finish_challenge/icon.png");
}
......
......@@ -19,6 +19,10 @@ class Renewmodule extends React.Component {
};
}
componentDidMount() {
store.getBaseIndex();
}
handleClick = (choice) => {
this.setState({ activeChoice: choice });
};
......@@ -61,7 +65,8 @@ class Renewmodule extends React.Component {
render() {
const { activeChoice } = this.state;
const { hasChallengeDay, resignJf, resignQg, jfNum, qgNum } = this.props;
const { hasChallengeDay, resignJf, resignQg } = this.props;
const { jfNum, qgNum } = store?.baseInfo || {};
// qg是否足够
const inferQg = qgNum >= resignQg;
......
......@@ -16,27 +16,16 @@ class Check extends React.Component<any, any> {
constructor(props) {
super(props);
this.state = {
baseInfo: {}
};
}
componentDidMount() {
store.getTaskInfo()
this.getBaseIndex()
}
async getBaseIndex() {
const { success, data } = await API.getChallengeBaseIndex()
if (!success) return;
this.setState({
baseInfo: data
});
store.getBaseIndex()
}
// 按钮
handlegofinish = (type, n, code, title) => {
const { jfNum = 0, qgNum = 0 } = this.state?.baseInfo || {};
const { jfNum = 0, qgNum = 0 } = store?.baseInfo || {};
if (type === "xhqg") {
if (n <= qgNum) {
ModalCtrl.showModal(Consume_qg, { n, code, title });
......@@ -56,8 +45,8 @@ class Check extends React.Component<any, any> {
};
handlegosign = _asyncThrottle((hasChallengeDay, resignJf, resignQg, { jfNum = 0, qgNum = 0 } = this.state?.baseInfo || {}) => {
ModalCtrl.showModal(Renewmodule, { hasChallengeDay, resignJf, resignQg, jfNum, qgNum });
handlegosign = _asyncThrottle((hasChallengeDay, resignJf, resignQg) => {
ModalCtrl.showModal(Renewmodule, { hasChallengeDay, resignJf, resignQg });
});
handlefinish = _asyncThrottle(() => {
......@@ -75,6 +64,8 @@ class Check extends React.Component<any, any> {
choosedChallengeId = 0,
hasChallengeDay = 0,
boolNeedResign,
challengeStartTime = 0,
challengeEndTime = 0,
challengeConfigList = [],
taskInfoList = [],
} = store?.taskInfo || {};
......@@ -87,8 +78,6 @@ class Check extends React.Component<any, any> {
// 当前挑战信息
const {
challengeTotalDay = 0,
challengeStartTime = 0,
challengeEndTime = 0,
prizeName = '',
prizeImg = '',
resignJf = 0,
......
......@@ -16,11 +16,11 @@
// .sparkBg("rulePage/bg.png");
}
.back {
width: 69px;
height: 68px;
left: 26px;
top: 46px;
left: 20px;
top: 60px;
width: 28px;
height: 43px;
position: absolute;
// .sparkBg("rulePage/back.png");
.webpBg("MyPrize/返回.png");
}
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import Choice_challenge from '../../src/components/choice_challenge/choice_challenge';
import SkyFullGoldPanel from "@/panels/SkyFullGoldPanel/SkyFullGoldPanel.tsx";
import Renewmodule from '../../src/components/renewmodule/renewmodule';
import Finish_task from '../../src/components/finish_task/finish_task';
import Finish_challenge from '../../src/components/finish_challenge/finish_challenge';
import { IBubbleInfo } from "@/pages/HomePage/Top/Components/Bubble.ts";
import { IOverflowBubbleInfo } from "@/pages/HomePage/Top/Components/OverflowBubble.ts";
......@@ -18,6 +18,8 @@ class Store {
makeAutoObservable(this);
}
baseInfo: any = {};
/** 前端开发配置 */
frontVariable: {
shareInfo: IWxShareInfo,
......@@ -118,13 +120,13 @@ class Store {
taskInfo: {
boolOpenChallenge?: boolean;
choosedChallengeId?: string;
challengeStartTime: number;
challengeEndTime: number;
hasChallengeDay?: number;
boolNeedResign?: boolean;
challengeConfigList?: Array<{
challengeId: string;
challengeTotalDay: number;
challengeStartTime: number;
challengeEndTime: number;
prizeName: string;
prizeImg: string;
resignJf: number;
......@@ -142,20 +144,51 @@ class Store {
boolNeedChallengeCompletePop?: boolean;
latestChallengeSuccessTime?: number;
boolNeedResignPop?: boolean;
} = {};
} = {
challengeStartTime: 0,
challengeEndTime: 0
};
async getBaseIndex() {
const { success, data } = await API.getChallengeBaseIndex()
if (!success) return;
this.baseInfo = data;
}
async getTaskInfo() {
const { success, data } = await API.getChallengeIndex();
if (success && data) {
this.taskInfo = data
const { boolOpenChallenge = 0,
choosedChallengeId = 0,
hasChallengeDay = 0,
boolNeedResign,
challengeConfigList = [],
taskInfoList = [],
} = this?.taskInfo || {};
// 找到当前挑战信息项
const currentChallenge = challengeConfigList.find(
item => item.challengeId === choosedChallengeId
);
// 当前挑战信息
const {
challengeTotalDay = 0,
prizeName = '',
prizeImg = '',
resignJf = 0,
resignQg = 0,
} = currentChallenge || {};
if (!data.choosedChallengeId) {
ModalCtrl.showModal(Choice_challenge)
}
if(data.boolNeedResignPop) {
ModalCtrl.showModal(Renewmodule)
if (data.boolNeedResignPop) {
ModalCtrl.showModal(Renewmodule, { hasChallengeDay, resignJf, resignQg });
}
if(data.boolNeedChallengeCompletePop){
ModalCtrl.showModal(Finish_task)
if (data.boolNeedChallengeCompletePop) {
ModalCtrl.showModal(Finish_challenge, { prizeName, prizeImg })
}
}
};
......
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