From 74e93a92c3ebd9dfb7e3a4d18092c56a0410eb77 Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Mon, 6 Aug 2018 23:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/GoodsController.class.php | 37 +++++++++++++++++-- .../Application/Admin/Lang/zh-cn/goods.php | 6 +-- .../Admin/Lang/zh-cn/goodscategory.php | 2 + .../Admin/View/Default/Answer/Index.html | 2 +- .../Admin/View/Default/Article/Index.html | 2 +- .../Admin/View/Default/Coupon/Index.html | 2 +- .../Admin/View/Default/Goods/Index.html | 12 ++++-- .../View/Default/GoodsCategory/Index.html | 7 ++++ .../Admin/View/Default/Slide/Index.html | 2 +- .../Temp/8cde93cbd070139d84f31d26f8ea8f4d.php | 2 +- .../Temp/a58f8070835be94249ea77f3601c6647.php | 2 +- .../Admin/Default/Css/GoodsCategory.css | 11 ++++++ service/Public/Common/Css/Common.css | 8 ++++ service/Public/Common/Js/Common.js | 29 +++++++++++---- 14 files changed, 100 insertions(+), 24 deletions(-) create mode 100644 service/Public/Admin/Default/Css/GoodsCategory.css diff --git a/service/Application/Admin/Controller/GoodsController.class.php b/service/Application/Admin/Controller/GoodsController.class.php index 242f9dde8..57e3815e7 100755 --- a/service/Application/Admin/Controller/GoodsController.class.php +++ b/service/Application/Admin/Controller/GoodsController.class.php @@ -64,6 +64,9 @@ class GoodsController extends CommonController // 是否上下架 $this->assign('common_goods_is_shelves_list', L('common_goods_is_shelves_list')); + // 是否首页推荐 + $this->assign('common_is_text_list', L('common_is_text_list')); + // 参数 $this->assign('param', $param); @@ -139,6 +142,10 @@ class GoodsController extends CommonController { $where['is_shelves'] = intval(I('is_shelves', 0)); } + if(I('is_home_recommended', -1) > -1) + { + $where['is_home_recommended'] = intval(I('is_home_recommended', 0)); + } // 表达式 if(!empty($_REQUEST['time_start'])) @@ -281,8 +288,8 @@ class GoodsController extends CommonController 'content_web' => $_POST['content_web'], 'images' => isset($photo['data'][0]) ? $photo['data'][0] : '', 'photo_count' => count($photo['data']), + 'is_home_recommended' => intval(I('is_home_recommended')), ]; - print_r($_POST);die; // 添加/编辑 $m = D('Goods'); @@ -574,13 +581,13 @@ class GoodsController extends CommonController } /** - * [StatusUpdate 状态更新] + * [StatusShelves 上下架状态更新] * @author Devil * @blog http://gong.gg/ * @version 0.0.1 * @datetime 2017-01-12T22:23:06+0800 */ - public function StatusUpdate() + public function StatusShelves() { // 参数 if(empty($_POST['id']) || !isset($_POST['state'])) @@ -596,5 +603,29 @@ class GoodsController extends CommonController $this->ajaxReturn(L('common_operation_edit_error'), -100); } } + + /** + * [StatusHomeRecommended 是否首页推荐状态更新] + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2017-01-12T22:23:06+0800 + */ + public function StatusHomeRecommended() + { + // 参数 + if(empty($_POST['id']) || !isset($_POST['state'])) + { + $this->ajaxReturn(L('common_param_error'), -1); + } + + // 数据更新 + if(M('Goods')->where(array('id'=>I('id')))->save(array('is_home_recommended'=>I('state')))) + { + $this->ajaxReturn(L('common_operation_edit_success')); + } else { + $this->ajaxReturn(L('common_operation_edit_error'), -100); + } + } } ?> \ No newline at end of file diff --git a/service/Application/Admin/Lang/zh-cn/goods.php b/service/Application/Admin/Lang/zh-cn/goods.php index b7708098e..d4b5268ee 100755 --- a/service/Application/Admin/Lang/zh-cn/goods.php +++ b/service/Application/Admin/Lang/zh-cn/goods.php @@ -47,12 +47,12 @@ return array( 'goods_buy_max_number_tips' => '单次最大数值 100000000, 小于等于0或空则不限', 'goods_buy_max_number_format' => '单次最大购买数量 1~100000000', - 'goods_is_deduction_inventory_text' => '是否扣减库存', + 'goods_is_deduction_inventory_text' => '扣减库存', 'goods_is_deduction_inventory_tips' => '扣除规则根据后台配置->扣除库存规则而定', - 'goods_is_shelves_text' => '是否上下架', + 'goods_is_shelves_text' => '上下架', 'goods_is_shelves_tips' => '下架后用户不可见', - 'goods_is_home_recommended_text' => '是否首页推荐', + 'goods_is_home_recommended_text' => '首页推荐', 'goods_is_home_recommended_tips' => '推荐后在首页展示', 'goods_images_text' => '相册', diff --git a/service/Application/Admin/Lang/zh-cn/goodscategory.php b/service/Application/Admin/Lang/zh-cn/goodscategory.php index 66537875f..5fe528d64 100755 --- a/service/Application/Admin/Lang/zh-cn/goodscategory.php +++ b/service/Application/Admin/Lang/zh-cn/goodscategory.php @@ -11,5 +11,7 @@ return array( // 添加/编辑 'goods_category_add_name' => '分类添加', 'goods_category_edit_name' => '分类编辑', + + 'goods_category_bg_color' => '背景色', ); ?> \ No newline at end of file diff --git a/service/Application/Admin/View/Default/Answer/Index.html b/service/Application/Admin/View/Default/Answer/Index.html index a6e00e4d7..effa6b7d2 100755 --- a/service/Application/Admin/View/Default/Answer/Index.html +++ b/service/Application/Admin/View/Default/Answer/Index.html @@ -69,7 +69,7 @@ {{$v.content}} - am-successam-default" data-url="{{:U('Admin/Answer/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_show']}}"> + am-successam-default" data-url="{{:U('Admin/Answer/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_show']}}" data-is-update-status="1"> {{$v.reply}} {{$v.add_time}} diff --git a/service/Application/Admin/View/Default/Article/Index.html b/service/Application/Admin/View/Default/Article/Index.html index 7ac01fa32..700d48aee 100755 --- a/service/Application/Admin/View/Default/Article/Index.html +++ b/service/Application/Admin/View/Default/Article/Index.html @@ -66,7 +66,7 @@ {{$v.article_category_name}} {{$v.access_count}} - am-successam-default" data-url="{{:U('Admin/Article/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}"> + am-successam-default" data-url="{{:U('Admin/Article/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1"> {{$v.add_time}} diff --git a/service/Application/Admin/View/Default/Coupon/Index.html b/service/Application/Admin/View/Default/Coupon/Index.html index 65f743062..ff856f35b 100755 --- a/service/Application/Admin/View/Default/Coupon/Index.html +++ b/service/Application/Admin/View/Default/Coupon/Index.html @@ -83,7 +83,7 @@ - am-successam-default" data-url="{{:U('Admin/Coupon/StateUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}"> + am-successam-default" data-url="{{:U('Admin/Coupon/StateUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1"> {{:L('common_see_more_name')}} diff --git a/service/Application/Admin/View/Default/Goods/Index.html b/service/Application/Admin/View/Default/Goods/Index.html index 002c75a60..2eb73c387 100755 --- a/service/Application/Admin/View/Default/Goods/Index.html +++ b/service/Application/Admin/View/Default/Goods/Index.html @@ -21,6 +21,12 @@ +
value="{{$param.time_start}}"/> ~ @@ -47,7 +53,6 @@ {{:L('goods_is_home_recommended_text')}} {{:L('goods_inventory_text')}} {{:L('goods_model_text')}} - {{:L('common_create_time_name')}} {{:L('common_more_name')}} {{:L('common_operation_name')}} @@ -69,14 +74,13 @@ - am-successam-default" data-url="{{:U('Admin/Goods/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_shelves']}}"> + am-successam-default" data-url="{{:U('Admin/Goods/StatusShelves')}}" data-id="{{$v.id}}" data-state="{{$v['is_shelves']}}" data-is-update-status="1"> - am-successam-default" data-url="{{:U('Admin/Goods/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_home_recommended']}}"> + am-successam-default" data-url="{{:U('Admin/Goods/StatusHomeRecommended')}}" data-id="{{$v.id}}" data-state="{{$v['is_home_recommended']}}" data-is-update-status="0"> {{$v.inventory}} {{$v.inventory_unit}} {{$v.model}} - {{$v.add_time}} {{:L('common_see_more_name')}}
diff --git a/service/Application/Admin/View/Default/GoodsCategory/Index.html b/service/Application/Admin/View/Default/GoodsCategory/Index.html index 3f63d9c3d..102d46fa5 100755 --- a/service/Application/Admin/View/Default/GoodsCategory/Index.html +++ b/service/Application/Admin/View/Default/GoodsCategory/Index.html @@ -29,6 +29,13 @@
{{$image_host}}{{$data.images_url}}{{$image_host}}/Public/Admin/Default/Images/default-images.png" id="form-img-images_url" class="block m-t-5 am-img-thumbnail am-radius" width="50" height="50" data-default="{{$image_host}}{{$data.images_url}}{{$image_host}}/Public/Admin/Default/Images/default-images.png" />
+
+ + + +
diff --git a/service/Application/Admin/View/Default/Slide/Index.html b/service/Application/Admin/View/Default/Slide/Index.html index 1e87b6268..42f1d12c7 100755 --- a/service/Application/Admin/View/Default/Slide/Index.html +++ b/service/Application/Admin/View/Default/Slide/Index.html @@ -84,7 +84,7 @@ - am-successam-default" data-url="{{:U('Admin/Slide/StateUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}"> + am-successam-default" data-url="{{:U('Admin/Slide/StateUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1"> {{$v.add_time_text}} diff --git a/service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php b/service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php index 6d384ac0f..c6c25969e 100644 --- a/service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php +++ b/service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php b/service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php index 9632858dc..25a366a5a 100644 --- a/service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php +++ b/service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/service/Public/Admin/Default/Css/GoodsCategory.css b/service/Public/Admin/Default/Css/GoodsCategory.css new file mode 100644 index 000000000..1b06f0054 --- /dev/null +++ b/service/Public/Admin/Default/Css/GoodsCategory.css @@ -0,0 +1,11 @@ +.colorpicker-submit:hover, .colorpicker-submit:active, .colorpicker-submit:focus { + background-color: #fff; +} +.colorpicker-submit:active { + background-image: none; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.15); + box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.15); +} +.colorpicker-submit img { + margin-right: 10px; +} \ No newline at end of file diff --git a/service/Public/Common/Css/Common.css b/service/Public/Common/Css/Common.css index 4fa8a621e..acc623b2e 100755 --- a/service/Public/Common/Css/Common.css +++ b/service/Public/Common/Css/Common.css @@ -38,6 +38,7 @@ legend {padding-bottom:0.2rem !important; margin-bottom: 1rem; } select {height:32px !important;} .bk-cr-gray {background:#f3f3f3 !important;} .bk-cr-ffd {background:#ffd !important;} +.bk-cr-white {background-color: #fff;} .t-c {text-align:center;} .t-l {text-align:left;} .t-r {text-align:right;} @@ -163,4 +164,11 @@ input:hover, select:hover, textarea:hover, .chosen-choices:hover, .chosen-single background-color: #ffeee1; border-color: #f9e4d3; color: #f37b1d; +} + +/** + * 颜色选择插件 + */ +#colorpanel { + z-index: 10000; } \ No newline at end of file diff --git a/service/Public/Common/Js/Common.js b/service/Public/Common/Js/Common.js index 9c420462b..8ca694c38 100755 --- a/service/Public/Common/Js/Common.js +++ b/service/Public/Common/Js/Common.js @@ -103,11 +103,17 @@ function GetFormVal(element) // input 复选框checkboox tmp_all = []; + temp_field = ''; i = 0; $(element).find('input[type="checkbox"]').each(function(key, tmp) { if(tmp.name != undefined && tmp.name != '') { + // name不一样的时候初始化索引值 + if(temp_field != tmp.name) + { + i = 0; + } if($(this).is(':checked')) { if(tmp_all[tmp.name] == undefined) tmp_all[tmp.name] = []; @@ -643,6 +649,7 @@ $(function() var id = $tag.data('id'); var state = ($tag.data('state') == 1) ? 0 : 1; var url = $tag.data('url'); + var is_update_status = $tag.data('is-update-status') || 0; if(id == undefined || url == undefined) { Prompt('参数配置有误'); @@ -667,16 +674,22 @@ $(function() { $tag.removeClass('am-success'); $tag.addClass('am-default'); - if($('#data-list-'+id).length > 0) + if(is_update_status == 1) { - $('#data-list-'+id).addClass('am-active'); + if($('#data-list-'+id).length > 0) + { + $('#data-list-'+id).addClass('am-active'); + } } } else { $tag.removeClass('am-default'); $tag.addClass('am-success'); - if($('#data-list-'+id).length > 0) + if(is_update_status == 1) { - $('#data-list-'+id).removeClass('am-active'); + if($('#data-list-'+id).length > 0) + { + $('#data-list-'+id).removeClass('am-active'); + } } } $tag.data('state', state); @@ -972,8 +985,6 @@ $(function() } address += $('#form-address').val(); - console.log(address); - var map = new BMap.Map("map", {enableMapClick:false}); var point = new BMap.Point(116.331398,39.897445); map.centerAndZoom(point,12); @@ -1056,12 +1067,14 @@ $(function() fillcolor:true, success:function(o, color) { - $($('.colorpicker-submit').data('input-tag')).css('color', color); + var style = $('.colorpicker-submit').data('color-style') || 'color'; + $($('.colorpicker-submit').data('input-tag')).css(style, color); $($('.colorpicker-submit').data('color-tag')).val(color); }, reset:function(o) { - $($('.colorpicker-submit').data('input-tag')).css('color', ''); + var style = $('.colorpicker-submit').data('color-style') || 'color'; + $($('.colorpicker-submit').data('input-tag')).css(style, ''); $($('.colorpicker-submit').data('color-tag')).val(''); } });