{"id":972,"date":"2023-09-11T11:31:26","date_gmt":"2023-09-11T03:31:26","guid":{"rendered":"https:\/\/open-doc.jkos.com\/?post_type=docs&#038;p=972"},"modified":"2023-09-11T11:31:26","modified_gmt":"2023-09-11T03:31:26","slug":"%e5%9f%ba%e7%a4%8e%e9%96%8b%e6%94%be%e8%83%bd%e5%8a%9b-%e4%bb%8b%e9%9d%a2%e4%ba%a4%e4%ba%92","status":"publish","type":"docs","link":"https:\/\/open-doc.jkos.com\/?docs=inapp-%e7%ac%ac%e4%b8%89%e6%96%b9%e6%9c%8d%e5%8b%99\/web-sdk\/v2-0-7\/%e5%9f%ba%e7%a4%8e%e9%96%8b%e6%94%be%e8%83%bd%e5%8a%9b-%e4%bb%8b%e9%9d%a2%e4%ba%a4%e4%ba%92","title":{"rendered":"\u57fa\u790e\u958b\u653e\u80fd\u529b &#8211; \u4ecb\u9762\u4ea4\u4e92"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">showModal<\/h2>\n\n\n\n<p>\u901a\u904e\u547c\u53eb&nbsp;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">jkos.showModal()<\/mark><\/strong>&nbsp;\u986f\u793a alert<\/p>\n\n\n\n<div class=\"admonition admonition-info alert alert--info\"><div class=\"admonition-heading\"><h5><span class=\"admonition-icon\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"14\" height=\"16\" viewBox=\"0 0 14 16\"><path fill-rule=\"evenodd\" d=\"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z\"><\/path><\/svg><\/span>  \u70ba\u4ec0\u9ebc\u4f7f\u7528 showModal \u53d6\u4ee3 web \u539f\u751f alert\uff1f<\/h5><\/div><div class=\"admonition-content\"><p><strong>\u975e\u5e38\u4e0d\u5efa\u8b70<\/strong> \u4f7f\u7528\u539f\u751f web alert \u6709\u53ef\u80fd\u5728\u7279\u6b8a\u64cd\u4f5c\u60c5\u5883\u4e0b\u5c0e\u81f4 App crash<\/p><\/div><\/div>\n\n\n\n<pre title=\"\u7bc4\u4f8b\" class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup line-numbers\">&lt;button id=\"test\"&gt;showModal&lt;\/button&gt; \n\n&lt;script&gt; \n  document.querySelector('#test').addEventListener('click', () =&gt; {\n      const info = {\n      type: '1',\n      title: '\u6211\u662f\u6a19\u984c',\n      content: '\u6211\u662f\u5167\u5bb9',\n      confirmText: 'ok',\n      cancelText: 'cancel',\n      onConfirm: () =&gt; {},\n      onCancel: () =&gt; {}\n    }\n\n    jkos.showModal(info, (res) =&gt; {\n      console.log(res.error)\n      console.log(res.errorMessage)\n    });\n  });\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u5165\u53c3\u8aaa\u660e\">\u5165\u53c3\u8aaa\u660e<a href=\"https:\/\/open.jkos.com\/docs\/next\/sdk-base\/action\/showModal#%E5%85%A5%E5%8F%83%E8%AA%AA%E6%98%8E\">\u200b<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>\u53c3\u6578<\/th><th>\u5fc5\u586b<\/th><th>\u578b\u614b<\/th><th>\u8aaa\u660e<\/th><th>\u9810\u8a2d<\/th><\/tr><\/thead><tbody><tr><td>type<\/td><td>\u5426<\/td><td><code>string<\/code><\/td><td>\u985e\u578b\uff1a<br><strong>&#8220;1&#8221;<\/strong>\uff1aalert (\u4e00\u9846\u6309\u9215\uff1a\u78ba\u8a8d)<br><strong>&#8220;2&#8221;<\/strong>\uff1aconfirm (\u5169\u9846\u6309\u9215\uff1a\u53d6\u6d88\uff06\u78ba\u8a8d)<\/td><td><code>1<\/code><\/td><\/tr><tr><td>title<\/td><td>\u662f<\/td><td><code>string<\/code><\/td><td>\u6a19\u984c<\/td><td><\/td><\/tr><tr><td>content<\/td><td>\u662f<\/td><td><code>string<\/code><\/td><td>\u5167\u5bb9<\/td><td><\/td><\/tr><tr><td>confirmText<\/td><td>\u5426<\/td><td><code>string<\/code><\/td><td>\u78ba\u8a8d\u6587\u5b57<\/td><td><code>\u78ba\u8a8d<\/code><\/td><\/tr><tr><td>cancelText<\/td><td>\u5426<\/td><td><code>string<\/code><\/td><td>\u53d6\u6d88\u6587\u5b57<\/td><td><code>\u53d6\u6d88<\/code><\/td><\/tr><tr><td>onConfirm<\/td><td>\u5426<\/td><td><code>function<\/code><\/td><td>\u9ede\u64ca\u78ba\u8a8d\u5f8c\u7684 callback \u51fd\u5f0f<\/td><td><\/td><\/tr><tr><td>onCancel<\/td><td>\u5426<\/td><td><code>function<\/code><\/td><td>\u9ede\u64ca\u53d6\u6d88\u5f8c\u7684 callback \u51fd\u5f0f<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"callback-\u53c3\u6578\u8aaa\u660e\">Callback \u53c3\u6578\u8aaa\u660e<a href=\"https:\/\/open.jkos.com\/docs\/next\/sdk-base\/action\/showModal#callback-%E5%8F%83%E6%95%B8%E8%AA%AA%E6%98%8E\">\u200b<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>\u53c3\u6578<\/th><th>\u578b\u614b<\/th><th>\u8aaa\u660e<\/th><\/tr><\/thead><tbody><tr><td>error<\/td><td><code>number<\/code><\/td><td>\u932f\u8aa4\u78bc &#8211;&nbsp;\u8a73\u60c5\u8acb\u53c3\u898b\u932f\u8aa4\u78bc\u8aaa\u660e<\/td><\/tr><tr><td>errorMessage<\/td><td><code>string<\/code><\/td><td>\u6b64\u63cf\u8ff0\u70ba\u76f8\u95dc\u932f\u8aa4\u7684 ASCII \u7de8\u78bc\u53ef\u8b80\u6587\u5b57<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">setPullRefreshOn<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>\u901a\u904e\u547c\u53eb&nbsp;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">jkos.setPullRefreshOn()<\/mark><\/strong>&nbsp;\u5f8c\uff0c\u7576\u4f7f\u7528\u8005\u65bc\u9801\u9762\u9032\u884c\u4e0b\u62c9\u66f4\u65b0\u7684\u52d5\u4f5c\u6642\uff0c\u53ef\u81ea\u52d5\u66f4\u65b0\u7576\u4e0b\u7684 url<\/li><li>\u53ef\u914d\u5408\u4f7f\u7528&nbsp;<code>jkos.setPullRefreshOff<\/code>&nbsp;\u4ee5\u95dc\u9589\u4e0b\u62c9\u66f4\u65b0\u529f\u80fd<\/li><\/ul>\n\n\n\n<pre title=\"\u7bc4\u4f8b\" class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup line-numbers\">&lt;button id=\"test\"&gt;setPullRefreshOn&lt;\/button&gt; \n\n&lt;script&gt; \n  document.querySelector('#test').addEventListener('click', () =&gt; {\n    jkos.setPullRefreshOn((res) =&gt; {\n      console.log(res.error)\n      console.log(res.errorMessage)\n    });\n  });\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"callback-\u53c3\u6578\u8aaa\u660e\">Callback \u53c3\u6578\u8aaa\u660e<a href=\"https:\/\/open.jkos.com\/docs\/next\/sdk-base\/action\/setPullRefreshOn#callback-%E5%8F%83%E6%95%B8%E8%AA%AA%E6%98%8E\">\u200b<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>\u53c3\u6578<\/th><th>\u578b\u614b<\/th><th>\u8aaa\u660e<\/th><\/tr><\/thead><tbody><tr><td>error<\/td><td><code>number<\/code><\/td><td>\u932f\u8aa4\u78bc &#8211;&nbsp;\u8a73\u60c5\u8acb\u53c3\u898b\u932f\u8aa4\u78bc\u8aaa\u660e<\/td><\/tr><tr><td>errorMessage<\/td><td><code>string<\/code><\/td><td>\u6b64\u63cf\u8ff0\u70ba\u76f8\u95dc\u932f\u8aa4\u7684 ASCII \u7de8\u78bc\u53ef\u8b80\u6587\u5b57<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">setPullRefreshOff<\/h2>\n\n\n\n<p>\u901a\u904e\u547c\u53eb&nbsp;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">jkos.setPullRefreshOff()<\/mark><\/strong>&nbsp;\u95dc\u9589\u4e0b\u62c9\u66f4\u65b0\u9801\u9762\u529f\u80fd\u7bc4\u4f8b<\/p>\n\n\n\n<pre title=\"\u7bc4\u4f8b\" class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup line-numbers\">&lt;button id=\"test\"&gt;setPullRefreshOff&lt;\/button&gt; \n\n&lt;script&gt; \n  document.querySelector('#test').addEventListener('click', () =&gt; {\n    jkos.setPullRefreshOff((res) =&gt; {\n      console.log(res.error)\n      console.log(res.errorMessage)\n    });\n  });\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"callback-\u53c3\u6578\u8aaa\u660e\">Callback \u53c3\u6578\u8aaa\u660e<a href=\"https:\/\/open.jkos.com\/docs\/next\/sdk-base\/action\/setPullRefreshOff#callback-%E5%8F%83%E6%95%B8%E8%AA%AA%E6%98%8E\">\u200b<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>\u53c3\u6578<\/th><th>\u578b\u614b<\/th><th>\u8aaa\u660e<\/th><\/tr><\/thead><tbody><tr><td>error<\/td><td><code>number<\/code><\/td><td>\u932f\u8aa4\u78bc &#8211;&nbsp;\u8a73\u60c5\u8acb\u53c3\u898b\u932f\u8aa4\u78bc\u8aaa\u660e<\/td><\/tr><tr><td>errorMessage<\/td><td><code>string<\/code><\/td><td>\u6b64\u63cf\u8ff0\u70ba\u76f8\u95dc\u932f\u8aa4\u7684 ASCII \u7de8\u78bc\u53ef\u8b80\u6587\u5b57<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u932f\u8aa4\u78bc\u56de\u8986\">\u932f\u8aa4\u78bc\u56de\u8986<a href=\"https:\/\/open.jkos.com\/docs\/next\/sdk-base\/action\/setPullRefreshOff#%E9%8C%AF%E8%AA%A4%E7%A2%BC%E5%9B%9E%E8%A6%86\">\u200b<\/a><\/h3>\n\n\n\n<p>\u8acb\u53c3\u95b1&nbsp;<a href=\"https:\/\/open-doc.jkos.com\/?docs=sdk\/v2-0-6\/%e9%8c%af%e8%aa%a4%e4%bb%a3%e7%a2%bc\" data-type=\"URL\" data-id=\"https:\/\/open-doc.jkos.com\/?docs=sdk\/v2-0-6\/%e9%8c%af%e8%aa%a4%e4%bb%a3%e7%a2%bc\" target=\"_blank\" rel=\"noreferrer noopener\">\u932f\u8aa4\u4ee3\u78bc\u9644\u9304<\/a>\u3002<\/p>\n","protected":false},"featured_media":0,"parent":970,"menu_order":3,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-972","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=972"}],"version-history":[{"count":1,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/972\/revisions"}],"predecessor-version":[{"id":981,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/972\/revisions\/981"}],"up":[{"embeddable":true,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/970"}],"next":[{"title":"\u932f\u8aa4\u4ee3\u78bc","link":"https:\/\/open-doc.jkos.com\/?docs=inapp-%e7%ac%ac%e4%b8%89%e6%96%b9%e6%9c%8d%e5%8b%99\/web-sdk\/v2-0-7\/%e9%8c%af%e8%aa%a4%e4%bb%a3%e7%a2%bc","href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/971"}],"prev":[{"title":"\u57fa\u790e\u958b\u653e\u80fd\u529b - \u8def\u7531","link":"https:\/\/open-doc.jkos.com\/?docs=inapp-%e7%ac%ac%e4%b8%89%e6%96%b9%e6%9c%8d%e5%8b%99\/web-sdk\/v2-0-7\/%e5%9f%ba%e7%a4%8e%e9%96%8b%e6%94%be%e8%83%bd%e5%8a%9b-%e8%b7%af%e7%94%b1","href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/973"}],"wp:attachment":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=972"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}