Commit 3ab7d4c4 authored by 罗超's avatar 罗超

1

parent 5bb2da23
<template> <template>
<div <div
: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)' : '',
}" }"
> >
<div <div
v-for="(item, gli) in goodList" v-for="(item, gli) in goodList"
:key="gli" :key="gli"
class="good-one" class="good-one-style1"
@click="openGood(item)" style="width: calc(100vw - 24px)"
:style="{ @click="openGood(item)"
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', :style="{
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '' border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
}" background:
> goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '',
<div class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width: 100%;" /></div> }"
<image >
style="width: calc(100vw - 24px); height: 50vw;border-top-left-radius: 10px; border-top-right-radius: 10px;" <div class="tips" v-if="goodsInfo.showGoodsTag">
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" <image
:src="item.picUrl" :src="goodsInfo.goodsTagPicUrl"
v-if="goodsInfo.goodsCoverProportion == '3-2'" mode="widthFix"
/> style="width: 100%"
<image />
style=" </div>
width: calc(100vw - 24px); <image
height: 100vw; style="
border-radius: 10rpx 10rpx 0 0; width: calc(100vw - 24px);
border-top-left-radius: 10px; border-top-right-radius: 10px; height: 50vw;
" border-top-left-radius: 10px;
v-if="goodsInfo.goodsCoverProportion == '1-1'" border-top-right-radius: 10px;
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" "
:src="item.picUrl" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
/> :src="item.picUrl"
<div class="good-info"> v-if="goodsInfo.goodsCoverProportion == '3-2'"
<div class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</div> />
<view class="good-sub-name" v-if="item.subname">{{item.subname}}</view> <image
<div class="good-price-info"> style="
<view style="display: flex;justify-content: space-between;width:100%;align-items: center;"> width: calc(100vw - 24px);
<view style="font-size:22rpx;color:#999999;"> height: 100vw;
{{item.thirdname}} border-radius: 10rpx 10rpx 0 0;
</view> border-top-left-radius: 10px;
<view> border-top-right-radius: 10px;
<span class="price"> "
<span style="font-size: 28rpx;font-weight: 500;margin-right: 2rpx;"></span> v-if="goodsInfo.goodsCoverProportion == '1-1'"
{{ goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : '' }} :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
</span> :src="item.picUrl"
</view> />
</view> <div class="good-info">
<span class="buy" v-if="goodsInfo.showBuyBtn" style="display:none;"> <div class="good-name" v-if="goodsInfo.showGoodsName">
<u-icon name="cart-o" size="40" style="color:#ff4544" v-if="goodsInfo.buyBtn == 'cart'" /> {{ item.name }}
<u-icon name="add-o" size="40" style="color:#ff4544" v-else-if="goodsInfo.buyBtn == 'add'" /> </div>
<u-button <view class="good-sub-name" v-if="item.subname">{{
type="primary" item.subname
size="mini" }}</view>
:ripple="true" <div class="good-price-info">
:color="goodsInfo.buttonColor" <view
style="
:custom-style="{ display: flex;
'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor , justify-content: space-between;
'color':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF' width: 100%;
}" align-items: center;
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4" "
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'" >
v-else <view style="font-size: 22rpx; color: #999999">
> {{ item.thirdname }}
</view>
{{ goodsInfo.buyBtnText }} <view>
</u-button> <span class="price">
</span> <span
</div> style="font-size: 28rpx; font-weight: 500; margin-right: 2rpx"
</div> ></span
</div> >
<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> goodsInfo.showGoodsPrice ? getPrice(item.OriginalPrice) : ""
</div> }}
</span>
</view>
</view>
<span class="buy" v-if="goodsInfo.showBuyBtn" style="display: none">
<u-icon
name="cart-o"
size="40"
style="color: #ff4544"
v-if="goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name="add-o"
size="40"
style="color: #ff4544"
v-else-if="goodsInfo.buyBtn == 'add'"
/>
<u-button
type="primary"
size="mini"
:ripple="true"
:color="goodsInfo.buttonColor"
:custom-style="{
backgroundColor:
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? '#FFF'
: 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>
</span>
</div>
</div>
</div>
<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>
</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("url1",url) "/pages/jiuzhai/jz_LineDetail?tcid=" +
uni.navigateTo({ item.id +
url:url "&configId=" +
}); item.subid;
} console.log("url1", 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-one { .good-one-style1 {
box-sizing: border-box;
margin: 12px; margin: 12px;
position: relative; position: relative;
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10px; border-radius: 10px;
padding-bottom: 10px; padding-bottom: 10px;
overflow: hidden; overflow: hidden;
box-shadow: 0 4px 10px 1px #D2D2D2; box-shadow: 0 4px 10px 1px #d2d2d2;
} }
.good-one .tips { .good-one-style1 .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-one .guding { .good-one-style1 .guding {
position: relative; position: relative;
} }
.good-one .guding .img-box { .good-one-style1 .guding .img-box {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
top: 0; top: 0;
} }
.good-one .good-info { .good-one-style1 .good-info {
padding: 12rpx; width: 700rpx;
padding-bottom: 0; box-sizing: border-box;
margin-top: -5px; padding: 12rpx;
padding-bottom: 0;
margin-top: -5px;
} }
.good-one .good-info .good-name { .good-one-style1 .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-bottom: 10px; margin-bottom: 10px;
font-size:32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
} }
.good-one .good-info .good-sub-name{ .good-one-style1 .good-info .good-sub-name {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
color:#999999; color: #999999;
margin-bottom: 10px; margin-bottom: 10px;
} }
.good-one .good-info .good-price-info { .good-one-style1 .good-info .good-price-info {
display: flex; display: flex;
} }
.good-one .good-info .good-price-info .price { .good-one-style1 .good-info .good-price-info .price {
color: #ff4544; color: #ff4544;
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
flex: 1; flex: 1;
} }
.good-one .good-info .good-price-info .buy { .good-one-style1 .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