Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
8388b1bf
Commit
8388b1bf
authored
Sep 26, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片填充方式
parent
c52c7717
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
static/nativeComponents/GoodsList/GoodsItem/index.js
+12
-2
static/nativeComponents/GoodsList/GoodsItem/index.wxml
+4
-4
static/nativeComponents/GoodsList/GoodsItem/index.wxss
+3
-0
No files found.
static/nativeComponents/GoodsList/GoodsItem/index.js
View file @
8388b1bf
...
...
@@ -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'
);
},
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxml
View file @
8388b1bf
...
...
@@ -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}}"
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxss
View file @
8388b1bf
...
...
@@ -78,6 +78,9 @@ align-items: flex-start;
width: 100%;
height: 100%;
}
.maxHeight{
height: 48vw!important;
}
.goodsPicture .saleWay{
position: absolute;
bottom: 0;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment