{"id":33428,"date":"2024-11-25T09:18:01","date_gmt":"2024-11-25T01:18:01","guid":{"rendered":"https:\/\/fwq.ai\/blog\/33428\/"},"modified":"2024-11-25T09:18:01","modified_gmt":"2024-11-25T01:18:01","slug":"%e5%85%ab%e5%88%86%e9%92%9f%e5%b8%a6%e4%bd%a0%e5%85%a5%e9%97%a8%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/33428\/","title":{"rendered":"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/053\/5ef95b8597c40186.jpg\" class=\"aligncenter\" title=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe\" alt=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe\" \/><\/p>\n<p><strong><span style=\"font-size: 14px\">\u6ce8\u518c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f<\/span><\/strong><\/p>\n<p>\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u7684\u8d26\u53f7\uff0c\u8bf7\u5148\u8fdb\u5165\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u9996\u9875\uff0c\u70b9\u51fb \u201c\u7acb\u5373\u6ce8\u518c\u201d \u6309\u94ae\u8fdb\u884c\u6ce8\u518c\u3002\u6ce8\u518c\u7684\u8d26\u53f7\u7c7b\u578b\u53ef\u4ee5\u662f\u8ba2\u9605\u53f7\u3001\u670d\u52a1\u53f7\u3001\u5c0f\u7a0b\u5e8f\u4ee5\u53ca\u4f01\u4e1a\u5fae\u4fe1\uff0c\u6211\u4eec\u9009\u62e9 \u201c\u5c0f\u7a0b\u5e8f\u201d \u5373\u53ef\u3002<\/p>\n<p>\u63a5\u7740\u586b\u5199\u8d26\u53f7\u4fe1\u606f\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u586b\u5199\u7684\u90ae\u7bb1\u5fc5\u987b\u662f\u672a\u88ab\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u6ce8\u518c\u3001\u672a\u88ab\u4e2a\u4eba\u5fae\u4fe1\u53f7\u7ed1\u5b9a\u7684\u90ae\u7bb1\uff0c\u800c\u4e14\u6bcf\u4e2a\u90ae\u7bb1\u4ec5\u80fd\u7533\u8bf7\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u3002<\/p>\n<p>\u6fc0\u6d3b\u90ae\u7bb1\u4e4b\u540e\uff0c\u9009\u62e9\u4e3b\u4f53\u7c7b\u578b\u4e3a \u201c\u4e2a\u4eba\u7c7b\u578b\u201d\uff0c\u5e76\u6309\u8981\u6c42\u767b\u8bb0\u4e3b\u4f53\u4fe1\u606f\u3002\u4e3b\u4f53\u4fe1\u606f\u63d0\u4ea4\u540e\u4e0d\u53ef\u4fee\u6539\uff0c\u8be5\u4e3b\u4f53\u5c06\u6210\u4e3a\u4f60\u4f7f\u7528\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u5404\u9879\u670d\u52a1\u548c\u529f\u80fd\u7684\u552f\u4e00\u6cd5\u5f8b\u4e3b\u4f53\u4e0e\u7f14\u7ea6\u4e3b\u4f53\uff0c\u5728\u540e\u7eed\u5f00\u901a\u5176\u4ed6\u4e1a\u52a1\u529f\u80fd\u65f6\u4e0d\u5f97\u53d8\u66f4\u6216\u4fee\u6539\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/859\/360\/580\/1593399479760370.png\" class=\"aligncenter\" title=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe1\" alt=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe1\" \/><\/p>\n<p>\u4e00\u5207 OK \u5c31\u53ef\u4ee5\u76f4\u63a5\u8fdb\u5165\u5c0f\u7a0b\u5e8f\u7684\u7ba1\u7406\u5e73\u53f0\u4e86\u3002\u5982\u679c\u76f4\u63a5\u8df3\u8f6c\u5931\u8d25\uff0c\u4e5f\u53ef\u4ee5\u4ece\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u4e0a\u624b\u52a8\u767b\u5f55\u3002\u586b\u5199\u5c0f\u7a0b\u5e8f\u7684\u57fa\u672c\u4fe1\u606f\uff0c\u5305\u62ec\u540d\u79f0\u3001\u56fe\u6807\u3001\u63cf\u8ff0\u7b49\u3002\u63d0\u4ea4\u6210\u529f\u4e4b\u540e\uff0c\u518d\u6dfb\u52a0\u5f00\u53d1\u8005\u3002\u5f00\u53d1\u8005\u9ed8\u8ba4\u4e3a\u7ba1\u7406\u5458\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u4ece\u8fd9\u91cc\u65b0\u589e\u7ed1\u5b9a\u5f00\u53d1\u8005\uff0c\u8fd9\u662f\u7ba1\u7406\u5458\u624d\u6709\u6743\u9650\u7684\u64cd\u4f5c\u3002<\/p>\n<p>\u7136\u540e\u5728\u5de6\u4fa7\u5bfc\u822a\u680f\u70b9\u51fb \u201c\u8bbe\u7f6e\u201d\uff0c\u627e\u5230\u5f00\u53d1\u8bbe\u7f6e\uff0c\u83b7\u5f97\u5c0f\u7a0b\u5e8f\u7684 AppID\u3002<\/p>\n<p><strong>\u5fae\u4fe1\u5f00\u53d1\u8005\u5de5\u5177<\/strong><\/p>\n<p>\u4e0b\u8f7d\u5fae\u4fe1web\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u6839\u636e\u81ea\u5df1\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0b\u8f7d\u5bf9\u5e94\u7684\u5b89\u88c5\u5305\u8fdb\u884c\u5b89\u88c5\u5373\u53ef\u3002<\/p>\n<p>\u6253\u5f00\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u7528\u5fae\u4fe1\u626b\u7801\u767b\u5f55\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u51c6\u5907\u5f00\u53d1\u4f60\u7684\u7b2c\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u5427\uff01<\/p>\n<p><strong>\u7b2c\u4e00\u4e2a\u5c0f\u7a0b\u5e8f<\/strong><\/p>\n<p>\u65b0\u5efa\u9879\u76ee<\/p>\n<p>\u6253\u5f00\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u9009\u62e9 \u201c\u5c0f\u7a0b\u5e8f\u9879\u76ee\u201d\uff0c\u70b9\u51fb\u53f3\u4e0b\u89d2\u7684 \u201c+\u201d \u65b0\u5efa\u9879\u76ee\u3002<\/p>\n<p>\u9009\u62e9\u4e00\u4e2a\u7a7a\u7684\u6587\u4ef6\u5939\u4f5c\u4e3a\u9879\u76ee\u76ee\u5f55\uff0c\u586b\u5165\u521a\u521a\u7684 AppID\uff0c\u518d\u586b\u5199\u4e00\u4e2a\u9879\u76ee\u540d\u79f0\uff0c\u6bd4\u5982\u6211\u8fd9\u91cc\u53eb\u505a GoZeroWaster\u3002\u70b9\u51fb \u201c\u786e\u5b9a\u201d \u8fdb\u5165\u5de5\u5177\u4e3b\u754c\u9762\u3002<\/p>\n<p>\u9879\u76ee\u76ee\u5f55\u7ed3\u6784<\/p>\n<p><strong>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u57fa\u672c\u6587\u4ef6\u6784\u9020\u548c\u9879\u76ee\u76ee\u5f55\u7ed3\u6784\u8bf4\u660e\u5982\u4e0b\uff1a<\/strong><\/p>\n<blockquote><p>\n  &nbsp;&nbsp;&nbsp;&nbsp;. &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;app.js&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u5c0f\u7a0b\u5e8f\u7684\u903b\u8f91\u6587\u4ef6 &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;app.json&nbsp;&nbsp;&nbsp;#&nbsp;\u5c0f\u7a0b\u5e8f\u7684\u914d\u7f6e\u6587\u4ef6 &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;app.wxss&nbsp;&nbsp;&nbsp;#&nbsp;\u5168\u5c40\u516c\u5171\u6837\u5f0f\u6587\u4ef6 &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;pages&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u5b58\u653e\u5c0f\u7a0b\u5e8f\u7684\u5404\u4e2a\u9875\u9762 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;index&nbsp;&nbsp;#&nbsp;index\u9875\u9762 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;index.js&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u903b\u8f91 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;index.wxml&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u7ed3\u6784 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;index.wxss&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u6837\u5f0f\u8868 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;logs&nbsp;&nbsp;&nbsp;#&nbsp;logs\u9875\u9762 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;logs.js&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u903b\u8f91 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;logs.json&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u914d\u7f6e &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;logs.wxml&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u7ed3\u6784 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;logs.wxss&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u6837\u5f0f\u8868 &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;project.config.json &nbsp;&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;utils &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;util.js\n<\/p><\/blockquote>\n<p>\u6839\u76ee\u5f55\u4e0b\u67093\u4e2a\u6587\u4ef6\uff1aapp.js\u3001app.json\u3001app.wxss\uff0c\u5c0f\u7a0b\u5e8f\u5fc5\u987b\u6709\u8fd93\u4e2a\u63cf\u8ff0 APP \u7684\u6587\u4ef6\uff0c\u5e76\u653e\u5728\u6839\u76ee\u5f55\u4e0b\u3002\u8fd93\u4e2a\u662f\u5e94\u7528\u7a0b\u5e8f\u7ea7\u522b\u7684\u6587\u4ef6\uff0c\u4e0e\u4e4b\u5e73\u884c\u7684\u8fd8\u6709\u4e00\u4e2a pages \u6587\u4ef6\u5939\uff0c\u7528\u6765\u5b58\u653e\u5c0f\u7a0b\u5e8f\u7684\u5404\u4e2a\u9875\u9762\u3002<\/p>\n<p><strong>\u6211\u4eec\u53ef\u4ee5\u548c web \u524d\u7aef\u5f00\u53d1\u6280\u672f\u505a\u4e2a\u7c7b\u6bd4\uff1a<\/strong><\/p>\n<ul>\n<li>wxml \u7c7b\u4f3c\u4e8e HTML \u6587\u4ef6\uff0c\u7528\u6765\u7f16\u5199\u9875\u9762\u7684\u6807\u7b7e\u548c\u9aa8\u67b6\uff0c\u4f46\u91cc\u9762\u53ea\u80fd\u7528\u5c0f\u7a0b\u5e8f\u81ea\u5df1\u5c01\u88c5\u7684\u7ec4\u4ef6\uff1b<\/li>\n<li>wxss \u7c7b\u4f3c\u4e8e CSS \u6587\u4ef6\uff0c\u7528\u6765\u7f16\u5199\u9875\u9762\u6837\u5f0f\uff0c\u53ea\u662f\u628a css \u6587\u4ef6\u6362\u6210\u4e86 wxss \u6587\u4ef6\uff1b<\/li>\n<li>js \u6587\u4ef6\u7c7b\u4f3c\u4e8e\u524d\u7aef\u7f16\u7a0b\u4e2d\u7684 JavaScript \u6587\u4ef6\uff0c\u7528\u6765\u7f16\u5199\u5c0f\u7a0b\u5e8f\u7684\u9875\u9762\u903b\u8f91\uff1b<\/li>\n<li>json \u6587\u4ef6\u7528\u6765\u914d\u7f6e\u9875\u9762\u7684\u6837\u5f0f\u548c\u884c\u4e3a\u3002<\/li>\n<\/ul>\n<p>\u76ee\u6807\u6210\u679c<\/p>\n<p>\u6211\u4eec\u5148\u6765\u770b\u770b\u6700\u7ec8\u7684\u76ee\u6807\u548c\u6210\u679c\uff0c\u5f88\u7b80\u5355\uff0c\u4e00\u5171\u4e24\u9875\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/162\/361\/557\/1593399528907322.png\" class=\"aligncenter\" title=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe2\" alt=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe2\" \/><\/p>\n<p>\uff08\u4e3a\u4e86\u8ba9\u5e7f\u5927\u7a0b\u5e8f\u5458\u4e5f\u80fd\u4fdd\u62a4\u73af\u5883\u548c\u70ed\u7231\u751f\u6d3b\uff0c\u6211\u7279\u610f\u9009\u4e86 \u201c\u96f6\u5783\u573e\u751f\u6d3b\u201d \u4e3b\u9898\u6765\u505a Demo\uff09<\/p>\n<p>\u6b65\u9aa4\u5206\u89e3<\/p>\n<p>Demo \u4ee3\u7801\u4e0b\u8f7d\uff1ahttps:\/\/gitee.com\/luhuadong\/Web_Learning\/tree\/master\/WeChat\/GoZeroWaster<\/p>\n<p><strong>\u5206\u89e3\u76ee\u6807\u6210\u679c\uff1a<\/strong><\/p>\n<ol>\n<li><strong>\u4e2a\u4eba\u4e2d\u5fc3<\/strong><\/li>\n<li><strong>\u751f\u6d3b\u6307\u5357<\/strong><\/li>\n<li><strong>\u6a21\u62df\u5f39\u7a97<\/strong><\/li>\n<li><strong>\u9884\u89c8\u56fe\u7247<\/strong><\/li>\n<\/ol>\n<p>\u9875\u5934\u9875\u5c3e<\/p>\n<p>\u5728\u76ee\u6807\u6210\u679c\u9884\u89c8\u4e2d\u6211\u4eec\u770b\u5230\uff0c\u4e24\u4e2a\u9875\u9762\u90fd\u6709\u5171\u540c\u7684\u90e8\u5206 \u2014\u2014 \u9875\u5934\u548c\u9875\u5c3e\u3002\u6240\u4ee5\u5728\u6784\u5efa\u9875\u9762\u5185\u5bb9\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u628a\u9875\u5934\u548c\u9875\u5c3e\u5904\u7406\u597d\u3002\u6211\u4eec\u5f88\u5bb9\u6613\u731c\u5230\uff0c\u8fd9\u4e24\u90e8\u5206\u5c5e\u4e8e\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e\uff0c\u56e0\u6b64\u9700\u8981\u4fee\u6539 app.json \u6587\u4ef6\u3002<\/p>\n<p>\u6700\u521d\u7684\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre>    {\n        \"pages\":[\n            \"pages\/index\/index\",\n            \"pages\/logs\/logs\"\n        ],\n        \"window\":{\n            \"backgroundTextStyle\": \"light\",\n            \"navigationBarBackgroundColor\": \"#fff\",\n            \"navigationBarTitleText\": \"WeChat\",\n            \"navigationBarTextStyle\": \"balack\"\n        }\n    }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>pages \u5c5e\u6027\u7528\u6765\u8bbe\u7f6e\u9875\u9762\u8def\u5f84\uff0c\u5b83\u662f\u4e00\u4e2a\u6570\u7ec4\uff0c\u6bcf\u4e00\u9879\u90fd\u662f\u5b57\u7b26\u4e32\u6765\u6307\u5b9a\u5c0f\u7a0b\u5e8f\u7531\u54ea\u4e9b\u9875\u9762\u7ec4\u6210\u3002\u6570\u7ec4\u7684\u7b2c\u4e00\u9879\u4ee3\u8868\u5c0f\u7a0b\u5e8f\u7684\u521d\u59cb\u9875\u9762\u3002\u5c0f\u7a0b\u5e8f\u4e2d\u65b0\u589e\u6216\u51cf\u5c11\u9875\u9762\uff0c\u90fd\u9700\u8981\u5bf9 pages \u6570\u7ec4\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n<p>window \u5c5e\u6027\u7528\u4e8e\u8bbe\u7f6e\u5c0f\u7a0b\u5e8f\u7684\u72b6\u6001\u680f\u3001\u5bfc\u822a\u6761\u3001\u6807\u9898\u3001\u7a97\u53e3\u80cc\u666f\u8272\u3002<\/p>\n<p>\u6211\u4eec\u628a\u9875\u5934\u7684\u6807\u9898\u548c\u989c\u8272\u4fee\u6539\u4e00\u4e0b\uff0c\u9875\u5c3e\u90e8\u5206\u6211\u4eec\u505a\u4e00\u4e2a tab \u680f\u6765\u5207\u6362\u9875\u9762\uff0c\u8fd9\u4e2a\u5c5e\u6027\u53eb\u505a tabBar\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>{\n  \"pages\":[\n    \"pages\/index\/index\",\n    \"pages\/logs\/logs\"\n  ],\n  \"window\":{\n    \"backgroundTextStyle\":\"light\",\n    \"navigationBarBackgroundColor\": \"#2f2f8f\",\n    \"navigationBarTitleText\": \"GoZeroWaste\",\n    \"navigationBarTextStyle\":\"white\"\n  },\n  \"tabBar\":{\n    \"color\": \"#bfc1ab\",\n    \"selectedColor\": \"#13b11c\",\n    \"backgroundColor\": \"#1f1f4f\",\n    \"list\": [\n      {\n        \"pagePath\": \"pages\/index\/index\",\n        \"iconPath\": \"image\/icon_component.png\",\n        \"selectedIconPath\": \"image\/icon_component_HL.png\",\n        \"text\": \"\u4e2a\u4eba\u4e2d\u5fc3\"\n      },\n      {\n        \"pagePath\": \"pages\/details\/details\",\n        \"iconPath\": \"image\/icon_API.png\",\n        \"selectedIconPath\": \"image\/icon_API_HL.png\",\n        \"text\": \"\u751f\u6d3b\u6307\u5357\"\n      }\n    ]\n  }}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\uff08\u6240\u7528\u5230\u7684\u56fe\u7247\u653e\u5728\u9879\u76ee\u7684 image \u76ee\u5f55\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u81ea\u5df1\u7684\u56fe\u7247\uff09<\/p>\n<p>\u8fd9\u91cc\u7528\u5230\u51e0\u4e2a tabBar \u7684\u5c5e\u6027\u662f color\u3001selectedColor\u3001backgroundColor \u548c list\uff0clist \u662f\u4e00\u4e2a\u6570\u7ec4\uff0c\u4e3b\u8981\u7528\u4e8e\u8bbe\u5b9a\u5bfc\u822a\u7684\u8def\u5f84\u3002<\/p>\n<p>CTRL + S \u4fdd\u5b58\u4e4b\u540e\uff0c\u6a21\u62df\u5668\u5c31\u4f1a\u81ea\u52a8\u5237\u65b0\uff0c\u9a6c\u4e0a\u53ef\u4ee5\u770b\u5230\u6548\u679c\u3002<\/p>\n<p><strong>\u4e2a\u4eba\u4e2d\u5fc3<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/717\/677\/587\/1593399567283452.png\" class=\"aligncenter\" title=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe3\" alt=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe3\" \/><\/p>\n<p>\u7b80\u5355\u8d77\u89c1\uff0c\u6211\u4eec\u5c31\u5728 pages\/index \u76ee\u5f55\u4e0b\u5b9e\u73b0 \u201c\u4e2a\u4eba\u4e2d\u5fc3\u201d \u9875\u9762\u597d\u4e86\u3002\u53cc\u51fb\u6253\u5f00 index.wxml\uff0c\u521d\u59cb\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre>    &lt;!--index.wxml--&gt;\n    &lt;view class=\"container\"&gt;\n      &lt;view class=\"userinfo\"&gt;\n        &lt;button wx:if=\"{{!hasUserInfo &amp;&amp; canIUse}}\" open-type=\"getUserInfo\" bindgetuserinfo=\"getUserInfo\"&gt; \u83b7\u53d6\u5934\u50cf\u6635\u79f0 &lt;\/button&gt;\n        &lt;block wx:else&gt;\n          &lt;image bindtap=\"bindViewTap\" class=\"userinfo-avatar\" src=\"{{userInfo.avatarUrl}}\" background-size=\"cover\"&gt;&lt;\/image&gt;\n          &lt;text class=\"userinfo-nickname\"&gt;{{userInfo.nickName}}&lt;\/text&gt;\n        &lt;\/block&gt;\n      &lt;\/view&gt;\n      &lt;view class=\"usermotto\"&gt;\n        &lt;text class=\"user-motto\"&gt;{{motto}}&lt;\/text&gt;\n      &lt;\/view&gt;\n    &lt;\/view&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u91cc\u5df2\u7ecf\u6709\u4e00\u4e9b\u4ee3\u7801\u4e86\uff0c\u867d\u7136\u73b0\u5728\u53ef\u80fd\u8fd8\u770b\u4e0d\u61c2\uff0c\u4f46\u6211\u4eec\u77e5\u9053\uff0c\u8fd9\u5c31\u662f\u73b0\u5728\u9875\u9762\u7684\u6e90\u4ee3\u7801\u3002\u6211\u4eec\u628a \u201cHello World\u201d \u90e8\u5206\u6ce8\u91ca\u6389\uff0c\u589e\u52a0\u6211\u4eec\u5e0c\u671b\u663e\u793a\u7684\u5185\u5bb9\uff1a<\/p>\n<pre>&lt;!--index.wxml--&gt;&lt;view class=\"container\"&gt;\n  &lt;view class=\"userinfo\"&gt;\n    &lt;button wx:if=\"{{!hasUserInfo &amp;&amp; canIUse}}\" open-type=\"getUserInfo\" bindgetuserinfo=\"getUserInfo\"&gt; \u83b7\u53d6\u5934\u50cf\u6635\u79f0 &lt;\/button&gt;\n    &lt;block wx:else&gt;\n      &lt;image bindtap=\"bindViewTap\" class=\"userinfo-avatar\" src=\"{{userInfo.avatarUrl}}\" background-size=\"cover\"&gt;&lt;\/image&gt;\n      &lt;text class=\"userinfo-nickname\"&gt;{{userInfo.nickName}}&lt;\/text&gt;\n    &lt;\/block&gt;\n  &lt;\/view&gt;\n   &lt;!-- &lt;view class=\"usermotto\"&gt;\n    &lt;text class=\"user-motto\"&gt;{{motto}}&lt;\/text&gt;\n  &lt;\/view&gt;  --&gt;\n  &lt;view class=\"ID_Badge\"&gt;\n    &lt;view&gt;\n      &lt;text class=\"ID_info\"&gt;{{company}}&lt;\/text&gt;\n    &lt;\/view&gt;\n    &lt;view&gt;\n      &lt;text class='ID_info'&gt;{{position}}&lt;\/text&gt;\n    &lt;\/view&gt;\n    &lt;view&gt;\n      &lt;text class='ID_info'&gt;{{lesson}}&lt;\/text&gt;\n    &lt;\/view&gt;\n  &lt;\/view&gt;&lt;\/view&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u91cc\u5206\u522b\u4f7f\u7528 {{company}}\u3001{{position}} \u548c {{lesson}} \u4f5c\u4e3a\u5360\u4f4d\u7b26\uff0c\u7528\u6cd5\u7c7b\u4f3c\u4e8e Django \u7684\u6a21\u677f\u8bed\u8a00\u3002\u5f53\u7136\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7528\u76f8\u5e94\u7684\u5b57\u7b26\u6765\u66ff\u6362\u5b83\uff0c\u53ea\u4e0d\u8fc7\u6211\u4eec\u60f3\u6cbf\u7528 {{motto}} \u7684\u505a\u6cd5\uff0c\u8ba9\u4f60\u77e5\u9053\u5728\u54ea\u91cc\u4fee\u6539\u8fd9\u4e9b\u6570\u636e\u3002\u6ca1\u9519\uff0c\u5c31\u662f\u5728 index.js \u6587\u4ef6\uff1a<\/p>\n<pre>Page({\n  data: {\n    motto: 'Hello World',\n    company: \"GoZeroWaste\",\n    lesson: \"21\u5929\u96f6\u5783\u573e\u751f\u6d3b\u6307\u5357\",\n    position: \"\u5783\u573e\u9b54\u6cd5\u5e08\",\n    \/* ... *\/\n  }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>wxml \u6587\u4ef6\u4e2d\u7684 \u7ec4\u4ef6\u7c7b\u4f3c\u4e8e\u7f51\u9875\u5f00\u53d1\u4e2d\u7684 <\/p>\n<p>\uff0c\u800c \u7ec4\u4ef6\u662f\u7528\u6765\u5199\u6587\u672c\u7684\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f \u7ec4\u4ef6\u5185\u53ea\u652f\u6301 \u5d4c\u5957\u3002\u5f53\u7136\uff0c\u53ef\u7528\u7528 <img> \u63d2\u5165\u56fe\u7247\uff0c\u56fe\u7247\u8981\u4fdd\u5b58\u5230 image \u76ee\u5f55\uff0c\u5426\u5219\u5728\u6d4b\u8bd5\u7684\u65f6\u5019\u662f\u65e0\u6cd5\u4e0a\u4f20\u7684\u3002 <\/p>\n<pre>    &lt;view class=\"ID_Badge\"&gt;\n        &lt;!-- \u7701\u7565 --&gt;\n        &lt;view&gt;\n          &lt;text class='ID_info'&gt;{{lesson}}&lt;\/text&gt;\n        &lt;\/view&gt;\n        &lt;view&gt;\n          &lt;image class='pic' mode='widthFix' src='..\/..\/image\/GoZeroWaste.jpg'&gt;&lt;\/image&gt;\n        &lt;\/view&gt;\n      &lt;\/view&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>mode=\u2018widthFix\u2019 &nbsp;\u8868\u793a\u4ee5\u5bbd\u5ea6\u4e0d\u53d8\uff0c\u9ad8\u5ea6\u81ea\u52a8\u53d8\u5316\uff0c\u4fdd\u6301\u539f\u56fe\u5bbd\u9ad8\u6bd4\u4e0d\u53d8\u7684\u65b9\u5f0f\u8fdb\u884c\u7f29\u653e\u4ee5\u9002\u5e94\u5c4f\u5e55\u5927\u5c0f\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u8fd8\u9700\u8981\u4fee\u6539 index.wxss \u6587\u4ef6\u6765\u8bbe\u7f6e\u6837\u5f0f\uff1a<\/p>\n<pre>\/**index.wxss**\/.userinfo {\n  display: flex;\n  flex-direction: column;\n  align-items: center;}.userinfo-avatar {\n  width: 128rpx;\n  height: 128rpx;\n  margin: 20rpx;\n  border-radius: 50%;}.userinfo-nickname {\n  color: #aaa;}.usermotto {\n  margin-top: 200px;}.ID_Badge {\n  padding-top: 20rpx;\n  color: blue;}.ID_info {\n  display: flex;\n  flex-direction: column;\n  align-items: center;}.pics {\n  width: 400rpx;}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fdd\u5b58\u5237\u65b0\uff0c\u201c\u4e2a\u4eba\u4e2d\u5fc3\u201d \u9875\u9762\u5c31\u5b8c\u6210\u4e86\u3002<\/p>\n<p><strong>\u751f\u6d3b\u6307\u5357<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/674\/375\/118\/1593399623151339.png\" class=\"aligncenter\" title=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe4\" alt=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe4\" \/><\/p>\n<p>\u539f\u6765\u7684\u9879\u76ee\u4e2d pages \u76ee\u5f55\u4e0b\u53ea\u6709 index \u548c logs \u4e24\u4e2a\u76ee\u5f55\uff0c\u56e0\u6b64\u6211\u4eec\u8fd8\u9700\u8981\u4e3a\u7b2c\u4e8c\u4e2a\u9875\u9762\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u3002<\/p>\n<p><strong>\u521b\u5efa\u9875\u9762\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a<\/strong><\/p>\n<ul>\n<li>\u5728\u76ee\u5f55\u7ed3\u6784\u7684 pages \u56fe\u8868\u4e0a\uff0c\u65b0\u5efa\u76ee\u5f55\uff0c\u7136\u540e\u5728\u76ee\u5f55\u4e0b\u9010\u4e00\u521b\u5efa\u9875\u9762\u6784\u6210\u6587\u4ef6<\/li>\n<li>\u5728 app.json \u4e0b\uff0c\u76f4\u63a5\u6dfb\u52a0<\/li>\n<\/ul>\n<p>\u5efa\u8bae\u91c7\u7528\u7b2c\u4e8c\u79cd\u65b9\u6cd5\uff0c\u4fee\u6539 app.json \u6587\u4ef6\uff1a<\/p>\n<pre>    {\n      \"pages\":[\n        \"pages\/index\/index\",\n        \"pages\/logs\/logs\",\n        \"pages\/details\/details\"\n      ]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fdd\u5b58\u5237\u65b0\u4e4b\u540e\u5c31\u4f1a\u53d1\u73b0\uff0c\u76ee\u5f55\u7ed3\u6784\u91cc\u81ea\u52a8\u521b\u5efa\u4e86\u8fd9\u4e00\u9875\u3002\u5bf9\u5e94\u7684\uff0c\u4e5f\u8981\u4fee\u6539 app.json \u4e2d\u7684 tabBar \u7684\u94fe\u63a5\uff08\u5b9e\u9645\u4e0a\u6211\u4eec\u5df2\u7ecf\u505a\u4e86\uff09\uff1a<\/p>\n<pre>    \t{\n            \"pagePath\": \"pages\/details\/details\",\n            \"iconPath\": \"image\/icon_API.png\",\n            \"selectedIconPath\": \"image\/icon_API_HL.png\",\n            \"text\": \"\u751f\u6d3b\u6307\u5357\"\n        }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7136\u540e\u4fee\u6539 details.wxml \u8bbe\u7f6e\u8fd9\u4e00\u9875\u7684\u6807\u9898\uff1a<\/p>\n<pre>    &lt;!--pages\/details\/details.wxml--&gt;\n    &lt;view&gt;\n      &lt;view class='title'&gt;\n        &lt;text&gt;21\u5929\u96f6\u5783\u573e\u751f\u6d3b\u6307\u5357&lt;\/text&gt;\n      &lt;\/view&gt;\n    &lt;\/view&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fee\u6539 details.wxss \u8bbe\u7f6e\u6837\u5f0f\uff1a<\/p>\n<pre>    \/* pages\/details\/details.wxss *\/\n    .title {\n      display: flex;\n      flex-direction: column;\n      align-items: center;\n      margin-top: 40rpx;\n      margin-bottom: 40rpx;\n      font-size: 40rpx;\n    }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u4e2a\u9875\u9762\u662f\u4e00\u4e2a\u5217\u8868\u5c55\u793a\u7684\u9875\u9762\uff0c\u6211\u4eec\u5148\u5728 details.js \u6587\u4ef6\u4e2d\u51c6\u5907\u597d\u6570\u636e\uff1a<\/p>\n<pre>\/\/ pages\/details\/details.jsPage({\n\n  \/**\n   * \u9875\u9762\u7684\u521d\u59cb\u6570\u636e\n   *\/\n  data: {\n    showModalStatus: false,\n    list: [\n      {\n        id: 0,\n        name : \"\u5199\u4e00\u7bc7\u300a\u5783\u573e\u65e5\u8bb0\u300b\",\n        introduce: \"\u96f6\u5783\u573e\u5e76\u4e0d\u662f\u4e00\u9879\u5b8f\u5927\u7684\u5de5\u7a0b\uff0c\u800c\u662f\u7531\u65e5\u5e38\u751f\u6d3b\u4e2d\u4e00\u4e2a\u4e2a\u5c0f\u5c0f\u7684\u4e60\u60ef\u548c\u9009\u62e9\u7ec4\u6210\u7684\u3002\u6700\u96be\u7684\uff0c\u662f\u8fc8\u51fa\u7b2c\u4e00\u6b65\u3002\",\n        src: '..\/..\/image\/day01.jpg',\n        showModalStatus: false,\n        catalog: [\n          { section: \"1. xxx\" },\n          { section: \"2. xxx\" },\n          { section: \"3. xxx\" },\n          { section: \"4. xxx\" },\n        ]\n      },\n      {\n        id: 1,\n        name: \"\u5e26\u4e0a\u81ea\u5df1\u7684\u8d2d\u7269\u888b\",\n        introduce: \"\u5728\u6211\u4eec\u5bb6\uff0c\u5f53\u65f6\u5783\u573e\u6876\u91cc\u6700\u591a\u7684\u5c31\u662f\u5851\u6599\u888b\uff0c\u800c\u8fd9\u4e9b\u888b\u5b50\u8ddf\u7740\u6211\u56de\u5bb6\u540e\uff0c\u90fd\u51e0\u4e4e\u96be\u9003\u88ab\u4e22\u8fdb\u5783\u573e\u6876\u7684\u547d\u8fd0\u3002\",\n        src: '..\/..\/image\/day02.jpg',\n        showModalStatus: false,\n        catalog: [\n          { section: \"1. xxx\" },\n          { section: \"2. xxx\" },\n          { section: \"3. xxx\" },\n          { section: \"4. xxx\" },\n        ]\n      },\n      \/* \u7701\u7565 *\/\n    ]\n  }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u8981\u4f7f\u7528\u5217\u8868\u6e32\u67d3\uff08wx:for\uff09\u7684\u65b9\u6cd5\u5c06\u8fd9\u4e9b\u6570\u636e\u7ed1\u5b9a\u4e00\u4e2a\u6570\u7ec4\uff0c\u5e76\u5728\u9875\u9762\u4e0a\u91cd\u590d\u6e32\u67d3\u3002\u4fee\u6539 details.wxml \u6587\u4ef6\uff1a<\/p>\n<pre>      &lt;view&gt;\n        &lt;view wx:for=\"{{list}}\" wx:key=\"id\" &gt;\n          &lt;view class=\"lesson\" id=\"{{item.id}}\"&gt;\n            &lt;image class=\"lessonPic\" mode='aspectFit' src=\"{{item.src}}\"&gt;&lt;\/image&gt;\n            &lt;view class=\"lessonName\"&gt;{{item.name}}&lt;\/view&gt;\n            &lt;view class=\"lessonIntroduce\"&gt;{{item.introduce}}&lt;\/view&gt;\n          &lt;\/view&gt;\n        &lt;\/view&gt;\n      &lt;\/view&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u9ed8\u8ba4\u6570\u7ec4\u7684\u5f53\u524d\u9879\u7684\u4e0b\u6807\u53d8\u91cf\u540d\u9ed8\u8ba4\u4e3a index\uff0c\u6570\u7ec4\u5f53\u524d\u9879\u7684\u53d8\u91cf\u540d\u9ed8\u8ba4\u4e3a item\u3002<\/p>\n<p>\u4fee\u6539 details.wxss \u6587\u4ef6\u6dfb\u52a0\u6837\u5f0f\uff1a<\/p>\n<pre>    .lesson {\n      height: 190rpx;\n      padding-left: 20rpx;\n    }\n    \n    .lessonPic {\n      position: absolute;\n      height: 150rpx;\n      width: 150rpx;\n    }\n    \n    .lessonName {\n      position: absolute;\n      margin-left: 220rpx;\n      font-size: 35rpx;\n    }\n    \n    .lessonIntroduce {\n      position: absolute;\n      margin-left: 220rpx;\n      margin-top: 60rpx;\n      margin-right: 20rpx;\n      color: rgb(185, 161, 161);\n      font-size: 28rpx;\n    }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u597d\u5566\uff0c\u7b2c\u4e8c\u4e2a\u9875\u9762\u4e5f\u5b8c\u6210\u4e86\u3002<\/p>\n<p><strong>\u6a21\u62df\u5f39\u7a97<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/494\/399\/395\/1593399701905667.png\" class=\"aligncenter\" title=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe5\" alt=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe5\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u8981\u5728 \u201c\u751f\u6d3b\u6307\u5357\u201d \u9875\u9762\u6a21\u62df\u4e00\u4e2a\u5f39\u7a97\u7684\u6548\u679c\uff0c\u6b63\u5e38\u7684\u65f6\u5019\u4e0d\u663e\u793a\uff0c\u53ea\u6709\u5728\u70b9\u51fb\u7684\u65f6\u5019\u624d\u51fa\u73b0\uff0c\u6441\u4e0b\u9762\u7684 \u201c\u786e\u5b9a\u201d \u5c31\u4f1a\u6d88\u5931\u3002<\/p>\n<p>\u5b8c\u4e86\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd\uff0c\u6211\u4eec\u8981\u5728\u7ec4\u4ef6\u4e2d\u7ed1\u5b9a\u4e00\u4e2a\u4e8b\u4ef6\u5904\u7406\u51fd\u6570 bindtap\uff0c\u70b9\u51fb\u8be5\u7ec4\u4ef6\u7684\u65f6\u5019\uff0c\u5c0f\u7a0b\u5e8f\u4f1a\u5728\u8be5\u9875\u9762\u5bf9\u5e94\u7684 Page \u4e2d\u627e\u5230\u76f8\u5e94\u7684\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\u3002<\/p>\n<p>\u6211\u4eec\u5148\u5728 details.js \u4e2d\u4e3a\u6bcf\u4e00\u5217\u6570\u636e\u91cc\u5f15\u5165\u4e00\u4e2a boolean \u53d8\u91cf showModalStatus \u6765\u63cf\u8ff0\u5bf9\u5e94\u7684\u5f39\u7a97\u72b6\u6001\uff0c\u5e76\u4e14\u521d\u59cb\u503c\u4e3a false\uff0c\u8868\u793a\u4e0d\u663e\u793a\u3002\u540c\u65f6\u5916\u5c42\u4e5f\u589e\u52a0\u4e00\u4e2a\u521d\u59cb\u503c\u4e3a false \u7684 showModalStatus \u53d8\u91cf\u5b9e\u73b0\u906e\u7f69\u6548\u679c\u3002\u5982\u4e0b\uff1a<\/p>\n<pre>       data: {\n        showModalStatus: false,\n        list: [\n          {\n            id: 0,\n            name : \"\u5199\u4e00\u7bc7\u300a\u5783\u573e\u65e5\u8bb0\u300b\",\n            introduce: \"\u96f6\u5783\u573e\u5e76\u4e0d\u662f\u4e00\u9879\u5b8f\u5927\u7684\u5de5\u7a0b\uff0c\u800c\u662f\u7531\u65e5\u5e38\u751f\u6d3b\u4e2d\u4e00\u4e2a\u4e2a\u5c0f\u5c0f\u7684\u4e60\u60ef\u548c\u9009\u62e9\u7ec4\u6210\u7684\u3002\u6700\u96be\u7684\uff0c\u662f\u8fc8\u51fa\u7b2c\u4e00\u6b65\u3002\",\n            src: '..\/..\/image\/day01.jpg',\n            showModalStatus: false,\n            catalog: [\n              { section: \"1. xxx\" },\n              { section: \"2. xxx\" },\n              { section: \"3. xxx\" },\n              { section: \"4. xxx\" },\n            ]\n          }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7136\u540e\u5728 details.wxml \u4e2d\u63d2\u5165\u5f39\u7a97\uff0c\u5e76\u7528\u6761\u4ef6\u6e32\u67d3\uff08wx:if\uff09\u6765\u5224\u65ad\u662f\u5426\u6e32\u67d3\uff08\u663e\u793a\uff09\u5f39\u7a97\u3002\u540c\u65f6\u4e3a\u6bcf\u4e00\u4e2a item \u6dfb\u52a0 data-statu \u6765\u8868\u793a\u5f39\u7a97\u7684\u72b6\u6001\u3002\u5982\u4e0b\uff1a<\/p>\n<pre>  &lt;view&gt;\n    &lt;view wx:for=\"{{list}}\" wx:key=\"id\" &gt;\n      &lt;view class=\"lesson\" bindtap='powerDrawer' data-statu='open' id=\"{{item.id}}\"&gt;\n        &lt;image class=\"lessonPic\" mode='aspectFit' src=\"{{item.src}}\"&gt;&lt;\/image&gt;\n        &lt;view class=\"lessonName\"&gt;{{item.name}}&lt;\/view&gt;\n        &lt;view class=\"lessonIntroduce\"&gt;{{item.introduce}}&lt;\/view&gt;\n      &lt;\/view&gt;\n        \n      &lt;!-- \u5f39\u7a97 --&gt;\n      &lt;view class='drawer_box' wx:if='{{item.showModalStatus}}' id='{{item.id}}'&gt;\n        &lt;view class=\"title\"&gt;{{item.name}}&lt;\/view&gt;\n        &lt;view class='drawer_content'&gt;\n          &lt;view class='title' wx:for='{{item.catalog}}' wx:for-item='catalog' wx:key='id'&gt;\n            {{catalog.section}}          &lt;\/view&gt;\n        &lt;\/view&gt;\n        &lt;!-- \u786e\u5b9a\u6309\u94ae --&gt;\n        &lt;view class='btn_ok' bindtap='powerDrawer' data-statu='close' id='{{item.id}}'&gt;\u786e\u5b9a&lt;\/view&gt;\n      &lt;\/view&gt;\n    &lt;\/view&gt;\n      \n    &lt;!-- \u906e\u7f69\u5c42 --&gt;\n    &lt;view class='drawer_screen' data-statu='close' wx:if='{{showModalStatus}}'&gt;&lt;\/view&gt;\n  &lt;\/view&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728 details.js \u6dfb\u52a0 powerDrawer \u4e8b\u4ef6\u5904\u7406\uff0c\u5305\u62ec\u663e\u793a\u548c\u5173\u95ed\u4e8b\u4ef6\uff1a<\/p>\n<pre>      powerDrawer: function (e) {\n        console.log(\"clicked\");\n    \n        var currentStatu = e.currentTarget.dataset.statu;\n        var index = e.currentTarget.id;\n    \n        \/\/ \u5173\u95ed\n        if (currentStatu == 'close') {\n          this.data.list[index].showModalStatus = false;\n          this.setData({\n            showModalStatus: false,\n            list: this.data.list,\n          });\n        }\n    \n        \/\/ \u663e\u793a\n        if (currentStatu == 'open') {\n          this.data.list[index].showModalStatus = true;\n          this.setData({\n            showModalStatus: true,\n            list: this.data.list,\n          });\n        }\n      },<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6700\u540e\u5728 details.wxss &nbsp;\u8bbe\u7f6e\u4e00\u4e0b\u5f39\u7a97\u548c\u906e\u7f69\u5c42\u7684\u6837\u5f0f\uff1a<\/p>\n<pre>    .drawer_box {\n      width: 650rpx;\n      overflow: hidden;\n      position: fixed;\n      top: 50%;\n      z-index: 1001;\n      background: #FAFAFA;\n      margin: -150px 50rpx 0 50rpx;\n    }\n    \n    .drawer_content {\n      border-top: 1.5px solid #E8E8EA;\n      height: 210px;\n      overflow-y: scroll; \/* \u8d85\u51fa\u7236\u76d2\u5b50\u9ad8\u5ea6\u53ef\u6eda\u52a8 *\/\n    }\n    \n    .btn_ok {\n      padding: 10px;\n      font: 20px \"microsoft yahei\";\n      text-align: center;\n      border-top: 1.5px solid #E8E8EA;\n      color: #3CC51F;\n    }\n    \n    .drawer_screen {\n      width: 100%;\n      height: 100%;\n      position: fixed;\n      top: 0;\n      left: 0;\n      z-index: 1000;\n      background: black;\n      opacity: 0.5;\n      overflow: hidden;\n    }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>OK\uff0c\u6a21\u62df\u5f39\u7a97\u4e5f\u5b9e\u73b0\u4e86\u3002<\/p>\n<p><strong>\u9884\u89c8\u56fe\u7247<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/919\/163\/276\/1593399752209227.png\" class=\"aligncenter\" title=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe6\" alt=\"\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u63d2\u56fe6\" \/><\/p>\n<p>\u6700\u540e\u4e00\u6b65\u5c31\u662f\u5728\u7b2c\u4e00\u4e2a\u9875\u9762\u5b9e\u73b0\u56fe\u7247\u9884\u89c8\u548c\u56fe\u7247\u4fdd\u5b58\u7684\u529f\u80fd\uff0c\u5728 index.wxml \u4e2d\u4e3a\u56fe\u7247\u6dfb\u52a0\u4e00\u4e2a\u70b9\u51fb\u4e8b\u4ef6 previewImage\u3002<\/p>\n<pre>    &lt;image class='pic' mode='widthFix' src='..\/..\/image\/GoZeroWaste.jpg' bindtap='previewImage'&gt;&lt;\/image&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728 index.js \u4e2d\u6dfb\u52a0 imgalist \u9879\uff08\u6211\u4eec\u76f4\u63a5\u628a\u516c\u4f17\u53f7\u7684\u4e8c\u7ef4\u7801\u56fe\u7247\u4e0a\u4f20\u5230 CSDN \u7684\u56fe\u7247\u670d\u52a1\u5668\u4e86\uff09\uff0c\u5e76\u4e14\u5b9e\u73b0 previewImage \u4e8b\u4ef6\u5904\u7406\u3002\u5982\u4e0b\uff1a<\/p>\n<pre>    Page({\n      data: {\n        motto: 'Hello World',\n        company: \"GoZeroWaste\",\n        lesson: \"21\u5929\u96f6\u5783\u573e\u751f\u6d3b\u6307\u5357\",\n        position: \"\u5783\u573e\u9b54\u6cd5\u5e08\",\n        imgalist: ['https:\/\/img-blog.csdnimg.cn\/20190109104518898.jpg'],\n        userInfo: {},\n        hasUserInfo: false,\n        canIUse: wx.canIUse('button.open-type.getUserInfo')\n      },\n      previewImage: function (e) {\n        wx.previewImage({\n          current: this.data.imgalist,  \/\/ \u5f53\u524d\u663e\u793a\u56fe\u7247\u7684http\u94fe\u63a5\n          urls: this.data.imgalist      \/\/ \u9700\u8981\u9884\u89c8\u7684\u56fe\u7247http\u94fe\u63a5\u5217\u8868\n        })\n      },<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5927\u529f\u544a\u6210\uff0c\u70b9\u51fb\u5f00\u53d1\u8005\u5de5\u5177\u4e2d\u7684 \u201c\u9884\u89c8\u201d\uff0c\u4f7f\u7528\u5fae\u4fe1\u626b\u63cf\u751f\u6210\u7684\u4e8c\u7ef4\u7801\u5373\u53ef\u5728\u624b\u673a\u7aef\u67e5\u770b\u3002<\/p>\n<p>\u6559\u7a0b\u5c31\u5230\u8fd9\u91cc\uff0c\u5e0c\u671b\u5927\u5bb6\u53ef\u4ee5\u5bf9\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u6709\u6240\u4e86\u89e3\u3002<\/p>\n<p>\u672c\u6587\u8f6c\u81ea\uff1ahttps:\/\/luhuadong.blog.csdn.net\/article\/details\/86181251<\/p>\n<p>\u63a8\u8350\u6559\u7a0b\uff1a\u300a\u300b<\/p>\n<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u516b\u5206\u949f\u5e26\u4f60\u5165\u95e8\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\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>\u6ce8\u518c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f \u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u7684\u8d26\u53f7\uff0c\u8bf7\u5148\u8fdb\u5165\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u9996\u9875\uff0c\u70b9\u51fb \u201c\u7acb\u5373\u6ce8\u518c\u201d \u6309\u94ae\u8fdb\u884c\u6ce8\u518c\u3002\u6ce8\u518c\u7684\u8d26\u53f7\u7c7b\u578b\u53ef\u4ee5\u662f\u8ba2\u9605\u53f7\u3001\u670d\u52a1\u53f7\u3001\u5c0f\u7a0b\u5e8f\u4ee5\u53ca\u4f01\u4e1a\u5fae\u4fe1\uff0c\u6211\u4eec\u9009\u62e9 \u201c\u5c0f\u7a0b\u5e8f\u201d \u5373\u53ef\u3002 \u63a5\u7740\u586b\u5199\u8d26\u53f7\u4fe1\u606f\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u586b\u5199\u7684\u90ae\u7bb1\u5fc5\u987b\u662f\u672a\u88ab\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u6ce8\u518c\u3001\u672a\u88ab\u4e2a\u4eba\u5fae\u4fe1\u53f7\u7ed1\u5b9a\u7684\u90ae\u7bb1\uff0c\u800c\u4e14\u6bcf\u4e2a\u90ae\u7bb1\u4ec5\u80fd\u7533\u8bf7\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u3002 \u6fc0\u6d3b\u90ae\u7bb1\u4e4b\u540e\uff0c\u9009\u62e9\u4e3b\u4f53\u7c7b\u578b\u4e3a \u201c\u4e2a\u4eba\u7c7b\u578b\u201d\uff0c\u5e76\u6309\u8981\u6c42\u767b\u8bb0\u4e3b\u4f53\u4fe1\u606f\u3002\u4e3b\u4f53\u4fe1\u606f\u63d0\u4ea4\u540e\u4e0d\u53ef\u4fee\u6539\uff0c\u8be5\u4e3b\u4f53\u5c06\u6210\u4e3a\u4f60\u4f7f\u7528\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u5404\u9879\u670d\u52a1\u548c\u529f\u80fd\u7684\u552f\u4e00\u6cd5\u5f8b\u4e3b\u4f53\u4e0e\u7f14\u7ea6\u4e3b\u4f53\uff0c\u5728\u540e\u7eed\u5f00\u901a\u5176\u4ed6\u4e1a\u52a1\u529f\u80fd\u65f6\u4e0d\u5f97\u53d8\u66f4\u6216\u4fee\u6539\u3002 \u4e00\u5207 OK \u5c31\u53ef\u4ee5\u76f4\u63a5\u8fdb\u5165\u5c0f\u7a0b\u5e8f\u7684\u7ba1\u7406\u5e73\u53f0\u4e86\u3002\u5982\u679c\u76f4\u63a5\u8df3\u8f6c\u5931\u8d25\uff0c\u4e5f\u53ef\u4ee5\u4ece\u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u4e0a\u624b\u52a8\u767b\u5f55\u3002\u586b\u5199\u5c0f\u7a0b\u5e8f\u7684\u57fa\u672c\u4fe1\u606f\uff0c\u5305\u62ec\u540d\u79f0\u3001\u56fe\u6807\u3001\u63cf\u8ff0\u7b49\u3002\u63d0\u4ea4\u6210\u529f\u4e4b\u540e\uff0c\u518d\u6dfb\u52a0\u5f00\u53d1\u8005\u3002\u5f00\u53d1\u8005\u9ed8\u8ba4\u4e3a\u7ba1\u7406\u5458\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u4ece\u8fd9\u91cc\u65b0\u589e\u7ed1\u5b9a\u5f00\u53d1\u8005\uff0c\u8fd9\u662f\u7ba1\u7406\u5458\u624d\u6709\u6743\u9650\u7684\u64cd\u4f5c\u3002 \u7136\u540e\u5728\u5de6\u4fa7\u5bfc\u822a\u680f\u70b9\u51fb \u201c\u8bbe\u7f6e\u201d\uff0c\u627e\u5230\u5f00\u53d1\u8bbe\u7f6e\uff0c\u83b7\u5f97\u5c0f\u7a0b\u5e8f\u7684 AppID\u3002 \u5fae\u4fe1\u5f00\u53d1\u8005\u5de5\u5177 \u4e0b\u8f7d\u5fae\u4fe1web\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u6839\u636e\u81ea\u5df1\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0b\u8f7d\u5bf9\u5e94\u7684\u5b89\u88c5\u5305\u8fdb\u884c\u5b89\u88c5\u5373\u53ef\u3002 \u6253\u5f00\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u7528\u5fae\u4fe1\u626b\u7801\u767b\u5f55\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u51c6\u5907\u5f00\u53d1\u4f60\u7684\u7b2c\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u5427\uff01 \u7b2c\u4e00\u4e2a\u5c0f\u7a0b\u5e8f \u65b0\u5efa\u9879\u76ee \u6253\u5f00\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u9009\u62e9 \u201c\u5c0f\u7a0b\u5e8f\u9879\u76ee\u201d\uff0c\u70b9\u51fb\u53f3\u4e0b\u89d2\u7684 \u201c+\u201d \u65b0\u5efa\u9879\u76ee\u3002 \u9009\u62e9\u4e00\u4e2a\u7a7a\u7684\u6587\u4ef6\u5939\u4f5c\u4e3a\u9879\u76ee\u76ee\u5f55\uff0c\u586b\u5165\u521a\u521a\u7684 AppID\uff0c\u518d\u586b\u5199\u4e00\u4e2a\u9879\u76ee\u540d\u79f0\uff0c\u6bd4\u5982\u6211\u8fd9\u91cc\u53eb\u505a GoZeroWaster\u3002\u70b9\u51fb \u201c\u786e\u5b9a\u201d \u8fdb\u5165\u5de5\u5177\u4e3b\u754c\u9762\u3002 \u9879\u76ee\u76ee\u5f55\u7ed3\u6784 \u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u57fa\u672c\u6587\u4ef6\u6784\u9020\u548c\u9879\u76ee\u76ee\u5f55\u7ed3\u6784\u8bf4\u660e\u5982\u4e0b\uff1a &nbsp;&nbsp;&nbsp;&nbsp;. &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;app.js&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u5c0f\u7a0b\u5e8f\u7684\u903b\u8f91\u6587\u4ef6 &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;app.json&nbsp;&nbsp;&nbsp;#&nbsp;\u5c0f\u7a0b\u5e8f\u7684\u914d\u7f6e\u6587\u4ef6 &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;app.wxss&nbsp;&nbsp;&nbsp;#&nbsp;\u5168\u5c40\u516c\u5171\u6837\u5f0f\u6587\u4ef6 &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;pages&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u5b58\u653e\u5c0f\u7a0b\u5e8f\u7684\u5404\u4e2a\u9875\u9762 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;index&nbsp;&nbsp;#&nbsp;index\u9875\u9762 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;index.js&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u903b\u8f91 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;index.wxml&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u7ed3\u6784 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;index.wxss&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u6837\u5f0f\u8868 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;logs&nbsp;&nbsp;&nbsp;#&nbsp;logs\u9875\u9762 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;logs.js&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u903b\u8f91 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;logs.json&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u914d\u7f6e &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;logs.wxml&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u7ed3\u6784 &nbsp;&nbsp;&nbsp;&nbsp;\u2502&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;logs.wxss&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;\u9875\u9762\u6837\u5f0f\u8868 &nbsp;&nbsp;&nbsp;&nbsp;\u251c\u2500\u2500&nbsp;project.config.json &nbsp;&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;utils &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u2514\u2500\u2500&nbsp;util.js \u6839\u76ee\u5f55\u4e0b\u67093\u4e2a\u6587\u4ef6\uff1aapp.js\u3001app.json\u3001app.wxss\uff0c\u5c0f\u7a0b\u5e8f\u5fc5\u987b\u6709\u8fd93\u4e2a\u63cf\u8ff0 APP \u7684\u6587\u4ef6\uff0c\u5e76\u653e\u5728\u6839\u76ee\u5f55\u4e0b\u3002\u8fd93\u4e2a\u662f\u5e94\u7528\u7a0b\u5e8f\u7ea7\u522b\u7684\u6587\u4ef6\uff0c\u4e0e\u4e4b\u5e73\u884c\u7684\u8fd8\u6709\u4e00\u4e2a pages \u6587\u4ef6\u5939\uff0c\u7528\u6765\u5b58\u653e\u5c0f\u7a0b\u5e8f\u7684\u5404\u4e2a\u9875\u9762\u3002 \u6211\u4eec\u53ef\u4ee5\u548c web [&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-33428","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33428","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=33428"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33428\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=33428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=33428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=33428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}