|
|
|
@ -1,75 +1,76 @@ |
|
|
|
|
<template> |
|
|
|
|
<!-- 服装类型--> |
|
|
|
|
<!-- 成衣推荐--> |
|
|
|
|
<div class="chengyi"> |
|
|
|
|
|
|
|
|
|
<Header fontColor="#000"></Header> |
|
|
|
|
<div class="main"> |
|
|
|
|
<div class="jz d-flex"> |
|
|
|
|
<el-menu |
|
|
|
|
class="el-menu-vertical-demo" |
|
|
|
|
@select="handleSelet" |
|
|
|
|
style="width: 10%; min-width: 140px" |
|
|
|
|
:unique-opened="true" |
|
|
|
|
> |
|
|
|
|
<el-submenu v-for="(item, i) in typeData" :key="i" :index="item.id"> |
|
|
|
|
<template slot="title"> |
|
|
|
|
<i class="el-icon-male"></i> |
|
|
|
|
<span>{{ item.name }}</span> |
|
|
|
|
</template> |
|
|
|
|
<el-submenu v-for="(j, i2) in item.childrens" :key="i2" :index="j.id"> |
|
|
|
|
<template slot="title">{{ j.name }}</template> |
|
|
|
|
<el-menu-item v-for="(k, i3) in j.childrens" :key="i3" :index="k.id">{{ k.name }}</el-menu-item> |
|
|
|
|
</el-submenu> |
|
|
|
|
</el-submenu> |
|
|
|
|
</el-menu> |
|
|
|
|
<div class="right"> |
|
|
|
|
<div class="name d-flex"> |
|
|
|
|
<span>{{this.current.name}}</span> |
|
|
|
|
<div class="d-flex"> |
|
|
|
|
<el-dropdown @command="handleCommand"> |
|
|
|
|
<Header fontColor="#000"></Header> |
|
|
|
|
<div class="main"> |
|
|
|
|
<div class="jz d-flex"> |
|
|
|
|
<el-menu |
|
|
|
|
class="el-menu-vertical-demo" |
|
|
|
|
@select="handleSelet" |
|
|
|
|
style="width: 10%; min-width: 140px" |
|
|
|
|
:unique-opened="true" |
|
|
|
|
> |
|
|
|
|
<el-submenu v-for="(item, i) in typeData" :key="i" :index="item.id"> |
|
|
|
|
<template slot="title"> |
|
|
|
|
<i class="el-icon-male"></i> |
|
|
|
|
<span>{{ item.name }}</span> |
|
|
|
|
</template> |
|
|
|
|
<el-menu-item v-for="(j, i2) in item.childrens" :key="i2" :index="j.id">{{ j.name }}</el-menu-item> |
|
|
|
|
<!-- <el-submenu v-for="(j, i2) in item.childrens" :key="i2" :index="j.id">--> |
|
|
|
|
<!-- <template slot="title">{{ j.name }}</template>--> |
|
|
|
|
<!-- <el-menu-item v-for="(k, i3) in j.childrens" :key="i3" :index="k.id">{{ k.name }}</el-menu-item>--> |
|
|
|
|
<!-- </el-submenu>--> |
|
|
|
|
</el-submenu> |
|
|
|
|
</el-menu> |
|
|
|
|
<div class="right"> |
|
|
|
|
<div class="name d-flex"> |
|
|
|
|
<span>{{this.current.name}}</span> |
|
|
|
|
<div class="d-flex"> |
|
|
|
|
<el-dropdown @command="handleCommand"> |
|
|
|
|
<span class="el-dropdown-link"> |
|
|
|
|
排序<i class="el-icon-arrow-down el-icon--right"></i> |
|
|
|
|
</span> |
|
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
|
<el-dropdown-item command="heat">热度</el-dropdown-item> |
|
|
|
|
<!-- <el-dropdown-item command="esteem">评分</el-dropdown-item>--> |
|
|
|
|
<el-dropdown-item command="high">价格降序</el-dropdown-item> |
|
|
|
|
<el-dropdown-item command="low">价格升序</el-dropdown-item> |
|
|
|
|
</el-dropdown-menu> |
|
|
|
|
</el-dropdown> |
|
|
|
|
<!-- <div class="iconDiv d-flex">--> |
|
|
|
|
<!-- <span>价格</span>--> |
|
|
|
|
<!-- <div class="icon d-flex">--> |
|
|
|
|
<!-- <i class="el-icon-arrow-up"></i>--> |
|
|
|
|
<!-- <i class="el-icon-arrow-down"></i>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
</div> |
|
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
|
<el-dropdown-item command="heat">热度</el-dropdown-item> |
|
|
|
|
<!-- <el-dropdown-item command="esteem">评分</el-dropdown-item>--> |
|
|
|
|
<el-dropdown-item command="high">价格降序</el-dropdown-item> |
|
|
|
|
<el-dropdown-item command="low">价格升序</el-dropdown-item> |
|
|
|
|
</el-dropdown-menu> |
|
|
|
|
</el-dropdown> |
|
|
|
|
<!-- <div class="iconDiv d-flex">--> |
|
|
|
|
<!-- <span>价格</span>--> |
|
|
|
|
<!-- <div class="icon d-flex">--> |
|
|
|
|
<!-- <i class="el-icon-arrow-up"></i>--> |
|
|
|
|
<!-- <i class="el-icon-arrow-down"></i>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
</div> |
|
|
|
|
<div class="clothDiv d-flex"> |
|
|
|
|
<div |
|
|
|
|
class="item" |
|
|
|
|
v-for="(item, index) in clothsList" |
|
|
|
|
:key="index" |
|
|
|
|
@click="clothDetails(item)" |
|
|
|
|
> |
|
|
|
|
<div class="imgDiv"> |
|
|
|
|
<img :src="item.imgUrl" alt="" /> |
|
|
|
|
</div> |
|
|
|
|
<div class="clothTitle"> |
|
|
|
|
<p class="price d-flex"> |
|
|
|
|
<span class="f_16 c_333">¥{{ item.currentPrice }}</span> |
|
|
|
|
<span class="f_12 c_999">¥{{ item.historicalPrice }}</span> |
|
|
|
|
</p> |
|
|
|
|
<p class="f_12 c_333">{{ item.title }}</p> |
|
|
|
|
<p class="f_12 c_9a9b9b">热度{{ item.heat }}</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="clothDiv d-flex"> |
|
|
|
|
<div |
|
|
|
|
class="item" |
|
|
|
|
v-for="(item, index) in clothsList" |
|
|
|
|
:key="index" |
|
|
|
|
@click="clothDetails(item)" |
|
|
|
|
> |
|
|
|
|
<div class="imgDiv"> |
|
|
|
|
<img :src="item.imgUrl" alt="" /> |
|
|
|
|
</div> |
|
|
|
|
<div class="clothTitle"> |
|
|
|
|
<p class="price d-flex"> |
|
|
|
|
<span class="f_16 c_333">¥{{ item.currentPrice }}</span> |
|
|
|
|
<span class="f_12 c_999">¥{{ item.historicalPrice }}</span> |
|
|
|
|
</p> |
|
|
|
|
<p class="f_12 c_333">{{ item.title }}</p> |
|
|
|
|
<p class="f_12 c_9a9b9b">热度{{ item.heat }}</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
@ -195,82 +196,64 @@ |
|
|
|
|
name: "男装", |
|
|
|
|
childrens: [ |
|
|
|
|
{ |
|
|
|
|
id: '11', |
|
|
|
|
name: "上衣", |
|
|
|
|
childrens: [ |
|
|
|
|
{ |
|
|
|
|
id: '111', |
|
|
|
|
name: "衬衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '112', |
|
|
|
|
name: "卫衣", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '113', |
|
|
|
|
name: "Polo衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '114', |
|
|
|
|
name: "针织衫", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '12', |
|
|
|
|
name: "外套", |
|
|
|
|
childrens: [ |
|
|
|
|
{ |
|
|
|
|
id: '121', |
|
|
|
|
name: "夹克", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '122', |
|
|
|
|
name: "羽绒服", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '123', |
|
|
|
|
name: "风衣", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '13', |
|
|
|
|
name: "裤子", |
|
|
|
|
childrens: [ |
|
|
|
|
{ |
|
|
|
|
id: '131', |
|
|
|
|
name: "休闲裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '132', |
|
|
|
|
name: "西裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '133', |
|
|
|
|
name: "工装裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '134', |
|
|
|
|
name: "运动裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '135', |
|
|
|
|
name: "卫裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '136', |
|
|
|
|
name: "九分裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '137', |
|
|
|
|
name: "短裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '138', |
|
|
|
|
name: "哈伦裤", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
id: '111', |
|
|
|
|
name: "衬衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '112', |
|
|
|
|
name: "卫衣", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '113', |
|
|
|
|
name: "Polo衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '114', |
|
|
|
|
name: "针织衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '121', |
|
|
|
|
name: "夹克", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '122', |
|
|
|
|
name: "羽绒服", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '123', |
|
|
|
|
name: "风衣", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '131', |
|
|
|
|
name: "休闲裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '132', |
|
|
|
|
name: "西裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '133', |
|
|
|
|
name: "工装裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '134', |
|
|
|
|
name: "运动裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '135', |
|
|
|
|
name: "卫裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '136', |
|
|
|
|
name: "九分裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '137', |
|
|
|
|
name: "短裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '138', |
|
|
|
|
name: "哈伦裤", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
@ -279,82 +262,130 @@ |
|
|
|
|
name: "女装", |
|
|
|
|
childrens: [ |
|
|
|
|
{ |
|
|
|
|
id: '21', |
|
|
|
|
name: "上衣", |
|
|
|
|
childrens: [ |
|
|
|
|
{ |
|
|
|
|
id: '211', |
|
|
|
|
name: "衬衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '212', |
|
|
|
|
name: "卫衣", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '213', |
|
|
|
|
name: "Polo衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '214', |
|
|
|
|
name: "针织衫", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '22', |
|
|
|
|
name: "外套", |
|
|
|
|
childrens: [ |
|
|
|
|
{ |
|
|
|
|
id: '221', |
|
|
|
|
name: "夹克", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '222', |
|
|
|
|
name: "羽绒服", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '223', |
|
|
|
|
name: "风衣", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '23', |
|
|
|
|
name: "裤子", |
|
|
|
|
childrens: [ |
|
|
|
|
{ |
|
|
|
|
id: '231', |
|
|
|
|
name: "休闲裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '232', |
|
|
|
|
name: "西裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '233', |
|
|
|
|
name: "工装裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '234', |
|
|
|
|
name: "运动裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '235', |
|
|
|
|
name: "卫裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '236', |
|
|
|
|
name: "九分裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '237', |
|
|
|
|
name: "短裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '238', |
|
|
|
|
name: "哈伦裤", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
id: '211', |
|
|
|
|
name: "衬衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '212', |
|
|
|
|
name: "卫衣", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '213', |
|
|
|
|
name: "Polo衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '214', |
|
|
|
|
name: "针织衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '221', |
|
|
|
|
name: "夹克", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '222', |
|
|
|
|
name: "羽绒服", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '223', |
|
|
|
|
name: "风衣", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '231', |
|
|
|
|
name: "休闲裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '232', |
|
|
|
|
name: "西裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '233', |
|
|
|
|
name: "工装裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '234', |
|
|
|
|
name: "运动裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '235', |
|
|
|
|
name: "卫裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '236', |
|
|
|
|
name: "九分裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '237', |
|
|
|
|
name: "短裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '238', |
|
|
|
|
name: "哈伦裤", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '3', |
|
|
|
|
name: "童装", |
|
|
|
|
childrens: [ |
|
|
|
|
{ |
|
|
|
|
id: '311', |
|
|
|
|
name: "衬衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '312', |
|
|
|
|
name: "卫衣", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '313', |
|
|
|
|
name: "Polo衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '314', |
|
|
|
|
name: "针织衫", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '321', |
|
|
|
|
name: "夹克", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '322', |
|
|
|
|
name: "羽绒服", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '323', |
|
|
|
|
name: "风衣", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '331', |
|
|
|
|
name: "休闲裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '332', |
|
|
|
|
name: "西裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '333', |
|
|
|
|
name: "工装裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '334', |
|
|
|
|
name: "运动裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '335', |
|
|
|
|
name: "卫裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '336', |
|
|
|
|
name: "九分裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '337', |
|
|
|
|
name: "短裤", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: '338', |
|
|
|
|
name: "哈伦裤", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
@ -362,7 +393,8 @@ |
|
|
|
|
// 目前选择的菜单 |
|
|
|
|
current:{ |
|
|
|
|
id:'', |
|
|
|
|
name:'' |
|
|
|
|
name:'', |
|
|
|
|
parrentName:'' |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
@ -374,19 +406,24 @@ |
|
|
|
|
const indexb = this.typeData[indexa].childrens.findIndex((value, keys, arr) => { |
|
|
|
|
return value.id == indexPath[1] |
|
|
|
|
}) |
|
|
|
|
const indexc = this.typeData[indexa].childrens[indexb].childrens.findIndex((value, keys, arr) => { |
|
|
|
|
return value.id == indexPath[2] |
|
|
|
|
}) |
|
|
|
|
this.current.name = this.typeData[indexa].childrens[indexb].childrens[indexc].name |
|
|
|
|
this.current.id = this.typeData[indexa].childrens[indexb].childrens[indexc].id |
|
|
|
|
// const indexc = this.typeData[indexa].childrens[indexb].childrens.findIndex((value, keys, arr) => { |
|
|
|
|
// return value.id == indexPath[2] |
|
|
|
|
// }) |
|
|
|
|
// this.current.name = this.typeData[indexa].childrens[indexb].childrens[indexc].name |
|
|
|
|
// this.current.id = this.typeData[indexa].childrens[indexb].childrens[indexc].id |
|
|
|
|
this.current.name = this.typeData[indexa].childrens[indexb].name |
|
|
|
|
this.current.id = this.typeData[indexa].childrens[indexb].id |
|
|
|
|
this.current.parrentName = this.typeData[indexa].name |
|
|
|
|
}, |
|
|
|
|
handleSelet(index,indexPath){ |
|
|
|
|
this.findIndex(indexPath) |
|
|
|
|
//这里更改右边显示衣服的数据,通过this.current.id查 |
|
|
|
|
// this.clothsList |
|
|
|
|
}, |
|
|
|
|
clothDetails(item) { |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: "/shopping/ClothDetail", |
|
|
|
|
query: { id: item.id, title: item.title }, |
|
|
|
|
query: { id: item.id, title: item.title ,name:this.current.name,parentName:this.current.parrentName}, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleCommand(command){ |
|
|
|
@ -396,8 +433,8 @@ |
|
|
|
|
else if(command == 'high'){//价格降序 |
|
|
|
|
this.clothsList.sort(compareDown("currentPrice")) |
|
|
|
|
} |
|
|
|
|
// else if(command == 'esteem'){//按评分排序 |
|
|
|
|
// this.clothsList.sort(compare("heat")) |
|
|
|
|
// else if(command == 'esteem'){//按评分排序 |
|
|
|
|
// this.clothsList.sort(compare("heat")) |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
else if(command == 'low'){//价格升序 |
|
|
|
@ -405,6 +442,11 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.current.name = this.typeData[0].childrens[0].name |
|
|
|
|
this.current.id = this.typeData[0].childrens[0].id |
|
|
|
|
this.current.parrentName = this.typeData[0].name |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style scoped> |
|
|
|
|