{"id":28552,"date":"2024-11-25T16:26:11","date_gmt":"2024-11-25T08:26:11","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28552\/"},"modified":"2024-11-25T16:26:11","modified_gmt":"2024-11-25T08:26:11","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e4%b8%ad%e5%88%97%e8%a1%a8%e4%b8%8a%e6%8b%89%e5%8a%a0%e8%bd%bd%e7%9a%84%e5%ae%9e%e7%8e%b0%e6%96%b9%e6%b3%95%ef%bc%88%e9%99%84%e4%bb%a3%e7%a0%81%ef%bc%89","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28552\/","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u5217\u8868\u4e0a\u62c9\u52a0\u8f7d\u7684\u5b9e\u73b0\u65b9\u6cd5\uff08\u9644\u4ee3\u7801\uff09"},"content":{"rendered":"<p>\u672c\u7bc7\u6587\u7ae0\u7ed9\u5927\u5bb6\u5e26\u6765\u7684\u5185\u5bb9\u662f\u5173\u4e8e\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u5217\u8868\u4e0a\u62c9\u52a0\u8f7d\u7684\u5b9e\u73b0\u4ee3\u7801\uff0c\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u6709\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>\u67d0\u4e2a\u9875\u9762\uff0c\u6709\u591a\u4e2a\u5217\u8868\uff0c\u5982100\u884c\uff0c\u8fd9\u65f6\u9700\u8981\u5b9e\u73b0\u5206\u9875\u529f\u80fd\uff0c\u624b\u673a\u7aef\u7684\u5206\u9875\u4e00\u822c\u90fd\u662f\u6ed1\u5230\u5e95\u90e8\u65f6\u4e0a\u62c9\u5237\u65b0\u3002<\/p>\n<p>\u4f7f\u7528scroll-view\u5b9e\u73b0\uff0c\u5176bindscrolltolower\u65b9\u6cd5\uff1a\u6eda\u52a8\u5230\u5e95\u90e8\/\u53f3\u8fb9\u89e6\u53d1\u3002\u5f53\u89e6\u53d1\u65f6\u53d1\u9001\u8bf7\u6c42\u83b7\u53d6\u65b0\u7684\u6570\u636e\uff0c\u6211\u5199\u7684\u65f6\u5019\u83b7\u53d6\u7684\u6570\u636e\u5f88\u5feb\uff0c\u6211\u8fd8\u7ed9\u5b83\u52a0\u4e86\u4e2a\u5b9a\u65f6\u5668\u554a\u54c8\u54c8\u54c8\uff0c\u56e0\u4e3a\u6211\u60f3\u8ba9showLoading\u52a0\u8f7d\u5f39\u7a97\u8f6c\u4e00\u8f6c\uff0c\u8ba9\u7528\u6237\u77e5\u9053\u4e0a\u62c9\u5237\u65b0\u6570\u636e\u3002\u56e0\u4e3a\u6ca1\u52a0\u7684\u65f6\u5019showLoading\u4e00\u95ea\u800c\u8fc7\uff0c\u611f\u89c9\u4f53\u9a8c\u6548\u679c\u4e0d\u597d\u3002<\/p>\n<p>\u6700\u540escroll-view\u4f7f\u7528\u7ad6\u5411\u6eda\u52a8\u65f6\uff0c\u9700\u8981\u7ed9&lt;scroll-view&gt;&lt;\/scroll-view&gt;\u4e00\u4e2a\u56fa\u5b9a\u9ad8\u5ea6\uff08height:93%\uff09\uff0c\u518d\u7ed9page\u8bbe\u7f6e\u9ad8\u5ea6\uff08height:100%\uff09\uff0c\u5426\u5219bindscrolltolower\u89e6\u53d1\u4e0d\u4e86<\/p>\n<pre>&lt;scroll-view&gt;&lt;\/scroll-view&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6765\u4e00\u6bb5\u903b\u8f91\u7684\u4ee3\u7801<\/p>\n<pre>&nbsp;&nbsp;\/\/\u4e0a\u62c9\u52a0\u8f7d\u5206\u9875\n&nbsp;&nbsp;getMore(e){\n&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;that&nbsp;=&nbsp;this;\n&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;user&nbsp;=&nbsp;wx.getStorageSync('bizUser');\n&nbsp;&nbsp;&nbsp;&nbsp;wx.showLoading({\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title:&nbsp;'\u6b63\u5728\u52a0\u8f7d\u4e2d',\n&nbsp;&nbsp;&nbsp;&nbsp;});\n&nbsp;&nbsp;&nbsp;&nbsp;setTimeout(function(){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;pageindex&nbsp;=&nbsp;that.data.curPage;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;student&nbsp;=&nbsp;that.data.student;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(pageindex&amp;gt;=1){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++pageindex;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wx.request({\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url:&nbsp;app.url&nbsp;+&nbsp;'',\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data:&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;schoolId:&nbsp;user.schoolId,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pageSize:&nbsp;10,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;curPage:pageindex\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;method:&nbsp;'GET',\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success:function(res){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(res.data.data)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;studentLength&nbsp;=&nbsp;(res.data.data&nbsp;instanceof&nbsp;Array)&nbsp;?&nbsp;res.data.data.length&nbsp;:&nbsp;0;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u5217\u8868\u4e0a\u62c9\u52a0\u8f7d\u7684\u5b9e\u73b0\u65b9\u6cd5\uff08\u9644\u4ee3\u7801\uff09\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>\u672c\u7bc7\u6587\u7ae0\u7ed9\u5927\u5bb6\u5e26\u6765\u7684\u5185\u5bb9\u662f\u5173\u4e8e\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u5217\u8868\u4e0a\u62c9\u52a0\u8f7d\u7684\u5b9e\u73b0\u4ee3\u7801\uff0c\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u6709\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\u3002 \u67d0\u4e2a\u9875\u9762\uff0c\u6709\u591a\u4e2a\u5217\u8868\uff0c\u5982100\u884c\uff0c\u8fd9\u65f6\u9700\u8981\u5b9e\u73b0\u5206\u9875\u529f\u80fd\uff0c\u624b\u673a\u7aef\u7684\u5206\u9875\u4e00\u822c\u90fd\u662f\u6ed1\u5230\u5e95\u90e8\u65f6\u4e0a\u62c9\u5237\u65b0\u3002 \u4f7f\u7528scroll-view\u5b9e\u73b0\uff0c\u5176bindscrolltolower\u65b9\u6cd5\uff1a\u6eda\u52a8\u5230\u5e95\u90e8\/\u53f3\u8fb9\u89e6\u53d1\u3002\u5f53\u89e6\u53d1\u65f6\u53d1\u9001\u8bf7\u6c42\u83b7\u53d6\u65b0\u7684\u6570\u636e\uff0c\u6211\u5199\u7684\u65f6\u5019\u83b7\u53d6\u7684\u6570\u636e\u5f88\u5feb\uff0c\u6211\u8fd8\u7ed9\u5b83\u52a0\u4e86\u4e2a\u5b9a\u65f6\u5668\u554a\u54c8\u54c8\u54c8\uff0c\u56e0\u4e3a\u6211\u60f3\u8ba9showLoading\u52a0\u8f7d\u5f39\u7a97\u8f6c\u4e00\u8f6c\uff0c\u8ba9\u7528\u6237\u77e5\u9053\u4e0a\u62c9\u5237\u65b0\u6570\u636e\u3002\u56e0\u4e3a\u6ca1\u52a0\u7684\u65f6\u5019showLoading\u4e00\u95ea\u800c\u8fc7\uff0c\u611f\u89c9\u4f53\u9a8c\u6548\u679c\u4e0d\u597d\u3002 \u6700\u540escroll-view\u4f7f\u7528\u7ad6\u5411\u6eda\u52a8\u65f6\uff0c\u9700\u8981\u7ed9&lt;scroll-view&gt;&lt;\/scroll-view&gt;\u4e00\u4e2a\u56fa\u5b9a\u9ad8\u5ea6\uff08height:93%\uff09\uff0c\u518d\u7ed9page\u8bbe\u7f6e\u9ad8\u5ea6\uff08height:100%\uff09\uff0c\u5426\u5219bindscrolltolower\u89e6\u53d1\u4e0d\u4e86 &lt;scroll-view&gt;&lt;\/scroll-view&gt; \u767b\u5f55\u540e\u590d\u5236 \u6765\u4e00\u6bb5\u903b\u8f91\u7684\u4ee3\u7801 &nbsp;&nbsp;\/\/\u4e0a\u62c9\u52a0\u8f7d\u5206\u9875 &nbsp;&nbsp;getMore(e){ &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;that&nbsp;=&nbsp;this; &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;user&nbsp;=&nbsp;wx.getStorageSync(&#8216;bizUser&#8217;); &nbsp;&nbsp;&nbsp;&nbsp;wx.showLoading({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title:&nbsp;&#8216;\u6b63\u5728\u52a0\u8f7d\u4e2d&#8217;, &nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;setTimeout(function(){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;pageindex&nbsp;=&nbsp;that.data.curPage; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;student&nbsp;=&nbsp;that.data.student; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(pageindex&amp;gt;=1){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++pageindex; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wx.request({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url:&nbsp;app.url&nbsp;+&nbsp;&#8221;, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data:&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;schoolId:&nbsp;user.schoolId, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pageSize:&nbsp;10, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;curPage:pageindex &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;method:&nbsp;&#8216;GET&#8217;, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success:function(res){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(res.data.data)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;studentLength&nbsp;=&nbsp;(res.data.data&nbsp;instanceof&nbsp;Array)&nbsp;?&nbsp;res.data.data.length&nbsp;:&nbsp;0; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp; \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u5217\u8868\u4e0a\u62c9\u52a0\u8f7d\u7684\u5b9e\u73b0\u65b9\u6cd5\uff08\u9644\u4ee3\u7801\uff09\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-28552","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28552","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=28552"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28552\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}