{"id":37603,"date":"2025-07-16T11:53:17","date_gmt":"2025-07-16T03:53:17","guid":{"rendered":"https:\/\/app.60day.cn\/appday\/?p=37603"},"modified":"2025-07-16T11:53:17","modified_gmt":"2025-07-16T03:53:17","slug":"%e7%99%be%e5%ba%a6%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91%e5%b8%b8%e7%94%a8%e6%96%b9%e6%b3%95%e6%9c%89%e5%93%aa%e4%ba%9b%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/app.60day.cn\/appday\/xcxkf\/37603\/","title":{"rendered":"\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5e38\u7528\u65b9\u6cd5\u6709\u54ea\u4e9b\uff1f"},"content":{"rendered":"<p>\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u662f\u4e00\u79cd\u57fa\u4e8e\u767e\u5ea6\u751f\u6001\u7cfb\u7edf\u7684\u8f7b\u91cf\u7ea7\u5e94\u7528\u5f00\u53d1\u5e73\u53f0\uff0c\u53ef\u4ee5\u5728\u767e\u5ea6\u641c\u7d22\u3001\u767e\u5ea6 App \u548c\u5176\u4ed6\u767e\u5ea6\u751f\u6001\u7cfb\u7edf\u4e2d\u4f7f\u7528\u3002\u5b83\u4f7f\u7528\u7c7b\u4f3c\u4e8e Web \u5f00\u53d1\u7684\u6280\u672f\u6808\uff08HTML\u3001CSS\u3001JavaScript\uff09\uff0c\u4f46\u662f\u6709\u4e00\u4e9b\u7279\u5b9a\u7684 API \u548c\u529f\u80fd\u3002\u5728\u672c\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5c06\u4ecb\u7ecd\u4e00\u4e9b<a href=\"https:\/\/sapp.yimenapp.com\/mp-xcx-541.html\">\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5b8c\u6574\u6559\u7a0b<\/a>\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u5e38\u7528\u7684\u65b9\u6cd5\u548c\u539f\u7406\u3002<\/p>\n<p>1. \u9875\u9762\u7ed3\u6784\uff1a\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u7684\u9875\u9762\u91c7\u7528\u7c7b\u4f3c\u4e8e\u4f20\u7edf\u7f51\u9875\u7684\u7ed3\u6784\uff0c\u7531`.wxml`\u3001<a href=\"https:\/\/sapp.yimenapp.com\/mp-xcx-392.html\">\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4f30\u4ef7<\/a>`.wxss`\u3001`.js` \u548c`.json`\u56db\u4e2a\u6587\u4ef6\u7ec4\u6210\u3002\u5176\u4e2d\uff0c`.wxml` \u6587\u4ef6\u5b9a\u4e49\u9875\u9762\u7684\u7ed3\u6784\uff0c`.wxss` \u6587\u4ef6\u5b9a\u4e49\u9875\u9762\u7684\u6837\u5f0f\uff0c`.js` \u6587\u4ef6\u8d1f\u8d23\u9875\u9762\u7684\u903b\u8f91\uff0c\u800c`.json` \u6587\u4ef6\u7528\u4e8e\u914d\u7f6e\u9875\u9762\u7684\u4e00\u4e9b\u53c2\u6570\uff0c\u5982\u6807\u9898\u3001\u80cc\u666f\u8272\u7b49\u3002<\/p>\n<p>2. \u6570\u636e\u7ed1\u5b9a\uff1a\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u4f7f\u7528\u6570\u636e\u7ed1\u5b9a\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u89c6\u56fe\u4e0e\u6570\u636e\u7684\u52a8\u6001\u66f4\u65b0\u3002\u5728`.wxml` \u6587\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u53cc\u82b1\u62ec\u53f7`{{}}`\u5c06\u6570\u636e\u7ed1\u5b9a\u5230\u89c6\u56fe\u4e2d\u3002\u4f8b\u5982\uff0c`{{message}}`\u4f1a\u5c06\u540d\u4e3a`message`\u7684\u6570\u636e\u52a8\u6001\u7ed1\u5b9a\u5230&#8220;\u6807\u7b7e\u4e2d\u3002<\/p>\n<p><p>3. \u4e8b\u4ef6\u7ed1\u5b9a\uff1a\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u652f\u6301\u5e38\u89c1\u7684\u4e8b\u4ef6\u7ed1\u5b9a\u65b9\u5f0f\uff0c\u5982\u70b9\u51fb\u4e8b\u4ef6\u3001\u6eda\u52a8\u4e8b\u4ef6\u7b49\u3002\u53ef\u4ee5\u5728`.wxml` \u6587\u4ef6\u4e2d\u4f7f\u7528`bind`\u6216`catch`\u524d\u7f00\u6765\u7ed1\u5b9a\u76f8\u5e94\u7684\u4e8b\u4ef6\u3002\u4f8b\u5982\uff0c`<button>\u70b9\u51fb\u6211<\/button>`\u4f1a\u5728\u6309\u94ae\u88ab\u70b9\u51fb\u65f6\u89e6\u53d1\u540d\u4e3a`handleTap`\u7684\u51fd\u6570\u3002<\/p>\n<p>4. \u5f02\u6b65\u8bf7\u6c42\uff1a\u5728\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684`wx.request`\u65b9\u6cd5\u6765\u53d1\u8d77\u5f02\u6b65\u8bf7\u6c42\uff0c\u83b7\u53d6\u6570\u636e\u6216\u4e0e\u540e\u7aef\u8fdb\u884c\u4ea4\u4e92\u3002\u8be5\u65b9\u6cd5\u901a\u5e38\u5728`.js` \u6587\u4ef6\u4e2d\u8c03\u7528\uff0c\u53ef\u4ee5\u6307\u5b9a\u8bf7\u6c42\u7684 URL\u3001\u8bf7\u6c42\u65b9\u5f0f\u3001\u8bf7\u6c42\u53c2\u6570\u7b49\u3002\u6210\u529f\u83b7\u53d6\u5230\u6570\u636e\u540e\uff0c\u53ef\u5728\u56de\u8c03\u51fd\u6570\u4e2d\u5904\u7406\u8fd4\u56de\u7684\u7ed3\u679c\u3002<\/p>\n<p>5. \u6570\u636e\u5b58\u50a8\uff1a\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u672c\u5730\u6570\u636e\u5b58\u50a8\u7684\u529f\u80fd\uff0c\u7528\u4e8e\u5728\u5c0f\u7a0b\u5e8f\u4e2d\u4fdd\u5b58\u548c\u8bfb\u53d6\u4e00\u4e9b\u4e34\u65f6\u6570\u636e\u3002\u4f7f\u7528`wx.setStorageSync`\u65b9\u6cd5\u53ef\u4ee5\u5c06\u6570\u636e\u4fdd\u5b58\u5230\u672c\u5730\u7f13\u5b58\u4e2d\uff0c\u4f7f\u7528`wx.getStorageSync`\u65b9\u6cd5\u53ef\u4ee5\u4ece\u672c\u5730\u7f13\u5b58\u4e2d\u8bfb\u53d6\u6570\u636e\u3002<\/p>\n<p>6. \u8def\u7531\u8df3\u8f6c\uff1a\u901a\u8fc7\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u63d0\u4f9b\u7684`navigateTo`\u3001`redirectTo`\u3001`switchTab`\u7b49\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u4e0d\u540c\u9875\u9762\u4e4b\u95f4\u8fdb\u884c\u8def\u7531\u8df3\u8f6c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528`wx.navigateTo`\u65b9\u6cd5\u5728\u5f53\u524d\u9875\u9762\u6253\u5f00\u53e6\u4e00\u4e2a\u9875\u9762\uff0c\u4f7f\u7528`wx.redirectTo`\u65b9\u6cd5\u5173\u95ed\u5f53\u524d\u9875\u9762\u6253\u5f00\u53e6\u4e00\u4e2a\u9875\u9762\uff0c\u4f7f\u7528`wx.switchTab`\u65b9\u6cd5\u5207\u6362\u5230\u6307\u5b9a\u7684 Tab \u9875\u9762\u3002<\/p>\n<p>7. \u7ec4\u4ef6\u5316\u5f00\u53d1\uff1a\u767e\u5ea6<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdn.myapp.ltd\/ag\/135\/sucai\/60.jpg\" \/><\/figure>\n<\/p>\n<p>\u5c0f\u7a0b\u5e8f\u652f\u6301\u81ea\u5b9a\u4e49\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u5c06\u4e00\u4e9b\u53ef\u590d\u7528\u7684\u4ee3\u7801\u5c01\u88c5\u4e3a\u7ec4\u4ef6\uff0c\u5728\u4e0d\u540c\u7684\u9875\u9762\u4e2d\u590d\u7528\u3002\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u7531`.wxml`\u3001`.wxss`\u3001`.js` \u548c`.json`\u56db\u4e2a\u6587\u4ef6\u7ec4\u6210\uff0c\u4f7f\u7528\u65f6\u53ea\u9700\u5728\u9875\u9762\u7684`.json`\u6587\u4ef6\u4e2d\u5f15\u5165\u5373\u53ef\u3002<\/p>\n<p>8. API \u8c03\u7528\uff1a\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684 API \u4f9b\u5f00\u53d1\u8005\u4f7f\u7528\uff0c\u5305\u62ec\u7f51\u7edc\u3001\u6587\u4ef6\u3001\u5730\u56fe\u3001\u8bbe\u5907\u7b49\u591a\u4e2a\u65b9\u9762\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u67e5\u9605\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u5b98\u65b9\u6587\u6863\uff0c\u4e86\u89e3\u6bcf\u4e2a API \u7684\u4f7f\u7528\u65b9\u6cd5\u548c\u53c2\u6570\u8bf4\u660e\u3002<\/p>\n<p>\u603b\u7ed3\uff1a\u672c\u6587\u4ecb\u7ecd\u4e86\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u5e38\u7528\u7684\u4e00\u4e9b\u65b9\u6cd5\u548c\u539f\u7406\uff0c\u6d89\u53ca\u9875\u9762\u7ed3\u6784\u3001\u6570\u636e\u7ed1\u5b9a\u3001\u4e8b\u4ef6\u7ed1\u5b9a\u3001\u5f02\u6b65\u8bf7\u6c42\u3001\u6570\u636e\u5b58\u50a8\u3001\u8def\u7531\u8df3\u8f6c\u3001\u7ec4\u4ef6\u5316\u5f00\u53d1\u4ee5\u53ca API \u8c03\u7528\u7b49\u65b9\u9762\u3002\u5e0c\u671b\u5bf9\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u521d\u5b66\u8005\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>        \u4e00\u95e8\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5de5\u5177\uff08https:\/\/sapp.yimenapp.com\/\uff09\u662f\u4e00\u6b3e\u4e91\u7aef\u5316\u8de8\u5e73\u53f0\u5f00\u53d1\u5de5\u5177\uff0c\u53ef\u4ee5\u4e00\u952e\u5728\u7ebf\u5c06\u7f51\u7ad9\u6253\u5305\u6210\u5c0f\u7a0b\u5e8f\uff0c\u652f\u6301\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u3001\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u3001\u6296\u97f3\u5c0f\u7a0b\u5e8f\u3001\u5feb\u624b\u5c0f\u7a0b\u5e8f\u3001\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u7b49\u56fd\u5185\u4e3b\u6d41\u5c0f\u7a0b\u5e8f\u5e73\u53f0\u3002\u4e00\u95e8\u63d0\u4f9b100+\u5c0f\u7a0b\u5e8f\u539f\u751f\u63a5\u53e3\u81ea\u52a9\u8c03\u7528\uff0c\u5f00\u53d1\u8005\u53ea\u9700\u8981\u4f7f\u7528\u5f00\u53d1\u7f51\u7ad9\u7684\u80fd\u529b\u5373\u53ef\u5728\u7ebf\u5feb\u901f\u5236\u4f5c\u5c0f\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u662f\u4e00\u79cd\u57fa\u4e8e\u767e\u5ea6\u751f\u6001\u7cfb\u7edf\u7684\u8f7b\u91cf\u7ea7\u5e94\u7528\u5f00\u53d1\u5e73\u53f0\uff0c\u53ef\u4ee5\u5728\u767e\u5ea6\u641c\u7d22\u3001\u767e\u5ea6 App \u548c\u5176\u4ed6\u767e\u5ea6\u751f\u6001\u7cfb\u7edf\u4e2d\u4f7f\u7528\u3002\u5b83\u4f7f\u7528\u7c7b\u4f3c\u4e8e Web \u5f00\u53d1\u7684\u6280\u672f\u6808\uff08HTML\u3001CSS\u3001JavaScript\uff09\uff0c\u4f46\u662f\u6709\u4e00\u4e9b<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[132,34157,28956,4150,553],"topic":[],"class_list":["post-37603","post","type-post","status-publish","format-standard","hentry","category-xcxkf","tag-132","tag-34157","tag-28956","tag-4150","tag-553"],"_links":{"self":[{"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/posts\/37603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/comments?post=37603"}],"version-history":[{"count":1,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/posts\/37603\/revisions"}],"predecessor-version":[{"id":37614,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/posts\/37603\/revisions\/37614"}],"wp:attachment":[{"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/media?parent=37603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/categories?post=37603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/tags?post=37603"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/topic?post=37603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}