Commit 54f91e53 authored by 罗超's avatar 罗超

1

parent 3a8a3a32
<template> <template>
<div class="goods-box" :class="{ flex: goods.catPosition == 'left' }"> <div class="goods-box" :class="goods.catPosition == 'left' ? 'flex' : ''">
<view :style="{ margin: goods.catStyle == 1 ? '0px' : '10px 5px' }"> <view :style="{ margin: goods.catStyle == 1 ? '0px' : '10px 5px' }">
<u-tabs v-if="goods.showCat && goods.catPosition == 'top' && goods.catList.length > 1" name="menuName" :list="goods.catList" <u-tabs
:is-scroll="true" :active-color="mainColor" :current="activeKey" :show-bar="goods.catStyle == 1" :bold="false" v-if="
:type-style="goods.catStyle" :height="goods.catStyle == 1 ? '88' : '44'" @change="tabChangeHandler"></u-tabs> goods.showCat &&
</view> goods.catPosition == 'top' &&
<div :class="{ 'right-slider': goods.catPosition == 'top' }"> goods.catList.length > 1
<!-- 有分类 --> "
<template v-if="goods.showCat"> name="menuName"
<template v-if="goods.catPosition == 'top'"> :list="goods.catList"
<!-- 一行一个 --> :is-scroll="true"
<style1 v-if="goods.listStyle == 1" :goods-info="goods" :good-list="currentList"></style1> :active-color="mainColor"
<!-- 一行两个 --> :current="activeKey"
<style2 v-if="goods.listStyle == 2" :goods-info="goods" :good-list="currentList"></style2> :show-bar="goods.catStyle == 1"
<!-- 一行三个 --> :bold="false"
<style3 v-if="goods.listStyle == 3" :goods-info="goods" :good-list="currentList"></style3> :type-style="goods.catStyle"
<!-- 左右滚动 --> :height="goods.catStyle == 1 ? '88' : '44'"
<style5 v-if="goods.listStyle == 0" :goods-info="goods" :good-list="currentList"></style5> @change="tabChangeHandler"
<!--列表模式--> ></u-tabs>
<style6 v-if="goods.listStyle == -1" :goods-info="goods" :good-list="currentList"></style6> </view>
<!-- 教育有星星模式 --> <div :class="goods.catPosition == 'top' ? 'right-slider' : ''">
<style7 v-if="goods.listStyle == 4" :goods-info="goods" :good-list="currentList"></style7> <!-- 有分类 -->
</template> <template v-if="goods.showCat">
<template v-else-if="goods.catPosition == 'left'"> <template v-if="goods.catPosition == 'top'">
<!-- 左侧分类 --> <!-- 一行一个 -->
<view> <style1
<view class="left-slider"> v-if="goods.listStyle == 1"
<sidebar :active="activeKey" v-if="goods.showCat && goods.catPosition == 'left'" :list="goods.catList" name="menuName" :goods-info="goods"
:active-color="mainColor" :border="false" @change="tabChangeHandler"></sidebar> :good-list="currentList"
</view> ></style1>
<!-- 右侧列表 --> <!-- 一行两个 -->
<view class="style4View"> <style2
<style4 :goods-info="goods" :good-list="currentList"></style4> v-if="goods.listStyle == 2"
</view> :goods-info="goods"
</view> :good-list="currentList"
</template> ></style2>
</template> <!-- 一行三个 -->
<!-- 只是商品 --> <style3
<template v-else> v-if="goods.listStyle == 3"
<!--一行一个--> :goods-info="goods"
<style1 v-if="goods.listStyle == 1" :goods-info="goods" :good-list="currentList"></style1> :good-list="currentList"
<!--一行两个--> ></style3>
<style2 v-if="goods.listStyle == 2" :goods-info="goods" :good-list="currentList"></style2> <!-- 左右滚动 -->
<!--一行三个--> <style5
<style3 v-if="goods.listStyle == 3" :goods-info="goods" :good-list="currentList"></style3> v-if="goods.listStyle == 0"
<!--左右滚动--> :goods-info="goods"
<style5 v-if="goods.listStyle == 0" :goods-info="goods" :good-list="currentList"></style5> :good-list="currentList"
<!--列表模式--> ></style5>
<style6 v-if="goods.listStyle == -1" :goods-info="goods" :good-list="currentList"></style6> <!--列表模式-->
<!-- 教育有星星模式 --> <style6
<style7 v-if="goods.listStyle == 4" :goods-info="goods" :good-list="currentList"></style7> v-if="goods.listStyle == -1"
</template> :goods-info="goods"
</div> :good-list="currentList"
</div> ></style6>
<!-- 教育有星星模式 -->
<style7
v-if="goods.listStyle == 4"
:goods-info="goods"
:good-list="currentList"
></style7>
</template>
<template v-else-if="goods.catPosition == 'left'">
<!-- 左侧分类 -->
<view>
<view class="left-slider">
<sidebar
:active="activeKey"
v-if="goods.showCat && goods.catPosition == 'left'"
:list="goods.catList"
name="menuName"
:active-color="mainColor"
:border="false"
@change="tabChangeHandler"
></sidebar>
</view>
<!-- 右侧列表 -->
<view class="style4View">
<style4 :goods-info="goods" :good-list="currentList"></style4>
</view>
</view>
</template>
</template>
<!-- 只是商品 -->
<template v-else>
<!--一行一个-->
<style1
v-if="goods.listStyle == 1"
:goods-info="goods"
:good-list="currentList"
></style1>
<!--一行两个-->
<style2
v-if="goods.listStyle == 2"
:goods-info="goods"
:good-list="currentList"
></style2>
<!--一行三个-->
<style3
v-if="goods.listStyle == 3"
:goods-info="goods"
:good-list="currentList"
></style3>
<!--左右滚动-->
<style5
v-if="goods.listStyle == 0"
:goods-info="goods"
:good-list="currentList"
></style5>
<!--列表模式-->
<style6
v-if="goods.listStyle == -1"
:goods-info="goods"
:good-list="currentList"
></style6>
<!-- 教育有星星模式 -->
<style7
v-if="goods.listStyle == 4"
:goods-info="goods"
:good-list="currentList"
></style7>
</template>
</div>
</div>
</template> </template>
<script> <script>
import style1 from './style1'; import style1 from "./style1";
import style2 from './style2'; import style2 from "./style2";
import style3 from './style3'; import style3 from "./style3";
import style4 from './style4'; import style4 from "./style4";
import style5 from './style5'; import style5 from "./style5";
import style6 from './style6'; import style6 from "./style6";
import style7 from './style7'; import style7 from "./style7";
import sidebar from '../sidebar/index'; import sidebar from "../sidebar/index";
export default { export default {
props: ['goods'], props: ["goods"],
components: { components: {
style1, style1,
style2, style2,
style3, style3,
style4, style4,
style5, style5,
style6, style6,
style7, style7,
sidebar sidebar,
}, },
data() { data() {
return { return {
mainColor: '', mainColor: "",
activeKey: 0, activeKey: 0,
currentList: [] currentList: [],
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
if (this.goods.showCat) { if (this.goods.showCat) {
this.currentList = this.goods.catList[0].goodsList; this.currentList = this.goods.catList[0].goodsList;
} else { } else {
this.currentList = this.goods.list; this.currentList = this.goods.list;
} }
}, },
methods: { methods: {
tabChangeHandler(i) { tabChangeHandler(i) {
this.currentList = this.goods.catList[i].goodsList; this.currentList = this.goods.catList[i].goodsList;
this.activeKey = i; this.activeKey = i;
} },
} },
}; };
</script> </script>
<style> <style>
.style4View { .style4View {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
padding-left: 80px; padding-left: 80px;
box-sizing: border-box; box-sizing: border-box;
} }
.goods-box { .goods-box {
/* margin: 20rpx 0; */ /* margin: 20rpx 0; */
} }
.goods-box .tips { .goods-box .tips {
z-index: 50 !important; z-index: 50 !important;
} }
.goods-box.flex { .goods-box .flex {
display: flex; display: flex;
} }
.goods-box.flex .left-slider { .goods-box.flex .left-slider {
width: 80px; width: 80px;
position: absolute; position: absolute;
} }
.goods-box.flex .right-slider { .goods-box.flex .right-slider {
flex: 1; flex: 1;
width: 1rpx; width: 1rpx;
} }
.defaultz .van-sticky { .defaultz .van-sticky {
z-index: 1 !important; z-index: 1 !important;
} }
.goods-box .van-tabs__scroll { .goods-box .van-tabs__scroll {
background: none; background: none;
} }
.goods-box ._div { .goods-box ._div {
width: 100%; width: 100%;
} }
</style> </style>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment