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
8d1acbab
Commit
8d1acbab
authored
Jul 06, 2021
by
chengzhichun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片画廊瀑布流
parent
b32dbfe9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
2 deletions
+69
-2
static/nativeComponents/PhotoGallery/index.js
+32
-2
static/nativeComponents/PhotoGallery/index.wxml
+12
-0
static/nativeComponents/PhotoGallery/index.wxss
+25
-0
No files found.
static/nativeComponents/PhotoGallery/index.js
View file @
8d1acbab
...
@@ -32,16 +32,46 @@ Component({
...
@@ -32,16 +32,46 @@ Component({
}
}
],
],
imgArr
:
[],
imgArr
:
[],
lenI
:
0
lenI
:
0
,
WaterfallFlowListL
:
[],
WaterfallFlowListR
:
[]
},
},
ready
(){
ready
(){
console
.
log
(
this
.
data
.
datas
.
componentData
.
paddingList
,
'this.data.datas.componentData.paddingList'
)
if
(
this
.
data
.
datas
.
componentData
.
paddingList
){
if
(
this
.
data
.
datas
.
componentData
.
paddingList
){
this
.
setData
({
this
.
setData
({
getPaddingList
:
this
.
data
.
datas
.
componentData
.
paddingList
getPaddingList
:
this
.
data
.
datas
.
componentData
.
paddingList
})
})
}
}
if
(
this
.
data
.
datas
.
componentData
.
style
==
'waterfall'
){
console
.
log
(
this
.
data
.
datas
.
componentData
,
'图片画廊waterfall'
)
let
list
=
this
.
data
.
datas
.
componentData
.
imgList
let
WaterfallFlowListL
=
[]
let
WaterfallFlowListR
=
[]
this
.
setData
({
WaterfallFlowListL
:
[],
WaterfallFlowListR
:
[]
})
list
.
forEach
(((
item
,
index
)
=>
{
if
(
index
%
2
==
0
)
{
WaterfallFlowListL
.
push
(
item
)
}
else
{
WaterfallFlowListR
.
push
(
item
)
}
}))
this
.
setData
({
[
'WaterfallFlowListL'
]:
WaterfallFlowListL
,
[
'WaterfallFlowListR'
]:
WaterfallFlowListR
})
console
.
log
(
this
.
data
.
WaterfallFlowListL
,
this
.
data
.
WaterfallFlowListR
,
'图片画廊数据'
)
}
this
.
data
.
datas
.
componentData
.
imgList
.
forEach
((
item
,
index
)
=>
{
this
.
data
.
datas
.
componentData
.
imgList
.
forEach
((
item
,
index
)
=>
{
this
.
setData
({
this
.
setData
({
...
...
static/nativeComponents/PhotoGallery/index.wxml
View file @
8d1acbab
...
@@ -21,4 +21,16 @@
...
@@ -21,4 +21,16 @@
</view>
</view>
</view>
</view>
</view>
</view>
<view wx:elif="{{datas.componentData.style==='waterfall'}}" class="waterfall">
<view class="waterfall-l">
<view wx:for="{{WaterfallFlowListL}}" :wx:key="index" class="item">
<image src="{{item.imageUrl}}" mode="widthFix"></image>
</view>
</view>
<view class="waterfall-r">
<view wx:for="{{WaterfallFlowListR}}" :wx:key="index" class="item">
<image src="{{item.imageUrl}}" mode="widthFix"></image>
</view>
</view>
</view>
</view>
</view>
static/nativeComponents/PhotoGallery/index.wxss
View file @
8d1acbab
...
@@ -54,3 +54,27 @@
...
@@ -54,3 +54,27 @@
-webkit-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
transform: rotate(180deg)
transform: rotate(180deg)
}
}
.waterfall{
overflow: hidden;
padding: 0 10px;
}
.waterfall-l{
width: 50%;
float: left;
box-sizing: border-box;
padding-right: 4px;
}
.waterfall-r{
width: 50%;
float: right;
box-sizing: border-box;
padding-left: 4px;
}
.waterfall .item{
background-color: #999;
margin-bottom: 8px;
}
\ No newline at end of file
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