{"id":304,"date":"2022-03-24T11:36:34","date_gmt":"2022-03-24T03:36:34","guid":{"rendered":"https:\/\/sit-open-doc.jkos.app\/?post_type=docs&#038;p=304"},"modified":"2025-05-19T14:17:51","modified_gmt":"2025-05-19T06:17:51","slug":"%e5%b7%a6%e5%81%b4%e6%8c%89%e9%88%95","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-2\/%e5%9f%ba%e7%a4%8e%e9%96%8b%e6%94%be%e8%83%bd%e5%8a%9b-%e5%b0%8e%e8%88%aa%e6%ac%84\/%e5%b7%a6%e5%81%b4%e6%8c%89%e9%88%95","title":{"rendered":"\u5de6\u5074\u6309\u9215"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">setNavLeftButton<\/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.setNavLeftButton<\/mark><\/strong>&nbsp;\u63a7\u5236 Navigation bar \u5de6\u5074\u986f\u793a\u8fd4\u56de&nbsp;<strong>(&lt;)<\/strong>&nbsp;\u6216\u662f\u95dc\u9589&nbsp;<strong>(X)<\/strong>&nbsp;icon \u4ee5\u53ca\u5176\u5c0d\u61c9\u7684\u884c\u70ba\u548c\u984f\u8272\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8a2d\u5b9a\u4e00\u6b21\u6309\u9215\u984f\u8272\u5373\u53ef\u5957\u7528\u81f3\u6240\u6709\u9801\u9762\uff0c\u82e5\u7121\u6307\u5b9a\u984f\u8272\u5247\u9810\u8a2d\u986f\u793a\u767d\u8272\u3002<\/li>\n\n\n\n<li>\u5efa\u8b70\u958b\u767c\u8005\u5c07\u9996\u9801\u8a2d\u5b9a\u70ba\u00a0<strong>X (type=2)<\/strong>\uff0c\u4e26\u5728\u96e2\u958b\u9996\u9801\u6642\u8a2d\u70ba\u00a0<strong>&lt; (type=1)<\/strong>\u00a0\u4ee5\u78ba\u4fdd\u4f7f\u7528\u8005\u5f9e\u4efb\u4f55\u9801\u9762\u56de\u5230\u9996\u9801\u6642\u90fd\u80fd\u5c07\u00a0<strong>webview<\/strong>\u00a0\u756b\u9762\u95dc\u9589\u3002<\/li>\n\n\n\n<li>\u53ef\u5728\u4f7f\u7528\u8005\u9ede\u64ca\u6309\u9215\u6642\uff0c\u559a\u8d77\u539f\u751f\u7684\u00a0<strong>popup \u8996\u7a97<\/strong>\uff0c\u963b\u64cb\u5176\u64cd\u4f5c\u884c\u70ba\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u9019\u500b\u529f\u80fd\u4f86\u8a2d\u8a08\u300e\u78ba\u5b9a\u8981\u96e2\u958b\u55ce\uff1f\u300f\u985e\u578b\u7684\u8a62\u554f\u8996\u7a97\u3002<\/li>\n<\/ul>\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>  \u7576\u958b\u767c\u8005\u672a\u8a2d\u5b9a\u6642\uff0c\u9810\u8a2d\u884c\u70ba\u662f<\/h5><\/div><div class=\"admonition-content\"><ul><li>\u958b\u555f\u7684\u7b2c\u4e00\u500b\u756b\u9762\u5c0e\u89bd\u5217\u5de6\u65b9 icon \u5c07\u6703\u986f\u793a\u95dc\u9589\u9215&nbsp;X\u3002<\/li><li>\u5176\u4ed6\u9801\u9762\u5247\u8996\u70ba\u5167\u9801\uff0c\u7686\u6703\u986f\u793a\u8fd4\u56de\u9375&nbsp;&lt;\u3002<\/li><\/ul><\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u4f7f\u7528\u65b9\u6cd5\">\u4f7f\u7528\u65b9\u6cd5<a href=\"https:\/\/open.jkos.com\/docs\/next\/sdk-base\/navigation\/setNavLeftButton#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95\">\u200b<\/a><\/h3>\n\n\n\n<pre title=\"\u51fd\u5f0f\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">jkos.setNavLeftButton(data, callback);<\/code><\/pre>\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;setNavLeftButton&lt;\/button&gt; \n\n&lt;script&gt; \ndocument.querySelector ('#test'). addEventListener ('click', () =&gt; {\n  jkos.setNavLeftButton({\n    type :  `1` ,\n    color :  `#ffffff`, \n    confirm: {\n      content: 'string'\n    }\n  }, (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\">\u5165\u53c3\u8aaa\u660e<a href=\"https:\/\/open.jkos.com\/docs\/next\/sdk-base\/navigation\/setNavLeftButton#%E5%85%A5%E5%8F%83%E8%AA%AA%E6%98%8E\">\u200b<\/a><\/h3>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u5fc5\u9808<\/mark><\/strong>&nbsp;\u7b2c\u4e00\u500b\u53c3\u6578\uff1adata<\/p>\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><\/tr><\/thead><tbody><tr><td>type<\/td><td>\u5426<\/td><td><code>string<\/code><\/td><td>\u6539\u8b8a Navbar \u5de6\u4e0a\u89d2\u6309\u9215&nbsp;<strong>\u884c\u70ba<\/strong>&nbsp;\u8207&nbsp;<strong>UI<\/strong>&nbsp;:<strong>&#8220;1&#8221;<\/strong>\u5411\u5de6\u7bad\u982d\u7684\u6309\u9215\u3002\u8fd4\u56de\u524d\u4e00\u9801<strong>&#8220;2&#8221;<\/strong>\u53c9\u53c9\u7684\u6309\u9215\u3002\u9ede\u64ca\u5f8c\u95dc\u9589 webview<\/td><\/tr><tr><td>color<\/td><td>\u5426<\/td><td><code>string<\/code><\/td><td>\u6539\u8b8a Navbar \u5de6\u4e0a\u89d2\u6309\u9215&nbsp;<strong>\u984f\u8272<\/strong>\uff0c\u4f7f\u7528&nbsp;<code>hex \u8272\u78bc<\/code><\/td><\/tr><tr><td>confirm<\/td><td>\u5426<\/td><td><code>object<\/code><\/td><td>\u7576\u9ede\u64ca\u5de6\u4e0a\u89d2\u6309\u9215\u6642\u89f8\u767c\u5f48\u7a97\uff0c\u78ba\u5b9a\u662f\u5426\u7e7c\u7e8c\u64cd\u4f5c&nbsp;<strong>\u5df2\u5b9a\u7fa9\u7684\u884c\u70ba<\/strong><\/td><\/tr><tr><td>confirm.content<\/td><td>\u5426<\/td><td><code>object<\/code><\/td><td>\u5b9a\u7fa9&nbsp;<strong>\u5f48\u7a97\u5167\u5bb9\u6587\u5b57<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"admonition admonition-info alert alert--info\">\n <div class=\"admonition-heading\">\n  <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>  Popup Message (Confirm Box)\n  <\/h5>\n <\/div>\n <div class=\"admonition-content\">\n  <img decoding=\"async\" width=\"250\" src=\"https:\/\/sit-open-doc.jkos.app\/wp-content\/uploads\/2022\/03\/setNavLeftButton-alert.png\">\n  <ul>\n   <li>\u6a19\u984c\n    <ul>\n     <li>\u6587\u6848\uff1a\u78ba\u5b9a\u8981\u96e2\u958b\u55ce\uff1f<\/li>\n    <\/ul>\n   <\/li>\n   <li>\u526f\u6a19\u984c\n    <ul>\n     <li>\u9810\u8a2d\u6587\u6848\uff1a\u60a8\u6240\u9032\u884c\u7684\u64cd\u4f5c\u53ef\u80fd\u4e0d\u6703\u4fdd\u7559\u3002<\/li>\n     <li>\u53ef\u900f\u904e <strong>confirm.content<\/strong> \u53c3\u6578\u5ba2\u88fd\u6587\u6848\u5167\u5bb9<\/li>\n    <\/ul>\n   <\/li>\n   <li>\u6309\u9215\n    <ul>\n     <li>\u5de6\uff1a\u300e\u53d6\u6d88\u300f\u3002\u9ede\u64ca\u95dc\u9589\u5f48\u7a97<\/li>\n     <li>\u53f3\uff1a\u300e\u96e2\u958b\u300f\u3002\u9ede\u64ca\u96e2\u958b\u6b64\u9801\u9762<\/li>\n    <\/ul>\n   <\/li>\n  <\/ul>\n <\/div>\n<\/div>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u975e\u5fc5\u9808<\/mark><\/strong>&nbsp;\u7b2c\u4e8c\u500b\u53c3\u6578\uff1a callback<\/p>\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;<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\">\u8a73\u60c5\u8acb\u53c3\u898b\u932f\u8aa4\u78bc\u8aaa\u660e<\/a><\/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\/v2.0.3\/sdk-base\/authentication\/getAuthCode#%E9%8C%AF%E8%AA%A4%E7%A2%BC%E5%9B%9E%E8%A6%86\">\u200b<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes has-extra-small-font-size\"><table><thead><tr><th>\u4ee3\u78bc<\/th><th>\u8aaa\u660e<\/th><\/tr><\/thead><tbody><tr><td>15<\/td><td>\u7cfb\u7d71\u4e0d\u652f\u63f4<\/td><\/tr><tr><td>16<\/td><td>\u683c\u5f0f\u932f\u8aa4<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"featured_media":0,"parent":273,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-304","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/304","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=304"}],"version-history":[{"count":6,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/304\/revisions"}],"predecessor-version":[{"id":1417,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/304\/revisions\/1417"}],"up":[{"embeddable":true,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/273"}],"next":[{"title":"\u53f3\u5074\u6309\u9215","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-2\/%e5%9f%ba%e7%a4%8e%e9%96%8b%e6%94%be%e8%83%bd%e5%8a%9b-%e5%b0%8e%e8%88%aa%e6%ac%84\/%e5%8f%b3%e5%81%b4%e6%8c%89%e9%88%95","href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/305"}],"prev":[{"title":"\u6a19\u984c\u8207\u80cc\u666f\u984f\u8272","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-2\/%e5%9f%ba%e7%a4%8e%e9%96%8b%e6%94%be%e8%83%bd%e5%8a%9b-%e5%b0%8e%e8%88%aa%e6%ac%84\/%e6%a8%99%e9%a1%8c%e8%88%87%e8%83%8c%e6%99%af%e9%a1%8f%e8%89%b2","href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/303"}],"wp:attachment":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}