Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
new_taobao
Commits
7d3a7955
Commit
7d3a7955
authored
Dec 09, 2020
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
领取精力与刷新三文鱼自测第一版,修正刷新三文鱼显示不对的问题
parent
9047e0a9
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
294 additions
and
88 deletions
+294
-88
tmallCat.getUserInfo.json
...ect/src/canvas/game/mock/miniTb/tmallCat.getUserInfo.json
+4
-2
output.js
project/src/canvas/game/output.js
+68
-16
output.js.map
project/src/canvas/game/output.js.map
+1
-1
output.js
project/src/canvas/game/released/output.js
+68
-16
resCanvasList.js
project/src/canvas/game/resCanvasList.js
+3
-3
Ins.ts
project/src/canvas/game/src/Ins.ts
+31
-2
Main.ts
project/src/canvas/game/src/Main.ts
+1
-0
Salmon.ts
project/src/canvas/game/src/cat/Salmon.ts
+2
-1
MainScene.ts
project/src/canvas/game/src/scenes/MainScene.ts
+23
-13
StartScene.ts
project/src/canvas/game/src/scenes/StartScene.ts
+2
-2
app.js
taobao_mini/client/app.js
+4
-4
prizeModal.acss
taobao_mini/client/components/prizeModal/prizeModal.acss
+2
-2
output.js
taobao_mini/client/pages/pagecanvas/output.js
+68
-16
pagecanvas.js
taobao_mini/client/pages/pagecanvas/pagecanvas.js
+6
-6
pageshop.acss
taobao_mini/client/pages/pageshop/pageshop.acss
+11
-4
No files found.
project/src/canvas/game/mock/miniTb/tmallCat.getUserInfo.json
View file @
7d3a7955
...
...
@@ -14,6 +14,8 @@
"senceTips"
:[
"1说话说话说话说话说话说话说话说话说话说话说话"
,
"2说话说话说话说话说话说话说话说话说话说话说话说话"
,
"3说话说话说话说话说话说话说话说话说话说话说话说话"
],
"energyMax"
:
50
,
"experienceMax"
:
1000
,
"senceGuide"
:
true
"senceGuide"
:
true
,
"updateTime"
:
1607507495319
,
"lastEnergyTime"
:
1607507395319
}
}
project/src/canvas/game/output.js
View file @
7d3a7955
...
...
@@ -2047,19 +2047,19 @@ const resCanvasList = {
'69435791-11ee-4c7f-9036-c4c3e28e1750': {
name: '经验条背景',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png',
url: '
https:
//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png',
uuid: '69435791-11ee-4c7f-9036-c4c3e28e1750'
},
'6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572': {
name: '经验条图片',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png',
url: '
https:
//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png',
uuid: '6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572'
},
'5cc07d1e-00f8-4178-8112-44fda9c15481': {
name: 'bedroomguide3final',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png',
url: '
https:
//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png',
uuid: '5cc07d1e-00f8-4178-8112-44fda9c15481'
}
};
...
...
@@ -2197,6 +2197,7 @@ var MSG;
MSG["UPDATE_ENERGY"] = "UPDATE_ENERGY";
MSG["SALMON_ANIM"] = "SALMON_ANIM";
MSG["FISH_COINANIM"] = "FISH_COINANIM";
MSG["SETUI_ENERGY"] = "SETUI_ENERGY";
})(MSG = exports.MSG || (exports.MSG = {}));
var CATTYPE;
(function (CATTYPE) {
...
...
@@ -2252,10 +2253,18 @@ var Ins = (function () {
Main_1.GDispatcher.dispatchEvent({ type: "toast" }, msg);
};
Ins.showLoading = function () {
console.log("canvas请求加载loading");
Main_1.GDispatcher.dispatchEvent({ type: "loading" });
if (this.stage) {
this.stage.mouseEnable = this.stage.mouseChildren = false;
}
};
Ins.hideLoading = function () {
console.log("canvas请求隐藏loading");
Main_1.GDispatcher.dispatchEvent({ type: "hideloading" });
if (this.stage) {
this.stage.mouseEnable = this.stage.mouseChildren = true;
}
};
Ins.stopLottieAnim = function (lottie) {
FYGE.Tween.removeTweens(lottie);
...
...
@@ -2403,6 +2412,7 @@ var Main = (function () {
console.log("初始化层级完成");
Ins_1.Ins.stageW = this.stage.viewRect.width;
Ins_1.Ins.stageH = this.stage.viewRect.height;
Ins_1.Ins.stage = this.stage;
console.log("舞台宽高:", Ins_1.Ins.stageW, Ins_1.Ins.stageH);
return [4, RES_1.RES.loadSparkAssets(resloadingList_1.default)];
case 1:
...
...
@@ -3128,8 +3138,9 @@ var Salmon = (function (_super) {
id: that._id,
energy: that.salmonCnt
};
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.takeEnergy, {
params: params
}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.takeEnergy, {
id: that._id, energy: that.salmonCnt
}, function (s, r) {
if (s) {
that.mouseEnable = true;
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.UPDATE_ENERGY, { call: function () { that.getSalmonAnim(); } });
}
else {
...
...
@@ -3199,11 +3210,13 @@ var __extends = (this && this.__extends) || (function () {
Object.defineProperty(exports, "__esModule", { value: true });
exports.SalmonAnim = void 0;
var Module_1 = __webpack_require__(/*! ../../module/views/Module */ "./module/views/Module.ts");
var Enum_1 = __webpack_require__(/*! ../Enum */ "./src/Enum.ts");
var Ins_1 = __webpack_require__(/*! ../Ins */ "./src/Ins.ts");
var SalmonAnim = (function (_super) {
__extends(SalmonAnim, _super);
function SalmonAnim(x, y) {
function SalmonAnim(x, y
, index
) {
var _this = _super.call(this) || this;
_this.index = 0;
_this.t = 0;
_this.targetX = 0;
_this.targetY = 0;
...
...
@@ -3213,6 +3226,7 @@ var SalmonAnim = (function (_super) {
_this.y = y;
_this.originX = x;
_this.originY = y;
_this.index = index;
return _this;
}
SalmonAnim.prototype.initUi = function () {
...
...
@@ -3227,6 +3241,9 @@ var SalmonAnim = (function (_super) {
this.targetX = targetX;
this.targetY = targetY;
FYGE.Tween.get(this, { onChangeObj: this, onChange: this.move }).wait(waitTime).to({ t: 1 }, 800).call(function () {
if (_this.index == 0) {
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.SETUI_ENERGY);
}
if (_this && _this.parent) {
_this.parent.removeChild(_this);
}
...
...
@@ -47360,6 +47377,7 @@ var MainScene = (function (_super) {
var _this = _super.call(this, data) || this;
_this.bgUUID = [];
_this.maxEnergy = 1500;
_this.firstSetEnergy = true;
_this.level = 0;
_this.isShow = false;
_this.salmonArr = [];
...
...
@@ -47567,8 +47585,17 @@ var MainScene = (function (_super) {
var that = this;
that.energy = Ins_1.Ins.userInfo.energy;
that.maxEnergy = Ins_1.Ins.userInfo.energyMax;
FYGE.Tween.removeTweens(that.energyImg);
FYGE.Tween.removeTweens(that.energyDeco);
if (that.firstSetEnergy) {
that.firstSetEnergy = false;
that.energyImg.scaleX = (that.energy / that.maxEnergy);
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
}
else {
FYGE.Tween.get(that.energyImg).to({ scaleX: (that.energy / that.maxEnergy) }, 1000, FYGE.Ease.quadOut);
FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * (that.energy / that.maxEnergy) - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut);
}
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
console.log("设置精力组数据结束");
...
...
@@ -47578,7 +47605,7 @@ var MainScene = (function (_super) {
if (that.recoverEnergyHandler)
clearInterval(that.recoverEnergyHandler);
console.log("上一次恢复精力的时间", new Date(Ins_1.Ins.userInfo.lastEnergyTime).getMinutes());
var time =
new Date().getTime()
- Ins_1.Ins.userInfo.lastEnergyTime;
var time =
Ins_1.Ins.userInfo.updateTime
- Ins_1.Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Math.floor(time % 3600 / 60));
if (time <= Ins_1.Ins.recoverEnergy) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy - time;
...
...
@@ -47755,6 +47782,7 @@ var MainScene = (function (_super) {
}
that.isShow = false;
that.energyUp1();
that.updateEnergy();
}
that.setEnergy();
that.mainUi.updateUserInfo();
...
...
@@ -47772,7 +47800,6 @@ var MainScene = (function (_super) {
var energyList = r.data.energyList;
Ins_1.Ins.userInfo.energy = r.data.energy;
e && e.data.call && e.data.call();
that.setEnergy();
that.initSalmon(energyList);
Ins_1.Ins.hideLoading();
}
...
...
@@ -47785,9 +47812,6 @@ var MainScene = (function (_super) {
MainScene.prototype.initSalmon = function (list) {
var diffCnt = Math.abs(list.length - Ins_1.Ins.salmonArr.length);
if (list.length >= Ins_1.Ins.salmonArr.length) {
for (var i = 0; i < Ins_1.Ins.salmonArr.length; i++) {
Ins_1.Ins.salmonArr[i].setCnt(list[Ins_1.Ins.salmonArr[i].index].energy);
}
var flagIndex = 0;
var canSetIndexArr = [];
while (flagIndex < 8) {
...
...
@@ -47807,6 +47831,21 @@ var MainScene = (function (_super) {
Ins_1.Ins.salmonArr.push(salmon);
setIndex++;
}
for (var i = 1; i < this.salmonArr.length; i++) {
for (var j = 0; j < this.salmonArr.length - i; j++) {
if (this.salmonArr[i].index > this.salmonArr[i].index) {
var temp = this.salmonArr[j];
this.salmonArr[j] = this.salmonArr[j + 1];
this.salmonArr[j + 1] = temp;
}
}
}
setTimeout(function () {
for (var i = 0; i < Ins_1.Ins.salmonArr.length; i++) {
if (Ins_1.Ins.salmonArr)
Ins_1.Ins.salmonArr[i].setCnt(list[i].energy);
}
}, 100);
}
};
MainScene.prototype.salmonAnim = function (e) {
...
...
@@ -47817,7 +47856,7 @@ var MainScene = (function (_super) {
var index = e.data.index;
this.salmonFlag[index] = false;
for (var i = 0; i < 5; i++) {
var salmonAnim = new SalmonAnim_1.SalmonAnim(x, y);
var salmonAnim = new SalmonAnim_1.SalmonAnim(x, y
, i
);
salmonAnim.setTween(100, 1100, i * 100);
this.salmonGroup.addChild(salmonAnim);
}
...
...
@@ -47892,6 +47931,7 @@ var MainScene = (function (_super) {
that.letter && that.letter.addEventListener(FYGE.MouseEvent.CLICK, that.openLetter, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_ENERGY, function (data) { that.updateEnergy(data); }, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.SETUI_ENERGY, that.setEnergy, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.SALMON_ANIM, that.salmonAnim, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.FISH_COINANIM, that.coinAnim, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
...
...
@@ -47908,6 +47948,7 @@ var MainScene = (function (_super) {
that.letter && that.letter.removeEventListener(FYGE.MouseEvent.CLICK, that.openLetter, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_ENERGY, function (data) { that.updateEnergy(data); }, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.SETUI_ENERGY, that.setEnergy, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.SALMON_ANIM, that.salmonAnim, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.FISH_COINANIM, that.coinAnim, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
...
...
@@ -48210,12 +48251,17 @@ var MainSceneBtnUi = (function (_super) {
that.catExperienceBg.addChild(that.catExperience);
var mask = new FYGE.Shape();
mask.beginFill(6, 1);
mask.drawRoundedRect(
-4
, 0, that.catExperience.width, that.catExperience.height, 45, 45, 45, 45);
mask.drawRoundedRect(
0
, 0, that.catExperience.width, that.catExperience.height, 45, 45, 45, 45);
mask.endFill();
mask.x =
5
;
mask.x =
0
;
mask.y = 0;
that.catExperienceBg.addChild(mask);
that.catExperience.mask = mask;
var rect = new FYGE.Shape();
rect.beginStroke(4670787, 4);
rect.drawRoundedRect(2, 2, that.catExperienceBg.width - 4, that.catExperienceBg.height - 4, 45, 45, 45, 45);
rect.endStroke();
that.catExperienceBg.addChild(rect);
that.experience = Ins_1.Ins.initLabel({ size: 20 });
that.experience.position.set(174, 53);
that.experience.textWidth = 110;
...
...
@@ -48259,8 +48305,14 @@ var MainSceneBtnUi = (function (_super) {
that.catNameLabel.text = catName;
that.catLevelLabel.text = "Lv." + level;
that.fishPointLabel.text = "" + happyCoin;
that.catExperience.scaleX = experience / experienceMax;
that.experience.text = experience + "/" + experienceMax;
var percent = experience / experienceMax;
if (percent >= 1) {
that.catExperience.x = (experience / experienceMax - 1) * that.catExperience.width;
}
else {
that.catExperience.x = (experience / experienceMax - 1) * that.catExperience.width + 4;
}
};
MainSceneBtnUi.prototype.hideAllActBtn = function () {
var that = this;
project/src/canvas/game/output.js.map
View file @
7d3a7955
This source diff could not be displayed because it is too large. You can
view the blob
instead.
project/src/canvas/game/released/output.js
View file @
7d3a7955
...
...
@@ -2049,19 +2049,19 @@ const resCanvasList = {
'69435791-11ee-4c7f-9036-c4c3e28e1750': {
name: '经验条背景',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png',
url: '
https:
//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png',
uuid: '69435791-11ee-4c7f-9036-c4c3e28e1750'
},
'6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572': {
name: '经验条图片',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png',
url: '
https:
//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png',
uuid: '6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572'
},
'5cc07d1e-00f8-4178-8112-44fda9c15481': {
name: 'bedroomguide3final',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png',
url: '
https:
//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png',
uuid: '5cc07d1e-00f8-4178-8112-44fda9c15481'
}
};
...
...
@@ -2199,6 +2199,7 @@ var MSG;
MSG["UPDATE_ENERGY"] = "UPDATE_ENERGY";
MSG["SALMON_ANIM"] = "SALMON_ANIM";
MSG["FISH_COINANIM"] = "FISH_COINANIM";
MSG["SETUI_ENERGY"] = "SETUI_ENERGY";
})(MSG = exports.MSG || (exports.MSG = {}));
var CATTYPE;
(function (CATTYPE) {
...
...
@@ -2254,10 +2255,18 @@ var Ins = (function () {
Main_1.GDispatcher.dispatchEvent({ type: "toast" }, msg);
};
Ins.showLoading = function () {
console.log("canvas请求加载loading");
Main_1.GDispatcher.dispatchEvent({ type: "loading" });
if (this.stage) {
this.stage.mouseEnable = this.stage.mouseChildren = false;
}
};
Ins.hideLoading = function () {
console.log("canvas请求隐藏loading");
Main_1.GDispatcher.dispatchEvent({ type: "hideloading" });
if (this.stage) {
this.stage.mouseEnable = this.stage.mouseChildren = true;
}
};
Ins.stopLottieAnim = function (lottie) {
FYGE.Tween.removeTweens(lottie);
...
...
@@ -2405,6 +2414,7 @@ var Main = (function () {
console.log("初始化层级完成");
Ins_1.Ins.stageW = this.stage.viewRect.width;
Ins_1.Ins.stageH = this.stage.viewRect.height;
Ins_1.Ins.stage = this.stage;
console.log("舞台宽高:", Ins_1.Ins.stageW, Ins_1.Ins.stageH);
return [4, RES_1.RES.loadSparkAssets(resloadingList_1.default)];
case 1:
...
...
@@ -3130,8 +3140,9 @@ var Salmon = (function (_super) {
id: that._id,
energy: that.salmonCnt
};
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.takeEnergy, {
params: params
}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.takeEnergy, {
id: that._id, energy: that.salmonCnt
}, function (s, r) {
if (s) {
that.mouseEnable = true;
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.UPDATE_ENERGY, { call: function () { that.getSalmonAnim(); } });
}
else {
...
...
@@ -3201,11 +3212,13 @@ var __extends = (this && this.__extends) || (function () {
Object.defineProperty(exports, "__esModule", { value: true });
exports.SalmonAnim = void 0;
var Module_1 = __webpack_require__(/*! ../../module/views/Module */ "./module/views/Module.ts");
var Enum_1 = __webpack_require__(/*! ../Enum */ "./src/Enum.ts");
var Ins_1 = __webpack_require__(/*! ../Ins */ "./src/Ins.ts");
var SalmonAnim = (function (_super) {
__extends(SalmonAnim, _super);
function SalmonAnim(x, y) {
function SalmonAnim(x, y
, index
) {
var _this = _super.call(this) || this;
_this.index = 0;
_this.t = 0;
_this.targetX = 0;
_this.targetY = 0;
...
...
@@ -3215,6 +3228,7 @@ var SalmonAnim = (function (_super) {
_this.y = y;
_this.originX = x;
_this.originY = y;
_this.index = index;
return _this;
}
SalmonAnim.prototype.initUi = function () {
...
...
@@ -3229,6 +3243,9 @@ var SalmonAnim = (function (_super) {
this.targetX = targetX;
this.targetY = targetY;
FYGE.Tween.get(this, { onChangeObj: this, onChange: this.move }).wait(waitTime).to({ t: 1 }, 800).call(function () {
if (_this.index == 0) {
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.SETUI_ENERGY);
}
if (_this && _this.parent) {
_this.parent.removeChild(_this);
}
...
...
@@ -47362,6 +47379,7 @@ var MainScene = (function (_super) {
var _this = _super.call(this, data) || this;
_this.bgUUID = [];
_this.maxEnergy = 1500;
_this.firstSetEnergy = true;
_this.level = 0;
_this.isShow = false;
_this.salmonArr = [];
...
...
@@ -47569,8 +47587,17 @@ var MainScene = (function (_super) {
var that = this;
that.energy = Ins_1.Ins.userInfo.energy;
that.maxEnergy = Ins_1.Ins.userInfo.energyMax;
FYGE.Tween.removeTweens(that.energyImg);
FYGE.Tween.removeTweens(that.energyDeco);
if (that.firstSetEnergy) {
that.firstSetEnergy = false;
that.energyImg.scaleX = (that.energy / that.maxEnergy);
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
}
else {
FYGE.Tween.get(that.energyImg).to({ scaleX: (that.energy / that.maxEnergy) }, 1000, FYGE.Ease.quadOut);
FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * (that.energy / that.maxEnergy) - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut);
}
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
console.log("设置精力组数据结束");
...
...
@@ -47580,7 +47607,7 @@ var MainScene = (function (_super) {
if (that.recoverEnergyHandler)
clearInterval(that.recoverEnergyHandler);
console.log("上一次恢复精力的时间", new Date(Ins_1.Ins.userInfo.lastEnergyTime).getMinutes());
var time =
new Date().getTime()
- Ins_1.Ins.userInfo.lastEnergyTime;
var time =
Ins_1.Ins.userInfo.updateTime
- Ins_1.Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Math.floor(time % 3600 / 60));
if (time <= Ins_1.Ins.recoverEnergy) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy - time;
...
...
@@ -47757,6 +47784,7 @@ var MainScene = (function (_super) {
}
that.isShow = false;
that.energyUp1();
that.updateEnergy();
}
that.setEnergy();
that.mainUi.updateUserInfo();
...
...
@@ -47774,7 +47802,6 @@ var MainScene = (function (_super) {
var energyList = r.data.energyList;
Ins_1.Ins.userInfo.energy = r.data.energy;
e && e.data.call && e.data.call();
that.setEnergy();
that.initSalmon(energyList);
Ins_1.Ins.hideLoading();
}
...
...
@@ -47787,9 +47814,6 @@ var MainScene = (function (_super) {
MainScene.prototype.initSalmon = function (list) {
var diffCnt = Math.abs(list.length - Ins_1.Ins.salmonArr.length);
if (list.length >= Ins_1.Ins.salmonArr.length) {
for (var i = 0; i < Ins_1.Ins.salmonArr.length; i++) {
Ins_1.Ins.salmonArr[i].setCnt(list[Ins_1.Ins.salmonArr[i].index].energy);
}
var flagIndex = 0;
var canSetIndexArr = [];
while (flagIndex < 8) {
...
...
@@ -47809,6 +47833,21 @@ var MainScene = (function (_super) {
Ins_1.Ins.salmonArr.push(salmon);
setIndex++;
}
for (var i = 1; i < this.salmonArr.length; i++) {
for (var j = 0; j < this.salmonArr.length - i; j++) {
if (this.salmonArr[i].index > this.salmonArr[i].index) {
var temp = this.salmonArr[j];
this.salmonArr[j] = this.salmonArr[j + 1];
this.salmonArr[j + 1] = temp;
}
}
}
setTimeout(function () {
for (var i = 0; i < Ins_1.Ins.salmonArr.length; i++) {
if (Ins_1.Ins.salmonArr)
Ins_1.Ins.salmonArr[i].setCnt(list[i].energy);
}
}, 100);
}
};
MainScene.prototype.salmonAnim = function (e) {
...
...
@@ -47819,7 +47858,7 @@ var MainScene = (function (_super) {
var index = e.data.index;
this.salmonFlag[index] = false;
for (var i = 0; i < 5; i++) {
var salmonAnim = new SalmonAnim_1.SalmonAnim(x, y);
var salmonAnim = new SalmonAnim_1.SalmonAnim(x, y
, i
);
salmonAnim.setTween(100, 1100, i * 100);
this.salmonGroup.addChild(salmonAnim);
}
...
...
@@ -47894,6 +47933,7 @@ var MainScene = (function (_super) {
that.letter && that.letter.addEventListener(FYGE.MouseEvent.CLICK, that.openLetter, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_ENERGY, function (data) { that.updateEnergy(data); }, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.SETUI_ENERGY, that.setEnergy, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.SALMON_ANIM, that.salmonAnim, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.FISH_COINANIM, that.coinAnim, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
...
...
@@ -47910,6 +47950,7 @@ var MainScene = (function (_super) {
that.letter && that.letter.removeEventListener(FYGE.MouseEvent.CLICK, that.openLetter, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_ENERGY, function (data) { that.updateEnergy(data); }, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.SETUI_ENERGY, that.setEnergy, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.SALMON_ANIM, that.salmonAnim, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.FISH_COINANIM, that.coinAnim, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
...
...
@@ -48212,12 +48253,17 @@ var MainSceneBtnUi = (function (_super) {
that.catExperienceBg.addChild(that.catExperience);
var mask = new FYGE.Shape();
mask.beginFill(6, 1);
mask.drawRoundedRect(
-4
, 0, that.catExperience.width, that.catExperience.height, 45, 45, 45, 45);
mask.drawRoundedRect(
0
, 0, that.catExperience.width, that.catExperience.height, 45, 45, 45, 45);
mask.endFill();
mask.x =
5
;
mask.x =
0
;
mask.y = 0;
that.catExperienceBg.addChild(mask);
that.catExperience.mask = mask;
var rect = new FYGE.Shape();
rect.beginStroke(4670787, 4);
rect.drawRoundedRect(2, 2, that.catExperienceBg.width - 4, that.catExperienceBg.height - 4, 45, 45, 45, 45);
rect.endStroke();
that.catExperienceBg.addChild(rect);
that.experience = Ins_1.Ins.initLabel({ size: 20 });
that.experience.position.set(174, 53);
that.experience.textWidth = 110;
...
...
@@ -48261,8 +48307,14 @@ var MainSceneBtnUi = (function (_super) {
that.catNameLabel.text = catName;
that.catLevelLabel.text = "Lv." + level;
that.fishPointLabel.text = "" + happyCoin;
that.catExperience.scaleX = experience / experienceMax;
that.experience.text = experience + "/" + experienceMax;
var percent = experience / experienceMax;
if (percent >= 1) {
that.catExperience.x = (experience / experienceMax - 1) * that.catExperience.width;
}
else {
that.catExperience.x = (experience / experienceMax - 1) * that.catExperience.width + 4;
}
};
MainSceneBtnUi.prototype.hideAllActBtn = function () {
var that = this;
project/src/canvas/game/resCanvasList.js
View file @
7d3a7955
...
...
@@ -903,19 +903,19 @@ const resCanvasList = {
'69435791-11ee-4c7f-9036-c4c3e28e1750'
:
{
name
:
'经验条背景'
,
ext
:
'.png'
,
url
:
'//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png'
,
url
:
'
https:
//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png'
,
uuid
:
'69435791-11ee-4c7f-9036-c4c3e28e1750'
},
'6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572'
:
{
name
:
'经验条图片'
,
ext
:
'.png'
,
url
:
'//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png'
,
url
:
'
https:
//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png'
,
uuid
:
'6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572'
},
'5cc07d1e-00f8-4178-8112-44fda9c15481'
:
{
name
:
'bedroomguide3final'
,
ext
:
'.png'
,
url
:
'//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png'
,
url
:
'
https:
//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png'
,
uuid
:
'5cc07d1e-00f8-4178-8112-44fda9c15481'
}
};
...
...
project/src/canvas/game/src/Ins.ts
View file @
7d3a7955
...
...
@@ -11,6 +11,7 @@ export class Ins {
/**舞台宽高 */
public
static
stageW
:
number
;
public
static
stageH
:
number
;
public
static
stage
:
FYGE
.
Stage
;
/**猫咪是否出寝了 */
public
static
catIsOut
:
boolean
;
...
...
@@ -40,8 +41,8 @@ export class Ins {
"energyMax"
:
number
,
"experienceMax"
:
number
,
"senceGuide"
:
boolean
,
"lastEnergyTime"
:
number
"lastEnergyTime"
:
number
,
"updateTime"
:
number
}
public
static
senceInfo
:
{
...
...
@@ -72,11 +73,17 @@ export class Ins {
public
static
showLoading
(){
console
.
log
(
"canvas请求加载loading"
)
GDispatcher
.
dispatchEvent
({
type
:
"loading"
});
if
(
this
.
stage
){
this
.
stage
.
mouseEnable
=
this
.
stage
.
mouseChildren
=
false
;
}
}
public
static
hideLoading
(){
console
.
log
(
"canvas请求隐藏loading"
)
GDispatcher
.
dispatchEvent
({
type
:
"hideloading"
});
if
(
this
.
stage
){
this
.
stage
.
mouseEnable
=
this
.
stage
.
mouseChildren
=
true
;
}
}
/**删除一个lottie的所有tween,停止动效 */
...
...
@@ -141,4 +148,26 @@ export class Ins {
// (1-t)^2 P0 + 2(1-t)tP1+ t^2P2
return
Math
.
pow
(
1
-
t
,
2
)
*
p0
+
2
*
(
1
-
t
)
*
t
*
p1
+
Math
.
pow
(
t
,
2
)
*
p2
;
}
//计算两个时间之间的时间差 多少天时分秒
public
static
intervalTime
(
time
)
{
var
date3
=
time
;
//时间差的毫秒数
//计算出相差天数
var
days
=
Math
.
floor
(
date3
/
(
24
*
3600
*
1000
));
//计算出小时数
var
leave1
=
date3
%
(
24
*
3600
*
1000
);
//计算天数后剩余的毫秒数
var
hours
=
Math
.
floor
(
leave1
/
(
3600
*
1000
));
//计算相差分钟数
var
leave2
=
leave1
%
(
3600
*
1000
);
//计算小时数后剩余的毫秒数
var
minutes
=
Math
.
floor
(
leave2
/
(
60
*
1000
));
//计算相差秒数
var
leave3
=
leave2
%
(
60
*
1000
);
//计算分钟数后剩余的毫秒数
var
seconds
=
Math
.
round
(
leave3
/
1000
);
// console.log(days + "天 " + hours + "小时 ")
// return days + "天 " + hours + "小时 " + minutes + " 分钟" + seconds + " 秒"
return
minutes
+
"分"
+
seconds
+
"秒"
}
}
\ No newline at end of file
project/src/canvas/game/src/Main.ts
View file @
7d3a7955
...
...
@@ -82,6 +82,7 @@ export class Main {
// await RES.loadGroup("common");
Ins
.
stageW
=
this
.
stage
.
viewRect
.
width
;
Ins
.
stageH
=
this
.
stage
.
viewRect
.
height
;
Ins
.
stage
=
this
.
stage
;
console
.
log
(
"舞台宽高:"
,
Ins
.
stageW
,
Ins
.
stageH
)
await
RES
.
loadSparkAssets
(
resloadingList
);
console
.
log
(
'resloadingList 加载完毕'
)
...
...
project/src/canvas/game/src/cat/Salmon.ts
View file @
7d3a7955
...
...
@@ -80,8 +80,9 @@ export class Salmon extends Module{
id
:
that
.
_id
,
energy
:
that
.
salmonCnt
}
sendTbNet
(
TbNetName
.
takeEnergy
,{
params
},(
s
,
r
)
=>
{
sendTbNet
(
TbNetName
.
takeEnergy
,{
id
:
that
.
_id
,
energy
:
that
.
salmonCnt
},(
s
,
r
)
=>
{
if
(
s
){
that
.
mouseEnable
=
true
;
FYGE
.
GDispatcher
.
dispatchEvent
(
MSG
.
UPDATE_ENERGY
,{
call
:()
=>
{
that
.
getSalmonAnim
()}});
}
else
{
that
.
mouseEnable
=
true
;
...
...
project/src/canvas/game/src/scenes/MainScene.ts
View file @
7d3a7955
...
...
@@ -361,8 +361,8 @@ export class MainScene extends Scene {
var
that
=
this
;
if
(
that
.
recoverEnergyHandler
)
clearInterval
(
that
.
recoverEnergyHandler
);
console
.
log
(
"上一次恢复精力的时间"
,
new
Date
(
Ins
.
userInfo
.
lastEnergyTime
).
getMinutes
())
let
time
=
new
Date
().
getTime
()
-
Ins
.
userInfo
.
lastEnergyTime
;
console
.
log
(
"相差的时间"
,
Math
.
floor
(
time
%
3600
/
60
))
let
time
=
Ins
.
userInfo
.
updateTime
-
Ins
.
userInfo
.
lastEnergyTime
;
console
.
log
(
"相差的时间"
,
Ins
.
intervalTime
(
time
))
if
(
time
<=
Ins
.
recoverEnergy
)
{
that
.
recoverEnergyTime
=
Ins
.
recoverEnergy
-
time
;
}
else
{
...
...
@@ -559,6 +559,7 @@ export class MainScene extends Scene {
}
that
.
isShow
=
false
;
that
.
energyUp1
();
that
.
updateEnergy
();
}
that
.
setEnergy
();
that
.
mainUi
.
updateUserInfo
();
...
...
@@ -594,11 +595,7 @@ export class MainScene extends Scene {
let
diffCnt
=
Math
.
abs
(
list
.
length
-
Ins
.
salmonArr
.
length
);
if
(
list
.
length
>=
Ins
.
salmonArr
.
length
)
{
// let index = 0;
for
(
let
i
=
0
;
i
<
Ins
.
salmonArr
.
length
;
i
++
)
{
if
(
Ins
.
salmonArr
[
i
]
&&
list
[
Ins
.
salmonArr
[
i
].
index
])
Ins
.
salmonArr
[
i
].
setCnt
(
list
[
Ins
.
salmonArr
[
i
].
index
].
energy
);
// index = i;
}
//用来获取空的三文鱼索引的index标示位
let
flagIndex
=
0
;
//可以放置的空的三文鱼索引
...
...
@@ -622,6 +619,25 @@ export class MainScene extends Scene {
Ins
.
salmonArr
.
push
(
salmon
);
setIndex
++
;
}
for
(
let
i
=
1
;
i
<
this
.
salmonArr
.
length
;
i
++
){
for
(
let
j
=
0
;
j
<
this
.
salmonArr
.
length
-
i
;
j
++
){
if
(
this
.
salmonArr
[
i
].
index
>
this
.
salmonArr
[
i
].
index
){
let
temp
=
this
.
salmonArr
[
j
];
this
.
salmonArr
[
j
]
=
this
.
salmonArr
[
j
+
1
];
this
.
salmonArr
[
j
+
1
]
=
temp
;
}
}
}
setTimeout
(()
=>
{
for
(
let
i
=
0
;
i
<
Ins
.
salmonArr
.
length
;
i
++
)
{
if
(
Ins
.
salmonArr
)
// if (Ins.salmonArr[i] && list[Ins.salmonArr[i].index])
Ins
.
salmonArr
[
i
].
setCnt
(
list
[
i
].
energy
);
// index = i;
}
},
100
)
}
}
...
...
@@ -635,12 +651,8 @@ export class MainScene extends Scene {
this
.
salmonFlag
[
index
]
=
false
;
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
let
salmonAnim
=
new
SalmonAnim
(
x
,
y
,
i
);
// salmonAnim.x = x-salmonAnim.width*0.5;
// salmonAnim.y = y-salmonAnim.height*0.7;
salmonAnim
.
setTween
(
100
,
1100
,
i
*
100
);
this
.
salmonGroup
.
addChild
(
salmonAnim
);
// let obj={t:0}
// FYGE.Tween.get(obj,{onChangeObj:obj,onChange:that.salmonMove}).wait(i*300).to({t:1},1000).call(()=>{this.salmonGroup.removeChild(salmonAnim)});
}
}
...
...
@@ -649,8 +661,6 @@ export class MainScene extends Scene {
console
.
log
(
"三文鱼运动"
,
this
,
salmonAnim
)
}
/**召回猫咪 */
recallCat
()
{
console
.
log
(
"找回猫咪,刷新用户信息,刷新出勤状态"
)
...
...
project/src/canvas/game/src/scenes/StartScene.ts
View file @
7d3a7955
...
...
@@ -23,7 +23,7 @@ export class StartScene extends Scene {
if
(
s
)
{
if
(
r
.
data
)
{
Ins
.
userInfo
=
r
.
data
;
/**判断猫咪是否出寝,只在用户进入游戏时判断,
后面要根据接口改写,现在先做测试
*/
/**判断猫咪是否出寝,只在用户进入游戏时判断,
使用接口判断
*/
that
.
judgeCatIsOutAChangeMainScene
();
}
else
{
sceneBg
.
visible
=
true
;
...
...
@@ -46,7 +46,7 @@ export class StartScene extends Scene {
console
.
log
(
"选择完猫咪"
,
r
)
Ins
.
showLoading
();
Ins
.
userInfo
=
r
.
data
.
data
;
/**判断猫咪是否出寝,只在用户进入游戏时判断,
后面要根据接口改写,现在先做测试
*/
/**判断猫咪是否出寝,只在用户进入游戏时判断,
使用接口判断
*/
this
.
judgeCatIsOutAChangeMainScene
();
}
...
...
taobao_mini/client/app.js
View file @
7d3a7955
import
cloud
from
'@tbmp/mp-cloud-sdk'
;
import
tbcc
from
'./tbcc-sdk'
;
const
env
=
'
online
'
// 云函数环境 test 测试环境 online 线上环境
const
env
=
'
test
'
// 云函数环境 test 测试环境 online 线上环境
cloud
.
init
({
env
:
env
});
...
...
@@ -9,7 +9,7 @@ cloud.init({
App
({
env
,
requestType
:
'cloud'
,
// yapi,cloud: 云函数
requestType
:
'local'
,
// yapi,cloud: 云函数
//
requestType: 'local', // yapi,cloud: 云函数
cloudName
:
'tmallCat'
,
// 主云函数项目名 tmallCat
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
cloud
,
...
...
@@ -29,8 +29,8 @@ App({
const
{
activityId
}
=
query
;
// this.activityId = activityId || '5f81841def5071b132fd5e21'; //赵然
// this.activityId = activityId || '5f8022919da671f3b6d5fb14'; //小婷1
this
.
activityId
=
activityId
||
'5f8d47218e6a0888fc426fad'
;
//小婷2zhengshi
//
this.activityId = activityId || '5f87e8a29897b4e0ce0ada02'; //ceshi
//
this.activityId = activityId || '5f8d47218e6a0888fc426fad'; //小婷2zhengshi
this
.
activityId
=
activityId
||
'5f87e8a29897b4e0ce0ada02'
;
//ceshi
}
...
...
taobao_mini/client/components/prizeModal/prizeModal.acss
View file @
7d3a7955
.my-prize-page {
width:
750rpx
;
height: 1
624rpx
;
width:
100vw
;
height: 1
00vh
;
opacity: 1;
position: absolute;
top: 0;
...
...
taobao_mini/client/pages/pagecanvas/output.js
View file @
7d3a7955
...
...
@@ -2049,19 +2049,19 @@ const resCanvasList = {
'69435791-11ee-4c7f-9036-c4c3e28e1750': {
name: '经验条背景',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png',
url: '
https:
//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png',
uuid: '69435791-11ee-4c7f-9036-c4c3e28e1750'
},
'6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572': {
name: '经验条图片',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png',
url: '
https:
//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png',
uuid: '6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572'
},
'5cc07d1e-00f8-4178-8112-44fda9c15481': {
name: 'bedroomguide3final',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png',
url: '
https:
//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png',
uuid: '5cc07d1e-00f8-4178-8112-44fda9c15481'
}
};
...
...
@@ -2199,6 +2199,7 @@ var MSG;
MSG["UPDATE_ENERGY"] = "UPDATE_ENERGY";
MSG["SALMON_ANIM"] = "SALMON_ANIM";
MSG["FISH_COINANIM"] = "FISH_COINANIM";
MSG["SETUI_ENERGY"] = "SETUI_ENERGY";
})(MSG = exports.MSG || (exports.MSG = {}));
var CATTYPE;
(function (CATTYPE) {
...
...
@@ -2254,10 +2255,18 @@ var Ins = (function () {
Main_1.GDispatcher.dispatchEvent({ type: "toast" }, msg);
};
Ins.showLoading = function () {
console.log("canvas请求加载loading");
Main_1.GDispatcher.dispatchEvent({ type: "loading" });
if (this.stage) {
this.stage.mouseEnable = this.stage.mouseChildren = false;
}
};
Ins.hideLoading = function () {
console.log("canvas请求隐藏loading");
Main_1.GDispatcher.dispatchEvent({ type: "hideloading" });
if (this.stage) {
this.stage.mouseEnable = this.stage.mouseChildren = true;
}
};
Ins.stopLottieAnim = function (lottie) {
FYGE.Tween.removeTweens(lottie);
...
...
@@ -2405,6 +2414,7 @@ var Main = (function () {
console.log("初始化层级完成");
Ins_1.Ins.stageW = this.stage.viewRect.width;
Ins_1.Ins.stageH = this.stage.viewRect.height;
Ins_1.Ins.stage = this.stage;
console.log("舞台宽高:", Ins_1.Ins.stageW, Ins_1.Ins.stageH);
return [4, RES_1.RES.loadSparkAssets(resloadingList_1.default)];
case 1:
...
...
@@ -3130,8 +3140,9 @@ var Salmon = (function (_super) {
id: that._id,
energy: that.salmonCnt
};
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.takeEnergy, {
params: params
}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.takeEnergy, {
id: that._id, energy: that.salmonCnt
}, function (s, r) {
if (s) {
that.mouseEnable = true;
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.UPDATE_ENERGY, { call: function () { that.getSalmonAnim(); } });
}
else {
...
...
@@ -3201,11 +3212,13 @@ var __extends = (this && this.__extends) || (function () {
Object.defineProperty(exports, "__esModule", { value: true });
exports.SalmonAnim = void 0;
var Module_1 = __webpack_require__(/*! ../../module/views/Module */ "./module/views/Module.ts");
var Enum_1 = __webpack_require__(/*! ../Enum */ "./src/Enum.ts");
var Ins_1 = __webpack_require__(/*! ../Ins */ "./src/Ins.ts");
var SalmonAnim = (function (_super) {
__extends(SalmonAnim, _super);
function SalmonAnim(x, y) {
function SalmonAnim(x, y
, index
) {
var _this = _super.call(this) || this;
_this.index = 0;
_this.t = 0;
_this.targetX = 0;
_this.targetY = 0;
...
...
@@ -3215,6 +3228,7 @@ var SalmonAnim = (function (_super) {
_this.y = y;
_this.originX = x;
_this.originY = y;
_this.index = index;
return _this;
}
SalmonAnim.prototype.initUi = function () {
...
...
@@ -3229,6 +3243,9 @@ var SalmonAnim = (function (_super) {
this.targetX = targetX;
this.targetY = targetY;
FYGE.Tween.get(this, { onChangeObj: this, onChange: this.move }).wait(waitTime).to({ t: 1 }, 800).call(function () {
if (_this.index == 0) {
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.SETUI_ENERGY);
}
if (_this && _this.parent) {
_this.parent.removeChild(_this);
}
...
...
@@ -47362,6 +47379,7 @@ var MainScene = (function (_super) {
var _this = _super.call(this, data) || this;
_this.bgUUID = [];
_this.maxEnergy = 1500;
_this.firstSetEnergy = true;
_this.level = 0;
_this.isShow = false;
_this.salmonArr = [];
...
...
@@ -47569,8 +47587,17 @@ var MainScene = (function (_super) {
var that = this;
that.energy = Ins_1.Ins.userInfo.energy;
that.maxEnergy = Ins_1.Ins.userInfo.energyMax;
FYGE.Tween.removeTweens(that.energyImg);
FYGE.Tween.removeTweens(that.energyDeco);
if (that.firstSetEnergy) {
that.firstSetEnergy = false;
that.energyImg.scaleX = (that.energy / that.maxEnergy);
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
}
else {
FYGE.Tween.get(that.energyImg).to({ scaleX: (that.energy / that.maxEnergy) }, 1000, FYGE.Ease.quadOut);
FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * (that.energy / that.maxEnergy) - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut);
}
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
console.log("设置精力组数据结束");
...
...
@@ -47580,7 +47607,7 @@ var MainScene = (function (_super) {
if (that.recoverEnergyHandler)
clearInterval(that.recoverEnergyHandler);
console.log("上一次恢复精力的时间", new Date(Ins_1.Ins.userInfo.lastEnergyTime).getMinutes());
var time =
new Date().getTime()
- Ins_1.Ins.userInfo.lastEnergyTime;
var time =
Ins_1.Ins.userInfo.updateTime
- Ins_1.Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Math.floor(time % 3600 / 60));
if (time <= Ins_1.Ins.recoverEnergy) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy - time;
...
...
@@ -47757,6 +47784,7 @@ var MainScene = (function (_super) {
}
that.isShow = false;
that.energyUp1();
that.updateEnergy();
}
that.setEnergy();
that.mainUi.updateUserInfo();
...
...
@@ -47774,7 +47802,6 @@ var MainScene = (function (_super) {
var energyList = r.data.energyList;
Ins_1.Ins.userInfo.energy = r.data.energy;
e && e.data.call && e.data.call();
that.setEnergy();
that.initSalmon(energyList);
Ins_1.Ins.hideLoading();
}
...
...
@@ -47787,9 +47814,6 @@ var MainScene = (function (_super) {
MainScene.prototype.initSalmon = function (list) {
var diffCnt = Math.abs(list.length - Ins_1.Ins.salmonArr.length);
if (list.length >= Ins_1.Ins.salmonArr.length) {
for (var i = 0; i < Ins_1.Ins.salmonArr.length; i++) {
Ins_1.Ins.salmonArr[i].setCnt(list[Ins_1.Ins.salmonArr[i].index].energy);
}
var flagIndex = 0;
var canSetIndexArr = [];
while (flagIndex < 8) {
...
...
@@ -47809,6 +47833,21 @@ var MainScene = (function (_super) {
Ins_1.Ins.salmonArr.push(salmon);
setIndex++;
}
for (var i = 1; i < this.salmonArr.length; i++) {
for (var j = 0; j < this.salmonArr.length - i; j++) {
if (this.salmonArr[i].index > this.salmonArr[i].index) {
var temp = this.salmonArr[j];
this.salmonArr[j] = this.salmonArr[j + 1];
this.salmonArr[j + 1] = temp;
}
}
}
setTimeout(function () {
for (var i = 0; i < Ins_1.Ins.salmonArr.length; i++) {
if (Ins_1.Ins.salmonArr)
Ins_1.Ins.salmonArr[i].setCnt(list[i].energy);
}
}, 100);
}
};
MainScene.prototype.salmonAnim = function (e) {
...
...
@@ -47819,7 +47858,7 @@ var MainScene = (function (_super) {
var index = e.data.index;
this.salmonFlag[index] = false;
for (var i = 0; i < 5; i++) {
var salmonAnim = new SalmonAnim_1.SalmonAnim(x, y);
var salmonAnim = new SalmonAnim_1.SalmonAnim(x, y
, i
);
salmonAnim.setTween(100, 1100, i * 100);
this.salmonGroup.addChild(salmonAnim);
}
...
...
@@ -47894,6 +47933,7 @@ var MainScene = (function (_super) {
that.letter && that.letter.addEventListener(FYGE.MouseEvent.CLICK, that.openLetter, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_ENERGY, function (data) { that.updateEnergy(data); }, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.SETUI_ENERGY, that.setEnergy, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.SALMON_ANIM, that.salmonAnim, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.FISH_COINANIM, that.coinAnim, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
...
...
@@ -47910,6 +47950,7 @@ var MainScene = (function (_super) {
that.letter && that.letter.removeEventListener(FYGE.MouseEvent.CLICK, that.openLetter, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_ENERGY, function (data) { that.updateEnergy(data); }, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.SETUI_ENERGY, that.setEnergy, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.SALMON_ANIM, that.salmonAnim, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.FISH_COINANIM, that.coinAnim, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
...
...
@@ -48212,12 +48253,17 @@ var MainSceneBtnUi = (function (_super) {
that.catExperienceBg.addChild(that.catExperience);
var mask = new FYGE.Shape();
mask.beginFill(6, 1);
mask.drawRoundedRect(
-4
, 0, that.catExperience.width, that.catExperience.height, 45, 45, 45, 45);
mask.drawRoundedRect(
0
, 0, that.catExperience.width, that.catExperience.height, 45, 45, 45, 45);
mask.endFill();
mask.x =
5
;
mask.x =
0
;
mask.y = 0;
that.catExperienceBg.addChild(mask);
that.catExperience.mask = mask;
var rect = new FYGE.Shape();
rect.beginStroke(4670787, 4);
rect.drawRoundedRect(2, 2, that.catExperienceBg.width - 4, that.catExperienceBg.height - 4, 45, 45, 45, 45);
rect.endStroke();
that.catExperienceBg.addChild(rect);
that.experience = Ins_1.Ins.initLabel({ size: 20 });
that.experience.position.set(174, 53);
that.experience.textWidth = 110;
...
...
@@ -48261,8 +48307,14 @@ var MainSceneBtnUi = (function (_super) {
that.catNameLabel.text = catName;
that.catLevelLabel.text = "Lv." + level;
that.fishPointLabel.text = "" + happyCoin;
that.catExperience.scaleX = experience / experienceMax;
that.experience.text = experience + "/" + experienceMax;
var percent = experience / experienceMax;
if (percent >= 1) {
that.catExperience.x = (experience / experienceMax - 1) * that.catExperience.width;
}
else {
that.catExperience.x = (experience / experienceMax - 1) * that.catExperience.width + 4;
}
};
MainSceneBtnUi.prototype.hideAllActBtn = function () {
var that = this;
taobao_mini/client/pages/pagecanvas/pagecanvas.js
View file @
7d3a7955
...
...
@@ -101,12 +101,12 @@ Page({
console
.
log
(
'on ready'
)
//授权和登录先搞
await
this
.
getAuth
();
setTimeout
(()
=>
{
my
.
navigateTo
({
url
:
`/pages/myprize/myprize
`
});
},
1000
)
//
await this.getAuth();
//
setTimeout(()=>{
//
my.navigateTo({
// url: `/pages/pageshop/pageshop
`
//
});
//
},1000)
// this.initCanvas();
my
.
__onMessage__
=
(
e
)
=>
{
this
.
onMessage
(
e
)
...
...
taobao_mini/client/pages/pageshop/pageshop.acss
View file @
7d3a7955
.shop-page {
width:
750rpx
;
height: 1
624rpx
;
width:
100vw
;
height: 1
00vh
;
opacity: 1;
position: absolute;
top: 0;
...
...
@@ -17,7 +17,7 @@
bottom: 0;
top: 464rpx;
padding-left: 54rpx;
right:0;
right:
0;
overflow-x: auto;
}
...
...
@@ -70,6 +70,7 @@
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_avatar {
width: 161rpx;
height: 161rpx;
...
...
@@ -135,12 +136,18 @@
.shop .shop_gold {
opacity: 1;
height: 54rpx;
left: 370rpx;
top: 32
6
rpx;
top: 32
0
rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 23.47394rpx;
color: #7b644e;
vertical-align: middle;
display: flex;
align-items: center;
justify-content: space-around;
flex-direction: column;
}
.shop .shop_backbtn {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment