From 9e7037d05c9dca3ca39d6872a65a2ab94fab2bfe Mon Sep 17 00:00:00 2001 From: devil Date: Thu, 30 Jul 2020 22:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=94=AF=E6=8C=81=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/default/goods/module/operate.html | 4 +++ .../admin/view/default/goods/save_info.html | 2 +- .../default/warehousegoods/goods_search.html | 34 +++++++++---------- .../view/default/warehousegoods/index.html | 8 +++-- application/service/WarehouseGoodsService.php | 2 +- .../static/admin/default/js/warehousegoods.js | 25 +++++++++++--- public/static/common/css/common.css | 32 +++++++++++++++++ public/static/common/js/common.js | 12 +++++++ 8 files changed, 91 insertions(+), 28 deletions(-) diff --git a/application/admin/view/default/goods/module/operate.html b/application/admin/view/default/goods/module/operate.html index 02704ea40..c0e36c593 100644 --- a/application/admin/view/default/goods/module/operate.html +++ b/application/admin/view/default/goods/module/operate.html @@ -7,6 +7,10 @@ 编辑 + + + 复制 + diff --git a/application/admin/view/default/warehousegoods/goods_search.html b/application/admin/view/default/warehousegoods/goods_search.html index 53b44dde3..32363278b 100644 --- a/application/admin/view/default/warehousegoods/goods_search.html +++ b/application/admin/view/default/warehousegoods/goods_search.html @@ -1,23 +1,21 @@ {{if !empty($data)}} - + + + {{/foreach}} {{else /}}
没有相关商品
{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/warehousegoods/index.html b/application/admin/view/default/warehousegoods/index.html index c5956084b..4f662558c 100644 --- a/application/admin/view/default/warehousegoods/index.html +++ b/application/admin/view/default/warehousegoods/index.html @@ -15,8 +15,8 @@

商品添加

- × + + ×
@@ -54,7 +54,9 @@
-
请搜索商品
+
diff --git a/application/service/WarehouseGoodsService.php b/application/service/WarehouseGoodsService.php index 7a6e0f766..d38e72084 100644 --- a/application/service/WarehouseGoodsService.php +++ b/application/service/WarehouseGoodsService.php @@ -756,7 +756,7 @@ class WarehouseGoodsService 'inventory' => $inventory_total, 'upd_time' => time(), ]; - if(!Db::name('Goods')->where(['id'=>$goods_id])->update($data)) + if(Db::name('Goods')->where(['id'=>$goods_id])->update($data) === false) { return DataReturn('商品库存同步失败', -21); } diff --git a/public/static/admin/default/js/warehousegoods.js b/public/static/admin/default/js/warehousegoods.js index c1ed0e249..1c57076d3 100644 --- a/public/static/admin/default/js/warehousegoods.js +++ b/public/static/admin/default/js/warehousegoods.js @@ -40,7 +40,7 @@ $(function() var $this = $(this); $this.button('loading'); - $('.goods-list-container').html('
'+($('.goods-list-container').data('loading-msg'))+'
'); + $('.goods-list-container ul.am-gallery').html('
'+($('.goods-list-container').data('loading-msg'))+'
'); $.ajax({ url: url, type: 'post', @@ -52,18 +52,18 @@ $(function() if(res.code == 0) { $('.goods-list-container').attr('data-is-init', 0); - $('.goods-list-container').html(res.data.data); + $('.goods-list-container ul.am-gallery').html(res.data.data); $('.goods-page-container').html(PageLibrary(res.data.total, res.data.page_size, res.data.page, 4)); } else { Prompt(res.msg); - $('.goods-list-container').html('
'+res.msg+'
'); + $('.goods-list-container ul.am-gallery').html('
'+res.msg+'
'); } }, error:function(res) { $this.button('reset'); Prompt('请求失败'); - $('.goods-list-container').html('
请求失败
'); + $('.goods-list-container ul.am-gallery').html('
请求失败
'); } }); }); @@ -105,5 +105,20 @@ $(function() }); }); - + // 弹窗全屏 + $('#warehouse-goods-popup').on('click', '.am-popup-hd .am-full', function() + { + var width = $(window).width(); + var height = $(window).height(); + if(width >= 630 && height >= 630) + { + var $parent = $(this).parents('.am-popup'); + if($parent.hasClass('popup-full')) + { + $parent.find('.am-gallery').addClass('am-avg-lg-5').removeClass('am-avg-lg-8'); + } else { + $parent.find('.am-gallery').addClass('am-avg-lg-8').removeClass('am-avg-lg-6'); + } + } + }); }); \ No newline at end of file diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index bc01922f4..33fc5ab8a 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -107,6 +107,38 @@ form.am-form .am-form-group-refreshing, .plug-file-upload-view, .content-app-ite .popup-not-title .am-close:hover { background: #f22a30; } +.am-popup-hd .am-close, .am-popup-hd .am-full { + width: 26px; + height: 26px; + line-height: 26px; + color: #999; + text-align: center; +} +.am-popup-hd .am-close { + font-size: 22px; + opacity: 1; +} +.am-popup-hd .am-close:hover { + color: #f22a30; + transform: none; +} +.am-popup-hd .am-full { + position: absolute; + right: 40px; + top: 11px; + cursor: pointer; +} +.am-popup-hd .am-full:hover { + color: #03A9F4; +} +.popup-full { + width: 100%; + height: 100%; + left: 0; + top: 0; + margin-left: 0; + margin-top: 0; +} /** diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 5e899cf56..0c8c187da 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -2498,4 +2498,16 @@ $(function() MapInit(lng, lat, null, null, false); }); + // 弹窗全屏 + $(document).on('click', '.am-popup-hd .am-full', function() + { + var $parent = $(this).parents('.am-popup'); + if($parent.hasClass('popup-full')) + { + $parent.removeClass('popup-full'); + } else { + $parent.addClass('popup-full'); + } + }); + }); \ No newline at end of file -- GitLab