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