小程序轮播图显示三个数据

//专家团队
getZhuanjia: function () {
var that = this;
app.util.request({
"url": "entry/wxapp/YuZhuanjia",
success: function (res) {
var big = res.data.data;
var length = big.length;
var num = parseInt(length / 3);
var arr = [];
for (var i = 0; i < num; i++) {
var ar = [];
for (var j = 0; j < 3; j++) {
ar.push(big[j])
}
arr.push(ar)
}
if (length % 3 != 0) {
var ar = []
for (var k = (num * 3); k < length; k++) {
ar.push(big[k])
}
arr.push(ar)
}
that.setData({
expert: arr
})
// WxParse.wxParse('jianjie', 'html', res.data.data.z_jianjie, that, 5);
}
})
},
 
 
 
<view class='bsbb p30 bgcf'>
<swiper class='h500' current='{{current}}' bindchange='nav'>
<block wx:for="{{expert}}" wx:key="unique" wx:for-item="items">
<swiper-item class="bsbb pt30 pb30">
<view class='df'>
<block wx:for="{{items}}" wx:key="unique">
<view class='df fdc aic jcc mr30' data-z_id="{{item.z_id}}" bindtap='doctorDetailClick'>
<view class='pr'>
<view>
<image mode='widthFix' style='width:210rpx;' src='../images/doctor_bg.png'></image>
</view>
<view class='pa doctor-img w df aife jcfe'>
<image mode='widthFix' src='{{item.z_thumbs}}'></image>
</view>
</view>
<view class='fs32 c6 mt20'>{{item.z_name}}</view>
<view class='fs24 c6 fw3 mt10'>{{item.z_zhicheng}}</view>
<view>
<button class='bdn bdc_sec c_sec fs24 fw3 h40 mt10'>详细了解</button>
</view>
</view>
</block>
</view>
</swiper-item>
</block>
</swiper>
<view class='df aic jcc'>
<block wx:for="{{expert}}" wx:key="unique">
<view class='cir mr20 bdr50 {{current == index ? "bgc_sec":"bgceb"}}'></view>
</block>
</view>
</view>

 

转载于:https://www.cnblogs.com/isuansuan/p/9888541.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值