Commit 0e8b37f6 authored by wildfirecode13's avatar wildfirecode13

Merge branch 'tianmaoxiaoyuan' of gitlab2.dui88.com:wanghongyuan/new_taobao into tianmaoxiaoyuan

parents e3abc2d7 e0110573
......@@ -1817,6 +1817,36 @@ const resCanvasList = {
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/catTalkDialog.6fa85b0929d7d8e0d42d0d30587cdbdc33059a8f.png',
uuid: '624e8c63-963f-4b20-9802-b0fb006fbf93'
},
'8b0d746a-524e-4dc5-984a-2da2f7f6f862': {
name: 'avatarBg',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/avatarBg.ab4622741c93fb3b2a08f0f8f01c8c4b31ae5cb0.png',
uuid: '8b0d746a-524e-4dc5-984a-2da2f7f6f862'
},
'60d6bb5e-5af1-459d-8a0f-ac7a3edcb703': {
name: 'exLoadingBg',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/exLoadingBg.a9104e208e4d425d0dc3fef446acae78d3e2753f.png',
uuid: '60d6bb5e-5af1-459d-8a0f-ac7a3edcb703'
},
'f2a39dcf-acc3-4cc8-9dd1-e82e915048db': {
name: 'exLoadingFront',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/exLoadingFront.a21f9697486f4433973e5f521ff9d6a978098503.png',
uuid: 'f2a39dcf-acc3-4cc8-9dd1-e82e915048db'
},
'3e9351dd-787d-4dca-bbf3-793d129c6332': {
name: 'shapGoBtn',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/shapGoBtn.78caf5d5af696b5510dd675e626089a320a5c3f1.png',
uuid: '3e9351dd-787d-4dca-bbf3-793d129c6332'
},
'dba58651-57a3-4b75-9447-0e4d498dd8cd': {
name: 'shapGoBtn1',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/shapGoBtn1.d4d2cbdd9ab87642e34600c20ca627c9a377ffb7.png',
uuid: 'dba58651-57a3-4b75-9447-0e4d498dd8cd'
}
};
/* harmony default export */ __webpack_exports__["default"] = (resCanvasList);
......@@ -1984,15 +2014,20 @@ var Ins = (function () {
console.log('showModal ruleModal, success,res', s, res);
});
};
Ins.navigateToPage = function (name, data) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.navigateToPage, { name: name, data: data ? data : {} }, function (s, res) {
console.log('showModal ruleModal, success,res', s, res);
});
};
Ins.showToast = function (msg) {
console.log("发出message", msg);
Main_1.GDispatcher.dispatchEvent({ type: "toast" }, msg);
};
Ins.showLoading = function () {
Main_1.GDispatcher.dispatchEvent("loading");
Main_1.GDispatcher.dispatchEvent({ type: "loading" });
};
Ins.hideLoading = function () {
Main_1.GDispatcher.dispatchEvent("hideloading");
Main_1.GDispatcher.dispatchEvent({ type: "hideloading" });
};
Ins.stopLottieAnim = function (lottie) {
FYGE.Tween.removeTweens(lottie);
......@@ -2023,6 +2058,7 @@ var Ins = (function () {
label.text = data.text ? data.text : "";
return label;
};
Ins.recoverEnergy = 5 * 60 * 1000;
return Ins;
}());
exports.Ins = Ins;
......@@ -2237,18 +2273,10 @@ var TbNetName;
TbNetName["showModal"] = "mine.showModal";
TbNetName["getUserInfo"] = "tmallCat.getUserInfo";
TbNetName["interaction"] = "tmallCat.interaction";
TbNetName["recoverEnergy"] = "tmallCat.recoverEnergy";
TbNetName["getUserEnergy"] = "tmallCat.getUserEnergy";
TbNetName["trackingReport"] = "squirrelsAdoptRest2c.trackingReport";
TbNetName["getActivityBaseInfoById"] = "bubbleSurviva.getActivityBaseInfoById";
TbNetName["getGameInfo"] = "babycare.getGameInfo";
TbNetName["consumerTools"] = "babycare.consumerTools";
TbNetName["gameOver"] = "babycare.gameOver";
TbNetName["receiveTaskRewards"] = "babycare.receiveTaskRewards";
TbNetName["exchange"] = "babycare.exchange";
TbNetName["getPrizesByLevel"] = "babycare.getPrizesByLevel";
TbNetName["queryCredits"] = "babycare.queryCredits";
TbNetName["dojoin"] = "babycare.dojoin";
TbNetName["completeTask"] = "babycare.completeTask";
TbNetName["getTaskList"] = "babycare.getTaskList";
TbNetName["authorize"] = "mine.authorize";
TbNetName["favorShop"] = "mine.favorShop";
TbNetName["getUserAddress"] = "mine.getUserAddress";
......@@ -46638,6 +46666,7 @@ var MainScene = (function (_super) {
that.addChild(that.mainUi);
that.initCat();
that.initEnergy();
that.energyUp();
};
MainScene.prototype.initCat = function () {
var that = this;
......@@ -46694,12 +46723,42 @@ var MainScene = (function (_super) {
MainScene.prototype.setEnergy = function () {
var that = this;
that.energy = Ins_1.Ins.userInfo.energy;
that.maxEnergy = Ins_1.Ins.userInfo.energyMax;
that.energyImg.scaleX = (that.energy / that.maxEnergy);
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
};
MainScene.prototype.energyUp = function () {
var that = this;
that.recoverEnergyHandler = setInterval(function () {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
if (s) {
that.getUserEnergy();
}
else {
Ins_1.Ins.showToast(r.message);
}
});
}, Ins_1.Ins.recoverEnergy);
};
MainScene.prototype.getUserEnergy = function () {
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserEnergy, {}, function (s, r) {
if (s) {
if (r.data != Ins_1.Ins.userInfo.energy) {
Ins_1.Ins.userInfo.energy = r.data;
that.setEnergy();
return;
}
else {
that.getUserEnergy();
}
}
else {
Ins_1.Ins.showToast(r.message);
}
});
};
MainScene.prototype.changeMainScene = function (type) {
console.log("切换到" + type);
......@@ -46785,6 +46844,7 @@ var MainScene = (function (_super) {
MainScene.prototype.removeEvents = function () {
var that = this;
console.log("主场景移除事件");
that.recoverEnergyHandler && clearInterval(that.recoverEnergyHandler);
that.tlBtn.removeEventListener(FYGE.MouseEvent.CLICK, function () { that.changeMainScene(Enum_1.SCENETYPE.CLASSROOM); }, that);
that.mxqBtn.removeEventListener(FYGE.MouseEvent.CLICK, function () { that.changeMainScene(Enum_1.SCENETYPE.PLAYGROUND); }, that);
that.letter && that.letter.removeEventListener(FYGE.MouseEvent.CLICK, that.openLetter, that);
......@@ -46959,6 +47019,9 @@ var MainSceneBtnUi = (function (_super) {
that.topBtnGroup.addChild(that.prizeBtn);
that.energyBtn = Ins_1.Ins.initSprite("cdb8e186-9872-442e-b71e-bba0a9ce5846", 539, -7);
that.bottomBtnGroup.addChild(that.energyBtn);
that.shapGoBtn = Ins_1.Ins.initSprite("dba58651-57a3-4b75-9447-0e4d498dd8cd");
that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137);
that.bottomBtnGroup.addChild(that.shapGoBtn);
that.initCatInfoGroup();
that.initFishPointGroup();
that.initActBtn();
......@@ -46967,7 +47030,7 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.initCatInfoGroup = function () {
var that = this;
that.catInfoGroup = Ins_1.Ins.initSprite("af4b699e-5152-4571-8c54-1c06eabf19e9", 69),
that.catInfoGroup = Ins_1.Ins.initSprite("8b0d746a-524e-4dc5-984a-2da2f7f6f862", 69),
that.topBtnGroup.addChild(that.catInfoGroup);
that.catAvatar = new FYGE.Sprite();
that.catInfoGroup.addChild(that.catAvatar);
......@@ -46982,6 +47045,19 @@ var MainSceneBtnUi = (function (_super) {
that.catInfoGroup.addChild(that.catNameLabel);
that.catLevelLabel = Ins_1.Ins.initLabel({ color: "black", size: 24, text: "Lv.1", x: (192 - 19), y: (167 - 145) });
that.catInfoGroup.addChild(that.catLevelLabel);
that.catExperienceBg = Ins_1.Ins.initSprite("60d6bb5e-5af1-459d-8a0f-ac7a3edcb703", 76, 52);
that.catInfoGroup.addChild(that.catExperienceBg);
that.catExperience = Ins_1.Ins.initSprite("f2a39dcf-acc3-4cc8-9dd1-e82e915048db");
that.catExperience.anchorY = that.catExperience.height >> 1;
that.catExperienceBg.addChild(that.catExperience);
var mask = new FYGE.Shape();
mask.beginFill(6, 1);
mask.drawRoundedRect(0, 0, that.catExperience.width, that.catExperience.height, 38, 38, 38, 38);
mask.endFill();
mask.x = 5;
mask.y = 0;
that.catExperienceBg.addChild(mask);
that.catExperience.mask = mask;
};
MainSceneBtnUi.prototype.initFishPointGroup = function () {
var that = this;
......@@ -47009,7 +47085,7 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.updateUserInfo = function () {
var that = this;
var _a = Ins_1.Ins.userInfo, catName = _a.catName, happyCoin = _a.happyCoin, level = _a.level, avatar = _a.avatar;
var _a = Ins_1.Ins.userInfo, catName = _a.catName, happyCoin = _a.happyCoin, level = _a.level, avatar = _a.avatar, experience = _a.experience, experienceMax = _a.experienceMax;
that.catAvatar.texture = RES_1.RES.getRes(avatar);
that.catAvatar.width = 52;
that.catAvatar.height = 52;
......@@ -47017,6 +47093,7 @@ var MainSceneBtnUi = (function (_super) {
that.catNameLabel.text = catName;
that.catLevelLabel.text = "Lv." + level;
that.fishPointLabel.text = "" + happyCoin;
that.catExperience.scaleX = experience / experienceMax;
};
MainSceneBtnUi.prototype.hideAllActBtn = function () {
var that = this;
......@@ -47114,6 +47191,10 @@ var MainSceneBtnUi = (function (_super) {
}
}
};
MainSceneBtnUi.prototype.goShap = function () {
console.log("去商城");
Ins_1.Ins.navigateToPage("pageshop");
};
MainSceneBtnUi.prototype.catRecallHandler = function () {
console.log("召回猫咪");
Ins_1.Ins.showModule("recallcatModal", { catType: Ins_1.Ins.userInfo.catType });
......@@ -47155,6 +47236,7 @@ var MainSceneBtnUi = (function (_super) {
that.addEvent(that.returnBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.strategyBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.prizeBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.shapGoBtn, FYGE.MouseEvent.CLICK, that.goShap);
that.addEvent(that.playBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.catBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.combingBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
......@@ -47177,6 +47259,7 @@ var MainSceneBtnUi = (function (_super) {
that.removeEvent(that.returnBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.strategyBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.prizeBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.shapGoBtn, FYGE.MouseEvent.CLICK, that.goShap);
that.removeEvent(that.playBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.catBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.combingBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1819,6 +1819,36 @@ const resCanvasList = {
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/catTalkDialog.6fa85b0929d7d8e0d42d0d30587cdbdc33059a8f.png',
uuid: '624e8c63-963f-4b20-9802-b0fb006fbf93'
},
'8b0d746a-524e-4dc5-984a-2da2f7f6f862': {
name: 'avatarBg',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/avatarBg.ab4622741c93fb3b2a08f0f8f01c8c4b31ae5cb0.png',
uuid: '8b0d746a-524e-4dc5-984a-2da2f7f6f862'
},
'60d6bb5e-5af1-459d-8a0f-ac7a3edcb703': {
name: 'exLoadingBg',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/exLoadingBg.a9104e208e4d425d0dc3fef446acae78d3e2753f.png',
uuid: '60d6bb5e-5af1-459d-8a0f-ac7a3edcb703'
},
'f2a39dcf-acc3-4cc8-9dd1-e82e915048db': {
name: 'exLoadingFront',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/exLoadingFront.a21f9697486f4433973e5f521ff9d6a978098503.png',
uuid: 'f2a39dcf-acc3-4cc8-9dd1-e82e915048db'
},
'3e9351dd-787d-4dca-bbf3-793d129c6332': {
name: 'shapGoBtn',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/shapGoBtn.78caf5d5af696b5510dd675e626089a320a5c3f1.png',
uuid: '3e9351dd-787d-4dca-bbf3-793d129c6332'
},
'dba58651-57a3-4b75-9447-0e4d498dd8cd': {
name: 'shapGoBtn1',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/shapGoBtn1.d4d2cbdd9ab87642e34600c20ca627c9a377ffb7.png',
uuid: 'dba58651-57a3-4b75-9447-0e4d498dd8cd'
}
};
/* harmony default export */ __webpack_exports__["default"] = (resCanvasList);
......@@ -1986,15 +2016,20 @@ var Ins = (function () {
console.log('showModal ruleModal, success,res', s, res);
});
};
Ins.navigateToPage = function (name, data) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.navigateToPage, { name: name, data: data ? data : {} }, function (s, res) {
console.log('showModal ruleModal, success,res', s, res);
});
};
Ins.showToast = function (msg) {
console.log("发出message", msg);
Main_1.GDispatcher.dispatchEvent({ type: "toast" }, msg);
};
Ins.showLoading = function () {
Main_1.GDispatcher.dispatchEvent("loading");
Main_1.GDispatcher.dispatchEvent({ type: "loading" });
};
Ins.hideLoading = function () {
Main_1.GDispatcher.dispatchEvent("hideloading");
Main_1.GDispatcher.dispatchEvent({ type: "hideloading" });
};
Ins.stopLottieAnim = function (lottie) {
FYGE.Tween.removeTweens(lottie);
......@@ -2025,6 +2060,7 @@ var Ins = (function () {
label.text = data.text ? data.text : "";
return label;
};
Ins.recoverEnergy = 5 * 60 * 1000;
return Ins;
}());
exports.Ins = Ins;
......@@ -2239,18 +2275,10 @@ var TbNetName;
TbNetName["showModal"] = "mine.showModal";
TbNetName["getUserInfo"] = "tmallCat.getUserInfo";
TbNetName["interaction"] = "tmallCat.interaction";
TbNetName["recoverEnergy"] = "tmallCat.recoverEnergy";
TbNetName["getUserEnergy"] = "tmallCat.getUserEnergy";
TbNetName["trackingReport"] = "squirrelsAdoptRest2c.trackingReport";
TbNetName["getActivityBaseInfoById"] = "bubbleSurviva.getActivityBaseInfoById";
TbNetName["getGameInfo"] = "babycare.getGameInfo";
TbNetName["consumerTools"] = "babycare.consumerTools";
TbNetName["gameOver"] = "babycare.gameOver";
TbNetName["receiveTaskRewards"] = "babycare.receiveTaskRewards";
TbNetName["exchange"] = "babycare.exchange";
TbNetName["getPrizesByLevel"] = "babycare.getPrizesByLevel";
TbNetName["queryCredits"] = "babycare.queryCredits";
TbNetName["dojoin"] = "babycare.dojoin";
TbNetName["completeTask"] = "babycare.completeTask";
TbNetName["getTaskList"] = "babycare.getTaskList";
TbNetName["authorize"] = "mine.authorize";
TbNetName["favorShop"] = "mine.favorShop";
TbNetName["getUserAddress"] = "mine.getUserAddress";
......@@ -46640,6 +46668,7 @@ var MainScene = (function (_super) {
that.addChild(that.mainUi);
that.initCat();
that.initEnergy();
that.energyUp();
};
MainScene.prototype.initCat = function () {
var that = this;
......@@ -46696,12 +46725,42 @@ var MainScene = (function (_super) {
MainScene.prototype.setEnergy = function () {
var that = this;
that.energy = Ins_1.Ins.userInfo.energy;
that.maxEnergy = Ins_1.Ins.userInfo.energyMax;
that.energyImg.scaleX = (that.energy / that.maxEnergy);
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
};
MainScene.prototype.energyUp = function () {
var that = this;
that.recoverEnergyHandler = setInterval(function () {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
if (s) {
that.getUserEnergy();
}
else {
Ins_1.Ins.showToast(r.message);
}
});
}, Ins_1.Ins.recoverEnergy);
};
MainScene.prototype.getUserEnergy = function () {
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserEnergy, {}, function (s, r) {
if (s) {
if (r.data != Ins_1.Ins.userInfo.energy) {
Ins_1.Ins.userInfo.energy = r.data;
that.setEnergy();
return;
}
else {
that.getUserEnergy();
}
}
else {
Ins_1.Ins.showToast(r.message);
}
});
};
MainScene.prototype.changeMainScene = function (type) {
console.log("切换到" + type);
......@@ -46787,6 +46846,7 @@ var MainScene = (function (_super) {
MainScene.prototype.removeEvents = function () {
var that = this;
console.log("主场景移除事件");
that.recoverEnergyHandler && clearInterval(that.recoverEnergyHandler);
that.tlBtn.removeEventListener(FYGE.MouseEvent.CLICK, function () { that.changeMainScene(Enum_1.SCENETYPE.CLASSROOM); }, that);
that.mxqBtn.removeEventListener(FYGE.MouseEvent.CLICK, function () { that.changeMainScene(Enum_1.SCENETYPE.PLAYGROUND); }, that);
that.letter && that.letter.removeEventListener(FYGE.MouseEvent.CLICK, that.openLetter, that);
......@@ -46961,6 +47021,9 @@ var MainSceneBtnUi = (function (_super) {
that.topBtnGroup.addChild(that.prizeBtn);
that.energyBtn = Ins_1.Ins.initSprite("cdb8e186-9872-442e-b71e-bba0a9ce5846", 539, -7);
that.bottomBtnGroup.addChild(that.energyBtn);
that.shapGoBtn = Ins_1.Ins.initSprite("dba58651-57a3-4b75-9447-0e4d498dd8cd");
that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137);
that.bottomBtnGroup.addChild(that.shapGoBtn);
that.initCatInfoGroup();
that.initFishPointGroup();
that.initActBtn();
......@@ -46969,7 +47032,7 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.initCatInfoGroup = function () {
var that = this;
that.catInfoGroup = Ins_1.Ins.initSprite("af4b699e-5152-4571-8c54-1c06eabf19e9", 69),
that.catInfoGroup = Ins_1.Ins.initSprite("8b0d746a-524e-4dc5-984a-2da2f7f6f862", 69),
that.topBtnGroup.addChild(that.catInfoGroup);
that.catAvatar = new FYGE.Sprite();
that.catInfoGroup.addChild(that.catAvatar);
......@@ -46984,6 +47047,19 @@ var MainSceneBtnUi = (function (_super) {
that.catInfoGroup.addChild(that.catNameLabel);
that.catLevelLabel = Ins_1.Ins.initLabel({ color: "black", size: 24, text: "Lv.1", x: (192 - 19), y: (167 - 145) });
that.catInfoGroup.addChild(that.catLevelLabel);
that.catExperienceBg = Ins_1.Ins.initSprite("60d6bb5e-5af1-459d-8a0f-ac7a3edcb703", 76, 52);
that.catInfoGroup.addChild(that.catExperienceBg);
that.catExperience = Ins_1.Ins.initSprite("f2a39dcf-acc3-4cc8-9dd1-e82e915048db");
that.catExperience.anchorY = that.catExperience.height >> 1;
that.catExperienceBg.addChild(that.catExperience);
var mask = new FYGE.Shape();
mask.beginFill(6, 1);
mask.drawRoundedRect(0, 0, that.catExperience.width, that.catExperience.height, 38, 38, 38, 38);
mask.endFill();
mask.x = 5;
mask.y = 0;
that.catExperienceBg.addChild(mask);
that.catExperience.mask = mask;
};
MainSceneBtnUi.prototype.initFishPointGroup = function () {
var that = this;
......@@ -47011,7 +47087,7 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.updateUserInfo = function () {
var that = this;
var _a = Ins_1.Ins.userInfo, catName = _a.catName, happyCoin = _a.happyCoin, level = _a.level, avatar = _a.avatar;
var _a = Ins_1.Ins.userInfo, catName = _a.catName, happyCoin = _a.happyCoin, level = _a.level, avatar = _a.avatar, experience = _a.experience, experienceMax = _a.experienceMax;
that.catAvatar.texture = RES_1.RES.getRes(avatar);
that.catAvatar.width = 52;
that.catAvatar.height = 52;
......@@ -47019,6 +47095,7 @@ var MainSceneBtnUi = (function (_super) {
that.catNameLabel.text = catName;
that.catLevelLabel.text = "Lv." + level;
that.fishPointLabel.text = "" + happyCoin;
that.catExperience.scaleX = experience / experienceMax;
};
MainSceneBtnUi.prototype.hideAllActBtn = function () {
var that = this;
......@@ -47116,6 +47193,10 @@ var MainSceneBtnUi = (function (_super) {
}
}
};
MainSceneBtnUi.prototype.goShap = function () {
console.log("去商城");
Ins_1.Ins.navigateToPage("pageshop");
};
MainSceneBtnUi.prototype.catRecallHandler = function () {
console.log("召回猫咪");
Ins_1.Ins.showModule("recallcatModal", { catType: Ins_1.Ins.userInfo.catType });
......@@ -47157,6 +47238,7 @@ var MainSceneBtnUi = (function (_super) {
that.addEvent(that.returnBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.strategyBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.prizeBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.shapGoBtn, FYGE.MouseEvent.CLICK, that.goShap);
that.addEvent(that.playBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.catBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.combingBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
......@@ -47179,6 +47261,7 @@ var MainSceneBtnUi = (function (_super) {
that.removeEvent(that.returnBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.strategyBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.prizeBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.shapGoBtn, FYGE.MouseEvent.CLICK, that.goShap);
that.removeEvent(that.playBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.catBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.combingBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
......@@ -10,5 +10,5 @@ export const ResJson = {
"name": "startScene"
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/1600936371/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/1601003410/resource/"
}
\ No newline at end of file
......@@ -19,17 +19,20 @@ Component({
onModalClose && onModalClose();
console.log('onModalClose')
},
onPostSelectCat() {
const userInfo = API.getUserInfo().catch(res=>{
my.showToast({content:userInfo?userInfo.message:null})
async onPostSelectCat() {
const userInfo = await API.getUserInfo().catch(res=>{
my.showToast({content:res?res.message:null})
});
if(userInfo&&userInfo.success){
console.log("aaa",userInfo)
const {
onPostSelectCat
} = this.props;
console.log("领养完毕")
this.onModalClose();
// my.__updateUserInfo__();
onPostSelectCat && onPostSelectCat(userInfo);
}
}
},
......
......@@ -1818,6 +1818,36 @@ const resCanvasList = {
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/catTalkDialog.6fa85b0929d7d8e0d42d0d30587cdbdc33059a8f.png',
uuid: '624e8c63-963f-4b20-9802-b0fb006fbf93'
},
'8b0d746a-524e-4dc5-984a-2da2f7f6f862': {
name: 'avatarBg',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/avatarBg.ab4622741c93fb3b2a08f0f8f01c8c4b31ae5cb0.png',
uuid: '8b0d746a-524e-4dc5-984a-2da2f7f6f862'
},
'60d6bb5e-5af1-459d-8a0f-ac7a3edcb703': {
name: 'exLoadingBg',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/exLoadingBg.a9104e208e4d425d0dc3fef446acae78d3e2753f.png',
uuid: '60d6bb5e-5af1-459d-8a0f-ac7a3edcb703'
},
'f2a39dcf-acc3-4cc8-9dd1-e82e915048db': {
name: 'exLoadingFront',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/exLoadingFront.a21f9697486f4433973e5f521ff9d6a978098503.png',
uuid: 'f2a39dcf-acc3-4cc8-9dd1-e82e915048db'
},
'3e9351dd-787d-4dca-bbf3-793d129c6332': {
name: 'shapGoBtn',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/shapGoBtn.78caf5d5af696b5510dd675e626089a320a5c3f1.png',
uuid: '3e9351dd-787d-4dca-bbf3-793d129c6332'
},
'dba58651-57a3-4b75-9447-0e4d498dd8cd': {
name: 'shapGoBtn1',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/shapGoBtn1.d4d2cbdd9ab87642e34600c20ca627c9a377ffb7.png',
uuid: 'dba58651-57a3-4b75-9447-0e4d498dd8cd'
}
};
/* harmony default export */ __webpack_exports__["default"] = (resCanvasList);
......@@ -1985,15 +2015,20 @@ var Ins = (function () {
console.log('showModal ruleModal, success,res', s, res);
});
};
Ins.navigateToPage = function (name, data) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.navigateToPage, { name: name, data: data ? data : {} }, function (s, res) {
console.log('showModal ruleModal, success,res', s, res);
});
};
Ins.showToast = function (msg) {
console.log("发出message", msg);
Main_1.GDispatcher.dispatchEvent({ type: "toast" }, msg);
};
Ins.showLoading = function () {
Main_1.GDispatcher.dispatchEvent("loading");
Main_1.GDispatcher.dispatchEvent({ type: "loading" });
};
Ins.hideLoading = function () {
Main_1.GDispatcher.dispatchEvent("hideloading");
Main_1.GDispatcher.dispatchEvent({ type: "hideloading" });
};
Ins.stopLottieAnim = function (lottie) {
FYGE.Tween.removeTweens(lottie);
......@@ -2024,6 +2059,7 @@ var Ins = (function () {
label.text = data.text ? data.text : "";
return label;
};
Ins.recoverEnergy = 5 * 60 * 1000;
return Ins;
}());
exports.Ins = Ins;
......@@ -2238,18 +2274,10 @@ var TbNetName;
TbNetName["showModal"] = "mine.showModal";
TbNetName["getUserInfo"] = "tmallCat.getUserInfo";
TbNetName["interaction"] = "tmallCat.interaction";
TbNetName["recoverEnergy"] = "tmallCat.recoverEnergy";
TbNetName["getUserEnergy"] = "tmallCat.getUserEnergy";
TbNetName["trackingReport"] = "squirrelsAdoptRest2c.trackingReport";
TbNetName["getActivityBaseInfoById"] = "bubbleSurviva.getActivityBaseInfoById";
TbNetName["getGameInfo"] = "babycare.getGameInfo";
TbNetName["consumerTools"] = "babycare.consumerTools";
TbNetName["gameOver"] = "babycare.gameOver";
TbNetName["receiveTaskRewards"] = "babycare.receiveTaskRewards";
TbNetName["exchange"] = "babycare.exchange";
TbNetName["getPrizesByLevel"] = "babycare.getPrizesByLevel";
TbNetName["queryCredits"] = "babycare.queryCredits";
TbNetName["dojoin"] = "babycare.dojoin";
TbNetName["completeTask"] = "babycare.completeTask";
TbNetName["getTaskList"] = "babycare.getTaskList";
TbNetName["authorize"] = "mine.authorize";
TbNetName["favorShop"] = "mine.favorShop";
TbNetName["getUserAddress"] = "mine.getUserAddress";
......@@ -46639,6 +46667,7 @@ var MainScene = (function (_super) {
that.addChild(that.mainUi);
that.initCat();
that.initEnergy();
that.energyUp();
};
MainScene.prototype.initCat = function () {
var that = this;
......@@ -46695,12 +46724,42 @@ var MainScene = (function (_super) {
MainScene.prototype.setEnergy = function () {
var that = this;
that.energy = Ins_1.Ins.userInfo.energy;
that.maxEnergy = Ins_1.Ins.userInfo.energyMax;
that.energyImg.scaleX = (that.energy / that.maxEnergy);
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
};
MainScene.prototype.energyUp = function () {
var that = this;
that.recoverEnergyHandler = setInterval(function () {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
if (s) {
that.getUserEnergy();
}
else {
Ins_1.Ins.showToast(r.message);
}
});
}, Ins_1.Ins.recoverEnergy);
};
MainScene.prototype.getUserEnergy = function () {
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserEnergy, {}, function (s, r) {
if (s) {
if (r.data != Ins_1.Ins.userInfo.energy) {
Ins_1.Ins.userInfo.energy = r.data;
that.setEnergy();
return;
}
else {
that.getUserEnergy();
}
}
else {
Ins_1.Ins.showToast(r.message);
}
});
};
MainScene.prototype.changeMainScene = function (type) {
console.log("切换到" + type);
......@@ -46786,6 +46845,7 @@ var MainScene = (function (_super) {
MainScene.prototype.removeEvents = function () {
var that = this;
console.log("主场景移除事件");
that.recoverEnergyHandler && clearInterval(that.recoverEnergyHandler);
that.tlBtn.removeEventListener(FYGE.MouseEvent.CLICK, function () { that.changeMainScene(Enum_1.SCENETYPE.CLASSROOM); }, that);
that.mxqBtn.removeEventListener(FYGE.MouseEvent.CLICK, function () { that.changeMainScene(Enum_1.SCENETYPE.PLAYGROUND); }, that);
that.letter && that.letter.removeEventListener(FYGE.MouseEvent.CLICK, that.openLetter, that);
......@@ -46960,6 +47020,9 @@ var MainSceneBtnUi = (function (_super) {
that.topBtnGroup.addChild(that.prizeBtn);
that.energyBtn = Ins_1.Ins.initSprite("cdb8e186-9872-442e-b71e-bba0a9ce5846", 539, -7);
that.bottomBtnGroup.addChild(that.energyBtn);
that.shapGoBtn = Ins_1.Ins.initSprite("dba58651-57a3-4b75-9447-0e4d498dd8cd");
that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137);
that.bottomBtnGroup.addChild(that.shapGoBtn);
that.initCatInfoGroup();
that.initFishPointGroup();
that.initActBtn();
......@@ -46968,7 +47031,7 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.initCatInfoGroup = function () {
var that = this;
that.catInfoGroup = Ins_1.Ins.initSprite("af4b699e-5152-4571-8c54-1c06eabf19e9", 69),
that.catInfoGroup = Ins_1.Ins.initSprite("8b0d746a-524e-4dc5-984a-2da2f7f6f862", 69),
that.topBtnGroup.addChild(that.catInfoGroup);
that.catAvatar = new FYGE.Sprite();
that.catInfoGroup.addChild(that.catAvatar);
......@@ -46983,6 +47046,19 @@ var MainSceneBtnUi = (function (_super) {
that.catInfoGroup.addChild(that.catNameLabel);
that.catLevelLabel = Ins_1.Ins.initLabel({ color: "black", size: 24, text: "Lv.1", x: (192 - 19), y: (167 - 145) });
that.catInfoGroup.addChild(that.catLevelLabel);
that.catExperienceBg = Ins_1.Ins.initSprite("60d6bb5e-5af1-459d-8a0f-ac7a3edcb703", 76, 52);
that.catInfoGroup.addChild(that.catExperienceBg);
that.catExperience = Ins_1.Ins.initSprite("f2a39dcf-acc3-4cc8-9dd1-e82e915048db");
that.catExperience.anchorY = that.catExperience.height >> 1;
that.catExperienceBg.addChild(that.catExperience);
var mask = new FYGE.Shape();
mask.beginFill(6, 1);
mask.drawRoundedRect(0, 0, that.catExperience.width, that.catExperience.height, 38, 38, 38, 38);
mask.endFill();
mask.x = 5;
mask.y = 0;
that.catExperienceBg.addChild(mask);
that.catExperience.mask = mask;
};
MainSceneBtnUi.prototype.initFishPointGroup = function () {
var that = this;
......@@ -47010,7 +47086,7 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.updateUserInfo = function () {
var that = this;
var _a = Ins_1.Ins.userInfo, catName = _a.catName, happyCoin = _a.happyCoin, level = _a.level, avatar = _a.avatar;
var _a = Ins_1.Ins.userInfo, catName = _a.catName, happyCoin = _a.happyCoin, level = _a.level, avatar = _a.avatar, experience = _a.experience, experienceMax = _a.experienceMax;
that.catAvatar.texture = RES_1.RES.getRes(avatar);
that.catAvatar.width = 52;
that.catAvatar.height = 52;
......@@ -47018,6 +47094,7 @@ var MainSceneBtnUi = (function (_super) {
that.catNameLabel.text = catName;
that.catLevelLabel.text = "Lv." + level;
that.fishPointLabel.text = "" + happyCoin;
that.catExperience.scaleX = experience / experienceMax;
};
MainSceneBtnUi.prototype.hideAllActBtn = function () {
var that = this;
......@@ -47115,6 +47192,10 @@ var MainSceneBtnUi = (function (_super) {
}
}
};
MainSceneBtnUi.prototype.goShap = function () {
console.log("去商城");
Ins_1.Ins.navigateToPage("pageshop");
};
MainSceneBtnUi.prototype.catRecallHandler = function () {
console.log("召回猫咪");
Ins_1.Ins.showModule("recallcatModal", { catType: Ins_1.Ins.userInfo.catType });
......@@ -47156,6 +47237,7 @@ var MainSceneBtnUi = (function (_super) {
that.addEvent(that.returnBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.strategyBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.prizeBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.shapGoBtn, FYGE.MouseEvent.CLICK, that.goShap);
that.addEvent(that.playBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.catBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.addEvent(that.combingBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
......@@ -47178,6 +47260,7 @@ var MainSceneBtnUi = (function (_super) {
that.removeEvent(that.returnBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.strategyBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.prizeBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.shapGoBtn, FYGE.MouseEvent.CLICK, that.goShap);
that.removeEvent(that.playBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.catBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
that.removeEvent(that.combingBtn, FYGE.MouseEvent.CLICK, that.touchHandler);
<view disable-scroll="true" class="page-game">
<canvas disable-scroll="true" id="canvas" type="2d" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
<canvas disable-scroll="true" id="canvas" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
</canvas>
</view>
......
......@@ -39,7 +39,7 @@ Page({
catnameModalVisible: false,
recallcatModalVisible: false,
recallcatModalData: {},
getcatModalVisible: false,
getcatModalVisible: true,
getcatModalData: {},
catbackbedModalVisible: false,
catruleModalVisible: 0
......@@ -59,12 +59,13 @@ Page({
},
onReady() {
async onReady() {
console.log('on ready')
//授权和登录先搞
this.getAuth();
await this.getAuth();
this.initCanvas();
my.__onMessage__ = (e) => {
this.onMessage(e)
}
......@@ -104,7 +105,7 @@ Page({
}
},
init() {
initCanvas() {
console.log('do init');
this.spark_startEngine();
......@@ -266,8 +267,10 @@ Page({
* 获取用户授权信息
*/
async getAuth() {
return new Promise(async (s,r)=>{
const userInfo = await getAuthUserInfo().catch(err => {
console.log('未授权成功', err);
r();
});
if (userInfo) {
console.log('授权成功 userInfo', userInfo);
......@@ -277,13 +280,16 @@ Page({
} = userInfo;
app.nickName = nickName;
app.avatar = avatar;
this.login();
await this.login();
s();
}
})
},
/**
* 登录接口
*/
async login() {
return new Promise(async (s,r)=>{
const {
nickName,
avatar
......@@ -294,12 +300,15 @@ Page({
userNick: nickName,
avatar
}).catch(res => {
r();
commonToast(res && res.message);
}) || {};
if (success) {
this.init();
s();
}
})
},
/**刷新用户信息 */
updateUserInfo() {
......@@ -370,7 +379,6 @@ Page({
})
},
closeGetcatModal() {
this.setData({
getcatModalVisible: false
})
......
......@@ -104,6 +104,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
// console.log('requestCloud', _cloudName, handle, params);
// return requestType === 'ams' ? requestAms() : requestCloud();
console.log(requestType);
return (requestType === 'ams' || requestType === 'yapi'|| requestType === 'local') ? requestMock() : requestCloud();
};
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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