Commit 8388b1bf by 李嘉林

图片填充方式

parent c52c7717
......@@ -21,7 +21,8 @@ const componentOptions = {
// 组件数据
data: {
isPageHidden: false, // 页面是否处于隐藏状态
timeData: {}
timeData: {},
imgFillType: "widthFix",
},
// 数据监听器
observers: {},
......@@ -29,11 +30,20 @@ const componentOptions = {
methods: {
init() {
let datas = this.data.datas
let { imgFillType } = this.data;
if(datas.componentData.angleSignImg && datas.componentData.angleSignImg.lenght != 0){
datas.componentData.angleSignImg = DFSImg(datas.componentData.angleSignImg,150,150,1)
}
if (datas.componentData.style === 'rowList' || datas.componentData.style === 'heap') {
imgFillType = "aspectFit"
} else if (datas.componentData.style == 'waterfall' && datas.componentData.imgShowMode == "1") {
imgFillType = "aspectFill"
} else {
imgFillType = "widthFix"
}
this.setData({
datas
datas,
imgFillType
})
log.info('datas');
},
......
......@@ -68,16 +68,16 @@
<!-- 商品主图 -->
<image
lazy-load
mode="{{datas.componentData.style==='rowList' || datas.componentData.style==='heap'?'aspectFit':'widthFix'}}"
class="productImgUrl"
mode="{{imgFillType}}"
class="productImgUrl {{datas.componentData.imgShowMode == 1 && datas.componentData.style === 'waterfall'?'maxHeight':''}}"
binderror="errorFunction"
wx:if="{{datas.componentData.goodsImgType == 1}}"
src="{{items.productImgUrl}}"
/>
<image
lazy-load
mode="{{datas.componentData.style==='rowList' || datas.componentData.style==='heap'?'aspectFit':'widthFix'}}"
class="productImgUrl"
mode="{{imgFillType}}"
class="productImgUrl {{datas.componentData.imgShowMode == 1 && datas.componentData.style === 'waterfall'?'maxHeight':''}}"
binderror="errorFunction"
wx:else
src="{{items.coverImage}}"
......
......@@ -78,6 +78,9 @@ align-items: flex-start;
width: 100%;
height: 100%;
}
.maxHeight{
height: 48vw!important;
}
.goodsPicture .saleWay{
position: absolute;
bottom: 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment