這篇文章將為大家詳細(xì)講解有關(guān)怎么在微信小程序中實(shí)現(xiàn)一個(gè)滑動(dòng)翻頁(yè)效果,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對(duì)相關(guān)知識(shí)有一定的了解。

創(chuàng)新互聯(lián)服務(wù)項(xiàng)目包括長(zhǎng)興網(wǎng)站建設(shè)、長(zhǎng)興網(wǎng)站制作、長(zhǎng)興網(wǎng)頁(yè)制作以及長(zhǎng)興網(wǎng)絡(luò)營(yíng)銷策劃等。多年來(lái),我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢(shì)、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,長(zhǎng)興網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到長(zhǎng)興省份的部分城市,未來(lái)相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
<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="../../image/左.png"></image>
<text class="vol-number">來(lái)源:{{item.copyfrom}}</text>
<image class="icon_left" src="../../image/右.png"></image>
</view>
<view class="vol-card" data-id="{{item.id}}" catchtap="onPostTap">
<!--<view data-detail-href="{{item.detailHref}}" rel="external nofollow" class="item">-->
<!--圖片-->
<image class="vol-picture" src="{{item.images[0]}}" mode="aspectFill"></image>
<!--標(biāo)題-->
<view class="vol-meta-title">
<text class="vol-number">{{item.title}}</text>
</view>
<!--時(shí)間-->
<view class="vol-meta-time">
<text>{{item.inputtime}}</text>
</view>
<!--描述信息-->
<view class="vol-content">
<text class="vol-content-text">{{item.description}}</text>
</view>
<!--</view>-->
</view>
</swiper-item>
</block>
</swiper>
</view>
<loading hidden="{{hidden}}" bindchange="loadingChange">
加載中...
</loading>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?id=" + postId
})
},
onShareAppMessage: function () {
return {
title: '柳州1號(hào)+ 視聽(tīng)頁(yè)面',
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;
}關(guān)于怎么在微信小程序中實(shí)現(xiàn)一個(gè)滑動(dòng)翻頁(yè)效果就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到。
網(wǎng)站欄目:怎么在微信小程序中實(shí)現(xiàn)一個(gè)滑動(dòng)翻頁(yè)效果
文章來(lái)源:http://chinadenli.net/article48/pphshp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)、虛擬主機(jī)、網(wǎng)站策劃、微信公眾號(hào)、品牌網(wǎng)站制作、用戶體驗(yàn)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)