Commit 0352d7fa authored by wildfirecode's avatar wildfirecode

1

parent ed56a29d
...@@ -31,7 +31,6 @@ Page({ ...@@ -31,7 +31,6 @@ Page({
}, },
createMain() { createMain() {
console.warn('do my.createCanvas')
var self = this; var self = this;
my.createCanvas({ my.createCanvas({
id: 'canvas', id: 'canvas',
...@@ -41,13 +40,9 @@ Page({ ...@@ -41,13 +40,9 @@ Page({
const windowHeight = my.getSystemInfoSync().windowHeight; const windowHeight = my.getSystemInfoSync().windowHeight;
ccc.width = windowWidth * dpr + dpr; //重新修改会有误差 ccc.width = windowWidth * dpr + dpr; //重新修改会有误差
ccc.height = windowHeight * dpr + dpr; ccc.height = windowHeight * dpr + dpr;
console.warn('my.createCanvas on success')
console.log(ccc.width, ccc.height) console.log(ccc.width, ccc.height)
console.log(!!this.main)
if (!this.main) { if (!this.main) {
this.main = new Main(ccc); this.main = new Main(ccc);
console.log(GDispatcher)
//添加事件,为了和main里的通信 //添加事件,为了和main里的通信
this.main.addGlobalEvent("onMessage", self.onMessage, self) this.main.addGlobalEvent("onMessage", self.onMessage, self)
} }
...@@ -167,11 +162,7 @@ Page({ ...@@ -167,11 +162,7 @@ Page({
}, },
//和main通信的方法,接收main的信息 //和main通信的方法,接收main的信息
onMessage(e) { onMessage(e) {
console.log(9999999)
console.log(e) console.log(e)
//接口名字 //接口名字
let netName = e.data.netName; let netName = e.data.netName;
//接口参数 //接口参数
...@@ -200,7 +191,7 @@ Page({ ...@@ -200,7 +191,7 @@ Page({
activityId: app.activityId, //|| "5e7c40e98564b57d7fb95812", activityId: app.activityId, //|| "5e7c40e98564b57d7fb95812",
nickName: app.nickName, nickName: app.nickName,
avatar: app.avatar, avatar: app.avatar,
openId: app.openId, inviteId: app.inviteId,
isFocusShop: app.isFollow || false, isFocusShop: app.isFollow || false,
shareCode: this.shareCode, //判断是否要发助力用 shareCode: this.shareCode, //判断是否要发助力用
} }
...@@ -236,7 +227,8 @@ Page({ ...@@ -236,7 +227,8 @@ Page({
} else { } else {
//获取后端接口 //获取后端接口
const { function: fc } = app.cloud const { function: fc } = app.cloud
//待写, console.log('app.cloudName, parameter, netName.spilt(".")[1]', app.cloudName, parameter, netName.spilt(".")[1])
fc.invoke(app.cloudName, parameter, netName.spilt(".")[1]) fc.invoke(app.cloudName, parameter, netName.spilt(".")[1])
.then(res => { .then(res => {
// console.log("返回数据" + JSON.stringify(res)); // console.log("返回数据" + JSON.stringify(res));
...@@ -247,7 +239,6 @@ Page({ ...@@ -247,7 +239,6 @@ Page({
} }
}, },
postMessage(netName, data) { postMessage(netName, data) {
console.warn('postMessage(netName, data) {', netName, data)
// this.main.dispatchGlobalEvent(netName, data) // this.main.dispatchGlobalEvent(netName, data)
this.main.dispatchGlobalEvent({ type: netName }, data) //以防复用事件event串了,就用这种方式 this.main.dispatchGlobalEvent({ type: netName }, data) //以防复用事件event串了,就用这种方式
}, },
......
...@@ -1256,6 +1256,7 @@ var MConst_1 = __webpack_require__(/*! ./Global/MConst */ "./src/Global/MConst.t ...@@ -1256,6 +1256,7 @@ var MConst_1 = __webpack_require__(/*! ./Global/MConst */ "./src/Global/MConst.t
var ResJson_1 = __webpack_require__(/*! ./ResJson */ "./src/ResJson.ts"); var ResJson_1 = __webpack_require__(/*! ./ResJson */ "./src/ResJson.ts");
var LoadingScene_1 = __webpack_require__(/*! ./scenes/LoadingScene */ "./src/scenes/LoadingScene.ts"); var LoadingScene_1 = __webpack_require__(/*! ./scenes/LoadingScene */ "./src/scenes/LoadingScene.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts"); var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts");
var global_1 = __webpack_require__(/*! ./datas/global */ "./src/datas/global.ts");
exports.GDispatcher = new FYGE.EventDispatcher(); exports.GDispatcher = new FYGE.EventDispatcher();
var Main = (function () { var Main = (function () {
function Main(canvas) { function Main(canvas) {
...@@ -1307,10 +1308,10 @@ var Main = (function () { ...@@ -1307,10 +1308,10 @@ var Main = (function () {
case 3: case 3:
_a.sent(); _a.sent();
console.log("loading资源加载完成"); console.log("loading资源加载完成");
return [4, TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getAppData, null)]; return [4, TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getAppData)];
case 4: case 4:
_a.sent(); _a.sent();
return [4, TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.filaStarGetActivityBaseInfoById)]; return [4, TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.filaStarGetActivityBaseInfoById, { activityId: global_1.getActivityId() })];
case 5: case 5:
_a.sent(); _a.sent();
ctrls_1.changeScene(LoadingScene_1.LoadingScene); ctrls_1.changeScene(LoadingScene_1.LoadingScene);
...@@ -1806,7 +1807,7 @@ exports.ResJson = { ...@@ -1806,7 +1807,7 @@ exports.ResJson = {
} }
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1592908129/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1592908948/resource/"
}; };
...@@ -1891,6 +1892,7 @@ var fc; ...@@ -1891,6 +1892,7 @@ var fc;
function sendTbNet(netName, parameter, callback, hideMsg) { function sendTbNet(netName, parameter, callback, hideMsg) {
if (hideMsg === void 0) { hideMsg = false; } if (hideMsg === void 0) { hideMsg = false; }
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
console.warn('接口发送', netName, JSON.stringify(parameter));
var waitObj; var waitObj;
if (!my) { if (!my) {
var url = "../../mock/miniTb/" + netName + ".json"; var url = "../../mock/miniTb/" + netName + ".json";
...@@ -1923,7 +1925,7 @@ function sendTbNet(netName, parameter, callback, hideMsg) { ...@@ -1923,7 +1925,7 @@ function sendTbNet(netName, parameter, callback, hideMsg) {
+ ("NAME : " + netName + " \n") + ("NAME : " + netName + " \n")
+ "STATE : %o \n" + "STATE : %o \n"
+ "PARAM : %o \n" + "PARAM : %o \n"
+ "%cDATA : %o \n", "" + (d.success ? 'color:green' : 'color:red'), d.success, parameter, "" + (d.success ? 'color:green' : 'color:red'), d); + "%cDATA : %o \n", "" + (d.success ? 'color:green' : 'color:red'), d.success, parameter, "" + (d.success ? 'color:green' : 'color:red'), d, JSON.stringify(d));
}; };
Main_1.GDispatcher.addEventListener(netName, fun); Main_1.GDispatcher.addEventListener(netName, fun);
waitObj = ctrls_1.wait(function () { waitObj = ctrls_1.wait(function () {
...@@ -2612,7 +2614,7 @@ exports.getIsFocusShop = function () { ...@@ -2612,7 +2614,7 @@ exports.getIsFocusShop = function () {
return exports.getAppData().data.isFocusShop; return exports.getAppData().data.isFocusShop;
}; };
exports.getInviteId = function () { exports.getInviteId = function () {
return exports.getAppData().data.openId; return exports.getAppData().data.inviteId;
}; };
exports.getBeforeStartTime = function () { exports.getBeforeStartTime = function () {
var _a = TaoBaoNet_1.getTbData(TaoBaoNet_1.TbNetName.filaStarGetActivityBaseInfoById).data, startTime = _a.startTime, endTime = _a.endTime; var _a = TaoBaoNet_1.getTbData(TaoBaoNet_1.TbNetName.filaStarGetActivityBaseInfoById).data, startTime = _a.startTime, endTime = _a.endTime;
......
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