fix: bug修复

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

View File

@@ -281,14 +281,14 @@
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
if($firstChar == '#'){
$colorType = 1;
}
elseif(strlen($attrValue) ==2){
elseif(strlen($attrValue) == 2){
$colorType = 2;
}
//判断颜色色块图片是否存在
@@ -307,7 +307,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-feed="'.$productColor[$attrValue].'" data-type="'.$ka.'" data-value="'.trim($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-feed="'.$productColor[$attrValue].'" data-type="'.$ka.'" data-value="'.trim($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{
@@ -716,7 +716,7 @@
</div>
<!-- 关联产品 s <?php //if ($product_relateds)print_r($product_relateds); ?>-->
<!-- 关联产品 s <?php //if ($product_relateds)print_r($product_relateds); ?>-->
<?php if ($product_relateds): ?>
<div class="warp2 proTfg">
<div class="swt-Container">
@@ -779,184 +779,281 @@
<!-- 相关下载 s -->
<?php if (!$product_dls) { ?>
<?php } else { ?>
<div class="nybox proTfg">
<div class="swt-Container">
<div class="sptit" id="link3">Related Download</div>
<?php
if ($product_dls):
$selectTypeArr = config("product_dltype");
$prodls = [];
foreach ($product_dls as $dlrow) {
$prodls[$dlrow['dl_type']][] = $dlrow;
}
?>
<?php foreach ($prodls as $type => $dlclrs): ?>
<div class="xz">
<p class="xztit"><?php echo isset($selectTypeArr[$type]) ? $selectTypeArr[$type] : ''; ?></p>
<?php foreach ($dlclrs as $dl): ?>
<p class="xz1"><a
href="<?php echo url('us/download/prodownload', ['id' => $dl['id']]); ?>"><i></i><?php echo $dl['dl_name']; ?>
</a></p>
<?php endforeach; ?>
<!-- 相关下载 s -->
<?php if (!$product_dls) { ?>
<?php } else { ?>
<div class="nybox proTfg">
<div class="swt-Container">
<div class="sptit" id="link3">Related Download</div>
<?php
if ($product_dls):
$selectTypeArr = config("product_dltype");
$prodls = [];
foreach ($product_dls as $dlrow) {
$prodls[$dlrow['dl_type']][] = $dlrow;
}
?>
<?php foreach ($prodls as $type => $dlclrs): ?>
<div class="xz">
<p class="xztit"><?php echo isset($selectTypeArr[$type]) ? $selectTypeArr[$type] : ''; ?></p>
<?php foreach ($dlclrs as $dl): ?>
<p class="xz1"><a
href="<?php echo url('us/download/prodownload', ['id' => $dl['id']]); ?>"><i></i><?php echo $dl['dl_name']; ?>
</a></p>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php } ?>
<style>
/*点击弹框*/
.popup-quick {
width: 48rem;
position: fixed;
top: 35%;
margin-top: -235px;
left: 45%;
margin-left: -235px;
background-color: #fff;
z-index: 9999;
box-shadow: 0px 2px 5px rgba(255, 255, 255, 0.2);
color: #333;
border-radius: 0.05rem;
}
.popup-quick .popup-app {
font-size: 0.14rem;
color: #333;
line-height: 22px;
padding: 30px 40px;
text-align: center;
}
.popup-quick .business-close {
width: 24px;
height: 24px;
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
}
.popup-quick .popup-business-logo img {
width: 1.5rem;
height: 1.5rem;
margin-left: 0.9rem;
}
.title-text {
font-size: 26px;
color: #101010;
font-weight: 600;
text-align: center;
padding: 34px 0;
}
.marsk-container {
background: rgba(0, 0, 0, 0.8);
display: none;
position: absolute;
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0px;
z-index: 999;
}
.detail_form input {
height: 2.75rem;
line-height: 2.75rem;
padding: 0 0.625rem;
margin-top: 0.625rem;
border: 1px solid #dbdbdb;
display: inline-block;
}
.detail_form select {
height: 2.75rem;
line-height: 2.75rem;
padding: 0 0.625rem;
margin-top: 0.625rem;
border: 1px solid #dbdbdb;
display: inline-block;
}
.detail_form textarea {
padding: 0.225rem 0.5rem;
margin-top: 0.625rem;
border: 1px solid #dbdbdb;
display: inline-block;
}
.apply_form textarea {
padding: 0.225rem;
margin-top: 0.625rem;
border: 1px solid #dbdbdb;
display: inline-block;
}
.apply_content{ width: 43.75rem; height: auto; margin: 0 auto;}
.form_title{ width: 43.75rem; height:1.875rem; line-height: 2rem; text-align: center; padding: 3.125rem 0; font-size: 1.5rem; font-weight: bold; color: #000000;}
.apply_form p{ color: #252525; font-size: 0.875rem; font-weight: bold;}
.apply_form input{ width: calc( 100% - 1.25rem ); height: 2.75rem; line-height: 2.75rem; padding: 0 0.625rem; margin-top: 0.625rem; border: 1px solid #DBDBDB;}
.apply_form .name>div{ float: left; width: calc( (100% - 1.25rem)/2 );}
.check_box, .radio_box{ margin-top: 0.9375rem;}
.check_box ul li, .radio_box ul li{ color: #252525; font-size: 0.875rem; font-weight: 400; margin-bottom: 0.625rem; line-height: 1.25rem;}
.check_box ul li i{ display: block; float: left; width: 1rem; height: 1rem; border: 1px solid #cccccc; border-radius: 0.125rem; margin-right: 0.625rem;}
.checked i::before{ background: url(../img/check.png); width: 1rem; height: 1rem; display: block; content: '';}
.radio_box ul li i{ display: block; float: left; width: 1rem; height: 1rem; border: 1px solid #cccccc; border-radius: 50%; margin-right: 0.625rem;}
.submit_btn{ margin: 0 auto; width: 15rem; height: 2.5rem; line-height: 2.5rem; background: #009FDF; color: #ffffff; text-align: center; cursor: pointer; margin-bottom: 5.625rem;}
.radio i::before{ background: url(../img/radio.png); width: 1rem; height: 1rem; display: block; content: '';}
</div>
<?php } ?>
.detail-w {
width: 40%;
}
.detail-w02 {
width: 45%;
}
.detail-w01 {
width: 90%;
}
.detail-w02 {
width: 100%;
}
.detail_form .name > div {
float: left;
width: calc((100% - 1.25rem) / 2);
}
</style>
<script>
<style>
/*点击弹框*/
.popup-quick {
width: 48rem;
position: fixed;
top: 35%;
margin-top: -235px;
left: 45%;
margin-left: -235px;
background-color: #fff;
z-index: 9999;
box-shadow: 0px 2px 5px rgba(255, 255, 255, 0.2);
color: #333;
border-radius: 0.05rem;
}
$(function() {
$('.tip1').tipso({
useTitle: false
});
});
.popup-quick .popup-app {
font-size: 0.14rem;
color: #333;
line-height: 22px;
padding: 30px 40px;
text-align: center;
}
</script>
<!-- 相关下载 e -->
<script type="text/javascript">
$(function () {
var attributes = JSON.parse('<?php echo json_encode($product_attr);?>');
var pictures = JSON.parse('<?php echo json_encode($product_images);?>');
//多属性选择及绑定事件
$(".hd .attr_item").click(function(){
$(this).siblings().removeClass('on');
$(this).toggleClass('on');
var attrVal = $(this).data('feed');
if($(this).hasClass("on")){
$(this).parents(".hd").find(".selectedAttr").text(attrVal);
}
else{
$(this).parents(".hd").find(".selectedAttr").html('');
}
//验证是否所有属性全部选中
var skuCount = $('.attr_type').length;
var activeCount = $('.hd .on').length;
var productAttr = skuAttrType();
.popup-quick .business-close {
width: 24px;
height: 24px;
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
}
.popup-quick .popup-business-logo img {
width: 1.5rem;
height: 1.5rem;
margin-left: 0.9rem;
}
.title-text {
font-size: 26px;
color: #101010;
font-weight: 600;
text-align: center;
padding: 34px 0;
}
.marsk-container {
background: rgba(0, 0, 0, 0.8);
display: none;
position: absolute;
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0px;
z-index: 999;
}
.detail_form input {
height: 2.75rem;
line-height: 2.75rem;
padding: 0 0.625rem;
margin-top: 0.625rem;
border: 1px solid #dbdbdb;
display: inline-block;
}
.detail_form select {
height: 2.75rem;
line-height: 2.75rem;
padding: 0 0.625rem;
margin-top: 0.625rem;
border: 1px solid #dbdbdb;
display: inline-block;
}
.detail_form textarea {
padding: 0.225rem 0.5rem;
margin-top: 0.625rem;
border: 1px solid #dbdbdb;
display: inline-block;
}
.apply_form textarea {
padding: 0.225rem;
margin-top: 0.625rem;
border: 1px solid #dbdbdb;
display: inline-block;
}
.apply_content {
width: 43.75rem;
height: auto;
margin: 0 auto;
}
.form_title {
width: 43.75rem;
height: 1.875rem;
line-height: 2rem;
text-align: center;
padding: 3.125rem 0;
font-size: 1.5rem;
font-weight: bold;
color: #000000;
}
.apply_form p {
color: #252525;
font-size: 0.875rem;
font-weight: bold;
}
.apply_form input {
width: calc(100% - 1.25rem);
height: 2.75rem;
line-height: 2.75rem;
padding: 0 0.625rem;
margin-top: 0.625rem;
border: 1px solid #DBDBDB;
}
.apply_form .name>div {
float: left;
width: calc((100% - 1.25rem)/2);
}
.check_box,
.radio_box {
margin-top: 0.9375rem;
}
.check_box ul li,
.radio_box ul li {
color: #252525;
font-size: 0.875rem;
font-weight: 400;
margin-bottom: 0.625rem;
line-height: 1.25rem;
}
.check_box ul li i {
display: block;
float: left;
width: 1rem;
height: 1rem;
border: 1px solid #cccccc;
border-radius: 0.125rem;
margin-right: 0.625rem;
}
.checked i::before {
background: url(../img/check.png);
width: 1rem;
height: 1rem;
display: block;
content: '';
}
.radio_box ul li i {
display: block;
float: left;
width: 1rem;
height: 1rem;
border: 1px solid #cccccc;
border-radius: 50%;
margin-right: 0.625rem;
}
.submit_btn {
margin: 0 auto;
width: 15rem;
height: 2.5rem;
line-height: 2.5rem;
background: #009FDF;
color: #ffffff;
text-align: center;
cursor: pointer;
margin-bottom: 5.625rem;
}
.radio i::before {
background: url(../img/radio.png);
width: 1rem;
height: 1rem;
display: block;
content: '';
}
.detail-w {
width: 40%;
}
.detail-w02 {
width: 45%;
}
.detail-w01 {
width: 90%;
}
.detail-w02 {
width: 100%;
}
.detail_form .name>div {
float: left;
width: calc((100% - 1.25rem) / 2);
}
.hd .co-bg {
width: 20px;
}
</style>
<script>
$(function() {
$('.tip1').tipso({
useTitle: false
});
});
</script>
<!-- 相关下载 e -->
<script type="text/javascript">
$(function() {
var attributes = JSON.parse('<?php echo json_encode($product_attr); ?>');
var pictures = JSON.parse('<?php echo json_encode($product_images); ?>');
//多属性选择及绑定事件
$(".hd .attr_item").click(function() {
$(this).siblings().removeClass('on');
$(this).toggleClass('on');
var attrVal = $(this).data('feed');
if ($(this).hasClass("on")) {
$(this).parents(".hd").find(".selectedAttr").text(attrVal);
} else {
$(this).parents(".hd").find(".selectedAttr").html('');
}
//验证是否所有属性全部选中
var skuCount = $('.attr_type').length;
var activeCount = $('.hd .on').length;
var productAttr = skuAttrType();
if(activeCount == skuCount)
{
@@ -1383,48 +1480,57 @@ $(function() {
var spu = '<?php echo $detail['brand_id']; ?>';
//点击创建申请块
if(companyName && firstName && lastName && email && phone && country && industry && inquiry) {
var type = 'Agent';
$.ajax({
type: "POST",
url: "/us/inquiry/create",
data: {'company':companyName, 'email':email,'country':country,'name':firstName,'last_name':lastName,'phone':phone,'industry':industry,'inquiry':inquiry,'spu':spu,'refer':k_win_ref},
dataType: "json",
success: function(data){
if(data.code == 200) {
alert("Inquiry Add Success!");
location.href = '/us/Group/submission.html';
$(".marsk-container").hide();
//点击创建申请块
if (companyName && firstName && lastName && email && phone && country && industry && inquiry) {
var type = 'Agent';
$.ajax({
type: "POST",
url: "/us/inquiry/create",
data: {
'company': companyName,
'email': email,
'country': country,
'name': firstName,
'last_name': lastName,
'phone': phone,
'industry': industry,
'inquiry': inquiry,
'spu': spu,
'refer': k_win_ref
},
dataType: "json",
success: function(data) {
if (data.code == 200) {
alert("Inquiry Add Success!");
location.href = '/us/Group/submission.html';
$(".marsk-container").hide();
$("input[ type='text']").val('');
$('#country').val('');
$('#inquiry').val('');
$('#industry').val('');
} else {
if (data.code == 403 || data.code == 201) {
alert(data.msg);
} else {
$('.email').addClass('error');
$('.email').next('span').removeClass('hide');
$("input[ type='text']").val('');
$('#country').val('');
$('#inquiry').val('');
$('#industry').val('');
}
else{
if(data.code == 403 || data.code == 201) {
alert(data.msg);
}
else{
$('.email').addClass('error');
$('.email').next('span').removeClass('hide');
}
}
}
}
});
}
}
});
})
}
});
})
});
</script>

View File

@@ -59,7 +59,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'];
}
@@ -114,7 +114,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'];
}