非scroll-view的纵向滑动

      <movable-area style="height:700rpx;width: 714rpx;overflow: hidden;">
        <movable-view inertia="true" direction="vertical" style="display: flex;justify-content: space-between;flex-wrap: wrap;width:714rpx;height:{{377*length}}rpx; ">
          <view a:for="{{bannerArray}}" style="margin-bottom:20rpx;width:350rpx;height:357rpx;background-image:url({{item.image}});background-size:100% 100%;">
          </view>
        </movable-view>
      </movable-area>
import { enhanceComponent } from 'tb-shop-enhance';

Component(enhanceComponent({
  data: {
    length: 0,
    flag: true,
    current: -1
  },

  onInit() {
    // mock数据需要修改client文件夹中的page文件
    // 正常运行过程中模块总是默认传入data参数
  },

  didMount() {
    // 加载成功后可以异步获取数据更新数据展示,例如请求接口等操作
    const { gdc = {}, mds = {}, modUtils } = this.props.data;
    this.setData({
      bannerArray: mds.moduleData.imageList,
    })

    if (this.data.bannerArray.length % 2 == 0) {
      this.setData({
        length: this.data.bannerArray.length / 2
      })
    } else {
      this.setData({
        length: Math.ceil(this.data.bannerArray.length / 2)
      })
    }

  },

  methods: {
    open(e) {
      console.log(e.currentTarget.dataset.index)
      this.setData({
        flag: !this.data.flag,
        current: e.currentTarget.dataset.index
      })
    }
  }
}));


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值