{"id":72894,"date":"2026-02-06T18:17:45","date_gmt":"2026-02-06T10:17:45","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/72894.html"},"modified":"2026-02-06T18:17:45","modified_gmt":"2026-02-06T10:17:45","slug":"%e3%80%90flutter-for-openharmony%e3%80%91%e5%bc%80%e6%ba%90%e9%b8%bf%e8%92%99%e8%b7%a8%e5%b9%b3%e5%8f%b0%e8%ae%ad%e7%bb%83%e8%90%a5day4-day6%ef%bc%9a%e8%ae%a9%e5%88%97%e8%a1%a8%e6%b4%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/72894.html","title":{"rendered":"\u3010Flutter for OpenHarmony\u3011\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u8bad\u7ec3\u8425DAY4-DAY6\uff1a\u8ba9\u5217\u8868\u201c\u6d3b\u201d\u8d77\u6765\u2014\u2014\u4e0a\u62c9\u52a0\u8f7d\u3001\u4e0b\u62c9\u5237\u65b0\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406\u5b9e\u6218"},"content":{"rendered":"<p>\u6b22\u8fce\u52a0\u5165\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u793e\u533a&#xff1a;https:\/\/openharmonycrossplatform.csdn.net<\/p>\n<\/p>\n<p>\u5404\u4f4d&#xff0c;\u6211\u662fMoranbika&#xff01;\u7ecf\u8fc7DAY3\u7684\u6218\u6597&#xff0c;\u6211\u4eec\u7684\u5e94\u7528\u5df2\u7ecf\u80fd\u5c55\u793a\u52a8\u6001\u5217\u8868\u4e86\u3002\u4f46\u4e00\u4e2a\u53ea\u4f1a\u663e\u793a\u7b2c\u4e00\u5c4f\u6570\u636e\u7684\u5217\u8868&#xff0c;\u5c31\u50cf\u4e00\u672c\u53ea\u80fd\u770b\u524d\u51e0\u9875\u7684\u4e66&#xff0c;\u4f53\u9a8c\u662f\u6b8b\u7f3a\u7684\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u8981\u7528\u4e09\u5929\u65f6\u95f4&#xff0c;\u4e3a\u5b83\u8d4b\u4e88\u00a0\u201c\u4e0b\u62c9\u5237\u65b0\u201d\u548c\u201c\u4e0a\u62c9\u52a0\u8f7d\u66f4\u591a\u201d\u00a0\u8fd9\u4e24\u9879\u7075\u9b42\u4ea4\u4e92&#xff0c;\u5e76\u6253\u9020\u4e00\u4e2a\u667a\u80fd\u7684\u00a0\u6570\u636e\u72b6\u6001\u63d0\u793a\u7cfb\u7edf&#xff08;\u52a0\u8f7d\u4e2d\u3001\u7a7a\u6570\u636e\u3001\u9519\u8bef\u3001\u65e0\u66f4\u591a\u6570\u636e&#xff09;\u3002\u8fd9\u4e0d\u4ec5\u662f\u529f\u80fd\u7684\u5806\u780c&#xff0c;\u66f4\u662f\u5bf9\u6027\u80fd\u3001\u4f53\u9a8c\u548c\u9c81\u68d2\u6027\u7684\u4e00\u6b21\u5168\u9762\u5347\u7ea7\u3002<\/p>\n<h4>\u7b2c\u4e00\u90e8\u5206&#xff1a;\u8bbe\u8ba1\u5148\u884c\u2014\u2014\u7406\u89e3\u4ea4\u4e92\u4e0e\u9009\u62e9\u65b9\u6848<\/h4>\n<p>\u5728\u52a8\u624b\u5199\u4ee3\u7801\u4e4b\u524d&#xff0c;\u6211\u4eec\u5148\u7406\u6e05\u601d\u8def\u3002\u5b9e\u73b0\u4e0b\u62c9\u5237\u65b0\u548c\u4e0a\u62c9\u52a0\u8f7d&#xff0c;\u901a\u5e38\u6709\u4e24\u6761\u8def&#xff1a;<\/p>\n<p>\u65b9\u6848\u4e00&#xff1a;\u4f7f\u7528\u5f00\u6e90\u9e3f\u8499\u539f\u751f\u7ec4\u4ef6\u4e0e\u81ea\u5b9a\u4e49\u624b\u52bf&#xff08;\u672c\u7bc7\u6838\u5fc3&#xff09;<\/p>\n<ul>\n<li>\n<p>\u4f18\u70b9&#xff1a;\u96f6\u4f9d\u8d56&#xff0c;\u6027\u80fd\u6700\u4f73&#xff0c;\u5bf9\u7cfb\u7edf\u7279\u6027\u652f\u6301\u6700\u597d&#xff0c;\u5305\u4f53\u79ef\u5c0f\u3002<\/p>\n<\/li>\n<li>\n<p>\u6311\u6218&#xff1a;\u9700\u8981\u81ea\u5df1\u5904\u7406\u66f4\u591a\u7ec6\u8282&#xff0c;\u5982\u624b\u52bf\u8bc6\u522b\u3001\u52a8\u753b\u540c\u6b65\u3001\u72b6\u6001\u7ba1\u7406\u7b49\u3002<\/p>\n<\/li>\n<li>\n<p>\u9002\u7528\u573a\u666f&#xff1a;\u8ffd\u6c42\u6781\u81f4\u6027\u80fd\u3001\u6df1\u5ea6\u5b9a\u5236UI&#xff0c;\u6216\u9879\u76ee\u9650\u5236\u4e0d\u80fd\u5f15\u5165\u4e09\u65b9\u5e93\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u65b9\u6848\u4e8c&#xff1a;\u96c6\u6210\u5df2\u9002\u914d\u7684\u8de8\u5e73\u53f0\u4e09\u65b9\u5e93&#xff08;\u5982react-native-MJRefresh\u6216pull_to_refresh&#xff09;<\/p>\n<ul>\n<li>\n<p>\u4f18\u70b9&#xff1a;\u5f00\u53d1\u901f\u5ea6\u5feb&#xff0c;\u901a\u5e38\u63d0\u4f9b\u4e30\u5bcc\u7684\u9884\u8bbe\u52a8\u753b\u548c\u5e03\u5c40&#xff0c;\u793e\u533a\u95ee\u9898\u8d44\u6e90\u591a\u3002<\/p>\n<\/li>\n<li>\n<p>\u6311\u6218&#xff1a;\u53ef\u80fd\u5b58\u5728\u4e0e\u7279\u5b9a\u9e3f\u8499SDK\u7248\u672c\u7684\u517c\u5bb9\u6027\u95ee\u9898&#xff0c;\u589e\u52a0\u5305\u4f53\u79ef&#xff0c;\u5b9a\u5236\u5316\u53d7\u9650\u4e8e\u5e93\u7684\u80fd\u529b\u3002<\/p>\n<\/li>\n<li>\n<p>\u9002\u7528\u573a\u666f&#xff1a;\u5feb\u901f\u539f\u578b\u5f00\u53d1&#xff0c;\u6216\u56e2\u961f\u5bf9\u67d0\u4e2a\u5e93\u5df2\u6709\u4e30\u5bcc\u7ecf\u9a8c\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u672c\u6307\u5357\u5c06\u6df1\u5ea6\u805a\u7126\u65b9\u6848\u4e00&#xff0c;\u56e0\u4e3a\u7406\u89e3\u5176\u539f\u7406\u540e&#xff0c;\u4f60\u4e0d\u4ec5\u80fd\u5b9e\u73b0\u529f\u80fd&#xff0c;\u66f4\u80fd\u4ece\u5bb9\u5e94\u5bf9\u4efb\u4f55\u81ea\u5b9a\u4e49\u4ea4\u4e92\u9700\u6c42&#xff0c;\u5e76\u80fd\u66f4\u597d\u5730\u6392\u67e5\u4e09\u65b9\u5e93\u51fa\u73b0\u7684\u95ee\u9898\u3002\u6211\u4eec\u5c06\u5206\u6a21\u5757\u6784\u5efa&#xff1a;\u4e0b\u62c9\u5237\u65b0 -&gt; \u4e0a\u62c9\u52a0\u8f7d -&gt; \u72b6\u6001\u63d0\u793a\u7cfb\u7edf\u3002<\/p>\n<h4>\u7b2c\u4e8c\u90e8\u5206&#xff1a;\u5b9e\u73b0\u201c\u4e0b\u62c9\u5237\u65b0\u201d\u2014\u2014Pull to Refresh<\/h4>\n<p>\u4e0b\u62c9\u5237\u65b0\u7684\u672c\u8d28\u662f&#xff1a;\u76d1\u542c\u5217\u8868\u7684\u5411\u4e0b\u6ed1\u52a8&#xff0c;\u5f53\u6ed1\u52a8\u8ddd\u79bb\u8d85\u8fc7\u67d0\u4e2a\u9608\u503c\u4e14\u677e\u624b\u65f6&#xff0c;\u89e6\u53d1\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\u3002<\/p>\n<p>1. \u6838\u5fc3\u7ec4\u4ef6\u7ed3\u6784<br \/>\n\u6211\u4eec\u9700\u8981\u6539\u9020\u539f\u6709\u7684\u00a0List\u3002\u5173\u952e\u5728\u4e8e\u4f7f\u7528\u00a0Scroll\u00a0\u7ec4\u4ef6\u5305\u88f9\u00a0List&#xff0c;\u56e0\u4e3a\u00a0Scroll\u00a0\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u624b\u52bf\u548c\u6eda\u52a8\u4e8b\u4ef6\u76d1\u542c\u3002<\/p>\n<p>javascript<\/p>\n<p>\/\/ \u4f7f\u7528&#064;State\u7ba1\u7406\u5237\u65b0\u72b6\u6001<br \/>\n&#064;State isRefreshing: boolean &#061; false; \/\/ \u662f\u5426\u6b63\u5728\u5237\u65b0<br \/>\n&#064;State refreshTrigger: number &#061; 0; \/\/ \u7528\u4e8e\u5f3a\u5236\u5217\u8868\u5237\u65b0\u7684\u89e6\u53d1\u5668<\/p>\n<p>build() {<br \/>\n  Column() {<br \/>\n    \/\/ 1. \u9876\u90e8\u5237\u65b0\u6307\u793a\u5668<br \/>\n    if (this.isRefreshing) {<br \/>\n      this.buildRefreshIndicator()<br \/>\n    }<\/p>\n<p>    \/\/ 2. \u53ef\u6eda\u52a8\u7684\u5217\u8868\u533a\u57df<br \/>\n    Scroll(this.scroller) {<br \/>\n      List() {<br \/>\n        ForEach(this.dataList, (item) &#061;&gt; {<br \/>\n          ListItem() {<br \/>\n            \/\/ \u4f60\u7684\u5217\u8868\u9879UI&#8230;<br \/>\n          }<br \/>\n        }, item &#061;&gt; item.id)<br \/>\n      }<br \/>\n      .onScrollIndex((start, end) &#061;&gt; {<br \/>\n        \/\/ \u8fd9\u91cc\u53ef\u4ee5\u7528\u4e8e\u7c97\u7565\u5224\u65ad\u662f\u5426\u6eda\u52a8\u5230\u5e95\u90e8&#xff08;\u4e0a\u62c9\u52a0\u8f7d&#xff09;<br \/>\n      })<br \/>\n    }<br \/>\n    .scrollable(ScrollDirection.Vertical) \/\/ \u5782\u76f4\u6eda\u52a8<br \/>\n    .onScrollFrameBegin((offset) &#061;&gt; {<br \/>\n      \/\/ \u6838\u5fc3&#xff1a;\u6eda\u52a8\u4e8b\u4ef6\u56de\u8c03&#xff0c;offset.scrollY\u662f\u7eb5\u5411\u6eda\u52a8\u504f\u79fb\u91cf<br \/>\n      this.handleScroll(offset.scrollY);<br \/>\n    })<br \/>\n    .onScrollEnd(() &#061;&gt; {<br \/>\n      \/\/ \u6eda\u52a8\u7ed3\u675f\u65f6\u5224\u65ad\u662f\u5426\u9700\u8981\u89e6\u53d1\u5237\u65b0<br \/>\n      this.handleScrollEnd();<br \/>\n    })<br \/>\n  }<br \/>\n}<\/p>\n<p>2. \u624b\u52bf\u4e0e\u72b6\u6001\u5224\u65ad\u903b\u8f91 (handleScroll\u00a0\u65b9\u6cd5)<br \/>\n\u8fd9\u662f\u4e0b\u62c9\u5237\u65b0\u7684\u201c\u5927\u8111\u201d\u3002\u6211\u4eec\u9700\u8981\u5b9a\u4e49\u51e0\u4e2a\u5173\u952e\u9608\u503c&#xff1a;REFRESH_THRESHOLD&#xff08;\u89e6\u53d1\u5237\u65b0\u7684\u4e0b\u62c9\u8ddd\u79bb&#xff0c;\u598280\u50cf\u7d20&#xff09;\u548c\u00a0DRAG_START_POSITION&#xff08;\u521d\u59cb\u89e6\u6478\u70b9&#xff09;\u3002<\/p>\n<p>javascript<\/p>\n<p>\/\/ \u5b9a\u4e49\u72b6\u6001\u548c\u9608\u503c<br \/>\nprivate isDragging: boolean &#061; false;<br \/>\nprivate startY: number &#061; 0;<br \/>\nprivate readonly REFRESH_THRESHOLD: number &#061; 80;<\/p>\n<p>handleScroll(scrollY: number) {<br \/>\n  \/\/ 1. \u5224\u65ad\u662f\u5426\u662f\u4e0b\u62c9&#xff08;\u5217\u8868\u5728\u6700\u9876\u90e8\u4e14\u5411\u4e0b\u62c9&#xff09;<br \/>\n  if (scrollY &lt;&#061; 0 &amp;&amp; !this.isDragging) {<br \/>\n    this.isDragging &#061; true;<br \/>\n    this.startY &#061; scrollY;<br \/>\n  }<\/p>\n<p>  \/\/ 2. \u8ba1\u7b97\u4e0b\u62c9\u8ddd\u79bb<br \/>\n  if (this.isDragging) {<br \/>\n    let dragDistance &#061; Math.abs(scrollY) &#8211; this.startY;<br \/>\n    \/\/ 3. \u6839\u636e\u8ddd\u79bb\u66f4\u65b0UI\u72b6\u6001&#xff08;\u4f8b\u5982&#xff1a;\u53ef\u4ee5\u7f29\u653e\u6216\u65cb\u8f6c\u9876\u90e8\u6307\u793a\u5668&#xff09;<br \/>\n    this.updateRefreshUI(dragDistance);<\/p>\n<p>    \/\/ 4. \u5982\u679c\u7528\u6237\u4e0b\u62c9\u8ddd\u79bb\u8d85\u8fc7\u9608\u503c&#xff0c;\u4e14\u672a\u5728\u5237\u65b0&#xff0c;\u5219\u51c6\u5907\u89e6\u53d1<br \/>\n    if (dragDistance &gt; this.REFRESH_THRESHOLD &amp;&amp; !this.isRefreshing) {<br \/>\n      \/\/ \u53ef\u4ee5\u7ed9\u4e00\u4e2a\u89c6\u89c9\u53cd\u9988&#xff0c;\u6bd4\u5982\u6539\u53d8\u63d0\u793a\u6587\u5b57\u4e3a\u201c\u677e\u624b\u5237\u65b0\u201d<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>handleScrollEnd() {<br \/>\n  if (this.isDragging) {<br \/>\n    let finalDragDistance &#061; &#8230;; \/\/ \u8ba1\u7b97\u6700\u7ec8\u8ddd\u79bb<br \/>\n    if (finalDragDistance &gt; this.REFRESH_THRESHOLD &amp;&amp; !this.isRefreshing) {<br \/>\n      \/\/ \u771f\u6b63\u89e6\u53d1\u5237\u65b0\u52a8\u4f5c<br \/>\n      this.triggerRefresh();<br \/>\n    }<br \/>\n    \/\/ \u91cd\u7f6e\u62d6\u62fd\u72b6\u6001<br \/>\n    this.isDragging &#061; false;<br \/>\n    this.startY &#061; 0;<br \/>\n    \/\/ \u65e0\u8bba\u662f\u5426\u89e6\u53d1&#xff0c;\u90fd\u91cd\u7f6e\u5237\u65b0UI<br \/>\n    this.resetRefreshUI();<br \/>\n  }<br \/>\n}<\/p>\n<p>3. \u89e6\u53d1\u5237\u65b0\u4e0e\u6570\u636e\u52a0\u8f7d (triggerRefresh\u00a0\u65b9\u6cd5)<br \/>\n\u5f53\u677e\u624b\u5e76\u6ee1\u8db3\u6761\u4ef6\u65f6&#xff0c;\u542f\u52a8\u5237\u65b0\u3002<\/p>\n<p>javascript<\/p>\n<p>async triggerRefresh() {<br \/>\n  \/\/ 1. \u66f4\u65b0\u72b6\u6001&#xff0c;\u663e\u793a\u52a0\u8f7d\u52a8\u753b<br \/>\n  this.isRefreshing &#061; true;<br \/>\n  this.refreshTrigger&#043;&#043;; \/\/ \u5f3a\u5236\u9876\u90e8\u6307\u793a\u5668\u91cd\u65b0\u6e32\u67d3<\/p>\n<p>  \/\/ 2. \u6267\u884c\u6570\u636e\u8bf7\u6c42&#xff08;\u590d\u7528DAY3\u7684fetchData&#xff0c;\u4f46\u5e94\u662f\u83b7\u53d6\u6700\u65b0\u7b2c\u4e00\u9875&#xff09;<br \/>\n  try {<br \/>\n    \/\/ \u6ce8\u610f&#xff1a;\u8fd9\u91cc\u5e94\u8bf7\u6c42\u7b2c\u4e00\u9875\u6570\u636e&#xff0c;\u800c\u4e0d\u662f\u4e0b\u4e00\u9875<br \/>\n    let newData &#061; await this.fetchNewPageData(1);<br \/>\n    \/\/ 3. \u6e05\u7a7a\u65e7\u5217\u8868&#xff0c;\u7528\u65b0\u6570\u636e\u66ff\u6362<br \/>\n    this.dataList &#061; newData;<br \/>\n    this.currentPage &#061; 1; \/\/ \u91cd\u7f6e\u9875\u7801<br \/>\n    \/\/ 4. \u663e\u793a\u5237\u65b0\u6210\u529f\u63d0\u793a&#xff08;\u53ef\u9009&#xff09;<br \/>\n    promptAction.showToast({ message: &#039;\u5237\u65b0\u6210\u529f&#039; });<br \/>\n  } catch (error) {<br \/>\n    \/\/ 5. \u5904\u7406\u9519\u8bef&#xff1a;\u663e\u793a\u9519\u8bef\u63d0\u793a<br \/>\n    promptAction.showToast({ message: &#039;\u5237\u65b0\u5931\u8d25&#xff0c;\u8bf7\u91cd\u8bd5&#039; });<br \/>\n    console.error(&#039;\u4e0b\u62c9\u5237\u65b0\u5931\u8d25:&#039;, error);<br \/>\n  } finally {<br \/>\n    \/\/ 6. \u65e0\u8bba\u6210\u529f\u5931\u8d25&#xff0c;\u7ed3\u675f\u5237\u65b0\u72b6\u6001<br \/>\n    this.isRefreshing &#061; false;<br \/>\n  }<br \/>\n}<\/p>\n<p>4. \u9047\u5230\u7684\u7b2c\u4e00\u4e2a\u5927\u5751&#xff1a;\u201c\u5217\u8868\u6296\u52a8\u201d\u4e0e\u624b\u52bf\u51b2\u7a81<br \/>\n\u5728\u771f\u673a\u4e0a\u6d4b\u8bd5\u65f6&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u53d1\u73b0\u4e0b\u62c9\u64cd\u4f5c\u4e0d\u8ddf\u624b&#xff0c;\u5217\u8868\u6709\u8f7b\u5fae\u6296\u52a8&#xff0c;\u6216\u8005\u5237\u65b0\u88ab\u610f\u5916\u89e6\u53d1\u3002<\/p>\n<p>\u95ee\u9898\u6839\u6e90&#xff1a;Scroll\u00a0\u7ec4\u4ef6\u7684\u00a0onScrollFrameBegin\u00a0\u4e8b\u4ef6\u975e\u5e38\u654f\u611f&#xff0c;\u53ef\u80fd\u4e0e\u7cfb\u7edf\u7684\u89e6\u6478\u4e8b\u4ef6\u5904\u7406\u4ea7\u751f\u5fae\u5999\u7684\u7ade\u4e89\u3002\u76f4\u63a5\u5728\u5176\u4e2d\u8fdb\u884c\u590d\u6742\u7684UI\u72b6\u6001\u8ba1\u7b97\u548c\u66f4\u65b0&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u6e32\u67d3\u5e27\u4e0d\u7a33\u5b9a\u3002<\/p>\n<p>\u6211\u7684\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u9632\u6296\u4e0e\u8282\u6d41&#xff1a;\u5bf9\u00a0handleScroll\u00a0\u4e2d\u7684UI\u66f4\u65b0\u903b\u8f91\u8fdb\u884c\u8282\u6d41&#xff0c;\u6bd4\u5982\u6bcf100\u6beb\u79d2\u53ea\u66f4\u65b0\u4e00\u6b21\u6307\u793a\u5668\u7684\u89c6\u89c9\u72b6\u6001&#xff0c;\u907f\u514d\u9ad8\u9891\u91cd\u7ed8\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u66f4\u7a33\u5b9a\u7684\u4e8b\u4ef6&#xff1a;\u5c1d\u8bd5\u4f7f\u7528\u00a0Scroll\u00a0\u7684\u00a0onTouch\u00a0\u4e8b\u4ef6\u7ed3\u5408\u00a0onScroll\u00a0\u6765\u5224\u65ad\u521d\u59cb\u62d6\u62fd&#xff0c;\u903b\u8f91\u66f4\u6e05\u6670\u3002<\/p>\n<\/li>\n<li>\n<p>\u5408\u7406\u8bbe\u7f6e\u6eda\u52a8\u8fb9\u754c&#xff1a;\u786e\u4fdd\u00a0Scroll\u00a0\u7684\u00a0edgeEffect\u00a0\u5c5e\u6027\u8bbe\u7f6e\u6b63\u786e&#xff08;\u5982\u00a0EdgeEffect.Spring&#xff09;&#xff0c;\u4f7f\u8fc7\u5ea6\u4e0b\u62c9\u7684\u7269\u7406\u53cd\u9988\u66f4\u81ea\u7136\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>\u7b2c\u4e09\u90e8\u5206&#xff1a;\u5b9e\u73b0\u201c\u4e0a\u62c9\u52a0\u8f7d\u66f4\u591a\u201d\u2014\u2014Infinite Scroll<\/h4>\n<p>\u4e0a\u62c9\u52a0\u8f7d\u7684\u6838\u5fc3\u662f&#xff1a;\u76d1\u542c\u5217\u8868\u6eda\u52a8\u5230\u5e95\u90e8&#xff08;\u6216\u63a5\u8fd1\u5e95\u90e8&#xff09;\u7684\u4e8b\u4ef6&#xff0c;\u81ea\u52a8\u89e6\u53d1\u52a0\u8f7d\u4e0b\u4e00\u9875\u6570\u636e\u3002<\/p>\n<p>1. \u5224\u65ad\u201c\u6eda\u52a8\u5230\u5e95\u90e8\u201d<br \/>\n\u6709\u4e24\u79cd\u4e3b\u6d41\u65b9\u6cd5&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u65b9\u6cd5A&#xff1a;\u901a\u8fc7\u00a0onScrollIndex\u00a0\u8ba1\u7b97\u3002\u5f53\u6eda\u52a8\u7ed3\u675f\u65f6&#xff0c;onScrollIndex\u00a0\u8fd4\u56de\u7684\u00a0end\u00a0\u7d22\u5f15\u7b49\u4e8e\u6216\u63a5\u8fd1\u6570\u636e\u5217\u8868\u7684\u6700\u540e\u4e00\u4e2a\u7d22\u5f15\u65f6&#xff0c;\u53ef\u8ba4\u4e3a\u89e6\u5e95\u3002<\/p>\n<\/li>\n<li>\n<p>\u65b9\u6cd5B&#xff1a;\u901a\u8fc7\u00a0onScroll\u00a0\u7684\u504f\u79fb\u91cf\u8ba1\u7b97&#xff08;\u66f4\u7cbe\u786e&#xff09;\u3002scrollY &#043; scrollHeight &gt;&#061; contentHeight &#8211; THRESHOLD\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u5c55\u793a\u66f4\u901a\u7528\u7684\u65b9\u6cd5B&#xff1a;<\/p>\n<p>javascript<\/p>\n<p>\/\/ \u5728Scroll\u7684onScroll\u56de\u8c03\u4e2d&#xff08;\u6216onScrollEnd\u4e2d&#xff09;<br \/>\nonScrollEnd(() &#061;&gt; {<br \/>\n  \/\/ \u83b7\u53d6Scroll\u7684\u5185\u5bb9\u9ad8\u5ea6\u548c\u53ef\u89c6\u533a\u57df\u9ad8\u5ea6&#xff08;\u9700\u8981\u901a\u8fc7ref\u6216\u4e0a\u4e0b\u6587\u83b7\u53d6&#xff0c;\u6b64\u5904\u4e3a\u4f2a\u4ee3\u7801\u903b\u8f91&#xff09;<br \/>\n  let contentH &#061; this.scroller.currentContentHeight();<br \/>\n  let scrollH &#061; this.scroller.height;<br \/>\n  let offsetY &#061; this.scroller.currentOffset().yOffset;<\/p>\n<p>  \/\/ \u5224\u65ad\u662f\u5426\u6eda\u52a8\u5230\u5e95\u90e8\u9608\u503c&#xff08;\u4f8b\u5982&#xff0c;\u8ddd\u79bb\u5e95\u90e8\u8fd8\u670950\u50cf\u7d20\u65f6\u89e6\u53d1&#xff09;<br \/>\n  const LOAD_MORE_THRESHOLD &#061; 50;<br \/>\n  if (contentH &#8211; (offsetY &#043; scrollH) &lt;&#061; LOAD_MORE_THRESHOLD) {<br \/>\n    if (!this.isLoadingMore &amp;&amp; this.hasMoreData) {<br \/>\n      this.loadMoreData();<br \/>\n    }<br \/>\n  }<br \/>\n})<\/p>\n<p>2. \u52a0\u8f7d\u66f4\u591a\u6570\u636e (loadMoreData\u00a0\u65b9\u6cd5)<\/p>\n<p>javascript<\/p>\n<p>\/\/ \u7ba1\u7406\u72b6\u6001<br \/>\n&#064;State isLoadingMore: boolean &#061; false;<br \/>\n&#064;State hasMoreData: boolean &#061; true;<\/p>\n<p>async loadMoreData() {<br \/>\n  \/\/ 1. \u9632\u6b62\u91cd\u590d\u52a0\u8f7d<br \/>\n  if (this.isLoadingMore || !this.hasMoreData) {<br \/>\n    return;<br \/>\n  }<br \/>\n  this.isLoadingMore &#061; true;<\/p>\n<p>  \/\/ 2. \u8ba1\u7b97\u4e0b\u4e00\u9875\u9875\u7801<br \/>\n  let nextPage &#061; this.currentPage &#043; 1;<\/p>\n<p>  try {<br \/>\n    \/\/ 3. \u8bf7\u6c42\u4e0b\u4e00\u9875\u6570\u636e<br \/>\n    let newPageData &#061; await this.fetchNewPageData(nextPage);<br \/>\n    if (newPageData &amp;&amp; newPageData.length &gt; 0) {<br \/>\n      \/\/ 4. \u62fc\u63a5\u6570\u636e<br \/>\n      this.dataList &#061; this.dataList.concat(newPageData);<br \/>\n      this.currentPage &#061; nextPage;<br \/>\n      \/\/ 5. \u5224\u65ad\u662f\u5426\u8fd8\u6709\u66f4\u591a\u6570\u636e&#xff08;\u4f8b\u5982&#xff0c;\u8fd4\u56de\u7684\u6570\u636e\u5c11\u4e8e\u6bcf\u9875\u9884\u671f\u6570\u91cf&#xff09;<br \/>\n      if (newPageData.length &lt; this.pageSize) {<br \/>\n        this.hasMoreData &#061; false;<br \/>\n        \/\/ \u66f4\u65b0\u5e95\u90e8\u72b6\u6001\u4e3a\u201c\u6ca1\u6709\u66f4\u591a\u4e86\u201d<br \/>\n      }<br \/>\n    } else {<br \/>\n      \/\/ \u6ca1\u6709\u65b0\u6570\u636e\u4e86<br \/>\n      this.hasMoreData &#061; false;<br \/>\n    }<br \/>\n  } catch (error) {<br \/>\n    console.error(&#039;\u52a0\u8f7d\u66f4\u591a\u5931\u8d25:&#039;, error);<br \/>\n    \/\/ \u663e\u793a\u52a0\u8f7d\u5931\u8d25\u72b6\u6001&#xff0c;\u4f46\u5141\u8bb8\u91cd\u8bd5<br \/>\n    promptAction.showToast({ message: &#039;\u52a0\u8f7d\u5931\u8d25&#xff0c;\u70b9\u51fb\u91cd\u8bd5&#039; });<br \/>\n  } finally {<br \/>\n    this.isLoadingMore &#061; false;<br \/>\n  }<br \/>\n}<\/p>\n<p>3. \u7b2c\u4e8c\u4e2a\u5927\u5751&#xff1a;\u5feb\u901f\u6eda\u52a8\u5bfc\u81f4\u7684\u201c\u91cd\u590d\u8bf7\u6c42\u201d\u4e0e\u201c\u5185\u5b58\u6cc4\u6f0f\u201d<br \/>\n\u75af\u72c2\u4e0a\u6ed1\u5217\u8868\u65f6&#xff0c;\u53ef\u80fd\u4f1a\u5728\u6781\u77ed\u65f6\u95f4\u5185\u8fde\u7eed\u89e6\u53d1\u591a\u6b21\u00a0loadMoreData&#xff0c;\u5bfc\u81f4\u540c\u4e00\u9875\u6570\u636e\u88ab\u8bf7\u6c42\u591a\u6b21&#xff0c;\u9875\u9762\u9519\u4e71\u3002<\/p>\n<p>\u95ee\u9898\u6839\u6e90&#xff1a;\u6eda\u52a8\u4e8b\u4ef6\u7684\u89e6\u53d1\u9891\u7387\u8fdc\u9ad8\u4e8e\u7f51\u7edc\u8bf7\u6c42\u7684\u5b8c\u6210\u901f\u5ea6\u3002\u5728\u7b2c\u4e00\u6b21\u8bf7\u6c42\u672a\u5b8c\u6210 (isLoadingMore\u00a0\u4ecd\u662f\u00a0false) \u524d&#xff0c;\u6eda\u52a8\u5224\u65ad\u903b\u8f91\u53ef\u80fd\u5df2\u7ecf\u6ee1\u8db3\u4e86\u518d\u6b21\u89e6\u53d1\u7684\u6761\u4ef6\u3002<\/p>\n<p>\u6211\u7684\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u6807\u5fd7\u4f4d\u9501&#xff1a;isLoadingMore\u00a0\u6807\u5fd7\u4f4d\u662f\u5173\u952e&#xff0c;\u5fc5\u987b\u5728\u8bf7\u6c42\u5f00\u59cb\u524d\u7acb\u5373\u7f6e\u4e3a\u00a0true&#xff0c;\u5728\u00a0finally\u00a0\u5757\u4e2d\u7f6e\u4e3a\u00a0false&#xff0c;\u786e\u4fdd\u9501\u7684\u53ef\u9760\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>\u51fd\u6570\u8282\u6d41&#xff1a;\u5bf9\u89e6\u53d1\u00a0loadMoreData\u00a0\u7684\u5224\u65ad\u51fd\u6570\u8fdb\u884c\u8282\u6d41&#xff0c;\u786e\u4fdd500\u6beb\u79d2\u5185\u53ea\u5224\u65ad\u4e00\u6b21\u3002<\/p>\n<\/li>\n<li>\n<p>\u6e05\u7406\u672a\u5b8c\u6210\u7684\u8bf7\u6c42&#xff1a;\u5728\u7ec4\u4ef6\u9500\u6bc1\u6216\u9875\u9762\u79bb\u5f00\u65f6&#xff0c;\u5982\u679c\u8bf7\u6c42\u672a\u5b8c\u6210&#xff0c;\u5e94\u5f53\u4f7f\u7528\u00a0httpRequest.destroy()&#xff08;\u539f\u751fAPI&#xff09;\u6216\u00a0CancelToken&#xff08;axios&#xff09;\u53d6\u6d88\u8bf7\u6c42&#xff0c;\u907f\u514d\u5185\u5b58\u6cc4\u6f0f\u548c\u66f4\u65b0\u4e00\u4e2a\u5df2\u9500\u6bc1\u7ec4\u4ef6\u7684\u72b6\u6001\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>\u7b2c\u56db\u90e8\u5206&#xff1a;\u6784\u5efa\u667a\u80fd\u72b6\u6001\u63d0\u793a\u7cfb\u7edf<\/h4>\n<p>\u4e00\u4e2a\u5065\u58ee\u7684\u5217\u8868&#xff0c;\u5fc5\u987b\u4f18\u96c5\u5730\u5904\u7406\u6240\u6709\u8fb9\u754c\u72b6\u6001\u3002\u6211\u4eec\u5728\u00a0List\u00a0\u7684\u672b\u5c3e&#xff0c;\u4f7f\u7528\u6761\u4ef6\u6e32\u67d3\u6765\u5c55\u793a\u4e0d\u540c\u7684\u72b6\u6001\u7ec4\u4ef6\u3002<\/p>\n<p>javascript<\/p>\n<p>List() {<br \/>\n  \/\/ 1. \u4e3b\u6570\u636e\u5217\u8868<br \/>\n  ForEach(this.dataList, (item) &#061;&gt; { &#8230; });<\/p>\n<p>  \/\/ 2. \u52a0\u8f7d\u66f4\u591a\u7684\u6307\u793a\u5668<br \/>\n  if (this.isLoadingMore) {<br \/>\n    ListItem() {<br \/>\n      Row() {<br \/>\n        LoadingProgress() \/\/ \u9e3f\u8499\u7684\u52a0\u8f7d\u8fdb\u5ea6\u6761\u7ec4\u4ef6<br \/>\n        Text(&#039;\u6b63\u5728\u52a0\u8f7d\u66f4\u591a&#8230;&#039;).margin({left: 10})<br \/>\n      }.justifyContent(FlexAlign.Center).width(&#039;100%&#039;).padding(20)<br \/>\n    }<br \/>\n  }<\/p>\n<p>  \/\/ 3. \u6ca1\u6709\u66f4\u591a\u6570\u636e\u7684\u63d0\u793a<br \/>\n  if (!this.hasMoreData &amp;&amp; this.dataList.length &gt; 0) {<br \/>\n    ListItem() {<br \/>\n      Text(&#039;\u2014\u2014 \u6211\u662f\u6709\u5e95\u7ebf\u7684 \u2014\u2014&#039;)<br \/>\n        .fontSize(14)<br \/>\n        .fontColor(&#039;#999&#039;)<br \/>\n        .textAlign(TextAlign.Center)<br \/>\n        .width(&#039;100%&#039;)<br \/>\n        .padding(20)<br \/>\n    }<br \/>\n  }<\/p>\n<p>  \/\/ 4. \u7a7a\u6570\u636e\u72b6\u6001&#xff08;\u9996\u6b21\u52a0\u8f7d\u65e0\u6570\u636e&#xff09;<br \/>\n  if (!this.isRefreshing &amp;&amp; !this.isLoadingMore &amp;&amp; this.dataList.length &#061;&#061;&#061; 0) {<br \/>\n    ListItem() {<br \/>\n      Column() {<br \/>\n        Image($r(&#039;app.media.empty_state&#039;)) \/\/ \u7a7a\u72b6\u6001\u56fe\u7247<br \/>\n          .width(120)<br \/>\n          .height(120)<br \/>\n        Text(&#039;\u8fd9\u91cc\u8fd8\u6ca1\u6709\u5185\u5bb9\u54e6~&#039;)<br \/>\n          .fontSize(16)<br \/>\n          .margin({top: 20})<br \/>\n        Button(&#039;\u70b9\u51fb\u5237\u65b0&#039;)<br \/>\n          .margin({top: 15})<br \/>\n          .onClick(() &#061;&gt; this.triggerRefresh())<br \/>\n      }<br \/>\n      .justifyContent(FlexAlign.Center)<br \/>\n      .width(&#039;100%&#039;)<br \/>\n      .height(400)<br \/>\n    }<br \/>\n  }<\/p>\n<p>  \/\/ 5. \u52a0\u8f7d\u5931\u8d25\u72b6\u6001&#xff08;\u53ef\u70b9\u51fb\u91cd\u8bd5&#xff09;<br \/>\n  if (this.loadError &amp;&amp; this.dataList.length &#061;&#061;&#061; 0) {<br \/>\n    ListItem() {<br \/>\n      Column() {<br \/>\n        Image($r(&#039;app.media.error_state&#039;))<br \/>\n          .width(120)<br \/>\n          .height(120)<br \/>\n        Text(&#039;\u52a0\u8f7d\u5931\u8d25&#xff0c;\u8bf7\u68c0\u67e5\u7f51\u7edc&#039;)<br \/>\n          .fontSize(16)<br \/>\n          .margin({top: 20})<br \/>\n        Button(&#039;\u91cd\u8bd5&#039;)<br \/>\n          .margin({top: 15})<br \/>\n          .onClick(() &#061;&gt; {<br \/>\n            this.loadError &#061; false;<br \/>\n            this.triggerRefresh();<br \/>\n          })<br \/>\n      }<br \/>\n      .justifyContent(FlexAlign.Center)<br \/>\n      .width(&#039;100%&#039;)<br \/>\n      .height(400)<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<h4>\u7b2c\u4e94\u90e8\u5206&#xff1a;\u6027\u80fd\u4f18\u5316\u4e0e\u7ec8\u6781\u6311\u6218<\/h4>\n<p>\u6311\u6218&#xff1a;\u8d85\u957f\u5217\u8868\u6ed1\u52a8\u5361\u987f<br \/>\n\u5f53\u5217\u8868\u6709\u6210\u5343\u4e0a\u4e07\u6761\u6570\u636e&#xff0c;\u4e14\u6bcf\u4e2a\u5217\u8868\u9879UI\u590d\u6742\u65f6&#xff0c;\u75af\u72c2\u6ed1\u52a8\u5fc5\u7136\u5361\u987f\u3002<\/p>\n<p>\u6df1\u5ea6\u4f18\u5316\u65b9\u6848&#xff1a;<\/p>\n<li>\n<p>\u4f7f\u7528\u00a0LazyForEach\u00a0\u66ff\u4ee3\u00a0ForEach&#xff1a;\u8fd9\u662f\u9e3f\u8499\u4e3a\u957f\u5217\u8868\u8bbe\u8ba1\u7684\u7ec8\u6781\u6b66\u5668\u3002\u5b83\u53ea\u521b\u5efa\u53ef\u89c6\u533a\u57df\u5185\u7684\u5217\u8868\u9879&#xff0c;\u5bf9\u5185\u5b58\u5f00\u9500\u662f\u6570\u91cf\u7ea7\u7684\u964d\u4f4e\u3002\u4f60\u5fc5\u987b\u4e3a\u6570\u636e\u6e90\u5b9e\u73b0\u00a0IDataSource\u00a0\u63a5\u53e3\u3002<\/p>\n<p>javascript<\/p>\n<p>\/\/ \u4f2a\u4ee3\u7801\u793a\u4f8b&#xff0c;\u5177\u4f53\u9700\u5b9e\u73b0IDataSource<br \/>\nLazyForEach(this.dataSource, (item: any) &#061;&gt; {<br \/>\n  ListItem() { &#8230; }<br \/>\n}, (item: any) &#061;&gt; item.id.toString())<\/p>\n<\/li>\n<li>\n<p>\u56fe\u7247\u4f18\u5316&#xff1a;\u5217\u8868\u4e2d\u7684\u56fe\u7247\u52a1\u5fc5\u4f7f\u7528\u00a0Image\u00a0\u7ec4\u4ef6\u7684\u7f13\u5b58\u3001\u7f29\u7565\u56fe\u3001\u5931\u8d25\u56fe\u7b49\u5c5e\u6027\u3002\u8003\u8651\u4f7f\u7528\u7b2c\u4e09\u65b9\u56fe\u7247\u5e93\u8fdb\u884c\u5185\u5b58\u7f13\u5b58\u548c\u78c1\u76d8\u7f13\u5b58\u3002<\/p>\n<\/li>\n<li>\n<p>\u5217\u8868\u9879UI\u6781\u7b80\u5316&#xff1a;\u907f\u514d\u5728\u5217\u8868\u9879\u4e2d\u4f7f\u7528\u8fc7\u591a\u7684\u9634\u5f71\u3001\u5706\u89d2\u548c\u590d\u6742\u7684\u5d4c\u5957\u5e03\u5c40\u3002\u4f7f\u7528\u00a0.backgroundColor\u00a0\u4ee3\u66ff\u591a\u5c42\u89c6\u56fe\u91cd\u53e0\u3002<\/p>\n<\/li>\n<li>\n<p>\u907f\u514d\u5728\u6eda\u52a8\u8fc7\u7a0b\u4e2d\u8fdb\u884c\u9ad8\u5f00\u9500\u8ba1\u7b97&#xff1a;\u5c06\u6570\u636e\u683c\u5f0f\u5316\u7b49\u64cd\u4f5c\u5728\u6570\u636e\u52a0\u8f7d\u65f6\u5b8c\u6210&#xff0c;\u800c\u4e0d\u662f\u5728\u5217\u8868\u9879\u7684\u00a0build\u00a0\u51fd\u6570\u4e2d\u3002<\/p>\n<\/li>\n<h4>\u603b\u7ed3\u4e0e\u63d0\u4ea4<\/h4>\n<p>\u5b8c\u6210\u8fd9\u4e09\u5927\u6a21\u5757&#xff0c;\u4f60\u7684\u5e94\u7528\u5217\u8868\u4f53\u9a8c\u5df2\u7ecf\u8fbe\u5230\u4e86\u4e13\u4e1a\u7ea7\u6c34\u5e73\u3002\u6700\u540e&#xff0c;\u522b\u5fd8\u4e86\u63d0\u4ea4\u4f60\u7684\u5de5\u4f5c\u6210\u679c&#xff1a;<\/p>\n<p>bash<\/p>\n<p>git add .<br \/>\ngit commit -m \u201cfeat: \u5b9e\u73b0\u5217\u8868\u9ad8\u7ea7\u4ea4\u4e92\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406<\/p>\n<p>&#8211; \u57fa\u4e8eScroll\u539f\u751f\u4e8b\u4ef6&#xff0c;\u5b9e\u73b0\u81ea\u5b9a\u4e49\u624b\u52bf\u4e0b\u62c9\u5237\u65b0&#xff0c;\u89e3\u51b3\u624b\u52bf\u51b2\u7a81\u5bfc\u81f4\u7684\u6296\u52a8\u95ee\u9898<br \/>\n&#8211; \u901a\u8fc7\u7cbe\u51c6\u6eda\u52a8\u76d1\u542c\u5b9e\u73b0\u4e0a\u62c9\u52a0\u8f7d\u66f4\u591a&#xff0c;\u5e76\u6dfb\u52a0\u9632\u6296\u4e0e\u8bf7\u6c42\u9501\u9632\u6b62\u91cd\u590d\u52a0\u8f7d<br \/>\n&#8211; \u6784\u5efa\u5b8c\u6574\u7684\u5217\u8868\u72b6\u6001\u63d0\u793a\u7cfb\u7edf&#xff08;\u52a0\u8f7d\u4e2d\u3001\u7a7a\u6570\u636e\u3001\u9519\u8bef\u3001\u65e0\u66f4\u591a\u6570\u636e&#xff09;<br \/>\n&#8211; \u9488\u5bf9\u8d85\u957f\u5217\u8868&#xff0c;\u5f15\u5165LazyForEach\u8fdb\u884c\u6df1\u5ea6\u6027\u80fd\u4f18\u5316<br \/>\n&#8211; \u4fee\u590d\u5feb\u901f\u6eda\u52a8\u53ef\u80fd\u5bfc\u81f4\u7684\u5185\u5b58\u6cc4\u6f0f\u9690\u60a3\u201d<\/p>\n<p>git push origin main<\/p>\n<p>DAY4-DAY6\u5fc3\u6cd5&#xff1a;\u8fd9\u4e09\u5929\u6211\u4eec\u8d85\u8d8a\u4e86\u529f\u80fd\u5b9e\u73b0&#xff0c;\u6df1\u5165\u5230\u4e86\u4ea4\u4e92\u7ec6\u8282\u3001\u72b6\u6001\u7ba1\u7406\u548c\u6027\u80fd\u4f18\u5316\u7684\u5c42\u9762\u3002\u4e00\u4e2a\u4f18\u79c0\u7684\u5217\u8868&#xff0c;\u4e0d\u4ec5\u8981\u201c\u6709\u201d\u529f\u80fd&#xff0c;\u66f4\u8981\u201c\u987a\u201d\u3001\u201c\u7a33\u201d\u3001\u201c\u7701\u201d\u3002\u5728\u63a5\u4e0b\u6765\u7684\u9636\u6bb5&#xff0c;\u6211\u4eec\u5c06\u63a2\u7d22\u66f4\u4e30\u5bcc\u7684\u5e94\u7528\u67b6\u6784\u3002\u6211\u4eec\u4e0b\u6b21\u89c1&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b22\u8fce\u52a0\u5165\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u793e\u533a&#xff1a;https:\/\/openharmonycrossplatform.csdn.net\u5404\u4f4d&#xff0c;\u6211\u662fMoranbika&#xff01;\u7ecf\u8fc7DAY3\u7684\u6218\u6597&#xff0c;\u6211\u4eec\u7684\u5e94\u7528\u5df2\u7ecf\u80fd\u5c55\u793a\u52a8\u6001\u5217\u8868\u4e86\u3002\u4f46\u4e00\u4e2a\u53ea\u4f1a\u663e\u793a\u7b2c\u4e00\u5c4f\u6570\u636e\u7684\u5217\u8868&#xff0c;\u5c31\u50cf\u4e00\u672c\u53ea\u80fd\u770b\u524d\u51e0\u9875\u7684\u4e66&#xff0c;\u4f53\u9a8c\u662f\u6b8b\u7f3a\u7684\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u8981\u7528\u4e09\u5929\u65f6\u95f4&#xff0c;\u4e3a\u5b83\u8d4b\u4e88\u00a0\u201c\u4e0b\u62c9\u5237\u65b0\u201d\u548c\u201c\u4e0a\u62c9\u52a0\u8f7d\u66f4\u591a\u201d\u00a0\u8fd9\u4e24\u9879\u7075\u9b42\u4ea4\u4e92&#xff0c;\u5e76\u6253\u9020\u4e00<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[280,67,227],"topic":[],"class_list":["post-72894","post","type-post","status-publish","format-standard","hentry","category-server","tag-harmonyos","tag-67","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Flutter for OpenHarmony\u3011\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u8bad\u7ec3\u8425DAY4-DAY6\uff1a\u8ba9\u5217\u8868\u201c\u6d3b\u201d\u8d77\u6765\u2014\u2014\u4e0a\u62c9\u52a0\u8f7d\u3001\u4e0b\u62c9\u5237\u65b0\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/72894.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Flutter for OpenHarmony\u3011\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u8bad\u7ec3\u8425DAY4-DAY6\uff1a\u8ba9\u5217\u8868\u201c\u6d3b\u201d\u8d77\u6765\u2014\u2014\u4e0a\u62c9\u52a0\u8f7d\u3001\u4e0b\u62c9\u5237\u65b0\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6b22\u8fce\u52a0\u5165\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u793e\u533a&#xff1a;https:\/\/openharmonycrossplatform.csdn.net\u5404\u4f4d&#xff0c;\u6211\u662fMoranbika&#xff01;\u7ecf\u8fc7DAY3\u7684\u6218\u6597&#xff0c;\u6211\u4eec\u7684\u5e94\u7528\u5df2\u7ecf\u80fd\u5c55\u793a\u52a8\u6001\u5217\u8868\u4e86\u3002\u4f46\u4e00\u4e2a\u53ea\u4f1a\u663e\u793a\u7b2c\u4e00\u5c4f\u6570\u636e\u7684\u5217\u8868&#xff0c;\u5c31\u50cf\u4e00\u672c\u53ea\u80fd\u770b\u524d\u51e0\u9875\u7684\u4e66&#xff0c;\u4f53\u9a8c\u662f\u6b8b\u7f3a\u7684\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u8981\u7528\u4e09\u5929\u65f6\u95f4&#xff0c;\u4e3a\u5b83\u8d4b\u4e88\u00a0\u201c\u4e0b\u62c9\u5237\u65b0\u201d\u548c\u201c\u4e0a\u62c9\u52a0\u8f7d\u66f4\u591a\u201d\u00a0\u8fd9\u4e24\u9879\u7075\u9b42\u4ea4\u4e92&#xff0c;\u5e76\u6253\u9020\u4e00\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/72894.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-06T10:17:45+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/72894.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/72894.html\",\"name\":\"\u3010Flutter for OpenHarmony\u3011\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u8bad\u7ec3\u8425DAY4-DAY6\uff1a\u8ba9\u5217\u8868\u201c\u6d3b\u201d\u8d77\u6765\u2014\u2014\u4e0a\u62c9\u52a0\u8f7d\u3001\u4e0b\u62c9\u5237\u65b0\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-06T10:17:45+00:00\",\"dateModified\":\"2026-02-06T10:17:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/72894.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/72894.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/72894.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Flutter for OpenHarmony\u3011\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u8bad\u7ec3\u8425DAY4-DAY6\uff1a\u8ba9\u5217\u8868\u201c\u6d3b\u201d\u8d77\u6765\u2014\u2014\u4e0a\u62c9\u52a0\u8f7d\u3001\u4e0b\u62c9\u5237\u65b0\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406\u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Flutter for OpenHarmony\u3011\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u8bad\u7ec3\u8425DAY4-DAY6\uff1a\u8ba9\u5217\u8868\u201c\u6d3b\u201d\u8d77\u6765\u2014\u2014\u4e0a\u62c9\u52a0\u8f7d\u3001\u4e0b\u62c9\u5237\u65b0\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/72894.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Flutter for OpenHarmony\u3011\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u8bad\u7ec3\u8425DAY4-DAY6\uff1a\u8ba9\u5217\u8868\u201c\u6d3b\u201d\u8d77\u6765\u2014\u2014\u4e0a\u62c9\u52a0\u8f7d\u3001\u4e0b\u62c9\u5237\u65b0\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6b22\u8fce\u52a0\u5165\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u793e\u533a&#xff1a;https:\/\/openharmonycrossplatform.csdn.net\u5404\u4f4d&#xff0c;\u6211\u662fMoranbika&#xff01;\u7ecf\u8fc7DAY3\u7684\u6218\u6597&#xff0c;\u6211\u4eec\u7684\u5e94\u7528\u5df2\u7ecf\u80fd\u5c55\u793a\u52a8\u6001\u5217\u8868\u4e86\u3002\u4f46\u4e00\u4e2a\u53ea\u4f1a\u663e\u793a\u7b2c\u4e00\u5c4f\u6570\u636e\u7684\u5217\u8868&#xff0c;\u5c31\u50cf\u4e00\u672c\u53ea\u80fd\u770b\u524d\u51e0\u9875\u7684\u4e66&#xff0c;\u4f53\u9a8c\u662f\u6b8b\u7f3a\u7684\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u8981\u7528\u4e09\u5929\u65f6\u95f4&#xff0c;\u4e3a\u5b83\u8d4b\u4e88\u00a0\u201c\u4e0b\u62c9\u5237\u65b0\u201d\u548c\u201c\u4e0a\u62c9\u52a0\u8f7d\u66f4\u591a\u201d\u00a0\u8fd9\u4e24\u9879\u7075\u9b42\u4ea4\u4e92&#xff0c;\u5e76\u6253\u9020\u4e00","og_url":"https:\/\/www.wsisp.com\/helps\/72894.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-06T10:17:45+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/72894.html","url":"https:\/\/www.wsisp.com\/helps\/72894.html","name":"\u3010Flutter for OpenHarmony\u3011\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u8bad\u7ec3\u8425DAY4-DAY6\uff1a\u8ba9\u5217\u8868\u201c\u6d3b\u201d\u8d77\u6765\u2014\u2014\u4e0a\u62c9\u52a0\u8f7d\u3001\u4e0b\u62c9\u5237\u65b0\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-06T10:17:45+00:00","dateModified":"2026-02-06T10:17:45+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/72894.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/72894.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/72894.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Flutter for OpenHarmony\u3011\u5f00\u6e90\u9e3f\u8499\u8de8\u5e73\u53f0\u8bad\u7ec3\u8425DAY4-DAY6\uff1a\u8ba9\u5217\u8868\u201c\u6d3b\u201d\u8d77\u6765\u2014\u2014\u4e0a\u62c9\u52a0\u8f7d\u3001\u4e0b\u62c9\u5237\u65b0\u4e0e\u667a\u80fd\u72b6\u6001\u7ba1\u7406\u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/72894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=72894"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/72894\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=72894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=72894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=72894"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=72894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}