{"id":30909,"date":"2024-11-25T16:06:25","date_gmt":"2024-11-25T08:06:25","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30909\/"},"modified":"2024-11-25T16:06:25","modified_gmt":"2024-11-25T08:06:25","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91%e5%85%a5%e9%97%a8%e7%af%87%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30909\/","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5165\u95e8\u7bc7\u4ecb\u7ecd"},"content":{"rendered":"<p><strong>\u524d\u8a00<\/strong><\/p>\n<p>\u8fd1\u65e5\uff0c\u5728\u5de5\u4f5c\u95f2\u6687\u4e4b\u4f59\uff0c\u9605\u8bfb\u4e86\u4e00\u4e9b\u5173\u4e8e\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u6587\u7ae0\uff0c\u5fcd\u4e0d\u4f4f\uff0c\u60f3\u52a8\u624b\u8bd5\u4ed6\u4e00\u8bd5\u3002\u672c\u6587\u5c31\u4ee5\u201c\u6211\u7684\u7b2c\u4e00\u4e2a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u201d\u4e3a\u4f8b\uff0c\u7b80\u5355\u7684\u4ecb\u7ecd\u4e0b\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u5165\u95e8\u7ea7\u7528\u6cd5\u3002<\/p>\n<p><strong>\u4e00\u3001\u6ce8\u518c\u5c0f\u7a0b\u5e8f\u8d26\u53f7<\/strong><\/p>\n<p>1\u3001\u8fdb\u5165\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\uff08https:\/\/mp.weixin.qq.com\/\uff09\uff0c\u6ce8\u518c\u5c0f\u7a0b\u5e8f\u8d26\u53f7\uff0c\u6839\u636e\u63d0\u793a\u586b\u5199\u5bf9\u5e94\u7684\u4fe1\u606f\u5373\u53ef\u3002<\/p>\n<p>2\u3001\u6ce8\u518c\u6210\u529f\u540e\u8fdb\u5165\u9996\u9875\uff0c\u5728 \u5c0f\u7a0b\u5e8f\u53d1\u5e03\u6d41\u7a0b-&gt;\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e0e\u7ba1\u7406-&gt;\u914d\u7f6e\u670d\u52a1\u5668\u4e2d\uff0c\u70b9\u51fb\u201c\u5f00\u53d1\u8005\u8bbe\u7f6e\u201d\u3002<\/p>\n<p>3\u3001\u4f1a\u83b7\u5f97\u4e00\u4e2aAppID\uff0c\u8bb0\u5f55AppID\uff0c\u540e\u9762\u521b\u5efa\u9879\u76ee\u65f6\u4f1a\u7528\u5230\u3002<\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong>\u5982\u679c\u8981\u4ee5\u975e\u7ba1\u7406\u5458\u5fae\u4fe1\u53f7\u5728\u624b\u673a\u4e0a\u4f53\u9a8c\u8be5\u5c0f\u7a0b\u5e8f\uff0c\u90a3\u4e48\u6211\u4eec\u8fd8\u9700\u8981\u64cd\u4f5c\u201c\u7ed1\u5b9a\u5f00\u53d1\u8005\u201d\u3002\u5373\u5728\u201c\u7528\u6237\u8eab\u4efd\u201d-\u201c\u5f00\u53d1\u8005\u201d\u6a21\u5757\uff0c\u7ed1\u5b9a\u4e0a\u9700\u8981\u4f53\u9a8c\u8be5\u5c0f\u7a0b\u5e8f\u7684\u5fae\u4fe1\u53f7\u3002\u672c\u6559\u7a0b\u9ed8\u8ba4\u6ce8\u518c\u5e10\u53f7\u3001\u4f53\u9a8c\u90fd\u662f\u4f7f\u7528\u7ba1\u7406\u5458\u5fae\u4fe1\u53f7<\/p>\n<p><strong>\u4e8c\u3001\u4e0b\u8f7d\u5fae\u4fe1web\u5f00\u53d1\u8005\u5de5\u5177<\/strong><\/p>\n<p>\u4e3a\u4e86\u5e2e\u52a9\u5f00\u53d1\u8005\u7b80\u5355\u548c\u9ad8\u6548\u5730\u5f00\u53d1\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u63a8\u51fa\u4e86\u5168\u65b0\u7684\u5f00\u53d1\u8005\u5de5\u5177 \uff0c\u96c6\u6210\u4e86\u5f00\u53d1\u8c03\u8bd5\u3001\u4ee3\u7801\u7f16\u8f91\u53ca\u7a0b\u5e8f\u53d1\u5e03\u7b49\u529f\u80fd\u3002<\/p>\n<p>1\u3001\u4e0b\u8f7d\u9875\u9762\uff1ahttps:\/\/mp.weixin.qq.com\/debug\/wxadoc\/dev\/devtools\/download.html?t=201715 <\/p>\n<p>\u6839\u636e\u7cfb\u7edf\uff0c\u9009\u62e9\u5bf9\u5e94\u7684\u5de5\u5177\u7248\u672c\u4e0b\u8f7d<\/p>\n<p>2\u3001\u5de5\u5177\u5305\u542b\u7f16\u8f91\u3001\u8c03\u8bd5\u548c\u9879\u76ee\u4e09\u4e2a\u9875\u5361\uff1a<\/p>\n<p>\uff081\uff09\u7f16\u8f91\u533a\u53ef\u4ee5\u5bf9\u5f53\u524d\u9879\u76ee\u8fdb\u884c\u4ee3\u7801\u7f16\u5199\u548c\u6587\u4ef6\u7684\u6dfb\u52a0\u3001\u5220\u9664\u4ee5\u53ca\u91cd\u547d\u540d\u7b49\u57fa\u672c\u64cd\u4f5c<\/p>\n<p>\uff082\uff09\u7a0b\u5e8f\u8c03\u8bd5\u4e3b\u8981\u6709\u4e09\u5927\u529f\u80fd\u533a\uff1a\u6a21\u62df\u5668\u3001\u8c03\u8bd5\u5de5\u5177\u548c\u5c0f\u7a0b\u5e8f\u64cd\u4f5c\u533a<\/p>\n<p>\uff083\uff09\u9879\u76ee\u9875\u5361\u4e3b\u8981\u6709\u4e09\u5927\u529f\u80fd\uff1a\u663e\u793a\u5f53\u524d\u9879\u76ee\u7ec6\u8282\u3001\u63d0\u4ea4\u9884\u89c8\u548c\u63d0\u4ea4\u4e0a\u4f20\u548c\u9879\u76ee\u914d\u7f6e<\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong>\u542f\u52a8\u5de5\u5177\u65f6\uff0c\u5f00\u53d1\u8005\u9700\u8981\u4f7f\u7528\u5df2\u5728\u540e\u53f0\u7ed1\u5b9a\u6210\u529f\u7684\u5fae\u4fe1\u53f7\u626b\u63cf\u4e8c\u7ef4\u7801\u767b\u5f55\uff0c\u540e\u7eed\u6240\u6709\u7684\u64cd\u4f5c\u90fd\u4f1a\u57fa\u4e8e\u8fd9\u4e2a\u5fae\u4fe1\u5e10\u53f7<\/p>\n<p><strong>\u4e09\u3001\u7f16\u5199\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b<\/strong><\/p>\n<p><strong>1\u3001\u5b9e\u4f8b\u76ee\u5f55\u7ed3\u6784<\/strong><\/p>\n<pre>test\r\n&nbsp;\u251c\u2500&nbsp;page\r\n&nbsp;\u2502&nbsp;\u2514\u2500&nbsp;index\r\n&nbsp;\u2502&nbsp;&nbsp;\u251c\u2500&nbsp;index.js\r\n&nbsp;\u2502&nbsp;&nbsp;\u251c\u2500&nbsp;index.json\r\n&nbsp;\u2502&nbsp;&nbsp;\u251c\u2500&nbsp;index.wxml\r\n&nbsp;\u2502&nbsp;&nbsp;\u2514\u2500&nbsp;index.wxss\r\n&nbsp;\u251c\u2500&nbsp;app.js\r\n&nbsp;\u251c\u2500&nbsp;app.json\r\n&nbsp;\u2514\u2500&nbsp;app.wxss<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>2\u3001\u5b9e\u4f8b\u6587\u4ef6\u8bf4\u660e\u53ca\u6e90\u7801<\/strong><\/p>\n<p>\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u5305\u542b\u4e00\u4e2aapp\uff08\u4e3b\u4f53\u90e8\u5206\uff09\u548c\u591a\u4e2apage\uff08\u9875\u9762\uff09<\/p>\n<p>\uff081\uff09app\u662f\u7528\u6765\u63cf\u8ff0\u6574\u4f53\u7a0b\u5e8f\u7684\uff0c\u7531\u4e09\u4e2a\u6587\u4ef6\u7ec4\u6210\uff0c.js\u540e\u7f00\u7684\u662f\u811a\u672c\u6587\u4ef6\uff0c.json\u540e\u7f00\u7684\u6587\u4ef6\u662f\u914d\u7f6e\u6587\u4ef6\uff0c.wxss\u540e\u7f00\u7684\u662f\u6837\u5f0f\u8868\u6587\u4ef6\uff0c\u5fc5\u987b\u653e\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\u3002<\/p>\n<p>app.js\u662f\u5c0f\u7a0b\u5e8f\u7684\u811a\u672c\u4ee3\u7801\uff08\u5fc5\u987b\uff09\uff0c\u53ef\u4ee5\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u76d1\u542c\u5e76\u5904\u7406\u5c0f\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u51fd\u6570\u3001\u58f0\u660e\u5168\u5c40\u53d8\u91cf\uff0c\u8c03\u7528\u6846\u67b6\u63d0\u4f9b\u7684\u4e30\u5bcc\u7684 API\u3002<\/p>\n<pre>App({\r\n&nbsp;onLaunch:&nbsp;function&nbsp;()&nbsp;{\r\n&nbsp;&nbsp;console.log('App&nbsp;Launch')\r\n&nbsp;},\r\n&nbsp;onShow:&nbsp;function&nbsp;()&nbsp;{\r\n&nbsp;&nbsp;console.log('App&nbsp;Show')\r\n&nbsp;},\r\n&nbsp;onHide:&nbsp;function&nbsp;()&nbsp;{\r\n&nbsp;&nbsp;console.log('App&nbsp;Hide')\r\n&nbsp;},\r\n&nbsp;globalData:&nbsp;{\r\n&nbsp;&nbsp;hasLogin:&nbsp;false\r\n&nbsp;}\r\n})<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>app.json\u662f\u5bf9\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e\uff08\u5fc5\u987b\uff09\uff0c\u7528\u6765\u5bf9\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u8fdb\u884c\u5168\u5c40\u914d\u7f6e\uff0c\u51b3\u5b9a\u9875\u9762\u6587\u4ef6\u7684\u8def\u5f84\u3001\u7a97\u53e3\u8868\u73b0\u3001\u8bbe\u7f6e\u7f51\u7edc\u8d85\u65f6\u65f6\u95f4\u3001\u8bbe\u7f6e\u591atab\u7b49\u3002\u63a5\u53d7\u4e00\u4e2a\u6570\u7ec4\uff0c\u6bcf\u4e00\u9879\u90fd\u662f\u5b57\u7b26\u4e32\uff0c\u6765\u6307\u5b9a\u5c0f\u7a0b\u5e8f\u7531\u54ea\u4e9b\u9875\u9762\u7ec4\u6210\u3002\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u6bcf\u4e00\u4e2a\u9875\u9762\u7684\u3010\u8def\u5f84+\u9875\u9762\u540d\u3011\u90fd\u9700\u8981\u5199\u5728app.json\u7684pages\u4e2d\uff0c\u4e14pages\u4e2d\u7684\u7b2c\u4e00\u4e2a\u9875\u9762\u662f\u5c0f\u7a0b\u5e8f\u7684\u9996\u9875\u3002<\/p>\n<pre>{\r\n&nbsp;\"pages\":[\r\n&nbsp;&nbsp;\"page\/index\/index\"\r\n&nbsp;],\r\n&nbsp;\"window\":{\r\n&nbsp;&nbsp;\"navigationBarTextStyle\":&nbsp;\"black\",\r\n&nbsp;&nbsp;\"navigationBarTitleText\":&nbsp;\"\u6b22\u8fce\u9875\",\r\n&nbsp;&nbsp;\"navigationBarBackgroundColor\":&nbsp;\"#fbf9fe\",\r\n&nbsp;&nbsp;\"backgroundColor\":&nbsp;\"#fbf9fe\"\r\n&nbsp;},\r\n&nbsp;\"debug\":&nbsp;true\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>app.wxss\u662f\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u516c\u5171\u6837\u5f0f\u8868\uff08\u975e\u5fc5\u987b\uff09\u3002<\/p>\n<pre>page&nbsp;{\r\n&nbsp;background-color:&nbsp;#fbf9fe;\r\n&nbsp;height:&nbsp;100%;\r\n}\r\n.container&nbsp;{\r\n&nbsp;display:&nbsp;flex;\r\n&nbsp;flex-direction:&nbsp;column;\r\n&nbsp;min-height:&nbsp;100%;\r\n&nbsp;justify-content:&nbsp;space-between;\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\uff082\uff09page\u662f\u7528\u6765\u63cf\u8ff0\u9875\u9762\uff0c\u4e00\u4e2a\u9875\u9762\u7531\u56db\u4e2a\u6587\u4ef6\u7ec4\u6210\uff0c\u8fd9\u91cc\u4ee5\u9996\u9875index\u4e3a\u4f8b\uff0c\u6bcf\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u9875\u9762\u662f\u7531\u540c\u8def\u5f84\u4e0b\u540c\u540d\u7684\u56db\u4e2a\u4e0d\u540c\u540e\u7f00\u6587\u4ef6\u7684\u7ec4\u6210\uff0c\u5982\uff1aindex.js\u3001index.wxml\u3001index.wxss\u3001index.json\u3002.js\u540e\u7f00\u7684\u6587\u4ef6\u662f\u811a\u672c\u6587\u4ef6\uff0c.json\u540e\u7f00\u7684\u6587\u4ef6\u662f\u914d\u7f6e\u6587\u4ef6\uff0c.wxss\u540e\u7f00\u7684\u662f\u6837\u5f0f\u8868\u6587\u4ef6\uff0c.wxml\u540e\u7f00\u7684\u6587\u4ef6\u662f\u9875\u9762\u7ed3\u6784\u6587\u4ef6\u3002<\/p>\n<p>index.js \u662f\u9875\u9762\u7684\u811a\u672c\u6587\u4ef6\uff08\u5fc5\u987b\uff09\uff0c\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u6211\u4eec\u53ef\u4ee5\u76d1\u542c\u5e76\u5904\u7406\u9875\u9762\u7684\u751f\u547d\u5468\u671f\u51fd\u6570\u3001\u83b7\u53d6\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b\uff0c\u58f0\u660e\u5e76\u5904\u7406\u6570\u636e\uff0c\u54cd\u5e94\u9875\u9762\u4ea4\u4e92\u4e8b\u4ef6\u7b49\u3002<\/p>\n<pre>Page({\r\n&nbsp;data:&nbsp;{\r\n&nbsp;&nbsp;title:'\u5c0f\u7a0b\u5e8f',\r\n&nbsp;&nbsp;desc:'Hello&nbsp;World!'\r\n&nbsp;}\r\n})<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>index.wxml\u662f\u9875\u9762\u7ed3\u6784\u6587\u4ef6\uff08\u5fc5\u987b\uff09\u3002<\/p>\n<pre>&lt;view&gt;\r\n&nbsp;&lt;view&gt;\r\n&nbsp;&nbsp;&lt;view&gt;\u6807\u9898\uff1apw_title&lt;\/view&gt;\r\n&nbsp;&nbsp;&lt;view&gt;\u63cf\u8ff0\uff1apw_desc&lt;\/view&gt;\r\n&nbsp;&lt;\/view&gt;&lt;\/view&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>index.wxss\u662f\u9875\u9762\u6837\u5f0f\u8868\u6587\u4ef6\uff08\u975e\u5fc5\u987b\uff09\uff0c\u5f53\u6709\u9875\u9762\u6837\u5f0f\u8868\u65f6\uff0c\u9875\u9762\u7684\u6837\u5f0f\u8868\u4e2d\u7684\u6837\u5f0f\u89c4\u5219\u4f1a\u5c42\u53e0\u8986\u76d6app.wxss\u4e2d\u7684\u6837\u5f0f\u89c4\u5219\u3002\u5982\u679c\u4e0d\u6307\u5b9a\u9875\u9762\u7684\u6837\u5f0f\u8868\uff0c\u4e5f\u53ef\u4ee5\u5728\u9875\u9762\u7684\u7ed3\u6784\u6587\u4ef6\u4e2d\u76f4\u63a5\u4f7f\u7528app.wxss\u4e2d\u6307\u5b9a\u7684\u6837\u5f0f\u89c4\u5219\u3002<\/p>\n<pre>.header&nbsp;{\r\n&nbsp;padding:&nbsp;80rpx;\r\n&nbsp;line-height:&nbsp;1;\r\n}\r\n.title&nbsp;{\r\n&nbsp;font-size:&nbsp;52rpx;\r\n}\r\n.desc&nbsp;{\r\n&nbsp;margin-top:&nbsp;10rpx;\r\n&nbsp;color:&nbsp;#888888;\r\n&nbsp;font-size:&nbsp;28rpx;\r\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>index.json\u662f\u9875\u9762\u914d\u7f6e\u6587\u4ef6\uff08\u975e\u5fc5\u987b\uff09\uff0c\u5f53\u6709\u9875\u9762\u7684\u914d\u7f6e\u6587\u4ef6\u65f6\uff0c\u914d\u7f6e\u9879\u5728\u8be5\u9875\u9762\u4f1a\u8986\u76d6app.json\u7684window\u4e2d\u76f8\u540c\u7684\u914d\u7f6e\u9879\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u7684\u9875\u9762\u914d\u7f6e\u6587\u4ef6\uff0c\u5219\u5728\u8be5\u9875\u9762\u76f4\u63a5\u4f7f\u7528app.json\u4e2d\u7684\u9ed8\u8ba4\u914d\u7f6e\u3002\u8fd9\u91cc\u65e0\u9700\u6307\u5b9a\u3002<\/p>\n<p><strong>Tips\uff1a<\/strong><\/p>\n<p>a.\u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u8005\u51cf\u5c11\u914d\u7f6e\u9879\uff0c\u5c0f\u7a0b\u5e8f\u89c4\u5b9a\u63cf\u8ff0\u9875\u9762\u7684\u8fd9\u56db\u4e2a\u6587\u4ef6\u5fc5\u987b\u5177\u6709\u76f8\u540c\u7684\u8def\u5f84\u4e0e\u6587\u4ef6\u540d<\/p>\n<p>b.\u5c0f\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684API\uff0c\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u9700\u6c42\u9009\u62e9\uff08https:\/\/mp.weixin.qq.com\/debug\/wxadoc\/dev\/api\/?t=201715\uff09<\/p>\n<p><strong>\u56db\u3001\u6d4b\u8bd5\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b<\/strong><\/p>\n<p>1\u3001\u6253\u5f00\u5fae\u4fe1web\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u9009\u62e9\u201c\u672c\u5730\u5c0f\u7a0b\u5e8f\u9879\u76ee\u201d\u3002<\/p>\n<p>2\u3001\u586b\u5199\u5c0f\u7a0b\u5e8f\u7684AppID\uff0c\u9879\u76ee\u540d\u79f0\uff0c\u9009\u62e9\u7b2c\u4e09\u6b65\u5199\u597d\u7684\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b\u6587\u4ef6\u5939\uff0c\u70b9\u51fb\u201c\u6dfb\u52a0\u9879\u76ee\u201d\u3002<\/p>\n<p>3\u3001\u5982\u679c\u51fa\u73b0\u5982\u4e0b\u6548\u679c\uff0c\u90a3\u4e48\u606d\u559c\u4f60\uff0c\u4f60\u7684\u7b2c\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u9879\u76ee\u5df2\u7ecf\u7f16\u5199\u6210\u529f\u4e86\uff01\u70b9\u51fb\u5de6\u4fa7\u8fb9\u680f\u201c\u7f16\u8f91\u201d\uff0c\u8fd8\u53ef\u4ee5\u5728\u53f3\u4fa7\u7f16\u8f91\u7a97\u53e3\u76f4\u63a5\u5bf9\u4ee3\u7801\u8fdb\u884c\u4fee\u6539\uff0c\u4fdd\u5b58\uff08CTRL+S\uff09\u540e\u5237\u65b0\uff08F5\uff09\u5373\u53ef\u751f\u6548\u3002<\/p>\n<p>4\u3001\u5982\u679c\u60f3\u770b\u5c0f\u7a0b\u5e8f\u9879\u76ee\u5728\u624b\u673a\u4e0a\u7684\u6548\u679c\uff0c\u70b9\u51fb\u5de6\u4fa7\u8fb9\u680f\u201c\u9879\u76ee\u201d\uff0c\u70b9\u51fb\u201c\u9884\u89c8\u201d\u751f\u6210\u4e8c\u7ef4\u7801\uff0c\u6253\u5f00\u5fae\u4fe1\u626b\u63cf\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u4e86\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5165\u95e8\u7bc7\u4ecb\u7ecd\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>\u524d\u8a00 \u8fd1\u65e5\uff0c\u5728\u5de5\u4f5c\u95f2\u6687\u4e4b\u4f59\uff0c\u9605\u8bfb\u4e86\u4e00\u4e9b\u5173\u4e8e\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u6587\u7ae0\uff0c\u5fcd\u4e0d\u4f4f\uff0c\u60f3\u52a8\u624b\u8bd5\u4ed6\u4e00\u8bd5\u3002\u672c\u6587\u5c31\u4ee5\u201c\u6211\u7684\u7b2c\u4e00\u4e2a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u201d\u4e3a\u4f8b\uff0c\u7b80\u5355\u7684\u4ecb\u7ecd\u4e0b\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u5165\u95e8\u7ea7\u7528\u6cd5\u3002 \u4e00\u3001\u6ce8\u518c\u5c0f\u7a0b\u5e8f\u8d26\u53f7 1\u3001\u8fdb\u5165\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\uff08https:\/\/mp.weixin.qq.com\/\uff09\uff0c\u6ce8\u518c\u5c0f\u7a0b\u5e8f\u8d26\u53f7\uff0c\u6839\u636e\u63d0\u793a\u586b\u5199\u5bf9\u5e94\u7684\u4fe1\u606f\u5373\u53ef\u3002 2\u3001\u6ce8\u518c\u6210\u529f\u540e\u8fdb\u5165\u9996\u9875\uff0c\u5728 \u5c0f\u7a0b\u5e8f\u53d1\u5e03\u6d41\u7a0b-&gt;\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e0e\u7ba1\u7406-&gt;\u914d\u7f6e\u670d\u52a1\u5668\u4e2d\uff0c\u70b9\u51fb\u201c\u5f00\u53d1\u8005\u8bbe\u7f6e\u201d\u3002 3\u3001\u4f1a\u83b7\u5f97\u4e00\u4e2aAppID\uff0c\u8bb0\u5f55AppID\uff0c\u540e\u9762\u521b\u5efa\u9879\u76ee\u65f6\u4f1a\u7528\u5230\u3002 \u6ce8\u610f\uff1a\u5982\u679c\u8981\u4ee5\u975e\u7ba1\u7406\u5458\u5fae\u4fe1\u53f7\u5728\u624b\u673a\u4e0a\u4f53\u9a8c\u8be5\u5c0f\u7a0b\u5e8f\uff0c\u90a3\u4e48\u6211\u4eec\u8fd8\u9700\u8981\u64cd\u4f5c\u201c\u7ed1\u5b9a\u5f00\u53d1\u8005\u201d\u3002\u5373\u5728\u201c\u7528\u6237\u8eab\u4efd\u201d-\u201c\u5f00\u53d1\u8005\u201d\u6a21\u5757\uff0c\u7ed1\u5b9a\u4e0a\u9700\u8981\u4f53\u9a8c\u8be5\u5c0f\u7a0b\u5e8f\u7684\u5fae\u4fe1\u53f7\u3002\u672c\u6559\u7a0b\u9ed8\u8ba4\u6ce8\u518c\u5e10\u53f7\u3001\u4f53\u9a8c\u90fd\u662f\u4f7f\u7528\u7ba1\u7406\u5458\u5fae\u4fe1\u53f7 \u4e8c\u3001\u4e0b\u8f7d\u5fae\u4fe1web\u5f00\u53d1\u8005\u5de5\u5177 \u4e3a\u4e86\u5e2e\u52a9\u5f00\u53d1\u8005\u7b80\u5355\u548c\u9ad8\u6548\u5730\u5f00\u53d1\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u63a8\u51fa\u4e86\u5168\u65b0\u7684\u5f00\u53d1\u8005\u5de5\u5177 \uff0c\u96c6\u6210\u4e86\u5f00\u53d1\u8c03\u8bd5\u3001\u4ee3\u7801\u7f16\u8f91\u53ca\u7a0b\u5e8f\u53d1\u5e03\u7b49\u529f\u80fd\u3002 1\u3001\u4e0b\u8f7d\u9875\u9762\uff1ahttps:\/\/mp.weixin.qq.com\/debug\/wxadoc\/dev\/devtools\/download.html?t=201715 \u6839\u636e\u7cfb\u7edf\uff0c\u9009\u62e9\u5bf9\u5e94\u7684\u5de5\u5177\u7248\u672c\u4e0b\u8f7d 2\u3001\u5de5\u5177\u5305\u542b\u7f16\u8f91\u3001\u8c03\u8bd5\u548c\u9879\u76ee\u4e09\u4e2a\u9875\u5361\uff1a \uff081\uff09\u7f16\u8f91\u533a\u53ef\u4ee5\u5bf9\u5f53\u524d\u9879\u76ee\u8fdb\u884c\u4ee3\u7801\u7f16\u5199\u548c\u6587\u4ef6\u7684\u6dfb\u52a0\u3001\u5220\u9664\u4ee5\u53ca\u91cd\u547d\u540d\u7b49\u57fa\u672c\u64cd\u4f5c \uff082\uff09\u7a0b\u5e8f\u8c03\u8bd5\u4e3b\u8981\u6709\u4e09\u5927\u529f\u80fd\u533a\uff1a\u6a21\u62df\u5668\u3001\u8c03\u8bd5\u5de5\u5177\u548c\u5c0f\u7a0b\u5e8f\u64cd\u4f5c\u533a \uff083\uff09\u9879\u76ee\u9875\u5361\u4e3b\u8981\u6709\u4e09\u5927\u529f\u80fd\uff1a\u663e\u793a\u5f53\u524d\u9879\u76ee\u7ec6\u8282\u3001\u63d0\u4ea4\u9884\u89c8\u548c\u63d0\u4ea4\u4e0a\u4f20\u548c\u9879\u76ee\u914d\u7f6e \u6ce8\u610f\uff1a\u542f\u52a8\u5de5\u5177\u65f6\uff0c\u5f00\u53d1\u8005\u9700\u8981\u4f7f\u7528\u5df2\u5728\u540e\u53f0\u7ed1\u5b9a\u6210\u529f\u7684\u5fae\u4fe1\u53f7\u626b\u63cf\u4e8c\u7ef4\u7801\u767b\u5f55\uff0c\u540e\u7eed\u6240\u6709\u7684\u64cd\u4f5c\u90fd\u4f1a\u57fa\u4e8e\u8fd9\u4e2a\u5fae\u4fe1\u5e10\u53f7 \u4e09\u3001\u7f16\u5199\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b 1\u3001\u5b9e\u4f8b\u76ee\u5f55\u7ed3\u6784 test &nbsp;\u251c\u2500&nbsp;page &nbsp;\u2502&nbsp;\u2514\u2500&nbsp;index &nbsp;\u2502&nbsp;&nbsp;\u251c\u2500&nbsp;index.js &nbsp;\u2502&nbsp;&nbsp;\u251c\u2500&nbsp;index.json &nbsp;\u2502&nbsp;&nbsp;\u251c\u2500&nbsp;index.wxml &nbsp;\u2502&nbsp;&nbsp;\u2514\u2500&nbsp;index.wxss &nbsp;\u251c\u2500&nbsp;app.js &nbsp;\u251c\u2500&nbsp;app.json &nbsp;\u2514\u2500&nbsp;app.wxss \u767b\u5f55\u540e\u590d\u5236 2\u3001\u5b9e\u4f8b\u6587\u4ef6\u8bf4\u660e\u53ca\u6e90\u7801 \u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u5305\u542b\u4e00\u4e2aapp\uff08\u4e3b\u4f53\u90e8\u5206\uff09\u548c\u591a\u4e2apage\uff08\u9875\u9762\uff09 \uff081\uff09app\u662f\u7528\u6765\u63cf\u8ff0\u6574\u4f53\u7a0b\u5e8f\u7684\uff0c\u7531\u4e09\u4e2a\u6587\u4ef6\u7ec4\u6210\uff0c.js\u540e\u7f00\u7684\u662f\u811a\u672c\u6587\u4ef6\uff0c.json\u540e\u7f00\u7684\u6587\u4ef6\u662f\u914d\u7f6e\u6587\u4ef6\uff0c.wxss\u540e\u7f00\u7684\u662f\u6837\u5f0f\u8868\u6587\u4ef6\uff0c\u5fc5\u987b\u653e\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\u3002 app.js\u662f\u5c0f\u7a0b\u5e8f\u7684\u811a\u672c\u4ee3\u7801\uff08\u5fc5\u987b\uff09\uff0c\u53ef\u4ee5\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u76d1\u542c\u5e76\u5904\u7406\u5c0f\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u51fd\u6570\u3001\u58f0\u660e\u5168\u5c40\u53d8\u91cf\uff0c\u8c03\u7528\u6846\u67b6\u63d0\u4f9b\u7684\u4e30\u5bcc\u7684 API\u3002 App({ &nbsp;onLaunch:&nbsp;function&nbsp;()&nbsp;{ &nbsp;&nbsp;console.log(&#8216;App&nbsp;Launch&#8217;) &nbsp;}, &nbsp;onShow:&nbsp;function&nbsp;()&nbsp;{ &nbsp;&nbsp;console.log(&#8216;App&nbsp;Show&#8217;) &nbsp;}, &nbsp;onHide:&nbsp;function&nbsp;()&nbsp;{ &nbsp;&nbsp;console.log(&#8216;App&nbsp;Hide&#8217;) &nbsp;}, &nbsp;globalData:&nbsp;{ &nbsp;&nbsp;hasLogin:&nbsp;false &nbsp;} }) \u767b\u5f55\u540e\u590d\u5236 app.json\u662f\u5bf9\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e\uff08\u5fc5\u987b\uff09\uff0c\u7528\u6765\u5bf9\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u8fdb\u884c\u5168\u5c40\u914d\u7f6e\uff0c\u51b3\u5b9a\u9875\u9762\u6587\u4ef6\u7684\u8def\u5f84\u3001\u7a97\u53e3\u8868\u73b0\u3001\u8bbe\u7f6e\u7f51\u7edc\u8d85\u65f6\u65f6\u95f4\u3001\u8bbe\u7f6e\u591atab\u7b49\u3002\u63a5\u53d7\u4e00\u4e2a\u6570\u7ec4\uff0c\u6bcf\u4e00\u9879\u90fd\u662f\u5b57\u7b26\u4e32\uff0c\u6765\u6307\u5b9a\u5c0f\u7a0b\u5e8f\u7531\u54ea\u4e9b\u9875\u9762\u7ec4\u6210\u3002\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u6bcf\u4e00\u4e2a\u9875\u9762\u7684\u3010\u8def\u5f84+\u9875\u9762\u540d\u3011\u90fd\u9700\u8981\u5199\u5728app.json\u7684pages\u4e2d\uff0c\u4e14pages\u4e2d\u7684\u7b2c\u4e00\u4e2a\u9875\u9762\u662f\u5c0f\u7a0b\u5e8f\u7684\u9996\u9875\u3002 { &nbsp;&#8220;pages&#8221;:[ &nbsp;&nbsp;&#8220;page\/index\/index&#8221; [&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-30909","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30909","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=30909"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30909\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}