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 &&
goods.catPosition == 'top' &&
goods.catList.length > 1
"
name="menuName"
:list="goods.catList"
:is-scroll="true"
:active-color="mainColor"
:current="activeKey"
:show-bar="goods.catStyle == 1"
:bold="false"
:type-style="goods.catStyle"
:height="goods.catStyle == 1 ? '88' : '44'"
@change="tabChangeHandler"
></u-tabs>
</view> </view>
<div :class="{ 'right-slider': goods.catPosition == 'top' }"> <div :class="goods.catPosition == 'top' ? 'right-slider' : ''">
<!-- 有分类 --> <!-- 有分类 -->
<template v-if="goods.showCat"> <template v-if="goods.showCat">
<template v-if="goods.catPosition == 'top'"> <template v-if="goods.catPosition == 'top'">
<!-- 一行一个 --> <!-- 一行一个 -->
<style1 v-if="goods.listStyle == 1" :goods-info="goods" :good-list="currentList"></style1> <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> <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> <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> <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> <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> <style7
v-if="goods.listStyle == 4"
:goods-info="goods"
:good-list="currentList"
></style7>
</template> </template>
<template v-else-if="goods.catPosition == 'left'"> <template v-else-if="goods.catPosition == 'left'">
<!-- 左侧分类 --> <!-- 左侧分类 -->
<view> <view>
<view class="left-slider"> <view class="left-slider">
<sidebar :active="activeKey" v-if="goods.showCat && goods.catPosition == 'left'" :list="goods.catList" name="menuName" <sidebar
:active-color="mainColor" :border="false" @change="tabChangeHandler"></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>
<!-- 右侧列表 --> <!-- 右侧列表 -->
<view class="style4View"> <view class="style4View">
...@@ -39,33 +84,57 @@ ...@@ -39,33 +84,57 @@
<!-- 只是商品 --> <!-- 只是商品 -->
<template v-else> <template v-else>
<!--一行一个--> <!--一行一个-->
<style1 v-if="goods.listStyle == 1" :goods-info="goods" :good-list="currentList"></style1> <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> <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> <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> <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> <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> <style7
v-if="goods.listStyle == 4"
:goods-info="goods"
:good-list="currentList"
></style7>
</template> </template>
</div> </div>
</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,
...@@ -74,13 +143,13 @@ ...@@ -74,13 +143,13 @@
style5, style5,
style6, style6,
style7, style7,
sidebar sidebar,
}, },
data() { data() {
return { return {
mainColor: '', mainColor: "",
activeKey: 0, activeKey: 0,
currentList: [] currentList: [],
}; };
}, },
created() { created() {
...@@ -95,50 +164,50 @@ ...@@ -95,50 +164,50 @@
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>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:style="{ :style="{
'background-color': goodsInfo.backgroundColor, 'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl, 'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '' 'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '',
}" }"
> >
<view <view
...@@ -14,41 +14,73 @@ ...@@ -14,41 +14,73 @@
:key="gli" :key="gli"
:style="{ :style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '' background:
goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '',
}" }"
> >
<view class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" /></view> <view class="tips" v-if="goodsInfo.showGoodsTag"
<view class="img-box"> ><image
<view class="img-show"> :src="goodsInfo.goodsTagPicUrl"
<image style="width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0;" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.picUrl" /> mode="widthFix"
</view> style="width: 100%"
/></view>
<view class="img-box-style5">
<image
style="width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.picUrl"
/>
</view> </view>
<view class="good-info"> <view class="good-info">
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view> <view class="good-name" v-if="goodsInfo.showGoodsName">{{
<view class="good-sub-name" style="height:35rpx;"> item.name
<template v-if="item.subname">{{item.subname}}</template> }}</view>
<view class="good-sub-name" style="height: 35rpx">
<template v-if="item.subname">{{ item.subname }}</template>
</view> </view>
<view class="good-price-info"> <view class="good-price-info">
<view class="price" :style="{ color: mainColor }"> <view class="price" :style="{ color: mainColor }">
<view class="good-sub-name" style="flex:1;">{{item.thirdname}}</view> <view class="good-sub-name" style="flex: 1">{{
<span style="color: #111;"> item.thirdname
{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }} }}</view>
<span style="color: #111">
{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : "" }}
</span> </span>
<!-- <span style='text-decoration: line-through;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> --> <!-- <span style='text-decoration: line-through;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> -->
</view> </view>
<view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)"> <view
<u-icon name="cart-o" size="40" :color="mainColor" v-if="goodsInfo.buyBtn == 'cart'" /> class="buy"
<u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" /> v-if="goodsInfo.showBuyBtn"
@click.stop="showSkuHandler(item)"
>
<u-icon
name="cart-o"
size="40"
:color="mainColor"
v-if="goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name="add-o"
size="40"
:color="mainColor"
v-else-if="goodsInfo.buyBtn == 'add'"
/>
<u-button <u-button
type="primary" type="primary"
size="mini" size="mini"
:ripple="true" :ripple="true"
:color="goodsInfo.buttonColor" :color="goodsInfo.buttonColor"
:custom-style=" :custom-style="`backgroundColor:${goodsInfo.buttonColor},color:${
`backgroundColor:${goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}` goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
" ? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4" :plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'" :shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else v-else
> >
{{ goodsInfo.buyBtnText }} {{ goodsInfo.buyBtnText }}
...@@ -57,27 +89,37 @@ ...@@ -57,27 +89,37 @@
</view> </view>
</view> </view>
</view> </view>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku> <good-sku
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> v-if="showSku"
:option-type="2"
borderRadius="20"
v-model="showSku"
:good="sku"
></good-sku>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view> </view>
</template> </template>
<script> <script>
import goodSku from '../goods/goodsku'; import goodSku from "../goods/goodsku";
import auth from '@/components/auth/index.vue'; import auth from "@/components/auth/index.vue";
export default { export default {
components: { components: {
goodSku, goodSku,
auth auth,
}, },
props: ['goodList', 'goodsInfo'], props: ["goodList", "goodsInfo"],
data() { data() {
return { return {
mainColor: '', mainColor: "",
activeKey: 0, activeKey: 0,
showSku: false, showSku: false,
sku: {}, sku: {},
showAuth: false, showAuth: false,
u: {} u: {},
}; };
}, },
created() { created() {
...@@ -87,38 +129,42 @@ export default { ...@@ -87,38 +129,42 @@ export default {
openGood(item) { openGood(item) {
//线路 //线路
if (item.goodType == 4) { if (item.goodType == 4) {
var url="/pages/jiuzhai/jz_LineDetail?tcid=" + item.id + '&configId=' + item.subid; var url =
console.log("url5",url) "/pages/jiuzhai/jz_LineDetail?tcid=" +
item.id +
"&configId=" +
item.subid;
console.log("url5", url);
uni.navigateTo({ uni.navigateTo({
url: url url: url,
}); });
} }
//酒店 //酒店
else if (item.goodType == 1) { else if (item.goodType == 1) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/hotel/detail?id=" + item.id url: "/pages/hotel/detail?id=" + item.id,
}); });
} }
//餐食 //餐食
else if (item.goodType == 2) { else if (item.goodType == 2) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/restaurant/detail?id=' + item.id url: "/pages/restaurant/detail?id=" + item.id,
}); });
} }
//景点 //景点
else if (item.goodType == 3) { else if (item.goodType == 3) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/ticketCoupons/detail?id=' + item.id url: "/pages/ticketCoupons/detail?id=" + item.id,
}); });
} }
}, },
showSkuHandler(g) { showSkuHandler(g) {
this.sku = g; this.sku = g;
this.u = uni.getStorageSync('mall_UserInfo'); this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { if (!this.u) {
this.u = { this.u = {
nickName: '未登录', nickName: "未登录",
avatarUrl: '' avatarUrl: "",
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
...@@ -126,14 +172,14 @@ export default { ...@@ -126,14 +172,14 @@ export default {
} }
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync('mall_UserInfo'); this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth = false; // this.showAuth = false;
}, },
//关闭登录窗口 //关闭登录窗口
gbAuth() { gbAuth() {
this.showAuth = false; this.showAuth = false;
} },
} },
}; };
</script> </script>
...@@ -152,16 +198,10 @@ export default { ...@@ -152,16 +198,10 @@ export default {
.her-scoller .good-five { .her-scoller .good-five {
position: relative; position: relative;
margin-right: 30rpx; margin-right: 30rpx;
/* width: 30%; */ display: inline-block;
/* border: 1rpx solid transparent;
border-radius: 10rpx;
padding-bottom: 10rpx; */
display:inline-block;
width: 560rpx; width: 560rpx;
box-shadow: 0px 10px 30px 0px rgba(36, 36, 36, 0.2); box-shadow: 0px 10px 30px 0px rgba(36, 36, 36, 0.2);
border-radius: 20rpx; border-radius: 20rpx;
/* float: left; */
} }
.her-scoller .good-five .tips { .her-scoller .good-five .tips {
width: 64rpx; width: 64rpx;
...@@ -171,36 +211,13 @@ export default { ...@@ -171,36 +211,13 @@ export default {
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.her-scoller .good-five .img-box { .her-scoller .good-five .img-box-style5 {
width: 100%; width: 100%;
/* height: 0;
padding-top: 100%; */
position: relative;
height: 224rpx; height: 224rpx;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
} }
.her-scoller .good-five .img-box .img-show {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 2;
}
.her-scoller .good-five .guding {
position: relative;
}
.her-scoller .good-five .guding .img-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.her-scoller .good-five .good-info { .her-scoller .good-five .good-info {
padding: 30rpx; padding: 30rpx;
} }
...@@ -216,7 +233,7 @@ export default { ...@@ -216,7 +233,7 @@ export default {
width: 100%; width: 100%;
font-weight: 600; font-weight: 600;
} }
.her-scoller .good-five .good-info .good-sub-name{ .her-scoller .good-five .good-info .good-sub-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: block; display: block;
......
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