Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobaominiDemo
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
taobaominiDemo
Commits
0352d7fa
Commit
0352d7fa
authored
Jun 23, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ed56a29d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
20 deletions
+13
-20
index.js
client/pages/index/index.js
+6
-15
output.js
client/pages/index/output.js
+7
-5
No files found.
client/pages/index/index.js
View file @
0352d7fa
...
...
@@ -31,7 +31,6 @@ Page({
},
createMain
()
{
console
.
warn
(
'do my.createCanvas'
)
var
self
=
this
;
my
.
createCanvas
({
id
:
'canvas'
,
...
...
@@ -41,14 +40,10 @@ Page({
const
windowHeight
=
my
.
getSystemInfoSync
().
windowHeight
;
ccc
.
width
=
windowWidth
*
dpr
+
dpr
;
//重新修改会有误差
ccc
.
height
=
windowHeight
*
dpr
+
dpr
;
console
.
warn
(
'my.createCanvas on success'
)
console
.
log
(
ccc
.
width
,
ccc
.
height
)
console
.
log
(
!!
this
.
main
)
if
(
!
this
.
main
)
{
this
.
main
=
new
Main
(
ccc
);
console
.
log
(
GDispatcher
)
//添加事件,为了和main里的通信
//添加事件,为了和main里的通信
this
.
main
.
addGlobalEvent
(
"onMessage"
,
self
.
onMessage
,
self
)
}
// console.log(this.main)
...
...
@@ -167,12 +162,8 @@ Page({
},
//和main通信的方法,接收main的信息
onMessage
(
e
)
{
console
.
log
(
9999999
)
console
.
log
(
e
)
//接口名字
//接口名字
let
netName
=
e
.
data
.
netName
;
//接口参数
let
parameter
=
e
.
data
.
parameter
;
...
...
@@ -200,7 +191,7 @@ Page({
activityId
:
app
.
activityId
,
//|| "5e7c40e98564b57d7fb95812",
nickName
:
app
.
nickName
,
avatar
:
app
.
avatar
,
openId
:
app
.
open
Id
,
inviteId
:
app
.
invite
Id
,
isFocusShop
:
app
.
isFollow
||
false
,
shareCode
:
this
.
shareCode
,
//判断是否要发助力用
}
...
...
@@ -236,7 +227,8 @@ Page({
}
else
{
//获取后端接口
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
])
.
then
(
res
=>
{
// console.log("返回数据" + JSON.stringify(res));
...
...
@@ -247,8 +239,7 @@ Page({
}
},
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串了,就用这种方式
},
onShow
()
{
...
...
client/pages/index/output.js
View file @
0352d7fa
...
...
@@ -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
LoadingScene_1
=
__webpack_require__
(
/*! ./scenes/LoadingScene */
"./src/scenes/LoadingScene.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
();
var
Main
=
(
function
()
{
function
Main
(
canvas
)
{
...
...
@@ -1307,10 +1308,10 @@ var Main = (function () {
case
3
:
_a
.
sent
();
console
.
log
(
"loading资源加载完成"
);
return
[
4
,
TaoBaoNet_1
.
sendTbNet
(
TaoBaoNet_1
.
TbNetName
.
getAppData
,
null
)];
return
[
4
,
TaoBaoNet_1
.
sendTbNet
(
TaoBaoNet_1
.
TbNetName
.
getAppData
)];
case
4
:
_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
:
_a
.
sent
();
ctrls_1
.
changeScene
(
LoadingScene_1
.
LoadingScene
);
...
...
@@ -1806,7 +1807,7 @@ exports.ResJson = {
}
}
],
"path"
:
"https://yun.duiba.com.cn/db_games/activity/kickball-feile/1592908
129
/resource/"
"path"
:
"https://yun.duiba.com.cn/db_games/activity/kickball-feile/1592908
948
/resource/"
};
...
...
@@ -1891,6 +1892,7 @@ var fc;
function
sendTbNet
(
netName
,
parameter
,
callback
,
hideMsg
)
{
if
(
hideMsg
===
void
0
)
{
hideMsg
=
false
;
}
return
new
Promise
(
function
(
resolve
,
reject
)
{
console
.
warn
(
'接口发送'
,
netName
,
JSON
.
stringify
(
parameter
));
var
waitObj
;
if
(
!
my
)
{
var
url
=
"../../mock/miniTb/"
+
netName
+
".json"
;
...
...
@@ -1923,7 +1925,7 @@ function sendTbNet(netName, parameter, callback, hideMsg) {
+
(
"NAME : "
+
netName
+
"
\n
"
)
+
"STATE : %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
);
waitObj
=
ctrls_1
.
wait
(
function
()
{
...
...
@@ -2612,7 +2614,7 @@ exports.getIsFocusShop = function () {
return
exports
.
getAppData
().
data
.
isFocusShop
;
};
exports
.
getInviteId
=
function
()
{
return
exports
.
getAppData
().
data
.
open
Id
;
return
exports
.
getAppData
().
data
.
invite
Id
;
};
exports
.
getBeforeStartTime
=
function
()
{
var
_a
=
TaoBaoNet_1
.
getTbData
(
TaoBaoNet_1
.
TbNetName
.
filaStarGetActivityBaseInfoById
).
data
,
startTime
=
_a
.
startTime
,
endTime
=
_a
.
endTime
;
...
...
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