{"id":29696,"date":"2024-11-25T08:02:32","date_gmt":"2024-11-25T00:02:32","guid":{"rendered":"https:\/\/fwq.ai\/blog\/29696\/"},"modified":"2024-11-25T08:02:32","modified_gmt":"2024-11-25T00:02:32","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91%e7%9a%84%e5%9b%9b%e5%8d%81%e4%b8%aa%e6%8a%80%e6%9c%af%e7%aa%8d%e9%97%a8%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/29696\/","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7684\u56db\u5341\u4e2a\u6280\u672f\u7a8d\u95e8\u603b\u7ed3"},"content":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e86\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7684\u56db\u5341\u4e2a\u6280\u672f\u7a8d\u95e8\u7684\u76f8\u5173\u8d44\u6599\uff0c\u76f8\u4fe1\u5bf9\u5927\u5bb6\u7684\u5b66\u4e60\u6216\u8005\u4f7f\u7528\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5177\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u501f\u9274\u4ef7\u503c\uff0c\u6240\u4ee5\u7279\u522b\u63a8\u8350\u7ed9\u5927\u5bb6\uff0c\u9700\u8981\u7684\u670b\u53cb\u4eec\u53ef\u4ee5\u4e00\u8d77\u6765\u770b\u770b\u5427\u3002<\/p>\n<p><strong>\u524d\u8a00<\/strong><\/p>\n<p>\u5fae\u4fe1\u201c\u5c0f\u7a0b\u5e8f\u201d\u6b63\u5f0f\u4e0a\u7ebf\u4e00\u5468\u65f6\u95f4\uff0c\u76f8\u5173\u8bdd\u9898\u6301\u7eed\u5347\u6e29\u3002\u652f\u4ed8\u5b9d\u5f00\u53d1\u201c\u5c0f\u7a0b\u5e8f\u201d\u7684\u6d88\u606f\u4e5f\u968f\u5373\u66dd\u51fa\uff0c\u4e92\u8054\u7f51\u5de8\u5934\u4eec\u6469\u62f3\u64e6\u638c\uff0c\u4e0d\u5c11\u7f51\u53cb\u8c03\u4f83\u8bf4\uff0c\u8fd9\u52bf\u5934\u611f\u89c9\u8981\u6311\u6218\u73b0\u6709\u7684\u201cAPP\u5e1d\u56fd\u201d\u4e86\u3002\u90a3\u4e48\uff0c\u9762\u5bf9\u5982\u6b64\u7099\u624b\u53ef\u70ed\u7684\u5c0f\u7a0b\u5e8f\uff0cWeX5\u79fb\u52a8\u5f00\u53d1\u4e91\u4e5f\u6ca1\u6709\u95f2\u7740\uff0c\u7ecf\u8fc7\u5168\u7f51\u641c\u7d22\uff0c\u4e3a\u5927\u5bb6\u7b5b\u9009\u51fa\u4e00\u6761\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u8005\u7684\u5fc5\u8bfb\u6587\u7ae0\uff0c\u5185\u5bb9\u6db5\u76d6\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5b9e\u6218\u9700\u8981\u6ce8\u610f\u768440\u4e2a\u6280\u672f\u70b9\uff0c\u4f9b\u5927\u5bb6\u53c2\u8003\uff01<\/p>\n<p><strong>Q:\u4e3a\u4ec0\u4e48\u811a\u672c\u5185\u4e0d\u80fd\u4f7f\u7528window\u7b49\u5bf9\u8c61<\/strong><\/p>\n<p>A:\u9875\u9762\u7684\u811a\u672c\u903b\u8f91\u662f\u5728JsCore\u4e2d\u8fd0\u884c\uff0cJsCore\u662f\u4e00\u4e2a\u6ca1\u6709\u7a97\u53e3\u5bf9\u8c61\u7684\u73af\u5883\uff0c\u6240\u4ee5\u4e0d\u80fd\u5728\u811a\u672c\u4e2d\u4f7f\u7528window\uff0c\u4e5f\u65e0\u6cd5\u5728\u811a\u672c\u4e2d\u64cd\u4f5c\u7ec4\u4ef6<\/p>\n<p><strong>Q:\u4e3a\u4ec0\u4e48 zepto\/jquery \u65e0\u6cd5\u4f7f\u7528<\/strong><\/p>\n<p>A:zepto\/jquery \u4f1a\u4f7f\u7528\u5230window\u5bf9\u8c61\u548cdocument\u5bf9\u8c61\uff0c\u6240\u4ee5\u65e0\u6cd5\u4f7f\u7528\u3002<\/p>\n<p><strong>Q:wx.navigateTo\u65e0\u6cd5\u6253\u5f00\u9875\u9762<\/strong><\/p>\n<p>A:\u4e00\u4e2a\u5e94\u7528\u540c\u65f6\u53ea\u80fd\u6253\u5f005\u4e2a\u9875\u9762\uff0c\u5f53\u5df2\u7ecf\u6253\u5f00\u4e865\u4e2a\u9875\u9762\u4e4b\u540e\uff0cwx.navigateTo\u4e0d\u80fd\u6b63\u5e38\u6253\u5f00\u65b0\u9875\u9762\u3002\u8bf7\u907f\u514d\u591a\u5c42\u7ea7\u7684\u4ea4\u4e92\u65b9\u5f0f\uff0c\u6216\u8005\u4f7f\u7528wx.redirectTo<\/p>\n<p><strong>Q:\u6837\u5f0f\u8868\u4e0d\u652f\u6301\u7ea7\u8054\u9009\u62e9\u5668<\/strong><\/p>\n<p>A:WXSS\u652f\u6301\u4ee5.\u5f00\u59cb\u7684\u7c7b\u9009\u62e9\u5668\u3002<\/p>\n<p><strong>Q\uff1a\u672c\u5730\u8d44\u6e90\u65e0\u6cd5\u901a\u8fc7 css \u83b7\u53d6<br \/><\/strong><\/p>\n<p>A\uff1abackground-image\uff1a\u53ef\u4ee5\u4f7f\u7528\u7f51\u7edc\u56fe\u7247\uff0c\u6216\u8005 base64\uff0c\u6216\u8005\u4f7f\u7528<img>\u6807\u7b7e<\/p>\n<p><strong>Q\uff1a\u5982\u4f55\u4fee\u6539\u7a97\u53e3\u7684\u80cc\u666f\u8272<\/strong><\/p>\n<p>A\uff1a\u4f7f\u7528 page \u6807\u7b7e\u9009\u62e9\u5668\uff0c\u53ef\u4ee5\u4fee\u6539\u9876\u5c42\u8282\u70b9\u7684\u6837\u5f0f<\/p>\n<p><\/p>\n<pre>page&nbsp;{&nbsp;\r\n&nbsp;&nbsp;display:&nbsp;block;&nbsp;\r\n&nbsp;&nbsp;min-height:&nbsp;100%;&nbsp;\r\n&nbsp;&nbsp;background-color:&nbsp;red;\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>Q\uff1a\u4e3a\u4ec0\u4e48\u4e0a\u4f20\u4e0d\u6210\u529f<\/strong><\/p>\n<p>A\uff1a\u4e3a\u4e86\u63d0\u5347\u4f53\u9a8c\u6d41\u7545\u5ea6\uff0c\u7f16\u8bd1\u540e\u7684\u4ee3\u7801\u5305\u5927\u5c0f\u9700\u5c0f\u4e8e 1MB \uff0c\u5927\u4e8e 1MB \u7684\u4ee3\u7801\u5305\u5c06\u4e0a\u4f20\u5931\u8d25\u3002<\/p>\n<p><strong>Q\uff1aHTTPS \u8bf7\u6c42\u4e0d\u6210\u529f<br \/><\/strong><\/p>\n<p>A\uff1atls \u4ec5\u652f\u6301 1.2 \u53ca\u4ee5\u4e0a\u7248\u672c<\/p>\n<p><strong>Q\uff1a\u7f51\u7edc\u8bf7\u6c42\u7684 referer<\/strong><\/p>\n<p>A\uff1a\u7f51\u7edc\u8bf7\u6c42\u7684 referer \u662f\u4e0d\u53ef\u4ee5\u8bbe\u7f6e\u7684\uff0c\u683c\u5f0f\u56fa\u5b9a\u4e3a https:\/\/servicewechat.com\/{appid}\/{version}\/page-frame.html\uff0c\u5176\u4e2d {appid} \u4e3a\u5c0f\u7a0b\u5e8f\u7684 appid\uff0c {version} \u4e3a\u5c0f\u7a0b\u5e8f\u7684\u7248\u672c\u53f7\uff0c\u7248\u672c\u53f7\u4e3a 0 \u8868\u793a\u4e3a\u5f00\u53d1\u7248\u3002<\/p>\n<p><strong>Q\uff1a\u4e0d\u80fd\u76f4\u63a5\u64cd\u4f5c Page.data<br \/><\/strong><\/p>\n<p>A\uff1a\u907f\u514d\u5728\u76f4\u63a5\u5bf9 Page.data \u8fdb\u884c\u8d4b\u503c\u4fee\u6539\uff0c\u8bf7\u4f7f\u7528 Page.setData \u8fdb\u884c\u64cd\u4f5c\u624d\u80fd\u5c06\u6570\u636e\u540c\u6b65\u5230\u9875\u9762\u4e2d\u8fdb\u884c\u6e32\u67d3\u600e\u4e48\u83b7\u53d6\u7528\u6237\u8f93\u5165<\/p>\n<p>\u80fd\u591f\u83b7\u53d6\u7528\u6237\u8f93\u5165\u7684\u7ec4\u4ef6\uff0c\u9700\u8981\u4f7f\u7528\u7ec4\u4ef6\u7684\u5c5e\u6027bindchange\u5c06\u7528\u6237\u7684\u8f93\u5165\u5185\u5bb9\u540c\u6b65\u5230 AppService\u3002<\/p>\n<p><\/p>\n<pre>&lt;input&gt;&lt;checkbox&gt;&lt;\/checkbox&gt;\r\nvar&nbsp;inputContent&nbsp;=&nbsp;{}\r\n&nbsp;\r\nPage({\r\n&nbsp;data:&nbsp;{\r\n&nbsp;inputContent:&nbsp;{}\r\n&nbsp;},\r\n&nbsp;bindChange:&nbsp;function(e)&nbsp;{\r\n&nbsp;inputContent[e.currentTarget.id]&nbsp;=&nbsp;e.detail.value\r\n&nbsp;}\r\n})<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>Q\uff1a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u6301fetch\u6216\u8005promise\u5417?<\/strong><\/p>\n<p>A\uff1apromise\u5de5\u5177\u76ee\u524d\u4e0d\u652f\u6301\uff0cfetch \u5ba2\u6237\u7aef\u4e0d\u652f\u6301 \u5de5\u5177\u4e0b\u4e2a\u7248\u672c\u4fdd\u6301\u7edf\u4e00\u3002<\/p>\n<p><strong>Q\uff1atouchmove\u6ed1\u52a8\u4e8b\u4ef6\u91cc\u9762\u7684currentTarget. id\u503c\u4e0d\u53d8\u52a8\u3002<\/strong><\/p>\n<p>A\uff1aouchmove \/ touchend \u4e8b\u4ef6\u7684 target \/ currentTarget \u4f1a\u6c38\u8fdc\u662f touchstart \u65f6\u7684 target \/ currentTarget \u3002<\/p>\n<p><strong>Q\uff1awx.request\u7684POST\u65b9\u6cd5\u7684\u53c2\u6570\u4f20\u8f93\u670d\u52a1\u5668\u63a5\u6536\u4e0d\u5230\u7684bug\u3002<br \/><\/strong><\/p>\n<p>A\uff1awx.request post \u7684 content-type \u9ed8\u8ba4\u4e3a \u2018application\/json &#8216;<\/p>\n<p>\u5982\u679c\u670d\u52a1\u5668\u6ca1\u6709\u7528\u5230 json \u89e3\u91ca\u7684\u8bdd\uff0c\u53ef\u4ee5\u628a content-type \u8bbe\u7f6e\u56de urlencoded\u3002<\/p>\n<p><\/p>\n<pre>wx.request({\r\n....\r\nmethod:&nbsp;\"POST\",\r\nheader:&nbsp;{\r\n\"content-type\":&nbsp;\"application\/x-www-form-urlencoded\"\r\n},\r\n...\r\n})<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>Q\uff1awx.uploadFile\u5728\u624b\u673a\u4e0a\u8fd4\u56dehttp\u7801403\u3002<br \/><\/strong><\/p>\n<p>A\uff1a\u5b89\u5353\u7684\u5fae\u4fe1\u5347\u7ea7\u52306.5.2\u53ca\u5176\u4ee5\u4e0a\u7248\u672c\u3002<\/p>\n<p><strong>Q\uff1a\u5c0f\u7a0b\u5e8fSVG\u652f\u6301\u5417?<\/strong><\/p>\n<p>A\uff1aimage\u7684src\u653e\u8fdc\u7a0bsvg\u53ef\u4ee5\uff0cbackground-image\u91cc\u4e5f\u53ef\u4ee5\u3002<\/p>\n<p><strong>Q\uff1awx.request\u8fd4\u56destatusCode\u4e24\u7aef\u7c7b\u578b\u4e0d\u4e00\u81f4\u3002<\/strong><\/p>\n<p>A\uff1a\u786e\u5b9e\u6709\u8fd9\u4e2a\u95ee\u9898\uff0c\u7a0d\u540e\u7684\u7248\u672c\u5c06\u4f1a\u4fee\u590d\u3002<\/p>\n<p><strong>Q\uff1a\u5173\u4e8e\u7ec4\u4ef6\u7684\u52a8\u6001\u751f\u6210\u4e0e\u9500\u6bc1\uff1f<br \/><\/strong><\/p>\n<p>A\uff1a\u4e0d\u652f\u6301\u52a8\u6001\u751f\u6210\u7ec4\u4ef6\uff0c\u4f46\u53ef\u4ee5\u7528 wx:for \u53bb\u6e32\u67d3\u591a\u4e2a\u3002<\/p>\n<p><strong>Q\uff1a\u5c0f\u7a0b\u5e8f\u652f\u6301\u70ed\u66f4\u5417\uff1f<\/strong><\/p>\n<p>A\uff1a\u4e0d\u652f\u6301\u5f00\u53d1\u8005\u81ea\u884c\u66f4\u66ff\u3002<\/p>\n<p><strong>Q\uff1a\u4e00\u4e9b\u63a5\u53e3\u7684\u56de\u8c03IOS\u548cAndroid\u4e0d\u4e00\u81f4\uff0c\u4f8b\u5982\u652f\u4ed8\u63a5\u53e3\uff0c\u7528\u6237\u53d6\u6d88\u652f\u4ed8\u540e\uff0cios\u53ea\u56de\u8c03complete\u65b9\u6cd5\uff0candroid\u5219\u56de\u8c03fail\u65b9\u6cd5\uff0c\u5b98\u65b9\u6587\u6863\u4e5f\u6ca1\u6709\u4efb\u4f55\u56de\u8c03\u8bf4\u660e\uff0c\u9020\u6210\u5f00\u53d1\u5f88\u56f0\u96be\uff1b\u7c7b\u4f3c\u7684\u8fd8\u6709\u56fe\u7247\u9009\u62e9\u63a5\u53e3\uff0c\u5206\u4eab\u63a5\u53e3\u7b49\u7b49\u3002<\/strong><\/p>\n<p>A\uff1a\u652f\u4ed8\u63a5\u53e3\uff0c\u7528\u6237\u53d6\u6d88\u652f\u4ed8\u540e\uff0cios\u53ea\u56de\u8c03complete\u65b9\u6cd5\uff0candroid\u5219\u56de\u8c03fail\u65b9\u6cd5\uff0c\u95ee\u9898\u5df2\u8bb0\u5f55\uff0c\u591a\u8c22\u53cd\u9988\u3002<\/p>\n<p><strong>Q\uff1a\u5982\u679cicon\u5df2\u7ecf\u5728\u670d\u52a1\u5668\u4e0a\u4e86\uff0c\u60f3\u7528\u76f4\u63a5\u8bbf\u95ee\u7f51\u5740\u7684\u65b9\u6cd5\u52a0\u8f7d\u56fe\u7247\u8fdb\u6765\u8fd9\u6837\u53ef\u4ee5\u5417\uff1f<br \/><\/strong><\/p>\n<p>A\uff1a\u4e0d\u80fd\u3002<\/p>\n<p><strong>Q\uff1aipad\u4e0d\u80fd\u4f7f\u7528\u5c0f\u7a0b\u5e8f\uff1f<\/strong><\/p>\n<p>A\uff1a\u6682\u65f6\u4e0d\u652f\u6301ipad\u6253\u5f00\u5c0f\u7a0b\u5e8f\u3002<\/p>\n<p><strong>Q\uff1a\u5c0f\u7a0b\u5e8f\u97f3\u9891\uff0c\u89c6\u9891\u64ad\u653e\u5668\u95ee\u9898 \u30021\u3001\u80fd\u591f\u53ea\u9690\u85cf\u8fdb\u5ea6\u6761\u8ddf\u65f6\u95f4\u5417\uff1f2\u3001\u73b0\u5728iOS\u5e73\u53f0\u4e0a\u7684\u65f6\u95f4\u663e\u793a\u662f0:00\uff0c\u4f46\u662fandroid\u4e0a\u4f1a\u663e\u793a\u9519\u8bef\u7801\uff0c\u80fd\u591f\u901a\u8fc7\u4ec0\u4e48\u8bbe\u7f6e\u4fee\u6539\u5417\uff1f<\/strong><\/p>\n<p>A\uff1a1\uff1a\u4e0b\u4e2a\u7248\u672c\u4f1a\u4fee\u6539\u8fd9\u91cc\u7684\u4ea4\u4e92\uff0c\u4e0d\u663e\u793a\u8fdb\u5ea6\u6761\u548c\u65f6\u95f4\u30022\uff1a6.5.3 \u7248\u672c\u5df2\u4fee\u590d\u6b64\u95ee\u9898\u3002<\/p>\n<p><strong>Q\uff1a\u62cd\u7167\u7a97\u53e3\u53ef\u4ee5\u52a0\u6d6e\u5c42\u5417\uff1f<\/strong><\/p>\n<p>A\uff1a\u6682\u65f6\u4e0d\u652f\u6301\u3002<\/p>\n<p><strong>Q\uff1a\u5f00\u53d1\u8005\u5de5\u5177\u7ecf\u5e38\u62a5jsEngineScriptError\u9519\u8bef\uff0c\u4f1a\u5bfc\u81f4\u9875\u9762\u767d\u5c4f\u3002<\/strong><\/p>\n<p>A\uff1a\u79fb\u6b65\u4e0b\u8f7d\u6700\u65b0 0.12.130400 \u7248\u672c\u7684\u5f00\u53d1\u5de5\u5177\u8bd5\u8bd5<\/p>\n<p><strong>Q\uff1a\u5f00\u53d1\u8005\u5de5\u5177\u91cc\u9762\uff0cSPA\u9875\u9762\uff0c\u66f4\u6539title\u65e0\u6548\u3002<\/strong><\/p>\n<p>A\uff1awx.setNavigationBarTitle\u53ef\u4ee5\u901a\u8fc7 API \u6539\u53d8\u5bfc\u822a\u680f\u6807\u9898\u3002<\/p>\n<p><strong>Q\uff1a\u8bf7\u95ee\u5c0f\u7a0b\u5e8f\u9875\u5185\u652f\u6301\u957f\u6309\u4fdd\u5b58\u56fe\u7247\u6216\u5206\u4eab\u56fe\u7247\u5417\uff1f<\/strong><\/p>\n<p>A\uff1a\u76ee\u524d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd\u3002<\/p>\n<p><strong>Q\uff1a\u5173\u4e8eswiper\u4e2d\u7684current\u95ee\u9898\u3002\u5982\u679c\u5728\u65b0\u7684\u7248\u672c\u4e2d\uff0c\u76f4\u63a5\u8bbecurrent,\u4f1a\u4ea7\u751f\u7684\u6548\u679c\u662f\uff1a\u65e0\u8bba\u4ece\u54ea\u4e2aswiper\u5143\u7d20\u70b9\u51fb\u8fdb\u53bb\uff0c\u90fd\u4f1a\u663e\u793aswiper\u7b2c\u4e00\u4e2a\u5b50\u5143\u7d20\u7684\u503c\u3002<\/strong><\/p>\n<p>A\uff1a\u76ee\u524dswiper\u5728\u5904\u7406swiper-item\u52a8\u6001\u53d8\u5316\u7684\u60c5\u51b5\u65f6\u6709\u4e00\u4e9bbug\uff0c\u4f1a\u5f88\u5feb\u4fee\u590d\u7684\u3002<\/p>\n<p><strong>Q\uff1a\u5c0f\u7a0b\u5e8f\u80fd\u5f15\u7528\u81ea\u5df1\u670d\u52a1\u5668\u4e0a\u7684wxss\u548cjs\u6587\u4ef6\u5417\uff1f<\/strong><\/p>\n<p>A\uff1a\u4e0d\u80fd\uff0c\u65e0\u6cd5\u6267\u884c\u8fdc\u7a0b\u4ee3\u7801\u3002<\/p>\n<p><strong>Q\uff1a\u82f9\u679c7\uff0c\u63d0\u793a\u5185\u90e8\u9519\u8bef\uff0c\u5185\u5b58\u5360\u7528\u8fc7\u591a\u3002<\/strong><\/p>\n<p>A\uff1a\u9875\u9762\u505a\u7684\u9884\u52a0\u8f7d\uff0c\u5217\u8868\u4e2d\u6709\u56fe\u7247\uff0c\u56fe\u7247\u6e32\u67d3\u7684\u592a\u591a\u4e86\uff0c\u89e3\u51b3\u529e\u6cd5\u5c31\u662f\u4e0d\u5f53\u5c4f\u5c55\u793a\u7684\u56fe\u7247\uff0c\u4e0d\u8ba9\u5b83\u6e32\u67d3\u3002<\/p>\n<p><strong>Q\uff1a\u5c0f\u7a0b\u5e8f\u4f53\u9a8c\u8005\u5b89\u5353\u5361\u5728\u52a0\u8f7d\u9875\u9762\u8fdb\u4e0d\u53bb\uff0cIOS\u53ef\u4ee5\u8fdb\u53bb\u3002<br \/><\/strong><\/p>\n<p>A\uff1a\u8fd9\u662fandroid\u5fae\u4fe1\u5ba2\u6237\u7aef\u65e7\u7248\u672c\u7684bug\uff0c \u8bf7\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684 6.5.3 \u5ba2\u6237\u7aef\u3002<\/p>\n<p><strong>Q\uff1a\u8bf7\u95ee\u76ee\u524d\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u6301\u84dd\u7259\u5417\uff1f<\/strong><\/p>\n<p>A\uff1a\u76ee\u524d\u4e0d\u652f\u6301\u3002<\/p>\n<p><strong>Q\uff1a\u5206\u4eab\u529f\u80fd\u771f\u673a\u6ca1\u6709\u6548\u679c\uff1f<br \/><\/strong><\/p>\n<p>A\uff1a\u8fd9\u662fandroid\u5fae\u4fe1\u5ba2\u6237\u7aef\u65e7\u7248\u672c\u7684bug\uff0c \u8bf7\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684 6.5.3 \u5ba2\u6237\u7aef\u3002<\/p>\n<p><strong>Q\uff1a\u5f3a\u5236\u4f7f\u7528https\uff0c\u5f00\u53d1\u548c\u6d4b\u8bd5\u73af\u5883\u4e0b\u600e\u4e48\u8054\u8c03\u548c\u6d4b\u8bd5\uff1f<\/strong><\/p>\n<p>A\uff1a\u300c\u5fae\u4fe1web\u5f00\u53d1\u8005\u5de5\u5177\u300d-&gt;\u300c\u9879\u76ee\u300d-&gt;\u300c\u5f00\u53d1\u73af\u5883\u4e0d\u6821\u9a8c\u8bf7\u6c42\u57df\u540d\u53caTLS\u7248\u672c\u300d\u3002<\/p>\n<p><strong>Q\uff1awx.showToast()\u65b9\u6cd5\u65e0\u6548\u3002<br \/><\/strong><\/p>\n<p>\u8c03\u7528wx.request\u8bf7\u6c42\u7f51\u7edc\u7136\u540e\u5728<\/p>\n<p><\/p>\n<pre>complete:&nbsp;function&nbsp;(res)&nbsp;{\r\n&nbsp;\r\n\/\/&nbsp;complete\r\nwx.hideToast();\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u6210\u529f\u65b9\u6cd5\u91cc\u9762\u5982\u679c\u8981\u8fdb\u884cshowToast\u7684\u65f6\u5019\u611f\u89c9\u65e0\u6548\uff0c\u5e76\u6ca1\u6709\u5f39\u51fa\u63d0\u793a\u6846\u3002<\/p>\n<p>A\uff1asuccess \u56de\u8c03\u8c03\u7528\u662f\u5728 complete \u4e4b\u524d\u7684\uff0c\u5982\u679c\u5728 success showToast\uff0c\u4e0b\u4e00\u6b65 complete hideToast \u5c31\u4f1a\u88ab\u51b2\u6389 showToast\u3002<\/p>\n<p><strong>Q\uff1apicker \u7ec4\u4ef6\u4e2d\u7684\u6587\u5b57\u5927\u5c0f\u662f\u5426\u652f\u6301\u4fee\u6539\uff1f<\/strong><\/p>\n<p>A\uff1a\u4e0d\u652f\u6301\u4fee\u6539\u3002<\/p>\n<p><strong>Q\uff1atabBar\u7684\u56fe\u7247\u5728android\u548cios\u4e0a\u9762\u5927\u5c0f\u5dee\u5f02\u592a\u5927\u3002<\/strong><\/p>\n<p>A\uff1a\u8fd9\u662fandroid\u5fae\u4fe1\u5ba2\u6237\u7aef\u65e7\u7248\u672c\u7684bug\uff0c \u8bf7\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684 6.5.3 \u5ba2\u6237\u7aef<\/p>\n<p><strong>Q\uff1atabbar \u9875\u9762\u8fd4\u56de\u95ee\u9898\u3002\u975e\u9996\u9875\u7684tabbar \u9875\u9762 \u70b9\u51fb\u5de6\u4e0a\u89d2\u8fd4\u56de\u7bad\u5934\u65f6\u5982\u4f55\u8fd4\u56de\u5230\u5c0f\u7a0b\u5e8f\u9996\u9875\uff1f \u73b0\u5728\u662f\u76f4\u63a5\u9000\u51fa\u5c0f\u7a0b\u5e8f\u4e86<br \/><\/strong><\/p>\n<p>A\uff1a\u521b\u5efa\u65b0\u9875\u9762\u65f6\u7528 navigateTo \u624d\u4f1a\u65b0\u5efa\u65b0\u9875\u9762\uff0c\u540c\u65f6\u4fdd\u7559\u65e7\u9875\u9762\uff0c\u5982\u679c\u7528 redirectTo \u662f\u5728\u5f53\u524d\u9875\u9762\u5185\u8df3\u8f6c\u3002<\/p>\n<p><strong>Q\uff1a\u95ee\u4e0b wx.request() \u600e\u4e48\u8bbe\u7f6e\u6210\u540c\u6b65\u3002<\/strong><\/p>\n<p>A\uff1areqeust\u662f\u53d1\u8d77\u7f51\u7edc\u8bf7\u6c42\u3002\u6ca1\u6709\u540c\u6b65\u63a5\u53e3\u3002<\/p>\n<p><strong>Q\uff1a\u6700\u65b0mac\u7248\u5de5\u5177\u4e0d\u53ef\u7528\uff0c\u8fdb\u6765\u5c31\u51fa\u73b0\u83b7\u53d6appservice \u5931\u8d25\u3002<\/strong><\/p>\n<p>A\uff1a\u5de5\u5177\u8bbe\u7f6e\u4e2d\u9009\u62e9\u76f4\u63a5\u94fe\u63a5\u7f51\u7edc \u3002\u6216\u8005 \u7cfb\u7edf\u4e2d\u7684\u4ee3\u7406\u8f6f\u4ef6\u8bbe\u7f6e\u5de5\u5177\u76f4\u63a5\u94fe\u63a5\u7f51\u7edc\u3002<\/p>\n<p><strong>Q\uff1a\u771f\u673a view overflow-y\u4e0b\u6ed1\u4f1a\u5f88\u5361\u3002<\/strong><\/p>\n<p>A\uff1a\u7236\u5c42\u9700\u8981 position:relative; \u52a0\u4e86\u4e4b\u540e\u5c31\u4e0d\u5361\u4e86\u3002<\/p>\n<p><strong>\u603b\u7ed3<\/strong><\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7684\u56db\u5341\u4e2a\u6280\u672f\u7a8d\u95e8\u603b\u7ed3\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>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e86\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7684\u56db\u5341\u4e2a\u6280\u672f\u7a8d\u95e8\u7684\u76f8\u5173\u8d44\u6599\uff0c\u76f8\u4fe1\u5bf9\u5927\u5bb6\u7684\u5b66\u4e60\u6216\u8005\u4f7f\u7528\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5177\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u501f\u9274\u4ef7\u503c\uff0c\u6240\u4ee5\u7279\u522b\u63a8\u8350\u7ed9\u5927\u5bb6\uff0c\u9700\u8981\u7684\u670b\u53cb\u4eec\u53ef\u4ee5\u4e00\u8d77\u6765\u770b\u770b\u5427\u3002 \u524d\u8a00 \u5fae\u4fe1\u201c\u5c0f\u7a0b\u5e8f\u201d\u6b63\u5f0f\u4e0a\u7ebf\u4e00\u5468\u65f6\u95f4\uff0c\u76f8\u5173\u8bdd\u9898\u6301\u7eed\u5347\u6e29\u3002\u652f\u4ed8\u5b9d\u5f00\u53d1\u201c\u5c0f\u7a0b\u5e8f\u201d\u7684\u6d88\u606f\u4e5f\u968f\u5373\u66dd\u51fa\uff0c\u4e92\u8054\u7f51\u5de8\u5934\u4eec\u6469\u62f3\u64e6\u638c\uff0c\u4e0d\u5c11\u7f51\u53cb\u8c03\u4f83\u8bf4\uff0c\u8fd9\u52bf\u5934\u611f\u89c9\u8981\u6311\u6218\u73b0\u6709\u7684\u201cAPP\u5e1d\u56fd\u201d\u4e86\u3002\u90a3\u4e48\uff0c\u9762\u5bf9\u5982\u6b64\u7099\u624b\u53ef\u70ed\u7684\u5c0f\u7a0b\u5e8f\uff0cWeX5\u79fb\u52a8\u5f00\u53d1\u4e91\u4e5f\u6ca1\u6709\u95f2\u7740\uff0c\u7ecf\u8fc7\u5168\u7f51\u641c\u7d22\uff0c\u4e3a\u5927\u5bb6\u7b5b\u9009\u51fa\u4e00\u6761\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u8005\u7684\u5fc5\u8bfb\u6587\u7ae0\uff0c\u5185\u5bb9\u6db5\u76d6\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5b9e\u6218\u9700\u8981\u6ce8\u610f\u768440\u4e2a\u6280\u672f\u70b9\uff0c\u4f9b\u5927\u5bb6\u53c2\u8003\uff01 Q:\u4e3a\u4ec0\u4e48\u811a\u672c\u5185\u4e0d\u80fd\u4f7f\u7528window\u7b49\u5bf9\u8c61 A:\u9875\u9762\u7684\u811a\u672c\u903b\u8f91\u662f\u5728JsCore\u4e2d\u8fd0\u884c\uff0cJsCore\u662f\u4e00\u4e2a\u6ca1\u6709\u7a97\u53e3\u5bf9\u8c61\u7684\u73af\u5883\uff0c\u6240\u4ee5\u4e0d\u80fd\u5728\u811a\u672c\u4e2d\u4f7f\u7528window\uff0c\u4e5f\u65e0\u6cd5\u5728\u811a\u672c\u4e2d\u64cd\u4f5c\u7ec4\u4ef6 Q:\u4e3a\u4ec0\u4e48 zepto\/jquery \u65e0\u6cd5\u4f7f\u7528 A:zepto\/jquery \u4f1a\u4f7f\u7528\u5230window\u5bf9\u8c61\u548cdocument\u5bf9\u8c61\uff0c\u6240\u4ee5\u65e0\u6cd5\u4f7f\u7528\u3002 Q:wx.navigateTo\u65e0\u6cd5\u6253\u5f00\u9875\u9762 A:\u4e00\u4e2a\u5e94\u7528\u540c\u65f6\u53ea\u80fd\u6253\u5f005\u4e2a\u9875\u9762\uff0c\u5f53\u5df2\u7ecf\u6253\u5f00\u4e865\u4e2a\u9875\u9762\u4e4b\u540e\uff0cwx.navigateTo\u4e0d\u80fd\u6b63\u5e38\u6253\u5f00\u65b0\u9875\u9762\u3002\u8bf7\u907f\u514d\u591a\u5c42\u7ea7\u7684\u4ea4\u4e92\u65b9\u5f0f\uff0c\u6216\u8005\u4f7f\u7528wx.redirectTo Q:\u6837\u5f0f\u8868\u4e0d\u652f\u6301\u7ea7\u8054\u9009\u62e9\u5668 A:WXSS\u652f\u6301\u4ee5.\u5f00\u59cb\u7684\u7c7b\u9009\u62e9\u5668\u3002 Q\uff1a\u672c\u5730\u8d44\u6e90\u65e0\u6cd5\u901a\u8fc7 css \u83b7\u53d6 A\uff1abackground-image\uff1a\u53ef\u4ee5\u4f7f\u7528\u7f51\u7edc\u56fe\u7247\uff0c\u6216\u8005 base64\uff0c\u6216\u8005\u4f7f\u7528\u6807\u7b7e Q\uff1a\u5982\u4f55\u4fee\u6539\u7a97\u53e3\u7684\u80cc\u666f\u8272 A\uff1a\u4f7f\u7528 page \u6807\u7b7e\u9009\u62e9\u5668\uff0c\u53ef\u4ee5\u4fee\u6539\u9876\u5c42\u8282\u70b9\u7684\u6837\u5f0f page&nbsp;{&nbsp; &nbsp;&nbsp;display:&nbsp;block;&nbsp; &nbsp;&nbsp;min-height:&nbsp;100%;&nbsp; &nbsp;&nbsp;background-color:&nbsp;red; } \u767b\u5f55\u540e\u590d\u5236 Q\uff1a\u4e3a\u4ec0\u4e48\u4e0a\u4f20\u4e0d\u6210\u529f A\uff1a\u4e3a\u4e86\u63d0\u5347\u4f53\u9a8c\u6d41\u7545\u5ea6\uff0c\u7f16\u8bd1\u540e\u7684\u4ee3\u7801\u5305\u5927\u5c0f\u9700\u5c0f\u4e8e 1MB \uff0c\u5927\u4e8e 1MB \u7684\u4ee3\u7801\u5305\u5c06\u4e0a\u4f20\u5931\u8d25\u3002 Q\uff1aHTTPS \u8bf7\u6c42\u4e0d\u6210\u529f A\uff1atls \u4ec5\u652f\u6301 1.2 \u53ca\u4ee5\u4e0a\u7248\u672c Q\uff1a\u7f51\u7edc\u8bf7\u6c42\u7684 referer A\uff1a\u7f51\u7edc\u8bf7\u6c42\u7684 referer \u662f\u4e0d\u53ef\u4ee5\u8bbe\u7f6e\u7684\uff0c\u683c\u5f0f\u56fa\u5b9a\u4e3a https:\/\/servicewechat.com\/{appid}\/{version}\/page-frame.html\uff0c\u5176\u4e2d {appid} \u4e3a\u5c0f\u7a0b\u5e8f\u7684 appid\uff0c {version} \u4e3a\u5c0f\u7a0b\u5e8f\u7684\u7248\u672c\u53f7\uff0c\u7248\u672c\u53f7\u4e3a 0 \u8868\u793a\u4e3a\u5f00\u53d1\u7248\u3002 Q\uff1a\u4e0d\u80fd\u76f4\u63a5\u64cd\u4f5c [&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-29696","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29696","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=29696"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29696\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=29696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=29696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=29696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}