Browse Source

bugCommit

zhengjinyi 4 năm trước cách đây
mục cha
commit
625e9a0b4d
1 tập tin đã thay đổi với 19 bổ sung19 xóa
  1. 19 19
      src/main/resources/static/js/base.js

+ 19 - 19
src/main/resources/static/js/base.js

@@ -271,27 +271,27 @@ $(function(){
     $('#topSearch').on("click", '.searchBtn', function(){
         var type = isPC ? $('#topSearch').find('[data-select]').attr("data-select")*1 : $('#topSearch').find('select').val()*1;
         var keyword = $.trim($('#topSearch').find('.keyword').val());
-        if (keyword.length < 2) {
-            $.confirm({
-                useBootstrap: false,
-                boxWidth: (isPC?'300px':'70%'),
-                title:'提示',
-                content:'请至少输入两个关键字!',
-                closeIcon: true,
-                animation: 'opacity',
-                closeAnimation: 'opacity',
-                animateFromElement: false,
-                buttons: {
-                    close: {
-                        text: '确定',
-                        btnClass: 'btn-confirm'
-                    }
-                }
-            });
-            return false;
-        }
         if (type === 0) {
             // 商品
+            if (keyword.length < 2) {
+                $.confirm({
+                    useBootstrap: false,
+                    boxWidth: (isPC?'300px':'70%'),
+                    title:'提示',
+                    content:'请至少输入两个关键字!',
+                    closeIcon: true,
+                    animation: 'opacity',
+                    closeAnimation: 'opacity',
+                    animateFromElement: false,
+                    buttons: {
+                        close: {
+                            text: '确定',
+                            btnClass: 'btn-confirm'
+                        }
+                    }
+                });
+                return false;
+            }
             window.location.href = '/product/list.html?keyword='+encodeURIComponent(keyword);
         } else if(type === 1) {
             // 供应商