Commit 303e94ae authored by wjf's avatar wjf

l

parents c7991a66 6e9a9bcf
......@@ -2,37 +2,17 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="9cef0552-af3c-4a1c-be1f-dc41ebe5b6db" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/resource/common/comm_light.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_0.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_1.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_10.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_11.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_12.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_13.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_14.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_15.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_2.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_3.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_4.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_5.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_6.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_7.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_8.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/starLight/star_light_9.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/mock/miniTb/babycare.getActivityBaseInfoById.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/SuccessPanel/star_left_dis.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/SuccessPanel/star_left_en.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/SuccessPanel/star_mid_dis.png" beforeDir="false" afterPath="$PROJECT_DIR$/resource/SuccessPanel/star_dis.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/SuccessPanel/star_mid_en.png" beforeDir="false" afterPath="$PROJECT_DIR$/resource/SuccessPanel/star_en.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/SuccessPanel/star_right_dis.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/SuccessPanel/star_right_en.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/SuccessPanel/按钮-继续闯关.png" beforeDir="false" afterPath="$PROJECT_DIR$/resource/SuccessPanel/去抽奖.png" afterDir="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$/mock/miniTb/babycare.getIndex.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/miniTb/babycare.getIndex.json" afterDir="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$/src/SkinJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/SkinJson.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/panels/SuccessPrizePanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/SuccessPrizePanel.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/StartPanelPrize.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/StartPanelPrize.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/map/MapScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/MapScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/map/MapUI.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/MapUI.ts" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -63,7 +43,7 @@
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resource/starLight" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resource/SuccessPanel" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
......@@ -71,25 +51,25 @@
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
<property name="settings.editor.selected.configurable" value="editor.preferences.fonts.default" />
<property name="settings.editor.selected.configurable" value="yiiguxing.plugin.translate" />
<property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resource/starLight" />
<recent name="$PROJECT_DIR$/resource/SuccessPrizePanel" />
<recent name="$PROJECT_DIR$/resource/map" />
<recent name="$PROJECT_DIR$/resource/mapCheckPrizeEffect" />
<recent name="$PROJECT_DIR$/resource/map_owl_effecrt" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resource/common" />
<recent name="$PROJECT_DIR$/resource/SuccessPrizePanel" />
<recent name="$PROJECT_DIR$/resource/mapWhaleEffect" />
<recent name="$PROJECT_DIR$/src/scene/map" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resource/SuccessPanel" />
<recent name="$PROJECT_DIR$/resource/starLight" />
<recent name="$PROJECT_DIR$/resource/SuccessPrizePanel" />
<recent name="$PROJECT_DIR$/resource/map" />
<recent name="$PROJECT_DIR$/resource/mapCheckPrizeEffect" />
</key>
</component>
<component name="RunManager" selected="npm.flushRes">
<component name="RunManager" selected="npm.dev">
<configuration name="dev" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
......@@ -113,8 +93,8 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="npm.flushRes" />
<item itemvalue="npm.dev" />
<item itemvalue="npm.flushRes" />
</list>
</recent_temporary>
</component>
......@@ -134,7 +114,8 @@
<workItem from="1594604662575" duration="27200000" />
<workItem from="1594691193000" duration="14409000" />
<workItem from="1594712553750" duration="3451000" />
<workItem from="1594777357248" duration="15025000" />
<workItem from="1594777357248" duration="24313000" />
<workItem from="1594864188027" duration="11253000" />
</task>
<task id="LOCAL-00001" summary="111">
<created>1594122339119</created>
......@@ -255,7 +236,21 @@
<option name="project" value="LOCAL" />
<updated>1594781505168</updated>
</task>
<option name="localTasksCounter" value="18" />
<task id="LOCAL-00018" summary="Success Panel Effect!">
<created>1594794860900</created>
<option name="number" value="00018" />
<option name="presentableId" value="LOCAL-00018" />
<option name="project" value="LOCAL" />
<updated>1594794860900</updated>
</task>
<task id="LOCAL-00019" summary="Success Panel Effect!">
<created>1594799066356</created>
<option name="number" value="00019" />
<option name="presentableId" value="LOCAL-00019" />
<option name="project" value="LOCAL" />
<updated>1594799066356</updated>
</task>
<option name="localTasksCounter" value="20" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......@@ -281,26 +276,30 @@
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state x="251" y="471" key="ANALYSIS_DLG_com.intellij.analysis.BaseAnalysisAction$1/31.23.1889.1177@31.23.1889.1177" timestamp="1594113080922" />
<state x="754" y="183" key="CommitChangelistDialog2" timestamp="1594781504873">
<state x="754" y="183" key="CommitChangelistDialog2" timestamp="1594799066118">
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state x="754" y="183" key="CommitChangelistDialog2/31.23.1889.1177@31.23.1889.1177" timestamp="1594781504873" />
<state width="882" height="327" key="GridCell.Tab.0.bottom" timestamp="1594793979488">
<state x="754" y="183" key="CommitChangelistDialog2/31.23.1889.1177@31.23.1889.1177" timestamp="1594799066118" />
<state width="876" height="321" key="GridCell.Tab.0.bottom" timestamp="1594870421111">
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state width="882" height="327" key="GridCell.Tab.0.bottom/31.23.1889.1177@31.23.1889.1177" timestamp="1594793979488" />
<state width="882" height="327" key="GridCell.Tab.0.center" timestamp="1594793979487">
<state width="882" height="321" key="GridCell.Tab.0.bottom/31.23.1649.1027@31.23.1649.1027" timestamp="1594827479519" />
<state width="876" height="321" key="GridCell.Tab.0.bottom/31.23.1889.1177@31.23.1889.1177" timestamp="1594870421111" />
<state width="876" height="321" key="GridCell.Tab.0.center" timestamp="1594870421110">
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state width="882" height="327" key="GridCell.Tab.0.center/31.23.1889.1177@31.23.1889.1177" timestamp="1594793979487" />
<state width="882" height="327" key="GridCell.Tab.0.left" timestamp="1594793979487">
<state width="882" height="321" key="GridCell.Tab.0.center/31.23.1649.1027@31.23.1649.1027" timestamp="1594827479518" />
<state width="876" height="321" key="GridCell.Tab.0.center/31.23.1889.1177@31.23.1889.1177" timestamp="1594870421110" />
<state width="876" height="321" key="GridCell.Tab.0.left" timestamp="1594870421110">
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state width="882" height="327" key="GridCell.Tab.0.left/31.23.1889.1177@31.23.1889.1177" timestamp="1594793979487" />
<state width="882" height="327" key="GridCell.Tab.0.right" timestamp="1594793979488">
<state width="882" height="321" key="GridCell.Tab.0.left/31.23.1649.1027@31.23.1649.1027" timestamp="1594827479517" />
<state width="876" height="321" key="GridCell.Tab.0.left/31.23.1889.1177@31.23.1889.1177" timestamp="1594870421110" />
<state width="876" height="321" key="GridCell.Tab.0.right" timestamp="1594870421111">
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state width="882" height="327" key="GridCell.Tab.0.right/31.23.1889.1177@31.23.1889.1177" timestamp="1594793979488" />
<state width="882" height="321" key="GridCell.Tab.0.right/31.23.1649.1027@31.23.1649.1027" timestamp="1594827479518" />
<state width="876" height="321" key="GridCell.Tab.0.right/31.23.1889.1177@31.23.1889.1177" timestamp="1594870421111" />
<state x="82" y="353" key="IDE.errors.dialog" timestamp="1594777965326">
<screen x="31" y="23" width="1889" height="1177" />
</state>
......@@ -309,14 +308,14 @@
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state x="210" y="320" key="RollbackChangesDialog/31.23.1889.1177@31.23.1889.1177" timestamp="1594173186663" />
<state x="31" y="250" key="SettingsEditor" timestamp="1594195630991">
<state x="300" y="248" key="SettingsEditor" timestamp="1594798992724">
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state x="31" y="250" key="SettingsEditor/31.23.1889.1177@31.23.1889.1177" timestamp="1594195630991" />
<state x="92" y="351" key="Vcs.Push.Dialog.v2" timestamp="1594726954085">
<state x="300" y="248" key="SettingsEditor/31.23.1889.1177@31.23.1889.1177" timestamp="1594798992724" />
<state x="92" y="351" key="Vcs.Push.Dialog.v2" timestamp="1594799067637">
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state x="92" y="351" key="Vcs.Push.Dialog.v2/31.23.1889.1177@31.23.1889.1177" timestamp="1594726954085" />
<state x="92" y="351" key="Vcs.Push.Dialog.v2/31.23.1889.1177@31.23.1889.1177" timestamp="1594799067637" />
<state x="87" y="216" key="com.intellij.openapi.editor.actions.MultiplePasteAction$ClipboardContentChooser" timestamp="1594705166397">
<screen x="31" y="23" width="1889" height="1177" />
</state>
......@@ -341,9 +340,9 @@
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state x="157" y="286" key="run.anything.popup/31.23.1889.1177@31.23.1889.1177" timestamp="1594712635697" />
<state x="640" y="288" width="670" height="676" key="search.everywhere.popup" timestamp="1594791368676">
<state x="640" y="288" width="670" height="676" key="search.everywhere.popup" timestamp="1594879664358">
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state x="640" y="288" width="670" height="676" key="search.everywhere.popup/31.23.1889.1177@31.23.1889.1177" timestamp="1594791368676" />
<state x="640" y="288" width="670" height="676" key="search.everywhere.popup/31.23.1889.1177@31.23.1889.1177" timestamp="1594879664358" />
</component>
</project>
\ No newline at end of file
{
"code": "000000",
"data": {
"inviteFriends": {
"type": 2,
"value": 10,
"taskNum": 3
},
"openId": "AAFwCvE-ALiIWXYsJuTQVRpH",
"rule": "测试规则4455334354",
"updateTime": 1594627802429,
"title": "测试活动",
"toolsProbability": {
"HAMMERS": {
"properiodfrom": 1,
"properiodto": 500,
"probability": 5
},
"STEPS": {
"properiodfrom": 1001,
"properiodto": 1400,
"probability": 4
},
"BOOMS": {
"properiodfrom": 501,
"properiodto": 1000,
"probability": 5
}
},
"levelPrize": {
"level_90": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png",
"level_60": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01Llkz1U1wMhRqE4D0f_!!2275046294-2-miniprogram.png",
"level_120": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01WvSfpG1wMhRrsjqFq_!!2275046294-2-miniprogram.png",
"level_30": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01Mf9wLi1wMhRoCuoOs_!!2275046294-2-miniprogram.png",
"level_10": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01bsypJm1wMhRsRMjh1_!!2275046294-2-miniprogram.png"
},
"buyCredits": {
"HAMMERS": "8",
"POWERS": "9",
"BOOMS": "6",
"STEPS": "7"
},
"beMembership": 65,
"openPrizeMsg": "",
"createTime": 1594361933457,
"deleteStatus": 1,
"browseGoods": {
"itemIds": "32223",
"type": 1,
"value": 10,
"taskNum": 3
},
"startTime": 1592448580000,
"_id": "5f08084ec3ad3494b9201c0e",
"endTime": 1594966980000,
"attentionStore": 7,
"openPrizeStatus": 3
},
"success": true,
"message": "成功"
}
......@@ -4,7 +4,7 @@
"message": "OK",
"data": {
"power": 100,
"currentLevel": 120,
"currentLevel": 1,
"tools": {
"STEPS": 1,
"BOOMS": 2,
......@@ -12,13 +12,29 @@
},
"prizes": [
{
"level": 5
"receiveTime": "",
"level": 120,
"isReceive": false
},
{
"level": 4
"receiveTime": "",
"level": 90,
"isReceive": false
},
{
"level": 1
"receiveTime": "",
"level": 60,
"isReceive": false
},
{
"receiveTime": "",
"level": 30,
"isReceive": false
},
{
"receiveTime": "",
"level": 10,
"isReceive": false
}
],
"visitors": [
......
{
"success": true,
"data": {
"avatar": "string",
"avatar": "https://source.unsplash.com/user/erondu/76x76",
"nickName": "我啊是大请问",
"activityId": "string",
"openId": "string",
"inviteId": "string",
"isFollow": true
}
}
\ No newline at end of file
}
......@@ -73,8 +73,8 @@
"name": "playScene"
},
{
"keys": "活动规则背景.png",
"name": "RulePanel"
"keys": "img_line1.png,img_line2.png,img_line3.png,img_line4.png,img_line5.png,loadingBg.jpg,loadingBg2.png,loadingPro0.png,loadingPro1.png,loadingPro10.png,loadingPro11.png,loadingPro2.png,loadingPro3.png,loadingPro4.png,loadingPro5.png,loadingPro6.png,loadingPro7.png,loadingPro8.png,loadingPro9.png,loadingTitle.png,proDown.png,wheel.png",
"name": "loadingScene"
},
{
"keys": "star_light_0.png,star_light_1.png,star_light_10.png,star_light_11.png,star_light_12.png,star_light_13.png,star_light_14.png,star_light_15.png,star_light_2.png,star_light_3.png,star_light_4.png,star_light_5.png,star_light_6.png,star_light_7.png,star_light_8.png,star_light_9.png",
......
......@@ -73,8 +73,8 @@ export const ResJson = {
"name": "playScene"
},
{
"keys": "活动规则背景.png",
"name": "RulePanel"
"keys": "img_line1.png,img_line2.png,img_line3.png,img_line4.png,img_line5.png,loadingBg.jpg,loadingBg2.png,loadingPro0.png,loadingPro1.png,loadingPro10.png,loadingPro11.png,loadingPro2.png,loadingPro3.png,loadingPro4.png,loadingPro5.png,loadingPro6.png,loadingPro7.png,loadingPro8.png,loadingPro9.png,loadingTitle.png,proDown.png,wheel.png",
"name": "loadingScene"
},
{
"keys": "star_light_0.png,star_light_1.png,star_light_10.png,star_light_11.png,star_light_12.png,star_light_13.png,star_light_14.png,star_light_15.png,star_light_2.png,star_light_3.png,star_light_4.png,star_light_5.png,star_light_6.png,star_light_7.png,star_light_8.png,star_light_9.png",
......
......@@ -9,6 +9,28 @@ export const SkinJson = {
"y": 0,
"type": "container",
"children": [
{
"name": "light1",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light1"
},
{
"name": "light2",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light2"
},
{
"name": "闯关成功Bg",
"x": 55,
......@@ -55,7 +77,7 @@ export const SkinJson = {
{
"name": "关卡文字",
"x": 300,
"y": 521,
"y": 501,
"alpha": 1,
"type": "text",
"props": {
......@@ -100,6 +122,28 @@ export const SkinJson = {
"y": 0,
"type": "container",
"children": [
{
"name": "light1",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light1"
},
{
"name": "light2",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light2"
},
{
"name": "闯关成功",
"x": 55,
......@@ -146,7 +190,7 @@ export const SkinJson = {
{
"name": "关卡文字",
"x": 300,
"y": 521,
"y": 501,
"alpha": 1,
"type": "text",
"props": {
......@@ -525,7 +569,8 @@ export const SkinJson = {
"type": "sprite",
"props": {
"source": "prize.png"
}
},
"id": "prizeImg"
},
{
"name": "关闭按钮",
......
......@@ -14,6 +14,15 @@ export enum TbNetName {
* activityId userNick avatar follow inviteId
*/
getIndex = "babycare.getIndex",
/**
* 活动基本信息
* @param activityId
* @type {string}
*/
getActivityBaseInfoById = "babycare.getActivityBaseInfoById",
/**
* 获取游戏信息
* activityId
......
......@@ -54,6 +54,19 @@ export class Tools {
"isFristLogin": boolean,//是否是首次
"topAward": any//120关自动开奖
}
public static baseInfo: {
prizeLevels: number[],
inviteFriends: any,
openId: string,
rule: string,
updateTime: number,
title: string,
toolsProbability: any,
levelPrize: any,
buyCredits: any, /// TODO ……
};// 活动基本信息
/**
* 首页数据,loading页面执行一次
*/
......@@ -70,6 +83,7 @@ export class Tools {
})
})
}
/**
* 进入地图页面刷新
*/
......@@ -81,12 +95,13 @@ export class Tools {
})
})
}
/**
* 消耗道具
*/
public static consumerTools(type: PropType): Promise<boolean> {
return new Promise((resolve, reject) => {
sendTbNet(TbNetName.consumerTools, { type }, (s, res) => {
sendTbNet(TbNetName.consumerTools, {type}, (s, res) => {
if (s) {
//修改道具数量
this.gameData.tools = res.data.tools;
......@@ -98,6 +113,7 @@ export class Tools {
})
})
}
/**
* 兑换道具,根据返回参数判断
*/
......@@ -112,7 +128,7 @@ export class Tools {
if (creditsData && !creditsData.success && !creditsData.data.isvip) {
return creditsData.data.url
}
const res = await sendTbNet(TbNetName.exchange, { type, credits: creditsData.data.credits })
const res = await sendTbNet(TbNetName.exchange, {type, credits: creditsData.data.credits})
if (res.success) {
//修改道具数量和体力
this.gameData.power = res.data.power;
......@@ -122,6 +138,7 @@ export class Tools {
return false;
}
}
/**
* 询问权限用
*/
......@@ -130,11 +147,11 @@ export class Tools {
var tbMy = my
if (!tbMy) return;
//@ts-ignore
const { cloud } = getApp();
const {cloud} = getApp();
//测试地址//到时云存储传一个小json,,改路径
var url = "cloud://B4F0300E5148F478B506DEDC26EA4C6C//butterfly0.svga";
//获取临时地址
var urls = await cloud.file.getTempFileURL({ fileId: [url] })
var urls = await cloud.file.getTempFileURL({fileId: [url]})
url = urls[0].url.replace('-internal', '');
tbMy.downloadFile({
url: url,
......@@ -143,10 +160,10 @@ export class Tools {
tbMy.getFileSystemManager().readFile({
filePath: i,
// encoding: "utf8",
success: function (r) {
success: function(r) {
},
fail: function (res) {
fail: function(res) {
}
})
......@@ -290,11 +307,11 @@ export class Tools {
showTime: number = 300
) {
Tween.get(target)
.set({ alpha: 0, visible: true })
.to({ alpha: 1 }, showTime, Ease.quadIn)
.set({alpha: 0, visible: true})
.to({alpha: 1}, showTime, Ease.quadIn)
.wait(time)
.to({ alpha: 0 }, showTime, Ease.quadOut)
.set({ alpha: 0, visible: false })
.to({alpha: 0}, showTime, Ease.quadOut)
.set({alpha: 0, visible: false})
.call(() => {
call();
});
......@@ -316,11 +333,11 @@ export class Tools {
/**
* 根据名字获取0到9的贴图
* @param name
* @param name
*/
public static getNumTextures(name: string): { [key: number]: FYGE.Texture } {
var arr = {}
for (var i = 0; i <= 9; i++)arr[i] = RES.getRes(name + i + ".png")
for (var i = 0; i <= 9; i++) arr[i] = RES.getRes(name + i + ".png")
return arr
}
}
......@@ -6,6 +6,10 @@ import { StartTarget } from "./StartPanel";
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
import { Tool } from "../something/Tool";
import { Tools } from "../Tools";
export class StartPanelPrize extends Panel {
get groupNames() {
......@@ -33,6 +37,7 @@ export class StartPanelPrize extends Panel {
startBtn2: FYGE.Button;
tipsTex: FYGE.TextField;
checkTex: FYGE.TextField;
prizeImg: Sprite;
initUi() {
this.checkTex.textWidth = 750;
......@@ -45,6 +50,10 @@ export class StartPanelPrize extends Panel {
this.addChild(new StartTarget(this.data.level))
.position.set(0, 682);
this.prizeImg.texture = Texture.fromUrl(Tools.baseInfo.levelPrize[`level_${this.data.level}`]);
this.prizeImg.anchorTexture.x = 0.5;
this.prizeImg.x = 750 / 2;
}
start(data) {
......
......@@ -11,7 +11,7 @@ import { RES } from "../../module/RES";
export class SuccessNoPrizePanel extends Panel {
get groupNames() {
return ["SuccessPanel", 'starLight']
return ['SuccessPanel', 'starLight']
}
get skinName() {
......@@ -36,6 +36,8 @@ export class SuccessNoPrizePanel extends Panel {
againBtn: FYGE.Button;
continueBtn: FYGE.Button;
totalContinueBtn: FYGE.Button;
light1: Sprite;
light2: Sprite;
private starGroup: SuccessStarGroup = null;
......@@ -49,9 +51,20 @@ export class SuccessNoPrizePanel extends Panel {
this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(373, 680);
this.lightEffect();
this.starGroup.play(3);
}
private lightEffect() {
Tween.get(this.light1, {loop: true})
.set({anchorX: 219.5, anchorY: 219.5})
.to({rotation: 360}, 12000);
Tween.get(this.light2, {loop: true})
.set({anchorX: 219.5, anchorY: 219.5})
.to({rotation: -360}, 12000);
}
start(data) {
super.start();
}
......
......@@ -3,10 +3,11 @@ import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import { SuccessStarGroup } from "./SuccessNoPrizePanel";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite;
export class SuccessPrizePanel extends Panel {
get groupNames() {
return ["SuccessPanel", 'starLight']
return ['SuccessPanel', 'starLight']
}
get skinName() {
......@@ -31,6 +32,8 @@ export class SuccessPrizePanel extends Panel {
againBtn: FYGE.Button;
noPrizeAgainBtn: FYGE.Button;
goPrizeBtn: FYGE.Button;
light1: Sprite;
light2: Sprite;
private starGroup: SuccessStarGroup = null;
......@@ -44,9 +47,20 @@ export class SuccessPrizePanel extends Panel {
this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(373, 678);
this.lightEffect();
this.starGroup.play(4);
}
private lightEffect() {
Tween.get(this.light1, {loop: true})
.set({anchorX: 219.5, anchorY: 219.5})
.to({rotation: 360}, 12000);
Tween.get(this.light2, {loop: true})
.set({anchorX: 219.5, anchorY: 219.5})
.to({rotation: -360}, 12000);
}
start(data) {
super.start();
}
......
......@@ -11,8 +11,6 @@ import { GTool } from "../../module/tools/GTool";
import { Lottie } from "../Lottie";
import { lottieConfig } from "../aa";
export class LoadingScene extends Scene {
get groupNames() {
return ["loadingScene"]
......@@ -40,7 +38,7 @@ export class LoadingScene extends Scene {
.position.set((750 - 577) / 2, 1288 - 24)
//进度条帧动画
var arr = [];
for (var i = 0; i <= 11; i++)arr.push(RES.getRes("loadingPro" + i + ".png"))
for (var i = 0; i <= 11; i++) arr.push(RES.getRes("loadingPro" + i + ".png"))
var pro = this.addChild(new FYGE.FrameAni(arr));
pro.play(0)
pro.position.set(375, 1288)//位置按正常满条的位置
......@@ -87,8 +85,9 @@ export class LoadingScene extends Scene {
GDispatcher.addEventListener(FYGE.Event.PROGRESS, this.progressEvent, this)
//首次进度一点
GDispatcher.dispatchEvent(FYGE.Event.PROGRESS, 0.2)
//获取app数据
const { data } = await sendTbNet(TbNetName.getAppData);
const {data} = await sendTbNet(TbNetName.getAppData);
Tools.globalData = data;
GDispatcher.dispatchEvent(FYGE.Event.PROGRESS, 0.3)
//询问读取权限,不阻止进程
......@@ -96,7 +95,18 @@ export class LoadingScene extends Scene {
//获取首页数据
var getIndexSuccesss = await Tools.getIndex()
//失败不进入
if (!getIndexSuccesss) return;
GDispatcher.dispatchEvent(FYGE.Event.PROGRESS, 0.3);
// 游戏基本信息
const baseInfo = await sendTbNet(TbNetName.getActivityBaseInfoById);
Tools.baseInfo = baseInfo.data;
Tools.baseInfo.prizeLevels = [];
for (let k in Tools.baseInfo.levelPrize) {
Tools.baseInfo.prizeLevels.push(+k.split('_')[1]);
}
GDispatcher.dispatchEvent(FYGE.Event.PROGRESS, 0.5);
//首次进入,地图页面需要引导
// if (Tools.gameData.isFristLogin) {
......@@ -109,7 +119,9 @@ export class LoadingScene extends Scene {
'mapOwlEffect',
'mapWhaleEffect',
'mapCheckPrizeEffect'
].map((e) => { return RES.loadGroup(e) }))
].map((e) => {
return RES.loadGroup(e)
}))
GDispatcher.dispatchEvent(FYGE.Event.PROGRESS, 1);
}
......@@ -117,11 +129,11 @@ export class LoadingScene extends Scene {
// private lastP=0
progressEvent(e: FYGE.Event) {
FYGE.Tween.get(this.progressBar, null, null, true)
.to({ value: e.data }, 2000/**(p-this.lastP)*/)
.to({value: e.data}, 2000/**(p-this.lastP)*/)
.call(() => {
if (e.data >= 1) {
GDispatcher.removeEventListener(FYGE.Event.PROGRESS, this.progressEvent, this);
changeScene(MapScene, { from: "loading" })
changeScene(MapScene, {from: "loading"})
}
})
// this.lastP=p
......@@ -184,19 +196,19 @@ class Title extends FYGE.Container {
this.y = -560;//待调整
//新建就动画出现吧,
FYGE.Tween.get(this)
.to({ y: targetY + 25 }, 300)
.to({ y: targetY - 30 }, 100)
.to({ y: targetY }, 100);
.to({y: targetY + 25}, 300)
.to({y: targetY - 30}, 100)
.to({y: targetY}, 100);
[line, title].forEach((e) => {
FYGE.Tween.get(e)
.to({ rotation: 1.5 }, 300)
.to({ rotation: -0.5 }, 100)
.to({ rotation: 0 }, 100)
.to({rotation: 1.5}, 300)
.to({rotation: -0.5}, 100)
.to({rotation: 0}, 100)
if (e === line) {
FYGE.Tween.get(e)
.to({ scaleY: 1.05 }, 300)
.to({ scaleY: 0.96 }, 100)
.to({ scaleY: 1 }, 100)
.to({scaleY: 1.05}, 300)
.to({scaleY: 0.96}, 100)
.to({scaleY: 1}, 100)
}
})
......
......@@ -241,7 +241,7 @@ class CheckCurEffect extends Container {
this.light1.anchorTexture.set(0.5, 0.5);
this.light2.anchorTexture.set(0.5, 0.5);
this.position.set(53, 50);
this.position.set(55, 50);
this.mouseEnable = this.mouseChildren = false;
}
......
......@@ -20,11 +20,19 @@ export default class MapPart extends Container {
}
protected initIcon() {
this.data.forEach((value, index) => {
// 坑爹的头像,所以倒着加,可以解决层级问题
for (let i = this.data.length - 1; i >= 0; i--) {
const value = this.data[i];
const nBtn = this.addChild(new CheckBtn(value));
nBtn.position.set(this.btnPos[index][0], this.btnPos[index][1]);
nBtn.position.set(this.btnPos[i][0], this.btnPos[i][1]);
MapScene.checkArr[value.check] = nBtn;
});
}
// this.data.forEach((value, index) => {
// const nBtn = this.addChild(new CheckBtn(value));
//
// nBtn.position.set(this.btnPos[index][0], this.btnPos[index][1]);
// MapScene.checkArr[value.check] = nBtn;
// });
}
}
......@@ -5,14 +5,13 @@ import MapUI from "./MapUI";
import MapMid from "./MapMid";
import CheckBtn, { CHECK_TYPE } from "./CheckBtn";
import { layers } from "../../../module/views/layers";
import { sendTbNet, TbNetName } from "../../TaoBaoNet";
import { Tools } from "../../Tools";
import { getTbData, sendTbNet, TbNetName } from "../../TaoBaoNet";
import ScrollPage = FYGE.ScrollPage;
import Container = FYGE.Container;
import { Tools } from "../../Tools";
import Graphics = FYGE.Graphics;
import { showPanel } from "../../../module/ctrls";
import { SuccessNoPrizePanel } from "../../panels/SuccessNoPrizePanel";
import { SuccessPrizePanel } from "../../panels/SuccessPrizePanel";
import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
export class MapScene extends Scene {
private mapContainer: Container = null;
......@@ -50,54 +49,58 @@ export class MapScene extends Scene {
this.initMap();
this.updateMapCheck();
showPanel(SuccessPrizePanel);
// showPanel(SuccessNoPrizePanel)
}
private updateMapCheck() {
sendTbNet(TbNetName.getIndex, {},
(success, res) => {
if (!success) return;
this.uiLayer.energyBox.count = res.data.power;
if (this.data.from == 'loading') {
this.initMapByData(Tools.gameData);
} else {
Tools.getIndex().then((success) => {
if (success) {
this.initMapByData(Tools.gameData);
}
});
}
}
const currentLevel = res.data.currentLevel;
private initMapByData(data) {
this.uiLayer.energyBox.count = data.power;
// 已经通关的
for (let i = 1; i < currentLevel; i++) {
MapScene.checkArr[i].type = CHECK_TYPE.COM;
MapScene.checkArr[i].enabled = true;
}
const currentLevel = data.currentLevel;
// 当前关卡
if (currentLevel < 121 && currentLevel > 0) {
MapScene.checkArr[currentLevel].type = CHECK_TYPE.CUR;
MapScene.checkArr[currentLevel].enabled = true;
!this.mapAvatar && (this.mapAvatar = this.addChild(new MapAvatar()));
this.mapAvatar.parent && this.mapAvatar.parent.removeChild(this.mapAvatar);
MapScene.checkArr[currentLevel].addChild(this.mapAvatar);
}
// 已经通关的
for (let i = 1; i < currentLevel; i++) {
MapScene.checkArr[i].type = CHECK_TYPE.COM;
MapScene.checkArr[i].enabled = true;
}
// 未通关的
for (let i = currentLevel + 1; i < 121; i++) {
MapScene.checkArr[i].type = CHECK_TYPE.COM;
MapScene.checkArr[i].enabled = false;
}
// 当前关卡
if (currentLevel < 121 && currentLevel > 0) {
MapScene.checkArr[currentLevel].type = CHECK_TYPE.CUR;
MapScene.checkArr[currentLevel].enabled = true;
!this.mapAvatar && (this.mapAvatar = this.addChild(new MapAvatar()));
this.mapAvatar.parent && this.mapAvatar.parent.removeChild(this.mapAvatar);
MapScene.checkArr[currentLevel].addChild(this.mapAvatar);
}
// 闯关记录里有的
res.data.visitors.forEach((v) => {
MapScene.checkArr[v.level].data = v;
});
// 未通关的
for (let i = currentLevel + 1; i < 121; i++) {
MapScene.checkArr[i].type = CHECK_TYPE.COM;
MapScene.checkArr[i].enabled = false;
}
// 奖励关卡
res.data.prizes.forEach((v) => {
MapScene.checkArr[v.level].isPrize = true;
});
// 闯关记录里有的
data.visitors.forEach((v) => {
MapScene.checkArr[v.level].data = v;
});
this.scrollToCheck(currentLevel);
// 奖励关卡
data.prizes.forEach((v) => {
MapScene.checkArr[v.level].isPrize = true;
});
}
);
this.scrollToCheck(currentLevel);
}
public initMap() {
......@@ -166,6 +169,8 @@ export class MapScene extends Scene {
*/
export class MapAvatar extends Container {
private avatarImg: Sprite = null;
constructor() {
super();
......@@ -178,7 +183,11 @@ export class MapAvatar extends Container {
const mask = this.addChild(new Graphics());
mask.drawCircle(0, -58, 38);
/// TODO 加头像
this.avatarImg = this.addChild(new Sprite(Texture.fromUrl(
Tools.globalData.avatar
)));
this.avatarImg.width = this.avatarImg.height = 76;
this.avatarImg.position.set(-38, -96);
this.avatarImg.mask = mask;
}
}
......@@ -10,6 +10,8 @@ import { showPanel } from "../../../module/ctrls";
import { RulePanel } from "../../panels/RulePanel";
import { BuyPowerPanel } from "../../panels/BuyPowerPanel";
import { TaskPanel } from "../../panels/TaskPanel";
import { sendTbNet, TbNetName } from "../../TaoBaoNet";
import Texture = FYGE.Texture;
export default class MapUI extends Container {
public energyBox: EnergyBox = null;
......@@ -160,16 +162,24 @@ class CreditsBox extends Container {
this.initUi(data);
}
private initUi(data) {
private async initUi(data) {
this.position.set(544, 184);
this.addChild(Tools.getSprite('map_creditsBg.png'));
const creditsData = await sendTbNet(TbNetName.queryCredits, {}, () => {
}, true);
let jfLabel = '积分:0';
if (!creditsData || !creditsData.data) {
jfLabel = '积分:0';
} else {
jfLabel = `积分:${creditsData.data.credits}`;
}
this.countLabel = this.addChild(Tools.getText(
'积分:0', 20, '#ffffff',
jfLabel, 20, '#ffffff',
TEXT_ALIGN.CENTER, 105, 58, 21
));
}
}
......@@ -208,6 +218,40 @@ class PrizeBox extends Button {
this.prizeImg = this.addChild(Tools.getSprite('map_star_enable.png', 39, 150));
this.prizeImg.width = 80;
this.prizeImg.height = 33;
const prizes = Tools.gameData.prizes;
if (prizes.length <= 0) {
const curLevel: number = Tools.gameData.currentLevel;
let upLevel: number = 120;
let dLevel: number = 120;
Tools.baseInfo.prizeLevels.forEach((value, index) => {
const d: number = value - curLevel;
if (curLevel <= value && d >= 0 && d <= dLevel) {
upLevel = value;
dLevel = d + 1;
}
});
console.log(upLevel, dLevel);
this.checkTip.text = `再闯${dLevel}关`;
this.tip.text = '';
this.prizeImg.texture = Texture.fromUrl(Tools.baseInfo.levelPrize[`level_${upLevel}`]);
} else if (prizes.length == 1 && +prizes[0].level == 120) {
this.checkTip.text = `等待开奖`;
this.tip.text = `8月28日10点\n开启大奖`;
this.prizeImg.texture = Texture.fromUrl(Tools.baseInfo.levelPrize['level_120']);
} else {
let lowerLevel = 120;
prizes.forEach((value) => {
if (value.level < lowerLevel) {
lowerLevel = value.level;
}
});
this.checkTip.text = `点击抽奖`;
this.tip.text = `抽取${lowerLevel}关奖励`;
this.tip.y += 10;
this.prizeImg.texture = Texture.fromUrl(Tools.baseInfo.levelPrize[`level_${lowerLevel}`]);
}
}
initEvent() {
......
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