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>
  • 相关阅读:
    My SqL 常用命令
    RGB颜色查询对照表
    Android 对话框(Dialog)大全
    【转】Android一些知识点汇总
    Google Maps API v2密钥申请
    蓝牙中文API文档
    IOS 电商类app 第一版架构 改进
    ios 开发小记 (四)
    ios 深度复制 copy & mutablecopy
    CCS绘制成的三角形箭头
  • 原文地址:https://www.cnblogs.com/isuansuan/p/9888541.html
Copyright © 2011-2022 走看看