diff --git a/plugin/think-plugs-static/stc/public/static/extra/script.js b/plugin/think-plugs-static/stc/public/static/extra/script.js index 6d64fc6e8..de5665e21 100644 --- a/plugin/think-plugs-static/stc/public/static/extra/script.js +++ b/plugin/think-plugs-static/stc/public/static/extra/script.js @@ -45,4 +45,12 @@ $(function () { window.showTableImage = function (image, circle, size, title) { return $.layTable.showImage(image, circle, size, title); }; + + // 显示商品规格 + window.showSpec = function (spec) { + let names = []; + return layui.each(spec.split(';;'), function (i, vv) { + names.push(vv.split('::').pop()); + }), names.join(' '); + } }); \ No newline at end of file diff --git a/public/static/extra/script.js b/public/static/extra/script.js index 6d64fc6e8..de5665e21 100644 --- a/public/static/extra/script.js +++ b/public/static/extra/script.js @@ -45,4 +45,12 @@ $(function () { window.showTableImage = function (image, circle, size, title) { return $.layTable.showImage(image, circle, size, title); }; + + // 显示商品规格 + window.showSpec = function (spec) { + let names = []; + return layui.each(spec.split(';;'), function (i, vv) { + names.push(vv.split('::').pop()); + }), names.join(' '); + } }); \ No newline at end of file