{"id":30324,"date":"2024-11-25T14:13:15","date_gmt":"2024-11-25T06:13:15","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30324\/"},"modified":"2024-11-25T14:13:15","modified_gmt":"2024-11-25T06:13:15","slug":"%e5%be%ae%e4%bf%a1%e5%bc%80%e5%8f%91%e4%b9%8b%e7%94%9f%e5%91%bd%e5%91%a8%e6%9c%9f%e5%87%bd%e6%95%b0%e7%9a%84%e5%ae%9e%e4%be%8b%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30324\/","title":{"rendered":"\u5fae\u4fe1\u5f00\u53d1\u4e4b\u751f\u547d\u5468\u671f\u51fd\u6570\u7684\u5b9e\u4f8b\u6559\u7a0b"},"content":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u4e86\u5fae\u4fe1\u5c0f\u7a0b\u5e8f \u751f\u547d\u5468\u671f\u51fd\u6570\u7684\u76f8\u5173\u8d44\u6599,\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e0b<\/p>\n<p><strong>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f \u751f\u547d\u5468\u671f\u51fd\u6570<\/strong><\/p>\n<p>\u5c0f\u7a0b\u5e8f\u4e2d \u5224\u65ad\u5f53\u524d\u9996\u9875\u662f\u4ece\u5176\u4ed6\u9875\u9762\u8fd4\u56de\uff0c\u8fd8\u662f\u7531\u5165\u53e3\u6253\u5f00<\/p>\n<p>\u7531\u4e8e\u5c0f\u7a0b\u5e8f\u7684\u6570\u636e\u5728\u6211\u4eec\u9000\u51fa\u5c0f\u7a0b\u5e8f\u65f6\u5e76\u6ca1\u6709\u5f97\u5230\u91ca\u653e\uff0c\u56e0\u6b64\u518d\u6b21\u70b9\u51fb\u5f00\u6765\u6570\u636e\u4f9d\u7136\u6ca1\u6709\u53d8\u6210\u521d\u59cb\u5316 <br \/>\u89e3\u51b3\u65b9\u6cd5\uff1a\u5728\u5c0f\u7a0b\u5e8f data \u6570\u636e\u4e2d\u58f0\u660e\u4e00\u4e2a\u53d8\u91cf isClose \u9ed8\u8ba4\u4e3a true \u7528\u4e8e\u5224\u65ad \u662f\u5426\u4e3a\u4ece\u5165\u53e3\u6253\u5f00\uff0c\u5f53\u70b9\u51fb\u8df3\u8f6c\u9875\u9762\u6216\u8005\u5173\u95ed\u5c0f\u7a0b\u5e8f\u7684\u65f6\u5019\uff0c\u4f1a\u89e6\u53d1 OnHide \u51fd\u6570\u5728\u6b64\u51fd\u6570\u4e2d\u5c06\u5224\u65ad isClose is true \u7684\u65f6\u5019\u5373\u4e3a\u5173\u95ed\u4e4b\u540e\u5728\u6253\u5f00\uff0c\u5f53\u8df3\u8f6c\u9875\u9762\u65f6\u9996\u5148\u5c06 isClose \u8bbe\u7f6e\u4e3a false, \u8fd9\u6837 \u89e6\u53d1 OnHide \u51fd\u6570\u7684\u65f6\u5019\uff0cisClose is flase \u5e76\u4e0d\u4f1a\u6267\u884c\uff0c\u8fdb\u5165\u8df3\u8f6c\u7684\u9875\u9762\uff0c\u7136\u540e\u5728\u7531\u9875\u9762\u8fdb\u884c\u8fd4\u56de\u8fd9\u662f\u4f1a\u89e6\u53d1\u8df3\u8f6c\u7684\u9875\u9762\u7684  \u51fd\u6570 \u5728\u6b64\u51fd\u6570\u4e2d \u8bbe\u7f6e\u4e00\u4e2a\u5b9a\u65f6\u5668 \u5728 200ms \u4e4b\u540e\u5c06 isClose \u6539\u4e3a true \u8fd9\u6837\u5f53\u5173\u95ed\u5c0f\u7a0b\u5e8f \u518d\u6b21\u8fdb\u5165\u7684\u65f6\u5019 isColse \u4f9d\u7136\u4e3atrue \u5224\u65ad\u65f6\u662f\u9996\u6b21\u8fdb\u5165\u9875\u9762 <\/p>\n<p><strong>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u51fd\u6570<\/strong><\/p>\n<p><strong>1.1 \u76d1\u542c\u9875\u9762\u52a0\u8f7d<\/strong><\/p>\n<p><span style=\"color: #0000ff\">: function (options) {}, <br \/><\/span><\/p>\n<p>\u4e00\u4e2a\u9875\u9762\u53ea\u4f1a\u8c03\u7528\u4e00\u6b21\uff0c\u53ef\u4ee5\u5728 onLoad \u4e2d\u83b7\u53d6\u6253\u5f00\u5f53\u524d\u9875\u9762\u6240\u8c03\u7528\u7684 query \u53c2\u6570\u3002 <\/p>\n<p><strong>1.2 \u76d1\u542c\u9875\u9762\u521d\u6b21\u6e32\u67d3\u5b8c\u6210<\/strong><\/p>\n<p><span style=\"color: #0000ff\">onReady: function () {}, <\/span><\/p>\n<p>\u4e00\u4e2a\u9875\u9762\u53ea\u4f1a\u8c03\u7528\u4e00\u6b21\uff0c\u4ee3\u8868\u9875\u9762\u5df2\u7ecf\u51c6\u5907\u59a5\u5f53\uff0c\u53ef\u4ee5\u548c\u89c6\u56fe\u5c42\u8fdb\u884c\u4ea4\u4e92\u3002 <\/p>\n<p><strong>1.3 \u76d1\u542c\u9875\u9762\u663e\u793a <\/strong><\/p>\n<p><span style=\"color: #0000ff\">onShow: function () {}, <br \/><\/span><\/p>\n<p>\u6bcf\u6b21\u6253\u5f00\u9875\u9762\u90fd\u4f1a\u8c03\u7528\u4e00\u6b21\u3002 <\/p>\n<p><strong>1.3 \u76d1\u542c\u9875\u9762\u9690\u85cf<\/strong><\/p>\n<p><span style=\"color: #0000ff\">onHide: function () {}, <\/span><\/p>\n<p>\u5f53navigateTo\u6216\u5e95\u90e8tab\u5207\u6362\u65f6\u8c03\u7528\u3002 <\/p>\n<p><strong>1.4 \u76d1\u542c\u9875\u9762\u5378\u8f7d<\/strong><\/p>\n<p><span style=\"color: #0000ff\">onUnload: function () {}, <\/span><\/p>\n<p>\u5f53reectTo\u6216navigateBack\u7684\u65f6\u5019\u8c03\u7528\u3002 <\/p>\n<p>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684 app. \u4e2d \u72ec\u6709\u7684 \u51fd\u6570<\/p>\n<p><strong>2.1 \u76d1\u542c\u5c0f\u7a0b\u5e8f\u521d\u59cb\u5316<\/strong><\/p>\n<p><span style=\"color: #0000ff\">onLaunch:function () {}, <\/span><\/p>\n<p>\u5f53\u5c0f\u7a0b\u5e8f\u521d\u59cb\u5316\u5b8c\u6210\u65f6\uff0c\u4f1a\u89e6\u53d1 onLaunch\uff08\u5168\u5c40\u53ea\u89e6\u53d1\u4e00\u6b21\uff09 <\/p>\n<p><strong>2.2 \u9519\u8bef\u76d1\u542c\u51fd\u6570<\/strong><\/p>\n<p><span style=\"color: #0000ff\">onError:function () {}, <\/span><\/p>\n<p>\u5f53\u5c0f\u7a0b\u5e8f\u53d1\u751f\u811a\u672c\u9519\u8bef\uff0c\u6216\u8005 api \u8c03\u7528\u5931\u8d25\u65f6\uff0c\u4f1a\u89e6\u53d1 onError \u5e76\u5e26\u4e0a\u9519\u8bef\u4fe1\u606f<\/p>\n<p>\u3010\u76f8\u5173\u63a8\u8350\u3011<\/p>\n<p>1. <\/p>\n<p>2.&nbsp;<\/p>\n<p>3.&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5f00\u53d1\u4e4b\u751f\u547d\u5468\u671f\u51fd\u6570\u7684\u5b9e\u4f8b\u6559\u7a0b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u4e86\u5fae\u4fe1\u5c0f\u7a0b\u5e8f \u751f\u547d\u5468\u671f\u51fd\u6570\u7684\u76f8\u5173\u8d44\u6599,\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e0b \u5fae\u4fe1\u5c0f\u7a0b\u5e8f \u751f\u547d\u5468\u671f\u51fd\u6570 \u5c0f\u7a0b\u5e8f\u4e2d \u5224\u65ad\u5f53\u524d\u9996\u9875\u662f\u4ece\u5176\u4ed6\u9875\u9762\u8fd4\u56de\uff0c\u8fd8\u662f\u7531\u5165\u53e3\u6253\u5f00 \u7531\u4e8e\u5c0f\u7a0b\u5e8f\u7684\u6570\u636e\u5728\u6211\u4eec\u9000\u51fa\u5c0f\u7a0b\u5e8f\u65f6\u5e76\u6ca1\u6709\u5f97\u5230\u91ca\u653e\uff0c\u56e0\u6b64\u518d\u6b21\u70b9\u51fb\u5f00\u6765\u6570\u636e\u4f9d\u7136\u6ca1\u6709\u53d8\u6210\u521d\u59cb\u5316 \u89e3\u51b3\u65b9\u6cd5\uff1a\u5728\u5c0f\u7a0b\u5e8f data \u6570\u636e\u4e2d\u58f0\u660e\u4e00\u4e2a\u53d8\u91cf isClose \u9ed8\u8ba4\u4e3a true \u7528\u4e8e\u5224\u65ad \u662f\u5426\u4e3a\u4ece\u5165\u53e3\u6253\u5f00\uff0c\u5f53\u70b9\u51fb\u8df3\u8f6c\u9875\u9762\u6216\u8005\u5173\u95ed\u5c0f\u7a0b\u5e8f\u7684\u65f6\u5019\uff0c\u4f1a\u89e6\u53d1 OnHide \u51fd\u6570\u5728\u6b64\u51fd\u6570\u4e2d\u5c06\u5224\u65ad isClose is true \u7684\u65f6\u5019\u5373\u4e3a\u5173\u95ed\u4e4b\u540e\u5728\u6253\u5f00\uff0c\u5f53\u8df3\u8f6c\u9875\u9762\u65f6\u9996\u5148\u5c06 isClose \u8bbe\u7f6e\u4e3a false, \u8fd9\u6837 \u89e6\u53d1 OnHide \u51fd\u6570\u7684\u65f6\u5019\uff0cisClose is flase \u5e76\u4e0d\u4f1a\u6267\u884c\uff0c\u8fdb\u5165\u8df3\u8f6c\u7684\u9875\u9762\uff0c\u7136\u540e\u5728\u7531\u9875\u9762\u8fdb\u884c\u8fd4\u56de\u8fd9\u662f\u4f1a\u89e6\u53d1\u8df3\u8f6c\u7684\u9875\u9762\u7684 \u51fd\u6570 \u5728\u6b64\u51fd\u6570\u4e2d \u8bbe\u7f6e\u4e00\u4e2a\u5b9a\u65f6\u5668 \u5728 200ms \u4e4b\u540e\u5c06 isClose \u6539\u4e3a true \u8fd9\u6837\u5f53\u5173\u95ed\u5c0f\u7a0b\u5e8f \u518d\u6b21\u8fdb\u5165\u7684\u65f6\u5019 isColse \u4f9d\u7136\u4e3atrue \u5224\u65ad\u65f6\u662f\u9996\u6b21\u8fdb\u5165\u9875\u9762 \u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u51fd\u6570 1.1 \u76d1\u542c\u9875\u9762\u52a0\u8f7d : function (options) {}, \u4e00\u4e2a\u9875\u9762\u53ea\u4f1a\u8c03\u7528\u4e00\u6b21\uff0c\u53ef\u4ee5\u5728 onLoad \u4e2d\u83b7\u53d6\u6253\u5f00\u5f53\u524d\u9875\u9762\u6240\u8c03\u7528\u7684 [&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-30324","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30324","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=30324"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30324\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}