|
|
|
@ -5,8 +5,10 @@ |
|
|
|
|
<view class="filter-content" v-for="(item, index) in menuList" :key="index" v-if="menuIndex == index"> |
|
|
|
|
<view v-if="item.isSort"> |
|
|
|
|
<view class="filter-content-list"> |
|
|
|
|
<view v-for="(detailItem,idx) in selectDetailList" :key="idx" :class="detailItem.isSelected?'filter-content-list-item-active':'filter-content-list-item-default'" |
|
|
|
|
:style="{'color': detailItem.isSelected?themeColor:'#666666'}" @tap="sortTap(idx,selectDetailList,item.key)"> |
|
|
|
|
<view v-for="(detailItem,idx) in selectDetailList" :key="idx" |
|
|
|
|
:class="detailItem.isSelected?'filter-content-list-item-active':'filter-content-list-item-default'" |
|
|
|
|
:style="{'color': detailItem.isSelected?themeColor:'#666666'}" |
|
|
|
|
@tap="sortTap(idx,selectDetailList,item.key)"> |
|
|
|
|
<text>{{detailItem.title}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -16,16 +18,20 @@ |
|
|
|
|
<text>{{item.detailTitle}}</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="filter-content-detail"> |
|
|
|
|
<text v-for="(detailItem,idx) in selectDetailList" :key="idx" class='filter-content-detail-item-default' :style="{'background-color':detailItem.isSelected?themeColor:'#f6f6f6','color':detailItem.isSelected?'#FFFFFF':'#999999'}" |
|
|
|
|
<text v-for="(detailItem,idx) in selectDetailList" :key="idx" |
|
|
|
|
class='filter-content-detail-item-default' |
|
|
|
|
:style="{'background-color':detailItem.isSelected?themeColor:'#f6f6f6','color':detailItem.isSelected?'#FFFFFF':'#999999'}" |
|
|
|
|
@tap="itemTap(idx,selectDetailList,item.isMutiple,item.key)"> |
|
|
|
|
{{detailItem.title}} |
|
|
|
|
</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="filter-content-footer"> |
|
|
|
|
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;" @tap="resetClick(selectDetailList,item.key)"> |
|
|
|
|
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;" |
|
|
|
|
@tap="resetClick(selectDetailList,item.key)"> |
|
|
|
|
<text>重置</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="filter-content-footer-item" :style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick"> |
|
|
|
|
<view class="filter-content-footer-item" |
|
|
|
|
:style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick"> |
|
|
|
|
<text>确定</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -95,7 +101,8 @@ |
|
|
|
|
let obj = {} |
|
|
|
|
for (let i = 0; i < this.menuList.length; i++) { |
|
|
|
|
let item = this.menuList[i]; |
|
|
|
|
if (!this.independence && item.defaultSelectedIndex != null && item.defaultSelectedIndex.toString().length > 0) { // 处理并列菜单默认值 |
|
|
|
|
if (!this.independence && item.defaultSelectedIndex != null && item.defaultSelectedIndex.toString() |
|
|
|
|
.length > 0) { // 处理并列菜单默认值 |
|
|
|
|
|
|
|
|
|
if (item.isMutiple) { |
|
|
|
|
obj[item.key] = []; |
|
|
|
@ -130,7 +137,7 @@ |
|
|
|
|
resetAllSelect(callback) { |
|
|
|
|
let titles = []; |
|
|
|
|
for (let i = 0; i < this.menuList.length; i++) { |
|
|
|
|
this.resetSelected(this.menuList[i].detailList,this.menuList[i].key); |
|
|
|
|
this.resetSelected(this.menuList[i].detailList, this.menuList[i].key); |
|
|
|
|
titles[this.menuList[i].key] = this.menuList[i].title; |
|
|
|
|
} |
|
|
|
|
let obj = { |
|
|
|
@ -150,12 +157,14 @@ |
|
|
|
|
if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // 把所有默认的为false的点为true |
|
|
|
|
for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) { |
|
|
|
|
if (this.selectDetailList[this.menuList[i].defaultSelectedIndex[j]].isSelected == false) { |
|
|
|
|
this.itemTap(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this.menuList[i].isMutiple, this |
|
|
|
|
this.itemTap(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this |
|
|
|
|
.menuList[i].isMutiple, this |
|
|
|
|
.menuList[i].key) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.itemTap(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i].isMutiple, this.menuList[ |
|
|
|
|
this.itemTap(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i] |
|
|
|
|
.isMutiple, this.menuList[ |
|
|
|
|
i].key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -164,7 +173,8 @@ |
|
|
|
|
// 把所有不是默认的为true的点为false |
|
|
|
|
for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) { |
|
|
|
|
if (this.selectDetailList[unDefaultSelectedIndexArr[j]].isSelected == true) { |
|
|
|
|
this.itemTap(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i].isMutiple, this |
|
|
|
|
this.itemTap(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i] |
|
|
|
|
.isMutiple, this |
|
|
|
|
.menuList[i].key) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -405,10 +415,12 @@ |
|
|
|
|
.filter-content-detail-item-active { |
|
|
|
|
background-color: #D1372C; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
padding: 5px 15px; |
|
|
|
|
border-radius: 20px; |
|
|
|
|
margin-right: 8px; |
|
|
|
|
margin-top: 10px; |
|
|
|
|
padding: 5px 0px; |
|
|
|
|
border-radius: 5px; |
|
|
|
|
width: 21%; |
|
|
|
|
margin-left: 4%; |
|
|
|
|
text-align: center; |
|
|
|
|
margin-top: 15px; |
|
|
|
|
display: inline-block; |
|
|
|
|
font-size: 13px; |
|
|
|
|
} |
|
|
|
@ -416,10 +428,12 @@ |
|
|
|
|
.filter-content-detail-item-default { |
|
|
|
|
background-color: #FFFFFF; |
|
|
|
|
color: #666666; |
|
|
|
|
padding: 5px 15px; |
|
|
|
|
padding: 5px 0px; |
|
|
|
|
border-radius: 5px; |
|
|
|
|
margin-right: 8px; |
|
|
|
|
margin-top: 10px; |
|
|
|
|
width: 21%; |
|
|
|
|
margin-left: 4%; |
|
|
|
|
text-align: center; |
|
|
|
|
margin-top: 15px; |
|
|
|
|
display: inline-block; |
|
|
|
|
font-size: 13px; |
|
|
|
|
} |
|
|
|
|