Commit 7a9162a7 by 梁建民

Merge branch 'Development' of http://119.23.72.7/liangjianmin/h5 into Development

parents 6b48faa0 6e9c612a
......@@ -18,3 +18,4 @@ yarn-error.log*
*.njsproj
*.sln
*.sw*
......@@ -28,9 +28,33 @@
padding-left: 66px;
h4 {
padding-bottom: 10px;
font-size: 18px;
color: #333333;
line-height: 30px;
strong {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 85%;
height: remFun(0.6rem);
width: auto;
margin-right: remFun(0.08rem);
}
span {
position: relative;
top: remFun(-0.3rem);
font-size: remFun(0.20rem);
color: #ff0000;
border: 1px solid #ff0000;
padding: 0 remFun(0.05rem);
border-radius: 5px;
display: inline-block;
height: remFun(0.3rem);
line-height: remFun(0.28rem);
}
}
}
}
......@@ -101,7 +125,7 @@
}
.xs-3 {
width:25%;
width: 25%;
}
th {
......@@ -113,6 +137,7 @@
td {
border: 1px solid #d9d9d9;
color: #333;
}
}
......@@ -155,7 +180,6 @@
.price {
padding-top: 10px;
.zyqhc {
position: absolute;
width: remFun(3.4rem);
......@@ -204,25 +228,26 @@
top: remFun(0.15rem);
}
.em1 {
padding: 0 0.5em;
}
dl {
font-size: 12px;
dt {
width: 5em;
width:5em;
color: #999;
float: left;
line-height: 30px;
.em1 {
padding: 0 0.5em;
}
}
dd {
padding-left: 5em;
padding-left: 4em;
color: #333;
line-height: 30px;
.toLogin{
margin-right:.15rem;
}
&.onePrice {
font-size: 14px;
}
......@@ -232,6 +257,25 @@
color: red;
font-size: 14px;
}
.isOriginPrice{
color: #999999;
font-size: 12px;
font-weight: normal;
&.isNoOriginPrice{
text-decoration: line-through;
}
}
.isNowPrice{
color: #333;
font-size: 12px;
font-weight: normal;
margin-right:.15rem;
}
.isOriginUsPrice{
color: #333;
font-size: 12px;
font-weight: normal;
}
&.tab {
span {
......@@ -250,6 +294,7 @@
color: #e10601;
border-color: #e10601;
}
&.act-blue {
color: #1080d0;
border-color: #1080d0;
......@@ -327,4 +372,19 @@
}
}
}
.toLogin {
color: rgb(16, 128, 208);
text-decoration: underline;
font-size: 12px;
font-weight: normal;
}
.priceCn {
color: rgb(153, 153, 153);
&.noPriceCn {
text-decoration: line-through
}
}
}
\ No newline at end of file
......@@ -60,8 +60,30 @@
>
<div class="mui-row act" v-for="(itemPrice,index) in item.tiered"
:class="{'dataNo':(index>2)&&!item.priceCheck}">
<p class="mui-col-sm-3 mui-col-xs-3"><font v-html="itemPrice.purchases"></font>+</p>
<p class="mui-col-sm-4 mui-col-xs-4 f-red">{{itemPrice.price_cn}}</p>
<template v-if="item.ac_type==2">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4 f-red">{{itemPrice.price_ac}}</p>
</template>
<template v-else-if="item.ac_type==3">
<template v-if="isCookie">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4 f-red">{{itemPrice.price_ac}}</p>
</template>
<template v-else>
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-if="index==0">
<span class="toLogin" @click="toLogin">登录查看</span>
</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-else>- -</p>
</template>
<template v-else>
<p class="mui-col-sm-6 mui-col-xs-6" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-6 mui-col-xs-6 f-red">{{itemPrice.price_cn}}</p>
</template>
</template>
</div>
</div>
<div class="more-height" v-if="item.tiered&&item.tiered.length>3"
......@@ -309,8 +331,31 @@
>
<div class="mui-row act" v-for="(itemPrice,index) in item.tiered"
:class="{'dataNo':(index>2)&&!item.priceCheck}">
<template v-if="item.ac_type==2||item.ac_type == 1">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4 f-red">{{itemPrice.price_ac}}</p>
</template>
<template v-else-if="item.ac_type==3">
<template v-if="isCookie">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4 f-red">{{itemPrice.price_ac}}</p>
</template>
<template v-else>
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-if="index==0">
<span class="toLogin" @click="toLogin">登录查看</span>
</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-else>- -</p>
</template>
</template>
<template v-else>
<p class="mui-col-sm-6 mui-col-xs-6"><font v-html="itemPrice.purchases"></font>+</p>
<p class="mui-col-sm-6 mui-col-xs-6 f-red">{{itemPrice.price_cn}}</p>
</template>
</div>
</div>
<div class="more-height" v-if="item.tiered&&item.tiered.length>3"
......@@ -392,8 +437,32 @@
>
<div class="mui-row act" v-for="(itemPrice,index) in item.tiered"
:class="{'dataNo':(index>2)&&!item.priceCheck}">
<!-- <p class="mui-col-sm-6 mui-col-xs-6"><font v-html="itemPrice.purchases"></font>+</p>
<p class="mui-col-sm-6 mui-col-xs-6 f-red">{{itemPrice.price_cn}}</p> -->
<template v-if="item.ac_type==2||item.ac_type == 1">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4 f-red">{{itemPrice.price_ac}}</p>
</template>
<template v-else-if="item.ac_type==3">
<template v-if="isCookie">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4 f-red">{{itemPrice.price_ac}}</p>
</template>
<template v-else>
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-if="index==0">
<span class="toLogin" @click="toLogin">登录查看</span>
</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-else>- -</p>
</template>
</template>
<template v-else>
<p class="mui-col-sm-6 mui-col-xs-6"><font v-html="itemPrice.purchases"></font>+</p>
<p class="mui-col-sm-6 mui-col-xs-6 f-red">{{itemPrice.price_cn}}</p>
</template>
</div>
</div>
<div class="more-height" v-if="item.tiered&&item.tiered.length>3"
......@@ -517,6 +586,7 @@
totalMoney:0,//总金额
totalNum:0,//总数量
isNoContent:false,//没有数据展示
isCookie: getCookie("Yo4teW_uid")//是否登入
}
},
computed:{
......@@ -620,6 +690,12 @@
},
},
methods:{
toLogin() {
window.location.href =
window.location.origin +
"/v3/login?referer=" +
encodeURIComponent(window.location.href);
},
isNOD:function(){
//没数据展示
if(this.type==1){
......@@ -1125,4 +1201,14 @@
<style scoped>
@import "../../assets/css/car/index.min.css";
.toLogin {
color: #1080d0;
text-decoration: underline;
font-size: 12px;
font-weight: normal;
}
.noPrice {
text-decoration: line-through;
color: #666;
}
</style>
\ No newline at end of file
......@@ -17,20 +17,30 @@
<template v-if="isZy">
<h4>{{itemchild.sku_name}}</h4>
<p v-if="itemchild.class_id2_name">分类:{{itemchild.class_id2_name}}</p>
<template v-if="itemchild.ac_type == 2 || itemchild.ac_type == 3">
<span class="youhui">优惠</span>
</template>
<template v-if="itemchild.ac_type == 1">
<span class="youhui">抢购</span>
</template>
<p v-if="itemchild.class_name2">分类:{{itemchild.class_name2}}</p>
<p>制造商:{{itemchild.brand_name}}</p>
<p v-if="itemchild.encap">封装:{{itemchild.encap}}</p>
<p>
库存:
<span v-html="itemchild.stock"></span>
(
{{"一"+itemchild.mpq_unit_name +"有"}}
<span class="f-orange" v-html="itemchild.mpq"></span>
{{itemchild.goods_unit_name}}
)
<span v-html="itemchild.purchase_info"></span>)
</p>
</template>
<template v-else>
<h4>{{itemchild.goods_name_temp||itemchild.goods_name}}</h4>
<h4>{{itemchild.goods_name_temp}}</h4>
<template v-if="itemchild.ac_type == 2 || itemchild.ac_type == 3">
<span class="youhui">优惠</span>
</template>
<template v-if="itemchild.ac_type == 1">
<span class="youhui">抢购</span>
</template>
<p>制造商:{{itemchild.brand_name||'- -'}}</p>
<p>
库存:
......@@ -56,14 +66,36 @@
:class="{'zyClass':itemchild.ladder_price&&itemchild.ladder_price.length<4,'zyMoreData':itemchild.ladder_price&&itemchild.ladder_price.length>3}"
>
<div class="mui-row list_data" v-for="(itemPrice,index) in itemchild.ladder_price">
<template v-if="itemchild.ac_type==2||itemchild.ac_type == 1">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4">{{itemPrice.price_ac}}</p>
</template>
<template v-else-if="itemchild.ac_type==3">
<template v-if="isCookie">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4">{{itemPrice.price_ac}}</p>
</template>
<template v-else>
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-if="index==0">
<span class="toLogin" @click="toLogin">登录查看</span>
</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-else>- -</p>
</template>
</template>
<template v-else>
<p class="mui-col-sm-6 mui-col-xs-6" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-6 mui-col-xs-6">{{itemPrice.price_cn}}</p>
</template>
</div>
</div>
<div
class="mui-row list_data f-fff"
v-if="!itemchild.ladder_price||itemchild.ladder_price.length==0"
v-if="itemchild.ladder_price&&itemchild.ladder_price.length==0"
>
<p class="mui-col-sm-6 mui-col-xs-6">- -</p>
<p class="mui-col-sm-6 mui-col-xs-6">- -</p>
......@@ -75,14 +107,36 @@
:class="{'lyClass':itemchild.ladder_price&&itemchild.ladder_price.length<4,'lyMoreData':itemchild.ladder_price&&itemchild.ladder_price.length>3}"
>
<div class="mui-row list_data" v-for="(itemPrice,index) in itemchild.ladder_price">
<template v-if="itemchild.ac_type==2">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4">{{itemPrice.price_ac}}</p>
</template>
<template v-else-if="itemchild.ac_type==3">
<template v-if="isCookie">
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4">{{itemPrice.price_ac}}</p>
</template>
<template v-else>
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4 noPrice">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-if="index==0">
<span class="toLogin" @click="toLogin">登录查看</span>
</p>
<p class="mui-col-sm-4 mui-col-xs-4" v-else>- -</p>
</template>
</template>
<template v-else>
<p class="mui-col-sm-4 mui-col-xs-4" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-4 mui-col-xs-4">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4">{{!itemPrice.price_us?'- -':'$'+itemPrice.price_us}}</p>
</template>
</div>
</div>
<div
class="mui-row list_data f-fff"
v-if="!itemchild.ladder_price||itemchild.ladder_price.length==0"
v-if="itemchild.ladder_price&&itemchild.ladder_price.length==0"
>
<p class="mui-col-sm-4 mui-col-xs-4">- -</p>
<p class="mui-col-sm-4 mui-col-xs-4">- -</p>
......@@ -103,6 +157,11 @@
<template v-if="isZy">
<a class="but" v-if="itemchild.is_buy==1" @click="placeOrder(itemchild.goods_id)">我要下单</a>
<a class="but but-orange" v-else @click="xunjia">立即询价</a>
<div
class="xianshitime"
v-if="itemchild.ac_type == 1"
:ref="'xs'+itemchild.goods_id"
>{{getTimeStr(indexdata)}}</div>
</template>
<template v-else="isZy">
<a class="but" v-if="itemchild.is_buy==1" @click="placeOrder(itemchild.goods_id)">我要下单</a>
......@@ -118,6 +177,7 @@
import Vue from "vue";
import { Lazyload } from "vant";
import bus from "../../util/bus.js";
import { setInterval, setTimeout } from "timers";
Vue.use(Lazyload);
export default {
name: "GoodsOne",
......@@ -135,14 +195,20 @@ export default {
},
data() {
return {
hostName:window.location.origin,
hostName: window.location.origin,
limitLength: 3,
defaultBtn: '更多梯度价格<i class="icon-bot"></i>'
defaultBtn: '更多梯度价格<i class="icon-bot"></i>',
isCookie: getCookie("Yo4teW_uid")
};
},
watch: {},
mounted() {},
methods: {
toLogin() {
window.location.href =
window.location.origin +
"/v3/login?referer=" +
encodeURIComponent(window.location.href);
},
priceRow: function(index, id) {
let dom = document.getElementById("priceContent" + id);
let arrLength = this.dataList[index].ladder_price.length;
......@@ -172,6 +238,51 @@ export default {
},
xunjia() {
bus.$emit("xunjia");
},
getTimeStr(i) {
let self = this;
this.$nextTick(() => {
let element = self.$refs["xs" + self.dataList[i].goods_id][0];
console.log(element);
let endTimer = self.dataList[i].activity_end_time * 1000;
let endTime = new Date(Number(endTimer));
let ts = endTime - new Date();
if (ts > 0) {
let dd = parseInt(ts / 1000 / 60 / 60 / 24, 10);
let hh = parseInt((ts / 1000 / 60 / 60) % 24, 10);
let mm = parseInt((ts / 1000 / 60) % 60, 10);
let ss = parseInt((ts / 1000) % 60, 10);
dd = dd < 10 ? "0" + dd : dd; //天
hh = hh < 10 ? "0" + hh : hh; //时
mm = mm < 10 ? "0" + mm : mm; //分
ss = ss < 10 ? "0" + ss : ss; //秒
let timehtml = dd + "天" + hh + "时" + mm + "分" + ss + "秒";
element.innerHTML = timehtml;
} else {
element.innerHTML = 0 + "天" + 0 + "时" + 0 + "分" + 0 + "秒";
}
let intertime = setInterval(function() {
let endTimer1 = self.dataList[i].activity_end_time * 1000;
let endTime1 = new Date(Number(endTimer1));
let ts1 = endTime1 - new Date();
if (ts1 > 0) {
let dd = parseInt(ts1 / 1000 / 60 / 60 / 24, 10);
let hh = parseInt((ts1 / 1000 / 60 / 60) % 24, 10);
let mm = parseInt((ts1 / 1000 / 60) % 60, 10);
let ss = parseInt((ts1 / 1000) % 60, 10);
dd = dd < 10 ? "0" + dd : dd; //天
hh = hh < 10 ? "0" + hh : hh; //时
mm = mm < 10 ? "0" + mm : mm; //分
ss = ss < 10 ? "0" + ss : ss; //秒
let timehtml1 = dd + "天" + hh + "时" + mm + "分" + ss + "秒";
element.innerHTML = timehtml1;
} else {
element.innerHTML = 0 + "天" + 0 + "时" + 0 + "分" + 0 + "秒";
clearInterval(intertime);
}
}, 1000);
});
}
},
components: {}
......@@ -221,10 +332,22 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.f-red {
font-weight: 400;
color: #1080d0;
max-width: 82%;
width: auto;
display: inline-block;
margin-right: 0.10667rem;
}
.youhui {
position: relative;
top: -.1rem;
font-size: 0.26667rem;
color: #ff0000;
border: 1px solid #ff0000;
padding: 0 0.06667rem;
border-radius: 5px;
display: inline-block;
height: 0.4rem;
line-height: 0.37333rem;
}
h5 {
height: 21px;
......@@ -314,9 +437,9 @@ export default {
}
.but {
height: 30px;
float: right;
// float: right;
line-height: 30px;
width: 100px;
width: 100%;
font-size: 14px;
display: block;
color: #fff;
......@@ -325,6 +448,7 @@ export default {
cursor: pointer;
box-sizing: border-box;
border-radius: 4px;
margin-bottom: 0.1rem;
&.but-orange {
background: #ffa200;
}
......@@ -365,5 +489,22 @@ export default {
margin-left: 5px;
}
}
.toLogin {
color: #1080d0;
text-decoration: underline;
font-size: 12px;
font-weight: normal;
}
.noPrice {
text-decoration: line-through;
}
.xianshitime {
width: 125px;
height: 0.37rem;
line-height: 0.37rem;
margin-top: 0.13rem;
color: #ff0000;
font-size: 12px;
}
}
</style>
......@@ -3,11 +3,18 @@
<div class="details-head">
<div class="head_top clr">
<div class="head_top_left fl">
<img :src="goodDetail.brand_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png'" @error="imgErr" @click="showImagePreview">
<img
:src="goodDetail.brand_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png'"
@error="imgErr"
@click="showImagePreview"
>
</div>
<div class="head_top_right">
<h4>
<strong>{{goodDetail.goods_name}}</strong>
<template v-if="goodDetail.ac_type == 2 || goodDetail.ac_type == 3">
<span>优惠</span>
</template>
</h4>
<p class="icon-hint"></p>
</div>
......@@ -66,6 +73,7 @@
<table>
<tbody>
<tr>
<!-- 2 活动价 3会员价 -->
<template v-if="goodDetail.ac_type == 2 || goodDetail.ac_type == 3">
<th class="xs-3">数量</th>
<th class="xs-3">原价(含税)</th>
......@@ -86,12 +94,29 @@
<td class="xs-3">
<span v-html="v.purchases+'+'"></span>
</td>
<template v-if=" goodDetail.ac_type == 3">
<td class="xs-3">
<span v-html="'¥'+v.price_cn"></span>
<span v-html="'¥'+v.price_cn" :class="{'priceCn':true,'noPriceCn':isCookie}"></span>
</td>
</template>
<template v-if=" goodDetail.ac_type == 2">
<td class="xs-3">
<span v-html="'¥'+v.price_cn" class="priceCn noPriceCn"></span>
</td>
</template>
<template v-if="goodDetail.ac_type == 3&&!isCookie">
<td class="xs-3" v-if="k==0">
<span class="toLogin" @click="toLogin">登录查看</span>
</td>
<td class="xs-3" v-else>
<span>- -</span>
</td>
</template>
<template v-else>
<td class="xs-3">
<span v-html="'¥'+v.price_ac"></span>
<span v-html="'¥'+v.price_ac" style="color: rgb(255, 0, 0)"></span>
</td>
</template>
<td class="xs-3">
<span v-html="'$'+v.price_us"></span>
</td>
......@@ -126,7 +151,7 @@
</div>
</template>
</div>
<div class="price">
<div class="price lyPrice">
<dl class="clr">
<dt>交货地</dt>
<dd class="tab">
......@@ -163,15 +188,58 @@
<span class="em1"></span>
</dt>
<dd class="onePrice" v-if="navInit==0">¥{{singlePriceCn}}</dd>
<dd class="onePrice" v-else>${{singlePriceUs}}</dd>
<dd class="onePrice" v-if="navInit==0">
<template v-if="goodDetail.ac_type == 3">
<span class="toLogin" v-if="!isCookie" @click="toLogin">登录查看</span>
<span class="isNowPrice" v-if="isCookie">¥{{singlePriceVip}}</span>
<span :class="{'isOriginPrice':true,'isNoOriginPrice':isCookie}">¥{{singlePriceCn}}</span>
</template>
<template v-else-if="goodDetail.ac_type == 2">
<span class="isNowPrice">¥{{singlePriceVip}}</span>
<span class="isOriginPrice isNoOriginPrice">¥{{singlePriceCn}}</span>
</template>
<template v-else>
<span>¥{{singlePriceCn}}</span>
</template>
</dd>
<dd class="onePrice" v-else>
<template v-if="goodDetail.ac_type == 3 || goodDetail.ac_type == 2">
<span class="isOriginUsPrice">${{singlePriceUs}}</span>
</template>
<template v-else>
<span>${{singlePriceUs}}</span>
</template>
</dd>
</dl>
<dl class="clr">
<dt>
<span class="em1"></span>
</dt>
<dd class="totalPrice">{{total}}</dd>
<dd class="totalPrice">
<template v-if="navInit==0">
<template v-if="goodDetail.ac_type == 3">
<span class="toLogin" v-if="!isCookie" @click="toLogin">登录查看</span>
<span class="isNowPrice" v-if="isCookie">{{vipTotal}}</span>
<span :class="{'isOriginPrice':true,'isNoOriginPrice':isCookie}">{{total}}</span>
</template>
<template v-else-if="goodDetail.ac_type == 2">
<span class="isNowPrice">{{vipTotal }}</span>
<span class="isOriginPrice isNoOriginPrice">{{total}}</span>
</template>
<template v-else>
<span>{{total}}</span>
</template>
</template>
<template v-else>
<template v-if="goodDetail.ac_type == 3 || goodDetail.ac_type == 2">
<span class="isOriginUsPrice">{{total}}</span>
</template>
<template v-else>
<span>{{total}}</span>
</template>
</template>
</dd>
</dl>
</div>
</div>
......@@ -183,8 +251,8 @@
</template>
<script>
import util from "../../util/index";
import Vue from 'vue'
import { ImagePreview } from 'vant';
import Vue from "vue";
import { ImagePreview } from "vant";
Vue.use(ImagePreview);
export default {
props: {
......@@ -200,6 +268,7 @@ export default {
isShowMore: false,
singlePriceCn: 0, //国内单价
singlePriceUs: 0, //香港单价
singlePriceVip: 0, //会员单价
navInit: 0,
startNum: 0, //起订量
multipleNum: 0, //倍数
......@@ -207,7 +276,8 @@ export default {
stockNum: 0, //库存,
zyladderArr: [], //阶梯价
zySingleInit: 0, //自营数量初始值
goodsNum: 0 //商品数量
goodsNum: 0, //商品数量
isCookie: getCookie("Yo4teW_uid")
};
},
computed: {
......@@ -219,6 +289,9 @@ export default {
//国内
return "¥" + (this.goodsNum * this.singlePriceCn).toFixed(4);
}
},
vipTotal() {
return "¥" + (this.goodsNum * this.singlePriceVip).toFixed(4);
}
},
watch: {
......@@ -266,9 +339,15 @@ export default {
num: util.aggxde(singleData.purchases),
priceus: Number(singleData.price_us).toFixed(4)
});
if (singleData.price_ac != null) {
this.zyladderArr[i].pricevip = Number(
singleData.price_ac
).toFixed(4);
}
}
}
console.log(this.zyladderArr);
}
}
},
goodsNum(now) {
......@@ -285,8 +364,17 @@ export default {
}
},
methods: {
toLogin() {
window.location.href =
window.location.origin +
"/v3/login?referer=" +
encodeURIComponent(window.location.href);
},
showImagePreview(position, timer) {
let images = [this.goodDetail.brand_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png'];
let images = [
this.goodDetail.brand_logo ||
"https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png"
];
const instance = ImagePreview({
images,
asyncClose: !!timer,
......@@ -312,12 +400,15 @@ export default {
//阶梯价的数据为空
this.singlePriceCn = 0;
this.singlePriceUs = 0;
this.singlePriceVip = 0;
return;
} else {
//阶梯价的数据不为空
if (length == 1) {
//阶梯价的数据为1
this.singlePriceCn = this.zyladderArr[0].pricecn;
this.zyladderArr[0].pricevip &&
(this.singlePriceVip = this.zyladderArr[0].pricevip);
this.singlePriceUs = this.zyladderArr[0].priceus;
return;
} else {
......@@ -325,11 +416,15 @@ export default {
if (v <= this.zyladderArr[0].num) {
//输入数量小于等于最小值
this.singlePriceCn = this.zyladderArr[0].pricecn;
this.zyladderArr[0].pricevip &&
(this.singlePriceVip = this.zyladderArr[0].pricevip);
this.singlePriceUs = this.zyladderArr[0].priceus;
return;
} else if (v >= this.zyladderArr[length - 1].num) {
//输入数量大于等于最大值
this.singlePriceCn = this.zyladderArr[length - 1].pricecn;
this.zyladderArr[length - 1].pricevip &&
(this.singlePriceVip = this.zyladderArr[length - 1].pricevip);
this.singlePriceUs = this.zyladderArr[length - 1].priceus;
return;
} else {
......@@ -339,6 +434,8 @@ export default {
v < this.zyladderArr[i + 1].num
) {
this.singlePriceCn = this.zyladderArr[i].pricecn;
this.zyladderArr[i].pricevip &&
(this.singlePriceVip = this.zyladderArr[i].pricevip);
this.singlePriceUs = this.zyladderArr[i].priceus;
break;
}
......
......@@ -3,11 +3,21 @@
<div class="details-head">
<div class="head_top clr">
<div class="head_top_left fl">
<img :src="goodDetail.brand_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png'" @onerror="imgErr" @click="showImagePreview">
<img
:src="goodDetail.brand_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png'"
@onerror="imgErr"
@click="showImagePreview"
>
</div>
<div class="head_top_right">
<h4>
<strong>{{goodDetail.sku_name}}</strong>
<template v-if="goodDetail.ac_type == 2 || goodDetail.ac_type == 3">
<span>优惠</span>
</template>
<template v-if="goodDetail.ac_type == 1">
<span>抢购</span>
</template>
</h4>
<p class="icon-hint"></p>
</div>
......@@ -70,12 +80,13 @@
<table>
<tbody>
<tr>
<!-- ac_type 1 限时限量 2 活动价 3会员价 -->
<template v-if="goodDetail.ac_type == 1">
<th class="xs-3">数量</th>
<th class="xs-3">原价(含税)</th>
<th class="xs-3">抢购价(含税)</th>
</template>
<template v-if="goodDetail.ac_type == 2 || goodDetail.ac_type == 3">
<template v-else-if="goodDetail.ac_type == 2 || goodDetail.ac_type == 3">
<th class="xs-3">数量</th>
<th class="xs-3">原价(含税)</th>
<th class="xs-3">优惠价(含税)</th>
......@@ -95,16 +106,33 @@
<td class="xs-3">
<span v-html="v.purchases+'+'"></span>
</td>
<template v-if=" goodDetail.ac_type == 3">
<td class="xs-3">
<span v-html="'¥'+v.price_cn"></span>
<span v-html="'¥'+v.price_cn" :class="{'priceCn':true,'noPriceCn':isCookie}"></span>
</td>
</template>
<template v-if=" goodDetail.ac_type == 2 || goodDetail.ac_type == 1">
<td class="xs-3">
<span v-html="'¥'+v.price_cn" class="priceCn noPriceCn"></span>
</td>
</template>
<template v-if="goodDetail.ac_type == 3&&!isCookie">
<td class="xs-3" v-if="k==0">
<span class="toLogin" @click="toLogin">登录查看</span>
</td>
<td class="xs-3" v-else>
<span>- -</span>
</td>
</template>
<template v-else>
<td class="xs-3">
<span v-html="'¥'+v.price_ac"></span>
<span v-html="'¥'+v.price_ac" style="color: rgb(255, 0, 0)"></span>
</td>
</template>
</template>
<template v-else>
<td class="xs-6">
<span v-html="'¥'+v.purchases"></span>
<span v-html="v.purchases+'+'"></span>
</td>
<td class="xs-6">
<span v-html="'¥'+v.price_cn"></span>
......@@ -129,7 +157,7 @@
</div>
</template>
</div>
<div class="price">
<div class="price zyPrice">
<dl class="clr">
<dt>购买形式</dt>
<dd class="tab">
......@@ -180,14 +208,40 @@
<span class="em1"></span>
</dt>
<dd class="onePrice">¥{{singlePrice}}</dd>
<dd class="onePrice">
<template v-if="goodDetail.ac_type == 3">
<span class="toLogin" v-if="!isCookie" @click="toLogin">登录查看</span>
<span class="isNowPrice" v-if="isCookie">¥{{singlePriceVip}}</span>
<span :class="{'isOriginPrice':true,'isNoOriginPrice':isCookie}">¥{{singlePrice}}</span>
</template>
<template v-else-if="goodDetail.ac_type == 2 || goodDetail.ac_type == 1">
<span class="isNowPrice">¥{{singlePriceVip}}</span>
<span class="isOriginPrice isNoOriginPrice">¥{{singlePrice}}</span>
</template>
<template v-else>
<span>¥{{singlePrice}}</span>
</template>
</dd>
</dl>
<dl class="clr">
<dt>
<span class="em1"></span>
</dt>
<dd class="totalPrice">¥{{total}}</dd>
<dd class="totalPrice">
<template v-if="goodDetail.ac_type == 3">
<span class="toLogin" v-if="!isCookie" @click="toLogin">登录查看</span>
<span class="isNowPrice" v-if="isCookie">{{vipTotal}}</span>
<span :class="{'isOriginPrice':true,'isNoOriginPrice':isCookie}">{{total}}</span>
</template>
<template v-else-if="goodDetail.ac_type == 2 || goodDetail.ac_type == 1">
<span class="isNowPrice">{{vipTotal }}</span>
<span class="isOriginPrice isNoOriginPrice">{{total}}</span>
</template>
<template v-else>
<span>{{total}}</span>
</template>
</dd>
</dl>
</div>
</div>
......@@ -199,8 +253,8 @@
</template>
<script>
import util from "../../util/index";
import Vue from 'vue'
import { ImagePreview } from 'vant';
import Vue from "vue";
import { ImagePreview } from "vant";
Vue.use(ImagePreview);
export default {
......@@ -214,10 +268,11 @@ export default {
},
data() {
return {
images:[],
images: [],
isShowMore: false,
ypNum: 0, //组
singlePrice: 0, //单价
singlePriceVip: 0, //会员单价
tipText: "",
btnText: "",
navInit: 0,
......@@ -227,12 +282,16 @@ export default {
stockNum: 0, //库存,
zyladderArr: [], //阶梯价
zySingleInit: 0, //自营数量初始值
goodsNum: 0 //商品数量
goodsNum: 0, //商品数量
isCookie: getCookie("Yo4teW_uid")
};
},
computed: {
total() {
return (this.goodsNum * this.singlePrice).toFixed(4);
},
vipTotal() {
return (this.goodsNum * this.singlePriceVip).toFixed(4);
}
},
watch: {
......@@ -284,6 +343,11 @@ export default {
price: Number(singleData.price_cn).toFixed(4),
num: util.aggxde(singleData.purchases)
});
if (singleData.price_ac != null) {
this.zyladderArr[i].pricevip = Number(
singleData.price_ac
).toFixed(4);
}
}
}
}
......@@ -306,12 +370,18 @@ export default {
}
},
methods: {
toLogin(){
window.location.href = window.location.origin+'/v3/login?referer='+encodeURIComponent(window.location.href)
},
showImagePreview(position, timer) {
let images = [this.goodDetail.brand_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png']
let images = [
this.goodDetail.brand_logo ||
"https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png"
];
const instance = ImagePreview({
images,
asyncClose: !!timer,
showIndex:false
showIndex: false
});
if (timer) {
setTimeout(() => {
......@@ -341,22 +411,29 @@ export default {
if (!length) {
//阶梯价的数据为空
this.singlePrice = 0;
this.singlePriceVip = 0;
return;
} else {
//阶梯价的数据不为空
if (length == 1) {
//阶梯价的数据为1
this.singlePrice = this.zyladderArr[0].price;
this.zyladderArr[0].pricevip &&
(this.singlePriceVip = this.zyladderArr[0].pricevip);
return;
} else {
//阶梯价的数据不为1
if (v <= this.zyladderArr[0].num) {
//输入数量小于等于最小值
this.singlePrice = this.zyladderArr[0].price;
this.zyladderArr[0].pricevip &&
(this.singlePriceVip = this.zyladderArr[0].pricevip);
return;
} else if (v >= this.zyladderArr[length - 1].num) {
//输入数量大于等于最大值
this.singlePrice = this.zyladderArr[length - 1].price;
this.zyladderArr[length - 1].pricevip &&
(this.singlePriceVip = this.zyladderArr[length - 1].pricevip);
return;
} else {
for (let i = 0; i < this.zyladderArr.length; i++) {
......@@ -365,6 +442,8 @@ export default {
v < this.zyladderArr[i + 1].num
) {
this.singlePrice = this.zyladderArr[i].price;
this.zyladderArr[i].pricevip &&
(this.singlePriceVip = this.zyladderArr[i].pricevip);
break;
}
}
......
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 sign in to comment