fix: bug修复

This commit is contained in:
2024-10-29 17:38:47 +08:00
parent 48bf3e6f33
commit cadb9dbcc4
31 changed files with 1032 additions and 662 deletions

View File

@@ -49,9 +49,8 @@
$images = reset($product_images);
$skuAttr = $images['image_color']; //获取多属性标签
}
else{
} else {
if ($color){
$images = $product_images[$color];
} else {
@@ -200,7 +199,7 @@
if($isColor){
//判断颜色属性取值【中文文字、色值、色块图英文名称】
$firstChar = substr($attrValue, 0, 1);
$colorFile = 'https://cc.f2b211.com/uploads/color/' .strtolower($attrValue). '.jpg';
$colorFile = 'https://cc.f2b211.com/static/colors/' .strtolower($attrValue). '.png';
if($kl == 0){
//判断为颜色色值RGB
@@ -225,7 +224,7 @@
elseif($colorType == 2){
if(isset($productColor[strtoupper($attrValue)])) {
if($attrValue == 'GD'||$attrValue == 'GR'||$attrValue == 'SV'||$attrValue == 'RG'||$attrValue == 'CO'||$attrValue == 'WD'){
echo '<li class="item attr_value tip1 '.$firstClass.'" data-type="'.$ka.'" data-value="'.trim($attrValue).'" data-feed="'.$productColor[$attrValue].'" data-tipso="'.$productColor[strtoupper($attrValue)].'"><a><img src="/uploads/color/'.$attrValue.'.jpg" alt="" style="width:20px; height: 20px; border-radius: 10px; "></a></li>';
echo '<li class="item attr_value tip1 '.$firstClass.'" data-type="'.$ka.'" data-value="'.trim($attrValue).'" data-feed="'.$productColor[$attrValue].'" data-tipso="'.$productColor[strtoupper($attrValue)].'"><a><img src="/static/colors/'.$attrValue.'.png" alt="" style="width:20px; height: 20px; border-radius: 10px; "></a></li>';
}
else{
@@ -244,7 +243,7 @@
?>
<li class="item attr_value inner tip1 <?php echo $firstClass;?>" data-tipso="<?php echo strtoupper($attrValue);?>" data-type="<?php echo trim($ka);?>" data-value="<?php echo trim($attrValue);?>">
<a>
<img src="<?php echo '/uploads/color/'.strtolower($attrValue);?>.jpg" alt="" style="width:20px; height: 20px; border-radius: 10px; ">
<img src="<?php echo '/static/colors/'.strtolower($attrValue);?>.png" alt="" style="width:20px; height: 20px; border-radius: 10px; ">
</a>
</li>
<?php
@@ -361,6 +360,7 @@
<div class="products_des"><?php echo $detail['ld_md_content']; ?></div>
</div>
<!-- 关联产品 s <?php //if ($product_relateds)print_r($product_relateds); ?>-->
?>-->
<?php if ($product_relateds): ?>
<div class="warp2 proTfg">
<div class="swt-Container">
@@ -627,6 +627,9 @@
margin-top: 0px !important;
}
.hd .co-bg {
width: 20px;
}
</style>
<script>
$(function () {
@@ -730,8 +733,7 @@ $(function() {
function skuAttrType(){
// 获取规格值
var spec = [];
$('.hd .on').each(function()
{
$('.hd .on').each(function() {
var typeName = $(this).data('type');
var selected = {};

View File

@@ -58,7 +58,7 @@
<?php
if(!$imglist['image_color']==''){
if(strlen($imglist['image_color']) == 2){
$colorImg = '/uploads/product/'.trim($imglist['image_color']).'.jpg';
$colorImg = '/static/colors/'.trim($imglist['image_color']).'.png';
}else{
$colorImg = $imglist['image_color'];
}
@@ -130,7 +130,7 @@
<?php
if(!$imglist['image_color']==''){
if(strlen($imglist['image_color']) == 2){
$colorImg = '/uploads/product/'.trim($imglist['image_color']).'.jpg';
$colorImg = '/static/colors/'.trim($imglist['image_color']).'.png';
}else{
$colorImg = $imglist['image_color'];
}