新增复活礼包,修改bug
This commit is contained in:
parent
71bccca68b
commit
1a54b904fd
File diff suppressed because it is too large
Load Diff
|
@ -243,6 +243,7 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
this.setUserPower(data);
|
||||
this.setmonth(data);
|
||||
|
||||
let levelInfo = cc.fx.StorageMessage.getStorage("level");
|
||||
//旧的读取数据设置数据方法,以强联网为主
|
||||
if (levelInfo == undefined || levelInfo == "" || levelInfo == null) {
|
||||
|
@ -322,6 +323,7 @@ export default class GameManager extends cc.Component {
|
|||
|
||||
//laf云函数
|
||||
Utils.getUserData((data) => {
|
||||
this.setRevive(data)
|
||||
})
|
||||
}
|
||||
else {
|
||||
|
@ -478,6 +480,7 @@ export default class GameManager extends cc.Component {
|
|||
cc.fx.GameConfig.GM_INFO.freezeAmount = data.result.data.freeze;
|
||||
cc.fx.GameConfig.GM_INFO.hammerAmount = data.result.data.hammer;
|
||||
cc.fx.GameConfig.GM_INFO.magicAmount = data.result.data.magic_wand;
|
||||
|
||||
let propInfoNew = {
|
||||
"freezeAmount": cc.fx.GameConfig.GM_INFO.freezeAmount,
|
||||
"hammerAmount": cc.fx.GameConfig.GM_INFO.hammerAmount,
|
||||
|
@ -698,6 +701,8 @@ export default class GameManager extends cc.Component {
|
|||
|
||||
//laf云函数
|
||||
Utils.getUserData((data) => {
|
||||
this.setRevive(data)
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -791,7 +796,7 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
}
|
||||
setmonth(data) {
|
||||
//如果给的时间戳大于当前时间hpmax=7,否则等于5
|
||||
//如果给的时间戳大于当前时间hpmax=7,否则等于5
|
||||
let nowTime = Math.floor(Date.now() / 1000);
|
||||
if (data.data.monthCardTime > nowTime) {
|
||||
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
|
||||
|
@ -802,7 +807,11 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
console.log(cc.fx.GameConfig.GM_INFO.hp_Max, "00000000000");
|
||||
}
|
||||
|
||||
//复活购买次数初始化
|
||||
setRevive(data) {
|
||||
console.log(data.data.rebornGiftCount, "🔥🔥🔥🔥🔥🔥🔥🔥")
|
||||
cc.fx.GameConfig.GM_INFO.revive = data.data.rebornGiftCount;
|
||||
}
|
||||
update(dt) {
|
||||
//console.log("加载1:", this.load1, "加载2:", this.load2, "加载3:", this.load3, "加载4:", this.load4, "加载5:", this.load5, "加载6:", this.load6, "时间:", this.timeNumber);
|
||||
if (this.load1 && this.load2 && this.load3 && this.load4 && this.load5 && this.load6 == true && this.timeNumber <= 0) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import NumberToImage from "./NumberToImage";
|
|||
import SceneManager from "./SceneManager";
|
||||
import { MiniGameSdk } from "./Sdk/MiniGameSdk";
|
||||
import Animation = cc.Animation;
|
||||
import Revive from "./Revive";
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
|
||||
|
@ -91,6 +92,9 @@ export default class MapConroler extends cc.Component {
|
|||
//结算界面节点
|
||||
@property(cc.Node)
|
||||
gameOverNode: cc.Node = null;
|
||||
//复活
|
||||
@property(cc.Node)
|
||||
revive: cc.Node = null;
|
||||
timeLabel: cc.Node = null;
|
||||
levelLabel: cc.Node = null;
|
||||
coin: cc.Node = null;
|
||||
|
@ -357,7 +361,7 @@ export default class MapConroler extends cc.Component {
|
|||
this.updateCoin();
|
||||
// var timeTemp = cc.fx.GameTool.getTimeMargin(this.timeNumber);
|
||||
// this.timeLabel.string = timeTemp.toString();
|
||||
NumberToImage.numberToImageNodes((cc.fx.GameConfig.GM_INFO.level + 1), 50, 20, "level_", this.levelLabel, true)
|
||||
NumberToImage.numberToImageNodes((cc.fx.GameConfig.GM_INFO.level + 1), 45, 0, "level_", this.levelLabel, true)
|
||||
console.log("当前关卡", cc.fx.GameConfig.GM_INFO.level + 1);
|
||||
//this.startTimeCutDown();
|
||||
|
||||
|
@ -1796,6 +1800,9 @@ export default class MapConroler extends cc.Component {
|
|||
add_Time: this.add_Time,
|
||||
result: "fail"
|
||||
}
|
||||
if (cc.fx.GameConfig.GM_INFO.revive == 0 && this.revive) {
|
||||
this.revive.getComponent(Revive).offShow();
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("finish_stage", data);
|
||||
}
|
||||
uploadToCloud(level: number) {
|
||||
|
|
383
assets/Script/Revive.ts
Normal file
383
assets/Script/Revive.ts
Normal file
|
@ -0,0 +1,383 @@
|
|||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
|
||||
|
||||
import JiaZai from "./JiaZai";
|
||||
import MapConroler from "./Map";
|
||||
import Utils from "./module/Pay/Utils";
|
||||
import NumberToImage from "./NumberToImage";
|
||||
import SceneManager from "./SceneManager";
|
||||
import { MiniGameSdk } from "./Sdk/MiniGameSdk";
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Revive extends cc.Component {
|
||||
|
||||
|
||||
|
||||
btn_Touch: boolean = false;
|
||||
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
private onShowListener: () => void;
|
||||
private iosPrice: number = 0;
|
||||
private iosProductId: string = "";
|
||||
private iosCount: number = 1;
|
||||
public home: number = 0;
|
||||
onLoad() {
|
||||
this.btn_Touch = true;
|
||||
// 检测微信小游戏切到后台
|
||||
if (cc.sys.platform === cc.sys.WECHAT_GAME) {
|
||||
// 定义监听函数
|
||||
this.onShowListener = () => {
|
||||
this.onShow();
|
||||
};
|
||||
//@ts-ignore
|
||||
wx.onShow(this.onShowListener);
|
||||
}
|
||||
}
|
||||
|
||||
onShow() {
|
||||
if (cc.sys.platform === cc.sys.WECHAT_GAME) {
|
||||
console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosOutTradeNo);
|
||||
if (cc.fx.GameConfig.GM_INFO.iosOutTradeNo != null && cc.fx.GameConfig.GM_INFO.iosOutTradeNo != "") {
|
||||
console.log("有苹果订单号,开始轮训");
|
||||
const iosOutTradeNo = cc.fx.GameConfig.GM_INFO.iosOutTradeNo;
|
||||
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = "";
|
||||
this.openLoad();
|
||||
this.btn_Touch = true;
|
||||
Utils.getIosPayInfo(iosOutTradeNo,
|
||||
(data) => {
|
||||
console.log("获得轮训结果:", data);
|
||||
if (data.code == 1) {
|
||||
console.log("购买成功");
|
||||
const dataSuccess = {
|
||||
outTradeNo: iosOutTradeNo,
|
||||
price: this.iosPrice,
|
||||
payment_name: this.iosProductId,
|
||||
payment_num: this.iosCount,
|
||||
type: "ios",
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
|
||||
let name = "购买金币道具:" + this.iosProductId;
|
||||
MiniGameSdk.API.yinli_Pay(this.iosPrice, iosOutTradeNo, name)
|
||||
Utils.setPayInfo(
|
||||
(res) => {
|
||||
this.closeLoad();
|
||||
//console.log("设置轮训结果:", res);
|
||||
if (res.code === 1) {
|
||||
console.log("_________正式发货");
|
||||
MiniGameSdk.API.showToast("充值成功");
|
||||
cc.fx.GameTool.shopBuy(this.iosProductId, false);
|
||||
if (this.iosProductId == "reborn_Gift") {
|
||||
this.buyGift();
|
||||
}
|
||||
//console.log("充值成功获得金币");
|
||||
}
|
||||
else {
|
||||
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
|
||||
const dataFail4 = {
|
||||
outTradeNo: iosOutTradeNo,
|
||||
price: this.iosPrice,
|
||||
payment_name: this.iosProductId,
|
||||
payment_num: this.iosCount,
|
||||
type: "ios",
|
||||
fail_reason: "成功付款,但是发货时请求服务器失败,充值成功未发货",
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
|
||||
}
|
||||
if (this.node.parent.parent.parent.parent.getComponent("SceneManager")) {
|
||||
this.node.parent.parent.parent.parent.getComponent("SceneManager").updateCoin();
|
||||
}
|
||||
}, iosOutTradeNo)
|
||||
}
|
||||
else if (data.code == 0) {
|
||||
console.log("用户自己取消充值");
|
||||
MiniGameSdk.API.showToast("充值失败");
|
||||
this.closeLoad();
|
||||
this.btn_Touch = true;
|
||||
const dataFail = {
|
||||
outTradeNo: iosOutTradeNo,
|
||||
price: this.iosPrice,
|
||||
payment_name: this.iosProductId,
|
||||
payment_num: this.iosCount,
|
||||
type: "ios",
|
||||
fail_reason: "用户取消充值",
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
|
||||
}
|
||||
else if (data.code == 2) {
|
||||
this.closeLoad();
|
||||
console.log("轮训超时");
|
||||
MiniGameSdk.API.showToast("订单已关闭");
|
||||
const dataFail = {
|
||||
outTradeNo: iosOutTradeNo,
|
||||
price: this.iosPrice,
|
||||
payment_name: this.iosProductId,
|
||||
payment_num: this.iosCount,
|
||||
type: "ios",
|
||||
fail_reason: "用户充值后,轮训结果超时",
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
|
||||
}
|
||||
|
||||
this.btn_Touch = true;
|
||||
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
start() {
|
||||
if (cc.fx.GameConfig.GM_INFO.revive == 1) {
|
||||
this.node.active = false;
|
||||
}
|
||||
}
|
||||
init() {
|
||||
this.btn_Touch = true;
|
||||
|
||||
}
|
||||
|
||||
//购买
|
||||
buyGift() {
|
||||
Utils.rebornGift(0, (data) => {
|
||||
console.log("购买'✅ ", data.code);
|
||||
if (data.code == 1) {
|
||||
MapConroler._instance.setPropNum();
|
||||
const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点
|
||||
const jiazaiComp = jiazaiNode.getComponent(JiaZai);
|
||||
if (jiazaiComp) {
|
||||
setTimeout(() => {
|
||||
jiazaiComp.updateCoin();
|
||||
}, 300);
|
||||
} else {
|
||||
console.log("无法获取JiaZai组件");
|
||||
}
|
||||
let shop = cc.find("Canvas/shop");
|
||||
if (shop) {
|
||||
let shopComp = shop.getComponent("shop");
|
||||
if (shopComp) {
|
||||
shopComp.openShop();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
// update (dt) {}
|
||||
}
|
||||
|
||||
buyProduct(customData) {
|
||||
// cc.fx.GameTool.shopBuy("revive", false);
|
||||
// MapConroler._instance.setPropNum();
|
||||
if (!this.btn_Touch) {
|
||||
return;
|
||||
}
|
||||
this.btn_Touch = false;
|
||||
const productId = customData;
|
||||
let id = "10011";
|
||||
let price = 100;
|
||||
let count = 1;
|
||||
id = productId;
|
||||
switch (productId) {
|
||||
case "reborn_Gift":
|
||||
price = 600;
|
||||
break;
|
||||
}
|
||||
console.log("获得商品id:", id, count, price);
|
||||
// 判断设备系统
|
||||
let systemType = "Android";
|
||||
try {
|
||||
//@ts-ignore
|
||||
const systemInfo = wx.getSystemInfoSync();
|
||||
if (systemInfo.platform === 'ios') {
|
||||
systemType = "ios";
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取系统信息失败', e);
|
||||
}
|
||||
|
||||
// Utils.GoKEFu();
|
||||
if (systemType == "ios") {
|
||||
// MiniGameSdk.API.showToast("IOS系统暂不支持支付");
|
||||
// this.btn_Touch = true;
|
||||
this.openLoad();
|
||||
this.btn_Touch = true;
|
||||
let iosPayInfo = {
|
||||
price: price,
|
||||
payment_name: productId,
|
||||
payment_count: 1,
|
||||
}
|
||||
this.iosPrice = price;
|
||||
this.iosProductId = productId;
|
||||
this.iosCount = 1;
|
||||
Utils.GoKEFu(iosPayInfo, (res) => {
|
||||
this.closeLoad();
|
||||
});
|
||||
}
|
||||
else {
|
||||
// MiniGameSdk.API.showToast("充值成功");
|
||||
// cc.fx.GameTool.shopBuy(productId, false);
|
||||
// setTimeout(() => {
|
||||
// if (productId == "unlimited_health_bundle_1" ||
|
||||
// productId == "unlimited_health_bundle_2" ||
|
||||
// productId == "unlimited_health_bundle_3"
|
||||
// ) {
|
||||
// console.log("触发————————updatePower");
|
||||
// this.updatePower();
|
||||
// }
|
||||
// }, 500);
|
||||
|
||||
this.openLoad();
|
||||
this.btn_Touch = true;
|
||||
//console.log("7.14_____________________", "调用充值接口");
|
||||
Utils.buyProp(id, count, price, systemType, productId, (res) => {
|
||||
//console.log("获得充值结果", res);
|
||||
if (res == null) {
|
||||
MiniGameSdk.API.showToast("充值失败");
|
||||
this.btn_Touch = true;
|
||||
const dataFail = {
|
||||
outTradeNo: Utils.outTradeNo,
|
||||
price: price,
|
||||
payment_name: productId,
|
||||
payment_num: 1,
|
||||
type: systemType,
|
||||
fail_reason: "网络异常,没有拉起支付",
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
|
||||
this.closeLoad();
|
||||
return;
|
||||
}
|
||||
else if (res.err) {
|
||||
MiniGameSdk.API.showToast("充值失败");
|
||||
//console.log(res);
|
||||
this.btn_Touch = true;
|
||||
let name = "支付拉起失败";
|
||||
if (res.errCode == -2) {
|
||||
name = "用户取消充值";
|
||||
}
|
||||
const dataFail = {
|
||||
outTradeNo: Utils.outTradeNo,
|
||||
price: price,
|
||||
payment_name: productId,
|
||||
payment_num: 1,
|
||||
type: systemType,
|
||||
fail_reason: name,
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
|
||||
this.closeLoad();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
Utils.getPayInfo((data) => {
|
||||
//console.log("7.14_______________充值成功,准备轮训");
|
||||
//console.log("获得轮训结果:", data);
|
||||
this.closeLoad();
|
||||
if (data.data.pay_state == 1) {
|
||||
this.btn_Touch = true;
|
||||
MiniGameSdk.API.showToast("取消充值");
|
||||
const dataFail2 = {
|
||||
outTradeNo: Utils.outTradeNo,
|
||||
price: price,
|
||||
payment_name: productId,
|
||||
payment_num: 1,
|
||||
type: systemType,
|
||||
fail_reason: "用户取消支付",
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail2);
|
||||
}
|
||||
else if (data.data.pay_state == 2) {
|
||||
this.btn_Touch = true;
|
||||
const dataSuccess = {
|
||||
outTradeNo: Utils.outTradeNo,
|
||||
price: price,
|
||||
payment_name: productId,
|
||||
payment_num: 1,
|
||||
type: systemType,
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
|
||||
let name = "购买金币道具:" + productId;
|
||||
MiniGameSdk.API.yinli_Pay(price, Utils.outTradeNo, name)
|
||||
console.log("7.14_______________充值成功,轮训成功,准备发货");
|
||||
Utils.setPayInfo(
|
||||
(res) => {
|
||||
console.log("设置轮训结果:", res);
|
||||
if (res.code === 1) {
|
||||
console.log("7.14_________正式发货");
|
||||
MiniGameSdk.API.showToast("充值成功");
|
||||
cc.fx.GameTool.shopBuy(productId, false);
|
||||
if (productId == "reborn_Gift") {
|
||||
this.buyGift();
|
||||
}
|
||||
//console.log("充值成功获得金币");
|
||||
}
|
||||
else {
|
||||
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
|
||||
const dataFail4 = {
|
||||
outTradeNo: Utils.outTradeNo,
|
||||
price: price,
|
||||
payment_name: productId,
|
||||
payment_num: 1,
|
||||
type: systemType,
|
||||
fail_reason: "成功付款,但是发货时请求服务器失败,充值成功未发货",
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
|
||||
}
|
||||
|
||||
if (this.node.parent.parent.parent.parent.getComponent("SceneManager")) {
|
||||
this.node.parent.parent.parent.parent.getComponent("SceneManager").updateCoin();
|
||||
}
|
||||
}, Utils.outTradeNo)
|
||||
}
|
||||
else {
|
||||
|
||||
const dataFail3 = {
|
||||
outTradeNo: Utils.outTradeNo,
|
||||
price: price,
|
||||
payment_name: productId,
|
||||
payment_num: 1,
|
||||
type: systemType,
|
||||
fail_reason: "拉起支付后,付款时网络异常付款失败",
|
||||
}
|
||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail3);
|
||||
this.btn_Touch = true;
|
||||
if (this.node.parent.parent.parent.parent.getComponent("SceneManager")) {
|
||||
this.node.parent.parent.parent.parent.getComponent("SceneManager").updateCoin();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
openLoad() {
|
||||
this.node.parent.parent.parent.parent.getChildByName("Loading").active = true;
|
||||
this.node.parent.parent.parent.parent.getChildByName("Loading").getChildByName("load").stopAllActions();
|
||||
this.node.parent.parent.parent.parent.getChildByName("Loading").getChildByName("load").runAction(cc.rotateTo(2, 1080).repeatForever());
|
||||
}
|
||||
|
||||
closeLoad() {
|
||||
this.node.parent.parent.parent.parent.getChildByName("Loading").active = false;
|
||||
}
|
||||
|
||||
|
||||
offShow() {
|
||||
if (cc.fx.GameConfig.GM_INFO.revive == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 移除 wx.onShow 监听器
|
||||
if (cc.sys.platform === cc.sys.WECHAT_GAME && this.onShowListener) {
|
||||
//@ts-ignore
|
||||
wx.offShow(this.onShowListener);
|
||||
console.log("🔥🔥🔥🔥🔥🔥🔥🔥")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
onDestroy() {
|
||||
}
|
||||
}
|
10
assets/Script/Revive.ts.meta
Normal file
10
assets/Script/Revive.ts.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"ver": "1.1.0",
|
||||
"uuid": "cf2259fd-d55a-47c1-9f75-fef608a12261",
|
||||
"importer": "typescript",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
|
@ -102,13 +102,17 @@ export default class Reward extends cc.Component {
|
|||
const rewardNode = cc.instantiate(this.rewardNode);
|
||||
rewardNode.parent = this.node;
|
||||
// 计算当前行的总宽度
|
||||
let startX = 0;
|
||||
if (row === 0) {
|
||||
const totalWidth = (nodeWidth * rowCounts[row]) + (spacing * (rowCounts[row] - 1));
|
||||
startX = -totalWidth / 2 + nodeWidth / 2;
|
||||
} else {
|
||||
startX = -((nodeWidth * 3) + (spacing * 2)) / 2 + nodeWidth / 2;
|
||||
}
|
||||
// let startX = 0;
|
||||
// if (row === 0) {
|
||||
// const totalWidth = (nodeWidth * rowCounts[row]) + (spacing * (rowCounts[row] - 1));
|
||||
// startX = -totalWidth / 2 + nodeWidth / 2;
|
||||
// } else {
|
||||
// startX = -((nodeWidth * 3) + (spacing * 2)) / 2 + nodeWidth / 2;
|
||||
// }
|
||||
// 修复:统一使用当前行的节点数量计算起始位置
|
||||
const totalWidth = (nodeWidth * rowCounts[row]) + (spacing * (rowCounts[row] - 1));
|
||||
const startX = -totalWidth / 2 + nodeWidth / 2;
|
||||
|
||||
// 计算每个节点的 x 和 y 位置
|
||||
const xPos = startX + (col * (nodeWidth + spacing));
|
||||
const yPos = startY - (row * (nodeHeight + spacing));
|
||||
|
|
|
@ -107,6 +107,7 @@ export class GameConfig {
|
|||
hp_Max: number; //体力最大值
|
||||
doubleCoin: number;//是否翻倍
|
||||
monthTime: number;//月卡时间
|
||||
revive: number; //复活次数
|
||||
};
|
||||
|
||||
|
||||
|
@ -258,6 +259,7 @@ export class GameConfig {
|
|||
hp_Max: 5, //体力最大值
|
||||
doubleCoin: 1, //是否双倍
|
||||
monthTime: 0, //月卡时间
|
||||
revive: 0, //复活礼包购买次数
|
||||
};
|
||||
// this.setCode(this.getKey("scode"));
|
||||
// this.GM_INFO.level = 0;
|
||||
|
|
|
@ -906,6 +906,59 @@ export default class Utils {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
//canRebonGift信息
|
||||
static canRebonGift(callBack) {
|
||||
if (typeof wx !== 'undefined' && wx !== null) {
|
||||
let uid = cc.fx.StorageMessage.getStorage("uid");
|
||||
//旧的读取数据设置数据方法,以强联网为主
|
||||
if (uid != undefined && uid != "" && uid != null) {
|
||||
cc.fx.GameConfig.GM_INFO.uid = uid;
|
||||
}
|
||||
let setData = {
|
||||
uid: cc.fx.GameConfig.GM_INFO.uid,
|
||||
}
|
||||
|
||||
Utils.POST("canRebonGift", setData, res => {
|
||||
if (res.code === 1) {
|
||||
console.log("服务器:canRebonGift'✅ ", res);
|
||||
if (callBack) callBack(res);
|
||||
} else {
|
||||
if (callBack) callBack(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//购买
|
||||
//上传monthlyCard信息
|
||||
static rebornGift(rebornGift, callBack) {
|
||||
if (typeof wx !== 'undefined' && wx !== null) {
|
||||
let uid = cc.fx.StorageMessage.getStorage("uid");
|
||||
// console.log("上传monthlyCard信息:", uid, monthCardTime);
|
||||
//旧的读取数据设置数据方法,以强联网为主
|
||||
if (uid != undefined && uid != "" && uid != null) {
|
||||
cc.fx.GameConfig.GM_INFO.uid = uid;
|
||||
}
|
||||
let setData = {
|
||||
uid: cc.fx.GameConfig.GM_INFO.uid,
|
||||
action: 'save',
|
||||
rebornGift: rebornGift,
|
||||
}
|
||||
|
||||
Utils.POST("rebornGift", setData, res => {
|
||||
// console.log("获得rebornGift数据:", res);
|
||||
if (res.code === 1) {
|
||||
console.log("服务器:上传rebornGift成功'✅ ", res);
|
||||
if (callBack) callBack(res);
|
||||
} else {
|
||||
// console.log("服务器:上传rebornGift失败'❌ ", res);
|
||||
if (callBack) callBack(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// const propName={
|
||||
// gold_1: "金币包1",
|
||||
// gold_2: "金币包2",
|
||||
|
|
|
@ -1092,6 +1092,26 @@ var GameTool = {
|
|||
{ type: "coin", count: coin },
|
||||
]
|
||||
break;
|
||||
case "reborn_Gift":
|
||||
cc.fx.GameTool.changeCoin(1000);
|
||||
coin = 1000;
|
||||
price = 500;
|
||||
rewardData = [
|
||||
{ type: "coin", count: coin },
|
||||
{ type: "freeze", count: 1 },
|
||||
{ type: "hammer", count: 1 },
|
||||
{ type: "magic", count: 1 },
|
||||
]
|
||||
let propData3 = {
|
||||
"freeze": 1,
|
||||
"hammer": 1,
|
||||
"magic_wand": 1,
|
||||
"price": price
|
||||
}
|
||||
this.getShopProp(propData3, compensate);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -244,6 +244,7 @@ export default class NewClass extends cc.Component {
|
|||
shopComp.openShop();
|
||||
}
|
||||
}
|
||||
this.init();
|
||||
}
|
||||
})
|
||||
// update (dt) {}
|
||||
|
|
116
assets/shop/img/Revive.plist
Normal file
116
assets/shop/img/Revive.plist
Normal file
|
@ -0,0 +1,116 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>frames</key>
|
||||
<dict>
|
||||
<key>an.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{290,100}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{290,100}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{0,0},{290,100}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>fenx.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{584,100}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{584,100}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{290,0},{584,100}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>fhb.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{956,332}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{956,332}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{0,100},{956,332}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>jixuc.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{161,37}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{161,37}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{0,432},{161,37}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>mmm.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{41,38}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{41,38}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{161,432},{41,38}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>tishik.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{342,85}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{342,85}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{202,432},{342,85}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>metadata</key>
|
||||
<dict>
|
||||
<key>format</key>
|
||||
<integer>3</integer>
|
||||
<key>pixelFormat</key>
|
||||
<string>RGBA8888</string>
|
||||
<key>premultiplyAlpha</key>
|
||||
<false/>
|
||||
<key>realTextureFileName</key>
|
||||
<string>Revive.png</string>
|
||||
<key>size</key>
|
||||
<string>{956,517}</string>
|
||||
<key>smartupdate</key>
|
||||
<string>$TexturePacker:SmartUpdate:f859f5f556d19ca1eb4a54fe66eb76f1:5d4e0bb5271032a10e97ef4da52806e2:4bc5e2af1b5c2e21a2f402a6d1605d1c$</string>
|
||||
<key>textureFileName</key>
|
||||
<string>Revive.png</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
151
assets/shop/img/Revive.plist.meta
Normal file
151
assets/shop/img/Revive.plist.meta
Normal file
|
@ -0,0 +1,151 @@
|
|||
{
|
||||
"ver": "1.2.6",
|
||||
"uuid": "2beee6ec-25c2-4485-9924-da395a4cd05a",
|
||||
"importer": "asset",
|
||||
"rawTextureUuid": "d9e802f0-13da-4d1b-9b9b-729c3e63d7f8",
|
||||
"size": {
|
||||
"width": 956,
|
||||
"height": 517
|
||||
},
|
||||
"type": "Texture Packer",
|
||||
"subMetas": {
|
||||
"an.png": {
|
||||
"ver": "1.0.6",
|
||||
"uuid": "1193af14-f157-46a6-9504-d24b03f50073",
|
||||
"importer": "sprite-frame",
|
||||
"rawTextureUuid": "d9e802f0-13da-4d1b-9b9b-729c3e63d7f8",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 290,
|
||||
"height": 100,
|
||||
"rawWidth": 290,
|
||||
"rawHeight": 100,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"fenx.png": {
|
||||
"ver": "1.0.6",
|
||||
"uuid": "ea910867-db13-4d95-a0c1-4eb24501001c",
|
||||
"importer": "sprite-frame",
|
||||
"rawTextureUuid": "d9e802f0-13da-4d1b-9b9b-729c3e63d7f8",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 290,
|
||||
"trimY": 0,
|
||||
"width": 584,
|
||||
"height": 100,
|
||||
"rawWidth": 584,
|
||||
"rawHeight": 100,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"fhb.png": {
|
||||
"ver": "1.0.6",
|
||||
"uuid": "4c988477-a457-479e-a318-5994fdb5b2c0",
|
||||
"importer": "sprite-frame",
|
||||
"rawTextureUuid": "d9e802f0-13da-4d1b-9b9b-729c3e63d7f8",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 100,
|
||||
"width": 956,
|
||||
"height": 332,
|
||||
"rawWidth": 956,
|
||||
"rawHeight": 332,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"jixuc.png": {
|
||||
"ver": "1.0.6",
|
||||
"uuid": "9dc97e7c-1f7b-4fde-b853-4c47f06ec97b",
|
||||
"importer": "sprite-frame",
|
||||
"rawTextureUuid": "d9e802f0-13da-4d1b-9b9b-729c3e63d7f8",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 432,
|
||||
"width": 161,
|
||||
"height": 37,
|
||||
"rawWidth": 161,
|
||||
"rawHeight": 37,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"mmm.png": {
|
||||
"ver": "1.0.6",
|
||||
"uuid": "9659ed22-c368-43b3-92fc-8ece78340ec9",
|
||||
"importer": "sprite-frame",
|
||||
"rawTextureUuid": "d9e802f0-13da-4d1b-9b9b-729c3e63d7f8",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 161,
|
||||
"trimY": 432,
|
||||
"width": 41,
|
||||
"height": 38,
|
||||
"rawWidth": 41,
|
||||
"rawHeight": 38,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"tishik.png": {
|
||||
"ver": "1.0.6",
|
||||
"uuid": "42a31065-5a4c-46e3-b410-5d129c84b9fa",
|
||||
"importer": "sprite-frame",
|
||||
"rawTextureUuid": "d9e802f0-13da-4d1b-9b9b-729c3e63d7f8",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 202,
|
||||
"trimY": 432,
|
||||
"width": 342,
|
||||
"height": 85,
|
||||
"rawWidth": 342,
|
||||
"rawHeight": 85,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/shop/img/Revive.png
Normal file
BIN
assets/shop/img/Revive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 169 KiB |
15
assets/shop/img/Revive.png.meta
Normal file
15
assets/shop/img/Revive.png.meta
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"ver": "2.3.7",
|
||||
"uuid": "d9e802f0-13da-4d1b-9b9b-729c3e63d7f8",
|
||||
"importer": "texture",
|
||||
"type": "raw",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 956,
|
||||
"height": 517,
|
||||
"platformSettings": {},
|
||||
"subMetas": {}
|
||||
}
|
2439
assets/shop/prefab/Revive.prefab
Normal file
2439
assets/shop/prefab/Revive.prefab
Normal file
File diff suppressed because it is too large
Load Diff
9
assets/shop/prefab/Revive.prefab.meta
Normal file
9
assets/shop/prefab/Revive.prefab.meta
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"ver": "1.3.2",
|
||||
"uuid": "d9c4e810-8682-496e-b5a9-bc3e7dd7bb93",
|
||||
"importer": "prefab",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"last-module-event-record-time": 1753090760574,
|
||||
"last-module-event-record-time": 1753696850285,
|
||||
"group-list": [
|
||||
"default",
|
||||
"Map"
|
||||
|
|
Loading…
Reference in New Issue
Block a user