{"id":33652,"date":"2024-11-25T09:37:47","date_gmt":"2024-11-25T01:37:47","guid":{"rendered":"https:\/\/fwq.ai\/blog\/33652\/"},"modified":"2024-11-25T09:37:47","modified_gmt":"2024-11-25T01:37:47","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0%ef%bc%8c%e6%94%b6%e8%97%8f%ef%bc%81%ef%bc%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/33652\/","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01"},"content":{"rendered":"<p><strong>\u680f\u76ee<\/strong><strong>\u4eca\u5929\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u5f00\u53d1\u7b14\u8bb0\uff0c\u5feb\u5feb\u6765\u770b\u3002<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/052\/5f801d4ea181d475.jpg\" class=\"aligncenter\" title=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01\u63d2\u56fe\" alt=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01\u63d2\u56fe\" \/><\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u6700\u8fd1\u5728\u5f00\u53d1\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\uff0c\u628a\u81ea\u5df1\u5728\u9879\u76ee\u4e2d\u7ecf\u5e38\u9047\u5230\u7684\u77e5\u8bc6\u70b9\u8bb0\u5f55\u4e0b\u6765\uff0c\u4ee5\u4fbf\u4e0b\u6b21\u5f00\u53d1\u7684\u65f6\u5019\u67e5\u770b\u3002<br \/>\u5f00\u53d1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5de5\u5177\u63a8\u8350vscode\u5199\u4ee3\u7801\uff0c\u5fae\u4fe1\u5f00\u53d1\u5de5\u5177\u7528\u4e8e\u67e5\u770b\u6548\u679c\u548c\u8c03\u8bd5\u3002<\/p>\n<h2> <span><\/span><span style=\"font-size: 18px;font-weight: bold;padding-left: 10px;border-left: 5px solid #DEC6FB;color: #595959\">1\u3001\u81ea\u5b9a\u4e49\u6807\u9898\u680f<\/span><span><\/span> <\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u73b0\u5728UI\u8981\u6c42\u8d8a\u6765\u8d8a\u9ad8\uff0c\u9ad8\u9891\u51fa\u73b0\u81ea\u5b9a\u4e49\u6807\u9898\u680f\u7684\u60c5\u51b5<\/p>\n<pre>\"navigationStyle\":&nbsp;\"custom\"\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h2> <span><\/span><span style=\"font-size: 18px;font-weight: bold;padding-left: 10px;border-left: 5px solid #DEC6FB;color: #595959\">2\u3001\u83b7\u53d6\u7528\u6237\u4fe1\u606f<\/span><span><\/span> <\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u7528\u6237\u6388\u6743\u662f\u6bcf\u4e2a\u5c0f\u7a0b\u5e8f\u4e2d\u90fd\u4f1a\u7528\u5230\u7684\uff0c\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9879\u76ee\u6d41\u7a0b\u7f16\u5199\u81ea\u5df1\u7684\u903b\u8f91\u3002 \u7528\u6237\u6388\u6743<\/p>\n<pre>&lt;button&gt;\u6388\u6743\u767b\u5f55&lt;\/button&gt;\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>bindGetUserInfo&nbsp;(e)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;console.log(e.detail.userInfo)&nbsp;\/\/&nbsp;\u83b7\u53d6\u5230\u7528\u6237\u4fe1\u606f}\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u5df2\u6388\u6743\u7684\u60c5\u51b5\u4e0b\u8c03\u7528<strong>\u300cwx.getUserInfo\u300d<\/strong>\uff0c<strong>\u300cwx.getSetting\u300d<\/strong>\u8fdb\u884c\u5224\u65ad\u8be5\u7528\u6237\u662f\u5426\u6388\u6743<\/p>\n<pre>wx.getSetting({&nbsp;&nbsp;success&nbsp;(res){&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(res.authSetting['scope.userInfo'])&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;\u5df2\u7ecf\u6388\u6743\uff0c\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528&nbsp;getUserInfo&nbsp;\u83b7\u53d6\u5934\u50cf\u6635\u79f0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wx.getUserInfo({&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success:&nbsp;function(res)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(res.userInfo)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;\u672a\u6388\u6743&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;}})\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h2> <span><\/span><span style=\"font-size: 18px;font-weight: bold;padding-left: 10px;border-left: 5px solid #DEC6FB;color: #595959\">3\u3001input \u8bbe\u7f6eplaceholder\u6837\u5f0f<\/span><span><\/span> <\/h2>\n<pre>&lt;input&gt;\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>.placeholderinput&nbsp;{&nbsp;&nbsp;color:&nbsp;#CCCCCF;&nbsp;&nbsp;font-size:&nbsp;36rpx;}\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h2> <span><\/span><span style=\"font-size: 18px;font-weight: bold;padding-left: 10px;border-left: 5px solid #DEC6FB;color: #595959\">4\u3001\u8def\u7531<\/span><span><\/span> <\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u8def\u7531\u8df3\u8f6c\u7528\u5230\u7684\u6bd4\u8f83\u591a\uff0c\u6bcf\u6b21\u8df3\u8f6c\u7684\u65f6\u5019\u603b\u662f\u4e0d\u80fd\u533a\u5206\u7528\u54ea\u4e00\u4e2a\u65b9\u5f0f\u8fdb\u884c\u8df3\u8f6c\uff0c\u8bb0\u4e0b\u6765\uff0c\u52a0\u6df1\u4e00\u4e0b\u5370\u8c61\u3002<br \/>\u8df3\u8f6c\u5230 tabBar \u9875\u9762\uff0c\u5e76\u5173\u95ed\u5176\u4ed6\u6240\u6709\u975e tabBar \u9875\u9762<\/p>\n<pre>wx.switchTab({&nbsp;&nbsp;&nbsp;&nbsp;url:&nbsp;'..\/..\/index\/index'})\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u8df3\u8f6c\u5230\u5e94\u7528\u5185\u7684\u67d0\u4e2a\u9875\u9762\uff0c\u4f46\u662f\u4e0d\u5141\u8bb8\u8df3\u8f6c\u5230 tabbar \u9875\u9762\uff0c\u5e76\u5173\u95ed\u5f53\u524d\u9875\u9762<\/p>\n<pre>wx.redirectTo({&nbsp;&nbsp;&nbsp;&nbsp;url:&nbsp;'..\/..\/index\/index'})\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u4fdd\u7559\u5f53\u524d\u9875\u9762\uff0c\u8df3\u8f6c\u5230\u5e94\u7528\u5185\u7684\u67d0\u4e2a\u9875\u9762\u3002\u4f46\u662f\u4e0d\u80fd\u8df3\u5230 tabbar \u9875\u9762\u3002<\/p>\n<pre>wx.navigateTo({&nbsp;&nbsp;&nbsp;&nbsp;url:&nbsp;'..\/..\/index\/index'})\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h2> <span><\/span><span style=\"font-size: 18px;font-weight: bold;padding-left: 10px;border-left: 5px solid #DEC6FB;color: #595959\">5\u3001image\u7ec4\u4ef6\u5e38\u7528mode\u5408\u6cd5\u503c\u68b3\u7406<\/span><span><\/span> <\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u4e3a\u4ec0\u4e48\u8be6\u7ec6\u8bb2\u89e3image\uff0c\u6bcf\u6b21\u540e\u53f0\u4e0a\u4f20\u7684\u56fe\u7247\u548c\u6211\u4eec\u524d\u7aef\u754c\u9762\u7684\u5c3a\u5bf8\u4e0d\u4e00\u6837\uff0c\u6211\u4eec\u524d\u7aef\u5c31\u8981\u8fdb\u884c\u5904\u7406\u4e86\uff0c\u8fd8\u6709\u5c31\u662f\u6d4b\u8bd5\u8001\u662f\u56de\u63d0\u51fa\u4e00\u4e9b\u56fe\u7247\u53d8\u5f62\u4e0a\u7684\u95ee\u9898\uff0c\u4e3a\u4e86\u4e0d\u8ba9\u4ed6\u4eec\u63d0\u51fa\u8fd9\u4e9b\u95ee\u9898\uff0c\u6211\u4eec\u8be6\u7ec6\u5206\u6790\u4e00\u4e0b\uff0c\u5982\u679c\u6709\u4e0d\u6b63\u786e\u6b22\u8fce\u4ea4\u6d41\u6307\u6b63\u3002 \u5728\u56fa\u5b9a\u5bbd\u9ad8\u7684\u60c5\u51b5\u4e0b\uff1a<\/p>\n<pre>&nbsp;&lt;image&gt;&lt;\/image&gt;\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>.pic&nbsp;{&nbsp;&nbsp;width:&nbsp;600rpx;&nbsp;&nbsp;height:&nbsp;500rpx;&nbsp;&nbsp;border:&nbsp;1rpx&nbsp;solid&nbsp;#ccc;}\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u8bbe\u7f6e\u4ee5\u4e0b\u5c5e\u6027\u56fe\u7247\u4f1a\u53d1\u751f\u4ec0\u4e48\u53d8\u5316<\/p>\n<ul>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">scaleToFill &nbsp;\u56fe\u7247\u7684\u5bbd\u9ad8\u5b8c\u5168\u62c9\u4f38\u81f3\u586b\u6ee1 image \u5143\u7d20\uff0c\u4f1a\u6539\u53d8\u56fe\u7247\u7684\u5bbd\u9ad8\u6bd4\uff0c\u56fe\u7247\u53d8\u5f62<\/p>\n<p> <img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/052\/ce39a5545435152fb1fa6d8c87050032-0.jpg\" style=\"max-width:90%\" title=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01\u63d2\u56fe1\" alt=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01\u63d2\u56fe1\" \/> <\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">aspectFit \u56fe\u7247\u5b8c\u6574\u7684\u5c55\u793a\u51fa\u6765\uff0c\u56fe\u7247\u7684\u5bbd\u9ad8\u6bd4\u4e0d\u53d8\u3002<\/p>\n<p> <img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/052\/6d663ad67888839d8acb6ea29d4761ef-1.jpg\" style=\"max-width:90%\" title=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01\u63d2\u56fe2\" alt=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01\u63d2\u56fe2\" \/> <\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">aspectFill \u56fe\u7247\u7684\u5bbd\u9ad8\u6bd4\u4e0d\u53d8\uff0c\u4e3a\u5b8c\u6574\u7684\u5c55\u793a\uff0c\u4f1a\u53d1\u751f\u88c1\u5207 &nbsp;<\/p>\n<p> <img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/052\/4af6366cd00aaf8d11f8a59d35c7c856-2.jpg\" style=\"max-width:90%\" title=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01\u63d2\u56fe3\" alt=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01\u63d2\u56fe3\" \/> <\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u5e38\u7528\u7684<strong>\u300caspectFit\u300d<\/strong> &nbsp;<strong>\u300caspectFill\u300d<\/strong>\u8fd9\u4e24\u4e2a<\/p>\n<h2> <span><\/span><span style=\"font-size: 18px;font-weight: bold;padding-left: 10px;border-left: 5px solid #DEC6FB;color: #595959\">6\u3001\u8bbe\u7f6einput\u7684<strong>\u300cconfirm-type\u300d<\/strong> \u7684\u5408\u6cd5\u503c<\/span><span><\/span> <\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u8bbe\u7f6e\u952e\u76d8\u53f3\u4e0b\u89d2\u6309\u94ae\u7684\u6587\u5b57\uff0ctype=&#8221;text&#8221;\u65f6\u751f\u6548<\/p>\n<ul>\n<li> send \u53f3\u4e0b\u89d2\u6309\u94ae\u4e3a\u201c\u53d1\u9001\u201d <\/li>\n<li> search \u53f3\u4e0b\u89d2\u6309\u94ae\u4e3a\u201c\u641c\u7d22\u201d <\/li>\n<li> next \u53f3\u4e0b\u89d2\u6309\u94ae\u4e3a\u201c\u4e0b\u4e00\u4e2a\u201d <\/li>\n<li> go \u53f3\u4e0b\u89d2\u6309\u94ae\u4e3a\u201c\u524d\u5f80\u201d <\/li>\n<li> done \u53f3\u4e0b\u89d2\u6309\u94ae\u4e3a\u201c\u5b8c\u6210\u201d <\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: #595959;margin: 10px 0px;letter-spacing: 2px;font-size: 14px\">\u4e3a\u4e86\u5b9e\u73b0\u5b89\u5353ios\u7684\u7edf\u4e00confirm-type\u7684\u8bbe\u7f6e\u4e5f\u662f\u5f88\u6709\u5fc5\u8981\uff0c\u9ed8\u8ba4\u503c\u662f done\uff0c\u5b89\u5353\u9ed8\u8ba4\u662f\u56de\u8f66\uff0cios\u9ed8\u8ba4\u662f\u5b8c\u6210\uff0c\u6240\u4ee5\u8bbe\u7f6e\u540c\u4e00\u53ea\u524d\u56db\u4e2a\u662f\u53ef\u4ee5\u7edf\u4e00\u7684\u3002<\/p>\n<blockquote><p>\n  \u76f8\u5173\u514d\u8d39\u5b66\u4e60\u63a8\u8350\uff1a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u6559\u7a0b\n<\/p><\/blockquote>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7b14\u8bb0\uff0c\u6536\u85cf\uff01\uff01\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u680f\u76ee\u4eca\u5929\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u5f00\u53d1\u7b14\u8bb0\uff0c\u5feb\u5feb\u6765\u770b\u3002 \u6700\u8fd1\u5728\u5f00\u53d1\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\uff0c\u628a\u81ea\u5df1\u5728\u9879\u76ee\u4e2d\u7ecf\u5e38\u9047\u5230\u7684\u77e5\u8bc6\u70b9\u8bb0\u5f55\u4e0b\u6765\uff0c\u4ee5\u4fbf\u4e0b\u6b21\u5f00\u53d1\u7684\u65f6\u5019\u67e5\u770b\u3002\u5f00\u53d1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5de5\u5177\u63a8\u8350vscode\u5199\u4ee3\u7801\uff0c\u5fae\u4fe1\u5f00\u53d1\u5de5\u5177\u7528\u4e8e\u67e5\u770b\u6548\u679c\u548c\u8c03\u8bd5\u3002 1\u3001\u81ea\u5b9a\u4e49\u6807\u9898\u680f \u73b0\u5728UI\u8981\u6c42\u8d8a\u6765\u8d8a\u9ad8\uff0c\u9ad8\u9891\u51fa\u73b0\u81ea\u5b9a\u4e49\u6807\u9898\u680f\u7684\u60c5\u51b5 &#8220;navigationStyle&#8221;:&nbsp;&#8220;custom&#8221;\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 2\u3001\u83b7\u53d6\u7528\u6237\u4fe1\u606f \u7528\u6237\u6388\u6743\u662f\u6bcf\u4e2a\u5c0f\u7a0b\u5e8f\u4e2d\u90fd\u4f1a\u7528\u5230\u7684\uff0c\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9879\u76ee\u6d41\u7a0b\u7f16\u5199\u81ea\u5df1\u7684\u903b\u8f91\u3002 \u7528\u6237\u6388\u6743 &lt;button&gt;\u6388\u6743\u767b\u5f55&lt;\/button&gt;\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 bindGetUserInfo&nbsp;(e)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;console.log(e.detail.userInfo)&nbsp;\/\/&nbsp;\u83b7\u53d6\u5230\u7528\u6237\u4fe1\u606f}\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 \u5df2\u6388\u6743\u7684\u60c5\u51b5\u4e0b\u8c03\u7528\u300cwx.getUserInfo\u300d\uff0c\u300cwx.getSetting\u300d\u8fdb\u884c\u5224\u65ad\u8be5\u7528\u6237\u662f\u5426\u6388\u6743 wx.getSetting({&nbsp;&nbsp;success&nbsp;(res){&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(res.authSetting[&#8216;scope.userInfo&#8217;])&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;\u5df2\u7ecf\u6388\u6743\uff0c\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528&nbsp;getUserInfo&nbsp;\u83b7\u53d6\u5934\u50cf\u6635\u79f0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wx.getUserInfo({&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success:&nbsp;function(res)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(res.userInfo)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;\u672a\u6388\u6743&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;}})\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 3\u3001input \u8bbe\u7f6eplaceholder\u6837\u5f0f &lt;input&gt;\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 .placeholderinput&nbsp;{&nbsp;&nbsp;color:&nbsp;#CCCCCF;&nbsp;&nbsp;font-size:&nbsp;36rpx;}\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 4\u3001\u8def\u7531 \u8def\u7531\u8df3\u8f6c\u7528\u5230\u7684\u6bd4\u8f83\u591a\uff0c\u6bcf\u6b21\u8df3\u8f6c\u7684\u65f6\u5019\u603b\u662f\u4e0d\u80fd\u533a\u5206\u7528\u54ea\u4e00\u4e2a\u65b9\u5f0f\u8fdb\u884c\u8df3\u8f6c\uff0c\u8bb0\u4e0b\u6765\uff0c\u52a0\u6df1\u4e00\u4e0b\u5370\u8c61\u3002\u8df3\u8f6c\u5230 tabBar \u9875\u9762\uff0c\u5e76\u5173\u95ed\u5176\u4ed6\u6240\u6709\u975e tabBar \u9875\u9762 wx.switchTab({&nbsp;&nbsp;&nbsp;&nbsp;url:&nbsp;&#8216;..\/..\/index\/index&#8217;})\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 \u8df3\u8f6c\u5230\u5e94\u7528\u5185\u7684\u67d0\u4e2a\u9875\u9762\uff0c\u4f46\u662f\u4e0d\u5141\u8bb8\u8df3\u8f6c\u5230 tabbar \u9875\u9762\uff0c\u5e76\u5173\u95ed\u5f53\u524d\u9875\u9762 wx.redirectTo({&nbsp;&nbsp;&nbsp;&nbsp;url:&nbsp;&#8216;..\/..\/index\/index&#8217;})\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 \u4fdd\u7559\u5f53\u524d\u9875\u9762\uff0c\u8df3\u8f6c\u5230\u5e94\u7528\u5185\u7684\u67d0\u4e2a\u9875\u9762\u3002\u4f46\u662f\u4e0d\u80fd\u8df3\u5230 tabbar \u9875\u9762\u3002 wx.navigateTo({&nbsp;&nbsp;&nbsp;&nbsp;url:&nbsp;&#8216;..\/..\/index\/index&#8217;})\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 5\u3001image\u7ec4\u4ef6\u5e38\u7528mode\u5408\u6cd5\u503c\u68b3\u7406 \u4e3a\u4ec0\u4e48\u8be6\u7ec6\u8bb2\u89e3image\uff0c\u6bcf\u6b21\u540e\u53f0\u4e0a\u4f20\u7684\u56fe\u7247\u548c\u6211\u4eec\u524d\u7aef\u754c\u9762\u7684\u5c3a\u5bf8\u4e0d\u4e00\u6837\uff0c\u6211\u4eec\u524d\u7aef\u5c31\u8981\u8fdb\u884c\u5904\u7406\u4e86\uff0c\u8fd8\u6709\u5c31\u662f\u6d4b\u8bd5\u8001\u662f\u56de\u63d0\u51fa\u4e00\u4e9b\u56fe\u7247\u53d8\u5f62\u4e0a\u7684\u95ee\u9898\uff0c\u4e3a\u4e86\u4e0d\u8ba9\u4ed6\u4eec\u63d0\u51fa\u8fd9\u4e9b\u95ee\u9898\uff0c\u6211\u4eec\u8be6\u7ec6\u5206\u6790\u4e00\u4e0b\uff0c\u5982\u679c\u6709\u4e0d\u6b63\u786e\u6b22\u8fce\u4ea4\u6d41\u6307\u6b63\u3002 \u5728\u56fa\u5b9a\u5bbd\u9ad8\u7684\u60c5\u51b5\u4e0b\uff1a &nbsp;&lt;image&gt;&lt;\/image&gt;\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 .pic&nbsp;{&nbsp;&nbsp;width:&nbsp;600rpx;&nbsp;&nbsp;height:&nbsp;500rpx;&nbsp;&nbsp;border:&nbsp;1rpx&nbsp;solid&nbsp;#ccc;}\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 \u8bbe\u7f6e\u4ee5\u4e0b\u5c5e\u6027\u56fe\u7247\u4f1a\u53d1\u751f\u4ec0\u4e48\u53d8\u5316 scaleToFill &nbsp;\u56fe\u7247\u7684\u5bbd\u9ad8\u5b8c\u5168\u62c9\u4f38\u81f3\u586b\u6ee1 image \u5143\u7d20\uff0c\u4f1a\u6539\u53d8\u56fe\u7247\u7684\u5bbd\u9ad8\u6bd4\uff0c\u56fe\u7247\u53d8\u5f62 aspectFit \u56fe\u7247\u5b8c\u6574\u7684\u5c55\u793a\u51fa\u6765\uff0c\u56fe\u7247\u7684\u5bbd\u9ad8\u6bd4\u4e0d\u53d8\u3002 aspectFill [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-33652","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=33652"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33652\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=33652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=33652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=33652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}