{"id":186731,"date":"2023-07-21T21:01:18","date_gmt":"2023-07-21T13:01:18","guid":{"rendered":"http:\/\/www.idc.net\/help\/186731\/"},"modified":"2023-07-21T21:01:18","modified_gmt":"2023-07-21T13:01:18","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91%e7%99%be%e5%ba%a6%e5%b0%8f%e7%a8%8b%e5%ba%8f%e6%95%99%e7%a8%8b%ef%bc%9asockettask","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/186731\/","title":{"rendered":"\u540e\u6d6a\u4e91\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u6559\u7a0b\uff1aSocketTask"},"content":{"rendered":"<ul>\n<li>SocketTask\n<ul>\n<li>\u65b9\u6cd5\u53c2\u6570<\/li>\n<li>\u793a\u4f8b\n<ul>\n<li>\u56fe\u7247\u793a\u4f8b<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b\n<ul><\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1><span><\/span>SocketTask<\/h1>\n<p><strong>\u89e3\u91ca<\/strong>\uff1aWebSocket \u4efb\u52a1\uff0c\u53ef\u901a\u8fc7 swan.connectSocket() \u63a5\u53e3\u521b\u5efa\u8fd4\u56de\u3002<\/p>\n<h2><span><\/span>\u65b9\u6cd5\u53c2\u6570<\/h2>\n<p>\u65e0<\/p>\n<h2><span><\/span>\u793a\u4f8b<\/h2>\n<p>\u8df3\u8f6c\u7f16\u8f91\u5de5\u5177<\/p>\n<p>\u5728\u5f00\u53d1\u8005\u5de5\u5177\u4e2d\u6253\u5f00<\/p>\n<p>\u5728 WEB IDE \u4e2d\u6253\u5f00<\/p>\n<p>\u626b\u7801\u4f53\u9a8c<\/p>\n<p>\u4ee3\u7801\u793a\u4f8b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/static.sitestack.cn\/projects\/smartprogram-20210306\/97ebf63311ffac886baad1c970c1b97b.png\" class=\"aligncenter\"><\/p>\n<p>\u8bf7\u4f7f\u7528\u767e\u5ea6APP\u626b\u7801<\/p>\n<h3><span><\/span>\u56fe\u7247\u793a\u4f8b<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/static.sitestack.cn\/projects\/smartprogram-20210306\/92199505e193378058b4c53e49602f6c.gif\" class=\"aligncenter\"><\/p>\n<\/p>\n<h3><span><\/span>\u4ee3\u7801\u793a\u4f8b<\/h3>\n<ul>\n<li>SWAN<\/li>\n<li>JS<\/li>\n<\/ul>\n<pre>\n \n \n <ol>\n  \n  \n  <li><code><span>&lt;button<\/span><span> <\/span><span>type<\/span><span>=<\/span><span>\"primary\"<\/span><span> <\/span><span>bindtap<\/span><span>=<\/span><span>\"socketTask\"<\/span><span>&gt;<\/span><span>socketTask<\/span><span>&lt;\/button&gt;<\/span><\/code><\/li>\n \n \n <\/ol><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SocketTask \u65b9\u6cd5\u53c2\u6570 \u793a\u4f8b \u56fe\u7247\u793a\u4f8b \u4ee3\u7801\u793a\u4f8b SocketTask \u89e3\u91ca\uff1aWebSocket \u4efb\u52a1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":186732,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182398],"tags":[],"class_list":["post-186731","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mini-program"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/186731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=186731"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/186731\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/186732"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=186731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=186731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=186731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}