Commit 2794eb73 by 李伟康

提交代码

1 parent 313d8481
......@@ -4,6 +4,7 @@
highlight-color="#FC5B32"
class="list"
:index-list="indexList"
:key="updata"
>
<template v-for="(item,index) in list">
<div
......@@ -11,18 +12,30 @@
:key="index"
>
<van-index-anchor :index="item.name" />
<template v-if="item.childs && item.childs.length">
<template v-for="(i,ind) in item.childs">
<div
class="card flex"
:key="ind"
@click="showCarType(i,item)"
>
{{i.name}}
<template v-if="item.done">
<template v-if="item.childs && item.childs.length">
<template v-for="(i,ind) in item.childs">
<div
class="card flex"
:key="ind"
@click="showCarType(i,item)"
>
{{i.name}}
</div>
</template>
</template>
<template v-else>
<div class="loading text-center">
<van-icon
name="fail"
color="#282829"
size="80"
/>
<div>暂无该车型</div>
</div>
</template>
</template>
<!-- <template v-else>
<template v-else>
<div class="loading text-center">
<van-loading
color="#282829"
......@@ -31,7 +44,7 @@
vertical
>加载中...</van-loading>
</div>
</template> -->
</template>
</div>
</template>
......@@ -65,7 +78,8 @@ export default {
indexList: [],
showType: false,
carTypeList: [],
brandInfo: null
brandInfo: null,
updata:Date.now()
}
},
activated () {
......@@ -93,7 +107,10 @@ export default {
brandId,
childBrandId: e.id
}).then(data => {
if (!data) data = []
this.list[index].done = true
this.list[index].childs = data
this.updata = Date.now()
})
},
showCarType (i, item) {
......@@ -148,6 +165,7 @@ export default {
.loading {
aspect-ratio: 1/1;
color: #282829;
flex-direction: column;
}
.card {
height: 56px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!