{"id":3506,"date":"2022-03-16T16:26:13","date_gmt":"2022-03-16T08:26:13","guid":{"rendered":"https:\/\/egonlin.com\/?p=3506"},"modified":"2022-04-26T14:00:54","modified_gmt":"2022-04-26T06:00:54","slug":"%e7%ac%ac%e5%8d%81%e4%b8%89%e8%8a%82%ef%bc%9a%e5%b0%8f%e7%a8%8b%e5%ba%8f%e8%b7%af%e7%94%b1%e8%b7%b3%e8%bd%ac","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=3506","title":{"rendered":"\u7b2c\u5341\u4e09\u8282\uff1a\u5c0f\u7a0b\u5e8f\u8def\u7531\u8df3\u8f6c"},"content":{"rendered":"<h2>1\u5c0f\u7a0b\u5e8f\u8def\u7531\u8df3\u8f6c<\/h2>\n<h3>1.1wx.switchTab(Object object)<\/h3>\n<p><strong>\u8fd9\u91cc\u7684tabBar\u662f\u5e95\u4e0b\u7684\u5bfc\u822a\u680f\u6307\u5b9a\u7684\u9875\u9762\uff0c<\/strong><\/p>\n<p>\u8df3\u8f6c\u5230 tabBar \u9875\u9762\uff0c\u5e76\u5173\u95ed\u5176\u4ed6\u6240\u6709\u975e tabBar \u9875\u9762<\/p>\n<p><strong>\u53c2\u6570<\/strong><\/p>\n<p><strong>Object object<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5c5e\u6027<\/th>\n<th>\u7c7b\u578b<\/th>\n<th>\u9ed8\u8ba4\u503c<\/th>\n<th>\u5fc5\u586b<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>url<\/td>\n<td>string<\/td>\n<td><\/td>\n<td>\u662f<\/td>\n<td>\u9700\u8981\u8df3\u8f6c\u7684 tabBar \u9875\u9762\u7684\u8def\u5f84\uff08\u9700\u5728 app.json \u7684 <a href=\"https:\/\/developers.weixin.qq.com\/miniprogram\/dev\/framework\/config.html#tabbar\">tabBar<\/a> \u5b57\u6bb5\u5b9a\u4e49\u7684\u9875\u9762\uff09\uff0c\u8def\u5f84\u540e\u4e0d\u80fd\u5e26\u53c2\u6570\u3002<\/td>\n<\/tr>\n<tr>\n<td>success<\/td>\n<td>function<\/td>\n<td><\/td>\n<td>\u5426<\/td>\n<td>\u63a5\u53e3\u8c03\u7528\u6210\u529f\u7684\u56de\u8c03\u51fd\u6570<\/td>\n<\/tr>\n<tr>\n<td>fail<\/td>\n<td>function<\/td>\n<td><\/td>\n<td>\u5426<\/td>\n<td>\u63a5\u53e3\u8c03\u7528\u5931\u8d25\u7684\u56de\u8c03\u51fd\u6570<\/td>\n<\/tr>\n<tr>\n<td>complete<\/td>\n<td>function<\/td>\n<td><\/td>\n<td>\u5426<\/td>\n<td>\u63a5\u53e3\u8c03\u7528\u7ed3\u675f\u7684\u56de\u8c03\u51fd\u6570\uff08\u8c03\u7528\u6210\u529f\u3001\u5931\u8d25\u90fd\u4f1a\u6267\u884c\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u793a\u4f8b\u4ee3\u7801<\/strong><\/p>\n<pre><code class=\"language-json\">{\n  &quot;tabBar&quot;: {\n    &quot;list&quot;: [\n      {\n        &quot;pagePath&quot;: &quot;index&quot;,\n        &quot;text&quot;: &quot;\u9996\u9875&quot;\n      },\n      {\n        &quot;pagePath&quot;: &quot;other&quot;,\n        &quot;text&quot;: &quot;\u5176\u4ed6&quot;\n      }\n    ]\n  }\n}\n<\/code><\/pre>\n<pre><code class=\"language-js\">wx.switchTab({\n  url: &#039;\/index&#039;\n})<\/code><\/pre>\n<h3>1.2wx.reLaunch(Object object)<\/h3>\n<blockquote>\n<p>\u57fa\u7840\u5e93 1.1.0 \u5f00\u59cb\u652f\u6301\uff0c\u4f4e\u7248\u672c\u9700\u505a<a href=\"https:\/\/developers.weixin.qq.com\/miniprogram\/dev\/framework\/compatibility.html\">\u517c\u5bb9\u5904\u7406<\/a>\u3002<\/p>\n<\/blockquote>\n<p>\u5173\u95ed\u6240\u6709\u9875\u9762\uff0c\u6253\u5f00\u5230\u5e94\u7528\u5185\u7684\u67d0\u4e2a\u9875\u9762<\/p>\n<p><strong>\u53c2\u6570<\/strong><\/p>\n<p><strong>Object object<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5c5e\u6027<\/th>\n<th>\u7c7b\u578b<\/th>\n<th>\u9ed8\u8ba4\u503c<\/th>\n<th>\u5fc5\u586b<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>url<\/td>\n<td>string<\/td>\n<td><\/td>\n<td>\u662f<\/td>\n<td>\u9700\u8981\u8df3\u8f6c\u7684\u5e94\u7528\u5185\u9875\u9762\u8def\u5f84\uff0c\u8def\u5f84\u540e\u53ef\u4ee5\u5e26\u53c2\u6570\u3002\u53c2\u6570\u4e0e\u8def\u5f84\u4e4b\u95f4\u4f7f\u7528?\u5206\u9694\uff0c\u53c2\u6570\u952e\u4e0e\u53c2\u6570\u503c\u7528=\u76f8\u8fde\uff0c\u4e0d\u540c\u53c2\u6570\u7528&amp;\u5206\u9694\uff1b\u5982 &#8216;path?key=value&amp;key2=value2&#8217;<\/td>\n<\/tr>\n<tr>\n<td>success<\/td>\n<td>function<\/td>\n<td><\/td>\n<td>\u5426<\/td>\n<td>\u63a5\u53e3\u8c03\u7528\u6210\u529f\u7684\u56de\u8c03\u51fd\u6570<\/td>\n<\/tr>\n<tr>\n<td>fail<\/td>\n<td>function<\/td>\n<td><\/td>\n<td>\u5426<\/td>\n<td>\u63a5\u53e3\u8c03\u7528\u5931\u8d25\u7684\u56de\u8c03\u51fd\u6570<\/td>\n<\/tr>\n<tr>\n<td>complete<\/td>\n<td>function<\/td>\n<td><\/td>\n<td>\u5426<\/td>\n<td>\u63a5\u53e3\u8c03\u7528\u7ed3\u675f\u7684\u56de\u8c03\u51fd\u6570\uff08\u8c03\u7528\u6210\u529f\u3001\u5931\u8d25\u90fd\u4f1a\u6267\u884c\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u793a\u4f8b\u4ee3\u7801<\/strong><\/p>\n<pre><code class=\"language-js\">wx.reLaunch({\n  url: &#039;test?id=1&#039;\n})\n<\/code><\/pre>\n<pre><code class=\"language-js\">\/\/ test Page({ onLoad (option) { console.log(option.query) } })<\/code><\/pre>\n<h3>1.3wx.redirectTo(Object object)<\/h3>\n<p>\u5173\u95ed\u5f53\u524d\u9875\u9762\uff0c\u8df3\u8f6c\u5230\u5e94\u7528\u5185\u7684\u67d0\u4e2a\u9875\u9762\u3002\u4f46\u662f\u4e0d\u5141\u8bb8\u8df3\u8f6c\u5230 tabbar \u9875\u9762\u3002<\/p>\n<p><strong>\u53c2\u6570<\/strong><\/p>\n<p><strong>Object object<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5c5e\u6027<\/th>\n<th>\u7c7b\u578b<\/th>\n<th>\u9ed8\u8ba4\u503c<\/th>\n<th>\u5fc5\u586b<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>url<\/td>\n<td>string<\/td>\n<td><\/td>\n<td>\u662f<\/td>\n<td>\u9700\u8981\u8df3\u8f6c\u7684\u5e94\u7528\u5185\u975e tabBar \u7684\u9875\u9762\u7684\u8def\u5f84, \u8def\u5f84\u540e\u53ef\u4ee5\u5e26\u53c2\u6570\u3002\u53c2\u6570\u4e0e\u8def\u5f84\u4e4b\u95f4\u4f7f\u7528 <code>?<\/code> \u5206\u9694\uff0c\u53c2\u6570\u952e\u4e0e\u53c2\u6570\u503c\u7528 <code>=<\/code> \u76f8\u8fde\uff0c\u4e0d\u540c\u53c2\u6570\u7528 <code>&amp;<\/code> \u5206\u9694\uff1b\u5982 &#8216;path?key=value&amp;key2=value2&#8217;<\/td>\n<\/tr>\n<tr>\n<td>success<\/td>\n<td>function<\/td>\n<td><\/td>\n<td>\u5426<\/td>\n<td>\u63a5\u53e3\u8c03\u7528\u6210\u529f\u7684\u56de\u8c03\u51fd\u6570<\/td>\n<\/tr>\n<tr>\n<td>fail<\/td>\n<td>function<\/td>\n<td><\/td>\n<td>\u5426<\/td>\n<td>\u63a5\u53e3\u8c03\u7528\u5931\u8d25\u7684\u56de\u8c03\u51fd\u6570<\/td>\n<\/tr>\n<tr>\n<td>complete<\/td>\n<td>function<\/td>\n<td><\/td>\n<td>\u5426<\/td>\n<td>\u63a5\u53e3\u8c03\u7528\u7ed3\u675f\u7684\u56de\u8c03\u51fd\u6570\uff08\u8c03\u7528\u6210\u529f\u3001\u5931\u8d25\u90fd\u4f1a\u6267\u884c\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u793a\u4f8b\u4ee3\u7801<\/strong><\/p>\n<pre><code class=\"language-js\">wx.redirectTo({\n  url: &#039;test?id=1&#039;\n})<\/code><\/pre>\n<h3>1.4wx.navigateTo(Object object)<\/h3>\n<p><\/p><div id=\"rml_readmorelogin_placeholder\" style=\"position:relative;\"><div id=\"rml_fade_content\" style=\"position: absolute;\r\ntop:-10em;\r\nwidth:100%;\r\nheight:10em;\r\nbackground: -webkit-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -moz-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -o-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -ms-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\"><\/div><div class=\"wpf-controller aru_rml_from_in_post\" style=\"background-color:#eeeeee;border:5px solid #cce6ff;\" id=\"ARU_ReadMoreLogin_ReadMoreLoginController\"><h2 id=\"Header\">\u67e5\u770b\u66f4\u591a<\/h2><div id=\"Message\"><p>\u8054\u7cfb\u7ba1\u7406\u5458\u5fae\u4fe1tutu19192010\uff0c\u6ce8\u518c\u8d26\u53f7<\/p>\n<\/div><div id=\"StatusBarHeader\"><\/div><form id=\"ARU_ReadMoreLogin_ReadMoreLoginController\"><input name=\"post_id\" value=\"3506\" type=\"hidden\"\/><input name=\"_init_callback\" value=\"InitLogin\" type=\"hidden\"\/><input name=\"post_id\" value=\"3506\" type=\"hidden\"\/><input name=\"rt_ype\" value=\"1\" type=\"hidden\"\/><input name=\"nonce\" value=\"4f6250faf4\" type=\"hidden\"\/><input name=\"_wpnonce\" value=\"02501b0a46\" type=\"hidden\"\/><input name=\"_controller\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginController\" type=\"hidden\"\/><input name=\"_proxy_controller\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginController\" type=\"hidden\"\/><input name=\"_view\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginView\" type=\"hidden\"\/><table class=\"wpf-table-placeholder\"><tbody class=\"wpf-table-placeholder\"><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\" width=\"400px\"><table class=\"wpf-table-placeholder\"><tbody class=\"wpf-table-placeholder\"><tr class=\"wpf-table-placeholder\"><th class=\"wpf-table-placeholder-input\"><label class=\"wpf-label\">Username:<\/label><\/th><\/tr><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\"><input class=\"regular-text text_input\" name=\"username\" value=\"\" type=\"text\"\/><\/td><\/tr><tr class=\"wpf-table-placeholder\"><th class=\"wpf-table-placeholder-input\"><label class=\"wpf-label\">Password:<\/label><\/th><\/tr><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\"><input class=\"regular-text text_input\" name=\"password\" value=\"\" type=\"password\"\/><\/td><\/tr><\/tbody><\/table><p class=\"wpf-table-placeholder submit\"><button class=\"wp_plugin_framework_ajax_button\" type=\"button\" style=\"background-color:#4D90FE;;color:#ffffff;;border:1px solid #3079ed;\" name=\"_event\" value=\"ButtonLogin\">Log in<\/button><\/p><\/td><td class=\"wpf-table-placeholder-input\"><\/td><\/tr><\/tbody><\/table><\/form><div id=\"ButtonStartRegister\"><a href=\"https:\/\/egonlin.com\/wp-login.php?action=register\">Register<\/a><\/div><div id=\"Link1\"><a href=\"https:\/\/egonlin.com\/wp-login.php?action=lostpassword\">Forgotten username or password?<\/a><\/div><div id=\"StatusBarFooter\"><\/div><\/div><\/div><div id=aru_remaining_content><\/div>","protected":false},"excerpt":{"rendered":"<p>1\u5c0f\u7a0b\u5e8f\u8def\u7531\u8df3\u8f6c 1.1wx.switchTab(Object object) \u8fd9\u91cc\u7684tabBar\u662f\u5e95\u4e0b\u7684\u5bfc\u822a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[307,308],"tags":[],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/3506"}],"collection":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3506"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/3506\/revisions"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}