mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交挂机
This commit is contained in:
@@ -4,7 +4,7 @@ import ResourceData from "../data/ResourceData";
|
||||
import { GUI } from "../ui/UIConfig";
|
||||
|
||||
//接受到JSON消息
|
||||
export const RData = (data:any,isTips:boolean = true) => {
|
||||
export const RData = (data:any,isTips:boolean = false) => {
|
||||
if(data.data.state == 200){
|
||||
//如果有 Resource 字段 表示要刷新资源
|
||||
if(data.data['resources']){
|
||||
@@ -14,6 +14,10 @@ export const RData = (data:any,isTips:boolean = true) => {
|
||||
PlayerPetData.getIns().onUpdateOV(res.operation,res.pet); //刷新宠物
|
||||
})
|
||||
}
|
||||
//弹出提示
|
||||
if(isTips){
|
||||
app.layer.Open(GUI.Tips,{text:data.data.msg});
|
||||
}
|
||||
return data.data.data;
|
||||
}else{
|
||||
//弹出提示
|
||||
@@ -97,7 +101,7 @@ export const API = {
|
||||
|
||||
/********** 新手引导接口 *****************/
|
||||
SavePlayerInfo : async (playerName:string,novice:boolean = true) => (await app.api.post(`/game/player/info/save`,{playerName,novice})).data as NewsContext, //保存玩家信息
|
||||
SelectNovicePet: async (petId:number) => RData(await app.api.post(`/game/novice/select/${petId}`),true), //选择新手引导宠物
|
||||
SelectNovicePet: async (petId:number) => RData(await app.api.post(`/game/novice/select/${petId}`),false), //选择新手引导宠物
|
||||
|
||||
|
||||
/********** 宠物接口 ******************/
|
||||
|
@@ -19,11 +19,11 @@ export const GAPI = {
|
||||
//切换游戏
|
||||
GOnHookSetMap : async (mapId) => RData(await app.api.post(`/game/mode/onHook/setMapId/${mapId}`)) as ModeOnHookOV,
|
||||
//生成野怪
|
||||
GOnHookSpawnCreeps : async () => RProto(await app.api.get(`/game/mode/onHook/onSpawnCreeps`,{responseType:'arraybuffer'},true),GActionType.GOnHookPets) as GOnHookPets,
|
||||
GOnHookSpawnCreeps : async () => RProto(await app.api.get(`/game/mode/onHook/onSpawnCreeps`,{responseType:'arraybuffer'},false),GActionType.GOnHookPets) as GOnHookPets,
|
||||
//捕捉野怪
|
||||
GOnHookCatchCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onCatchCreeps/${creepId}`)) as PlayerPetOV,
|
||||
GOnHookCatchCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onCatchCreeps/${creepId}`),true) as PlayerPetOV,
|
||||
//出售野怪
|
||||
GOnHookSellCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onSellCreeps/${creepId}`)) as boolean,
|
||||
GOnHookSellCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onSellCreeps/${creepId}`),true) as boolean,
|
||||
//下一关
|
||||
GOnHookNextLevel : async () => RData(await app.api.post(`/game/mode/onHook/nextLevel`)) as boolean,
|
||||
|
||||
|
Reference in New Issue
Block a user