Commit 6b08fb1d authored by 罗超's avatar 罗超

1

parent 9b151619
<template> <template>
<div <div
style="padding: 12px; padding-bottom: 0;" style="padding: 12px; padding-bottom: 0"
: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)' : '',
}" }"
> >
<u-row gutter="24"> <u-row gutter="24">
<u-col span="4" v-for="(item, gli) in goodList" :key="gli"> <u-col span="4" v-for="(item, gli) in goodList" :key="gli">
<div <div
class="good-three" class="good-three"
@click="openGood(item)" @click="openGood(item)"
:style="{ :style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', border:
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '' goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
}" background:
> goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2
<div class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" /></div> ? '#FFF'
<div class="img-box"> : '',
<div class="img-show"> }"
<image >
style=" <div class="tips" v-if="goodsInfo.showGoodsTag">
<image
:src="goodsInfo.goodsTagPicUrl"
mode="widthFix"
style="width: 100%"
/>
</div>
<div class="img-box">
<div class="img-show">
<image
style="
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 10rpx 10rpx 0 0; border-radius: 10rpx 10rpx 0 0;
" "
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.picUrl" :src="item.picUrl"
/> />
</div> </div>
</div> </div>
<div class="good-info"> <div class="good-info">
<div class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</div> <div class="good-name" v-if="goodsInfo.showGoodsName">
<div class="good-price-info"> {{ item.name }}
<view class="price" :style="{ color: mainColor }"> </div>
<span>{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }}</span> <div class="good-price-info">
<span style='text-decoration: line-through;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> <view class="price" :style="{ color: mainColor }">
</view> <span>{{
<view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)"> goodsInfo.showGoodsPrice ? getPrice(item.price) : ""
<u-icon name="cart-o" size="40" :color="mainColor" v-if="goodsInfo.buyBtn == 'cart'" /> }}</span>
<u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" /> <span
<u-button style="
type="primary" text-decoration: line-through;
size="mini" font-size: 10px;
:ripple="true" color: gray;
:color="goodsInfo.buttonColor" font-family: aa;
:custom-style=" "
`backgroundColor:${goodsInfo.buttonColor},color:${ >原价:{{
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF' goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ""
}` }}</span
" >
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4" </view>
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'" <view
v-else class="buy"
> v-if="goodsInfo.showBuyBtn"
{{ goodsInfo.buyBtnText }} @click.stop="showSkuHandler(item)"
</u-button> >
</view> <u-icon
</div> name="cart-o"
</div> size="40"
</div> :color="mainColor"
</u-col> v-if="goodsInfo.buyBtn == 'cart'"
</u-row> />
<good-sku v-if="showSku" borderRadius="20" v-model="showSku" :good="sku" :option-type="2"></good-sku> <u-icon
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> name="add-o"
</div> size="40"
:color="mainColor"
v-else-if="goodsInfo.buyBtn == 'add'"
/>
<u-button
type="primary"
size="mini"
:ripple="true"
:color="goodsInfo.buttonColor"
:custom-style="`backgroundColor:${
goodsInfo.buttonColor
},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else
>
{{ goodsInfo.buyBtnText }}
</u-button>
</view>
</div>
</div>
</div>
</u-col>
</u-row>
<good-sku
v-if="showSku"
borderRadius="20"
v-model="showSku"
:good="sku"
:option-type="2"
></good-sku>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</div>
</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() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
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("url3",url) "/pages/jiuzhai/jz_LineDetail?tcid=" +
uni.navigateTo({ item.id +
url: url "&configId=" +
}); item.subid;
} console.log("url3", url);
//酒店 uni.navigateTo({
else if (item.goodType == 1) { url: url,
uni.navigateTo({ });
url: "/pages/hotel/detail?id=" + item.id }
}); //酒店
} else if (item.goodType == 1) {
//餐食 uni.navigateTo({
else if (item.goodType == 2) { url: "/pages/hotel/detail?id=" + item.id,
uni.navigateTo({ });
url: '/pages/restaurant/detail?id=' + item.id }
}); //餐食
} else if (item.goodType == 2) {
//景点 uni.navigateTo({
else if (item.goodType == 3) { url: "/pages/restaurant/detail?id=" + item.id,
uni.navigateTo({ });
url: '/pages/ticketCoupons/detail?id=' + item.id }
}); //景点
} else if (item.goodType == 3) {
}, uni.navigateTo({
showSkuHandler(g) { url: "/pages/ticketCoupons/detail?id=" + item.id,
this.sku = g; });
this.u = uni.getStorageSync('mall_UserInfo'); }
if (!this.u) { },
this.u = { showSkuHandler(g) {
nickName: '未登录', this.sku = g;
avatarUrl: '' this.u = uni.getStorageSync("mall_UserInfo");
}; if (!this.u) {
this.showAuth = true; this.u = {
} else { nickName: "未登录",
this.showSku = true; avatarUrl: "",
} };
}, this.showAuth = true;
reloadUserinfo() { } else {
this.u = uni.getStorageSync('mall_UserInfo'); this.showSku = true;
// this.showAuth = false; }
}, },
//关闭登录窗口 reloadUserinfo() {
gbAuth() { this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth = false; // this.showAuth = false;
} },
} //关闭登录窗口
gbAuth() {
this.showAuth = false;
},
},
}; };
</script> </script>
<style> <style scoped>
.good-three { .good-three {
position: relative; position: relative;
margin-bottom: 12px; margin-bottom: 12px;
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
padding-bottom: 5px; padding-bottom: 5px;
} }
.good-three .tips { .good-three .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.good-three .img-box { .good-three .img-box {
width: 100%; width: 100%;
height: 0; height: 0;
padding-top: 100%; padding-top: 100%;
position: relative; position: relative;
} }
.good-three .img-box .img-show { .good-three .img-box .img-show {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
.good-three .guding { .good-three .guding {
position: relative; position: relative;
} }
.good-three .guding .img-box { .good-three .guding .img-box {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
top: 0; top: 0;
} }
.good-three .good-info { .good-three .good-info {
padding: 6rpx; padding: 6rpx;
margin-top: -5px; margin-top: -5px;
padding-bottom: 0; padding-bottom: 0;
} }
.good-three .good-info .good-name { .good-three .good-info .good-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin: 3px 0; margin: 3px 0;
font-size: 13px; font-size: 13px;
word-break: break-all; word-break: break-all;
height: 37px; height: 37px;
} }
.good-three .good-info .good-price-info { .good-three .good-info .good-price-info {
display: flex; display: flex;
justify-items: center; justify-items: center;
align-items: center; align-items: center;
} }
.good-three .good-info .good-price-info .price { .good-three .good-info .good-price-info .price {
color: #ff4544; color: #ff4544;
flex: 1; flex: 1;
font-size: 14px; font-size: 14px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.good-three .good-info .good-price-info .buy { .good-three .good-info .good-price-info .buy {
width: 24px; width: 24px;
text-align: right; text-align: right;
} }
</style> </style>
<template> <template>
<view <view
style="padding: 12px; padding-bottom: 0;width:100%;min-height:450rpx;" style="padding: 12px; padding-bottom: 0; width: 100%; min-height: 450rpx"
: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
class="good-four" class="good-four"
v-for="(item, gli) in goodList" v-for="(item, gli) in goodList"
:key="gli" :key="gli"
@click="openGood(item)" @click="openGood(item)"
: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="img-box"><image style="width: 100%; height: 100%;" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.picUrl" /></view> <view class="tips" v-if="goodsInfo.showGoodsTag"
<view class="good-info"> ><image
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view> :src="goodsInfo.goodsTagPicUrl"
<view class="good-price-info"> mode="widthFix"
<view class="price" :style="{ color: mainColor }">{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }}</view> style="width: 100%"
<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'" /> <view class="img-box"
<u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" /> ><image
<u-button style="width: 100%; height: 100%"
type="primary" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
size="mini" :src="item.picUrl"
:ripple="true" /></view>
:color="goodsInfo.buttonColor" <view class="good-info">
:custom-style=" <view class="good-name" v-if="goodsInfo.showGoodsName">{{
`backgroundColor:${goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}` item.name
" }}</view>
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4" <view class="good-price-info">
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'" <view class="price" :style="{ color: mainColor }">{{
v-else goodsInfo.showGoodsPrice ? getPrice(item.price) : ""
> }}</view>
{{ goodsInfo.buyBtnText }} <view
</u-button> class="buy"
</view> v-if="goodsInfo.showBuyBtn"
</view> @click.stop="showSkuHandler(item)"
</view> >
</view> <u-icon
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku> name="cart-o"
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> size="40"
</view> :color="mainColor"
v-if="goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name="add-o"
size="40"
:color="mainColor"
v-else-if="goodsInfo.buyBtn == 'add'"
/>
<u-button
type="primary"
size="mini"
:ripple="true"
:color="goodsInfo.buttonColor"
:custom-style="`backgroundColor:${goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else
>
{{ goodsInfo.buyBtnText }}
</u-button>
</view>
</view>
</view>
</view>
<good-sku
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>
</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() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
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("url4",url) "/pages/jiuzhai/jz_LineDetail?tcid=" +
uni.navigateTo({ item.id +
url: url "&configId=" +
}); item.subid;
} console.log("url4", url);
//酒店 uni.navigateTo({
else if (item.goodType == 1) { url: url,
uni.navigateTo({ });
url: "/pages/hotel/detail?id=" + item.id }
}); //酒店
} else if (item.goodType == 1) {
//餐食 uni.navigateTo({
else if (item.goodType == 2) { url: "/pages/hotel/detail?id=" + item.id,
uni.navigateTo({ });
url: '/pages/restaurant/detail?id=' + item.id }
}); //餐食
} else if (item.goodType == 2) {
//景点 uni.navigateTo({
else if (item.goodType == 3) { url: "/pages/restaurant/detail?id=" + item.id,
uni.navigateTo({ });
url: '/pages/ticketCoupons/detail?id=' + item.id }
}); //景点
} else if (item.goodType == 3) {
}, uni.navigateTo({
showSkuHandler(g) { url: "/pages/ticketCoupons/detail?id=" + item.id,
this.sku = g; });
this.u = uni.getStorageSync('mall_UserInfo'); }
if (!this.u) { },
this.u = { showSkuHandler(g) {
nickName: '未登录', this.sku = g;
avatarUrl: '' this.u = uni.getStorageSync("mall_UserInfo");
}; if (!this.u) {
this.showAuth = true; this.u = {
} else { nickName: "未登录",
this.showSku = true; avatarUrl: "",
} };
}, this.showAuth = true;
reloadUserinfo() { } else {
this.u = uni.getStorageSync('mall_UserInfo'); this.showSku = true;
// this.showAuth = false; }
}, },
//关闭登录窗口 reloadUserinfo() {
gbAuth() { this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth = false; // this.showAuth = false;
} },
//格式化价格添加.00 //关闭登录窗口
// getPrice(value){ gbAuth() {
// var html,_val; this.showAuth = false;
// value =Number(value).toFixed(2); },
// if(value==0){ //格式化价格添加.00
// value=0; // getPrice(value){
// return html = "¥0"; // var html,_val;
// }else if(value.split('.')[1].substring(1)==0){ // value =Number(value).toFixed(2);
// value = Number(value).toFixed(2); // if(value==0){
// } // value=0;
// _val = value.split('.'); // return html = "¥0";
// return html = '¥'+_val[0]+'.'+_val[1]; // }else if(value.split('.')[1].substring(1)==0){
// } // value = Number(value).toFixed(2);
} // }
// _val = value.split('.');
// return html = '¥'+_val[0]+'.'+_val[1];
// }
},
}; };
</script> </script>
<style> <style scoped>
.good-four { .good-four {
position: relative; position: relative;
margin-bottom: 14px; margin-bottom: 14px;
display: flex; display: flex;
height: 102px; height: 102px;
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10rpx; border-radius: 10rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 1px 1px 0; padding: 0 1px 1px 0;
overflow: hidden; overflow: hidden;
} }
.good-four .tips { .good-four .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.good-four .img-box { .good-four .img-box {
width: 100px; width: 100px;
height: 100px; height: 100px;
} }
.good-four .good-info { .good-four .good-info {
padding: 12px; padding: 12px;
flex: 1; flex: 1;
width: 1rpx; width: 1rpx;
border: 10rpx; border: 10rpx;
padding-bottom: 0; padding-bottom: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* width:20%; */ /* width:20%; */
} }
.good-four .good-info .good-name { .good-four .good-info .good-name {
font-size: 13px; font-size: 13px;
height: 34px; height: 34px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.good-four .good-info .good-price-info { .good-four .good-info .good-price-info {
display: flex; display: flex;
justify-items: center; justify-items: center;
align-items: flex-end; align-items: flex-end;
height: 22px; height: 22px;
flex: 1; flex: 1;
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.good-four .good-info .good-price-info .price { .good-four .good-info .good-price-info .price {
color: #ff4544; color: #ff4544;
flex: 1; flex: 1;
font-size: 14px; font-size: 14px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.good-four .good-info .good-price-info .buy { .good-four .good-info .good-price-info .buy {
width: 24px; width: 24px;
text-align: right; text-align: right;
} }
</style> </style>
...@@ -24,14 +24,12 @@ ...@@ -24,14 +24,12 @@
mode="widthFix" mode="widthFix"
style="width: 100%" style="width: 100%"
/></view> /></view>
<view class="img-box"> <view class="img-box-style5">
<view class="img-show"> <image
<image style="width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0"
style="width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.picUrl"
:src="item.picUrl" />
/>
</view>
</view> </view>
<view class="good-info"> <view class="good-info">
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ <view class="good-name" v-if="goodsInfo.showGoodsName">{{
...@@ -189,7 +187,7 @@ export default { ...@@ -189,7 +187,7 @@ export default {
.her-scoller { .her-scoller {
overflow-x: auto !important; overflow-x: auto !important;
padding: 12px; padding: 12px;
/* display: flex; */ display: flex;
white-space: nowrap; white-space: nowrap;
} }
/* .her-scoller::after { /* .her-scoller::after {
...@@ -200,9 +198,7 @@ export default { ...@@ -200,9 +198,7 @@ export default {
.her-scoller .good-five { .her-scoller .good-five {
position: relative; position: relative;
margin-right: 30rpx; margin-right: 30rpx;
display: inline-block;
width: 560rpx; width: 560rpx;
height: 368rpx;
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;
} }
...@@ -214,36 +210,12 @@ export default { ...@@ -214,36 +210,12 @@ 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: 224rpx;
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;
} }
......
<template> <template>
<view style="padding: 12px; padding-bottom: 0;width:100%;" :style="{ <view
'background-color': goodsInfo.backgroundColor, style="padding: 12px; padding-bottom: 0; width: 100%"
'background-image': goodsInfo.backgroundPicUrl, :style="{
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '' 'background-color': goodsInfo.backgroundColor,
}"> 'background-image': goodsInfo.backgroundPicUrl,
<view class="good-four" v-for="(item, gli) in goodList" :key="gli" @click="openGood(item)" :style="{ 'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '',
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', }"
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '' >
}"> <view
<view class="tips" v-if="goodsInfo.showGoodsTag"> class="good-four"
<image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width: 100%;" /> v-for="(item, gli) in goodList"
</view> :key="gli"
<view class="img-box"> @click="openGood(item)"
<image style="width: 100%; height: 100%;" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.picUrl" /> :style="{
</view> border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
<view class="good-info"> background:
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view> goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '',
<view class="good-sub-name" v-if="item.subname">{{item.subname}}</view> }"
<view class="good-price-info"> >
<view class="price" :style="{ color: mainColor }">{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }} <view class="tips" v-if="goodsInfo.showGoodsTag">
<!-- <span style='text-decoration: line-through;margin-left: 10px;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> --> <image
</view> :src="goodsInfo.goodsTagPicUrl"
<view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)"> mode="widthFix"
<u-icon name="cart-o" size="40" :color="mainColor" v-if="goodsInfo.buyBtn == 'cart'" /> style="width: 100%"
<u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" /> />
<u-button type="primary" size="mini" :ripple="true" :color="goodsInfo.buttonColor" :custom-style=" </view>
`backgroundColor:${goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}` <view class="img-box">
" <image
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4" :shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'" style="width: 100%; height: 100%"
v-else> :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
{{ goodsInfo.buyBtnText }} :src="item.picUrl"
</u-button> />
</view> </view>
</view> <view class="good-info">
</view> <view class="good-name" v-if="goodsInfo.showGoodsName">{{
</view> item.name
<good-sku v-if="showSku" borderRadius="20" v-model="showSku" :good="sku" :option-type="2"></good-sku> }}</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <view class="good-sub-name" v-if="item.subname">{{
</view> item.subname
}}</view>
<view class="good-price-info">
<view class="price" :style="{ color: mainColor }"
>{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : "" }}
<!-- <span style='text-decoration: line-through;margin-left: 10px;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> -->
</view>
<view
class="buy"
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
type="primary"
size="mini"
:ripple="true"
:color="goodsInfo.buttonColor"
:custom-style="`backgroundColor:${goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else
>
{{ goodsInfo.buyBtnText }}
</u-button>
</view>
</view>
</view>
</view>
<good-sku
v-if="showSku"
borderRadius="20"
v-model="showSku"
:good="sku"
:option-type="2"
></good-sku>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</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() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
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("url6",url) "/pages/jiuzhai/jz_LineDetail?tcid=" +
uni.navigateTo({ item.id +
url: url "&configId=" +
}); item.subid;
} console.log("url6", url);
//酒店 uni.navigateTo({
else if (item.goodType == 1) { url: url,
uni.navigateTo({ });
url: "/pages/hotel/detail?id=" + item.id }
}); //酒店
} else if (item.goodType == 1) {
//餐食 uni.navigateTo({
else if (item.goodType == 2) { url: "/pages/hotel/detail?id=" + item.id,
uni.navigateTo({ });
url: '/pages/restaurant/detail?id=' + item.id }
}); //餐食
} else if (item.goodType == 2) {
//景点 uni.navigateTo({
else if (item.goodType == 3) { url: "/pages/restaurant/detail?id=" + item.id,
uni.navigateTo({ });
url: '/pages/ticketCoupons/detail?id=' + item.id }
}); //景点
} else if (item.goodType == 3) {
}, uni.navigateTo({
showSkuHandler(g) { url: "/pages/ticketCoupons/detail?id=" + item.id,
this.sku = g; });
this.u = uni.getStorageSync('mall_UserInfo'); }
if (!this.u) { },
this.u = { showSkuHandler(g) {
nickName: '未登录', this.sku = g;
avatarUrl: '' this.u = uni.getStorageSync("mall_UserInfo");
}; if (!this.u) {
this.showAuth = true; this.u = {
} else { nickName: "未登录",
this.showSku = true; avatarUrl: "",
} };
}, this.showAuth = true;
reloadUserinfo() { } else {
this.u = uni.getStorageSync('mall_UserInfo'); this.showSku = true;
// this.showAuth = false; }
}, },
//关闭登录窗口 reloadUserinfo() {
gbAuth() { this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth = false; // this.showAuth = false;
} },
} //关闭登录窗口
}; gbAuth() {
this.showAuth = false;
},
},
};
</script> </script>
<style> <style scoped>
.good-four { .good-four {
position: relative; position: relative;
margin-bottom: 14px; margin-bottom: 14px;
display: flex; display: flex;
height: 102px; height: 102px;
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10rpx; border-radius: 10rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 1px 1px 0; padding: 0 1px 1px 0;
overflow: hidden; overflow: hidden;
} }
.good-four .tips { .good-four .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.good-four .img-box { .good-four .img-box {
width: 100px; width: 100px;
height: 100px; height: 100px;
} }
.good-four .good-info { .good-four .good-info {
padding: 12px; padding: 12px;
flex: 1; flex: 1;
width: 1rpx; width: 1rpx;
border: 10rpx; border: 10rpx;
padding-bottom: 0; padding-bottom: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* width:20%; */ /* width:20%; */
} }
.good-four .good-info .good-name { .good-four .good-info .good-name {
font-size: 13px; font-size: 13px;
height: 34px; height: 34px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.good-four .good-info .good-price-info { .good-four .good-info .good-price-info {
display: flex; display: flex;
justify-items: center; justify-items: center;
align-items: flex-end; align-items: flex-end;
height: 22px; height: 22px;
flex: 1; flex: 1;
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.good-four .good-info .good-price-info .price { .good-four .good-info .good-price-info .price {
color: #ff4544; color: #ff4544;
flex: 1; flex: 1;
font-size: 14px; font-size: 14px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.good-four .good-info .good-price-info .buy { .good-four .good-info .good-price-info .buy {
width: 24px; width: 24px;
text-align: right; text-align: right;
} }
..good-four .good-info .good-sub-name { ..good-four .good-info .good-sub-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
/* -webkit-line-clamp: 2; /* -webkit-line-clamp: 2;
-webkit-box-orient: vertical; */ -webkit-box-orient: vertical; */
white-space: nowrap; white-space: nowrap;
margin-bottom: 10rpx; margin-bottom: 10rpx;
font-size: 22rpx; font-size: 22rpx;
color: #999999; color: #999999;
/* height: 37px; */ /* height: 37px; */
} }
</style> </style>
<template> <template>
<view style="padding:0 15px;width:100%;" :style="{ <view
'background-color': goodsInfo.backgroundColor, style="padding: 0 15px; width: 100%"
'background-image': goodsInfo.backgroundPicUrl, :style="{
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '' 'background-color': goodsInfo.backgroundColor,
}"> 'background-image': goodsInfo.backgroundPicUrl,
<view class="good-seven" v-for="(item, gli) in goodList" :key="gli" @click="openGood(item)" :style="{ 'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '',
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', }"
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '' >
}"> <view
<view class="tips" v-if="goodsInfo.showGoodsTag"> class="good-seven"
<image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width: 100%;" /> v-for="(item, gli) in goodList"
</view> :key="gli"
<view class="img-box"> @click="openGood(item)"
<template v-if="item.imglist&&item.imglist.length==1"> :style="{
<image class="img-0" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.imglist[0]" /> border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
<image class="img-1" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.imglist[0]" /> background:
<image class="img-2" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.imglist[0]" /> goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '',
</template> }"
<template v-if="item.imglist&&item.imglist.length==2"> >
<image class="img-0" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.imglist[0]" /> <view class="tips" v-if="goodsInfo.showGoodsTag">
<image class="img-1" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.imglist[1]" /> <image
<image class="img-2" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.imglist[0]" /> :src="goodsInfo.goodsTagPicUrl"
</template> mode="widthFix"
<template v-if="item.imglist&&item.imglist.length>=3"> style="width: 100%"
<image class="img-0" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.imglist[0]" /> />
<image class="img-1" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.imglist[1]" /> </view>
<image class="img-2" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.imglist[2]" /> <view class="img-box">
</template> <template v-if="item.imglist && item.imglist.length == 1">
</view> <image
<view class="good-info"> class="img-0"
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }} </view> :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
<view class="sencond-title" v-if="item.subname">{{item.subname}}</view> :src="item.imglist[0]"
<view class="good-price-info"> />
<view style="display:none;"> <image
<u-rate :current="item.courseScore!=null &&item.courseScore>0?item.courseScore:'5'" :active-color="mainColor" class="img-1"
inactive-color="#DDDDDD" active-icon="star" inactive-icon="star-o" size="34" :disabled="true"></u-rate> :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
<text class="good-rb-text">{{item.courseScore!=null &&item.courseScore>0?item.courseScore.toFixed(1):'5.0'}}分</text> :src="item.imglist[0]"
</view> />
<view class="price" :style="{ color: mainColor }" v-if="item.price>0 && goodsInfo.showGoodsPrice">{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }} <image
<span style='text-decoration: line-through;margin-left: 3px;font-size: 10px;color: gray;font-family: aa;'>原价:{{goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ''}}</span> class="img-2"
</view> :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
<view class="price" v-else-if="goodsInfo.showGoodsPrice" style="font-size:13px;color:#999999">免费</view> :src="item.imglist[0]"
<view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)"> />
<u-icon name="cart-o" size="40" :color="mainColor" v-if="goodsInfo.buyBtn == 'cart'" /> </template>
<u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" /> <template v-if="item.imglist && item.imglist.length == 2">
<u-button type="primary" size="mini" :ripple="true" :color="goodsInfo.buttonColor" :custom-style=" <image
`backgroundColor:${goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}` class="img-0"
" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4" :shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'" :src="item.imglist[0]"
v-else> />
{{ goodsInfo.buyBtnText }} <image
</u-button> class="img-1"
</view> :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
</view> :src="item.imglist[1]"
</view> />
</view> <image
<good-sku v-if="showSku" borderRadius="20" v-model="showSku" :good="sku" :option-type="2"></good-sku> class="img-2"
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
</view> :src="item.imglist[0]"
/>
</template>
<template v-if="item.imglist && item.imglist.length >= 3">
<image
class="img-0"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.imglist[0]"
/>
<image
class="img-1"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.imglist[1]"
/>
<image
class="img-2"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.imglist[2]"
/>
</template>
</view>
<view class="good-info">
<view class="good-name" v-if="goodsInfo.showGoodsName"
>{{ item.name }}
</view>
<view class="sencond-title" v-if="item.subname">{{
item.subname
}}</view>
<view class="good-price-info">
<view style="display: none">
<u-rate
:current="
item.courseScore != null && item.courseScore > 0
? item.courseScore
: '5'
"
:active-color="mainColor"
inactive-color="#DDDDDD"
active-icon="star"
inactive-icon="star-o"
size="34"
:disabled="true"
></u-rate>
<text class="good-rb-text"
>{{
item.courseScore != null && item.courseScore > 0
? item.courseScore.toFixed(1)
: "5.0"
}}分</text
>
</view>
<view
class="price"
:style="{ color: mainColor }"
v-if="item.price > 0 && goodsInfo.showGoodsPrice"
>{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : "" }}
<span
style="
text-decoration: line-through;
margin-left: 3px;
font-size: 10px;
color: gray;
font-family: aa;
"
>原价:{{
goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ""
}}</span
>
</view>
<view
class="price"
v-else-if="goodsInfo.showGoodsPrice"
style="font-size: 13px; color: #999999"
>免费</view
>
<view
class="buy"
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
type="primary"
size="mini"
:ripple="true"
:color="goodsInfo.buttonColor"
:custom-style="`backgroundColor:${goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else
>
{{ goodsInfo.buyBtnText }}
</u-button>
</view>
</view>
</view>
</view>
<good-sku
v-if="showSku"
borderRadius="20"
v-model="showSku"
:good="sku"
:option-type="2"
></good-sku>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</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: {},
IsEducation: 1 IsEducation: 1,
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.IsEducation = uni.getStorageSync('basedata') ? this.IsEducation = uni.getStorageSync("basedata")
(uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle ? uni.getStorageSync("basedata").mall.setting.mallStyle.IsEducation
.IsEducation : 0) : ? uni.getStorageSync("basedata").mall.setting.mallStyle.IsEducation
0; : 0
}, : 0;
methods: { },
openGood(item) { methods: {
//线路 openGood(item) {
if (item.goodType == 4) { //线路
var url="/pages/jiuzhai/jz_LineDetail?tcid=" + item.id + '&configId=' + item.subid; if (item.goodType == 4) {
console.log("url7",url) var url =
uni.navigateTo({ "/pages/jiuzhai/jz_LineDetail?tcid=" +
url: url item.id +
}); "&configId=" +
} item.subid;
//酒店 console.log("url7", url);
else if (item.goodType == 1) { uni.navigateTo({
uni.navigateTo({ url: url,
url: "/pages/hotel/detail?id=" + item.id });
}); }
} //酒店
//餐食 else if (item.goodType == 1) {
else if (item.goodType == 2) { uni.navigateTo({
uni.navigateTo({ url: "/pages/hotel/detail?id=" + item.id,
url: '/pages/restaurant/detail?id=' + item.id });
}); }
} //餐食
//景点 else if (item.goodType == 2) {
else if (item.goodType == 3) { uni.navigateTo({
uni.navigateTo({ url: "/pages/restaurant/detail?id=" + item.id,
url: '/pages/ticketCoupons/detail?id=' + item.id });
}); }
} //景点
}, else if (item.goodType == 3) {
showSkuHandler(g) { uni.navigateTo({
this.sku = g; url: "/pages/ticketCoupons/detail?id=" + item.id,
this.u = uni.getStorageSync('mall_UserInfo'); });
if (!this.u) { }
this.u = { },
nickName: '未登录', showSkuHandler(g) {
avatarUrl: '' this.sku = g;
}; this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth = true; if (!this.u) {
} else { this.u = {
this.showSku = true; nickName: "未登录",
} avatarUrl: "",
}, };
reloadUserinfo() { this.showAuth = true;
this.u = uni.getStorageSync('mall_UserInfo'); } else {
// this.showAuth = false; this.showSku = true;
}, }
//关闭登录窗口 },
gbAuth() { reloadUserinfo() {
this.showAuth = false; this.u = uni.getStorageSync("mall_UserInfo");
} // this.showAuth = false;
} },
}; //关闭登录窗口
gbAuth() {
this.showAuth = false;
},
},
};
</script> </script>
<style> <style scoped>
.good-seven { .good-seven {
position: relative; position: relative;
margin-bottom: 14px; margin-bottom: 14px;
display: flex; display: flex;
/* height: 102px; */ /* height: 102px; */
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10rpx; border-radius: 10rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 1px 1px 0; padding: 0 1px 1px 0;
overflow: hidden; overflow: hidden;
padding-bottom: 14px; padding-bottom: 14px;
border-bottom: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2;
} }
.good-seven:last-child { .good-seven:last-child {
padding-bottom: 0; padding-bottom: 0;
border-bottom: none; border-bottom: none;
} }
.good-seven .tips { .good-seven .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.good-seven .img-box { .good-seven .img-box {
width: 266rpx; width: 266rpx;
height: 260rpx; height: 260rpx;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
border-radius: 20rpx; border-radius: 20rpx;
} }
.good-seven .img-box .img-0 { .good-seven .img-box .img-0 {
width: 200rpx; width: 200rpx;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
height: 260rpx; height: 260rpx;
z-index: 3; z-index: 3;
} }
.good-seven .img-box .img-1 { .good-seven .img-box .img-1 {
width: 200rpx; width: 200rpx;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
left: 40rpx; left: 40rpx;
top: 20rpx; top: 20rpx;
height: 220rpx; height: 220rpx;
opacity: 0.6; opacity: 0.6;
z-index: 2; z-index: 2;
} }
.good-seven .img-box .img-2 { .good-seven .img-box .img-2 {
width: 200rpx; width: 200rpx;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
left: 66rpx; left: 66rpx;
top: 40rpx; top: 40rpx;
height: 180rpx; height: 180rpx;
opacity: 0.3; opacity: 0.3;
z-index: 1; z-index: 1;
} }
.good-seven .good-info { .good-seven .good-info {
padding-left: 12px; padding-left: 12px;
flex: 1; flex: 1;
width: 1rpx; width: 1rpx;
border: 10rpx; border: 10rpx;
padding-bottom: 0; padding-bottom: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* width:20%; */ /* width:20%; */
} }
.good-seven .good-info .good-name { .good-seven .good-info .good-name {
font-size: 30rpx; font-size: 30rpx;
max-height: 80rpx; max-height: 80rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
color: #111; color: #111;
} }
.good-seven .good-info .good-price-info { .good-seven .good-info .good-price-info {
display: flex; display: flex;
justify-items: center; justify-items: center;
justify-content: space-between; justify-content: space-between;
align-items: flex-end; align-items: flex-end;
height: 10px; height: 10px;
flex: 1; flex: 1;
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.good-seven .good-info .sencond-title { .good-seven .good-info .sencond-title {
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
color: #999999; color: #999999;
line-height: 32rpx; line-height: 32rpx;
margin-top: 5px; margin-top: 5px;
text-overflow: -o-ellipsis-lastline; text-overflow: -o-ellipsis-lastline;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
line-clamp: 3; line-clamp: 3;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.good-seven .good-rb-text { .good-seven .good-rb-text {
font-size: 32rpx; font-size: 32rpx;
color: #999999; color: #999999;
margin-left: 2px; margin-left: 2px;
} }
.good-seven .good-info .good-price-info .price { .good-seven .good-info .good-price-info .price {
color: #ff4544; color: #ff4544;
font-size: 14px; font-size: 14px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.good-seven .good-info .good-price-info .buy { .good-seven .good-info .good-price-info .buy {
width: 24px; width: 24px;
text-align: right; text-align: right;
} }
</style> </style>
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