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
......@@ -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>
<td class="xs-3">
<span v-html="'¥'+v.price_cn"></span>
</td>
<td class="xs-3">
<span v-html="'¥'+v.price_ac"></span>
</td>
<template v-if=" goodDetail.ac_type == 3">
<td class="xs-3">
<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" 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,8 +339,14 @@ 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);
}
}
},
......@@ -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>
<td class="xs-3">
<span v-html="'¥'+v.price_cn"></span>
</td>
<td class="xs-3">
<span v-html="'¥'+v.price_ac"></span>
</td>
<template v-if=" goodDetail.ac_type == 3">
<td class="xs-3">
<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" 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