From 6de066700687dc54f680ef60a5285581d4fb44a1 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Wed, 22 Jun 2022 14:35:27 +0800
Subject: [PATCH] 20220528
---
src/main/resources/templates/febs/views/modules/goods/goodsList.html | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/templates/febs/views/modules/goods/goodsList.html b/src/main/resources/templates/febs/views/modules/goods/goodsList.html
index bd804bb..9a75209 100644
--- a/src/main/resources/templates/febs/views/modules/goods/goodsList.html
+++ b/src/main/resources/templates/febs/views/modules/goods/goodsList.html
@@ -60,6 +60,13 @@
<input type="checkbox" value={{d.id}} lay-text="上架|下架" lay-skin="switch" lay-filter="upOrDownSwitch">
{{# } }}
</script>
+<script type="text/html" id="isHotSwitch">
+ {{# if(d.isHot === 1) { }}
+ <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="isHotSwitch">
+ {{# } else { }}
+ <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="isHotSwitch">
+ {{# } }}
+</script>
<script type="text/html" id="isSkuFormat">
{{# if(d.isSku === 1) { }}
<span>是</span>
@@ -68,7 +75,7 @@
{{# } }}
</script>
<script type="text/html" id="goodsTypeFormat">
- {{# if(d.isNormal === 1) { }}
+ {{# if(d.isNormal == 1) { }}
<span>普通商品</span>
{{# } else { }}
<span>套餐</span>
@@ -170,6 +177,18 @@
$query.click();
});
}
+ function goodsHot(id) {
+ febs.get(ctx + 'admin/goods/goodsHot/' + id, null, function () {
+ febs.alert.success('设置成功');
+ $query.click();
+ });
+ }
+ function goodsNotHot(id) {
+ febs.get(ctx + 'admin/goods/goodsNotHot/' + id, null, function () {
+ febs.alert.success('设置成功');
+ $query.click();
+ });
+ }
// 查询按钮
$query.on('click', function () {
@@ -211,6 +230,7 @@
}, minWidth: 150,align:'center'},
{field: 'categaryName', title: '分类', minWidth: 150,align:'left'},
{field: 'isSale', title: '是否上架', templet: '#upOrDownSwitch', minWidth: 130,align:'center'},
+ {field: 'isHot', title: '是否主推', templet: '#isHotSwitch', minWidth: 130,align:'center'},
{templet:"#goodsTypeFormat", title: '商品类型', minWidth: 150,align:'left'},
{templet:"#isSkuFormat", title: '是否多规格', minWidth: 150,align:'left'},
{field: 'presentPrice', title: '现价', minWidth: 150,align:'left'},
@@ -243,6 +263,14 @@
}
})
+ form.on('switch(isHotSwitch)', function (data) {
+ if (data.elem.checked) {
+ goodsHot(data.value);
+ } else {
+ goodsNotHot(data.value);
+ }
+ })
+
// 获取查询参数
function getQueryParams() {
return {
--
Gitblit v1.9.1