当前位置: 首页> 娱乐> 明星 > 小程序-公告滚动

小程序-公告滚动

时间:2025/7/9 7:17:59来源:https://blog.csdn.net/weixin_42941628/article/details/141421851 浏览次数:0次

 

<view class="bg_box icon_nav_box" style="margin-top: -70rpx;position: relative;"><view class="flex flex_y_center"><view class="c_red f32" style="font-style: italic;flex-shrink:0 ;">最新公告</view><view class="c_colum" style="line-height: 60rpx;height: 60rpx;overflow-y: hidden;position: relative;"> <view class="notice_main" style="top: {{notice_top}}rpx;"><block wx:for="{{notice_list}}"><view  class="ml15 lineText">{{item.title}}</view></block></view></view></view>
</view>.icon_nav_box .item{flex: 1;}
.icon_nav_box .icon{width: 100rpx;}
noticeScoll(){//公告滚动let that = this;let curindex = 0;setInterval(() => {let top = that.data.notice_top;let notice_list = that.data.notice_list;if(curindex < notice_list.length-1){curindex = curindex+1;that.setData({notice_top: top - 60})}else{curindex = 0;that.setData({notice_top: 0,})}}, 3000);},data: {notice_list:[{title:"商城上线啦农资上线啦1",},{title:"商城上线啦农资商城上线啦农资商城上线啦2",},{title:"商城上线啦资商城上线啦农资商城上线啦3",},{title:"商城上线啦啦农资商城上线啦4",},{title:"商城上上线啦5",},{title:"商城上线啦农啦农资商城上线啦6",},],notice_top:0,
},

 

关键字:小程序-公告滚动

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: