|
|
|
@ -11,83 +11,84 @@ |
|
|
|
|
:style="{ |
|
|
|
|
zIndex: zIndex, |
|
|
|
|
backgroundColor: bgColor.header}"> |
|
|
|
|
<view |
|
|
|
|
class="wyb-drop-down-header-item" |
|
|
|
|
v-for="(item,index) in options" |
|
|
|
|
:key="item.header" |
|
|
|
|
@tap.stop="onHeaderTap(index)" |
|
|
|
|
:style="{fontSize: fontSize.header + 'rpx'}"> |
|
|
|
|
<text |
|
|
|
|
class="wyb-drop-down-header-item-label" |
|
|
|
|
<view class="headercontainer"> |
|
|
|
|
<view |
|
|
|
|
class="wyb-drop-down-header-item" |
|
|
|
|
v-for="(item,index) in options" |
|
|
|
|
:key="item.header" |
|
|
|
|
@tap.stop="onHeaderTap(index)" |
|
|
|
|
:style="{fontSize: fontSize.header + 'rpx'}"> |
|
|
|
|
<text |
|
|
|
|
class="wyb-drop-down-header-item-label" |
|
|
|
|
:style="{ |
|
|
|
|
fontWeight: headerActiveIndex === index && dropOver && activeWeight ? 'bold' : 'normal', |
|
|
|
|
color: headerActiveIndex === index && dropOver ? activeColor: defaultColor}">{{item.header}}</text> |
|
|
|
|
<text |
|
|
|
|
v-if="dropIcon === 'fill'" |
|
|
|
|
class="iconfont icon-down-fill wyb-drop-down-header-item-icon" |
|
|
|
|
:class="[headerActiveIndex === index && dropOver ? 'wyb-drop-down-header-item-icon-active' : '']" |
|
|
|
|
:style="{ |
|
|
|
|
fontSize: fontSize.header - 5 + 'rpx', |
|
|
|
|
color: headerActiveIndex === index && dropOver ? activeColor: defaultColor}" /> |
|
|
|
|
<text |
|
|
|
|
v-if="dropIcon==='line'" |
|
|
|
|
class="iconfont icon-down wyb-drop-down-header-item-icon" |
|
|
|
|
:class="[headerActiveIndex === index && dropOver ? 'wyb-drop-down-header-item-icon-active' : '']" |
|
|
|
|
:style="{ |
|
|
|
|
fontSize: fontSize.header - 5 + 'rpx', |
|
|
|
|
transformOrigin: '50% 45%', |
|
|
|
|
color: headerActiveIndex === index && dropOver ? activeColor: defaultColor}" /> |
|
|
|
|
<view class="wyb-drop-down-vline" v-if="index !== options.length - 1" /></view> |
|
|
|
|
</view> |
|
|
|
|
<u-search placeholder="输入搜索内容" |
|
|
|
|
:focus="false" |
|
|
|
|
@focus="clickHandle" |
|
|
|
|
@blur="blurHandle" |
|
|
|
|
:showAction="false" |
|
|
|
|
:class="disabled?'withSearch':'withSearch withSearchDisabled'" |
|
|
|
|
bgColor="#F3F5F7" |
|
|
|
|
@search="searchHandle" |
|
|
|
|
v-model="catagoryName"></u-search> |
|
|
|
|
<scroll-view |
|
|
|
|
v-if="dropDown" |
|
|
|
|
class="wyb-drop-down-content" |
|
|
|
|
:class="[dropOver ? 'wyb-drop-down-content-active' : '']" |
|
|
|
|
:scroll-y="scroll" |
|
|
|
|
:enable-flex="true" |
|
|
|
|
:scroll-anchoring="true" |
|
|
|
|
:style="{ |
|
|
|
|
fontWeight: headerActiveIndex === index && dropOver && activeWeight ? 'bold' : 'normal', |
|
|
|
|
color: headerActiveIndex === index && dropOver ? activeColor: defaultColor}">{{item.header}}</text> |
|
|
|
|
<text |
|
|
|
|
v-if="dropIcon === 'fill'" |
|
|
|
|
class="iconfont icon-down-fill wyb-drop-down-header-item-icon" |
|
|
|
|
:class="[headerActiveIndex === index && dropOver ? 'wyb-drop-down-header-item-icon-active' : '']" |
|
|
|
|
:style="{ |
|
|
|
|
fontSize: fontSize.header - 5 + 'rpx', |
|
|
|
|
color: headerActiveIndex === index && dropOver ? activeColor: defaultColor}" /> |
|
|
|
|
<text |
|
|
|
|
v-if="dropIcon==='line'" |
|
|
|
|
class="iconfont icon-down wyb-drop-down-header-item-icon" |
|
|
|
|
:class="[headerActiveIndex === index && dropOver ? 'wyb-drop-down-header-item-icon-active' : '']" |
|
|
|
|
:style="{ |
|
|
|
|
fontSize: fontSize.header - 5 + 'rpx', |
|
|
|
|
transformOrigin: '50% 45%', |
|
|
|
|
color: headerActiveIndex === index && dropOver ? activeColor: defaultColor}" /> |
|
|
|
|
<view class="wyb-drop-down-vline" v-if="index !== options.length - 1" /></view> |
|
|
|
|
zIndex: zIndex - 1, |
|
|
|
|
fontSize: fontSize.content + 'rpx', |
|
|
|
|
backgroundColor: bgColor.content, |
|
|
|
|
borderBottomLeftRadius: radius + 'px', |
|
|
|
|
borderBottomRightRadius: radius + 'px', |
|
|
|
|
minHeight: minHeight + 'rpx', |
|
|
|
|
height: autoHeight ? 'auto' : minHeight + 'rpx', |
|
|
|
|
maxHeight: autoHeight && maxHeight ? maxHeight + 'rpx' : 'auto'}"> |
|
|
|
|
<view class="wyb-drop-down-content-box" v-for="(item,index) in options" :key="contentBoxKey(index)"> |
|
|
|
|
<view v-if="item['custom'] && headerActiveIndex === index && dropDown" class="wyb-drop-down-content-slot"> |
|
|
|
|
<slot></slot> |
|
|
|
|
</view> |
|
|
|
|
<view |
|
|
|
|
v-if="!item['custom'] && headerActiveIndex === index && dropDown" |
|
|
|
|
class="wyb-drop-down-content-item" |
|
|
|
|
v-for="(content,zIndex) in item['contents']" |
|
|
|
|
:key="content" |
|
|
|
|
@tap.stop="onContentItemsTap(zIndex)"> |
|
|
|
|
<text |
|
|
|
|
class="wyb-drop-down-content-item-label" |
|
|
|
|
:style="{color: contentActiveIndexList[headerActiveIndex]['index'] === zIndex && dropOver ? activeColor: defaultColor}"> |
|
|
|
|
{{content}} |
|
|
|
|
</text> |
|
|
|
|
<text |
|
|
|
|
v-if="contentActiveIndexList[headerActiveIndex]['index'] === zIndex && dropOver" |
|
|
|
|
:style="{color: activeColor}" |
|
|
|
|
class="iconfont icon-selected wyb-drop-down-content-item-icon" /> |
|
|
|
|
<view class="wyb-drop-down-line" v-if="zIndex !== options[headerActiveIndex].contents.length - 1" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</scroll-view> |
|
|
|
|
</view> |
|
|
|
|
<u-search placeholder="输入搜索内容" |
|
|
|
|
:focus="false" |
|
|
|
|
@focus="clickHandle" |
|
|
|
|
@blur="blurHandle" |
|
|
|
|
:showAction="false" |
|
|
|
|
:class="disabled?'withSearch':'withSearch withSearchDisabled'" |
|
|
|
|
bgColor="#F3F5F7" |
|
|
|
|
@search="searchHandle" |
|
|
|
|
v-model="catagoryName"></u-search> |
|
|
|
|
<scroll-view |
|
|
|
|
v-if="dropDown" |
|
|
|
|
class="wyb-drop-down-content" |
|
|
|
|
:class="[dropOver ? 'wyb-drop-down-content-active' : '']" |
|
|
|
|
:scroll-y="scroll" |
|
|
|
|
:enable-flex="true" |
|
|
|
|
:scroll-anchoring="true" |
|
|
|
|
:style="{ |
|
|
|
|
zIndex: zIndex - 1, |
|
|
|
|
fontSize: fontSize.content + 'rpx', |
|
|
|
|
backgroundColor: bgColor.content, |
|
|
|
|
borderBottomLeftRadius: radius + 'px', |
|
|
|
|
borderBottomRightRadius: radius + 'px', |
|
|
|
|
minHeight: minHeight + 'rpx', |
|
|
|
|
height: autoHeight ? 'auto' : minHeight + 'rpx', |
|
|
|
|
maxHeight: autoHeight && maxHeight ? maxHeight + 'rpx' : 'auto'}"> |
|
|
|
|
<view class="wyb-drop-down-content-box" v-for="(item,index) in options" :key="contentBoxKey(index)"> |
|
|
|
|
<view v-if="item['custom'] && headerActiveIndex === index && dropDown" class="wyb-drop-down-content-slot"> |
|
|
|
|
<slot></slot> |
|
|
|
|
</view> |
|
|
|
|
<view |
|
|
|
|
v-if="!item['custom'] && headerActiveIndex === index && dropDown" |
|
|
|
|
class="wyb-drop-down-content-item" |
|
|
|
|
v-for="(content,zIndex) in item['contents']" |
|
|
|
|
:key="content" |
|
|
|
|
@tap.stop="onContentItemsTap(zIndex)"> |
|
|
|
|
<text |
|
|
|
|
class="wyb-drop-down-content-item-label" |
|
|
|
|
:style="{color: contentActiveIndexList[headerActiveIndex]['index'] === zIndex && dropOver ? activeColor: defaultColor}"> |
|
|
|
|
{{content}} |
|
|
|
|
</text> |
|
|
|
|
<text |
|
|
|
|
v-if="contentActiveIndexList[headerActiveIndex]['index'] === zIndex && dropOver" |
|
|
|
|
:style="{color: activeColor}" |
|
|
|
|
class="iconfont icon-selected wyb-drop-down-content-item-icon" /> |
|
|
|
|
<view class="wyb-drop-down-line" v-if="zIndex !== options[headerActiveIndex].contents.length - 1" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view |
|
|
|
@ -236,6 +237,7 @@ |
|
|
|
|
methods: { |
|
|
|
|
searchHandle(){ |
|
|
|
|
console.log(this.catagoryName,"uuu") |
|
|
|
|
this.$emit('getContent',this.catagoryName) |
|
|
|
|
}, |
|
|
|
|
clickHandle(){ |
|
|
|
|
this.disabled = false; |
|
|
|
@ -317,15 +319,19 @@ |
|
|
|
|
/* #endif */ |
|
|
|
|
left: 0; |
|
|
|
|
right: 0; |
|
|
|
|
display: flex; |
|
|
|
|
/* display: flex; */ |
|
|
|
|
flex-direction: row; |
|
|
|
|
background-color: #fff; |
|
|
|
|
z-index: 500; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
.headercontainer{ |
|
|
|
|
position: relative; |
|
|
|
|
z-index: 500; |
|
|
|
|
background-color: #ffffff; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.wyb-drop-down-header-item { |
|
|
|
|
border:1px solid blue; |
|
|
|
|
position:relative; |
|
|
|
|
flex: 1; |
|
|
|
|
height: 100rpx; |
|
|
|
@ -439,7 +445,7 @@ |
|
|
|
|
.withSearch{ |
|
|
|
|
position:absolute; |
|
|
|
|
z-index:999; |
|
|
|
|
top:110upx; |
|
|
|
|
top:20upx; |
|
|
|
|
right:24upx; |
|
|
|
|
width:180upx; |
|
|
|
|
height:70upx; |
|
|
|
|