{"id":32221,"date":"2024-11-25T08:15:21","date_gmt":"2024-11-25T00:15:21","guid":{"rendered":"https:\/\/fwq.ai\/blog\/32221\/"},"modified":"2024-11-25T08:15:21","modified_gmt":"2024-11-25T00:15:21","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%ae%9e%e4%be%8b%ef%bc%9a%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e8%b7%91%e9%a9%ac%e7%81%af%e7%9a%84%e5%8a%a8%e7%94%bb%e6%95%88%e6%9e%9c%ef%bc%88%e9%99%84","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/32221\/","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b\uff1a\u5982\u4f55\u5b9e\u73b0\u8dd1\u9a6c\u706f\u7684\u52a8\u753b\u6548\u679c\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\u5b9e\u4f8b\uff1a\u5982\u4f55\u5b9e\u73b0\u8dd1\u9a6c\u706f\u7684\u52a8\u753b\u6548\u679c\uff08\u9644\u4ee3\u7801\uff09\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>\u4e00\uff1a\u529f\u80fd\u4ecb\u7ecd\u53ca\u8bb2\u89e3<\/p>\n<p>\u5b9e\u73b0\u7684\u8dd1\u9a6c\u706f\uff08\u8dd1\u9a6c\u706f\u91cc\u9762\u663e\u793a\u6587\u7ae0\u7684title\uff09\u7684\u6548\u679c\uff0c\u5e76\u5728\u53f3\u4fa7\u6709\u4e2a\u67e5\u770b\u6587\u7ae0\u7684\u6309\u94ae\uff0c\u6309\u94ae\u7ed1\u5b9a\u5f53\u524d\u7684\u8dd1\u9a6c\u706f\u4fe1\u606f\u7684id\uff0c\u70b9\u51fb\u6309\u94ae\u540e\u6839\u636eid\u8df3\u8f6c\u5230\u76f8\u5e94\u7684\u6587\u7ae0\u8be6\u60c5\u9875\uff1b<\/p>\n<p>\u8fd9\u91cc\u503c\u5f97\u6ce8\u610f\u7684\u70b9\u662f\u6211\u7528\u4e86swiper\u7ec4\u4ef6\u7684 bindchange \u4e8b\u4ef6\u6765\u83b7\u53d6\u5230\u5f53\u524d\u4fe1\u606f\u7684\u6570\u7ec4\u4e0b\u6807\uff0c\u5b9e\u73b0\u4e86\u52a8\u6001\u6539\u53d8\u67e5\u770b\u6309\u94ae\u7ed1\u5b9a\u4fe1\u606fid\u503c\u7684\u6548\u679c\uff1b<\/p>\n<p>\u4e8c\uff1a\u5b8c\u6574\u6e90\u7801<\/p>\n<p>1.\u5c01\u88c5\u6210\u4e00\u4e2a\u7ec4\u4ef6\uff1a<\/p>\n<\/p>\n<pre>&lt;!-- \/\/\u6eda\u52a8 --&gt; \n&lt;template name=\"roll\"&gt; \n &lt;block&gt; \n   &lt;navigator url='..\/details\/details2\/detail2?artical_id={{newsId}}'&gt; \n    &lt;view class='chakan'&gt;\u67e5\u770b&lt;\/view&gt; \n   &lt;\/navigator&gt; \n  &lt;view class='sx_lunbo page_row'&gt; \n   &lt;text class='red'&gt;\u516c\u544a&lt;\/text&gt; \n   &lt;swiper class='sx_swiper page_row' autoplay interval=\"5000\" duration=\"3000\" bindchange=\"newsId\" data-newsId='{{item.id}}' circular&gt; \n    &lt;swiper-item wx:for=\"{{news}}\" wx:key=\"\"&gt; \n     &lt;view class='reds'&gt;{{item.title}} \n     &lt;\/view&gt; \n    &lt;\/swiper-item&gt; \n   &lt;\/swiper&gt; \n  &lt;\/view&gt; \n &lt;\/block&gt; \n&lt;\/template&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<\/p>\n<pre>.sx_lunbo { \n width: 100%; \n height: 60rpx; \n border-bottom: solid 1px #eee; \n} \n.chakan{ \n padding-left: 25rpx; \n right: 20rpx; \n clear: both; \n position:absolute;  \n height: 40rpx; \n margin-top: 10rpx; \n color: #f63; \n border:solid 1px #f63; \n border-radius:5rpx; \n padding: 0rpx 10rpx 0rpx 10rpx; \n font-size: 28rpx \n} \n.sx_swiper { \n width: 550rpx; \n margin-top: 10rpx; \n} \n.sx_swiper swiper-item{ \n  height: 40rpx \n } \n.reds { \n overflow: hidden; \n text-overflow: ellipsis; \n white-space:nowrap; \n width:500rpx; \n font-size: 28rpx; \n height: 40rpx; \n} \n.red { \n font-size: 24rpx; \n color: white; \n width: 60rpx; \n height: 40rpx; \n line-height: 40rpx; \n background: blue; \n padding-left: 10rpx; \n margin: 10rpx; \n border-radius: 10rpx; \n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>2.\u5728\u9875\u9762\u8c03\u7528\uff1a<\/p>\n<\/p>\n<pre>&lt;import src=\"..\/template\/roll\/roll.wxml\" \/&gt; \n&lt;template is=\"roll\" data=\"{{news,newsId}}\" \/&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<\/p>\n<pre>@import \"..\/template\/roll\/roll.wxss\";<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<\/p>\n<pre>newsId: function (e) { \n var that = this \n var item = e.detail.current; \n this.setData({ \n  newsId:that.data.news[item].id \n }) \n},<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>3.news\u7684\u6570\u636e\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/009\/eca4421c71cd5b31e53f7b3525867411-1.png\" class=\"aligncenter\" title=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b\uff1a\u5982\u4f55\u5b9e\u73b0\u8dd1\u9a6c\u706f\u7684\u52a8\u753b\u6548\u679c\uff08\u9644\u4ee3\u7801\uff09\u63d2\u56fe\" alt=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b\uff1a\u5982\u4f55\u5b9e\u73b0\u8dd1\u9a6c\u706f\u7684\u52a8\u753b\u6548\u679c\uff08\u9644\u4ee3\u7801\uff09\u63d2\u56fe\" \/><\/p>\n<p>\u76f8\u5173\u63a8\u8350\uff1a<\/p>\n<\/p>\n<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b\uff1a\u5982\u4f55\u5b9e\u73b0\u8dd1\u9a6c\u706f\u7684\u52a8\u753b\u6548\u679c\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\u5b9e\u4f8b\uff1a\u5982\u4f55\u5b9e\u73b0\u8dd1\u9a6c\u706f\u7684\u52a8\u753b\u6548\u679c\uff08\u9644\u4ee3\u7801\uff09\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 \u4e00\uff1a\u529f\u80fd\u4ecb\u7ecd\u53ca\u8bb2\u89e3 \u5b9e\u73b0\u7684\u8dd1\u9a6c\u706f\uff08\u8dd1\u9a6c\u706f\u91cc\u9762\u663e\u793a\u6587\u7ae0\u7684title\uff09\u7684\u6548\u679c\uff0c\u5e76\u5728\u53f3\u4fa7\u6709\u4e2a\u67e5\u770b\u6587\u7ae0\u7684\u6309\u94ae\uff0c\u6309\u94ae\u7ed1\u5b9a\u5f53\u524d\u7684\u8dd1\u9a6c\u706f\u4fe1\u606f\u7684id\uff0c\u70b9\u51fb\u6309\u94ae\u540e\u6839\u636eid\u8df3\u8f6c\u5230\u76f8\u5e94\u7684\u6587\u7ae0\u8be6\u60c5\u9875\uff1b \u8fd9\u91cc\u503c\u5f97\u6ce8\u610f\u7684\u70b9\u662f\u6211\u7528\u4e86swiper\u7ec4\u4ef6\u7684 bindchange \u4e8b\u4ef6\u6765\u83b7\u53d6\u5230\u5f53\u524d\u4fe1\u606f\u7684\u6570\u7ec4\u4e0b\u6807\uff0c\u5b9e\u73b0\u4e86\u52a8\u6001\u6539\u53d8\u67e5\u770b\u6309\u94ae\u7ed1\u5b9a\u4fe1\u606fid\u503c\u7684\u6548\u679c\uff1b \u4e8c\uff1a\u5b8c\u6574\u6e90\u7801 1.\u5c01\u88c5\u6210\u4e00\u4e2a\u7ec4\u4ef6\uff1a &lt;!&#8211; \/\/\u6eda\u52a8 &#8211;&gt; &lt;template name=&#8221;roll&#8221;&gt; &lt;block&gt; &lt;navigator url=&#8217;..\/details\/details2\/detail2?artical_id={{newsId}}&#8217;&gt; &lt;view class=&#8217;chakan&#8217;&gt;\u67e5\u770b&lt;\/view&gt; &lt;\/navigator&gt; &lt;view class=&#8217;sx_lunbo page_row&#8217;&gt; &lt;text class=&#8217;red&#8217;&gt;\u516c\u544a&lt;\/text&gt; &lt;swiper class=&#8217;sx_swiper page_row&#8217; autoplay interval=&#8221;5000&#8243; duration=&#8221;3000&#8243; bindchange=&#8221;newsId&#8221; data-newsId='{{item.id}}&#8217; circular&gt; &lt;swiper-item wx:for=&#8221;{{news}}&#8221; wx:key=&#8221;&#8221;&gt; &lt;view class=&#8217;reds&#8217;&gt;{{item.title}} &lt;\/view&gt; &lt;\/swiper-item&gt; &lt;\/swiper&gt; &lt;\/view&gt; &lt;\/block&gt; &lt;\/template&gt; \u767b\u5f55\u540e\u590d\u5236 .sx_lunbo { width: 100%; height: 60rpx; border-bottom: solid 1px #eee; [&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-32221","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/32221","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=32221"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/32221\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=32221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=32221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=32221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}