微信小程序实现滑动翻页效果,效果图如下所示:
源码:
<view class="mainFrame">
<swiper class="container" indicator-dots="{{indicatorDots}}" indicator-dots="{{indicatordots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{xinwen_list}}" wx:for-index="index">
<swiper-item class="vol-swiper-item" bindtap="onItemClick">
<view class="vol-meta-title">
<image class="icon_right" src="/UploadFiles/2021-04-02/左.png">
js
var Api = require("../../utils/api.js")
var ARR_NEWS_DATA=[]
Page({
data: {
hidden: false,
xinwen_list: [],
indicatorDots: false,
autoplay: false,
interval: 2000,
indicatordots: true,
duration: 1000
},
onLoad: function () {
var that = this;
var videoUrl = Api.Url + "&isvideo=1"
Api.fetchGet(videoUrl, (err, res) => {
for (var i = 0; i < 14; i++) {
res.data[i].inputtime = Api.js_date_time(res.data[i].inputtime)
ARR_NEWS_DATA.push(res.data[i])
}
that.setData({
hidden: true,
xinwen_list: ARR_NEWS_DATA,
})
})
},
onPostTap: function (event) {
var postId = event.currentTarget.dataset.id;
wx.navigateTo({
url: "../video/video-listdetails" + postId
})
},
onShareAppMessage: function () {
return {
title: '柳州1号+ 视听页面',
path: 'pages/video/video'
}
}
})
css
.mainFrame {
margin-top: 0rpx;
height: 100%;
display: flex;
flex-direction: column;
border: 0px solid #ebebeb;
}
.container {
height: 1135rpx;
padding-top: 0px;
background: #b3d4db
}
.icon_right{
height: 30px;
width: 30px;
padding-right: 60rpx;
}
.icon_left{
height: 30px;
width: 30px;
padding-left: 60rpx;
}
.vol-swiper-item {
box-sizing: border-box;
padding-left: 30rpx;
padding-right: 30rpx;
}
.title {
display: block;
width: 100%;
height: 50px;
color: #f00;
}
.time {
font-size: 22rpx;
text-align: right;
color: #ccc;
}
.vol-card {
/*parent layout and this inner padding*/
padding: 20rpx;
height: 965rpx;
border: 2px solid #ebebeb;
border-radius: 5px;
box-shadow: 5px 5px 5px #c0c0c0;
background: #fff;
margin-top: 0px;
}
.vol-swiper {
height: 100%;
}
.vol-picture {
width: 100%;
}
.vol-meta-title {
margin-top: 5px;
text-align: center;
padding: 10rpx 5rpx;
font-size: 17px;
color: #000;
font-family: 'KaiTi';
}
.vol-meta-time {
padding: 10rpx 5rpx;
font-size: 12px;
padding-right: 5px;
color: #888;
}
.vol-content {
margin-top: 15rpx;
padding: 0 5rpx;
font-size: 14px;
line-height: 1.4;
font-family: 'KaiTi';
color: #9c9c9c;
}
.vol-content-text {
margin-top: 5px;
width: 100%;
min-height: 200rpx;
display: inline-block;
text-indent: 2em;
}
.vol-makettime {
font-size: 13px;
color: #888;
text-align: right;
}
总结
以上所述是小编给大家介绍的微信小程序实现滑动翻页效果,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
暂无“微信小程序实现滑动翻页效果(完整代码)”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新动态
2025年10月25日
2025年10月25日
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]
