Commit a50d40c6 authored by 陈子煜's avatar 陈子煜

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	assets/Scripts/Scenes/BlessingBagPage.ts
#	assets/Scripts/Scenes/HomeScene.ts
#	assets/Scripts/store/store.ts
parents e2f55621 53593af6
...@@ -18,7 +18,8 @@ export default class RulePanel extends Panel { ...@@ -18,7 +18,8 @@ export default class RulePanel extends Panel {
@property(Node) closeBtn: Node = null; @property(Node) closeBtn: Node = null;
@property(Node) spNode: Node = null; @property(Node) spNode: Node = null;
onLoad() { async onLoad() {
await store.updateRule()
this.closeBtn.on(Button.EventType.CLICK, this.clickClose); this.closeBtn.on(Button.EventType.CLICK, this.clickClose);
} }
......
...@@ -7,8 +7,8 @@ import {HomeScene} from "db://assets/Scripts/Scenes/HomeScene"; ...@@ -7,8 +7,8 @@ import {HomeScene} from "db://assets/Scripts/Scenes/HomeScene";
import {getUrlParams} from "../Utils/WebNet/web/webTools"; import {getUrlParams} from "../Utils/WebNet/web/webTools";
import OpenLuckyPanel from "../Panels/OpenLuckyPanel"; import OpenLuckyPanel from "../Panels/OpenLuckyPanel";
import shareStore from "../store/shareStore"; import shareStore from "../store/shareStore";
import store from "db://assets/Scripts/store/store";
import GetPrize from "db://assets/Scripts/Panels/GetPrize"; import GetPrize from "db://assets/Scripts/Panels/GetPrize";
import store from "../store/store";
const {ccclass, property} = _decorator; const {ccclass, property} = _decorator;
...@@ -171,9 +171,7 @@ export class BlessingBagPage extends Scene { ...@@ -171,9 +171,7 @@ export class BlessingBagPage extends Scene {
//赚福袋任务界面 //赚福袋任务界面
const {success: TaskSuccess, data: TaskData} = await sendWebNetWithToken(WebNetName.taskList, { const {success: TaskSuccess, data: TaskData} = await store.getTaskInfo();
taskToken: getUrlParams("taskToken") || "123456",
})
if (!TaskSuccess) return if (!TaskSuccess) return
this.TaskInfo = TaskData this.TaskInfo = TaskData
console.log(TaskData) console.log(TaskData)
...@@ -274,7 +272,7 @@ export class BlessingBagPage extends Scene { ...@@ -274,7 +272,7 @@ export class BlessingBagPage extends Scene {
if (this.bagInfo.remainBagSilverNum < 1) { if (this.bagInfo.remainBagSilverNum < 1) {
showToast("福袋数量不足") showToast("福袋数量不足")
} else { } else {
showPanel(OpenLuckyPanel, {num: 1, type: "sliver"}); showPanel(OpenLuckyPanel, { num: 1, type: "sliver" });
} }
} }
...@@ -283,7 +281,7 @@ export class BlessingBagPage extends Scene { ...@@ -283,7 +281,7 @@ export class BlessingBagPage extends Scene {
if (this.bagInfo.remainBagSilverNum < 5) { if (this.bagInfo.remainBagSilverNum < 5) {
showToast("福袋数量不足") showToast("福袋数量不足")
} else { } else {
showPanel(OpenLuckyPanel, {num: 5, type: "sliver"}); showPanel(OpenLuckyPanel, { num: 5, type: "sliver" });
} }
} }
...@@ -292,7 +290,7 @@ export class BlessingBagPage extends Scene { ...@@ -292,7 +290,7 @@ export class BlessingBagPage extends Scene {
if (this.bagInfo.remainBagSilverNum < this.bagInfo.bagSilverToGold) { if (this.bagInfo.remainBagSilverNum < this.bagInfo.bagSilverToGold) {
showToast("福袋数量不足") showToast("福袋数量不足")
} else { } else {
showPanel(OpenLuckyPanel, {num: 1, type: "gold"}) showPanel(OpenLuckyPanel, { num: 1, type: "gold" })
} }
} }
...@@ -301,7 +299,7 @@ export class BlessingBagPage extends Scene { ...@@ -301,7 +299,7 @@ export class BlessingBagPage extends Scene {
if (this.bagInfo.remainBagSilverNum < this.bagInfo.bagSilverToGold * 5) { if (this.bagInfo.remainBagSilverNum < this.bagInfo.bagSilverToGold * 5) {
showToast("福袋数量不足") showToast("福袋数量不足")
} else { } else {
showPanel(OpenLuckyPanel, {num: 5, type: "gold"}) showPanel(OpenLuckyPanel, { num: 5, type: "gold" })
} }
} }
...@@ -310,7 +308,7 @@ export class BlessingBagPage extends Scene { ...@@ -310,7 +308,7 @@ export class BlessingBagPage extends Scene {
if (this.bagInfo.remainBagSilverNum < this.bagInfo.bagSilverToDiamond) { if (this.bagInfo.remainBagSilverNum < this.bagInfo.bagSilverToDiamond) {
showToast("福袋数量不足") showToast("福袋数量不足")
} else { } else {
showPanel(OpenLuckyPanel, {num: 1, type: "diamond"}); showPanel(OpenLuckyPanel, { num: 1, type: "diamond" });
} }
} }
...@@ -319,7 +317,7 @@ export class BlessingBagPage extends Scene { ...@@ -319,7 +317,7 @@ export class BlessingBagPage extends Scene {
if (this.bagInfo.remainBagSilverNum < this.bagInfo.bagSilverToDiamond * 5) { if (this.bagInfo.remainBagSilverNum < this.bagInfo.bagSilverToDiamond * 5) {
showToast("福袋数量不足") showToast("福袋数量不足")
} else { } else {
showPanel(OpenLuckyPanel, {num: 5, type: "diamond"}); showPanel(OpenLuckyPanel, { num: 5, type: "diamond" });
} }
} }
...@@ -327,17 +325,15 @@ export class BlessingBagPage extends Scene { ...@@ -327,17 +325,15 @@ export class BlessingBagPage extends Scene {
//去赚福袋任务 //去赚福袋任务
async clickTofinish(taskId, taskCode, jumpUrl) { async clickTofinish(taskId, taskCode, jumpUrl) {
if (taskCode == "task_invite") { if(taskCode == "task_invite"){
shareStore.doShare(); shareStore.doShare();
} else { }else{
// const {success, data} = await sendWebNetWithToken(WebNetName.finishTask, {taskId, taskCode}) // const {success, data} = await sendWebNetWithToken(WebNetName.finishTask, {taskId, taskCode})
// if (!success) return // if (!success) return
window.location.href = jumpUrl window.location.href = jumpUrl
} }
} }
@render @render
render() { render() {
// const {} = store.homeInfo || {}; // const {} = store.homeInfo || {};
......
...@@ -21,6 +21,8 @@ import RulePanel from "../Panels/RulePanel"; ...@@ -21,6 +21,8 @@ import RulePanel from "../Panels/RulePanel";
import RankPrizePanel from "../Panels/RankPrizePanel"; import RankPrizePanel from "../Panels/RankPrizePanel";
import SnakeSkin from "../Panels/SnakeSkin"; import SnakeSkin from "../Panels/SnakeSkin";
import shareStore from "../store/shareStore"; import shareStore from "../store/shareStore";
import { sendWebNetWithToken, WebNetName } from "../Utils/WebNet/WebNet";
import { getUrlParams } from "../Utils/WebNet/web/webTools";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -74,11 +76,11 @@ export class HomeScene extends Scene { ...@@ -74,11 +76,11 @@ export class HomeScene extends Scene {
async start() { async start() {
store.doAssist(); store.doAssist();
//完成福袋任务弹窗
store.checkFudai();
await store.updateIndex();
await store.updateRule()
await store.getTaskInfo();
await store.updateIndex();
//完成福袋任务弹窗
store.checkFudai();
const { const {
signPopFlag, signPopFlag,
rankPopList, rankPopList,
......
...@@ -133,6 +133,12 @@ class Store { ...@@ -133,6 +133,12 @@ class Store {
} }
async getTaskInfo() {
return await sendWebNetWithToken(WebNetName.taskList, {
taskToken: getUrlParams("taskToken") || "123456",
});
}
//已完成福袋任务 //已完成福袋任务
checkFudai() { checkFudai() {
if (store.homeInfo.bagPopVO) { if (store.homeInfo.bagPopVO) {
......
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