From 896f57788d871aabcaee1db4464ed21dc206649c Mon Sep 17 00:00:00 2001 From: devil_gong Date: Wed, 11 Sep 2019 21:06:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E6=A0=BC=E5=BF=AB=E6=8D=B7=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/view/default/goods/save_info.html | 64 ++++- config/shopxo.php | 2 +- public/static/admin/default/css/goods.css | 218 +++++++++++++++--- public/static/admin/default/js/goods.js | 46 +++- public/static/index/default/js/index.js | 26 ++- 5 files changed, 311 insertions(+), 45 deletions(-) diff --git a/application/admin/view/default/goods/save_info.html b/application/admin/view/default/goods/save_info.html index ca5337ac0..ad383eaaa 100755 --- a/application/admin/view/default/goods/save_info.html +++ b/application/admin/view/default/goods/save_info.html @@ -42,6 +42,9 @@
  • SEO
  • + @@ -165,9 +168,68 @@
    +
    + +快捷操作 + 生成规格 +
    + + + + + + + + + + + + + + + + + +
    规格名规格值
    + × + + +
    + + × +
    +
    + + × +
    + +
    + +添加规格值 +
    + +
    + × + + +
    + + × +
    +
    + + × +
    + +
    + +添加规格值 +
    + +
    +
    +
    + +添加规格
    - +
    {{if !empty($specifications['type'])}} diff --git a/config/shopxo.php b/config/shopxo.php index 8021e7794..6cc7668a4 100755 --- a/config/shopxo.php +++ b/config/shopxo.php @@ -15,7 +15,7 @@ return [ // 开发模式 - 'is_develop' => false, + 'is_develop' => true, // 默认编码 'default_charset' => 'utf-8', diff --git a/public/static/admin/default/css/goods.css b/public/static/admin/default/css/goods.css index 74c2d6c08..a47004f6a 100755 --- a/public/static/admin/default/css/goods.css +++ b/public/static/admin/default/css/goods.css @@ -1,50 +1,134 @@ /** * 列表 */ -.form-keyword { width: 55% !important; display: initial !important; } -.more-submit input { display: none; } -.param-where, .param-date input { display: initial !important; } +.form-keyword { + width:55% !important; + display:initial !important; +} +.more-submit input { + display:none; +} +.param-where,.param-date input { + display:initial !important; +} @media only screen and (max-width: 641px) { - .param-where { width: 100% !important; margin-left: 0px !important; } - .param-date input { width: 47% !important; } - .images-list li { width: calc( 50% - 10px) !important; } - .images-list { width: 100%; } - .view-list .am-table tr th:nth-child(1) { width: 150px; } + .param-where { + width:100% !important; + margin-left:0px !important; + } + .param-date input { + width:47% !important; + } + .images-list li { + width:calc( 50% - 10px) !important; + } + .images-list { + width:100%; + } + .view-list .am-table tr th:nth-child(1) { + width:150px; + } } @media only screen and (min-width: 641px) { - .param-where { width: 32% !important; float: left; } - .param-date input { width: 45% !important; } - .param-where:nth-child(1) { margin-left: 0px !important; } - .images-list { width: 75%; } - .view-list .am-table tr th:nth-child(1) { width: 300px; } + .param-where { + width:32% !important; + float:left; + } + .param-date input { + width:45% !important; + } + .param-where:nth-child(1) { + margin-left:0px !important; + } + .images-list { + width:75%; + } + .view-list .am-table tr th:nth-child(1) { + width:300px; + } } @media only screen and (max-width: 321px) { - .view-operation button { margin: 2px 0px; } + .view-operation button { + margin:2px 0px; + } +} +.goods-list.am-table .goods-images { + width:60px; + height:60px; + float:left; + margin-right:5px; } -.goods-list.am-table .goods-images { width: 60px; height: 60px; float: left; margin-right: 5px; } /** * 滚动导航 */ -.goods-nav { background: #f5f5f5; top: 100px; right: 0; width: 110px; position: fixed; z-index: 1000; border: 1px solid #eee; border-right: 0px; } -.goods-nav ul { margin: 0; padding: 0; } -.goods-nav li { display: inline-block; border-bottom: 1px solid #eee; width: 100%; } -.goods-nav li:last-child { border-bottom: 0px; } -.goods-nav li a { color: #666; padding: 10px 15px; display: inline-block; width: 100%; } -.goods-nav li a:hover, .goods-nav-active { color: #333; background: #eee; } +.goods-nav { + background:#f5f5f5; + top:100px; + right:0; + width:110px; + position:fixed; + z-index:1000; + border:1px solid #eee; + border-right:0px; +} +.goods-nav ul { + margin:0; + padding:0; +} +.goods-nav li { + display:inline-block; + border-bottom:1px solid #eee; + width:100%; +} +.goods-nav li:last-child { + border-bottom:0px; +} +.goods-nav li a { + color:#666; + padding:10px 15px; + display:inline-block; + width:100%; +} +.goods-nav li a:hover,.goods-nav-active { + color:#333; + background:#eee; +} +.goods-nav li.nav-shrink-submit { + background: #eaeaea; + cursor: pointer; +} +.goods-nav-retract { + /*right: -110px;*/ +} +.goods-nav-retract .nav-shrink-submit { + position: absolute; + /*left: -50px;*/ + /*width: 50px;*/ +} /** * 区域分割 */ -.division-block { margin-bottom: 30px; } -.division-block .nav-detail-title { border-bottom: 3px ridge #c7c7c7; padding: 8px 5px 5px 5px; margin-bottom: 10px; background: #f3f3f3; font-weight: bold; } +.division-block { + margin-bottom:30px; +} +.division-block .nav-detail-title { + border-bottom:3px ridge #c7c7c7; + padding:8px 5px 5px 5px; + margin-bottom:10px; + background:#f3f3f3; + font-weight:bold; +} /** * 规格 */ -.specifications-table .title-nav th { +.specifications-table .title-nav th, +.spec-quick table thead th { background-color: #f5f7fa; position: relative; + border-bottom: 0; } .specifications-table .title-nav th input { width: calc(100% - 25px); @@ -85,14 +169,86 @@ * 属性 * app详情 */ -i.drag-sort-submit { margin-left: 30px; } -ul { margin: 0px; padding: 0px; overflow: hidden; } -.content-app-items > li { border: 3px dashed #eee; padding: 10px; } -ul li { list-style-type: none; } +i.drag-sort-submit { + margin-left:30px; +} +ul { + margin:0px; + padding:0px; + overflow:hidden; +} +.content-app-items > li { + border:3px dashed #eee; + padding:10px; +} +ul li { + list-style-type:none; +} /** * app详情 */ -.content-app-left, .content-app-right { border-bottom: 0 !important; } -.content-app-items li { padding-bottom: 10px; margin-bottom: 20px; overflow: hidden; } -.content-app-left, .content-app-right { width: 45% !important; display: inline-table; margin-bottom: 5px; padding-right: 5px !important; } +.content-app-left,.content-app-right { + border-bottom:0 !important; +} +.content-app-items li { + padding-bottom:10px; + margin-bottom:20px; + overflow:hidden; +} +.content-app-left,.content-app-right { + width:45% !important; + display:inline-table; + margin-bottom:5px; + padding-right:5px !important; +} + +/** + * 规格快捷添加 + */ +.spec-quick table td, +.spec-quick table td.spec-quick-td-value .value-item { + position: relative; +} +.spec-quick table td.am-text-middle { + padding-right: 25px; +} +.spec-quick-td-value .value-item input { + width: calc(100% - 23px) !important; +} +.spec-quick table td.am-text-middle i.quick-title-remove, +.spec-quick table td.spec-quick-td-value i.quick-value-remove { + position: absolute; + top: 0px; + right: 0px; + z-index: 2; +} +.spec-quick table td.spec-quick-td-value i.quick-value-remove { + top: 2px; +} +.spec-quick .goods-specifications { + border-bottom: 0; + padding-bottom: 0; +} + +@media only screen and (min-width: 641px) { + .spec-quick-th-title { + width: 150px; + } + .spec-quick-td-value .value-item { + width: calc(30% - 12px) !important; + } +} +@media only screen and (min-width: 1025px) { + .spec-quick-td-value .value-item { + width: calc(20% - 12px) !important; + } +} +@media only screen and (max-width: 641px) { + .spec-quick-th-title { + width: 20%; + } + .spec-quick-td-value .value-item { + width: calc(50% - 12px) !important; + } +} \ No newline at end of file diff --git a/public/static/admin/default/js/goods.js b/public/static/admin/default/js/goods.js index 0f76eaa17..946b867c2 100755 --- a/public/static/admin/default/js/goods.js +++ b/public/static/admin/default/js/goods.js @@ -8,7 +8,29 @@ $(function() { $('.goods-nav li a').removeClass('goods-nav-active'); $(this).addClass('goods-nav-active'); - }) + }); + + // 商品导航收缩 + $('.goods-nav li.nav-shrink-submit').on('click', function() + { + if($(this).find('i').hasClass('am-icon-angle-double-right')) + { + $(this).find('i').removeClass('am-icon-angle-double-right'); + $(this).find('i').addClass('am-icon-angle-double-left'); + $(this).parents('.goods-nav').addClass('goods-nav-retract'); + $('.goods-nav-retract').animate({right:'-110px'}, 500, function() + { + $('.goods-nav-retract li.nav-shrink-submit').animate({width: '50px', left:'-51px'}); + }); + + } else { + $(this).find('i').removeClass('am-icon-angle-double-left'); + $(this).find('i').addClass('am-icon-angle-double-right'); + $(this).parents('.goods-nav').removeClass('goods-nav-retract'); + $('.goods-nav').animate({right:'-0px'}); + $('.goods-nav li.nav-shrink-submit').animate({width: '100%', left:'0px'}); + } + }); // 规格列添加 $('.specifications-nav-title-add').on('click', function() @@ -197,4 +219,26 @@ $(function() } $extends_popup.modal(); }); + + + + // 快捷操作 + // 规格列添加 + $('.quick-spec-title-add').on('click', function() + { + var spec_max = $('#goods-nav-operations').data('spec-add-max-number') || 3; + if($('.spec-quick table tbody tr').length >= spec_max) + { + Prompt('最多添加'+spec_max+'列规格'); + return false; + } + + Prompt('hello'); + }); + + // 生成规格 + $('.quick-spec-created').on('click', function() + { + Prompt('world'); + }); }); \ No newline at end of file diff --git a/public/static/index/default/js/index.js b/public/static/index/default/js/index.js index ac2814339..5446b7eac 100755 --- a/public/static/index/default/js/index.js +++ b/public/static/index/default/js/index.js @@ -1,3 +1,13 @@ +// 楼层聚合数据高度处理 +function floor_resize_handle() +{ + $('.floor').each(function(k, v) + { + var height = $(this).find('.goods-list').height(); + $(this).find('.aggregation').css('height', ((window.innerWidth || $(window).width()) <= 640) ? 'auto' : height+'px'); + }); +} + $(function() { // 新闻轮播 @@ -19,21 +29,15 @@ $(function() }, 3000); } - // 楼层聚合数据高度处理 - function floor_resize_handle() - { - $('.floor').each(function(k, v) - { - var height = $(this).find('.goods-list').height(); - $(this).find('.aggregation').css('height', ((window.innerWidth || $(window).width()) <= 640) ? 'auto' : height+'px'); - }); - } - floor_resize_handle(); - // 浏览器窗口实时事件 $(window).resize(function() { floor_resize_handle(); }); +}); + +$(window).load(function() +{ + floor_resize_handle(); }); \ No newline at end of file