diff --git a/pages.json b/pages.json index d5bc0b79a8a371217c2252a8234b079683856f39..0e909f74a7331745fb714ab38cced0b1c58b664a 100644 --- a/pages.json +++ b/pages.json @@ -55,24 +55,24 @@ "style": { "navigationBarTitleText": "radio" } - }, - { - "path": "pages/component/rich-text/rich-text", - "style": { - "navigationBarTitleText": "rich-text" - } - }, - { - "path": "pages/component/rich-text/rich-text-tags", - "style": { - "navigationBarTitleText": "rich-text-tags" - } - }, - { - "path": "pages/component/rich-text/rich-text-complex", - "style": { - "navigationBarTitleText": "rich-text-complex" - } + }, + { + "path": "pages/component/rich-text/rich-text", + "style": { + "navigationBarTitleText": "rich-text" + } + }, + { + "path": "pages/component/rich-text/rich-text-tags", + "style": { + "navigationBarTitleText": "rich-text-tags" + } + }, + { + "path": "pages/component/rich-text/rich-text-complex", + "style": { + "navigationBarTitleText": "rich-text-complex" + } }, { "path": "pages/component/checkbox/checkbox", @@ -660,6 +660,12 @@ "navigationBarTitleText": "" } }, + { + "path": "pages/API/call-function/call-function", + "style": { + "navigationBarTitleText": "" + } + }, { "path": "pages/API/get-system-info/get-system-info", "style": { @@ -767,12 +773,12 @@ "style": { "navigationBarTitleText": "swiper-list" } - }, - { - "path": "pages/template/swiper-list2/swiper-list2", - "style": { - "navigationBarTitleText": "swiper-list2" - } + }, + { + "path": "pages/template/swiper-list2/swiper-list2", + "style": { + "navigationBarTitleText": "swiper-list2" + } }, { "path": "pages/template/swiper-vertical-video/swiper-vertical-video", @@ -832,7 +838,7 @@ { "path": "pages/template/long-list/long-list", "style": { - "navigationBarTitleText": "复杂长列表", + "navigationBarTitleText": "复杂长列表", "enablePullDownRefresh": true } }, @@ -859,7 +865,7 @@ "style": { "navigationBarTitleText": "自定义下拉刷新的scroll-view属性示例" } - }, + }, { "path": "pages/template/pull-zoom-image/pull-zoom-image", "style": { diff --git a/pages/API/call-function/call-function.uvue b/pages/API/call-function/call-function.uvue new file mode 100644 index 0000000000000000000000000000000000000000..9e74d44358a2d6d529adff7016779cf44ae48c3e --- /dev/null +++ b/pages/API/call-function/call-function.uvue @@ -0,0 +1,62 @@ + + + + diff --git a/pages/tabBar/API.uvue b/pages/tabBar/API.uvue index e311853a6b3120a984d4d4408495cb56e8555eed..58b5562d3469b0ba89410e1916b8804e6595bf1c 100644 --- a/pages/tabBar/API.uvue +++ b/pages/tabBar/API.uvue @@ -157,6 +157,10 @@ name: '全局websocket', url: 'websocket-global', api: ["connectSocket", "onSocketOpen", "onSocketError", "sendSocketMessage", "onSocketMessage", "closeSocket", "onSocketClose"] + }, + { + name: '请求云函数', + url: 'call-function', }, ] as Page[], }, diff --git a/uniCloud-aliyun/cloudfunctions/echo-cf/index.js b/uniCloud-aliyun/cloudfunctions/echo-cf/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ab5137656bea5460db5ee66df76d8a331689a2a7 --- /dev/null +++ b/uniCloud-aliyun/cloudfunctions/echo-cf/index.js @@ -0,0 +1,12 @@ +'use strict'; +exports.main = async (event, context) => { + //event为客户端上传的参数 + console.log('event : ', event) + + //返回数据给客户端 + return { + event, + context, + showMessage: 'Hello uniCloud function' + } +}; diff --git a/uniCloud-aliyun/cloudfunctions/echo-cf/package.json b/uniCloud-aliyun/cloudfunctions/echo-cf/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1618abf45a6870583bcf0a6ba7e360ca7e1b4d06 --- /dev/null +++ b/uniCloud-aliyun/cloudfunctions/echo-cf/package.json @@ -0,0 +1,5 @@ +{ + "name": "echo-cf", + "dependencies": {}, + "extensions": {} +}