zoukankan      html  css  js  c++  java
  • 小程序轮播图显示三个数据

    //专家团队
    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='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>
  • 相关阅读:
    jvm 优化
    SqlServer体系结构
    sqlserver2012 在视图中建索引
    win10 桌面设置为远程桌面
    ORACLE 查询某表中的某个字段的类型,是否为空,是否有默认值等
    activemq读取剩余消息队列中消息的数量
    Oracl 一条sql语句 批量添加、修改数据
    ClickOnce一项Winform部署
    C#语言中的修饰符
    关于MySQL集群的一些看法
  • 原文地址:https://www.cnblogs.com/isuansuan/p/9888541.html
Copyright © 2011-2022 走看看