Authored by 李奇

商品详情页部分修改

... ... @@ -18,15 +18,15 @@ module.exports = {
app_type: 1
},
domains: {
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/'
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
/* api: 'http://dev-api.yohops.com:9999/',
service: 'http://dev-service.yohops.com:9999/',*/
// singleApi: 'http://192.168.102.27:8092/'
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
singleApi: 'http://single.yoho.cn/'
// singleApi: 'http://192.168.102.205:8080/gateway/',//'http://single.yoho.cn/',
... ...
<template>
<div class="image-carousel">
<swipe :continuous="false" :auto="0" :show-indicators="goods && goods.length > 1" v-ref:swipe>
<swipe-item v-for="item in goods">
<img title="{{item.title}}"
:src="item.color_image | resize 750 1000"
width="100%" alt=""
@click.prevent="showcase()">
</swipe-item>
</swipe>
<div class="swipe-wrap">
<swipe :continuous="true" :auto="0" :show-indicators="goods && goods.length > 1" v-ref:swipe>
<swipe-item v-for="item in goods">
<img title="{{item.title}}"
:src="item.color_image | resize 580 773"
width="100%" alt=""
@click.prevent="showcase()">
</swipe-item>
</swipe>
</div>
<div class="indicators-bg"></div>
</div>
</template>
<style l>
.image-carousel {
width: 100%;
height: 1000px;
height: 833px;
overflow: hidden;
.swipe-wrap {
width: 100%;
padding: 0 85px;
font-size: 0;
}
.swipe {
height: 100%;
display: inline-block;
width: 100%;
height: 773px;
overflow: visible;
.swipe-items-wrap > div {
}
.swipe-item {
width: 100%;
&.active {
}
}
}
.swipe-indicators {
left: auto;
right: 32px;
bottom: -35px;
}
.swipe-indicator {
width: 8px;
height: 8px;
line-height: 12px;
width: 10px;
height: 10px;
line-height: 10px;
display: inline-block;
border-radius: 0;
&.active {
width: 12px;
height: 12px;
width: 20px;
height: 10px;
background: #000;
opacity: 0.6;
margin: -2px 5px;
margin: 0 5px;
}
}
.indicators-bg {
height: 60px;
width: 100%;
background-color: #f7f7f7;
}
}
</style>
<script>
... ... @@ -57,6 +86,10 @@
swipeItem: swipe.SwipeItem,
},
methods: {
initActiveSides: function () {
},
showcase: function() {
const opts = {
images: this.goods.map((item) => {
... ...
... ... @@ -2,15 +2,24 @@
<top-nav v-if="isApp" :title="entity.product_name" :img="firstImage | resize 300 300"></top-nav>
<show-box :is-first="true">
<image-carousel :goods="entity.goods_list"></image-carousel>
<div class="title-box">
<h1 class="line-clamp-2">{{entity.product_name}}</h1>
<i class="price" v-if="entity.market_price > entity.sales_price"
:class="{'strike-through': entity.sales_price > 0}">{{entity.format_market_price}}</i>
</show-box>
<show-box :zero-top-margin="true">
<ul class="item-action">
<li><i class="brand icon icon-share2"></i><span class="action-text">{{brand.brand_name
}}</span></li>
<li><i class="brand icon icon-focus"></i><span class="action-text">收藏</span></li>
<li><i class="brand icon icon-share2"></i><span class="action-text">分享</span></li>
</ul>
<hr>
<div class="item-price">
<i v-if="entity.sales_price > 0"
:class="{price: true, highlight: entity.market_price > entity.sales_price}">
{{entity.format_sales_price !== '0' ? entity.format_sales_price : entity.format_market_price}}
</i>
<i class="price" v-if="entity.market_price > entity.sales_price"
:class="{'line-through': entity.sales_price > 0}">{{entity.format_market_price}}</i>
<p class="product-name">{{entity.product_name}}</p>
<ul class="vip-level" v-if="entity.vipPrice">
<li class="icons-item" v-for="vip in entity.vipPrice">
<span class="vip-img vip-{{vip.level}}"></span>
... ... @@ -18,28 +27,17 @@
</li>
</ul>
</div>
</show-box>
<show-box class="brand" v-if="brand">
<img :src="brand.brand_ico | resize 110 68"/>
<h2>{{brand.brand_name}}</h2>
<div class="brand-go">
<span>进入店铺</span>
<span class="icon icon-right"></span>
<hr>
<div>
<ul class="service">
<li><i class="icon icon-real"></i>100%品牌正品</li>
<li class="return" v-if="intro.supportRefundExchange === 'N'"><i class="icon icon-unsupport-seven"></i>不支持7天无理由退换货
</li>
<li class="return" v-else><i class="icon icon-seven"></i>支持7天无理由退换货</li>
<li><i class="icon icon-onlineservice"></i>便捷在线客服</li>
</ul>
</div>
<a :href="brand.brand_domain | brandUrl"></a>
</show-box>
<show-box>
<ul class="service">
<li><i class="icon icon-real"></i>100%品牌正品</li>
<li class="return" v-if="intro.supportRefundExchange === 'N'"><i class="icon icon-unsupport-seven"></i>不支持7天无理由退换货</li>
<li class="return" v-else><i class="icon icon-seven"></i>支持7天无理由退换货</li>
<li><i class="icon icon-onlineservice"></i>便捷在线客服</li>
</ul>
</show-box>
<show-box v-if="intro.productDescBo">
<h2>商品信息</h2>
<i>DESCRIPTION</i>
... ... @@ -329,35 +327,76 @@
background: #fff;
}
.title-box {
ul.item-action {
height: 103px;
font-size: 0;
text-align: center;
margin-bottom: 50px;
max-height: 195px;
h1 {
li {
position: relative;
display: inline-block;
margin-top: 70px;
text-align: center;
font-size: 30px;
line-height: 48px;
font-weight: normal;
max-width: 580px;
margin: 30px auto;
font-size: 22px;
width: 250px;
&:first-child {
float: left;
width: 210px;
}
&:last-child {
float: right;
width: 210px;
}
}
i.price {
color: #b0b0b0;
li .action-text {
display: inline-block;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
li .icon {
position: absolute;
margin-left: -20px;
top: -50px;
left: 50%;
font-size: 34px;
}
}
.item-price {
text-align: left;
margin-top: 45px;
margin-bottom: 40px;
max-height: 195px;
.price {
color: #b0b0b0;
font-size: 32px;
font-style: normal;
font-family: "BrownStd-Regular";
&.strike-through {
&.line-through {
margin-left: 8px;
font-size: 22px;
text-decoration: line-through;
}
&.highlight {
color: #d0021b;
color: #b0021b;
}
}
.product-name {
font-size: 24px;
color: #000;
}
.vip-level {
padding: 0 40px;
min-height: 2.2rem;
... ...
<template>
<div class="show-box" :class="{ 'first-box': isFirst, 'last-box': isLast }">
<div class="show-box" :class="{ 'first-box': isFirst, 'last-box': isLast, 'zero-top-margin': zeroTopMargin }">
<slot></slot>
</div>
</template>
... ... @@ -73,13 +73,18 @@
&.last-box {
margin-bottom: 99px;
}
&.zero-top-margin {
margin-top: 0;
}
}
</style>
<script>
module.exports = {
props: {
isFirst: [Boolean],
isLast: [Boolean]
isLast: [Boolean],
zeroTopMargin: [Boolean]
},
data() {
return {};
... ...
<template>
<cheader title="商品详情" class="product-header ghost" v-ref:header>
<i class="icon icon-share2" slot="right" @click="share()"></i>
</cheader>
<cheader title="商品详情" class="product-header ghost" v-ref:header></cheader>
</template>
<style>
.product-header {
... ...