Commit 8388b1bf by 李嘉林

图片填充方式

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