Commit 2f401be1 authored by wildfirecode's avatar wildfirecode

1

parent 0352d7fa
...@@ -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.spilt(".")[1]) fc.invoke(app.cloudName, parameter, netName.split(".")[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)
......
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