{"id":28780,"date":"2024-11-25T16:46:21","date_gmt":"2024-11-25T08:46:21","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28780\/"},"modified":"2024-11-25T16:46:21","modified_gmt":"2024-11-25T08:46:21","slug":"%e5%88%86%e4%ba%ab%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e4%b9%8b%e6%96%87%e4%bb%b6%e7%bb%93%e6%9e%84%e7%9b%ae%e5%bd%95%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28780\/","title":{"rendered":"\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790"},"content":{"rendered":"<p>\u5728\u5fae\u4fe1\u5f00\u53d1\u8005\u5de5\u5177\u4e2d\u6dfb\u52a0\u9879\u76ee\u5e76\u52fe\u9009\u521b\u5efa\u9ed8\u8ba4\u5c0f\u7a0b\u5e8f\uff0c\u7cfb\u7edf\u7ed9\u6211\u4eec\u81ea\u52a8\u521b\u5efa\u7684\u5c0f\u5b9e\u4f8b\u662f\u7b2c\u4e00\u4e2a\u9875\u9762\u663e\u793a\u6211\u4eec\u7684\u5934\u50cf\u3001\u6635\u79f0\u8fd8\u6709hello world\u7684\u6587\u672c\uff0c\u70b9\u51fb\u5934\u50cf\u8df3\u8f6c\u5230\u53e6\u5916\u4e00\u4e2a\u9875\u9762\u663e\u793a\u542f\u52a8\u65e5\u5fd7\uff0c\u6548\u679c\u5982\u4e0b\uff1a<br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/\/upload\/image\/467\/493\/959\/1488963760781994.gif\" style=\"max-width:90%\" class=\"aligncenter\" title=\"\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790\u63d2\u56fe\" alt=\"\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790\u63d2\u56fe\" \/><br \/>\u8fdb\u5165\u3010\u7f16\u8f91\u3011\u9009\u9879\uff0c\u4f60\u4f1a\u770b\u5230\u5982\u4e0b\u76ee\u5f55\u7ed3\u6784\uff1a<br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/\/upload\/image\/740\/744\/852\/1488963769150442.png\" style=\"max-width:90%\" class=\"aligncenter\" title=\"\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790\u63d2\u56fe1\" alt=\"\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790\u63d2\u56fe1\" \/><\/p>\n<p>\u5728\u56fe\u4e2d\u7684\u76ee\u5f55\u53ef\u4ee5\u770b\u5230\u51e0\u79cd\u6587\u4ef6\u683c\u5f0f\uff1a.wxml\u3001.js\u3001.json\u3001.wxss\u3001<br \/>\u5176\u4e2d\uff1a<br \/><strong>.wxml<\/strong>\u2014\u9875\u9762\u7ed3\u6784\u6587\u4ef6\uff1b<br \/><strong>.js<\/strong>\u2014\u811a\u672c\u6587\u4ef6\uff0c\u5305\u542b\u9875\u9762\/\u7a0b\u5e8f\u7684\u58f0\u660e\u5468\u671f\u51fd\u6570\uff0c\u4e00\u4e9bwxml\u9875\u9762\u7684\u76d1\u542c\u51fd\u6570\u7684\u5b9e\u73b0\u4e5f\u662f\u5728\u8fd9\u4e2a\u6587\u4ef6\u91cc\u9762\u7f16\u5199\u7684\uff1b<br \/><strong>.json<\/strong>\u2014\u914d\u7f6e\u6587\u4ef6\uff1b<br \/><strong>.wxss<\/strong>\u2014\u6837\u5f0f\u8868\uff1b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/\/upload\/image\/596\/676\/337\/1488963782118623.png\" style=\"max-width:90%\" class=\"aligncenter\" title=\"\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790\u63d2\u56fe2\" alt=\"\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790\u63d2\u56fe2\" \/><br \/>\u4ece\u5927\u7684\u65b9\u5411\u6765\u770b\uff0c\u6839\u76ee\u5f55\u4e0b\u5305\u542bpages,utils\u76ee\u5f55\u548capp.js app.json,app.wxss\u7b49\u5185\u5bb9\u3002<br \/><strong>1.pages\u76ee\u5f55<br \/><\/strong><br \/><strong>&nbsp; &nbsp;&nbsp; &nbsp;1.1\u65b0\u589e\u9875\u9762\u5e76\u8fdb\u884c\u914d\u7f6e<\/strong><\/p>\n<p>pages\u2014\u5305\u542b\u9875\u9762\u6587\u4ef6\uff0c\u5982\u8981\u5728\u9879\u76ee\u4e2d\u6dfb\u52a0\u9875\u9762\uff0c\u8981\u5728pages\u76ee\u5f55\u5148\uff0c\u65b0\u5efa\u4e00\u4e2a\u5b50\u76ee\u5f55\u5982\u4e0a\u56fe\u7684index\u76ee\u5f55\uff0c\u76ee\u5f55\u4e2d\u8981\u5305\u542b.wxml .js \u8fd9\u4e24\u4e2a\u662f\u5fc5\u987b\u7684\uff0c\u8fd8\u6709.json .wxss\u662f\u53ef\u9009\u7684\u3002<br \/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; \u800c\u4e14\u8fd9\u51e0\u4e2a\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u662f\u4e00\u81f4\u7684\uff0c\u540e\u7f00\u540d\u4e0d\u76f8\u540c\u3002\u65b0\u5efa\u65b0\u7684\u9875\u9762\u6587\u4ef6\u4e4b\u540e\uff0c\u8fd8\u9700\u8981\u5728app.json\u6587\u4ef6\u4e2d\u914d\u7f6e\u9875\u9762\u8def\u5f84\uff0c\u5426\u5219\u7a0b\u5e8f\u662f\u627e\u4e0d\u5230\u8fd9\u4e2a\u9875\u9762\u7684\u76f8\u5173\u6587\u4ef6\u7684\uff0c\u5982\u6211\u8981\u65b0\u5efa\u4e00\u4e2a\u53eb\u505amyNewPage\u7684\u9875\u9762\uff0c\u9875\u9762\u4e2d\u5305\u542b\u4e00\u4e2a\u56fe\u7247\uff0c\u6211\u8981\u8fd9\u6837\u505a\uff1a<br \/>\u65b0\u5efa\u4e4b\u540e\u6211\u8981\u5728app.json\u6587\u4ef6\u4e2d\u7684pages\u6570\u7ec4\u4e0b\u914d\u7f6e\u9875\u9762\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/\/upload\/image\/110\/926\/505\/1488963795108080.png\" style=\"max-width:90%\" class=\"aligncenter\" title=\"\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790\u63d2\u56fe3\" alt=\"\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790\u63d2\u56fe3\" \/><\/p>\n<pre>{&nbsp;\r\n\"pages\":[&nbsp;\r\n\"pages\/newPage\/myNewPage\",&nbsp;\r\n\"pages\/index\/index\",&nbsp;\r\n\"pages\/logs\/logs\"&nbsp;\r\n],&nbsp;\r\n\"window\":{&nbsp;\r\n\"backgroundTextStyle\":\"light\",&nbsp;\r\n\"navigationBarBackgroundColor\":&nbsp;\"#fff\",&nbsp;\r\n\"navigationBarTitleText\":&nbsp;\"WeChat\",&nbsp;\r\n\"navigationBarTextStyle\":\"black\"&nbsp;\r\n}&nbsp;\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>pages\u4e2d\u9875\u9762\u5730\u5740\u914d\u7f6e\u7684\u987a\u5e8f\u51b3\u5b9a\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u663e\u793a\u987a\u5e8f\uff0c\u5982\u6211\u8981\u7b2c\u4e00\u4e2a\u663e\u793a\u6211\u7684myNewPage\u6211\u9700\u8981\u628a\u5b83\u653e\u5728\u7b2c\u4e00\u884c\uff0c\u5176\u4ed6\u7684\u9875\u9762\u53ef\u4ee5\u901a\u8fc7\u8df3\u8f6c\u7b49\u65b9\u5f0f\u6765\u4f7f\u5176\u663e\u793a\u3002\u6240\u6709\u7a0b\u5e8f\u7684\u9875\u9762\u90fd\u9700\u8981\u5728app.json\u4e2d\u914d\u7f6e\u3002<br \/><strong>&nbsp; &nbsp;&nbsp;&nbsp;1.2 \u5bf9\u5355\u72ec\u7684\u9875\u9762\u8fdb\u884c\u914d\u7f6e<\/strong><\/p>\n<p>\u6bcf\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u9875\u9762\u4e5f\u53ef\u4ee5\u4f7f\u7528.json\u6587\u4ef6\u6765\u5bf9\u672c\u9875\u9762\u7684\u7a97\u53e3\u8868\u73b0\u8fdb\u884c\u914d\u7f6e\u3002\u53ea\u9700\u8bbe\u7f6e app.json \u4e2d\u7684 window \u914d\u7f6e\u9879\u7684\u5185\u5bb9\uff0c\u9875\u9762\u4e2d\u914d\u7f6e\u9879\u4f1a\u8986\u76d6 app.json \u7684 window \u4e2d\u76f8\u540c\u7684\u914d\u7f6e\u9879\u3002<br \/>\u9875\u9762\u7684.json\u53ea\u80fd\u8bbe\u7f6e window \u76f8\u5173\u7684\u914d\u7f6e\u9879\uff0c\u4ee5\u51b3\u5b9a\u672c\u9875\u9762\u7684\u7a97\u53e3\u8868\u73b0\uff0c\u6240\u4ee5\u65e0\u9700\u5199 window \u8fd9\u4e2a\u952e\uff0c\u5982\uff1a<br \/>[tr]\u5c5e\u6027\u7c7b\u578b\u9ed8\u8ba4\u503c\u63cf\u8ff0[\/tr]<\/p>\n<table>\n<tbody>\n<tr>\n<td>navigationBarBackgroundColor<\/td>\n<td>HexColor<\/td>\n<td>#000000<\/td>\n<td>\u5bfc\u822a\u680f\u80cc\u666f\u989c\u8272\uff0c\u5982&#8221;#000000&#8243;<\/td>\n<\/tr>\n<tr>\n<td>navigationBarTextStyle<\/td>\n<td>String<\/td>\n<td>white<\/td>\n<td>\u5bfc\u822a\u680f\u6807\u9898\u989c\u8272\uff0c\u4ec5\u652f\u6301 black\/white<\/td>\n<\/tr>\n<tr>\n<td>navigationBarTitleText<\/td>\n<td>String<\/td>\n<td><\/td>\n<td>\u5bfc\u822a\u680f\u6807\u9898\u6587\u5b57\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>backgroundColor<\/td>\n<td>HexColor<\/td>\n<td>#ffffff<\/td>\n<td>\u7a97\u53e3\u7684\u80cc\u666f\u8272<\/td>\n<\/tr>\n<tr>\n<td>backgroundTextStyle<\/td>\n<td>String<\/td>\n<td>dark<\/td>\n<td>\u4e0b\u62c9\u80cc\u666f\u5b57\u4f53\u3001loading \u56fe\u7684\u6837\u5f0f\uff0c\u4ec5\u652f\u6301 dark\/light<\/td>\n<\/tr>\n<tr>\n<td>enablePullDownRefresh<\/td>\n<td>Boolean<\/td>\n<td>false<\/td>\n<td>\u662f\u5426\u5f00\u542f\u4e0b\u62c9\u5237\u65b0\uff0c\u8be6\u89c1\u9875\u9762\u76f8\u5173\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\u3002<\/td>\n<\/tr>\n<tr>\n<td>disableScroll<\/td>\n<td>Boolean<\/td>\n<td>false<\/td>\n<td>\u8bbe\u7f6e\u4e3a true \u5219\u9875\u9762\u6574\u4f53\u4e0d\u80fd\u4e0a\u4e0b\u6eda\u52a8\uff1b\u53ea\u5728 page.json \u4e2d\u6709\u6548\uff0c\u65e0\u6cd5\u5728 app.json \u4e2d\u8bbe\u7f6e\u8be5\u9879<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre>{\r\n\"navigationBarBackgroundColor\":&nbsp;\"#ffffff\",\r\n\"navigationBarTextStyle\":&nbsp;\"black\",\r\n\"navigationBarTitleText\":&nbsp;\"\u5fae\u4fe1\u63a5\u53e3\u529f\u80fd\u6f14\u793a\",\r\n\"backgroundColor\":&nbsp;\"#eeeeee\",\r\n\"backgroundTextStyle\":&nbsp;\"light\"\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236    \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>2.utils\u76ee\u5f55<br \/><\/strong><br \/>utils\u76ee\u5f55\u653e\u7684\u662f\u6211\u4eec\u5de5\u5177\u811a\u672c\u6587\u4ef6\uff0c\u6211\u4eec\u5728\u64cd\u4f5c\u9875\u9762\u6216\u8005\u89e3\u6790\u6570\u636e\u7684\u65f6\u5019\u5e38\u5e38\u9700\u8981\u5199\u4e00\u4e9b\u65b9\u6cd5\uff0c\u901a\u5e38\u662f\u5199\u5728\u6211\u4eec\u5404\u81ea\u9875\u9762.js\u6587\u4ef6\u4e2d\u6216\u8005\u662f\u5168\u5c40\u7684app.js\u9875\u9762\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u5c06\u4e00\u4e9b\u590d\u6742\u7684\u903b\u8f91\u4ee3\u7801\u62bd\u53d6\u51fa\u6765\u653e\u5728\u4e00\u4e2a\u6587\u4ef6\u4e2d\u5c01\u88c5\u6210\u4e00\u4e2a\u4e2a\u51fd\u6570\uff0c\u8fd9\u6837\u53ef\u4ee5\u5b9e\u73b0\u4ee3\u7801\u7684\u6a21\u5757\u5316\uff0c\u4e5f\u53ef\u4ee5\u5927\u91cf\u51cf\u5c11\u7f16\u5199\u91cd\u590d\u529f\u80fd\u4ee3\u7801\u8fd9\u7c7b\u7684\u5de5\u4f5c\u3002<br \/>\u628a\u516c\u5171\u7684\u65b9\u6cd5\u5c01\u88c5\u8d77\u6765\uff0c\u7136\u540e\u4f7f\u7528\u65f6\u9700\u8981\u5148\u5f15\u5165\u8fd9\u4e2a\u5de5\u5177js\u6587\u4ef6\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u7ed9\u6211\u4eec\u521b\u5efa\u7684\u5c0f\u5b9e\u4f8b\u4e2d\uff0clogs\u9875\u9762\u4e2d\u7684\u811a\u672c\u6587\u4ef6logs.js\u9700\u8981\u5f15\u7528utils\u76ee\u5f55\u4e0butil.js\u4e2d\u7684formatTime\uff08\uff09\u65b9\u6cd5\uff0c\u4f7f\u7528\u524d\u4ed6\u9700\u8981\u4f7f\u7528var util = require(&#8216;..\/..\/utils\/util.js&#8217;)\u5f15\u5165util.js\u6587\u4ef6\uff1a<\/p>\n<pre>{\r\n\"navigationBarBackgroundColor\":&nbsp;\"#ffffff\",\r\n\"navigationBarTextStyle\":&nbsp;\"black\",\r\n\"navigationBarTitleText\":&nbsp;\"\u5fae\u4fe1\u63a5\u53e3\u529f\u80fd\u6f14\u793a\",\r\n\"backgroundColor\":&nbsp;\"#eeeeee\",\r\n\"backgroundTextStyle\":&nbsp;\"light\"\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236    \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5f15\u5165\u4e4b\u540e\u76f4\u63a5\u4f7f\u7528<\/p>\n<pre>util.formatTime(new&nbsp;Date(log))<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><em>\u590d\u5236\u4ee3\u7801<\/em><br \/>\u6765\u4f7f\u7528\u8fd9\u4e2a\u65b9\u6cd5\u5e76\u4f20\u5165\u53c2\u6570\u5373\u53ef\u3002<\/p>\n<p><strong>3.app.js<\/strong><br \/>app.js&nbsp;&nbsp;\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5168\u5c40\u903b\u8f91\u811a\u672c\uff0c\u5c0f\u7a0b\u5e8f\u542f\u52a8\u4f1a\u6267\u884c\u8be5\u6587\u4ef6\u5185\u7684\u90e8\u5206\u65b9\u6cd5\u5982onLaunch\u65b9\u6cd5\u3002\u6240\u4ee5\u4e00\u4e9b\u5168\u5c40\u521d\u59cb\u5316\u7684\u5de5\u4f5c\u53ef\u4ee5\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u76f8\u5e94\u7684\u65b9\u6cd5\u4e2d\u6267\u884c\u3002<\/p>\n<p><strong>4.app.wxss<\/strong><br \/>app.wxss \u662f\u5c0f\u7a0b\u5e8f\u5168\u5c40\u6837\u5f0f\u6587\u4ef6\uff0c\u5728\u6b64\u6587\u4ef6\u4e2d\u5b9a\u4e49\u7684\u6837\u5f0f\uff0c\u6574\u4e2a\u7a0b\u5e8f\u90fd\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u6240\u4ee5\u53ef\u4ee5\u628a\u4e00\u4e9b\u516c\u5171\u7684\u6837\u5f0f\u653e\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\uff0c\u4ee5\u514d\u7f16\u5199\u91cd\u590d\u7684\u6837\u5f0f\u3002<\/p>\n<p>\u9ed8\u8ba4\u7684\uff0c\u8be5\u6587\u4ef6\u5c31\u5305\u542b.container\u6837\u5f0f\uff0c<\/p>\n<pre>\/**app.wxss**\/&nbsp;\r\n.container&nbsp;{&nbsp;\r\nheight:&nbsp;100%;&nbsp;\r\ndisplay:&nbsp;flex;&nbsp;\r\nflex-direction:&nbsp;column;&nbsp;\r\nalign-items:&nbsp;center;&nbsp;\r\njustify-content:&nbsp;space-between;&nbsp;\r\npadding:&nbsp;200rpx&nbsp;0;&nbsp;\r\nbox-sizing:&nbsp;border-box;&nbsp;\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8be5\u6837\u5f0f\u4e00\u8fb9\u7528\u4e8e\u5916\u90e8\u5bb9\u5668\u7ec4\u4ef6\u4e2d\uff0c\u5728\u6240\u6709\u9875\u9762\u4e2d\u90fd\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u3002<br \/>\u5982\u679c\u5728pages\u76ee\u5f55\u4e0b\u7684\u6307\u5b9a\u9875\u9762\uff0c\u91cd\u5199\u4e86.container\u7684\u6837\u5f0f\uff0c\u90a3\u4e48\u8fd9\u4e2a\u9875\u9762\u7684\u6837\u5f0f\u5c06\u4f1a\u8986\u76d6\u5168\u5c40\u7684\u6837\u5f0f\u3002<\/p>\n<p><strong>5.app.json<\/strong><\/p>\n<p>app.json\u662f\u5168\u5c40\u7684\u914d\u7f6e\u6587\u4ef6\uff0c<\/p>\n<pre>{&nbsp;\r\n\"pages\":[&nbsp;\r\n\"pages\/newPage\/myNewPage\",&nbsp;\r\n\"pages\/index\/index\",&nbsp;\r\n\"pages\/logs\/logs\"&nbsp;\r\n],&nbsp;\r\n\"window\":{&nbsp;\r\n\"backgroundTextStyle\":\"light\",&nbsp;\r\n\"navigationBarBackgroundColor\":&nbsp;\"#fff\",&nbsp;\r\n\"navigationBarTitleText\":&nbsp;\"WeChat\",&nbsp;\r\n\"navigationBarTextStyle\":\"black\"&nbsp;\r\n}&nbsp;\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u914d\u7f6e\u9879\u5982\u4e0b\u8fb9\u6240\u793a\uff1a<br \/>[tr]\u5c5e\u6027\u7c7b\u578b\u5fc5\u586b\u63cf\u8ff0[\/tr]<\/p>\n<table style=\"width:560px\">\n<tbody>\n<tr>\n<td>pages<\/td>\n<td>String Array<\/td>\n<td>\u662f<\/td>\n<td>\u8bbe\u7f6e\u9875\u9762\u8def\u5f84<\/td>\n<\/tr>\n<tr>\n<td>window<\/td>\n<td>Object<\/td>\n<td>\u5426<\/td>\n<td>\u8bbe\u7f6e\u9ed8\u8ba4\u9875\u9762\u7684\u7a97\u53e3\u8868\u73b0\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u5c0f\u7a0b\u5e8f\u7684\u72b6\u6001\u680f\u3001\u5bfc\u822a\u6761\u3001\u6807\u9898\u3001\u7a97\u53e3\u80cc\u666f\u8272<\/td>\n<\/tr>\n<tr>\n<td>tabBar<\/td>\n<td>Object<\/td>\n<td>\u5426<\/td>\n<td>\u8bbe\u7f6e\u5e95\u90e8 tab \u7684\u8868\u73b0<\/td>\n<\/tr>\n<tr>\n<td>networkTimeout<\/td>\n<td>Object<\/td>\n<td>\u5426<\/td>\n<td>\u8bbe\u7f6e\u7f51\u7edc\u8d85\u65f6\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td>debug<\/td>\n<td>Boolean<\/td>\n<td>\u5426<\/td>\n<td>\u8bbe\u7f6e\u662f\u5426\u5f00\u542f debug \u6a21\u5f0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5176\u4e2d\uff1a<\/p>\n<p>window\u8bbe\u7f6e\u5217\u8868\u5982\u4e0b\uff1a<\/p>\n<p>[tr]\u5c5e\u6027\u7c7b\u578b\u9ed8\u8ba4\u503c\u63cf\u8ff0[\/tr]<\/p>\n<table style=\"width:560px\">\n<tbody>\n<tr>\n<td>navigationBarBackgroundColor<\/td>\n<td>HexColor<\/td>\n<td>#000000<\/td>\n<td>\u5bfc\u822a\u680f\u80cc\u666f\u989c\u8272\uff0c\u5982&#8221;#000000&#8243;<\/td>\n<\/tr>\n<tr>\n<td>navigationBarTextStyle<\/td>\n<td>String<\/td>\n<td>white<\/td>\n<td>\u5bfc\u822a\u680f\u6807\u9898\u989c\u8272\uff0c\u4ec5\u652f\u6301 black\/white<\/td>\n<\/tr>\n<tr>\n<td>navigationBarTitleText<\/td>\n<td>String<\/td>\n<td><\/td>\n<td>\u5bfc\u822a\u680f\u6807\u9898\u6587\u5b57\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>backgroundColor<\/td>\n<td>HexColor<\/td>\n<td>#ffffff<\/td>\n<td>\u7a97\u53e3\u7684\u80cc\u666f\u8272<\/td>\n<\/tr>\n<tr>\n<td>backgroundTextStyle<\/td>\n<td>String<\/td>\n<td>dark<\/td>\n<td>\u4e0b\u62c9\u80cc\u666f\u5b57\u4f53\u3001loading \u56fe\u7684\u6837\u5f0f\uff0c\u4ec5\u652f\u6301 dark\/light<\/td>\n<\/tr>\n<tr>\n<td>enablePullDownRefresh<\/td>\n<td>Boolean<\/td>\n<td>false<\/td>\n<td>\u662f\u5426\u5f00\u542f\u4e0b\u62c9\u5237\u65b0\uff0c\u8be6\u89c1\u9875\u9762\u76f8\u5173\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>tabBar\u8bbe\u7f6e\u5217\u8868\u5982\u4e0b\uff1a<br \/>[tr]\u5c5e\u6027\u7c7b\u578b\u5fc5\u586b\u9ed8\u8ba4\u503c\u63cf\u8ff0[\/tr]<\/p>\n<table style=\"width:560px\">\n<tbody>\n<tr>\n<td>color<\/td>\n<td>HexColor<\/td>\n<td>\u662f<\/td>\n<td><\/td>\n<td>tab \u4e0a\u7684\u6587\u5b57\u9ed8\u8ba4\u989c\u8272<\/td>\n<\/tr>\n<tr>\n<td>selectedColor<\/td>\n<td>HexColor<\/td>\n<td>\u662f<\/td>\n<td><\/td>\n<td>tab \u4e0a\u7684\u6587\u5b57\u9009\u4e2d\u65f6\u7684\u989c\u8272<\/td>\n<\/tr>\n<tr>\n<td>backgroundColor<\/td>\n<td>HexColor<\/td>\n<td>\u662f<\/td>\n<td><\/td>\n<td>tab \u7684\u80cc\u666f\u8272<\/td>\n<\/tr>\n<tr>\n<td>borderStyle<\/td>\n<td>String<\/td>\n<td>\u5426<\/td>\n<td>black<\/td>\n<td>tabbar\u4e0a\u8fb9\u6846\u7684\u989c\u8272\uff0c \u4ec5\u652f\u6301 black\/white<\/td>\n<\/tr>\n<tr>\n<td>list<\/td>\n<td>Array<\/td>\n<td>\u662f<\/td>\n<td><\/td>\n<td>tab \u7684\u5217\u8868\uff0c\u8be6\u89c1 list \u5c5e\u6027\u8bf4\u660e\uff0c\u6700\u5c112\u4e2a\u3001\u6700\u591a5\u4e2a tab<\/td>\n<\/tr>\n<tr>\n<td>position<\/td>\n<td>String<\/td>\n<td>\u5426<\/td>\n<td>bottom<\/td>\n<td>\u53ef\u9009\u503c bottom\u3001top<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5176\u4e2d list \u63a5\u53d7\u4e00\u4e2a\u6570\u7ec4\uff0c\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u9879\u90fd\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5176\u5c5e\u6027\u503c\u5982\u4e0b\uff1a<br \/>[tr]\u5c5e\u6027\u7c7b\u578b\u5fc5\u586b\u8bf4\u660e[\/tr]<\/p>\n<table style=\"width:560px\">\n<tbody>\n<tr>\n<td>pagePath<\/td>\n<td>String<\/td>\n<td>\u662f<\/td>\n<td>\u9875\u9762\u8def\u5f84\uff0c\u5fc5\u987b\u5728 pages \u4e2d\u5148\u5b9a\u4e49<\/td>\n<\/tr>\n<tr>\n<td>text<\/td>\n<td>String<\/td>\n<td>\u662f<\/td>\n<td>tab \u4e0a\u6309\u94ae\u6587\u5b57<\/td>\n<\/tr>\n<tr>\n<td>iconPath<\/td>\n<td>String<\/td>\n<td>\u662f<\/td>\n<td>\u56fe\u7247\u8def\u5f84\uff0cicon \u5927\u5c0f\u9650\u5236\u4e3a40kb\uff0c\u5efa\u8bae\u5c3a\u5bf8\u4e3a 81px * 81px<\/td>\n<\/tr>\n<tr>\n<td>selectedIconPath<\/td>\n<td>String<\/td>\n<td>\u662f<\/td>\n<td>\u9009\u4e2d\u65f6\u7684\u56fe\u7247\u8def\u5f84\uff0cicon \u5927\u5c0f\u9650\u5236\u4e3a40kb\uff0c\u5efa\u8bae\u5c3a\u5bf8\u4e3a 81px * 81px<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>network Timeout:\u8bbe\u7f6e\u5404\u79cd\u7f51\u7edc\u8bf7\u6c42\u7684\u8d85\u65f6\u65f6\u95f4\u3002<br \/><strong>\u5c5e\u6027\u8bf4\u660e\uff1a<\/strong><br \/>[tr]\u5c5e\u6027\u7c7b\u578b\u5fc5\u586b\u8bf4\u660e[\/tr]<\/p>\n<table>\n<tbody>\n<tr>\n<td>request<\/td>\n<td>Number<\/td>\n<td>\u5426<\/td>\n<td>wx.request\u7684\u8d85\u65f6\u65f6\u95f4\uff0c\u5355\u4f4d\u6beb\u79d2\uff0c\u9ed8\u8ba4\u4e3a\uff1a60000<\/td>\n<\/tr>\n<tr>\n<td>connectSocket<\/td>\n<td>Number<\/td>\n<td>\u5426<\/td>\n<td>wx.connectSocket\u7684\u8d85\u65f6\u65f6\u95f4\uff0c\u5355\u4f4d\u6beb\u79d2\uff0c\u9ed8\u8ba4\u4e3a\uff1a60000<\/td>\n<\/tr>\n<tr>\n<td>uploadFile<\/td>\n<td>Number<\/td>\n<td>\u5426<\/td>\n<td>wx.uploadFile\u7684\u8d85\u65f6\u65f6\u95f4\uff0c\u5355\u4f4d\u6beb\u79d2\uff0c\u9ed8\u8ba4\u4e3a\uff1a60000<\/td>\n<\/tr>\n<tr>\n<td>downloadFile<\/td>\n<td>Number<\/td>\n<td>\u5426<\/td>\n<td>wx.downloadFile\u7684\u8d85\u65f6\u65f6\u95f4\uff0c\u5355\u4f4d\u6beb\u79d2\uff0c\u9ed8\u8ba4\u4e3a\uff1a60000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6bcf\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u9875\u9762\u4e5f\u53ef\u4ee5\u4f7f\u7528.json\u6587\u4ef6\u6765\u5bf9\u672c\u9875\u9762\u7684\u7a97\u53e3\u8868\u73b0\u8fdb\u884c\u914d\u7f6e\u3002 \u9875\u9762\u7684\u914d\u7f6e\u6bd4app.json\u5168\u5c40\u914d\u7f6e\u7b80\u5355\u5f97\u591a\uff0c\u53ea\u662f\u8bbe\u7f6e app.json \u4e2d\u7684 window \u914d\u7f6e\u9879\u7684\u5185\u5bb9\uff0c\u9875\u9762\u4e2d\u914d\u7f6e\u9879\u4f1a\u8986\u76d6 app.json \u7684 window \u4e2d\u76f8\u540c\u7684\u914d\u7f6e\u9879\u3002<br \/>\u9875\u9762\u7684.json\u53ea\u80fd\u8bbe\u7f6e window \u76f8\u5173\u7684\u914d\u7f6e\u9879\uff0c\u4ee5\u51b3\u5b9a\u672c\u9875\u9762\u7684\u7a97\u53e3\u8868\u73b0\uff0c\u6240\u4ee5\u65e0\u9700\u5199 window \u8fd9\u4e2a\u952e\uff0c\u5982\uff1a<br \/>[tr]\u5c5e\u6027\u7c7b\u578b\u9ed8\u8ba4\u503c\u63cf\u8ff0[\/tr]<\/p>\n<table>\n<tbody>\n<tr>\n<td>navigationBarBackgroundColor<\/td>\n<td>HexColor<\/td>\n<td>#000000<\/td>\n<td>\u5bfc\u822a\u680f\u80cc\u666f\u989c\u8272\uff0c\u5982&#8221;#000000&#8243;<\/td>\n<\/tr>\n<tr>\n<td>navigationBarTextStyle<\/td>\n<td>String<\/td>\n<td>white<\/td>\n<td>\u5bfc\u822a\u680f\u6807\u9898\u989c\u8272\uff0c\u4ec5\u652f\u6301 black\/white<\/td>\n<\/tr>\n<tr>\n<td>navigationBarTitleText<\/td>\n<td>String<\/td>\n<td><\/td>\n<td>\u5bfc\u822a\u680f\u6807\u9898\u6587\u5b57\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>backgroundColor<\/td>\n<td>HexColor<\/td>\n<td>#ffffff<\/td>\n<td>\u7a97\u53e3\u7684\u80cc\u666f\u8272<\/td>\n<\/tr>\n<tr>\n<td>backgroundTextStyle<\/td>\n<td>String<\/td>\n<td>dark<\/td>\n<td>\u4e0b\u62c9\u80cc\u666f\u5b57\u4f53\u3001loading \u56fe\u7684\u6837\u5f0f\uff0c\u4ec5\u652f\u6301 dark\/light<\/td>\n<\/tr>\n<tr>\n<td>enablePullDownRefresh<\/td>\n<td>Boolean<\/td>\n<td>false<\/td>\n<td>\u662f\u5426\u5f00\u542f\u4e0b\u62c9\u5237\u65b0\uff0c\u8be6\u89c1\u9875\u9762\u76f8\u5173\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\u3002<\/td>\n<\/tr>\n<tr>\n<td>disableScroll<\/td>\n<td>Boolean<\/td>\n<td>false<\/td>\n<td>\u8bbe\u7f6e\u4e3a true \u5219\u9875\u9762\u6574\u4f53\u4e0d\u80fd\u4e0a\u4e0b\u6eda\u52a8\uff1b\u53ea\u5728 page.json \u4e2d\u6709\u6548\uff0c\u65e0\u6cd5\u5728 app.json \u4e2d\u8bbe\u7f6e\u8be5\u9879<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5206\u4eab\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e4b\u6587\u4ef6\u7ed3\u6784\u76ee\u5f55\u89e3\u6790\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>\u5728\u5fae\u4fe1\u5f00\u53d1\u8005\u5de5\u5177\u4e2d\u6dfb\u52a0\u9879\u76ee\u5e76\u52fe\u9009\u521b\u5efa\u9ed8\u8ba4\u5c0f\u7a0b\u5e8f\uff0c\u7cfb\u7edf\u7ed9\u6211\u4eec\u81ea\u52a8\u521b\u5efa\u7684\u5c0f\u5b9e\u4f8b\u662f\u7b2c\u4e00\u4e2a\u9875\u9762\u663e\u793a\u6211\u4eec\u7684\u5934\u50cf\u3001\u6635\u79f0\u8fd8\u6709hello world\u7684\u6587\u672c\uff0c\u70b9\u51fb\u5934\u50cf\u8df3\u8f6c\u5230\u53e6\u5916\u4e00\u4e2a\u9875\u9762\u663e\u793a\u542f\u52a8\u65e5\u5fd7\uff0c\u6548\u679c\u5982\u4e0b\uff1a\u8fdb\u5165\u3010\u7f16\u8f91\u3011\u9009\u9879\uff0c\u4f60\u4f1a\u770b\u5230\u5982\u4e0b\u76ee\u5f55\u7ed3\u6784\uff1a \u5728\u56fe\u4e2d\u7684\u76ee\u5f55\u53ef\u4ee5\u770b\u5230\u51e0\u79cd\u6587\u4ef6\u683c\u5f0f\uff1a.wxml\u3001.js\u3001.json\u3001.wxss\u3001\u5176\u4e2d\uff1a.wxml\u2014\u9875\u9762\u7ed3\u6784\u6587\u4ef6\uff1b.js\u2014\u811a\u672c\u6587\u4ef6\uff0c\u5305\u542b\u9875\u9762\/\u7a0b\u5e8f\u7684\u58f0\u660e\u5468\u671f\u51fd\u6570\uff0c\u4e00\u4e9bwxml\u9875\u9762\u7684\u76d1\u542c\u51fd\u6570\u7684\u5b9e\u73b0\u4e5f\u662f\u5728\u8fd9\u4e2a\u6587\u4ef6\u91cc\u9762\u7f16\u5199\u7684\uff1b.json\u2014\u914d\u7f6e\u6587\u4ef6\uff1b.wxss\u2014\u6837\u5f0f\u8868\uff1b \u4ece\u5927\u7684\u65b9\u5411\u6765\u770b\uff0c\u6839\u76ee\u5f55\u4e0b\u5305\u542bpages,utils\u76ee\u5f55\u548capp.js app.json,app.wxss\u7b49\u5185\u5bb9\u30021.pages\u76ee\u5f55&nbsp; &nbsp;&nbsp; &nbsp;1.1\u65b0\u589e\u9875\u9762\u5e76\u8fdb\u884c\u914d\u7f6e pages\u2014\u5305\u542b\u9875\u9762\u6587\u4ef6\uff0c\u5982\u8981\u5728\u9879\u76ee\u4e2d\u6dfb\u52a0\u9875\u9762\uff0c\u8981\u5728pages\u76ee\u5f55\u5148\uff0c\u65b0\u5efa\u4e00\u4e2a\u5b50\u76ee\u5f55\u5982\u4e0a\u56fe\u7684index\u76ee\u5f55\uff0c\u76ee\u5f55\u4e2d\u8981\u5305\u542b.wxml .js \u8fd9\u4e24\u4e2a\u662f\u5fc5\u987b\u7684\uff0c\u8fd8\u6709.json .wxss\u662f\u53ef\u9009\u7684\u3002&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; \u800c\u4e14\u8fd9\u51e0\u4e2a\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u662f\u4e00\u81f4\u7684\uff0c\u540e\u7f00\u540d\u4e0d\u76f8\u540c\u3002\u65b0\u5efa\u65b0\u7684\u9875\u9762\u6587\u4ef6\u4e4b\u540e\uff0c\u8fd8\u9700\u8981\u5728app.json\u6587\u4ef6\u4e2d\u914d\u7f6e\u9875\u9762\u8def\u5f84\uff0c\u5426\u5219\u7a0b\u5e8f\u662f\u627e\u4e0d\u5230\u8fd9\u4e2a\u9875\u9762\u7684\u76f8\u5173\u6587\u4ef6\u7684\uff0c\u5982\u6211\u8981\u65b0\u5efa\u4e00\u4e2a\u53eb\u505amyNewPage\u7684\u9875\u9762\uff0c\u9875\u9762\u4e2d\u5305\u542b\u4e00\u4e2a\u56fe\u7247\uff0c\u6211\u8981\u8fd9\u6837\u505a\uff1a\u65b0\u5efa\u4e4b\u540e\u6211\u8981\u5728app.json\u6587\u4ef6\u4e2d\u7684pages\u6570\u7ec4\u4e0b\u914d\u7f6e\u9875\u9762\uff1a {&nbsp; &#8220;pages&#8221;:[&nbsp; &#8220;pages\/newPage\/myNewPage&#8221;,&nbsp; &#8220;pages\/index\/index&#8221;,&nbsp; &#8220;pages\/logs\/logs&#8221;&nbsp; ],&nbsp; &#8220;window&#8221;:{&nbsp; &#8220;backgroundTextStyle&#8221;:&#8221;light&#8221;,&nbsp; &#8220;navigationBarBackgroundColor&#8221;:&nbsp;&#8220;#fff&#8221;,&nbsp; &#8220;navigationBarTitleText&#8221;:&nbsp;&#8220;WeChat&#8221;,&nbsp; &#8220;navigationBarTextStyle&#8221;:&#8221;black&#8221;&nbsp; }&nbsp; } \u767b\u5f55\u540e\u590d\u5236 pages\u4e2d\u9875\u9762\u5730\u5740\u914d\u7f6e\u7684\u987a\u5e8f\u51b3\u5b9a\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u663e\u793a\u987a\u5e8f\uff0c\u5982\u6211\u8981\u7b2c\u4e00\u4e2a\u663e\u793a\u6211\u7684myNewPage\u6211\u9700\u8981\u628a\u5b83\u653e\u5728\u7b2c\u4e00\u884c\uff0c\u5176\u4ed6\u7684\u9875\u9762\u53ef\u4ee5\u901a\u8fc7\u8df3\u8f6c\u7b49\u65b9\u5f0f\u6765\u4f7f\u5176\u663e\u793a\u3002\u6240\u6709\u7a0b\u5e8f\u7684\u9875\u9762\u90fd\u9700\u8981\u5728app.json\u4e2d\u914d\u7f6e\u3002&nbsp; &nbsp;&nbsp;&nbsp;1.2 \u5bf9\u5355\u72ec\u7684\u9875\u9762\u8fdb\u884c\u914d\u7f6e \u6bcf\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u9875\u9762\u4e5f\u53ef\u4ee5\u4f7f\u7528.json\u6587\u4ef6\u6765\u5bf9\u672c\u9875\u9762\u7684\u7a97\u53e3\u8868\u73b0\u8fdb\u884c\u914d\u7f6e\u3002\u53ea\u9700\u8bbe\u7f6e app.json \u4e2d\u7684 window \u914d\u7f6e\u9879\u7684\u5185\u5bb9\uff0c\u9875\u9762\u4e2d\u914d\u7f6e\u9879\u4f1a\u8986\u76d6 app.json \u7684 window \u4e2d\u76f8\u540c\u7684\u914d\u7f6e\u9879\u3002\u9875\u9762\u7684.json\u53ea\u80fd\u8bbe\u7f6e window \u76f8\u5173\u7684\u914d\u7f6e\u9879\uff0c\u4ee5\u51b3\u5b9a\u672c\u9875\u9762\u7684\u7a97\u53e3\u8868\u73b0\uff0c\u6240\u4ee5\u65e0\u9700\u5199 window \u8fd9\u4e2a\u952e\uff0c\u5982\uff1a[tr]\u5c5e\u6027\u7c7b\u578b\u9ed8\u8ba4\u503c\u63cf\u8ff0[\/tr] navigationBarBackgroundColor HexColor #000000 \u5bfc\u822a\u680f\u80cc\u666f\u989c\u8272\uff0c\u5982&#8221;#000000&#8243; navigationBarTextStyle String white \u5bfc\u822a\u680f\u6807\u9898\u989c\u8272\uff0c\u4ec5\u652f\u6301 black\/white [&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-28780","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28780","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=28780"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28780\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}