feat(index): 样式调整
This commit is contained in:
parent
03af5fd69a
commit
7fba675e7f
|
|
@ -605,8 +605,17 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (item.specialArea == 30) {
|
if (item.specialArea === 3) {
|
||||||
this.goAreaUrl()
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
'/pages/specialArea/drawer-list?label=' +
|
||||||
|
item.specialAreaName +
|
||||||
|
'&specialArea=' +
|
||||||
|
item.specialArea +
|
||||||
|
'&children=' +
|
||||||
|
JSON.stringify(this.zoneList[tapx].children) +
|
||||||
|
'&diff=1',
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:
|
url:
|
||||||
|
|
|
||||||
|
|
@ -244,12 +244,12 @@
|
||||||
<!-- 一级分类 -->
|
<!-- 一级分类 -->
|
||||||
<view
|
<view
|
||||||
class="drawer-first-level"
|
class="drawer-first-level"
|
||||||
:class="{ active: oneId == item.pkId }"
|
:class="{ active: currentCategory == item.pkId }"
|
||||||
>
|
>
|
||||||
<view class="drawer-menu-text" @click="selectFirstLevel(item)">{{
|
<view class="drawer-menu-text" @click="selectFirstLevel(item)">{{
|
||||||
truncateText(item.classifyName, 12)
|
truncateText(item.classifyName, 12)
|
||||||
}}</view>
|
}}</view>
|
||||||
<!-- <view
|
<view
|
||||||
v-if="item.children && item.children.length > 0"
|
v-if="item.children && item.children.length > 0"
|
||||||
class="drawer-expand-icon"
|
class="drawer-expand-icon"
|
||||||
:class="{ expanded: expandedMenus.includes(item.pkId) }"
|
:class="{ expanded: expandedMenus.includes(item.pkId) }"
|
||||||
|
|
@ -258,9 +258,9 @@
|
||||||
<u-icon
|
<u-icon
|
||||||
name="arrow-right"
|
name="arrow-right"
|
||||||
size="16"
|
size="16"
|
||||||
:color="oneId == item.pkId ? '#fff' : '#666'"
|
:color="currentCategory === item.pkId ? '#fff' : '#666'"
|
||||||
></u-icon>
|
></u-icon>
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view
|
||||||
|
|
@ -272,7 +272,7 @@
|
||||||
v-for="subItem in item.children"
|
v-for="subItem in item.children"
|
||||||
:key="subItem.pkId"
|
:key="subItem.pkId"
|
||||||
class="drawer-second-level"
|
class="drawer-second-level"
|
||||||
:class="{ active: twoId == subItem.pkId }"
|
:class="{ active: currentCategory === subItem.pkId }"
|
||||||
@click="selectSecondLevel(subItem)"
|
@click="selectSecondLevel(subItem)"
|
||||||
>
|
>
|
||||||
<view class="drawer-sub-menu-text">{{
|
<view class="drawer-sub-menu-text">{{
|
||||||
|
|
@ -338,6 +338,7 @@ export default {
|
||||||
waresName: '',
|
waresName: '',
|
||||||
expandedMenus: [], // 存储展开的一级菜单ID
|
expandedMenus: [], // 存储展开的一级菜单ID
|
||||||
showCategoryDrawer: false, // 控制分类抽屉显示
|
showCategoryDrawer: false, // 控制分类抽屉显示
|
||||||
|
currentCategory: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|
@ -444,7 +445,7 @@ export default {
|
||||||
const children = item.children
|
const children = item.children
|
||||||
if (children && children.length > 0) {
|
if (children && children.length > 0) {
|
||||||
item.children = [
|
item.children = [
|
||||||
{ classifyName: '全部', pkId: item.pkId },
|
// { classifyName: '全部', pkId: item.pkId },
|
||||||
...children,
|
...children,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -460,7 +461,8 @@ export default {
|
||||||
if (this.oneList[0]) {
|
if (this.oneList[0]) {
|
||||||
this.oneId = this.oneList[0].pkId
|
this.oneId = this.oneList[0].pkId
|
||||||
this.twoId = this.oneList[0].pkId
|
this.twoId = this.oneList[0].pkId
|
||||||
this.getAllGoods(this.oneList[0].pkId)
|
this.currentCategory = this.oneId
|
||||||
|
this.getAllGoods(this.currentCategory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -474,7 +476,8 @@ export default {
|
||||||
selectFirstLevel(item) {
|
selectFirstLevel(item) {
|
||||||
this.oneId = item.pkId
|
this.oneId = item.pkId
|
||||||
this.twoId = item.pkId
|
this.twoId = item.pkId
|
||||||
this.getAllGoods(item.pkId)
|
this.currentCategory = item.pkId
|
||||||
|
this.getAllGoods(this.currentCategory)
|
||||||
},
|
},
|
||||||
// 切换展开状态(不影响选择状态)
|
// 切换展开状态(不影响选择状态)
|
||||||
toggleExpand(pkId) {
|
toggleExpand(pkId) {
|
||||||
|
|
@ -492,7 +495,8 @@ export default {
|
||||||
// 选择二级分类
|
// 选择二级分类
|
||||||
selectSecondLevel(item) {
|
selectSecondLevel(item) {
|
||||||
this.twoId = item.pkId
|
this.twoId = item.pkId
|
||||||
this.getAllGoods1(item.pkId)
|
this.currentCategory = item.pkId
|
||||||
|
this.getAllGoods1(this.currentCategory)
|
||||||
// 不自动关闭抽屉,让用户手动关闭
|
// 不自动关闭抽屉,让用户手动关闭
|
||||||
},
|
},
|
||||||
// 打开分类抽屉
|
// 打开分类抽屉
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue