This commit is contained in:
YZ\249929363 2025-07-31 17:13:44 +08:00
commit e274e42ab1
13 changed files with 2509 additions and 164 deletions

File diff suppressed because it is too large Load Diff

View File

@ -836,12 +836,7 @@ export default class GameManager extends cc.Component {
}
//复活购买次数初始化
setRevive(data) {
if (data.data.rebornGiftCount == undefined) {
cc.fx.GameConfig.GM_INFO.revive = 0;
} else {
cc.fx.GameConfig.GM_INFO.revive = data.data.rebornGiftCount;
}
console.log(data.data.rebornGiftCount, cc.fx.GameConfig.GM_INFO.revive, "🔥🔥🔥🔥🔥🔥🔥🔥")
}

View File

@ -64,14 +64,20 @@ export default class JiaZai extends cc.Component {
setUi: cc.Node = null;
scheduleCallback2: any;
//月卡
// @property(cc.Node)
// monthCardBtn: cc.Node = null;
// @property(cc.Node)
// monthCardBtn2: cc.Node = null;
// @property(cc.Node)
// monthCardTime: cc.Node = null;
// @property(cc.Node)
// monthCard: cc.Node = null;
@property(cc.Node)
monthCardBtn: cc.Node = null;
monthCardReward: cc.Node = null;
//剩余天数
@property(cc.Node)
monthCardBtn2: cc.Node = null;
@property(cc.Node)
monthCardTime: cc.Node = null;
@property(cc.Node)
monthCard: cc.Node = null;
cardTime: cc.Node = null;
// LIFE-CYCLE CALLBACKS:
onLoad() {
@ -187,8 +193,9 @@ export default class JiaZai extends cc.Component {
// //打开heath弹窗
// this.openHeath();
this.uploadToCloud(cc.fx.GameConfig.GM_INFO.level + 1);
// this.rewarded();
// this.getMonthlyCardValidityDays();
this.getMonthlyCardValidityDays();
this.rewarded();
Utils.getMonthlyCard((data) => {
if (data.code == 1) {
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
@ -753,63 +760,53 @@ export default class JiaZai extends cc.Component {
openMonthCard() {
this.openMonthlyCard();
this.monthlyCardNode.getComponent("monthlyCard").home = 1;
// this.monthCard.active = true;
// Utils.getMonthlyCard((data) => {
// if (data.msg == "不在有效期") {
// this.monthCardBtn.active = true;
// this.monthCardBtn2.active = false;
// } else {
// this.monthCardBtn.active = false;
// this.monthCardBtn2.active = true;
// NumberToImage.numberToImageNodes(25, 35, 20, "month_", this.monthCardTime, true);
// }
// })
}
//关闭界面
closeMonthCard() {
Utils.getMonthlyCard((data) => {
if (data.msg == "不在有效期") {
this.monthCardBtn.active = true;
this.monthCardBtn2.active = false;
} else {
this.monthCardBtn.active = false;
this.monthCardBtn2.active = true;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true);
}
})
this.monthCard.active = false;
this.rewarded();
// closeMonthCard() {
// Utils.getMonthlyCard((data) => {
// if (data.msg == "不在有效期") {
// this.monthCardBtn.active = true;
// this.monthCardBtn2.active = false;
// } else {
// this.monthCardBtn.active = false;
// this.monthCardBtn2.active = true;
// NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true);
// }
// })
// this.monthCard.active = false;
// this.rewarded();
}
//购买月卡
buyMonthCard() {
Utils.setMonthlyCard(0, (data) => {
console.log("购买月卡'✅ ", data.code);
if (data.code == 1) {
let rewardData = [
{ type: "coin", count: 6000 },
]
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
cc.fx.GameConfig.GM_INFO.hp = 7;
cc.fx.GameTool.changeCoin(6000);
setTimeout(() => {
this.updateCoin();
this.setHealthInfo(false);
this.startTimeCutDown();
this.openRewardWindow(rewardData, 1);
}, 300);
cc.fx.GameTool.setUserHealth(0, (data) => {
cc.fx.GameTool.getHealth(null);
})
this.monthCardBtn.active = false;
this.monthCardBtn2.active = true;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true);
// }
// //购买月卡
// buyMonthCard() {
// Utils.setMonthlyCard(0, (data) => {
// console.log("购买月卡'✅ ", data.code);
// if (data.code == 1) {
// let rewardData = [
// { type: "coin", count: 6000 },
// ]
// cc.fx.GameConfig.GM_INFO.hp_Max = 7;
// cc.fx.GameConfig.GM_INFO.hp = 7;
// cc.fx.GameTool.changeCoin(6000);
// setTimeout(() => {
// this.updateCoin();
// this.setHealthInfo(false);
// this.startTimeCutDown();
// this.openRewardWindow(rewardData, 1);
// }, 300);
// cc.fx.GameTool.setUserHealth(0, (data) => {
// cc.fx.GameTool.getHealth(null);
// })
// this.monthCardBtn.active = false;
// this.monthCardBtn2.active = true;
// NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true);
}
})
}
// }
// })
// }
rewarded() {
rewarded() {
Utils.monthGetReward((data) => {
if (data.data == null) {
console.log("到期");
@ -827,33 +824,17 @@ export default class JiaZai extends cc.Component {
this.startTimeCutDown();
}, 300);
}
if (data.data != null && data.code == 0) {
console.log("未到期已领取");
}
if (data.code == 1) {
cc.fx.GameTool.changeCoin(500);
this.updateCoin();
let rewardData = [
{ type: "coin", count: 500 },
]
setTimeout(() => {
this.openRewardWindow(rewardData);
}, 500);
const dataTemp = {
change_reason: "month",
id: "1001",
num: 500,
compensate: false
}
cc.fx.GameTool.shushu_Track("resource_get", dataTemp);
this.monthCardReward.active = true;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 40, 20, "month_", this.cardTime, true);
}
})
}
//缓存弹窗
monthH() {
// return;
@ -903,7 +884,8 @@ export default class JiaZai extends cc.Component {
const remainingDays = Math.max(0, days);
cc.fx.GameConfig.GM_INFO.monthTime = remainingDays;
console.log('月卡剩余天数 (零点刷新):', remainingDays);
console.log('%c月卡剩余天数 (零点刷新): ' + remainingDays,
'color: green; font-weight: bold;');
} else {
}
});
@ -957,5 +939,19 @@ export default class JiaZai extends cc.Component {
}
}
onCardReward() {
cc.fx.GameTool.changeCoin(500);
this.updateCoin();
const dataTemp = {
change_reason: "month",
id: "1001",
num: 500,
compensate: false
}
cc.fx.GameTool.shushu_Track("resource_get", dataTemp);
this.monthCardReward.active = false;
}
// update (dt) {}
}

View File

@ -17,6 +17,7 @@ const { ccclass, property } = cc._decorator;
@ccclass
export default class Revive extends cc.Component {
@property(cc.Node)
btn_Touch: boolean = false;
@ -72,6 +73,7 @@ export default class Revive extends cc.Component {
console.log("_________正式发货");
MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(this.iosProductId, false);
this.revivew()
if (this.iosProductId == "reborn_Gift") {
this.buyGift();
}
@ -150,7 +152,14 @@ export default class Revive extends cc.Component {
Utils.rebornGift(1, (data) => {
console.log("购买'✅ ", data.code);
if (data.code == 1) {
MapConroler._instance.setPropNum();
}
})
// update (dt) {}
}
//发奖励
revivew() {
MapConroler._instance.setPropNum();
const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点
const jiazaiComp = jiazaiNode.getComponent(JiaZai);
if (jiazaiComp) {
@ -172,11 +181,7 @@ export default class Revive extends cc.Component {
this.node.active = false;
}, 200);
MapConroler._instance.runRewiveCopy();
}
})
// update (dt) {}
}
buyProduct(customData) {
// cc.fx.GameTool.shopBuy("revive", false);
// MapConroler._instance.setPropNum();
@ -316,6 +321,7 @@ export default class Revive extends cc.Component {
console.log("7.14_________正式发货");
MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(productId, false);
this.revivew();
if (productId == "reborn_Gift") {
this.buyGift();
}

View File

@ -78,9 +78,9 @@ export default class NewClass extends cc.Component {
if (res.code === 1) {
console.log("_________正式发货");
MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(this.iosProductId, false);
if (this.iosProductId == "month_Card") {
this.buyMonthCard();
this.buyMonthCard(this.iosProductId);
}
//console.log("充值成功获得金币");
}
@ -168,13 +168,14 @@ export default class NewClass extends cc.Component {
}
//购买月卡
buyMonthCard() {
buyMonthCard(id) {
Utils.setMonthlyCard(0, (data) => {
console.log("购买月卡'✅ ", data.code);
if (data.code == 1) {
// let rewardData = [
// { type: "coin", count: 6000 },
// ]
cc.fx.GameTool.shopBuy(id, false);
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
cc.fx.GameConfig.GM_INFO.hp = 7;
// cc.fx.GameTool.changeCoin(6000);
@ -412,9 +413,9 @@ export default class NewClass extends cc.Component {
if (res.code === 1) {
console.log("7.14_________正式发货");
MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(productId, false);
if (productId == "month_Card") {
this.buyMonthCard();
this.buyMonthCard(productId);
}
//console.log("充值成功获得金币");
}

BIN
assets/shop/img/lqbg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "015de0a3-500b-4ffb-98af-9b51007f4f83",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 914,
"height": 1348,
"platformSettings": {},
"subMetas": {
"lqbg": {
"ver": "1.0.6",
"uuid": "954feb1c-d5fc-4c47-8577-6285e17154d4",
"importer": "sprite-frame",
"rawTextureUuid": "015de0a3-500b-4ffb-98af-9b51007f4f83",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 914,
"height": 1347,
"rawWidth": 914,
"rawHeight": 1348,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -15,7 +15,7 @@
<key>spriteSourceSize</key>
<string>{516,164}</string>
<key>textureRect</key>
<string>{{1195,0},{516,164}}</string>
<string>{{1328,0},{516,164}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -30,7 +30,7 @@
<key>spriteSourceSize</key>
<string>{123,90}</string>
<key>textureRect</key>
<string>{{1072,0},{123,90}}</string>
<string>{{1205,0},{123,90}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -45,7 +45,7 @@
<key>spriteSourceSize</key>
<string>{506,506}</string>
<key>textureRect</key>
<string>{{1248,490},{506,506}}</string>
<string>{{1496,490},{506,506}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -60,7 +60,7 @@
<key>spriteSourceSize</key>
<string>{794,210}</string>
<key>textureRect</key>
<string>{{0,164},{794,210}}</string>
<string>{{635,164},{794,210}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -75,7 +75,22 @@
<key>spriteSourceSize</key>
<string>{58,58}</string>
<key>textureRect</key>
<string>{{1014,0},{58,58}}</string>
<string>{{1147,0},{58,58}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>haisheng.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{89,42}</string>
<key>spriteSourceSize</key>
<string>{89,42}</string>
<key>textureRect</key>
<string>{{772,0},{89,42}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -90,7 +105,7 @@
<key>spriteSourceSize</key>
<string>{248,326}</string>
<key>textureRect</key>
<string>{{1114,164},{248,326}}</string>
<string>{{1749,164},{248,326}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -105,7 +120,37 @@
<key>spriteSourceSize</key>
<string>{320,320}</string>
<key>textureRect</key>
<string>{{794,164},{320,320}}</string>
<string>{{1429,164},{320,320}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>lq.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{635,173}</string>
<key>spriteSourceSize</key>
<string>{635,173}</string>
<key>textureRect</key>
<string>{{0,164},{635,173}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>lqtian.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{44,40}</string>
<key>spriteSourceSize</key>
<string>{44,40}</string>
<key>textureRect</key>
<string>{{684,0},{44,40}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -120,7 +165,7 @@
<key>spriteSourceSize</key>
<string>{286,42}</string>
<key>textureRect</key>
<string>{{728,0},{286,42}}</string>
<string>{{861,0},{286,42}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -150,7 +195,7 @@
<key>spriteSourceSize</key>
<string>{1000,406}</string>
<key>textureRect</key>
<string>{{248,490},{1000,406}}</string>
<string>{{496,490},{1000,406}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -165,7 +210,7 @@
<key>spriteSourceSize</key>
<string>{248,326}</string>
<key>textureRect</key>
<string>{{1362,164},{248,326}}</string>
<string>{{0,490},{248,326}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -180,7 +225,7 @@
<key>spriteSourceSize</key>
<string>{248,326}</string>
<key>textureRect</key>
<string>{{0,490},{248,326}}</string>
<string>{{248,490},{248,326}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -195,7 +240,7 @@
<key>spriteSourceSize</key>
<string>{44,40}</string>
<key>textureRect</key>
<string>{{684,0},{44,40}}</string>
<string>{{728,0},{44,40}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -241,9 +286,9 @@
<key>realTextureFileName</key>
<string>yueka.png</string>
<key>size</key>
<string>{1754,996}</string>
<string>{2002,996}</string>
<key>smartupdate</key>
<string>$TexturePacker:SmartUpdate:be988a3fbb232978060220687567e4fb:2676f661d720583c5d093865b3e0b41d:f9d521de5bc0db19166bcf92821562f3$</string>
<string>$TexturePacker:SmartUpdate:31468ea6569fed60cde5a27ae2edf1f2:95c923329506deb632b0e819bc5756f8:f9d521de5bc0db19166bcf92821562f3$</string>
<key>textureFileName</key>
<string>yueka.png</string>
</dict>

View File

@ -4,7 +4,7 @@
"importer": "asset",
"rawTextureUuid": "b72f8f63-5869-4f82-83a6-70c719b5e4ac",
"size": {
"width": 1754,
"width": 2002,
"height": 996
},
"type": "Texture Packer",
@ -19,7 +19,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1195,
"trimX": 1328,
"trimY": 0,
"width": 516,
"height": 164,
@ -42,7 +42,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1072,
"trimX": 1205,
"trimY": 0,
"width": 123,
"height": 90,
@ -65,7 +65,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1248,
"trimX": 1496,
"trimY": 490,
"width": 506,
"height": 506,
@ -88,7 +88,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimX": 635,
"trimY": 164,
"width": 794,
"height": 210,
@ -111,7 +111,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1014,
"trimX": 1147,
"trimY": 0,
"width": 58,
"height": 58,
@ -124,6 +124,29 @@
"spriteType": "normal",
"subMetas": {}
},
"haisheng.png": {
"ver": "1.0.6",
"uuid": "c4e289ba-3afd-4838-bf0c-571cadce8db2",
"importer": "sprite-frame",
"rawTextureUuid": "b72f8f63-5869-4f82-83a6-70c719b5e4ac",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 772,
"trimY": 0,
"width": 89,
"height": 42,
"rawWidth": 89,
"rawHeight": 42,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"spriteType": "normal",
"subMetas": {}
},
"jiantou.png": {
"ver": "1.0.6",
"uuid": "506a1673-0424-419b-804a-634729897214",
@ -134,7 +157,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1114,
"trimX": 1749,
"trimY": 164,
"width": 248,
"height": 326,
@ -157,7 +180,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 794,
"trimX": 1429,
"trimY": 164,
"width": 320,
"height": 320,
@ -170,6 +193,52 @@
"spriteType": "normal",
"subMetas": {}
},
"lq.png": {
"ver": "1.0.6",
"uuid": "8419f8d6-48b4-4ecd-8228-34d620ae0da9",
"importer": "sprite-frame",
"rawTextureUuid": "b72f8f63-5869-4f82-83a6-70c719b5e4ac",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 164,
"width": 635,
"height": 173,
"rawWidth": 635,
"rawHeight": 173,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"spriteType": "normal",
"subMetas": {}
},
"lqtian.png": {
"ver": "1.0.6",
"uuid": "2b6c09cd-62b2-4b90-8f3f-498e1a7b4c3f",
"importer": "sprite-frame",
"rawTextureUuid": "b72f8f63-5869-4f82-83a6-70c719b5e4ac",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 684,
"trimY": 0,
"width": 44,
"height": 40,
"rawWidth": 44,
"rawHeight": 40,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"spriteType": "normal",
"subMetas": {}
},
"shengxiaozhong.png": {
"ver": "1.0.6",
"uuid": "3fa8a798-dfb7-403a-93a7-a57a80e07245",
@ -180,7 +249,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 728,
"trimX": 861,
"trimY": 0,
"width": 286,
"height": 42,
@ -226,7 +295,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 248,
"trimX": 496,
"trimY": 490,
"width": 1000,
"height": 406,
@ -249,8 +318,8 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1362,
"trimY": 164,
"trimX": 0,
"trimY": 490,
"width": 248,
"height": 326,
"rawWidth": 248,
@ -272,7 +341,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimX": 248,
"trimY": 490,
"width": 248,
"height": 326,
@ -295,7 +364,7 @@
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 684,
"trimX": 728,
"trimY": 0,
"width": 44,
"height": 40,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 935 KiB

View File

@ -8,7 +8,7 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1754,
"width": 2002,
"height": 996,
"platformSettings": {},
"subMetas": {}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
{
"ver": "1.3.2",
"uuid": "1a9f7d54-86c0-4e75-a1ac-ff623f0c9a1f",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}