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">
...@@ -13,11 +13,21 @@ ...@@ -13,11 +13,21 @@
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
? '#FFF'
: '',
}" }"
> >
<div class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" /></div> <div class="tips" v-if="goodsInfo.showGoodsTag">
<image
:src="goodsInfo.goodsTagPicUrl"
mode="widthFix"
style="width: 100%"
/>
</div>
<div class="img-box"> <div class="img-box">
<div class="img-show"> <div class="img-show">
<image <image
...@@ -32,27 +42,63 @@ ...@@ -32,27 +42,63 @@
</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">
{{ item.name }}
</div>
<div class="good-price-info"> <div class="good-price-info">
<view class="price" :style="{ color: mainColor }"> <view class="price" :style="{ color: mainColor }">
<span>{{ 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> goodsInfo.showGoodsPrice ? getPrice(item.price) : ""
}}</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:${
`backgroundColor:${goodsInfo.buttonColor},color:${ goodsInfo.buttonColor
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF' },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'
" "
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
v-else v-else
> >
{{ goodsInfo.buyBtnText }} {{ goodsInfo.buyBtnText }}
...@@ -63,28 +109,38 @@ ...@@ -63,28 +109,38 @@
</div> </div>
</u-col> </u-col>
</u-row> </u-row>
<good-sku v-if="showSku" borderRadius="20" v-model="showSku" :good="sku" :option-type="2"></good-sku> <good-sku
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> 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> </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() {
...@@ -94,38 +150,42 @@ export default { ...@@ -94,38 +150,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("url3",url) "/pages/jiuzhai/jz_LineDetail?tcid=" +
item.id +
"&configId=" +
item.subid;
console.log("url3", 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 {
...@@ -133,18 +193,18 @@ export default { ...@@ -133,18 +193,18 @@ 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>
<style> <style scoped>
.good-three { .good-three {
position: relative; position: relative;
margin-bottom: 12px; margin-bottom: 12px;
......
<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
...@@ -14,28 +14,63 @@ ...@@ -14,28 +14,63 @@
@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="tips" v-if="goodsInfo.showGoodsTag"
<view class="img-box"><image style="width: 100%; height: 100%;" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.picUrl" /></view> ><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="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">{{
item.name
}}</view>
<view class="good-price-info"> <view class="good-price-info">
<view class="price" :style="{ color: mainColor }">{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }}</view> <view class="price" :style="{ color: mainColor }">{{
<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'" /> }}</view>
<u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" /> <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 <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 }}
...@@ -44,28 +79,38 @@ ...@@ -44,28 +79,38 @@
</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() {
...@@ -75,38 +120,42 @@ export default { ...@@ -75,38 +120,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("url4",url) "/pages/jiuzhai/jz_LineDetail?tcid=" +
item.id +
"&configId=" +
item.subid;
console.log("url4", 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 {
...@@ -114,13 +163,13 @@ export default { ...@@ -114,13 +163,13 @@ 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;
} },
//格式化价格添加.00 //格式化价格添加.00
// getPrice(value){ // getPrice(value){
// var html,_val; // var html,_val;
...@@ -134,11 +183,11 @@ export default { ...@@ -134,11 +183,11 @@ export default {
// _val = value.split('.'); // _val = value.split('.');
// return html = '¥'+_val[0]+'.'+_val[1]; // 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;
......
...@@ -24,15 +24,13 @@ ...@@ -24,15 +24,13 @@
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">{{
item.name item.name
...@@ -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
style="padding: 12px; padding-bottom: 0; width: 100%"
: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 class="good-four" v-for="(item, gli) in goodList" :key="gli" @click="openGood(item)" :style="{ >
<view
class="good-four"
v-for="(item, gli) in goodList"
:key="gli"
@click="openGood(item)"
: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"> <view class="tips" v-if="goodsInfo.showGoodsTag">
<image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width: 100%;" /> <image
:src="goodsInfo.goodsTagPicUrl"
mode="widthFix"
style="width: 100%"
/>
</view> </view>
<view class="img-box"> <view class="img-box">
<image style="width: 100%; height: 100%;" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.picUrl" /> <image
style="width: 100%; height: 100%"
: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" v-if="item.subname">{{item.subname}}</view> item.name
}}</view>
<view class="good-sub-name" v-if="item.subname">{{
item.subname
}}</view>
<view class="good-price-info"> <view class="good-price-info">
<view class="price" :style="{ color: mainColor }">{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }} <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> --> <!-- <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>
<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"
<u-button type="primary" size="mini" :ripple="true" :color="goodsInfo.buttonColor" :custom-style=" @click.stop="showSkuHandler(item)"
`backgroundColor:${goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}` >
<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'
" "
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4" :shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'" v-else
v-else> >
{{ goodsInfo.buyBtnText }} {{ goodsInfo.buyBtnText }}
</u-button> </u-button>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<good-sku v-if="showSku" borderRadius="20" v-model="showSku" :good="sku" :option-type="2"></good-sku> <good-sku
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> 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> </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() {
...@@ -66,38 +126,42 @@ ...@@ -66,38 +126,42 @@
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=" +
item.id +
"&configId=" +
item.subid;
console.log("url6", 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 {
...@@ -105,19 +169,19 @@ ...@@ -105,19 +169,19 @@
} }
}, },
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>
<style> <style scoped>
.good-four { .good-four {
position: relative; position: relative;
margin-bottom: 14px; margin-bottom: 14px;
display: flex; display: flex;
...@@ -127,23 +191,23 @@ ...@@ -127,23 +191,23 @@
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;
...@@ -152,9 +216,9 @@ ...@@ -152,9 +216,9 @@
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;
...@@ -162,32 +226,32 @@ ...@@ -162,32 +226,32 @@
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;
...@@ -198,5 +262,5 @@ ...@@ -198,5 +262,5 @@
font-size: 22rpx; font-size: 22rpx;
color: #999999; color: #999999;
/* height: 37px; */ /* height: 37px; */
} }
</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