优化UI图片资源
|
@ -97,6 +97,19 @@ export default class JiaZai extends cc.Component {
|
||||||
if (cc.fx.GameConfig.GM_INFO.first) {
|
if (cc.fx.GameConfig.GM_INFO.first) {
|
||||||
console.log("————————准备注册事件", cc.fx.GameConfig.GM_INFO.openid);
|
console.log("————————准备注册事件", cc.fx.GameConfig.GM_INFO.openid);
|
||||||
const group = cc.fx.GameTool.setWechatGameGroup(2);
|
const group = cc.fx.GameTool.setWechatGameGroup(2);
|
||||||
|
if (group == 0) {
|
||||||
|
cc.fx.GameConfig.GM_INFO.musicOpen = true;
|
||||||
|
}
|
||||||
|
else if (group == 1) {
|
||||||
|
cc.fx.GameConfig.GM_INFO.musicOpen = false;
|
||||||
|
}
|
||||||
|
const audioInfo = {
|
||||||
|
"musicOpen": cc.fx.GameConfig.GM_INFO.musicOpen, //音乐
|
||||||
|
"effectOpen": cc.fx.GameConfig.GM_INFO.effectOpen, //音效
|
||||||
|
"vibrateOpen": cc.fx.GameConfig.GM_INFO.vibrateOpen, //震动
|
||||||
|
}
|
||||||
|
cc.fx.StorageMessage.setStorage("music", audioInfo);
|
||||||
|
|
||||||
if (cc.fx.GameConfig.GM_INFO.openid != "") {
|
if (cc.fx.GameConfig.GM_INFO.openid != "") {
|
||||||
console.log("————————发送注册事件");
|
console.log("————————发送注册事件");
|
||||||
const time = cc.fx.GameTool.formatDate(new Date());
|
const time = cc.fx.GameTool.formatDate(new Date());
|
||||||
|
@ -126,7 +139,7 @@ export default class JiaZai extends cc.Component {
|
||||||
// console.log("关卡",cc.fx.GameConfig.GM_INFO.level+1);
|
// console.log("关卡",cc.fx.GameConfig.GM_INFO.level+1);
|
||||||
|
|
||||||
cc.fx.GameTool.getHealth(null);
|
cc.fx.GameTool.getHealth(null);
|
||||||
// cc.fx.GameConfig.LEVEL_INFO_init(false,0);s
|
// cc.fx.GameConfig.LEVEL_INFO_init(false,0);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
NumberToImage.numberToImageNodes((cc.fx.GameConfig.GM_INFO.level + 1), 43, 15, "level_", this.level, true);
|
NumberToImage.numberToImageNodes((cc.fx.GameConfig.GM_INFO.level + 1), 43, 15, "level_", this.level, true);
|
||||||
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
|
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
|
||||||
|
|
|
@ -1369,6 +1369,12 @@ export default class MapConroler extends cc.Component {
|
||||||
// console.log("即将上报成功________________________:",this.add_Time);
|
// console.log("即将上报成功________________________:",this.add_Time);
|
||||||
// console.log("成功消除一个",this.add_Time);
|
// console.log("成功消除一个",this.add_Time);
|
||||||
cc.fx.GameTool.changeCoin(40);
|
cc.fx.GameTool.changeCoin(40);
|
||||||
|
const data = {
|
||||||
|
change_reason: "闯关成功获得金币",
|
||||||
|
id: (1001 + ""),
|
||||||
|
num: 40
|
||||||
|
}
|
||||||
|
cc.fx.GameTool.shushu_Track("resource_get", data);
|
||||||
let overTime = Date.now();
|
let overTime = Date.now();
|
||||||
this.count_Time = overTime - this.count_Time;
|
this.count_Time = overTime - this.count_Time;
|
||||||
cc.fx.GameTool.addLevel(this.count_Time, this.add_Time);
|
cc.fx.GameTool.addLevel(this.count_Time, this.add_Time);
|
||||||
|
@ -1507,6 +1513,12 @@ export default class MapConroler extends cc.Component {
|
||||||
runRewive(data) {
|
runRewive(data) {
|
||||||
console.log("复活回调函数内", data);
|
console.log("复活回调函数内", data);
|
||||||
cc.fx.GameTool.changeCoin(data.coin);
|
cc.fx.GameTool.changeCoin(data.coin);
|
||||||
|
const dataTemp = {
|
||||||
|
change_reason: "游戏内复活消耗金币",
|
||||||
|
id: (1001 + ""),
|
||||||
|
num: data.coin
|
||||||
|
}
|
||||||
|
cc.fx.GameTool.shushu_Track("resource_cost", dataTemp);
|
||||||
MiniGameSdk.API.showToast("继续游戏");
|
MiniGameSdk.API.showToast("继续游戏");
|
||||||
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
|
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
|
||||||
if (data.type == "time") {
|
if (data.type == "time") {
|
||||||
|
@ -1751,6 +1763,7 @@ export default class MapConroler extends cc.Component {
|
||||||
cc.fx.GameTool.setUserProp(2001, cc.fx.GameConfig.GM_INFO.freezeAmount, (data) => {
|
cc.fx.GameTool.setUserProp(2001, cc.fx.GameConfig.GM_INFO.freezeAmount, (data) => {
|
||||||
})
|
})
|
||||||
let data = {
|
let data = {
|
||||||
|
change_reason: "使用道具",
|
||||||
id: "2001",
|
id: "2001",
|
||||||
num: -1
|
num: -1
|
||||||
}
|
}
|
||||||
|
@ -1870,6 +1883,7 @@ export default class MapConroler extends cc.Component {
|
||||||
cc.fx.GameTool.setUserProp(2002, cc.fx.GameConfig.GM_INFO.hammerAmount, (data) => {
|
cc.fx.GameTool.setUserProp(2002, cc.fx.GameConfig.GM_INFO.hammerAmount, (data) => {
|
||||||
})
|
})
|
||||||
let data = {
|
let data = {
|
||||||
|
change_reason: "使用道具",
|
||||||
id: "2002",
|
id: "2002",
|
||||||
num: -1
|
num: -1
|
||||||
}
|
}
|
||||||
|
@ -1983,6 +1997,7 @@ export default class MapConroler extends cc.Component {
|
||||||
cc.fx.GameTool.setUserProp(2003, cc.fx.GameConfig.GM_INFO.magicAmount, (data) => {
|
cc.fx.GameTool.setUserProp(2003, cc.fx.GameConfig.GM_INFO.magicAmount, (data) => {
|
||||||
})
|
})
|
||||||
let data = {
|
let data = {
|
||||||
|
change_reason: "使用道具",
|
||||||
id: "2003",
|
id: "2003",
|
||||||
num: -1
|
num: -1
|
||||||
}
|
}
|
||||||
|
|
|
@ -1127,7 +1127,7 @@ export namespace MiniGameSdk {
|
||||||
},
|
},
|
||||||
// 根据环境变量设置 debug 模式
|
// 根据环境变量设置 debug 模式
|
||||||
debug: !isProduction,
|
debug: !isProduction,
|
||||||
enableLog: false
|
enableLog: true
|
||||||
};
|
};
|
||||||
// 创建 TA 实例
|
// 创建 TA 实例
|
||||||
API._ta = new ThinkingAnalyticsAPI(config);
|
API._ta = new ThinkingAnalyticsAPI(config);
|
||||||
|
|
|
@ -70,6 +70,12 @@ export default class NewClass extends cc.Component {
|
||||||
if (curCoin >= 1000) {
|
if (curCoin >= 1000) {
|
||||||
this.switchButtons[1].active = false;
|
this.switchButtons[1].active = false;
|
||||||
cc.fx.GameTool.changeCoin(-1000);
|
cc.fx.GameTool.changeCoin(-1000);
|
||||||
|
const data = {
|
||||||
|
change_reason: "首页购买体力",
|
||||||
|
id: (1001 + ""),
|
||||||
|
num: -1000
|
||||||
|
}
|
||||||
|
cc.fx.GameTool.shushu_Track("resource_cost", data);
|
||||||
cc.fx.GameConfig.GM_INFO.hp = 5;
|
cc.fx.GameConfig.GM_INFO.hp = 5;
|
||||||
const parentNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点
|
const parentNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点
|
||||||
if (parentNode) {
|
if (parentNode) {
|
||||||
|
@ -83,6 +89,15 @@ export default class NewClass extends cc.Component {
|
||||||
cc.fx.GameTool.setUserHealth(0, (data) => {
|
cc.fx.GameTool.setUserHealth(0, (data) => {
|
||||||
cc.fx.GameTool.getHealth(null);
|
cc.fx.GameTool.getHealth(null);
|
||||||
})
|
})
|
||||||
|
const buyData = {
|
||||||
|
item_id: "refill_health",
|
||||||
|
item_num: 3,
|
||||||
|
item_price: 1000,
|
||||||
|
cost_type: "gold"
|
||||||
|
}
|
||||||
|
console.log("____________即将上传Shop_buy", buyData);
|
||||||
|
cc.fx.GameTool.shushu_Track("shop_buy", buyData);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MiniGameSdk.API.showToast("金币不足,无法购买体力");
|
MiniGameSdk.API.showToast("金币不足,无法购买体力");
|
||||||
|
|
|
@ -83,7 +83,7 @@ export class GameConfig {
|
||||||
first: boolean; //是否首次进入游戏
|
first: boolean; //是否首次进入游戏
|
||||||
score: number; //总得分
|
score: number; //总得分
|
||||||
scale: number; //玩家总计成功点火数
|
scale: number; //玩家总计成功点火数
|
||||||
iosOutTradeNo: number; //ios订单号
|
iosOutTradeNo: string; //ios订单号
|
||||||
min_Time: number; //体力恢复的剩余时间
|
min_Time: number; //体力恢复的剩余时间
|
||||||
freezeAmount: number; //冻结道具次数
|
freezeAmount: number; //冻结道具次数
|
||||||
hammerAmount: number; //锤子道具次数
|
hammerAmount: number; //锤子道具次数
|
||||||
|
@ -220,7 +220,7 @@ export class GameConfig {
|
||||||
first: false, //是否首次进入游戏
|
first: false, //是否首次进入游戏
|
||||||
score: 0, //总得分
|
score: 0, //总得分
|
||||||
scale: 1, //玩家总计成功点火数
|
scale: 1, //玩家总计成功点火数
|
||||||
iosOutTradeNo: 0, //ios订单号
|
iosOutTradeNo: "", //ios订单号
|
||||||
min_Time: 0, //体力恢复的剩余时间
|
min_Time: 0, //体力恢复的剩余时间
|
||||||
freezeAmount: 0, //冻结道具次数
|
freezeAmount: 0, //冻结道具次数
|
||||||
hammerAmount: 0, //锤子道具次数
|
hammerAmount: 0, //锤子道具次数
|
||||||
|
|
|
@ -134,22 +134,35 @@ export default class Utils {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static getIosPayInfo(callBack) {
|
static getIosPayInfo(callBack) {
|
||||||
|
const delays = [1000, 10000, 30000, 60000, 60000]; // 延迟时间数组
|
||||||
|
let attempt = 0; // 轮询次数
|
||||||
|
|
||||||
|
const poll = () => {
|
||||||
|
if (attempt >= delays.length) {
|
||||||
|
callBack({ code: 0, data: null, message: '轮询超时' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
console.log("请求uid:" + Utils.uid);
|
console.log("请求uid:" + Utils.uid);
|
||||||
console.log("outTradeNo:"+this.outTradeNo);
|
console.log("outTradeNo:" + cc.fx.GameConfig.GM_INFO.iosOutTradeNo);
|
||||||
Utils.POST("wx/iosgetPayInfo",{outTradeNo:Utils.outTradeNo},res=>{
|
Utils.POST("wx/iosgetPayInfo", { outTradeNo: cc.fx.GameConfig.GM_INFO.iosOutTradeNo }, res => {
|
||||||
console.log("查询字符结果");
|
console.log("查询字符结果IOS");
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if(res.code==1){
|
if (res.code === 1) {
|
||||||
if(res.data){
|
callBack(res);
|
||||||
callBack("充值取消");
|
|
||||||
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
|
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
|
||||||
}else{
|
} else if (res.code === 0) {
|
||||||
callBack("充值成功");
|
callBack(res);
|
||||||
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
|
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
attempt++;
|
||||||
|
setTimeout(poll, delays[attempt - 1]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
poll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -644,9 +644,16 @@ var GameTool = {
|
||||||
num = 1;
|
num = 1;
|
||||||
}
|
}
|
||||||
cc.fx.GameTool.changeCoin(-cost);
|
cc.fx.GameTool.changeCoin(-cost);
|
||||||
|
const dataTemp = {
|
||||||
|
change_reason: "商城购买道具消耗",
|
||||||
|
id: (1001 + ""),
|
||||||
|
num: -cost
|
||||||
|
}
|
||||||
|
cc.fx.GameTool.shushu_Track("resource_cost", dataTemp);
|
||||||
cc.fx.GameTool.setUserProp(propid, num, (data) => {
|
cc.fx.GameTool.setUserProp(propid, num, (data) => {
|
||||||
})
|
})
|
||||||
const data = {
|
const data = {
|
||||||
|
change_reason: "商城购买道具",
|
||||||
id: (propid + ""),
|
id: (propid + ""),
|
||||||
num: 3
|
num: 3
|
||||||
}
|
}
|
||||||
|
@ -828,6 +835,7 @@ var GameTool = {
|
||||||
shopBuy(productId) {
|
shopBuy(productId) {
|
||||||
let coin = 0;
|
let coin = 0;
|
||||||
let price = 0;
|
let price = 0;
|
||||||
|
let getCoin = 0;
|
||||||
switch (productId) {
|
switch (productId) {
|
||||||
case "gold_1":
|
case "gold_1":
|
||||||
cc.fx.GameTool.changeCoin(1200);
|
cc.fx.GameTool.changeCoin(1200);
|
||||||
|
@ -866,6 +874,13 @@ var GameTool = {
|
||||||
MiniGameSdk.API.showToast("充值成功,获得240000金币");
|
MiniGameSdk.API.showToast("充值成功,获得240000金币");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
const dataTemp = {
|
||||||
|
change_reason: "商城RMB购买金币",
|
||||||
|
id: (1001 + ""),
|
||||||
|
num: coin
|
||||||
|
}
|
||||||
|
cc.fx.GameTool.shushu_Track("resource_get", dataTemp);
|
||||||
|
|
||||||
const buyData = {
|
const buyData = {
|
||||||
item_id: productId,
|
item_id: productId,
|
||||||
item_num: coin,
|
item_num: coin,
|
||||||
|
@ -927,14 +942,14 @@ var GameTool = {
|
||||||
break;
|
break;
|
||||||
case "resource_get":
|
case "resource_get":
|
||||||
eventData = {
|
eventData = {
|
||||||
change_reason: "购买道具", //获得来源
|
change_reason: data.change_reason, //获得来源
|
||||||
change_num: data.num, //获得数量
|
change_num: data.num, //获得数量
|
||||||
resource_id: data.id //道具id
|
resource_id: data.id //道具id
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "resource_cost":
|
case "resource_cost":
|
||||||
eventData = {
|
eventData = {
|
||||||
change_reason: "使用道具", //获得来源
|
change_reason: data.change_reason, //获得来源
|
||||||
change_num: data.num, //获得数量
|
change_num: data.num, //获得数量
|
||||||
resource_id: data.id //道具id
|
resource_id: data.id //道具id
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 467 KiB After Width: | Height: | Size: 467 KiB |
Before Width: | Height: | Size: 933 KiB |
|
@ -1,38 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "2.3.7",
|
|
||||||
"uuid": "8ac53103-5eab-4857-b56c-2d055f0be6e3",
|
|
||||||
"importer": "texture",
|
|
||||||
"type": "sprite",
|
|
||||||
"wrapMode": "clamp",
|
|
||||||
"filterMode": "bilinear",
|
|
||||||
"premultiplyAlpha": false,
|
|
||||||
"genMipmaps": false,
|
|
||||||
"packable": true,
|
|
||||||
"width": 1071,
|
|
||||||
"height": 1257,
|
|
||||||
"platformSettings": {},
|
|
||||||
"subMetas": {
|
|
||||||
"tanchuang1": {
|
|
||||||
"ver": "1.0.6",
|
|
||||||
"uuid": "f2dcf5a7-9beb-4773-ad55-45a2f827a912",
|
|
||||||
"importer": "sprite-frame",
|
|
||||||
"rawTextureUuid": "8ac53103-5eab-4857-b56c-2d055f0be6e3",
|
|
||||||
"trimType": "auto",
|
|
||||||
"trimThreshold": 1,
|
|
||||||
"rotated": false,
|
|
||||||
"offsetX": 0,
|
|
||||||
"offsetY": 0,
|
|
||||||
"trimX": 0,
|
|
||||||
"trimY": 0,
|
|
||||||
"width": 1071,
|
|
||||||
"height": 1257,
|
|
||||||
"rawWidth": 1071,
|
|
||||||
"rawHeight": 1257,
|
|
||||||
"borderTop": 0,
|
|
||||||
"borderBottom": 0,
|
|
||||||
"borderLeft": 0,
|
|
||||||
"borderRight": 0,
|
|
||||||
"subMetas": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 296 KiB After Width: | Height: | Size: 296 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 8.6 KiB |
|
@ -992,8 +992,8 @@
|
||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 98,
|
"width": 94,
|
||||||
"height": 98
|
"height": 90
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
|
|
Before Width: | Height: | Size: 221 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 43 KiB |
BIN
assets/shop/img/shop_1.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"ver": "2.3.7",
|
"ver": "2.3.7",
|
||||||
"uuid": "d0d3a854-9f5c-486f-8a9e-ebd1c96b68b5",
|
"uuid": "9c710aa3-45b5-43fb-b76f-8d6af41a21d5",
|
||||||
"importer": "texture",
|
"importer": "texture",
|
||||||
"type": "sprite",
|
"type": "sprite",
|
||||||
"wrapMode": "clamp",
|
"wrapMode": "clamp",
|
||||||
|
@ -12,11 +12,11 @@
|
||||||
"height": 2340,
|
"height": 2340,
|
||||||
"platformSettings": {},
|
"platformSettings": {},
|
||||||
"subMetas": {
|
"subMetas": {
|
||||||
"shop_2": {
|
"shop_1": {
|
||||||
"ver": "1.0.6",
|
"ver": "1.0.6",
|
||||||
"uuid": "1880f261-dd18-4e9e-9f49-b2f194d5ef8f",
|
"uuid": "403aa689-5ef4-4978-978a-74b806e0760f",
|
||||||
"importer": "sprite-frame",
|
"importer": "sprite-frame",
|
||||||
"rawTextureUuid": "d0d3a854-9f5c-486f-8a9e-ebd1c96b68b5",
|
"rawTextureUuid": "9c710aa3-45b5-43fb-b76f-8d6af41a21d5",
|
||||||
"trimType": "auto",
|
"trimType": "auto",
|
||||||
"trimThreshold": 1,
|
"trimThreshold": 1,
|
||||||
"rotated": false,
|
"rotated": false,
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 42 KiB |
|
@ -1,38 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "2.3.7",
|
|
||||||
"uuid": "39980b3f-ffc1-450f-90bc-4861aa8c81fb",
|
|
||||||
"importer": "texture",
|
|
||||||
"type": "sprite",
|
|
||||||
"wrapMode": "clamp",
|
|
||||||
"filterMode": "bilinear",
|
|
||||||
"premultiplyAlpha": false,
|
|
||||||
"genMipmaps": false,
|
|
||||||
"packable": true,
|
|
||||||
"width": 1080,
|
|
||||||
"height": 2340,
|
|
||||||
"platformSettings": {},
|
|
||||||
"subMetas": {
|
|
||||||
"shop_2": {
|
|
||||||
"ver": "1.0.6",
|
|
||||||
"uuid": "5652a0a0-3753-477b-afbd-e68830208955",
|
|
||||||
"importer": "sprite-frame",
|
|
||||||
"rawTextureUuid": "39980b3f-ffc1-450f-90bc-4861aa8c81fb",
|
|
||||||
"trimType": "auto",
|
|
||||||
"trimThreshold": 1,
|
|
||||||
"rotated": false,
|
|
||||||
"offsetX": 0,
|
|
||||||
"offsetY": 0,
|
|
||||||
"trimX": 0,
|
|
||||||
"trimY": 0,
|
|
||||||
"width": 1080,
|
|
||||||
"height": 2340,
|
|
||||||
"rawWidth": 1080,
|
|
||||||
"rawHeight": 2340,
|
|
||||||
"borderTop": 0,
|
|
||||||
"borderBottom": 0,
|
|
||||||
"borderLeft": 0,
|
|
||||||
"borderRight": 0,
|
|
||||||
"subMetas": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Before Width: | Height: | Size: 932 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 536 KiB After Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 40 KiB |
|
@ -328,7 +328,7 @@
|
||||||
"_srcBlendFactor": 770,
|
"_srcBlendFactor": 770,
|
||||||
"_dstBlendFactor": 771,
|
"_dstBlendFactor": 771,
|
||||||
"_spriteFrame": {
|
"_spriteFrame": {
|
||||||
"__uuid__": "1880f261-dd18-4e9e-9f49-b2f194d5ef8f"
|
"__uuid__": "403aa689-5ef4-4978-978a-74b806e0760f"
|
||||||
},
|
},
|
||||||
"_type": 0,
|
"_type": 0,
|
||||||
"_sizeMode": 0,
|
"_sizeMode": 0,
|
||||||
|
@ -4002,7 +4002,7 @@
|
||||||
"component": "",
|
"component": "",
|
||||||
"_componentId": "48bfeZuYFZE2qmgxbW2IigB",
|
"_componentId": "48bfeZuYFZE2qmgxbW2IigB",
|
||||||
"handler": "buyProduct",
|
"handler": "buyProduct",
|
||||||
"customEventData": "gold_pack_5"
|
"customEventData": "gold_5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "de906iE/HVHpI6VO7IMvKaI",
|
"__type__": "de906iE/HVHpI6VO7IMvKaI",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"ver": "1.3.2",
|
"ver": "1.3.2",
|
||||||
"uuid": "b01ef5c5-2755-455d-acb4-ba3818f5e331",
|
"uuid": "b01ef5c5-2755-455d-acb4-ba3818f5e331",
|
||||||
"importer": "prefab",
|
"importer": "prefab",
|
||||||
"optimizationPolicy": "AUTO",
|
"optimizationPolicy": "MULTI_INSTANCE",
|
||||||
"asyncLoadAssets": false,
|
"asyncLoadAssets": false,
|
||||||
"readonly": false,
|
"readonly": false,
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
|
|
|
@ -53,6 +53,7 @@ export default class NewClass extends cc.Component {
|
||||||
}
|
}
|
||||||
//打开商店界面
|
//打开商店界面
|
||||||
openShop() {
|
openShop() {
|
||||||
|
Utils.outTradeNo = null;
|
||||||
// 商品数据数组
|
// 商品数据数组
|
||||||
const products = [
|
const products = [
|
||||||
{ product_id: "gold_1", name: "金币包1", price: 600, coin: 1200, title: "3x2六档金币" },
|
{ product_id: "gold_1", name: "金币包1", price: 600, coin: 1200, title: "3x2六档金币" },
|
||||||
|
@ -126,6 +127,7 @@ protected update(dt: number): void {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
wx.offShow(this.onShowListener);
|
wx.offShow(this.onShowListener);
|
||||||
}
|
}
|
||||||
|
Utils.outTradeNo = null;
|
||||||
//销毁预制体
|
//销毁预制体
|
||||||
if (this.node.parent.getComponent("JiaZai")) {
|
if (this.node.parent.getComponent("JiaZai")) {
|
||||||
this.node.parent.getComponent("JiaZai").closeShop();
|
this.node.parent.getComponent("JiaZai").closeShop();
|
||||||
|
@ -141,6 +143,10 @@ protected update(dt: number): void {
|
||||||
console.log("有苹果订单号,开始轮训");
|
console.log("有苹果订单号,开始轮训");
|
||||||
Utils.getIosPayInfo((data) => {
|
Utils.getIosPayInfo((data) => {
|
||||||
console.log("获得轮训结果:", data);
|
console.log("获得轮训结果:", data);
|
||||||
|
if (data.code == 1) {
|
||||||
|
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
|
||||||
|
MiniGameSdk.API.showToast("购买金币成功");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -249,6 +255,7 @@ protected update(dt: number): void {
|
||||||
// Utils.GoKEFu();
|
// Utils.GoKEFu();
|
||||||
if (systemType == "ios") {
|
if (systemType == "ios") {
|
||||||
MiniGameSdk.API.showToast("IOS系统暂不支持支付");
|
MiniGameSdk.API.showToast("IOS系统暂不支持支付");
|
||||||
|
this.btn_Touch = true;
|
||||||
// Utils.GoKEFu();
|
// Utils.GoKEFu();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -283,6 +290,7 @@ protected update(dt: number): void {
|
||||||
if (data.data.pay_state == 1) {
|
if (data.data.pay_state == 1) {
|
||||||
this.btn_Touch = true;
|
this.btn_Touch = true;
|
||||||
MiniGameSdk.API.showToast("取消充值");
|
MiniGameSdk.API.showToast("取消充值");
|
||||||
|
|
||||||
const dataFail2 = {
|
const dataFail2 = {
|
||||||
outTradeNo: Utils.outTradeNo,
|
outTradeNo: Utils.outTradeNo,
|
||||||
price: price,
|
price: price,
|
||||||
|
@ -291,8 +299,7 @@ protected update(dt: number): void {
|
||||||
type: systemType,
|
type: systemType,
|
||||||
fail_reason: "用户取消支付",
|
fail_reason: "用户取消支付",
|
||||||
}
|
}
|
||||||
|
cc.fx.GameTool.shushu_Track("payment_fail", dataFail2);
|
||||||
cc.fx.GameTool.shushu_Track("payment_fail",name);
|
|
||||||
}
|
}
|
||||||
else if (data.data.pay_state == 2) {
|
else if (data.data.pay_state == 2) {
|
||||||
this.btn_Touch = true;
|
this.btn_Touch = true;
|
||||||
|
|
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 229 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.2 KiB |
|
@ -15,7 +15,7 @@
|
||||||
"mainCompressionType": "subpackage",
|
"mainCompressionType": "subpackage",
|
||||||
"mainIsRemote": false,
|
"mainIsRemote": false,
|
||||||
"optimizeHotUpdate": false,
|
"optimizeHotUpdate": false,
|
||||||
"md5Cache": true,
|
"md5Cache": false,
|
||||||
"nativeMd5Cache": true,
|
"nativeMd5Cache": true,
|
||||||
"encryptJs": true,
|
"encryptJs": true,
|
||||||
"xxteaKey": "07ac496c-82b0-4f",
|
"xxteaKey": "07ac496c-82b0-4f",
|
||||||
|
|