<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
})
}
}
}));