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
d672b3bd
Commit
d672b3bd
authored
Sep 29, 2020
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1234
parent
68ca898c
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
24533 additions
and
47778 deletions
+24533
-47778
output.js
project/src/canvas/game/output.js
+56
-3
output.js.map
project/src/canvas/game/output.js.map
+1
-1
output.js
project/src/canvas/game/released/output.js
+56
-3
copyJs.js
project/src/canvas/game/scripts/copyJs.js
+1
-1
Ins.ts
project/src/canvas/game/src/Ins.ts
+2
-0
MainScene.ts
project/src/canvas/game/src/scenes/MainScene.ts
+66
-6
StartScene.ts
project/src/canvas/game/src/scenes/StartScene.ts
+2
-0
comcatrule.acss
taobao_mini/client/components/comcatrule/comcatrule.acss
+1
-1
comlevelup.acss
taobao_mini/client/components/comlevelup/comlevelup.acss
+17
-4
comlevelup.axml
taobao_mini/client/components/comlevelup/comlevelup.axml
+3
-1
output.js
taobao_mini/client/pages/pagecanvas/output.js
+56
-3
pagecanvas.js
taobao_mini/client/pages/pagecanvas/pagecanvas.js
+28
-2
pagecanvasoutput.js
taobao_mini/client/pages/pagecanvasoutput.js
+0
-47753
debug.log
taobao_mini/debug.log
+24244
-0
No files found.
project/src/canvas/game/output.js
View file @
d672b3bd
...
@@ -46905,6 +46905,7 @@ var MainScene = (function (_super) {
...
@@ -46905,6 +46905,7 @@ var MainScene = (function (_super) {
_this.bgUUID = [];
_this.bgUUID = [];
_this.maxEnergy = 1500;
_this.maxEnergy = 1500;
_this.level = 0;
_this.level = 0;
_this.isShow = false;
return _this;
return _this;
}
}
MainScene.prototype.initUi = function () {
MainScene.prototype.initUi = function () {
...
@@ -46943,7 +46944,7 @@ var MainScene = (function (_super) {
...
@@ -46943,7 +46944,7 @@ var MainScene = (function (_super) {
}
}
that.initCat();
that.initCat();
that.initEnergy();
that.initEnergy();
that.energyUp();
that.energyUp
1
();
};
};
MainScene.prototype.initCat = function () {
MainScene.prototype.initCat = function () {
var that = this;
var that = this;
...
@@ -47059,11 +47060,39 @@ var MainScene = (function (_super) {
...
@@ -47059,11 +47060,39 @@ var MainScene = (function (_super) {
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
};
};
MainScene.prototype.energyUp = function () {
MainScene.prototype.energyUp
1
= function () {
var that = this;
var that = this;
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;
console.log("相差的时间", Math.floor(time % 3600 / 60));
if (time <= Ins_1.Ins.recoverEnergy) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy - time;
}
that.recoverEnergyHandler = setInterval(function () {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
if (s) {
console.log("恢复精力时间:", new Date().getMinutes());
clearInterval(that.recoverEnergyHandler);
that.energyUp2();
that.getUserEnergy();
}
else {
Ins_1.Ins.showToast(r.message);
}
});
}, that.recoverEnergyTime);
};
MainScene.prototype.energyUp2 = function () {
var that = this;
if (that.recoverEnergyHandler)
clearInterval(that.recoverEnergyHandler);
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy;
that.recoverEnergyHandler = setInterval(function () {
that.recoverEnergyHandler = setInterval(function () {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
if (s) {
if (s) {
console.log("恢复精力时间2:", new Date().getMinutes());
that.getUserEnergy();
that.getUserEnergy();
}
}
else {
else {
...
@@ -47072,10 +47101,14 @@ var MainScene = (function (_super) {
...
@@ -47072,10 +47101,14 @@ var MainScene = (function (_super) {
});
});
}, Ins_1.Ins.recoverEnergy);
}, Ins_1.Ins.recoverEnergy);
};
};
MainScene.prototype.showPageEnergyUp = function () {
};
MainScene.prototype.getUserEnergy = function () {
MainScene.prototype.getUserEnergy = function () {
var that = this;
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserEnergy, {}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserEnergy, {}, function (s, r) {
if (s) {
if (s) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy;
console.log("设置恢复时间", that.recoverEnergyTime);
if (r.data != Ins_1.Ins.userInfo.energy) {
if (r.data != Ins_1.Ins.userInfo.energy) {
Ins_1.Ins.userInfo.energy = r.data;
Ins_1.Ins.userInfo.energy = r.data;
that.setEnergy();
that.setEnergy();
...
@@ -47083,7 +47116,9 @@ var MainScene = (function (_super) {
...
@@ -47083,7 +47116,9 @@ var MainScene = (function (_super) {
}
}
else {
else {
if (r.data != Ins_1.Ins.userInfo.energyMax) {
if (r.data != Ins_1.Ins.userInfo.energyMax) {
that.getUserEnergy();
setTimeout(function () {
that.getUserEnergy();
}, 500);
}
}
else {
else {
return;
return;
...
@@ -47150,6 +47185,10 @@ var MainScene = (function (_super) {
...
@@ -47150,6 +47185,10 @@ var MainScene = (function (_super) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserInfo, {}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserInfo, {}, function (s, r) {
if (s) {
if (s) {
Ins_1.Ins.userInfo = r.data;
Ins_1.Ins.userInfo = r.data;
if (that.isShow) {
that.isShow = false;
that.energyUp1();
}
that.setEnergy();
that.setEnergy();
that.mainUi.updateUserInfo();
that.mainUi.updateUserInfo();
}
}
...
@@ -47193,6 +47232,14 @@ var MainScene = (function (_super) {
...
@@ -47193,6 +47232,14 @@ var MainScene = (function (_super) {
}
}
});
});
};
};
MainScene.prototype.onShow = function () {
console.log("canvas页面显示,isShow设置为true");
this.isShow = true;
};
MainScene.prototype.onHide = function () {
console.log("canvas页面显示, isShow设置为false");
this.isShow = false;
};
MainScene.prototype.initEvents = function () {
MainScene.prototype.initEvents = function () {
var that = this;
var that = this;
console.log("主场景添加事件");
console.log("主场景添加事件");
...
@@ -47202,6 +47249,8 @@ var MainScene = (function (_super) {
...
@@ -47202,6 +47249,8 @@ var MainScene = (function (_super) {
FYGE.GDispatcher.addEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.addEventListener("onShow", that.onShow, that);
Main_1.GDispatcher.addEventListener("onHide", that.onHide, that);
};
};
MainScene.prototype.removeEvents = function () {
MainScene.prototype.removeEvents = function () {
var that = this;
var that = this;
...
@@ -47213,6 +47262,8 @@ var MainScene = (function (_super) {
...
@@ -47213,6 +47262,8 @@ var MainScene = (function (_super) {
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.addEventListener("onShow", that.onShow, that);
Main_1.GDispatcher.addEventListener("onHide", that.onHide, that);
};
};
return MainScene;
return MainScene;
}(Scene_1.Scene));
}(Scene_1.Scene));
...
@@ -47286,6 +47337,7 @@ var StartScene = (function (_super) {
...
@@ -47286,6 +47337,7 @@ var StartScene = (function (_super) {
};
};
StartScene.prototype.getCat = function (r) {
StartScene.prototype.getCat = function (r) {
console.log("选择完猫咪", r);
console.log("选择完猫咪", r);
Ins_1.Ins.showLoading();
Ins_1.Ins.userInfo = r.data.data;
Ins_1.Ins.userInfo = r.data.data;
this.judgeCatIsOutAChangeMainScene();
this.judgeCatIsOutAChangeMainScene();
};
};
...
@@ -47304,6 +47356,7 @@ var StartScene = (function (_super) {
...
@@ -47304,6 +47356,7 @@ var StartScene = (function (_super) {
ctrls_1.changeScene(MainScene_1.MainScene);
ctrls_1.changeScene(MainScene_1.MainScene);
}
}
else {
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
Ins_1.Ins.showToast(r.message);
}
}
});
});
project/src/canvas/game/output.js.map
View file @
d672b3bd
This diff is collapsed.
Click to expand it.
project/src/canvas/game/released/output.js
View file @
d672b3bd
...
@@ -46907,6 +46907,7 @@ var MainScene = (function (_super) {
...
@@ -46907,6 +46907,7 @@ var MainScene = (function (_super) {
_this.bgUUID = [];
_this.bgUUID = [];
_this.maxEnergy = 1500;
_this.maxEnergy = 1500;
_this.level = 0;
_this.level = 0;
_this.isShow = false;
return _this;
return _this;
}
}
MainScene.prototype.initUi = function () {
MainScene.prototype.initUi = function () {
...
@@ -46945,7 +46946,7 @@ var MainScene = (function (_super) {
...
@@ -46945,7 +46946,7 @@ var MainScene = (function (_super) {
}
}
that.initCat();
that.initCat();
that.initEnergy();
that.initEnergy();
that.energyUp();
that.energyUp
1
();
};
};
MainScene.prototype.initCat = function () {
MainScene.prototype.initCat = function () {
var that = this;
var that = this;
...
@@ -47061,11 +47062,39 @@ var MainScene = (function (_super) {
...
@@ -47061,11 +47062,39 @@ var MainScene = (function (_super) {
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
};
};
MainScene.prototype.energyUp = function () {
MainScene.prototype.energyUp
1
= function () {
var that = this;
var that = this;
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;
console.log("相差的时间", Math.floor(time % 3600 / 60));
if (time <= Ins_1.Ins.recoverEnergy) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy - time;
}
that.recoverEnergyHandler = setInterval(function () {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
if (s) {
console.log("恢复精力时间:", new Date().getMinutes());
clearInterval(that.recoverEnergyHandler);
that.energyUp2();
that.getUserEnergy();
}
else {
Ins_1.Ins.showToast(r.message);
}
});
}, that.recoverEnergyTime);
};
MainScene.prototype.energyUp2 = function () {
var that = this;
if (that.recoverEnergyHandler)
clearInterval(that.recoverEnergyHandler);
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy;
that.recoverEnergyHandler = setInterval(function () {
that.recoverEnergyHandler = setInterval(function () {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
if (s) {
if (s) {
console.log("恢复精力时间2:", new Date().getMinutes());
that.getUserEnergy();
that.getUserEnergy();
}
}
else {
else {
...
@@ -47074,10 +47103,14 @@ var MainScene = (function (_super) {
...
@@ -47074,10 +47103,14 @@ var MainScene = (function (_super) {
});
});
}, Ins_1.Ins.recoverEnergy);
}, Ins_1.Ins.recoverEnergy);
};
};
MainScene.prototype.showPageEnergyUp = function () {
};
MainScene.prototype.getUserEnergy = function () {
MainScene.prototype.getUserEnergy = function () {
var that = this;
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserEnergy, {}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserEnergy, {}, function (s, r) {
if (s) {
if (s) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy;
console.log("设置恢复时间", that.recoverEnergyTime);
if (r.data != Ins_1.Ins.userInfo.energy) {
if (r.data != Ins_1.Ins.userInfo.energy) {
Ins_1.Ins.userInfo.energy = r.data;
Ins_1.Ins.userInfo.energy = r.data;
that.setEnergy();
that.setEnergy();
...
@@ -47085,7 +47118,9 @@ var MainScene = (function (_super) {
...
@@ -47085,7 +47118,9 @@ var MainScene = (function (_super) {
}
}
else {
else {
if (r.data != Ins_1.Ins.userInfo.energyMax) {
if (r.data != Ins_1.Ins.userInfo.energyMax) {
that.getUserEnergy();
setTimeout(function () {
that.getUserEnergy();
}, 500);
}
}
else {
else {
return;
return;
...
@@ -47152,6 +47187,10 @@ var MainScene = (function (_super) {
...
@@ -47152,6 +47187,10 @@ var MainScene = (function (_super) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserInfo, {}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserInfo, {}, function (s, r) {
if (s) {
if (s) {
Ins_1.Ins.userInfo = r.data;
Ins_1.Ins.userInfo = r.data;
if (that.isShow) {
that.isShow = false;
that.energyUp1();
}
that.setEnergy();
that.setEnergy();
that.mainUi.updateUserInfo();
that.mainUi.updateUserInfo();
}
}
...
@@ -47195,6 +47234,14 @@ var MainScene = (function (_super) {
...
@@ -47195,6 +47234,14 @@ var MainScene = (function (_super) {
}
}
});
});
};
};
MainScene.prototype.onShow = function () {
console.log("canvas页面显示,isShow设置为true");
this.isShow = true;
};
MainScene.prototype.onHide = function () {
console.log("canvas页面显示, isShow设置为false");
this.isShow = false;
};
MainScene.prototype.initEvents = function () {
MainScene.prototype.initEvents = function () {
var that = this;
var that = this;
console.log("主场景添加事件");
console.log("主场景添加事件");
...
@@ -47204,6 +47251,8 @@ var MainScene = (function (_super) {
...
@@ -47204,6 +47251,8 @@ var MainScene = (function (_super) {
FYGE.GDispatcher.addEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.addEventListener("onShow", that.onShow, that);
Main_1.GDispatcher.addEventListener("onHide", that.onHide, that);
};
};
MainScene.prototype.removeEvents = function () {
MainScene.prototype.removeEvents = function () {
var that = this;
var that = this;
...
@@ -47215,6 +47264,8 @@ var MainScene = (function (_super) {
...
@@ -47215,6 +47264,8 @@ var MainScene = (function (_super) {
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.addEventListener("onShow", that.onShow, that);
Main_1.GDispatcher.addEventListener("onHide", that.onHide, that);
};
};
return MainScene;
return MainScene;
}(Scene_1.Scene));
}(Scene_1.Scene));
...
@@ -47288,6 +47339,7 @@ var StartScene = (function (_super) {
...
@@ -47288,6 +47339,7 @@ var StartScene = (function (_super) {
};
};
StartScene.prototype.getCat = function (r) {
StartScene.prototype.getCat = function (r) {
console.log("选择完猫咪", r);
console.log("选择完猫咪", r);
Ins_1.Ins.showLoading();
Ins_1.Ins.userInfo = r.data.data;
Ins_1.Ins.userInfo = r.data.data;
this.judgeCatIsOutAChangeMainScene();
this.judgeCatIsOutAChangeMainScene();
};
};
...
@@ -47306,6 +47358,7 @@ var StartScene = (function (_super) {
...
@@ -47306,6 +47358,7 @@ var StartScene = (function (_super) {
ctrls_1.changeScene(MainScene_1.MainScene);
ctrls_1.changeScene(MainScene_1.MainScene);
}
}
else {
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
Ins_1.Ins.showToast(r.message);
}
}
});
});
project/src/canvas/game/scripts/copyJs.js
View file @
d672b3bd
...
@@ -7,7 +7,7 @@ var fs = require("fs");
...
@@ -7,7 +7,7 @@ var fs = require("fs");
// )
// )
// var endPath = 'D:/duibaGame/测试项目0527/taobaominiTest/client/pages/index1/';
// var endPath = 'D:/duibaGame/测试项目0527/taobaominiTest/client/pages/index1/';
// var endPath = '/Users/wanghongyuan/new_taobao/taobao_mini/client/pages/pagecanvas/';
// var endPath = '/Users/wanghongyuan/new_taobao/taobao_mini/client/pages/pagecanvas/';
var
endPath
=
'D:/taobaoProject/tmyangcheng/new_taobao/taobao_mini/client/pages/pagecanvas'
;
var
endPath
=
'D:/taobaoProject/tmyangcheng/new_taobao/taobao_mini/client/pages/pagecanvas
/
'
;
var
version
=
Math
.
round
(
new
Date
().
getTime
()
/
1000
);
var
version
=
Math
.
round
(
new
Date
().
getTime
()
/
1000
);
// fs.writeFileSync(endPath + "output." + version + ".js", fs.readFileSync("./released/output.js"));
// fs.writeFileSync(endPath + "output." + version + ".js", fs.readFileSync("./released/output.js"));
...
...
project/src/canvas/game/src/Ins.ts
View file @
d672b3bd
...
@@ -20,6 +20,8 @@ export class Ins {
...
@@ -20,6 +20,8 @@ export class Ins {
/**多长时间恢复精力(ms) */
/**多长时间恢复精力(ms) */
public
static
recoverEnergy
:
number
=
5
*
60
*
1000
;
public
static
recoverEnergy
:
number
=
5
*
60
*
1000
;
// /**最长时间恢复精力 */
public
static
userInfo
:
{
public
static
userInfo
:
{
"catName"
:
string
,
//猫咪姓名
"catName"
:
string
,
//猫咪姓名
"catType"
:
number
,
//猫咪类型
"catType"
:
number
,
//猫咪类型
...
...
project/src/canvas/game/src/scenes/MainScene.ts
View file @
d672b3bd
...
@@ -49,7 +49,11 @@ export class MainScene extends Scene {
...
@@ -49,7 +49,11 @@ export class MainScene extends Scene {
/**场景引导 */
/**场景引导 */
private
Guide
:
Guide
;
private
Guide
:
Guide
;
/**是否是重新进入游戏场景 */
/**恢复精力的时间 */
private
recoverEnergyTime
:
number
;
/**页面是否显示 */
private
isShow
:
boolean
=
false
;
initUi
()
{
initUi
()
{
var
that
=
this
;
var
that
=
this
;
...
@@ -96,7 +100,7 @@ export class MainScene extends Scene {
...
@@ -96,7 +100,7 @@ export class MainScene extends Scene {
that
.
initCat
();
that
.
initCat
();
that
.
initEnergy
();
that
.
initEnergy
();
that
.
energyUp
();
that
.
energyUp
1
();
// that.initGuide(Ins.curScene > 3 ? 3 : Ins.curScene);
// that.initGuide(Ins.curScene > 3 ? 3 : Ins.curScene);
}
}
...
@@ -235,12 +239,39 @@ export class MainScene extends Scene {
...
@@ -235,12 +239,39 @@ export class MainScene extends Scene {
that
.
energyLabel
.
x
=
(
that
.
energyGroup
.
width
-
that
.
energyLabel
.
textWidth
)
/
2
that
.
energyLabel
.
x
=
(
that
.
energyGroup
.
width
-
that
.
energyLabel
.
textWidth
)
/
2
}
}
/**按照时间恢复精力 */
/**按照
首次登录
时间恢复精力 */
energyUp
()
{
energyUp
1
()
{
var
that
=
this
;
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
))
if
(
time
<=
Ins
.
recoverEnergy
){
that
.
recoverEnergyTime
=
Ins
.
recoverEnergy
-
time
;
}
that
.
recoverEnergyHandler
=
setInterval
(()
=>
{
that
.
recoverEnergyHandler
=
setInterval
(()
=>
{
sendTbNet
(
TbNetName
.
recoverEnergy
,
{},
(
s
,
r
)
=>
{
sendTbNet
(
TbNetName
.
recoverEnergy
,
{},
(
s
,
r
)
=>
{
if
(
s
)
{
if
(
s
)
{
console
.
log
(
"恢复精力时间:"
,
new
Date
().
getMinutes
())
clearInterval
(
that
.
recoverEnergyHandler
);
that
.
energyUp2
();
that
.
getUserEnergy
();
}
else
{
Ins
.
showToast
(
r
.
message
);
}
});
},
that
.
recoverEnergyTime
)
}
/**按照固定时间恢复精力 */
energyUp2
(){
var
that
=
this
;
if
(
that
.
recoverEnergyHandler
)
clearInterval
(
that
.
recoverEnergyHandler
);
that
.
recoverEnergyTime
=
Ins
.
recoverEnergy
;
that
.
recoverEnergyHandler
=
setInterval
(()
=>
{
sendTbNet
(
TbNetName
.
recoverEnergy
,
{},
(
s
,
r
)
=>
{
if
(
s
)
{
console
.
log
(
"恢复精力时间2:"
,
new
Date
().
getMinutes
())
that
.
getUserEnergy
();
that
.
getUserEnergy
();
}
else
{
}
else
{
Ins
.
showToast
(
r
.
message
);
Ins
.
showToast
(
r
.
message
);
...
@@ -249,18 +280,29 @@ export class MainScene extends Scene {
...
@@ -249,18 +280,29 @@ export class MainScene extends Scene {
},
Ins
.
recoverEnergy
)
},
Ins
.
recoverEnergy
)
}
}
/**显示页面时重新计算时间恢复精力 */
showPageEnergyUp
(){
}
/**时间到的时候拿取精力值 */
/**时间到的时候拿取精力值 */
getUserEnergy
()
{
getUserEnergy
()
{
var
that
=
this
;
var
that
=
this
;
sendTbNet
(
TbNetName
.
getUserEnergy
,
{},
(
s
,
r
)
=>
{
sendTbNet
(
TbNetName
.
getUserEnergy
,
{},
(
s
,
r
)
=>
{
if
(
s
)
{
if
(
s
)
{
that
.
recoverEnergyTime
=
Ins
.
recoverEnergy
;
console
.
log
(
"设置恢复时间"
,
that
.
recoverEnergyTime
)
if
(
r
.
data
!=
Ins
.
userInfo
.
energy
)
{
if
(
r
.
data
!=
Ins
.
userInfo
.
energy
)
{
Ins
.
userInfo
.
energy
=
r
.
data
;
Ins
.
userInfo
.
energy
=
r
.
data
;
// that.recoverEnergyTime = Ins.recoverEnergy;
// console.log("设置恢复时间",that.recoverEnergyTime)
that
.
setEnergy
();
that
.
setEnergy
();
return
;
return
;
}
else
{
}
else
{
if
(
r
.
data
!=
Ins
.
userInfo
.
energyMax
)
{
if
(
r
.
data
!=
Ins
.
userInfo
.
energyMax
)
{
that
.
getUserEnergy
();
setTimeout
(()
=>
{
that
.
getUserEnergy
();
},
500
)
}
}
else
{
else
{
return
;
return
;
...
@@ -332,9 +374,12 @@ export class MainScene extends Scene {
...
@@ -332,9 +374,12 @@ export class MainScene extends Scene {
sendTbNet
(
TbNetName
.
getUserInfo
,
{},
(
s
,
r
)
=>
{
sendTbNet
(
TbNetName
.
getUserInfo
,
{},
(
s
,
r
)
=>
{
if
(
s
)
{
if
(
s
)
{
Ins
.
userInfo
=
r
.
data
;
Ins
.
userInfo
=
r
.
data
;
if
(
that
.
isShow
){
that
.
isShow
=
false
;
that
.
energyUp1
();
}
that
.
setEnergy
();
that
.
setEnergy
();
that
.
mainUi
.
updateUserInfo
();
that
.
mainUi
.
updateUserInfo
();
}
else
{
}
else
{
Ins
.
showToast
(
r
.
message
)
Ins
.
showToast
(
r
.
message
)
}
}
...
@@ -376,6 +421,17 @@ export class MainScene extends Scene {
...
@@ -376,6 +421,17 @@ export class MainScene extends Scene {
})
})
}
}
/**页面显示 */
onShow
(){
console
.
log
(
"canvas页面显示,isShow设置为true"
)
this
.
isShow
=
true
;
}
/**页面隐藏 */
onHide
(){
console
.
log
(
"canvas页面显示, isShow设置为false"
)
this
.
isShow
=
false
;
}
initEvents
()
{
initEvents
()
{
var
that
=
this
;
var
that
=
this
;
...
@@ -386,6 +442,8 @@ export class MainScene extends Scene {
...
@@ -386,6 +442,8 @@ export class MainScene extends Scene {
FYGE
.
GDispatcher
.
addEventListener
(
MSG
.
CHANGE_SCENE
,
()
=>
{
that
.
changeMainScene
(
SCENETYPE
.
BEADROOM
)
},
that
);
FYGE
.
GDispatcher
.
addEventListener
(
MSG
.
CHANGE_SCENE
,
()
=>
{
that
.
changeMainScene
(
SCENETYPE
.
BEADROOM
)
},
that
);
GDispatcher
.
addEventListener
(
MSG
.
UPDATE_USERINFO
,
that
.
updateUserInfo
,
that
);
GDispatcher
.
addEventListener
(
MSG
.
UPDATE_USERINFO
,
that
.
updateUserInfo
,
that
);
GDispatcher
.
addEventListener
(
MSG
.
RECALL_CAT
,
that
.
recallCat
,
that
);
GDispatcher
.
addEventListener
(
MSG
.
RECALL_CAT
,
that
.
recallCat
,
that
);
GDispatcher
.
addEventListener
(
"onShow"
,
that
.
onShow
,
that
);
GDispatcher
.
addEventListener
(
"onHide"
,
that
.
onHide
,
that
);
}
}
removeEvents
()
{
removeEvents
()
{
...
@@ -398,5 +456,7 @@ export class MainScene extends Scene {
...
@@ -398,5 +456,7 @@ export class MainScene extends Scene {
FYGE
.
GDispatcher
.
removeEventListener
(
MSG
.
CHANGE_SCENE
,
()
=>
{
that
.
changeMainScene
(
SCENETYPE
.
BEADROOM
)
},
that
);
FYGE
.
GDispatcher
.
removeEventListener
(
MSG
.
CHANGE_SCENE
,
()
=>
{
that
.
changeMainScene
(
SCENETYPE
.
BEADROOM
)
},
that
);
GDispatcher
.
removeEventListener
(
MSG
.
UPDATE_USERINFO
,
that
.
updateUserInfo
,
that
);
GDispatcher
.
removeEventListener
(
MSG
.
UPDATE_USERINFO
,
that
.
updateUserInfo
,
that
);
GDispatcher
.
removeEventListener
(
MSG
.
RECALL_CAT
,
that
.
recallCat
,
that
);
GDispatcher
.
removeEventListener
(
MSG
.
RECALL_CAT
,
that
.
recallCat
,
that
);
GDispatcher
.
addEventListener
(
"onShow"
,
that
.
onShow
,
that
);
GDispatcher
.
addEventListener
(
"onHide"
,
that
.
onHide
,
that
);
}
}
}
}
\ No newline at end of file
project/src/canvas/game/src/scenes/StartScene.ts
View file @
d672b3bd
...
@@ -44,6 +44,7 @@ export class StartScene extends Scene {
...
@@ -44,6 +44,7 @@ export class StartScene extends Scene {
/**领养完毕猫咪 */
/**领养完毕猫咪 */
getCat
(
r
)
{
getCat
(
r
)
{
console
.
log
(
"选择完猫咪"
,
r
)
console
.
log
(
"选择完猫咪"
,
r
)
Ins
.
showLoading
();
Ins
.
userInfo
=
r
.
data
.
data
;
Ins
.
userInfo
=
r
.
data
.
data
;
/**判断猫咪是否出寝,只在用户进入游戏时判断,后面要根据接口改写,现在先做测试 */
/**判断猫咪是否出寝,只在用户进入游戏时判断,后面要根据接口改写,现在先做测试 */
this
.
judgeCatIsOutAChangeMainScene
();
this
.
judgeCatIsOutAChangeMainScene
();
...
@@ -63,6 +64,7 @@ export class StartScene extends Scene {
...
@@ -63,6 +64,7 @@ export class StartScene extends Scene {
Ins
.
hideLoading
();
Ins
.
hideLoading
();
changeScene
(
MainScene
)
changeScene
(
MainScene
)
}
else
{
}
else
{
Ins
.
hideLoading
();
Ins
.
showToast
(
r
.
message
);
Ins
.
showToast
(
r
.
message
);
}
}
})
})
...
...
taobao_mini/client/components/comcatrule/comcatrule.acss
View file @
d672b3bd
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
height: 559rpx;
height: 559rpx;
opacity: 1;
opacity: 1;
left: 18rpx;
left: 18rpx;
top:
39
2rpx;
top:
44
2rpx;
position: absolute;
position: absolute;
transform-origin: 50% 50% 0rpx;
transform-origin: 50% 50% 0rpx;
display: block;
display: block;
...
...
taobao_mini/client/components/comlevelup/comlevelup.acss
View file @
d672b3bd
...
@@ -96,14 +96,27 @@
...
@@ -96,14 +96,27 @@
transform-origin: 0rpx 0rpx 0rpx;
transform-origin: 0rpx 0rpx 0rpx;
}
}
.levelup .levelup_prizeView {
width: 353rpx;
height: 293rpx;
opacity: 1;
left: 201rpx;
top: 380rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
overflow: hidden;
/* border: 3rpx solid black; */
border-radius: 10rpx;
}
.levelup .levelup_prizeImg {
.levelup .levelup_prizeImg {
width: 3
49
rpx;
width: 3
60
rpx;
height: 2
88
rpx;
height: 2
99
rpx;
opacity: 1;
opacity: 1;
left: 203rpx;
top: 382rpx;
position: absolute;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
transform-origin: 0rpx 0rpx 0rpx;
left: -3rpx;
top: -3rpx;
}
}
.levelup .levelup_btn {
.levelup .levelup_btn {
...
...
taobao_mini/client/components/comlevelup/comlevelup.axml
View file @
d672b3bd
...
@@ -7,7 +7,9 @@
...
@@ -7,7 +7,9 @@
<label class="levelup_txt ">{{levelupTxt}}</label>
<label class="levelup_txt ">{{levelupTxt}}</label>
<image class="levelup_title " src={{resList['69bff61a-b5a6-4979-ba8d-9e008aed737a'].url}} />
<image class="levelup_title " src={{resList['69bff61a-b5a6-4979-ba8d-9e008aed737a'].url}} />
<image class="levelup_imgbg " src={{resList['f56872e2-5e79-4906-99a2-576231f153af'].url}} />
<image class="levelup_imgbg " src={{resList['f56872e2-5e79-4906-99a2-576231f153af'].url}} />
<image class="levelup_prizeImg" src="{{prizeImg}}"/>>
<view class="levelup_prizeView">
<image class="levelup_prizeImg" src="{{prizeImg}}"/>>
</view>
<image class="levelup_btn btn" onTap="onBtnClick" src={{resList['95520b55-9655-4988-a833-3907978dbffb'].url}} />
<image class="levelup_btn btn" onTap="onBtnClick" src={{resList['95520b55-9655-4988-a833-3907978dbffb'].url}} />
<image class="levelup_closebtn " onTap="onModalClose" src={{resList['d33bbf87-ed39-4959-8673-02a4c31dca77'].url}} />
<image class="levelup_closebtn " onTap="onModalClose" src={{resList['d33bbf87-ed39-4959-8673-02a4c31dca77'].url}} />
</view>
</view>
...
...
taobao_mini/client/pages/pagecanvas/output.js
View file @
d672b3bd
...
@@ -46907,6 +46907,7 @@ var MainScene = (function (_super) {
...
@@ -46907,6 +46907,7 @@ var MainScene = (function (_super) {
_this.bgUUID = [];
_this.bgUUID = [];
_this.maxEnergy = 1500;
_this.maxEnergy = 1500;
_this.level = 0;
_this.level = 0;
_this.isShow = false;
return _this;
return _this;
}
}
MainScene.prototype.initUi = function () {
MainScene.prototype.initUi = function () {
...
@@ -46945,7 +46946,7 @@ var MainScene = (function (_super) {
...
@@ -46945,7 +46946,7 @@ var MainScene = (function (_super) {
}
}
that.initCat();
that.initCat();
that.initEnergy();
that.initEnergy();
that.energyUp();
that.energyUp
1
();
};
};
MainScene.prototype.initCat = function () {
MainScene.prototype.initCat = function () {
var that = this;
var that = this;
...
@@ -47061,11 +47062,39 @@ var MainScene = (function (_super) {
...
@@ -47061,11 +47062,39 @@ var MainScene = (function (_super) {
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
};
};
MainScene.prototype.energyUp = function () {
MainScene.prototype.energyUp
1
= function () {
var that = this;
var that = this;
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;
console.log("相差的时间", Math.floor(time % 3600 / 60));
if (time <= Ins_1.Ins.recoverEnergy) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy - time;
}
that.recoverEnergyHandler = setInterval(function () {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
if (s) {
console.log("恢复精力时间:", new Date().getMinutes());
clearInterval(that.recoverEnergyHandler);
that.energyUp2();
that.getUserEnergy();
}
else {
Ins_1.Ins.showToast(r.message);
}
});
}, that.recoverEnergyTime);
};
MainScene.prototype.energyUp2 = function () {
var that = this;
if (that.recoverEnergyHandler)
clearInterval(that.recoverEnergyHandler);
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy;
that.recoverEnergyHandler = setInterval(function () {
that.recoverEnergyHandler = setInterval(function () {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recoverEnergy, {}, function (s, r) {
if (s) {
if (s) {
console.log("恢复精力时间2:", new Date().getMinutes());
that.getUserEnergy();
that.getUserEnergy();
}
}
else {
else {
...
@@ -47074,10 +47103,14 @@ var MainScene = (function (_super) {
...
@@ -47074,10 +47103,14 @@ var MainScene = (function (_super) {
});
});
}, Ins_1.Ins.recoverEnergy);
}, Ins_1.Ins.recoverEnergy);
};
};
MainScene.prototype.showPageEnergyUp = function () {
};
MainScene.prototype.getUserEnergy = function () {
MainScene.prototype.getUserEnergy = function () {
var that = this;
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserEnergy, {}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserEnergy, {}, function (s, r) {
if (s) {
if (s) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy;
console.log("设置恢复时间", that.recoverEnergyTime);
if (r.data != Ins_1.Ins.userInfo.energy) {
if (r.data != Ins_1.Ins.userInfo.energy) {
Ins_1.Ins.userInfo.energy = r.data;
Ins_1.Ins.userInfo.energy = r.data;
that.setEnergy();
that.setEnergy();
...
@@ -47085,7 +47118,9 @@ var MainScene = (function (_super) {
...
@@ -47085,7 +47118,9 @@ var MainScene = (function (_super) {
}
}
else {
else {
if (r.data != Ins_1.Ins.userInfo.energyMax) {
if (r.data != Ins_1.Ins.userInfo.energyMax) {
that.getUserEnergy();
setTimeout(function () {
that.getUserEnergy();
}, 500);
}
}
else {
else {
return;
return;
...
@@ -47152,6 +47187,10 @@ var MainScene = (function (_super) {
...
@@ -47152,6 +47187,10 @@ var MainScene = (function (_super) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserInfo, {}, function (s, r) {
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserInfo, {}, function (s, r) {
if (s) {
if (s) {
Ins_1.Ins.userInfo = r.data;
Ins_1.Ins.userInfo = r.data;
if (that.isShow) {
that.isShow = false;
that.energyUp1();
}
that.setEnergy();
that.setEnergy();
that.mainUi.updateUserInfo();
that.mainUi.updateUserInfo();
}
}
...
@@ -47195,6 +47234,14 @@ var MainScene = (function (_super) {
...
@@ -47195,6 +47234,14 @@ var MainScene = (function (_super) {
}
}
});
});
};
};
MainScene.prototype.onShow = function () {
console.log("canvas页面显示,isShow设置为true");
this.isShow = true;
};
MainScene.prototype.onHide = function () {
console.log("canvas页面显示, isShow设置为false");
this.isShow = false;
};
MainScene.prototype.initEvents = function () {
MainScene.prototype.initEvents = function () {
var that = this;
var that = this;
console.log("主场景添加事件");
console.log("主场景添加事件");
...
@@ -47204,6 +47251,8 @@ var MainScene = (function (_super) {
...
@@ -47204,6 +47251,8 @@ var MainScene = (function (_super) {
FYGE.GDispatcher.addEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.addEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.addEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.addEventListener("onShow", that.onShow, that);
Main_1.GDispatcher.addEventListener("onHide", that.onHide, that);
};
};
MainScene.prototype.removeEvents = function () {
MainScene.prototype.removeEvents = function () {
var that = this;
var that = this;
...
@@ -47215,6 +47264,8 @@ var MainScene = (function (_super) {
...
@@ -47215,6 +47264,8 @@ var MainScene = (function (_super) {
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
FYGE.GDispatcher.removeEventListener(Enum_1.MSG.CHANGE_SCENE, function () { that.changeMainScene(Enum_1.SCENETYPE.BEADROOM); }, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.UPDATE_USERINFO, that.updateUserInfo, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.removeEventListener(Enum_1.MSG.RECALL_CAT, that.recallCat, that);
Main_1.GDispatcher.addEventListener("onShow", that.onShow, that);
Main_1.GDispatcher.addEventListener("onHide", that.onHide, that);
};
};
return MainScene;
return MainScene;
}(Scene_1.Scene));
}(Scene_1.Scene));
...
@@ -47288,6 +47339,7 @@ var StartScene = (function (_super) {
...
@@ -47288,6 +47339,7 @@ var StartScene = (function (_super) {
};
};
StartScene.prototype.getCat = function (r) {
StartScene.prototype.getCat = function (r) {
console.log("选择完猫咪", r);
console.log("选择完猫咪", r);
Ins_1.Ins.showLoading();
Ins_1.Ins.userInfo = r.data.data;
Ins_1.Ins.userInfo = r.data.data;
this.judgeCatIsOutAChangeMainScene();
this.judgeCatIsOutAChangeMainScene();
};
};
...
@@ -47306,6 +47358,7 @@ var StartScene = (function (_super) {
...
@@ -47306,6 +47358,7 @@ var StartScene = (function (_super) {
ctrls_1.changeScene(MainScene_1.MainScene);
ctrls_1.changeScene(MainScene_1.MainScene);
}
}
else {
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
Ins_1.Ins.showToast(r.message);
}
}
});
});
taobao_mini/client/pages/pagecanvas/pagecanvas.js
View file @
d672b3bd
...
@@ -95,7 +95,7 @@ Page({
...
@@ -95,7 +95,7 @@ Page({
console
.
log
(
'on ready'
)
console
.
log
(
'on ready'
)
//授权和登录先搞
//授权和登录先搞
//
await this.getAuth();
await
this
.
getAuth
();
// this.initCanvas();
// this.initCanvas();
my
.
__onMessage__
=
(
e
)
=>
{
my
.
__onMessage__
=
(
e
)
=>
{
this
.
onMessage
(
e
)
this
.
onMessage
(
e
)
...
@@ -188,6 +188,9 @@ Page({
...
@@ -188,6 +188,9 @@ Page({
onCanvasReady
(
query
)
{
onCanvasReady
(
query
)
{
console
.
log
(
'onCanvasReady'
,
query
)
console
.
log
(
'onCanvasReady'
,
query
)
setInterval
(()
=>
{
console
.
log
(
"测试测试测试"
)
},
2000
)
//授权和登录先搞
//授权和登录先搞
checkSystem
().
then
(
r
=>
{
checkSystem
().
then
(
r
=>
{
if
(
r
)
{
if
(
r
)
{
...
@@ -298,9 +301,10 @@ Page({
...
@@ -298,9 +301,10 @@ Page({
onShow
()
{
onShow
()
{
// 页面显示
// 页面显示
if
(
this
.
main
)
{
if
(
this
.
main
)
{
console
.
log
(
"界面显示"
)
this
.
main
.
run
();
this
.
main
.
run
();
this
.
main
.
dispatchGlobalEvent
(
"onShow"
);
this
.
main
.
dispatchGlobalEvent
(
"onShow"
);
my
.
__updateUserInfo__
();
this
.
showPageLogin
();
}
}
},
},
...
@@ -309,6 +313,7 @@ Page({
...
@@ -309,6 +313,7 @@ Page({
if
(
this
.
main
)
{
if
(
this
.
main
)
{
this
.
main
.
pause
();
this
.
main
.
pause
();
this
.
main
.
dispatchGlobalEvent
(
"onHide"
);
this
.
main
.
dispatchGlobalEvent
(
"onHide"
);
console
.
log
(
"主页面隐藏"
)
}
}
},
},
...
@@ -376,6 +381,27 @@ Page({
...
@@ -376,6 +381,27 @@ Page({
this
.
initCanvas
();
this
.
initCanvas
();
}
}
},
},
/**页面显示登录 */
async
showPageLogin
()
{
const
{
nickName
,
avatar
}
=
app
;
const
{
success
,
data
,
}
=
await
API
.
login
({
userNick
:
nickName
,
avatar
}).
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
})
||
{};
if
(
success
)
{
app
.
openId
=
data
.
openId
;
my
.
__updateUserInfo__
();
}
},
/**刷新用户信息 */
/**刷新用户信息 */
updateUserInfo
()
{
updateUserInfo
()
{
console
.
log
(
"通知canvas刷新用户信息"
)
console
.
log
(
"通知canvas刷新用户信息"
)
...
...
taobao_mini/client/pages/pagecanvasoutput.js
deleted
100644 → 0
View file @
68ca898c
This diff is collapsed.
Click to expand it.
taobao_mini/debug.log
View file @
d672b3bd
This diff is collapsed.
Click to expand it.
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