Commit 31a52cdd authored by haiyoucuv's avatar haiyoucuv

整理一下代码

parent 53049f77
......@@ -15,6 +15,7 @@ import { CircleItem } from './CircleItem';
import { HandItem } from './HandItem';
import { showToast } from 'db://assets/Module/UIFast';
import store from "../../../store/store";
import { toJS } from "mobx";
const {ccclass, property} = _decorator;
......@@ -297,7 +298,7 @@ export class ChangeEquipPanel extends Panel {
/** 任务栏渲染 */
taskRender() {
const data = this.loopList?.[this.middleIndex];
const {isUsed, title, completedSize, intervalLimitSize, loopType} = data || {};
const {taskData, taskCode, isUsed, title, completedSize, intervalLimitSize, loopType} = data || {};
/** 气泡渲染 */
if (loopType == "1") {
this.bubble.active = false;
......@@ -306,6 +307,7 @@ export class ChangeEquipPanel extends Panel {
this.bubble.getChildByName("Content").getComponent(Label).string = `分数提升 ${BUFF?.[loopType] || ""}%`
}
console.log(data);
if (!!isUsed) {
/** 已装备 */
this.mainBtnGrey.active = true;
......@@ -324,10 +326,17 @@ export class ChangeEquipPanel extends Panel {
this.mainBtn.active = false;
this.taskBox.active = true;
this.taskBox.getChildByName("Title").getComponent(Label).string = strFormat(title, 22);
if (taskCode == "bank_2201") {
const descObj = taskData.desc ? JSON.parse(taskData.desc) : {};
const t = descObj?.progressAmount || 0;
this.taskBox.getChildByName("Progress").getComponent(Label).string = `累计已提升金额:${t}`;
} else {
this.taskBox.getChildByName("Progress").getComponent(Label).string = `完成 ${completedSize}/${intervalLimitSize}`;
}
}
}
}
/** 去完成任务 */
doTask() {
......
......@@ -51,15 +51,16 @@ export class TaskItem extends ScrollListItem {
if (code?.startsWith("it")) {
this.title.string = strFormat(`${title}(${completedSize}/${intervalLimitSize})`, 24);
this.subTitle.string = strFormat(subTitle, 38);
} else if (code === "bank_2202") {
const descObj = desc ? JSON.parse(desc) : {};
const t = ~~((descObj?.progressAmount || 0) / 1000);
this.title.string = strFormat(`${title}(${t}/10)`, 30);
const t = descObj?.progressAmount || 0;
this.title.string = strFormat(`${title}(${~~(t / 1000)}/10)`, 30);
this.subTitle.string = strFormat(`累计已提升金额:${t}元`, 38);
} else {
this.title.string = strFormat(title, 24);
}
this.subTitle.string = strFormat(subTitle, 38);
}
const btnSp = this.btn.getComponent(Sprite);
......@@ -79,9 +80,8 @@ export class TaskItem extends ScrollListItem {
btnSp.spriteFrame = this.doSf;
} else {
if (code === "bank_2202") { // 特殊任务
const descObj = desc ? JSON.parse(desc) : {};
// hasReceivedNum 特殊任务的已领奖次数
if (descObj.hasReceivedNum >= 1) {
if (completedSize >= 1) {
btnSp.spriteFrame = this.fightSf;
} else {
btnSp.spriteFrame = this.doSf;
......
......@@ -6,10 +6,11 @@ import { resetBackCookie } from "../../../AppTool";
// import { isFromShare, newUser } from 'duiba-utils';
// let mergeData = {
// user_type: newUser ? '0' : '1',
// is_from_share: isFromShare ? '0' : '1',
// }
let mergeData = {
// user_type: newUser ? '0' : '1',
// is_from_share: isFromShare ? '0' : '1',
// channel: getUrlParams('channel'),
}
export const DEFAULF_ERROR = '网络异常,请稍后重试';
//////////////星速台接口方法集成
......
......@@ -16,6 +16,7 @@ import { UIMgr } from "../Module/UIMgr";
import { changeScene, showToast } from "db://assets/Module/UIFast";
import { HomeScene } from "db://assets/Scripts/Scenes/HomeScene";
import store from "../store/store";
import { appRequest, disableGestureReturn } from "../AppTool";
const {ccclass, property} = _decorator;
......@@ -33,6 +34,8 @@ export class Start extends Component {
@property(ProgressBar)
progressBar: ProgressBar;
interval = null;
onLoad() {
// game.frameRate = _FPS;
......@@ -45,8 +48,26 @@ export class Start extends Component {
store.updateFrontVariable();
disableGestureReturn();
this.interval = setInterval(() => {
this.keepLive();
}, 1000 * 60 * 5);
}
onDestroy() {
clearInterval(this.interval);
}
keepLive = () => {
appRequest('/activityCommonService/duiBaKeepAlive', {
method: 'POST',
}).then(res => {
console.log('keepLive', res);
});
};
async start() {
await this.preload([
{
......
......@@ -4,21 +4,6 @@
<meta charset="utf-8">
<title>套圈挑战赛</title>
<script id="monitorjs" src="//yun.duiba.com.cn/woodpecker/sdk/0.0.36/woodpecker_outer.js" ></script>
<script id="registerMonitor">
// 烽火台注入前端监控脚本,请勿修改
try {
woodpecker.setConfig({
projectId: "pc9c1ee11",
developer: [
"fa17c4667c62b5ba014f382c0802a462"
],
});
} catch (e) {
console.error(e);
}
</script>
<!--http://www.html5rocks.com/en/mobile/mobifying/-->
<meta name="viewport"
......@@ -54,7 +39,7 @@
<script src="//yun.duiba.com.cn/polaris/SVGA.Lite.v2.1.1.d3a67cbc13c591c53c6f87ab34c57ce387010374.js" crossorigin="anonymous"></script>
<script src="//yun.duiba.com.cn/aurora/assets/2403d1edf2acd15b179306b6ddaa5f0967d78a8f.js"></script>
<link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1720404223993/style.css"/>
<link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1720511787175/style.css"/>
<style>
.sui-captcha {
......@@ -116,16 +101,16 @@
</script>
<!-- Polyfills bundle. -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1720404223993/src/polyfills.bundle.js" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1720511787175/src/polyfills.bundle.js" charset="utf-8"></script>
<!-- SystemJS support. -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1720404223993/src/system.bundle.js" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1720511787175/src/system.bundle.js" charset="utf-8"></script>
<!-- Import map -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1720404223993/src/import-map.json" type="systemjs-importmap" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1720511787175/src/import-map.json" type="systemjs-importmap" charset="utf-8"></script>
<script>
System.import('//yun.duiba.com.cn/db_games/ccc_game/template3d/1720404223993/index.js').catch(function (err) {
System.import('//yun.duiba.com.cn/db_games/ccc_game/template3d/1720511787175/index.js').catch(function (err) {
console.error(err);
})
</script>
......
{
"code": null,
"data": {
"handType": "1",
"handType": "3",
"taskInfo": [
{
"isUsed": false,
"loopType": 2,
"taskCode": "join_5"
"taskCode": "join_3"
},
{
"isUsed": false,
......@@ -16,12 +16,12 @@
{
"isUsed": false,
"loopType": 4,
"taskCode": "score_1000"
"taskCode": "score_300"
},
{
"isUsed": false,
"loopType": 5,
"taskCode": "score_8000"
"taskCode": "bank_2201"
},
{
"isUsed": true,
......@@ -32,5 +32,5 @@
},
"message": null,
"success": true,
"timeStamp": 1718776874488
"timeStamp": 1720598101102
}
\ No newline at end of file
......@@ -3,43 +3,6 @@
"data": {
"endTimestamp": 1785495731000,
"item": [
{
"buttonText": null,
"code": "bank_2202",
"completedSize": 0,
"desc": "{\"taskType\":2,\"hasReceivedNum\":10, \"progressAmount\":10000}",
"extra": null,
"icon": null,
"id": "savjpxbs",
"index": null,
"indexes": null,
"intervalLimitSize": 1,
"intervalType": 0,
"jumpUrl": "/",
"options": [
{
"degree": null,
"icon": null,
"icon2": null,
"id": "sp_challenge_times",
"index": null,
"name": "挑战次数",
"prizeId": "sp_challenge_times",
"prizeType": null,
"refId": null,
"refType": null,
"sendCount": 3
}
],
"playwayId": "task_1",
"prizePendingCode": null,
"prizePendingCodeList": null,
"ruleId": "spPrize@sp_challenge_times@3",
"sendPrize": null,
"subTitle": "/",
"taskStatus": 0,
"title": "资产每提升1000元得次数*1"
},
{
"buttonText": "请邀请好友给你助力",
"code": "it",
......@@ -179,7 +142,7 @@
"id": "jnu13vqb",
"index": null,
"indexes": null,
"intervalLimitSize": 10,
"intervalLimitSize": 100,
"intervalType": 1,
"jumpUrl": "https://www.baidu.com1",
"options": [
......@@ -187,20 +150,59 @@
"degree": null,
"icon": null,
"icon2": null,
"id": "sp_challenge_times",
"index": null,
"name": "挑战次数",
"prizeId": "sp_challenge_times",
"prizeType": null,
"id": "of05a780e",
"index": 1,
"name": "88积分测试数据",
"prizeId": "third_ZHXYKHQ240802",
"prizeType": 1,
"refId": null,
"refType": null,
"sendCount": 1
},
{
"degree": null,
"icon": null,
"icon2": null,
"id": "obc9d8d93",
"index": 2,
"name": "立减金测试",
"prizeId": "third_ZHXYKHQ240801",
"prizeType": 1,
"refId": null,
"refType": null,
"sendCount": 10
},
{
"degree": null,
"icon": "//yun.dui88.com/images/202211/vo9167fvxo.png",
"icon2": null,
"id": "o02dcd829",
"index": 3,
"name": "非首次-漫漫测试实物-星速台",
"prizeId": "sss_3",
"prizeType": 2,
"refId": "42731",
"refType": "object",
"sendCount": 1
},
{
"degree": null,
"icon": "//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png",
"icon2": null,
"id": "thanks",
"index": 4,
"name": "谢谢参与",
"prizeId": "thanks",
"prizeType": 0,
"refId": null,
"refType": null,
"sendCount": 1
}
],
"playwayId": "task_1",
"prizePendingCode": null,
"prizePendingCodeList": null,
"ruleId": "spPrize@sp_challenge_times@10",
"ruleId": "ru_loop",
"sendPrize": null,
"subTitle": "百度1副标题",
"taskStatus": 0,
......@@ -218,7 +220,7 @@
"indexes": null,
"intervalLimitSize": 1,
"intervalType": 4,
"jumpUrl": "https://e.czbank.com/weixinHTML/creditCardApply/creditCardFullApplyETF.html?creditPreFlag=1",
"jumpUrl": "https://mobapp.czbank.com/life/mobile_recharge.html",
"options": [
{
"degree": null,
......@@ -253,19 +255,58 @@
"id": "cvzdcxpe",
"index": null,
"indexes": null,
"intervalLimitSize": 1,
"intervalLimitSize": 10,
"intervalType": 4,
"jumpUrl": "https://mobapp.czbank.com/setUp/loginManage.html",
"jumpUrl": "https://mobapp.czbank.com/life/mobile_recharge.html",
"options": [
{
"degree": null,
"icon": null,
"icon2": null,
"id": "sp_challenge_times",
"index": null,
"name": "挑战次数",
"prizeId": "sp_challenge_times",
"prizeType": null,
"id": "of05a780e",
"index": 1,
"name": "88积分测试数据",
"prizeId": "third_ZHXYKHQ240802",
"prizeType": 1,
"refId": null,
"refType": null,
"sendCount": 1
},
{
"degree": null,
"icon": null,
"icon2": null,
"id": "obc9d8d93",
"index": 2,
"name": "立减金测试",
"prizeId": "third_ZHXYKHQ240801",
"prizeType": 1,
"refId": null,
"refType": null,
"sendCount": 10
},
{
"degree": null,
"icon": "//yun.dui88.com/images/202211/vo9167fvxo.png",
"icon2": null,
"id": "o02dcd829",
"index": 3,
"name": "非首次-漫漫测试实物-星速台",
"prizeId": "sss_3",
"prizeType": 2,
"refId": "42731",
"refType": "object",
"sendCount": 1
},
{
"degree": null,
"icon": "//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png",
"icon2": null,
"id": "thanks",
"index": 4,
"name": "谢谢参与",
"prizeId": "thanks",
"prizeType": 0,
"refId": null,
"refType": null,
"sendCount": 1
......@@ -274,7 +315,7 @@
"playwayId": "task_1",
"prizePendingCode": null,
"prizePendingCodeList": null,
"ruleId": "spPrize@sp_challenge_times@1",
"ruleId": "ru_loop",
"sendPrize": null,
"subTitle": "/",
"taskStatus": 0,
......@@ -321,7 +362,7 @@
"buttonText": null,
"code": "bank_2201",
"completedSize": 0,
"desc": "{\"taskType\":1}",
"desc": "{\"taskType\":1,\"progressAmount\":\"1\"}",
"extra": null,
"icon": null,
"id": "oywi1c5s",
......@@ -338,13 +379,55 @@
"sendPrize": null,
"subTitle": "/",
"taskStatus": 0,
"title": "资产提升10000元任务"
"title": "【圈圈】资产提升10000元任务"
},
{
"buttonText": null,
"code": "bank_2202",
"completedSize": 1,
"desc": "{\"taskType\":2,\"progressAmount\":\"1001\"}",
"extra": null,
"icon": null,
"id": "oumzgwqz",
"index": null,
"indexes": null,
"intervalLimitSize": 10,
"intervalType": 4,
"jumpUrl": "/",
"options": [
{
"degree": null,
"icon": null,
"icon2": null,
"id": "sp_challenge_times",
"index": null,
"name": "挑战次数",
"prizeId": "sp_challenge_times",
"prizeType": null,
"refId": null,
"refType": null,
"sendCount": 3
}
],
"playwayId": "task_1",
"prizePendingCode": "",
"prizePendingCodeList": [
{
"code": null,
"index": 1
}
],
"ruleId": "spPrize@sp_challenge_times@3",
"sendPrize": true,
"subTitle": "/",
"taskStatus": 0,
"title": "资产每提升1000元得次数*1"
}
],
"startTimestamp": 1718190131000,
"timestamp": 1719490008971
"timestamp": 1720597476609
},
"message": null,
"success": true,
"timeStamp": 1719490009176
"timeStamp": 1720597476795
}
\ No newline at end of file
{"proSetting":{"projectxIDs":{"devId":[],"testId":[{"label":"test","value":"pa7410987"}],"prodId":[{"label":"prodTest","value":"pc9c1ee11"}]},"skinVariables":[],"mockSetting":{"projectId":"","pageId":""}},"envSetting":{},"psdSetting":{"psdFSSetting":true,"psdCenterSetting":true}}
{"proSetting":{"projectxIDs":{"devId":[],"testId":[{"label":"test","value":"pa7410987"}],"prodId":[{"label":"prodTest","value":"pc9c1ee11"},{"label":"prod","value":"p7bdf2f84"}]},"skinVariables":[],"mockSetting":{"projectId":"","pageId":""}},"envSetting":{},"psdSetting":{"psdFSSetting":true,"psdCenterSetting":true}}
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