商品售价js改变样式丢下修

This commit is contained in:
gongfuxiang 2024-04-15 20:20:22 +08:00
parent b0cd662968
commit 30a668d54b
3 changed files with 19 additions and 19 deletions

View File

@ -22,7 +22,7 @@
<div class="items goods-price goods-original-price">
<dt>{{$module_data.goods.show_field_original_price_text|raw}}</dt>
<dd>
<span class="original-price-value am-text-grey" data-original-price="{{$module_data.goods.original_price}}">
<span class="goods-original-price-value am-text-grey" data-original-price="{{$module_data.goods.original_price}}">
{{if !empty($module_data['goods']['show_original_price_symbol'])}}
<em class="symbol">{{$module_data.goods.show_original_price_symbol}}</em>
{{/if}}
@ -58,7 +58,7 @@
{{if !empty($module_data['goods']['show_price_symbol'])}}
<em class="symbol">{{$module_data.goods.show_price_symbol}}</em>
{{/if}}
<b class="goods-price" data-original-price="{{$module_data.goods.price}}">{{$module_data.goods.price}}</b>
<b class="goods-sale-price-value" data-original-price="{{$module_data.goods.price}}">{{$module_data.goods.price}}</b>
{{if !empty($module_data['goods']['show_price_unit'])}}
<em class="unit am-text-grey">{{$module_data.goods.show_price_unit}}</em>
{{/if}}

View File

@ -614,12 +614,15 @@ i.buy-event {
position: relative;
}
.tb-detail-panel-base .original-price-value {
text-decoration: line-through;
.tb-detail-price-content .goods-price b {
font-size: 1.8rem;
}
.goods-price {
.tb-detail-price-content .goods-original-price-value b {
text-decoration: line-through;
}
.tb-detail-price-content .goods-sale-price {
color: var(--color-price);
}
@ -688,12 +691,9 @@ i.buy-event {
width: calc(100% - 8.5rem);
}
.tb-detail-price-content .goods-sale-price .goods-price {
.tb-detail-price-content .goods-sale-price .goods-sale-price-value {
font-weight: bold;
line-height: 1.6rem;
}
.tb-detail-price-content .goods-sale-price .goods-price {
font-size: 2.4rem;
}
@ -930,10 +930,10 @@ i.buy-event {
padding: 1.2rem 1.2rem 4rem 1.2rem;
}
.tb-detail-panel-base .original-price-value {
.tb-detail-price-content .goods-original-price-value {
font-size: 1.2rem;
}
.tb-detail-price-content .goods-sale-price .goods-price {
.tb-detail-price-content .goods-sale-price .goods-sale-price-value {
font-size: 1.6rem;
}
.tb-detail-price-content .goods-sale-price .symbol,

View File

@ -234,13 +234,13 @@ function BuyCartHandle(e)
function GoodsSpecDetailBackHandle(data)
{
// 售价
$('.text-info .price-now').text(__currency_symbol__+data.spec_base.price);
$('.goods-price').text(data.spec_base.price);
$('.text-info .price-now b').text(data.spec_base.price);
$('.goods-sale-price-value').text(data.spec_base.price);
// 数量处理
var inventory = parseInt(data.spec_base.inventory);
var $input = $('#text_box');
var $stock = $('.stock-tips .stock');
var $origina_price_value = $('.original-price-value b');
var $origina_price_value = $('.goods-original-price-value b');
// 起购数
var min = parseInt($input.data('original-buy-min-number'));
@ -474,9 +474,9 @@ function GoodsBaseRestore()
{
var $input = $('#text_box');
var $stock = $('.stock-tips .stock');
var $price = $('.goods-price');
var $price = $('.goods-sale-price-value');
var $price_now = $('.text-info .price-now');
var $original_price_value = $('.tb-detail-panel-base .original-price-value');
var $original_price_value = $('.tb-detail-panel-base .goods-original-price-value');
$input.attr('min', $input.data('original-buy-min-number'));
$input.attr('max', $stock.data('original-max'));
$stock.text($stock.data('original-inventory'));
@ -484,7 +484,7 @@ function GoodsBaseRestore()
$stock.attr('data-max-limit', $input.attr('data-original-buy-max-number'));
// 价格处理
$price_now.text(__currency_symbol__+$price_now.data('original-price'));
$price_now.find('b').text($price_now.data('original-price'));
$price.text($price.data('original-price'));
if($original_price_value.length > 0)
{
@ -493,7 +493,7 @@ function GoodsBaseRestore()
var price = $(this).data('original-price');
if(price !== undefined)
{
$(this).text(__currency_symbol__+price);
$(this).find('b').text(price);
}
});
}
@ -584,7 +584,7 @@ $(function() {
spec = spec.split('|');
if($('.sku-container').length > 0 && $('.sku-container .sku-items').length > 0 && $('.sku-container .sku-items').length == spec.length && $('.buy-submit-container').length > 0 && ($('.buy-submit-container button.buy-submit').length > 0 || $('.buy-submit-container button.cart-submit').length > 0) && $('.tb-detail-panel-top-price-content .goods-sale-price').length > 0)
{
var $price = $('.tb-detail-panel-base .tb-detail-panel-top-price-content .items.price dd b, .tb-detail-panel-base .tb-detail-panel-top-price-content .goods-sale-price .goods-price');
var $price = $('.tb-detail-panel-base .tb-detail-panel-top-price-content .items.price dd b, .tb-detail-panel-base .tb-detail-panel-top-price-content .goods-sale-price .goods-sale-price-value');
// 先清除价格展示信息
$price.text('...');
var num = 0;