样式设置
diff --git a/public/static/common/css/layout.admin.css b/public/static/common/css/layout.admin.css
index c3b6f5a1f..c545d848e 100644
--- a/public/static/common/css/layout.admin.css
+++ b/public/static/common/css/layout.admin.css
@@ -285,6 +285,14 @@
border-color: #ddd;
}
+/**
+ * 图片魔方展示类型
+ */
+.config-view-show-style-images-magic-cube label:nth-child(7),
+.config-view-show-style-images-magic-cube label:nth-child(13) {
+ margin-left: 0;
+}
+
/**
* 表单小组合组件
*/
@@ -566,9 +574,6 @@
.layout-category-choice .goods-category-choice-content ul li:not(:nth-child(-n+7)):last-child {
border-bottom: 0;
}
-.layout-category-choice .goods-category-choice-content ul li:first-child {
- border-bottom: 1px solid #dedede;
-}
.layout-category-choice .goods-category-choice-content ul li a {
text-decoration: none;
}
diff --git a/public/static/common/css/layout.css b/public/static/common/css/layout.css
index e9d375590..864e8bb57 100644
--- a/public/static/common/css/layout.css
+++ b/public/static/common/css/layout.css
@@ -2,7 +2,7 @@
* 公共
*/
.layout-container [class*="am-u-"] {padding-left:0;padding-right:0;}
-.layout-container a {text-decoration: none;color: #333;}
+.layout-container a {text-decoration: none;}
.layout-container img {-webkit-transition: transform .3s ease-in;-moz-transition: transform .3s ease-in;-ms-transition: transform .3s ease-in;-o-transition: transform .3s ease-in;transition: transform .3s ease-in;}
.layout-container img:hover {transform: scale(1.03);-moz-transform: scale(1.03);-webkit-transform: scale(1.03);-o-transform: scale(1.03);-ms-transform: scale(1.03);}
@@ -1929,4 +1929,12 @@
.module-fixed-doc-ent-width{width:100%}
.module-fixed-doc-ent-height{height:100%}
.module-fixed-doc-ent-auto{margin:0 auto}
-.module-fixed-doc-ent-cover{object-fit:cover}
\ No newline at end of file
+.module-fixed-doc-ent-cover{object-fit:cover}
+
+/**
+ * 图片魔方
+ */
+.layout-module-images-magic-cube a img {
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/public/static/common/images/layout/g1.png b/public/static/common/images/layout/g1.png
new file mode 100644
index 000000000..2973620c3
Binary files /dev/null and b/public/static/common/images/layout/g1.png differ
diff --git a/public/static/common/images/layout/g4.png b/public/static/common/images/layout/g4.png
new file mode 100644
index 000000000..eb2e33767
Binary files /dev/null and b/public/static/common/images/layout/g4.png differ
diff --git a/public/static/common/images/layout/h2.png b/public/static/common/images/layout/h2.png
new file mode 100644
index 000000000..59e3f1434
Binary files /dev/null and b/public/static/common/images/layout/h2.png differ
diff --git a/public/static/common/images/layout/h3.png b/public/static/common/images/layout/h3.png
new file mode 100644
index 000000000..e1ca39f3c
Binary files /dev/null and b/public/static/common/images/layout/h3.png differ
diff --git a/public/static/common/images/layout/h4.png b/public/static/common/images/layout/h4.png
new file mode 100644
index 000000000..475b388a6
Binary files /dev/null and b/public/static/common/images/layout/h4.png differ
diff --git a/public/static/common/images/layout/lr12.png b/public/static/common/images/layout/lr12.png
new file mode 100644
index 000000000..02c3ff0fd
Binary files /dev/null and b/public/static/common/images/layout/lr12.png differ
diff --git a/public/static/common/images/layout/lr13.png b/public/static/common/images/layout/lr13.png
new file mode 100644
index 000000000..6bbf323a3
Binary files /dev/null and b/public/static/common/images/layout/lr13.png differ
diff --git a/public/static/common/images/layout/lr21.png b/public/static/common/images/layout/lr21.png
new file mode 100644
index 000000000..9ebc60a00
Binary files /dev/null and b/public/static/common/images/layout/lr21.png differ
diff --git a/public/static/common/images/layout/lr31.png b/public/static/common/images/layout/lr31.png
new file mode 100644
index 000000000..fdf8efe3f
Binary files /dev/null and b/public/static/common/images/layout/lr31.png differ
diff --git a/public/static/common/images/layout/lrh2v2.png b/public/static/common/images/layout/lrh2v2.png
new file mode 100644
index 000000000..18f37bcc8
Binary files /dev/null and b/public/static/common/images/layout/lrh2v2.png differ
diff --git a/public/static/common/images/layout/lrv2h2.png b/public/static/common/images/layout/lrv2h2.png
new file mode 100644
index 000000000..b1a71791d
Binary files /dev/null and b/public/static/common/images/layout/lrv2h2.png differ
diff --git a/public/static/common/images/layout/tb12.png b/public/static/common/images/layout/tb12.png
new file mode 100644
index 000000000..667d8b263
Binary files /dev/null and b/public/static/common/images/layout/tb12.png differ
diff --git a/public/static/common/images/layout/tb13.png b/public/static/common/images/layout/tb13.png
new file mode 100644
index 000000000..ef12d0f99
Binary files /dev/null and b/public/static/common/images/layout/tb13.png differ
diff --git a/public/static/common/images/layout/tb21.png b/public/static/common/images/layout/tb21.png
new file mode 100644
index 000000000..db811eef4
Binary files /dev/null and b/public/static/common/images/layout/tb21.png differ
diff --git a/public/static/common/images/layout/tb31.png b/public/static/common/images/layout/tb31.png
new file mode 100644
index 000000000..b3a082ebc
Binary files /dev/null and b/public/static/common/images/layout/tb31.png differ
diff --git a/public/static/common/images/layout/v2.png b/public/static/common/images/layout/v2.png
new file mode 100644
index 000000000..7cc67b393
Binary files /dev/null and b/public/static/common/images/layout/v2.png differ
diff --git a/public/static/common/images/layout/v3.png b/public/static/common/images/layout/v3.png
new file mode 100644
index 000000000..e2da5248d
Binary files /dev/null and b/public/static/common/images/layout/v3.png differ
diff --git a/public/static/common/images/layout/v4.png b/public/static/common/images/layout/v4.png
new file mode 100644
index 000000000..f11ef5d95
Binary files /dev/null and b/public/static/common/images/layout/v4.png differ
diff --git a/public/static/common/js/layout.admin.js b/public/static/common/js/layout.admin.js
index a0b4efe64..e036b5086 100644
--- a/public/static/common/js/layout.admin.js
+++ b/public/static/common/js/layout.admin.js
@@ -3,6 +3,7 @@ FromInit('form.form-validation-layout-config');
FromInit('form.form-validation-module-offcanvas-images');
FromInit('form.form-validation-module-offcanvas-many-images');
FromInit('form.form-validation-module-offcanvas-images-text');
+FromInit('form.form-validation-module-offcanvas-images-magic-cube');
FromInit('form.form-validation-module-offcanvas-video');
FromInit('form.form-validation-module-offcanvas-goods');
FromInit('form.form-validation-module-offcanvas-title');
@@ -26,6 +27,7 @@ var $offcanvas_layout_config = $('#offcanvas-layout-config');
var $offcanvas_config_images = $('#offcanvas-module-config-images');
var $offcanvas_config_many_images = $('#offcanvas-module-config-many-images');
var $offcanvas_config_images_text = $('#offcanvas-module-config-images-text');
+var $offcanvas_config_images_magic_cube = $('#offcanvas-module-config-images-magic-cube');
var $offcanvas_config_video = $('#offcanvas-module-config-video');
var $offcanvas_config_goods = $('#offcanvas-module-config-goods');
var $offcanvas_config_title = $('#offcanvas-module-config-title');
@@ -199,7 +201,7 @@ function ModuleToPrompt(to_name)
* @param {[object]} data [数据]
* @param {[string]} key [key]
* @param {[array]} replace_rules [替换规则]
- * @param {[array]} exclude [排除样式]
+ * @param {[array]} exclude [排除css]
*/
function StyleBaseHandle(data, key, replace_rules, exclude)
{
@@ -245,10 +247,26 @@ function StyleBaseHandle(data, key, replace_rules, exclude)
var l = data[key+type+'_left'] || value;
if((t != 0 || r != 0 || b != 0 || l != 0) || (t != '' || r != '' || b != '' || l != ''))
{
- if((exclude || null) == null || exclude.indexOf(arr[i]['css']) == -1)
+ if((exclude || null) != null)
{
- style += arr[i]['css']+':'+ t+unit+' '+r+unit+' '+b+unit+' '+l+unit+';';
+ if(exclude.indexOf(arr[i][t]) != -1)
+ {
+ t = 0;
+ }
+ if(exclude.indexOf(arr[i][r]) != -1)
+ {
+ r = 0;
+ }
+ if(exclude.indexOf(arr[i][b]) != -1)
+ {
+ b = 0;
+ }
+ if(exclude.indexOf(arr[i][l]) != -1)
+ {
+ l = 0;
+ }
}
+ style += arr[i]['css']+':'+ t+unit+' '+r+unit+' '+b+unit+' '+l+unit+';';
}
}
@@ -340,6 +358,56 @@ function StyleBaseHandle(data, key, replace_rules, exclude)
return style;
}
+/**
+ * 表单回调数据列表处理
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2022-11-25
+ * @desc description
+ * @param {[object]} data [表单数据]
+ * @param {[object]} fields [处理字段]
+ */
+function FormBackDataListHandle(data, fields)
+{
+ var key_temp = [];
+ var data_list = [];
+ for(var i in data)
+ {
+ var loc = i.lastIndexOf('_');
+ if(loc != -1)
+ {
+ var key = i.substr(0, loc+1);
+ var last = i.substr(loc+1);
+ for(var f in fields)
+ {
+ if(key == f)
+ {
+ // 临时索引记录
+ var index = key_temp.indexOf(last);
+ if(index == -1)
+ {
+ key_temp.push(last);
+ index = key_temp.length-1;
+ }
+
+ // 数据组合
+ if(data_list[index] == undefined)
+ {
+ data_list[index] = {};
+ }
+ data_list[index][fields[f]] = (fields[f] != 'value' || (data[i] || null) == null) ? data[i] : (JSON.parse(decodeURIComponent(data[i])) || '');
+ delete data[i];
+ }
+ }
+ }
+ }
+ return {
+ data: data,
+ data_list: data_list
+ }
+}
+
/**
* 元素固定处理
* @author Devil
@@ -468,7 +536,7 @@ function FormBackLayoutConfigHandle(data)
"style": style,
"ent": ent
}
- $layout_content_obj.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $layout_content_obj.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
$offcanvas_layout_config.offCanvas('close');
}
@@ -518,7 +586,7 @@ function FormBackModuleConfigImagesHandle(data)
"style": style,
"media_fixed": media_fixed
}
- $doc.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
$offcanvas_config_images.offCanvas('close');
}
@@ -548,38 +616,9 @@ function FormBackModuleConfigManyImagesHandle(data)
"content_to_type_": "type",
"content_to_value_": "value"
};
- var key_temp = [];
- var data_list = [];
- for(var i in data)
- {
- var loc = i.lastIndexOf('_');
- if(loc != -1)
- {
- var key = i.substr(0, loc+1);
- var last = i.substr(loc+1);
- for(var f in fields)
- {
- if(key == f)
- {
- // 临时索引记录
- var index = key_temp.indexOf(last);
- if(index == -1)
- {
- key_temp.push(last);
- index = key_temp.length-1;
- }
-
- // 数据组合
- if(data_list[index] == undefined)
- {
- data_list[index] = {};
- }
- data_list[index][fields[f]] = (fields[f] != 'value' || (data[i] || null) == null) ? data[i] : (JSON.parse(decodeURIComponent(data[i])) || '');
- delete data[i];
- }
- }
- }
- }
+ var res = FormBackDataListHandle(data, fields);
+ data = res.data;
+ var data_list = res.data_list;
if(data_list.length <= 0)
{
Prompt($layout.data('config-images-tips') || '请先添加图片并配置');
@@ -713,7 +752,7 @@ function FormBackModuleConfigManyImagesHandle(data)
"media_fixed": media_fixed
}
data['data_list'] = data_list;
- $doc.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
// 滚动初始化
if(show_style != 'list')
@@ -765,38 +804,9 @@ function FormBackModuleConfigImagesTextHandle(data)
"content_to_type_": "type",
"content_to_value_": "value"
};
- var key_temp = [];
- var data_list = [];
- for(var i in data)
- {
- var loc = i.lastIndexOf('_');
- if(loc != -1)
- {
- var key = i.substr(0, loc+1);
- var last = i.substr(loc+1);
- for(var f in fields)
- {
- if(key == f)
- {
- // 临时索引记录
- var index = key_temp.indexOf(last);
- if(index == -1)
- {
- key_temp.push(last);
- index = key_temp.length-1;
- }
-
- // 数据组合
- if(data_list[index] == undefined)
- {
- data_list[index] = {};
- }
- data_list[index][fields[f]] = (fields[f] != 'value' || (data[i] || null) == null) ? data[i] : (JSON.parse(decodeURIComponent(data[i])) || '');
- delete data[i];
- }
- }
- }
- }
+ var res = FormBackDataListHandle(data, fields);
+ data = res.data;
+ var data_list = res.data_list;
if(data_list.length <= 0)
{
Prompt($layout.data('config-images-text-tips') || '请先添加图文并配置');
@@ -815,7 +825,7 @@ function FormBackModuleConfigImagesTextHandle(data)
if(show_style == null)
{
Prompt($layout.data('data-show-modal-tips') || '请选择数据展示模式');
- return false;
+ return false;
}
// 样式处理
@@ -956,7 +966,7 @@ function FormBackModuleConfigImagesTextHandle(data)
"media_fixed": media_fixed
}
data['data_list'] = data_list;
- $doc.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
// 滚动初始化
if(show_style == 'rolling')
@@ -966,6 +976,571 @@ function FormBackModuleConfigImagesTextHandle(data)
$offcanvas_config_images_text.offCanvas('close');
}
+/**
+ * 模块-图片魔方处理
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2021-05-18
+ * @desc description
+ * @param {[object]} data [表单数据]
+ */
+function FormBackModuleConfigImagesMagicCubeHandle(data)
+{
+ // 基础信息
+ var doc = $offcanvas_config_images_magic_cube.attr('data-doc') || null;
+ if(doc == null)
+ {
+ Prompt($layout.data('module-tab-tips') || '模块标记有误');
+ return false;
+ }
+
+ // 数据字段
+ var fields = {
+ "content_images_": "images",
+ "content_to_name_": "name",
+ "content_to_type_": "type",
+ "content_to_value_": "value"
+ };
+ var res = FormBackDataListHandle(data, fields);
+ data = res.data;
+ var data_list = res.data_list;
+ for(var i in data_list)
+ {
+ if((data_list[i]['images'] || null) == null)
+ {
+ Prompt($layout.data('upload-images-tips') || '请上传图片');
+ return false;
+ }
+ }
+ // 展示模式
+ var show_style = data.view_list_show_style || null;
+ if(show_style == null)
+ {
+ Prompt($layout.data('data-show-modal-tips') || '请选择数据展示模式');
+ return false;
+ }
+
+ // 外边距
+ var margin = parseInt(data.style_margin || 0);
+ data['style_item_margin_top'] = margin;
+ data['style_item_margin_left'] = margin;
+
+ // 样式处理
+ var images_style = StyleBaseHandle(data, 'style_item_');
+
+ // 设置了外边距,则计算平均移动值
+ var list_ent = (margin > 0) ? 'module-list-content-avg-'+margin : '';
+
+ // 数据处理
+ var html = '';
+ var item_style = [];
+ switch(show_style)
+ {
+ // 1图
+ case 'g1' :
+ item_style[0] = 'width:100%;';
+ html += `
`;
+ break;
+
+ // 2竖图
+ case 'v2' :
+ item_style[0] = 'width:50%;';
+ item_style[1] = 'width:50%;';
+ html += `
`;
+ break;
+
+ // 3竖图
+ case 'v3' :
+ item_style[0] = 'width:33.33%;';
+ item_style[1] = 'width:33.33%;';
+ item_style[2] = 'width:33.33%;';
+ html += `
`;
+ break;
+
+ // 4竖图
+ case 'v4' :
+ item_style[0] = 'width:25%;';
+ item_style[1] = 'width:25%;';
+ item_style[2] = 'width:25%;';
+ item_style[3] = 'width:25%;';
+ html += `
`;
+ break;
+
+ // 2横图
+ case 'h2' :
+ item_style[0] = 'width:100%;';
+ item_style[1] = 'width:100%;';
+ html += `
`;
+ break;
+
+ // 3横图
+ case 'h3' :
+ item_style[0] = 'width:100%;';
+ item_style[1] = 'width:100%;';
+ item_style[2] = 'width:100%;';
+ html += `
`;
+ break;
+
+ // 4横图
+ case 'h4' :
+ item_style[0] = 'width:100%;';
+ item_style[1] = 'width:100%;';
+ item_style[2] = 'width:100%;';
+ item_style[3] = 'width:100%;';
+ html += `
`;
+ break;
+
+ // 1左右2
+ case 'lr12' :
+ if(margin > 0)
+ {
+ item_style[0] = 'width:calc(50% + '+(margin/2)+'px);';
+ item_style[1] = 'width:calc(50% - '+(margin/2)+'px);';
+ } else {
+ item_style[0] = 'width:50%;';
+ item_style[1] = 'width:50%;';
+ }
+ html += `
`;
+ break;
+
+ // 1左右3
+ case 'lr13' :
+ if(margin > 0)
+ {
+ item_style[0] = 'width:calc(50% + '+margin+'px);';
+ item_style[1] = 'width:calc(50% - '+margin+'px);';
+ } else {
+ item_style[0] = 'width:50%;';
+ item_style[1] = 'width:50%;';
+ }
+ html += `
`;
+ break;
+
+ // 2左右1
+ case 'lr21' :
+ if(margin > 0)
+ {
+ item_style[0] = 'width:calc(50% - '+(margin/2)+'px);';
+ item_style[1] = 'width:calc(50% + '+(margin/2)+'px);';
+ } else {
+ item_style[0] = 'width:50%;';
+ item_style[1] = 'width:50%;';
+ }
+ html += `
`;
+ break;
+
+ // 3左右1
+ case 'lr31' :
+ if(margin > 0)
+ {
+ item_style[0] = 'width:calc(50% - '+margin+'px);';
+ item_style[1] = 'width:calc(50% + '+margin+'px);';
+ } else {
+ item_style[0] = 'width:50%;';
+ item_style[1] = 'width:50%;';
+ }
+ html += `
`;
+ break;
+
+ // 1上下2
+ case 'tb12' :
+ item_style[0] = 'width:100%;';
+ item_style[1] = 'width:50%;';
+ item_style[2] = 'width:50%;';
+ html += `
`;
+ break;
+
+ // 1上下3
+ case 'tb13' :
+ item_style[0] = 'width:100%;';
+ item_style[1] = 'width:33.33%;';
+ item_style[2] = 'width:33.33%;';
+ item_style[3] = 'width:33.33%;';
+ html += `
`;
+ break;
+
+ // 2上下1
+ case 'tb21' :
+ item_style[0] = 'width:50%;';
+ item_style[1] = 'width:50%;';
+ item_style[2] = 'width:100%;';
+ html += `
`;
+ break;
+
+ // 3上下1
+ case 'tb31' :
+ item_style[0] = 'width:33.33%;';
+ item_style[1] = 'width:33.33%;';
+ item_style[2] = 'width:33.33%;';
+ item_style[3] = 'width:100%;';
+ html += `
`;
+ break;
+
+ // 2竖左右横2
+ case 'lrv2h2' :
+ if(margin > 0)
+ {
+ item_style[0] = 'width:calc(25% + '+(margin/2)+'px);';
+ item_style[1] = 'width:calc(25% + '+(margin/2)+'px);';
+ item_style[2] = 'width:calc(50% - '+margin+'px);';
+ } else {
+ item_style[0] = 'width:25%;';
+ item_style[1] = 'width:25%;';
+ item_style[2] = 'width:50%;';
+ }
+ html += `
`;
+ break;
+
+ // 2横左右竖2
+ case 'lrh2v2' :
+ if(margin > 0)
+ {
+ item_style[0] = 'width:calc(50% - '+margin+'px);';
+ item_style[1] = 'width:calc(25% + '+(margin/2)+'px);';
+ item_style[2] = 'width:calc(25% + '+(margin/2)+'px);';
+ } else {
+ item_style[0] = 'width:50%;';
+ item_style[1] = 'width:25%;';
+ item_style[2] = 'width:25%;';
+ }
+ html += `
`;
+ break;
+
+ // 4图
+ case 'g4' :
+ item_style[0] = 'width:50%;';
+ item_style[1] = 'width:50%;';
+ item_style[2] = 'width:50%;';
+ item_style[3] = 'width:50%;';
+ html += `
`;
+ break;
+ }
+
+ // 模块容器设置
+ var $doc = $(doc);
+ $doc.html(html);
+
+ // 数据加入配置
+ data['frontend_config'] = {
+ list_ent: list_ent,
+ item_style: item_style,
+ images_style: images_style
+ }
+ data['data_list'] = data_list;
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
+ $offcanvas_config_images_magic_cube.offCanvas('close');
+}
+
/**
* 模块-视频处理
* @author Devil
@@ -1012,7 +1587,7 @@ function FormBackModuleConfigVideoHandle(data)
"style": style,
"media_fixed": media_fixed
}
- $doc.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
$offcanvas_config_video.offCanvas('close');
}
@@ -1122,19 +1697,19 @@ function FormBackModuleConfigGoodsHandle(data)
var item_html = '';
for(var i in list)
{
- item_html += '
';
- item_html += '';
- item_html += '
';
- item_html += '
';
- item_html += '';
- item_html += '
';
- item_html += '
';
- item_html += '
'+__currency_symbol__+list[i]['price']+'
';
- item_html += '
';
- item_html += '
';
- item_html += '';
+ item_html += `
;
+
+
+
+
+
+
+
`+__currency_symbol__+list[i]['price']+`
+
+
+ `;
}
// 商品容器
@@ -1146,6 +1721,7 @@ function FormBackModuleConfigGoodsHandle(data)
// 展示模式
var nav_dot_ent = '';
var list_ent = '';
+ var item_right_style = '';
var show_style = data.view_list_show_style || 'routine';
switch(show_style)
{
@@ -1173,6 +1749,34 @@ function FormBackModuleConfigGoodsHandle(data)
}
break;
+ // 左图右文
+ case 'leftright' :
+ var style_media_fixed_width = parseInt(data.style_media_fixed_width || 0);
+ item_right_style = 'margin-left:10px;'+((style_media_fixed_width > 0) ? 'width: calc(100% - '+(style_media_fixed_width+10)+'px);' : '');
+ // 设置了外边距,则计算平均移动值
+ var avg = (margin > 0) ? 'module-list-content-avg-'+margin : '';
+ // 列表class
+ list_ent = avg+' module-list-sm-'+sm+' module-list-md-'+md+' module-list-lg-'+md+' ';
+ html += '
';
+ for(var i in list)
+ {
+ html += `-
+
+
+
+
+
+
+
`+__currency_symbol__+list[i]['price']+`
+
+
+ `;
+ }
+ html += '
';
+ break;
+
// 常规、默认
default :
// 设置了外边距,则计算平均移动值
@@ -1201,11 +1805,12 @@ function FormBackModuleConfigGoodsHandle(data)
data['frontend_config'] = {
"style": style,
"item_style": item_style,
+ "item_right_style": item_right_style,
"nav_dot_ent": nav_dot_ent,
"list_ent": list_ent,
"media_fixed": media_fixed
}
- $doc.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
// 组件参数
if(JSON.stringify(option) !== '{}')
@@ -1330,7 +1935,7 @@ function FormBackModuleConfigTitleHandle(data)
"style_title_vice": style_title_vice,
"style_title_more": style_title_more
}
- $doc.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
$offcanvas_config_title.offCanvas('close');
}
@@ -1357,14 +1962,8 @@ function FormBackModuleConfigCustomHandle(data)
var $doc = $(doc);
$doc.html(data.custom || '');
- // 自定义html、转为base64
- if((data['custom'] || null) != null)
- {
- data['custom'] = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(data.custom));
- }
-
// 数据加入配置
- $doc.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
$offcanvas_config_custom.offCanvas('close');
}
@@ -1413,7 +2012,7 @@ function FormBackModuleConfigBorderHandle(data)
data['frontend_config'] = {
"style": style
}
- $doc.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
$offcanvas_config_border.offCanvas('close');
}
@@ -1457,7 +2056,7 @@ function FormBackModuleConfigHeightHandle(data)
data['frontend_config'] = {
"style": style
}
- $doc.attr('data-json', encodeURIComponent(JSON.stringify(data)));
+ $doc.attr('data-json', encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(data)))));
$offcanvas_config_height.offCanvas('close');
}
@@ -1697,28 +2296,28 @@ function ModuleConfigGoodsItemContentHtml(data)
function ModuleConfigManyImagesItemContentHtml(images, type, name, value)
{
var index = parseInt(Math.random()*1000001);
- var html = '
';
- html += '
';
- html += '
';
- html += '
';
- html += '
';
+ var html = `
`;
return html;
}
@@ -1832,6 +2431,88 @@ function ModuleConfigImagesTextItemContentHtml(data)
return html;
}
+/**
+ * 模块-图片魔方信息生成
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2021-05-18
+ * @desc description
+ * @param {[object]} data [配置数据]
+ */
+function ModuleConfigImagesMagicCubeItemContentHtml(data)
+{
+ // 基础处理
+ if((data || null) == null)
+ {
+ data = {};
+ }
+
+ // 展示模式
+ var value = (((data.view_list_show_style || null) == null) ? $offcanvas_config_images_magic_cube.find('input[name="view_list_show_style"]:checked').val() : data.view_list_show_style) || null;
+ if(value == null)
+ {
+ Prompt($layout.data('data-show-modal-tips') || '请选择数据展示模式');
+ return false;
+ }
+ var modal_arr = {g1:1, v2:2, v3:3, v4:4, h2:2, h3:3, h4:4, lr12:3, lr13:4, lr21:3, lr31:4, tb12:3, tb13:4, tb21:3, tb31:4, lrv2h2:4, lrh2v2:4, g4:4};
+ if(modal_arr[value] == undefined)
+ {
+ Prompt(($layout.data('data-show-modal-error-tips') || '展示模式有误')+'('+value+')');
+ return false;
+ }
+
+ // 编辑则重新添加
+ var count = 0;
+ if(JSON.stringify(data) == '{}')
+ {
+ // 已有数据条数、满足数量则不增加,多余则移除
+ count = $offcanvas_config_images_magic_cube.find('.config-images-magic-cube-container > .am-panel').length;
+ var max = modal_arr[value]-count;
+ if(max < 0)
+ {
+ for(var i=count;i>=modal_arr[value];i--)
+ {
+ $offcanvas_config_images_magic_cube.find('.config-images-magic-cube-container > .am-panel:eq('+i+')').remove();
+ }
+ }
+ if(max <= 0)
+ {
+ return false;
+ }
+ }
+
+ // 生成数据
+ var html = '';
+ var data_list = data.data_list || [];
+ for(var i=count;i
+
+
+ `;
+ }
+ return html;
+}
+
/**
* 模块-标题关键字
* @author Devil
@@ -2025,8 +2706,8 @@ function OffcanvasConfigPagesChoice(obj, event)
// 获取已选择的数据
var $parent = $page_parent_obj.parents('.form-view-choice-container');
- var key = $parent.data('key') || null;
- var index = (key == null) ? '' : '_'+key;
+ var key = $parent.data('key') ;
+ var index = (key == undefined) ? '' : '_'+key;
var to_type = $parent.find('input[name="content_to_type'+index+'"]').val() || null;
var to_name = $parent.find('input[name="content_to_name'+index+'"]').val() || null;
var to_value = $parent.find('input[name="content_to_value'+index+'"]').val() || null;
@@ -2097,8 +2778,8 @@ function OffcanvasConfigPagesRemove(obj, event)
{
var $parent = obj.parents('.form-view-choice-container');
var $content = $parent.find('.form-view-choice-container-content');
- var key = $parent.data('key') || null;
- var index = (key == null) ? '' : '_'+key;
+ var key = $parent.data('key');
+ var index = (key == undefined) ? '' : '_'+key;
$content.html(ModuleConfigImagesToContentHtml());
$parent.find('input[name="content_to_type'+index+'"]').val('');
$parent.find('input[name="content_to_name'+index+'"]').val('');
@@ -2151,7 +2832,7 @@ function LayoutViewConfig()
var layout_temp = {
"value": $(this).data('value').toString(),
"status": ($(this).find('.layout-content-submit input[type="checkbox"]:checked').val() == 'on') ? 1 : 0,
- "config": (json == null) ? {} : JSON.parse(decodeURIComponent(json)),
+ "config": (json == null) ? {} : JSON.parse(CryptoJS.enc.Base64.parse(decodeURIComponent(json)).toString(CryptoJS.enc.Utf8)),
"children": []
};
@@ -2161,7 +2842,7 @@ function LayoutViewConfig()
// 容器数据
var json = $(this).attr('data-json') || null;
var content_temp = {
- "config": (json == null) ? {} : JSON.parse(decodeURIComponent(json)),
+ "config": (json == null) ? {} : JSON.parse(CryptoJS.enc.Base64.parse(decodeURIComponent(json)).toString(CryptoJS.enc.Utf8)),
"children": []
};
@@ -2174,7 +2855,7 @@ function LayoutViewConfig()
var module_config = {
"value": value,
"name": layout_module_type_arr[value],
- "config": (json == null) ? {} : JSON.parse(decodeURIComponent(json))
+ "config": (json == null) ? {} : JSON.parse(CryptoJS.enc.Base64.parse(decodeURIComponent(json)).toString(CryptoJS.enc.Utf8))
};
// 商品模块移除商品列表
if(value == 'goods')
@@ -2327,7 +3008,7 @@ $(function()
if(json != null)
{
// 数据解析
- json = JSON.parse(decodeURIComponent(json)) || null;
+ json = JSON.parse(CryptoJS.enc.Base64.parse(decodeURIComponent(json)).toString(CryptoJS.enc.Utf8)) || null;
}
// 获取表单字段并赋空值
if((json || null) == null)
@@ -2383,7 +3064,7 @@ $(function()
if(json != null)
{
// 数据解析
- json = JSON.parse(decodeURIComponent(json)) || null;
+ json = JSON.parse(CryptoJS.enc.Base64.parse(decodeURIComponent(json)).toString(CryptoJS.enc.Utf8)) || null;
}
// 获取表单字段并赋空值
if((json || null) == null)
@@ -2528,7 +3209,7 @@ $(function()
if(json != null)
{
// 数据解析
- json = JSON.parse(decodeURIComponent(json)) || null;
+ json = JSON.parse(CryptoJS.enc.Base64.parse(decodeURIComponent(json)).toString(CryptoJS.enc.Utf8)) || null;
}
// 配置模块
@@ -2568,7 +3249,6 @@ $(function()
{
// 图片模块
case 'images' :
- // 图片处理
var default_images = $config.data('default-images');
var html = '