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
30534db5
Commit
30534db5
authored
Sep 26, 2021
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
轮播图显示条件
parent
284341e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
static/nativeComponents/Banner/index.js
+10
-1
static/nativeComponents/Banner/index.wxml
+3
-3
No files found.
static/nativeComponents/Banner/index.js
View file @
30534db5
...
...
@@ -23,9 +23,18 @@ Component({
duration
:
500
,
activeIndex
:
0
,
bannerHeight
:
0
,
firstLoad
:
false
,
firstLoad
:
false
,
newArr
:
[],
},
ready
()
{
console
.
log
(
'----------------------30'
)
this
.
setData
({
'newArr'
:
this
.
newList
()})
console
.
log
(
this
.
data
.
newArr
,
this
.
newList
(),
'--------32'
)
},
methods
:
{
newList
(){
return
this
.
data
.
datas
.
componentData
.
imgList
.
filter
(
item
=>
item
.
visible
==
undefined
||
item
.
visible
==
1
)
||
[]
},
customMethod
()
{
console
.
log
(
"hello world! I am learning 微信小程序"
);
},
...
...
static/nativeComponents/Banner/index.wxml
View file @
30534db5
...
...
@@ -11,7 +11,7 @@
bindchange="bannerChange"
style="height:{{bannerHeight}}"
>
<block wx:for="{{
datas.componentData.imgList
}}" wx:key="index">
<block wx:for="{{
newArr
}}" wx:key="index">
<swiper-item data-item="{{item}}" bindtap="onClick">
<view class="swiper-item">
<image
...
...
@@ -25,10 +25,10 @@
</swiper-item>
</block>
</swiper>
<view class="dots">
<view class="dots"
wx:if="{{newArr.length>1}}"
>
<view
class="dotsItem {{index==activeIndex?'isDotsColor':''}} {{datas.componentData.indStyle == 'flat'?'dotsStyle1':'dotsStyle2'}} {{datas.componentData.indBorderShow==true?'dotBorder':''}}"
wx:for="{{
datas.componentData.imgList
}}"
wx:for="{{
newArr
}}"
wx:key="index"
></view>
</view>
...
...
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