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
2f401be1
Commit
2f401be1
authored
Jun 23, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
0352d7fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
69 deletions
+75
-69
index.js
client/pages/index/index.js
+75
-69
No files found.
client/pages/index/index.js
View file @
2f401be1
...
@@ -162,7 +162,8 @@ Page({
...
@@ -162,7 +162,8 @@ Page({
},
},
//和main通信的方法,接收main的信息
//和main通信的方法,接收main的信息
onMessage
(
e
)
{
onMessage
(
e
)
{
console
.
log
(
e
)
try
{
//接口名字
//接口名字
let
netName
=
e
.
data
.
netName
;
let
netName
=
e
.
data
.
netName
;
//接口参数
//接口参数
...
@@ -227,9 +228,8 @@ Page({
...
@@ -227,9 +228,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
.
spil
t
(
"."
)[
1
])
fc
.
invoke
(
app
.
cloudName
,
parameter
,
netName
.
spli
t
(
"."
)[
1
])
.
then
(
res
=>
{
.
then
(
res
=>
{
// console.log("返回数据" + JSON.stringify(res));
// console.log("返回数据" + JSON.stringify(res));
//发送消息
//发送消息
...
@@ -237,6 +237,12 @@ Page({
...
@@ -237,6 +237,12 @@ Page({
this
.
postMessage
(
netName
,
res
)
this
.
postMessage
(
netName
,
res
)
})
})
}
}
}
catch
(
error
)
{
console
.
log
(
error
)
}
},
},
postMessage
(
netName
,
data
)
{
postMessage
(
netName
,
data
)
{
// this.main.dispatchGlobalEvent(netName, data)
// this.main.dispatchGlobalEvent(netName, data)
...
...
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