Commit de6f22ae authored by 邱旭's avatar 邱旭

20210206

parent 48b91a59
...@@ -2,10 +2,35 @@ ...@@ -2,10 +2,35 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="0d3cb18d-e144-41a0-bc8b-4877c2e1fef1" name="默认的" comment=""> <list default="true" id="0d3cb18d-e144-41a0-bc8b-4877c2e1fef1" name="默认的" comment="">
<change afterPath="$PROJECT_DIR$/mock/miniTb/feile.getActivityBaseInfoById.json" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/FreePowerPanel/freePowerBg.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/FreePowerPanel/freePowerBtn.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/common/powerIcon.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/tb/index/index.acss" afterDir="false" />
<change afterPath="$PROJECT_DIR$/tb/index/index.axml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/tb/index/index.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/tb/index/index.json" afterDir="false" />
<change afterPath="$PROJECT_DIR$/tb/index/output.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/mock/miniTb/babycare.consumerTools.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/miniTb/feile.consumerTools.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/mock/miniTb/babycare.getActivityBaseInfoById.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/mock/miniTb/mine.getAppData.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/miniTb/mine.getAppData.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/FreePowerPanel/圆圈.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/FreePowerPanel/开心收下.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/res.json" beforeDir="false" afterPath="$PROJECT_DIR$/resource/res.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ResJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/ResJson.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/SkinJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/SkinJson.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/SkinJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/SkinJson.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TaoBaoNet.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/TaoBaoNet.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Tools.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/Tools.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/FreePowerPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/FreePowerPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/NoStepPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/NoStepPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/RulePanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/RulePanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/StartPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/StartPanel.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/panels/StartPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/StartPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/SuccessNoPrizePanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/SuccessNoPrizePanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/LoadingScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/LoadingScene.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/scene/LoadingScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/LoadingScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/LotteryScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/LotteryScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/PlayScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/PlayScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/map/MapScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/MapScene.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -39,13 +64,15 @@ ...@@ -39,13 +64,15 @@
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" /> <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/panels" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/tb" />
<property name="nodejs_package_manager_path" value="npm" /> <property name="nodejs_package_manager_path" value="npm" />
<property name="settings.editor.selected.configurable" value="vcs.Git" />
<property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" /> <property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" />
<property name="vue.rearranger.settings.migration" value="true" /> <property name="vue.rearranger.settings.migration" value="true" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/tb" />
<recent name="$PROJECT_DIR$/src/panels" /> <recent name="$PROJECT_DIR$/src/panels" />
<recent name="$PROJECT_DIR$/resource" /> <recent name="$PROJECT_DIR$/resource" />
</key> </key>
...@@ -53,7 +80,7 @@ ...@@ -53,7 +80,7 @@
<recent name="$PROJECT_DIR$/lotties" /> <recent name="$PROJECT_DIR$/lotties" />
</key> </key>
</component> </component>
<component name="RunManager" selected="npm.flushRes"> <component name="RunManager" selected="npm.dev">
<configuration name="handleLotS.js" type="NodeJSConfigurationType" temporary="true" nameIsGenerated="true" path-to-js-file="$PROJECT_DIR$/scripts/handleLotS.js" working-dir="$PROJECT_DIR$/scripts"> <configuration name="handleLotS.js" type="NodeJSConfigurationType" temporary="true" nameIsGenerated="true" path-to-js-file="$PROJECT_DIR$/scripts/handleLotS.js" working-dir="$PROJECT_DIR$/scripts">
<method v="2" /> <method v="2" />
</configuration> </configuration>
...@@ -109,7 +136,8 @@ ...@@ -109,7 +136,8 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1612576978320</updated> <updated>1612576978320</updated>
<workItem from="1612576979459" duration="13000" /> <workItem from="1612576979459" duration="13000" />
<workItem from="1612577003915" duration="21073000" /> <workItem from="1612577003915" duration="21094000" />
<workItem from="1612662929222" duration="7013000" />
</task> </task>
<task id="LOCAL-00001" summary="斐乐消消乐"> <task id="LOCAL-00001" summary="斐乐消消乐">
<created>1612581213298</created> <created>1612581213298</created>
...@@ -167,7 +195,14 @@ ...@@ -167,7 +195,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1612603219647</updated> <updated>1612603219647</updated>
</task> </task>
<option name="localTasksCounter" value="9" /> <task id="LOCAL-00009" summary="20210206">
<created>1612608155005</created>
<option name="number" value="00009" />
<option name="presentableId" value="LOCAL-00009" />
<option name="project" value="LOCAL" />
<updated>1612608155005</updated>
</task>
<option name="localTasksCounter" value="10" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
...@@ -184,6 +219,7 @@ ...@@ -184,6 +219,7 @@
<MESSAGE value="NoEnergyPanel" /> <MESSAGE value="NoEnergyPanel" />
<MESSAGE value="NoStep" /> <MESSAGE value="NoStep" />
<MESSAGE value="Failed" /> <MESSAGE value="Failed" />
<option name="LAST_COMMIT_MESSAGE" value="Failed" /> <MESSAGE value="20210206" />
<option name="LAST_COMMIT_MESSAGE" value="20210206" />
</component> </component>
</project> </project>
\ No newline at end of file
{
"code": "000000",
"data": {
"inviteFriends": {
"type": 2,
"value": 8,
"taskNum": 3
},
"openId": "AAEaCvE-ALiIWXQsJuac30pr",
"rule": "测试活动规则",
"updateTime": 1594987802814,
"title": "澎锋测试1",
"toolsProbability": {
"HAMMERS": {
"properiodfrom": 1,
"properiodto": 3300,
"probability": 33
},
"STEPS": {
"properiodfrom": 3301,
"properiodto": 6700,
"probability": 34
},
"BOOMS": {
"properiodfrom": 6701,
"properiodto": 10000,
"probability": 33
}
},
"levelPrize": {
"level_90": "https://img.alicdn.com/imgextra/i4/2275046294/O1CN01rG9iDU1wMhRtEnjA8_!!2275046294-2-miniprogram.png",
"level_60": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01Sytynw1wMhRuqjy5V_!!2275046294-2-miniprogram.png",
"level_30": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN019uAoYk1wMhRsoAgag_!!2275046294-2-miniprogram.png",
"level_10": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01FwiFBB1wMhRybF1V4_!!2275046294-2-miniprogram.png"
},
"buyCredits": {
"HAMMERS": "3",
"POWERS": "4",
"STEPS": "2",
"BOOMS": "1"
},
"beMembership": 7,
"createTime": 1594987659195,
"deleteStatus": 1,
"browseGoods": {
"itemIds": "616444374083,617466150499,616903228711",
"type": 2,
"value": 5,
"taskNum": 3
},
"startTime": 1594988024000,
"_id": "5f11948b3075d9927ec1f4ce",
"endTime": 1595592824000,
"attentionStore": 6,
"openPrizeStatus": 2
},
"success": true,
"message": "成功"
}
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
"code": "000000", "code": "000000",
"data": { "data": {
"tools": { "tools": {
"HAMMERS": 1, "hammers": 1,
"STEPS": 0, "steps": 0,
"BOOMS": 1 "booms": 1
} }
}, },
"success": true, "success": true,
......
{
"code": "000000",
"data": {
"currentLevel": 4,
"topLevelVisitSuccess": false,
"power": 10,
"tools": {
"steps": 10,
"booms": 11,
"hammers": 0
},
"records": [
{
"score": 960,
"level": 2,
"createTime": 1595851904269,
"isVisitSuccess": true,
"updateTime": 1595851904269,
"stars": 3
},
{
"score": 38010,
"level": 1,
"createTime": 1595842163033,
"isVisitSuccess": true,
"updateTime": 1595842163033,
"stars": 3,
"isPrizeLevel": false
}
],
"rule": "测试活动规则",
"levelPrize": {
"level50": "https://img.alicdn.com/imgextra/i4/2275046294/O1CN01rG9iDU1wMhRtEnjA8_!!2275046294-2-miniprogram.png",
"level99": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01Sytynw1wMhRuqjy5V_!!2275046294-2-miniprogram.png"
},
"tasks": {
"jumpLink": {
"links": []
}
}
},
"success": true,
"message": "成功"
}
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
"nickName": "我啊是大请问", "nickName": "我啊是大请问",
"activityId": "string", "activityId": "string",
"openId": "string", "openId": "string",
"isFirstLogin": true,
"loginAddPower": 3,
"isNewUser": false,
"inviteId": "string", "inviteId": "string",
"isFollow": true "isFollow": true
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"name": "FailedPanel" "name": "FailedPanel"
}, },
{ {
"keys": "圆圈.png,开心收下.png", "keys": "freePowerBg.png,freePowerBtn.png",
"name": "FreePowerPanel" "name": "FreePowerPanel"
}, },
{ {
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
"name": "bonus_lottie" "name": "bonus_lottie"
}, },
{ {
"keys": "boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,panelBgS.png,powerImg.png,stepBtn.png,target0.png,target1.png,target2.png,target3.png,target4.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png", "keys": "boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,panelBgS.png,powerIcon.png,powerImg.png,stepBtn.png,target0.png,target1.png,target2.png,target3.png,target4.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png",
"name": "common" "name": "common"
}, },
{ {
......
...@@ -5,7 +5,7 @@ export const ResJson = { ...@@ -5,7 +5,7 @@ export const ResJson = {
"name": "FailedPanel" "name": "FailedPanel"
}, },
{ {
"keys": "圆圈.png,开心收下.png", "keys": "freePowerBg.png,freePowerBtn.png",
"name": "FreePowerPanel" "name": "FreePowerPanel"
}, },
{ {
...@@ -49,7 +49,7 @@ export const ResJson = { ...@@ -49,7 +49,7 @@ export const ResJson = {
"name": "bonus_lottie" "name": "bonus_lottie"
}, },
{ {
"keys": "boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,panelBgS.png,powerImg.png,stepBtn.png,target0.png,target1.png,target2.png,target3.png,target4.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png", "keys": "boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,panelBgS.png,powerIcon.png,powerImg.png,stepBtn.png,target0.png,target1.png,target2.png,target3.png,target4.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png",
"name": "common" "name": "common"
}, },
{ {
......
...@@ -438,42 +438,5 @@ export const SkinJson = { ...@@ -438,42 +438,5 @@ export const SkinJson = {
} }
] ]
}, },
{
"name": "FreePowerPanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "圆圈",
"x": 55,
"y": 267,
"type": "sprite",
"props": {
"source": "圆圈.png"
}
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
},
{
"name": "开心收下",
"x": 163,
"y": 900,
"type": "button",
"props": {
"tUp": "开心收下.png"
},
"id": "acceptBtn"
}
]
},
] ]
} }
import { showToast, wait, clearWait } from "../module/ctrls"; import { showToast } from "../module/ctrls";
import { GDispatcher } from "./Main"; import { GDispatcher } from "./Main";
import { Tools } from "./Tools";
//接口枚举,包括需要调用淘宝的api,用是否含有兑吧区分,或者单独区分 //接口枚举,包括需要调用淘宝的api,用是否含有兑吧区分,或者单独区分
export enum TbNetName { export enum TbNetName {
...@@ -9,33 +10,25 @@ export enum TbNetName { ...@@ -9,33 +10,25 @@ export enum TbNetName {
* activityId params elemType * activityId params elemType
*/ */
trackingReport = "squirrelsAdoptRest2c.trackingReport", trackingReport = "squirrelsAdoptRest2c.trackingReport",
/**
* 进入活动调用, 刷新数据不调用该接口
* activityId userNick avatar follow inviteId
*/
getIndex = "babycare.getIndex",
// 领取权益奖励 // 领取权益奖励
receiveEnamePrize = "babycare.receiveEnamePrize", receiveEnamePrize = "babycare.receiveEnamePrize",
/** /**
* 活动基本信息 * 活动基本信息
* @param activityId * @param activityId
* @type {string} * @type {string}
*/ */
getActivityBaseInfoById = "babycare.getActivityBaseInfoById", getActivityBaseInfoById = "feile.getActivityBaseInfoById",
/**
* 获取游戏信息
* activityId
*/
getGameInfo = "babycare.getGameInfo",
/** /**
* 消耗道具 ,会返回剩余所有道具数量 * 消耗道具 ,会返回剩余所有道具数量
* activityId type * activityId type
*/ */
consumerTools = "babycare.consumerTools", consumerTools = "feile.consumerTools",
/** /**
* 提交分数 * 提交分数
* activityId level score stars isVisitSuccess(是否通关) * activityId level score stars isVisitSuccess(是否通关)
......
import { RES } from "../module/RES"; import { RES } from "../module/RES";
import { layers } from "../module/views/layers"; import { layers } from "../module/views/layers";
import Tween = FYGE.Tween; import { sendTbNet, TbNetName } from "./TaoBaoNet";
import Ease = FYGE.Ease;
import { sendTbNet, TbNetName, getTbData } from "./TaoBaoNet";
import { PropType } from "./something/enum/PropType"; import { PropType } from "./something/enum/PropType";
import { showToast } from "../module/ctrls";
import { showPanel } from "../module/ctrls"; import { showPanel } from "../module/ctrls";
import { FailedPanel } from "./panels/FailedPanel"; import { FailedPanel } from "./panels/FailedPanel";
import { SuccessPrizePanel } from "./panels/SuccessPrizePanel"; import { SuccessPrizePanel } from "./panels/SuccessPrizePanel";
import { SuccessNoPrizePanel } from "./panels/SuccessNoPrizePanel"; import { SuccessNoPrizePanel } from "./panels/SuccessNoPrizePanel";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
/** /**
* 定制,记录一些全局量和方法 * 定制,记录一些全局量和方法
*/ */
export class Tools { export class Tools {
public static openTask(){ public static openTask() {
console.error('TODO 打开任务'); console.error('TODO 打开任务');
alert('TODO 打开任务'); alert('TODO 打开任务');
} }
...@@ -33,88 +32,49 @@ export class Tools { ...@@ -33,88 +32,49 @@ export class Tools {
* 全局数据,重要数据 * 全局数据,重要数据
*/ */
public static globalData: { public static globalData: {
"avatar": string, avatar: string,
"nickName": string, nickName: string,
"activityId": string, activityId: string,
"openId": string, openId: string,
"inviteId": string, inviteId: string,
"isFollow": boolean, isFollow: boolean,
"isFromWx": boolean, isFirstLogin: boolean, // 当日是否第一次登录
} loginAddPower: number, // 赠送体力值
/** isNewUser: boolean, // 是否新用户
* 游戏数据,需要根据接口维护
*/
public static gameData: {
"currentLevel": number,
"loginAddPower": boolean,
"visitors": {
"score": number,
"level": number,
"isVisitSuccess": boolean,
"stars": number,
sendAwardType: any
}[],
"prizes": {
"receiveTime": string,//number
"level": number,
"isReceive": boolean
}[],
"power": number,
"tools": {
"HAMMERS": number,
"STEPS": number,
"BOOMS": number
},
"isFristLogin": boolean,//是否是首次
"topAward": {
openPrizeStatus: boolean,
prize: any
},//120关自动开奖
"wxOriginPrize"?: {//微信中奖信息
"type": number,
"name": string,
"rewardNum": number,
"code"?:string,
"defaultMsg"?:string
}
} }
public static baseInfo: { public static gameData: {
prizeLevels: number[], prizeLevels: number[],
inviteFriends: any,
openId: string,
rule: string, rule: string,
updateTime: number, currentLevel: any,
title: string, topLevelVisitSuccess: string,
toolsProbability: any, power: number,
levelPrize: any, tools: {
buyCredits: any, /// TODO …… steps: number,
booms: number,
hammers: number,
},
records: {
score: number,
level: number,
isVisitSuccess: boolean,
stars: number,
createTime: number,
updateTime: number,
},
levelPrize: {
level50: string,
level99: string,
}
tasks: any,
};// 活动基本信息 };// 活动基本信息
/**
* 首页数据,loading页面执行一次
*/
public static getIndex(): Promise<boolean> {
return new Promise((r) => {
sendTbNet(TbNetName.getIndex, {
userNick: this.globalData.nickName,
avatar: this.globalData.avatar,
follow: this.globalData.isFollow,
inviteId: this.globalData.inviteId,
isFromWx: this.globalData.isFromWx
}, (s, res) => {
if (s) this.gameData = res.data;
r(s);
})
})
}
/** /**
* 进入地图页面刷新 * 进入地图页面刷新
*/ */
public static getGameInfo() { public static getGameInfo() {
return new Promise((r) => { return new Promise((r) => {
sendTbNet(TbNetName.getGameInfo, {}, (s, res) => { sendTbNet(TbNetName.getActivityBaseInfoById, {}, (s, res) => {
if (s) this.gameData = res.data; if (s) this.gameData = res.data;
r(s); r(s);
}) })
...@@ -130,7 +90,6 @@ export class Tools { ...@@ -130,7 +90,6 @@ export class Tools {
if (s) { if (s) {
//修改道具数量 //修改道具数量
this.gameData.tools = res.data.tools; this.gameData.tools = res.data.tools;
// resolve(res);//数据按照gameData的更新,不返回
resolve(true) resolve(true)
} else { } else {
// reject() // reject()
...@@ -147,7 +106,7 @@ export class Tools { ...@@ -147,7 +106,7 @@ export class Tools {
//120关,如果没有奖品图片,伪造一个 //120关,如果没有奖品图片,伪造一个
if (data.level == 99 && (!data.prize || !data.prize.image)) { if (data.level == 99 && (!data.prize || !data.prize.image)) {
data.prize = data.prize || {}; data.prize = data.prize || {};
data.prize.image = Tools.baseInfo.levelPrize['level_99']; data.prize.image = Tools.gameData.levelPrize['level99'];
} }
showPanel(SuccessPrizePanel, data); showPanel(SuccessPrizePanel, data);
} else { // 闯关成功,不是奖励关卡 } else { // 闯关成功,不是奖励关卡
......
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import { GDispatcher } from "../Main"; import { Tools } from "../Tools";
import { RES } from "../../module/RES";
import Button = FYGE.Button;
import MouseEvent = FYGE.MouseEvent;
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
export class FreePowerPanel extends Panel { export class FreePowerPanel extends Panel {
get groupNames() { return ["FreePowerPanel"] } get groupNames() {
get skinName() { return "FreePowerPanel" } return ["FreePowerPanel"]
acceptBtn: FYGE.Button; }
closeBtn: FYGE.Button;
protected initUi() {
super.initUi();
this.addChild(Tools.getSprite('freePowerBg.png')).position.set(79, 345);
this.addChild(new Button(RES.getRes('freePowerBtn.png')))
.addEventListener(MouseEvent.CLICK, this.hidePanel, this)
.position.set(190, 893);
this.addChild(Tools.getSprite('powerIcon.png')).position.set(280, 763);
const powerTxt = this.addChild(Tools.getText(
`+${Tools.globalData.loginAddPower}`, 38, "#ffe090",
TEXT_ALIGN.LEFT,
));
powerTxt.strokeColor = '#7f3c05';
powerTxt.stroke = 2;
powerTxt.position.set(400, 795);
this.addChild(new Button(RES.getRes('关闭按钮.png')))
.addEventListener(MouseEvent.CLICK, this.hidePanel, this)
.position.set(633, 456);
get closeBtns() {
return [this.closeBtn, this.acceptBtn]
} }
hidePanel() { hidePanel() {
super.hidePanel(); super.hidePanel();
//显示倒计时 //显示倒计时
GDispatcher.dispatchEvent("showRemindIcon")
} }
} }
...@@ -51,7 +51,7 @@ export class NoStepPanel extends Panel { ...@@ -51,7 +51,7 @@ export class NoStepPanel extends Panel {
//复活 //复活
this.okBtn.addEventListener(FYGE.MouseEvent.CLICK, () => { this.okBtn.addEventListener(FYGE.MouseEvent.CLICK, () => {
//无步数道具,弹出积分兑换 //无步数道具,弹出积分兑换
if (!Tools.gameData.tools.STEPS) { if (!Tools.gameData.tools.steps) {
} else { } else {
this.data.reviveFun(); this.data.reviveFun();
this.hidePanel(); this.hidePanel();
......
...@@ -27,7 +27,7 @@ export class RulePanel extends Panel { ...@@ -27,7 +27,7 @@ export class RulePanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
const rule = Tools.baseInfo.rule; const rule = Tools.gameData.rule;
this.ruleTex = this.addChild(Tools.getText( this.ruleTex = this.addChild(Tools.getText(
rule, 26, '#892a1a', rule, 26, '#892a1a',
FYGE.TEXT_ALIGN.LEFT, 570 FYGE.TEXT_ALIGN.LEFT, 570
......
...@@ -50,7 +50,7 @@ export class StartPanel extends Panel { ...@@ -50,7 +50,7 @@ export class StartPanel extends Panel {
this.addChild(new StartTarget(this.data.level)) this.addChild(new StartTarget(this.data.level))
.position.set(0, 682); .position.set(0, 682);
this.prizeImg.texture = Texture.fromUrl(Tools.baseInfo.levelPrize[`level_${this.data.level}`]); this.prizeImg.texture = Texture.fromUrl(Tools.gameData.levelPrize[`level${this.data.level}`]);
this.prizeImg.anchorTexture.x = 0.5; this.prizeImg.anchorTexture.x = 0.5;
this.prizeImg.x = 750 / 2; this.prizeImg.x = 750 / 2;
} }
......
...@@ -79,7 +79,7 @@ export class SuccessNoPrizePanel extends Panel { ...@@ -79,7 +79,7 @@ export class SuccessNoPrizePanel extends Panel {
const curLevel: number = Tools.gameData.currentLevel; const curLevel: number = Tools.gameData.currentLevel;
let upLevel: number = 120; let upLevel: number = 120;
let dLevel: number = 120; let dLevel: number = 120;
Tools.baseInfo.prizeLevels.forEach((value, index) => { Tools.gameData.prizeLevels.forEach((value, index) => {
const d: number = value - curLevel; const d: number = value - curLevel;
if (curLevel <= value && d >= 0 && d <= dLevel) { if (curLevel <= value && d >= 0 && d <= dLevel) {
upLevel = value; upLevel = value;
......
...@@ -2,10 +2,9 @@ import { Scene } from "../../module/views/Scene"; ...@@ -2,10 +2,9 @@ import { Scene } from "../../module/views/Scene";
import { Tools } from "../Tools"; import { Tools } from "../Tools";
import { ProgressBarS } from "../common/ProgressBarS"; import { ProgressBarS } from "../common/ProgressBarS";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { getTbData, sendTbNet, TbNetName } from "../TaoBaoNet"; import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { layers } from "../../module/views/layers"; import { layers } from "../../module/views/layers";
import { changeScene } from "../../module/ctrls"; import { changeScene, showToast } from "../../module/ctrls";
import { PlayScene } from "./PlayScene";
import { MapScene } from "./map/MapScene"; import { MapScene } from "./map/MapScene";
export class LoadingScene extends Scene { export class LoadingScene extends Scene {
...@@ -37,45 +36,25 @@ export class LoadingScene extends Scene { ...@@ -37,45 +36,25 @@ export class LoadingScene extends Scene {
this.dispatchEvent(FYGE.Event.PROGRESS, 0.2) this.dispatchEvent(FYGE.Event.PROGRESS, 0.2)
//获取app数据 //获取app数据
const {data} = await sendTbNet(TbNetName.getAppData); const { data } = await sendTbNet(TbNetName.getAppData);
Tools.globalData = data; Tools.globalData = data;
this.dispatchEvent(FYGE.Event.PROGRESS, 0.3); this.dispatchEvent(FYGE.Event.PROGRESS, 0.3);
//询问读取权限,不阻止进程 //询问读取权限,不阻止进程
// Tools.checkPermission();//这个需要吗? // Tools.checkPermission();//这个需要吗?
//获取首页数据
const indexSuccess = await Tools.getIndex();
//失败不进入
if (!indexSuccess) return;
this.dispatchEvent(FYGE.Event.PROGRESS, 0.3);
//赋值openId,取getIndex里的数据
Tools.globalData.openId = getTbData(TbNetName.getIndex).data.openId;
// 游戏基本信息 // 游戏基本信息
const baseInfo = await sendTbNet(TbNetName.getActivityBaseInfoById); const baseInfo = await Tools.getGameInfo();
Tools.baseInfo = baseInfo.data; if (!baseInfo) showToast("获取游戏信息失败");
Tools.baseInfo.prizeLevels = []; Tools.gameData.prizeLevels = [];
for (let k in Tools.baseInfo.levelPrize) { for (let k in Tools.gameData.levelPrize) {
Tools.baseInfo.prizeLevels.push(+k.split('_')[1]); Tools.gameData.prizeLevels.push(+k.split('level')[1]);
} }
this.dispatchEvent(FYGE.Event.PROGRESS, 0.5); this.dispatchEvent(FYGE.Event.PROGRESS, 0.5);
//首次进入,地图页面需要引导
// if (Tools.gameData.isFristLogin) {
// }
//加载地图资源
// await Promise.all([
// 'map',
// 'mapCrabEffect',
// 'mapOwlEffect',
// 'mapWhaleEffect',
// 'mapCheckPrizeEffect'
// ].map((e) => {
// return RES.loadGroup(e)
// }))
await RES.loadGroup("map"); await RES.loadGroup("map");
this.dispatchEvent(FYGE.Event.PROGRESS, 0.6); this.dispatchEvent(FYGE.Event.PROGRESS, 0.6);
this.dispatchEvent(FYGE.Event.PROGRESS, 0.7); this.dispatchEvent(FYGE.Event.PROGRESS, 0.7);
......
...@@ -34,11 +34,11 @@ export class LotteryScene extends Scene { ...@@ -34,11 +34,11 @@ export class LotteryScene extends Scene {
// dLevel = d + 1; // dLevel = d + 1;
// } // }
// }); // });
Tools.baseInfo.prizeLevels.sort((a, b) => { Tools.gameData.prizeLevels.sort((a, b) => {
return a - b return a - b
}) })
var index = Tools.baseInfo.prizeLevels.indexOf(this.data.level); var index = Tools.gameData.prizeLevels.indexOf(this.data.level);
let upLevel = Tools.baseInfo.prizeLevels[index + 1] let upLevel = Tools.gameData.prizeLevels[index + 1]
//标题文案 //标题文案
this.addChild(Tools.getText( this.addChild(Tools.getText(
this.data.level + "关抽奖奖励", this.data.level + "关抽奖奖励",
......
...@@ -313,10 +313,10 @@ export class PlayScene extends Scene { ...@@ -313,10 +313,10 @@ export class PlayScene extends Scene {
} else { } else {
this.enableMouseEvt(true); this.enableMouseEvt(true);
//首次送道具,的动画先出,然后再出引导 //首次送道具,的动画先出,然后再出引导
if (this.chapter == 1 && Tools.gameData.isFristLogin) { if (this.chapter == 1 && Tools.globalData.isNewUser) {
this.addChild(new FirstPropGift()) this.addChild(new FirstPropGift())
.once(FYGE.MouseEvent.CLICK, (e: FYGE.MouseEvent) => { .once(FYGE.MouseEvent.CLICK, (e: FYGE.MouseEvent) => {
Tools.gameData.isFristLogin = false; Tools.globalData.isNewUser = false;
//移除自己 //移除自己
this.removeChild(e.target) this.removeChild(e.target)
//游戏引导 //游戏引导
...@@ -791,9 +791,9 @@ export class PlayScene extends Scene { ...@@ -791,9 +791,9 @@ export class PlayScene extends Scene {
* 绝对别修改,其他地方有调用的 * 绝对别修改,其他地方有调用的
*/ */
updateScene() { updateScene() {
this.propBtnCon.boomCount = Tools.gameData.tools.BOOMS; this.propBtnCon.boomCount = Tools.gameData.tools.booms;
this.propBtnCon.hammerCount = Tools.gameData.tools.HAMMERS; this.propBtnCon.hammerCount = Tools.gameData.tools.hammers;
this.propBtnCon.stepCount = Tools.gameData.tools.STEPS; this.propBtnCon.stepCount = Tools.gameData.tools.steps;
} }
//侦听事件 //侦听事件
...@@ -1863,7 +1863,7 @@ export class PlayScene extends Scene { ...@@ -1863,7 +1863,7 @@ export class PlayScene extends Scene {
//判断步数是否为0; //判断步数是否为0;
if (this.steps == 0) { if (this.steps == 0) {
//还未提示过加步数 //还未提示过加步数
if (!this.addedStepWarning && Tools.gameData.tools.STEPS > 0) { if (!this.addedStepWarning && Tools.gameData.tools.steps > 0) {
this.addedStepWarning = true; this.addedStepWarning = true;
//没步数弹框 //没步数弹框
showPanel(NoStepPanel, { showPanel(NoStepPanel, {
......
...@@ -8,8 +8,6 @@ import { layers } from "../../../module/views/layers"; ...@@ -8,8 +8,6 @@ import { layers } from "../../../module/views/layers";
import { Tools } from "../../Tools"; import { Tools } from "../../Tools";
import { showPanel } from "../../../module/ctrls"; import { showPanel } from "../../../module/ctrls";
import { FreePowerPanel } from "../../panels/FreePowerPanel"; import { FreePowerPanel } from "../../panels/FreePowerPanel";
import { PrizePanel } from "../../panels/PrizePanel";
import { GTool } from "../../../module/tools/GTool";
import ScrollPage = FYGE.ScrollPage; import ScrollPage = FYGE.ScrollPage;
import Container = FYGE.Container; import Container = FYGE.Container;
import Graphics = FYGE.Graphics; import Graphics = FYGE.Graphics;
...@@ -47,20 +45,9 @@ export class MapScene extends Scene { ...@@ -47,20 +45,9 @@ export class MapScene extends Scene {
this.initMap(); this.initMap();
this.updateMapCheck(); this.updateMapCheck();
if (Tools.gameData.loginAddPower && !Tools.gameData.isFristLogin) { if (Tools.globalData.isFirstLogin && !Tools.globalData.isNewUser) {
showPanel(FreePowerPanel); showPanel(FreePowerPanel);
Tools.gameData.loginAddPower = false; Tools.globalData.isFirstLogin = false;
}
let openPrize = GTool.readCache('openPrize');
if (Tools.gameData.topAward && Tools.gameData.topAward.openPrizeStatus && openPrize !== 'true') { // 开奖了,并且没弹过
GTool.writeCache('openPrize', 'true');
if (Tools.gameData.topAward.prize && Tools.gameData.topAward.prize._id) { // 有奖
showPanel(PrizePanel, JSON.parse(JSON.stringify(Tools.gameData.topAward.prize)));
} else { // 没奖
// showPanel(NoPrizePanel);
}
Tools.gameData.topAward = null;
} }
} }
...@@ -68,7 +55,7 @@ export class MapScene extends Scene { ...@@ -68,7 +55,7 @@ export class MapScene extends Scene {
if (this.data && this.data.from == 'loading') { if (this.data && this.data.from == 'loading') {
this.uiLayer = this.addChild(new MapUI()); this.uiLayer = this.addChild(new MapUI());
this.initMapByData(Tools.gameData); this.initMapByData(Tools.gameData);
if (Tools.gameData.isFristLogin) { if (Tools.globalData.isNewUser) {
this.initGuide(); this.initGuide();
} }
} else { } else {
...@@ -82,9 +69,6 @@ export class MapScene extends Scene { ...@@ -82,9 +69,6 @@ export class MapScene extends Scene {
} }
private initGuide() { private initGuide() {
//有bug再说
// Tools.gameData.isFristLogin = false;
setTimeout(() => this.scrollToCheck(3)); setTimeout(() => this.scrollToCheck(3));
const guide = this.addChild(new Container()); const guide = this.addChild(new Container());
...@@ -157,7 +141,7 @@ export class MapScene extends Scene { ...@@ -157,7 +141,7 @@ export class MapScene extends Scene {
} }
// 闯关记录里有的 // 闯关记录里有的
data.visitors.forEach((v) => { data.records.forEach((v) => {
MapScene.checkArr[v.level].data = v; MapScene.checkArr[v.level].data = v;
}); });
......
.canvas {
width:100%;
height:100%;
}
.page-game {
/* position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
min-height: 100vh; */
width:100%;
height:100vh;
flex: 1;
display: flex;
flex-direction: column;
background: #f5cccd;
}
<view class="page-game">
<canvas id="canvas" type="2d" class="canvas" disable-scroll="true"
onTouchStart="onMouseEvent"
onTouchMove="onMouseEvent"
onTouchEnd="onMouseEvent"
onReady="onCanvasReady"
></canvas>
</view>
This diff is collapsed.
{
"disableScroll": "true"
}
\ No newline at end of file
This diff is collapsed.
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