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
ed56a29d
Commit
ed56a29d
authored
Jun 23, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9682a8b5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
.gitignore
.gitignore
+2
-1
index.js
client/pages/index/index.js
+15
-6
output.js
client/pages/index/output.js
+2
-5
No files found.
.gitignore
View file @
ed56a29d
./client/pages/index/output.js
server
\ No newline at end of file
client/pages/index/index.js
View file @
ed56a29d
import
{
Main
}
from
'./output'
;
import
{
Main
,
GDispatcher
}
from
'./output'
;
import
{
getUserAddress
,
favorShop
,
getAuthUserInfo
,
checkShopFavoredStatus
}
from
'../../utils/utils'
;
const
app
=
getApp
()
...
...
@@ -43,8 +43,11 @@ Page({
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
)
this
.
main
=
new
Main
(
ccc
);
console
.
log
(
GDispatcher
)
//添加事件,为了和main里的通信
this
.
main
.
addGlobalEvent
(
"onMessage"
,
self
.
onMessage
,
self
)
}
...
...
@@ -164,6 +167,11 @@ Page({
},
//和main通信的方法,接收main的信息
onMessage
(
e
)
{
console
.
log
(
9999999
)
console
.
log
(
e
)
//接口名字
let
netName
=
e
.
data
.
netName
;
//接口参数
...
...
@@ -222,14 +230,14 @@ Page({
my
.
showSharePanel
()
break
}
console
.
log
(
879797897
)
// this.webViewContext.postMessage({ netName: netName, data: data })
this
.
postMessage
(
netName
,
data
)
}
else
{
var
app
=
getApp
();
//获取后端接口
const
{
function
:
fc
}
=
app
.
cloud
//待写,
fc
.
invoke
(
app
.
cloudName
,
parameter
,
netName
)
fc
.
invoke
(
app
.
cloudName
,
parameter
,
netName
.
spilt
(
"."
)[
1
]
)
.
then
(
res
=>
{
// console.log("返回数据" + JSON.stringify(res));
//发送消息
...
...
@@ -239,6 +247,7 @@ Page({
}
},
postMessage
(
netName
,
data
)
{
console
.
warn
(
'postMessage(netName, data) {'
,
netName
,
data
)
// this.main.dispatchGlobalEvent(netName, data)
this
.
main
.
dispatchGlobalEvent
({
type
:
netName
},
data
)
//以防复用事件event串了,就用这种方式
},
...
...
client/pages/index/output.js
View file @
ed56a29d
...
...
@@ -1280,9 +1280,6 @@ var Main = (function () {
if
(
!
my
)
{
}
else
{
MConst_1
.
MConst
.
activityId
=
getApp
().
query
.
activityOutId
;
MConst_1
.
MConst
.
o
=
getApp
().
query
.
o
||
null
;
MConst_1
.
MConst
.
groupId
=
getApp
().
query
.
groupId
;
}
if
(
MConst_1
.
MConst
.
o
)
{
}
...
...
@@ -1809,7 +1806,7 @@ exports.ResJson = {
}
}
],
"path"
:
"https://yun.duiba.com.cn/db_games/activity/kickball-feile/159290
5106
/resource/"
"path"
:
"https://yun.duiba.com.cn/db_games/activity/kickball-feile/159290
8129
/resource/"
};
...
...
@@ -1929,7 +1926,6 @@ function sendTbNet(netName, parameter, callback, hideMsg) {
+
"%cDATA : %o
\n
"
,
""
+
(
d
.
success
?
'color:green'
:
'color:red'
),
d
.
success
,
parameter
,
""
+
(
d
.
success
?
'color:green'
:
'color:red'
),
d
);
};
Main_1
.
GDispatcher
.
addEventListener
(
netName
,
fun
);
Main_1
.
GDispatcher
.
dispatchEvent
({
type
:
"onMessage"
},
{
netName
:
netName
,
parameter
:
parameter
});
waitObj
=
ctrls_1
.
wait
(
function
()
{
if
(
netName
!=
TbNetName
.
favorShop
&&
netName
!=
TbNetName
.
getUserAddress
&&
...
...
@@ -1937,6 +1933,7 @@ function sendTbNet(netName, parameter, callback, hideMsg) {
fun
({
type
:
netName
,
data
:
{
success
:
false
}
});
}
},
10000
);
Main_1
.
GDispatcher
.
dispatchEvent
({
type
:
"onMessage"
},
{
netName
:
netName
,
parameter
:
parameter
});
});
}
exports
.
sendTbNet
=
sendTbNet
;
...
...
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