小程序-公告滚动

server/2024/10/18 19:27:24/

 

<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,
},

 


http://www.ppmy.cn/server/104409.html

相关文章

google transalte api的使用,V2服务账户方式(google-cloud-java)

Google Cloud Translation API 有几个不同的使用方式&#xff0c;其中之一是使用最新的 Google Cloud Client Library。这些库提供了简化的 API&#xff0c;使得与 Google Cloud 服务的交互变得更加容易。 对于gcp平台的创建方式&#xff0c;我记得得绑定真信用卡了&#xff0c…

Android笔试面试题AI答之Kotlin(17)

文章目录 80. 阐述 inline class内联类的开销&#xff1f;1. 编译时开销2. 运行时开销3. 可维护性和可读性结论 81. Kotlin是如何解决空指针(NPE)问题的 &#xff1f;82. Kotlin中的Compaion Object的作用 &#xff1f;主要用途如何定义注意事项 83. 详细描述 Koltin by lazy工…

《Web项目跨域请求后端Api设置Cookie失败问题?》

问题描述&#xff1a; 在web项目中跨域请求api时&#xff0c;api登录成功后需要向域名中设置cookie实现在两个域名下共享&#xff0c;但是登录接口返回成功&#xff0c;响应头中也有set-cookie&#xff0c;实际却无法设置到cookie中… web项目访问时的域名https://b.com/ api所…

adb 获取手机电池信息与修改恢复

一、获取电池信息 1.1 命令&#xff1a; adb shell dumpsys battery 示例&#xff1a; adb shell dumpsys battery Current Battery Service state:AC powered: falseUSB powered: trueWireless powered: falseMax charging current: 500000status: 2health: 2present: true…

XSS-复现dom破坏案例和靶场

目录 xss注入原理&#xff1a; xss是什么&#xff1f; xss原理&#xff1a; DOM&#xff1a; 闯关&#xff1a; 第一关&#xff1a;Ma Spaghet! 源码&#xff1a; 要求&#xff1a; 分析&#xff1a; 第二关&#xff1a; Jefff 源码&#xff1a; 要求&#xff1a; …

vue3+ts+vant4 列表下拉刷新+分页加载

效果图 主要代码&#xff1a; <van-pull-refreshv-model"refreshing"refresh"handleRefresh"pulling-text"下拉释放刷新"loosing-text"下拉释放刷新"loading-text"加载中"><van-listv-model:loading"loading…

【C++】static

C中的static 说起static&#xff0c;一般想到它的作用是延长变量的生命周期&#xff0c;如果只是这样那么它跟全局变量有什么区别呢&#xff1f; 在C之前&#xff0c;C语言就有static了&#xff0c;C的static作用很简单&#xff0c;就是不让其他文件的访问自己的全局变量。 C中…

Java编程:单一职责原则

单一职责原则&#xff08;SRP&#xff09;在面向对象设计领域占据核心地位&#xff0c;它是SOLID五大原则的关键一环。 这些原则共同目的是提升软件的易维护性和扩展性。 按照SRP&#xff0c;每个类的构建应专注于一个变化因子。 在软件工程实践中&#xff0c;单一职责原则作为…