|
@@ -1239,19 +1239,25 @@ function GenProductSection(mimg, specimg) {
|
|
|
|
|
|
specimgstr = "";
|
|
|
|
|
|
- for (i = 0; i < specimg.blocks.length; i++) {
|
|
|
- //alert(block.type);
|
|
|
- block = specimg.blocks[i];
|
|
|
- console.log(block);
|
|
|
- if (block.type == "image") {
|
|
|
- iurl = block.data.file.url.split("/");
|
|
|
- if (iurl[iurl.length - 1] != "logo2.png") {
|
|
|
- specimgstr +=
|
|
|
- '<h6>尺寸規格</h6><img\n class="w-100 h-100" alt="小寶優居 | ' +
|
|
|
- $("#ctitle").val() +
|
|
|
- '"\n src="img/' +
|
|
|
- iurl[iurl.length - 1] +
|
|
|
- '"\n >\n</img>';
|
|
|
+ if(specimg.blocks.length===0){
|
|
|
+ specimgstr = "";
|
|
|
+
|
|
|
+ }else{
|
|
|
+ specimgstr += "<h6>尺寸規格</h6>";
|
|
|
+ for (i = 0; i < specimg.blocks.length; i++) {
|
|
|
+ //alert(block.type);
|
|
|
+ block = specimg.blocks[i];
|
|
|
+ console.log(block);
|
|
|
+ if (block.type == "image") {
|
|
|
+ iurl = block.data.file.url.split("/");
|
|
|
+ if (iurl[iurl.length - 1] != "logo2.png") {
|
|
|
+ specimgstr +=
|
|
|
+ '<img\n class="w-100 h-100" alt="小寶優居 | ' +
|
|
|
+ $("#ctitle").val() +
|
|
|
+ '"\n src="img/' +
|
|
|
+ iurl[iurl.length - 1] +
|
|
|
+ '"\n >\n</img>';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|