From 180861136f8c4074ba4ab521ff37a443589d856b Mon Sep 17 00:00:00 2001 From: xxb Date: Mon, 9 Aug 2021 15:12:49 +0800 Subject: [PATCH] liche update for admin auto cars edit do --- admin/controllers/auto/Cars.php | 9 ++----- admin/views/auto/cars/get.php | 38 +++++++++-------------------- admin/views/auto/cars/lists.php | 2 +- www/admin/static/js/common/admin.js | 14 ++++++++--- 4 files changed, 25 insertions(+), 38 deletions(-) diff --git a/admin/controllers/auto/Cars.php b/admin/controllers/auto/Cars.php index 88c2b13b..9c4366a6 100644 --- a/admin/controllers/auto/Cars.php +++ b/admin/controllers/auto/Cars.php @@ -131,14 +131,10 @@ class Cars extends HD_Controller{ $attr_ids = explode('_', $row['attrs']); $str_ids = implode(',', $attr_ids); $where_attr = array("id in ({$str_ids})" => null); - $map_attr = $this->auto_attr_model->map('id', 'title', $where_attr, 'id desc', 0 , 0, 'id, title'); + $map_attr = $this->auto_attr_model->map('type', 'title', $where_attr, 'id desc', 0 , 0, 'type, title'); //属性分类 $attr_types = $this->auto_attr_model->get_type(); - $attr = ""; - foreach($attr_ids as $k => $attr_id){ - $attr .= $map_attr[$attr_id]. "({$attr_types[$k]})-"; - } - $attr = trim($attr, '-'); + $attr = "{$map_attr[1]}-{$map_attr[0]}-{$map_attr[2]}(内饰)"; //车系 $row_sery = $this->auto_series_model->get(array('id' => $row['s_id'])); @@ -259,7 +255,6 @@ class Cars extends HD_Controller{ 'price_coplus' => floatval($info['price_coplus']), 'brokerage_1' => floatval($info['brokerage_1']), 'brokerage_2' => floatval($info['brokerage_2']), - 'status' => $info['status'], ); $where = array('id' => $info['id']); diff --git a/admin/views/auto/cars/get.php b/admin/views/auto/cars/get.php index 953d0c07..4ba026ea 100644 --- a/admin/views/auto/cars/get.php +++ b/admin/views/auto/cars/get.php @@ -1,80 +1,64 @@ -
+
- -
{{info.brand_name}}
+ +
{{info.brand_name}} {{info.sery_name}} {{info.attr}}
-
- -
{{info.sery_name}}
-
-
- -
{{info.attr}}
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
- -
- -
-
diff --git a/admin/views/auto/cars/lists.php b/admin/views/auto/cars/lists.php index c8c2f3c5..17cd0ad3 100644 --- a/admin/views/auto/cars/lists.php +++ b/admin/views/auto/cars/lists.php @@ -63,7 +63,7 @@ {{v.attr_title}} {{v.status_name}} - 编辑 关闭 diff --git a/www/admin/static/js/common/admin.js b/www/admin/static/js/common/admin.js index e5171d29..04969f88 100644 --- a/www/admin/static/js/common/admin.js +++ b/www/admin/static/js/common/admin.js @@ -204,13 +204,14 @@ $(function () { return layer.open({title: title || '窗口', type: 2, area: ['800px', '530px'], fix: true, maxmin: false, content: url}); }; // 加载HTML到弹出层 - this.modal = function (url, data, title, callback, loading, tips) { + this.modal = function (url, data, title, callback, loading, tips, area) { this.load(url, data, 'GET', function (res) { if (typeof (res) === 'object') { return $.msg.auto(res); } + area = area || '800px'; var layerIndex = layer.open({ - type: 1, btn: false,shadeClose: true, area: "800px", content: res, title: title || '', success: function (dom, index) { + type: 1, btn: false,shadeClose: true, area: area, content: res, title: title || '', success: function (dom, index) { $(dom).find('[data-close]').off('click').on('click', function () { if ($(this).attr('data-confirm')) { var confirmIndex = $.msg.confirm($(this).attr('data-confirm'), function () { @@ -643,7 +644,14 @@ $(function () { /*! 注册 data-modal 事件行为 */ $body.on('click', '[data-modal]', function () { - return $.form.modal($(this).attr('data-modal'), 'open_type=modal', $(this).attr('data-title') || '编辑'); + var width = $(this).attr('data-width') || '800px'; + var height = $(this).attr('data-height'); + if(undefined != width && undefined != height){ + var area = [width, height]; + } else if (undefined == width){ + area = width; + } + return $.form.modal($(this).attr('data-modal'), 'open_type=modal', $(this).attr('data-title') || '编辑', null, null ,null, area); }); /*! 注册 data-open 事件行为 */