This commit is contained in:
2025-03-19 16:29:25 +08:00
parent 0173944fdf
commit 78166f6bd8
5 changed files with 64 additions and 7 deletions
+51
View File
@@ -221,6 +221,7 @@
}
form.render();
getProductImage()
})
form.on("radio(switch)", function (data) {
@@ -247,6 +248,56 @@
}
});
function getProductImage(craft) {
$("#carousel").empty();
$("#remark").empty();
let data = {proTypeValue: "杯垫"}
let remark = "";
let html = "";
let kindValue = $("input[name='kindValue']:checked").val();
if (!!kindValue) {
if (kindValue == 4 || kindValue == 6) {
kindValue = "铜版纸";
}
data.kindValue = kindValue;
}
$.ajax({
url: "${pageContext.request.contextPath}/getImgs",
type: "GET",
data,
//dataType : "json",
success: function (result) {
for (let i = 0; i < result.length; i++) {
// 只留一个remark
remark = "";
if (result[0].imgWidth < result[0].imgHeight) {
html += '<div><img style="width:' + result[0].imgWidth + 'px" src="' + result[i].imgUrl + '"></div>';
} else {
html += '<div><img style="height:' + result[0].imgHeight + 'px" src="' + result[i].imgUrl + '"></div>';
}
remark += '<div><span>' + result[0].remark + '<span/></div>';
}
$("#carousel").append(html);
// 如果没有说明,就不显示null
if (remark.indexOf("null") < 0) {
$("#remark").append(remark);
}
// 如果没有轮播图就隐藏
if (result.length == 0) {
document.getElementById("test1").style.display = "none"; //隐藏
} else {
document.getElementById("test1").style.display = "block"; //显示
ins.reload({
elem: '#test1',
width: result[0].imgWidth, //设置容器宽度
height: result[0].imgHeight
});
}
}
});
};
// 点击计算,计算价格
form.on('submit(acount_btn)', function (data) {