Authored by zhangxiaoru

订单详情、列表

... ... @@ -14,6 +14,14 @@ const TICKETS = {
};
/**
* 格式化价格
* @private
*/
const transPrice = (price, isSepcialZero) => {
return (price > 0 || isSepcialZero) ? parseFloat(price).toFixed(2) : 0;
};
/**
* 格式化订单商品
* @private
*/
... ... @@ -26,18 +34,27 @@ const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => {
name: value.product_name,
color: value.factory_color_name ? value.factory_color_name : value.color_name,
size: value.size_name,
price: value.goods_price,
count: value.buy_number
payPrice: value.real_pay_price,
salePrice: transPrice(value.sales_price) || value.good,
count: value.buy_number,
isVipPrice: value.discount_tag === 'V',
isStudebt: value.discount_tag === 'S'
};
if (parseInt(value.real_pay_price, 10) === parseInt(value.sales_price, 10)) {
goods.salePrice = false;
}
/* gift=>是否赠品,advanceBuy=>是否加价购 */
if (value.goods_type === 'gift') {
Object.assign(goods, {
gift: true
gift: true,
salePrice: transPrice(value.sales_price)
});
} else if (value.goods_type === 'price_gift') {
Object.assign(goods, {
advanceBuy: true
advanceBuy: true,
salePrice: transPrice(value.sales_price)
});
}
... ...
... ... @@ -183,17 +183,26 @@ const orderDetailData = (uid, orderCode) => {
name: data.productName,
color: data.factoryColorName ? data.factoryColorName : data.colorName,
size: data.sizeName,
price: data.goodsPrice,
count: count
payPrice: data.realPayPrice,
salePrice: parseFloat(data.salesPrice).toFixed(2),
count: count,
isVipPrice: data.discountTag === 'V',
isStudebt: data.discountTag === 'S'
});
if (parseInt(data.realPayPrice, 10) === parseInt(data.salesPrice, 10)) {
obj.salePrice = false;
}
if (data.goodsType === 'gift') {
obj = _.assign(obj, {
gift: true
gift: true,
salePrice: parseFloat(data.salesPrice).toFixed(2)
});
} else if (data.goodsType === 'priceGift') {
obj = _.assign(obj, {
advanceBuy: true
advanceBuy: true,
salePrice: parseFloat(data.salesPrice).toFixed(2)
});
}
... ...
... ... @@ -26,9 +26,20 @@
<span class="appear-date">上市期:{{appearDate}}</span>
{{/if}}
<p class="row price-wrap">
{{#if isVipPrice}}
<span class="fill-text">VIP</span>
{{/if}}
{{#if isStudebt}}
<span class="fill-text"></span>
{{/if}}
<span class="price">
¥{{price}}
¥{{payPrice}}
</span>
{{#if salePrice}}
<span class="sale-price">
¥{{salePrice}}
</span>
{{/if}}
<span class="count">
×{{count}}
</span>
... ...
... ... @@ -306,7 +306,7 @@
.name {
font-size: 28px;
max-width: 70%;
max-width: 63%;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
... ... @@ -345,10 +345,28 @@
text-align: right;
}
.fill-text {
padding: 0.05rem 0.2rem;
color: #fff;
font-size: 0.5rem;
line-height: 0.65rem;
border-radius: 0.75rem;
display: inline-block;
background-color: #e01;
}
.price {
color: #e01;
}
.sale-price {
display: block;
color: #999;
text-align: right;
line-height: 45px;
text-decoration: line-through;
}
.count {
display: block;
color: #999;
... ...