diff --git a/application/plugins/freightfee/Admin.php b/application/plugins/freightfee/Admin.php index 20f4237f536c012e05f1e8f892c689224e4859f5..f86af745f1a39efeb3a4ae198f0120f934dd1164 100644 --- a/application/plugins/freightfee/Admin.php +++ b/application/plugins/freightfee/Admin.php @@ -10,6 +10,7 @@ // +---------------------------------------------------------------------- namespace app\plugins\freightfee; +use think\Db; use think\Controller; use app\service\PluginsService; use app\service\RegionService; @@ -36,6 +37,15 @@ class Admin extends Controller $ret = PluginsService::PluginsData('freightfee'); if($ret['code'] == 0) { + // 数据处理 + if(!empty($ret['data']['data'])) + { + foreach($ret['data']['data'] as &$v) + { + $v['region_names'] = empty($v['region_show']) ? '' : implode('、', Db::name('Region')->where('id', 'in', explode('-', $v['region_show']))->column('name')); + } + } + $this->assign('data', $ret['data']); return $this->fetch('../../../plugins/view/freightfee/admin/index'); } else { @@ -73,7 +83,14 @@ class Admin extends Controller }, $region); } - //print_r($ret['data']); + // 数据处理 + if(!empty($ret['data']['data'])) + { + foreach($ret['data']['data'] as &$v) + { + $v['region_names'] = empty($v['region_show']) ? '' : implode('、', Db::name('Region')->where('id', 'in', explode('-', $v['region_show']))->column('name')); + } + } $this->assign('region_list', $region); $this->assign('is_whether_list', $is_whether_list); diff --git a/application/plugins/view/freightfee/admin/index.html b/application/plugins/view/freightfee/admin/index.html index 28f92ed03e531514ccdcad74ac647a0d8b987320..78672b21960ab0a55094f22e166d4d06773979cc 100644 --- a/application/plugins/view/freightfee/admin/index.html +++ b/application/plugins/view/freightfee/admin/index.html @@ -10,61 +10,63 @@
- +
- {{if !empty($data['application_name'])}} - {{$data.application_name}} + {{if isset($data['valuation']) and $data['valuation'] eq 0}} + 按件数 {{else /}} - 无 - {{/if}} -
-
-
- -
- {{if !empty($data['login_name'])}} - {{$data.login_name}} - {{else /}} - 游客登录 - {{/if}} -
-
-
- -
- {{if !empty($data['nickname'])}} - {{$data.nickname}} - {{else /}} - 游客 - {{/if}} -
-
-
- -
- {{if !empty($data['query_tips'])}} - {{$data.query_tips}} - {{else /}} - 无 + 按重量 {{/if}}
- -
- {{if isset($data['is_default_tourist']) and $data['is_default_tourist'] eq 1}} - 是 - {{else /}} - 否 - {{/if}} -
-
- -
- -
- {{:PluginsHomeUrl('freightfee', 'index', 'index')}} + +
+ + {{if empty($data['data'])}} + 没有配置 + {{else /}} + {{if isset($data['valuation']) and $data['valuation'] eq 0}} + + + + + + + + + + {{else /}} + + + + + + + + + + {{/if}} + + {{foreach $data.data as $k=>$v}} + + + + + + + + {{/foreach}} + + {{/if}} +
运送到首件数(件)首费(元)续件数(件)续费(元)
运送到首件数(kg)首费(元)续件数(kg)续费(元)
+ {{if $v['region'] eq 'default'}} + 默认运费 + {{else /}} +
{{$v.region_names}}
+ {{/if}} +
{{$v.first}}{{$v.first_price}}{{$v.continue}}{{$v.continue_price}}
diff --git a/application/plugins/view/freightfee/admin/saveinfo.html b/application/plugins/view/freightfee/admin/saveinfo.html index cb08360670d2189a8cd6a6ae1a6faa7486e8a06a..360ff057d6c0482575194f043656a11e2766d3c3 100644 --- a/application/plugins/view/freightfee/admin/saveinfo.html +++ b/application/plugins/view/freightfee/admin/saveinfo.html @@ -23,37 +23,138 @@
- - - - - - - - - - - - - - - - - - - - + {{if empty($data['data'])}} + + + + + + + + + + + + + + + + + + + + + {{else /}} + {{if isset($data['valuation']) and $data['valuation'] eq 0}} + + + + + + + + + + + + {{foreach $data.data as $k=>$v}} + + + + + + + {{if $v['region'] eq 'default'}} + + {{else /}} + + {{/if}} + + {{/foreach}} + + {{else /}} + + + + + + + + + + + + {{foreach $data.data as $k=>$v}} + + + + + + + {{if $v['region'] eq 'default'}} + + {{else /}} + + {{/if}} + + {{/foreach}} + + {{/if}} + {{/if}}
运送到首件数(件)首费(元)续件数(件)续费(元)操作
-
默认运费 - -
- - - - - - - -
运送到首件数(件)首费(元)续件数(件)续费(元)操作
+
默认运费 + + +
+ + + + + + + +
运送到首件数(件)首费(元)续件数(件)续费(元)操作
+ {{if $v['region'] eq 'default'}} +
默认运费 + + + {{else /}} +
{{$v.region_names}}
+ 添加地区 + + + {{/if}} +
+ + + + + + + + + 删除 +
运送到首件数(kg)首费(元)续件数(kg)续费(元)操作
+ {{if $v['region'] eq 'default'}} +
默认运费 + + + {{else /}} +
{{$v.region_names}}
+ 添加地区 + + + {{/if}} +
+ + + + + + + + + 删除 +
+为指定地区城市设置运费
diff --git a/public/static/plugins/css/freightfee/admin.css b/public/static/plugins/css/freightfee/admin.css index 8562ba949146d54ce5978c323345008d40613a3f..e185ea51063f8ecbfcbbdbe93e5d2008fe92297b 100755 --- a/public/static/plugins/css/freightfee/admin.css +++ b/public/static/plugins/css/freightfee/admin.css @@ -11,7 +11,7 @@ } /** - * 编辑页面 + * 运费模板 */ .freightfee-rules table.am-table { margin-bottom: 10px; diff --git a/public/static/plugins/js/freightfee/admin.js b/public/static/plugins/js/freightfee/admin.js index 06682fd9d5166dd90d707ac50c0590727318610b..7ee36f2b9e8e29b45a8991f853ca1bdab86ac65a 100644 --- a/public/static/plugins/js/freightfee/admin.js +++ b/public/static/plugins/js/freightfee/admin.js @@ -38,18 +38,20 @@ $(function() case 0 : html += ''; html += '
默认运费'; - html += ''; + html += ''; + html += ''; + html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; html += ''; @@ -59,18 +61,20 @@ $(function() case 1 : html += ''; html += '
默认运费'; - html += ''; + html += ''; + html += ''; + html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; html += ''; @@ -121,11 +125,12 @@ $(function() $('.freightfee-rules table.am-table').find('tbody tr:last').removeClass().addClass('data-list-'+index); // name名称设置 - $('.freightfee-rules table.am-table').find('tbody tr:last .region-name').attr('name', 'region_name['+index+'][\'region\']'); - $('.freightfee-rules table.am-table').find('tbody tr:last .first-name').attr('name', 'first_name['+index+'][\'first\']'); - $('.freightfee-rules table.am-table').find('tbody tr:last .first-price-name').attr('name', 'first_price_name['+index+'][\'first_price\']'); - $('.freightfee-rules table.am-table').find('tbody tr:last .continue-name').attr('name', 'continue_name['+index+'][\'continue\']'); - $('.freightfee-rules table.am-table').find('tbody tr:last .continue-price-name').attr('name', 'continue_price_name['+index+'][\'continue_price\']'); + $('.freightfee-rules table.am-table').find('tbody tr:last .region-name').attr('name', 'data['+index+'][region]'); + $('.freightfee-rules table.am-table').find('tbody tr:last .region-name-show').attr('name', 'data['+index+'][region_show]'); + $('.freightfee-rules table.am-table').find('tbody tr:last .first-name').attr('name', 'data['+index+'][first]'); + $('.freightfee-rules table.am-table').find('tbody tr:last .first-price-name').attr('name', 'data['+index+'][first_price]'); + $('.freightfee-rules table.am-table').find('tbody tr:last .continue-name').attr('name', 'data['+index+'][continue]'); + $('.freightfee-rules table.am-table').find('tbody tr:last .continue-price-name').attr('name', 'data['+index+'][continue_price]'); }); // 行移除 @@ -141,7 +146,7 @@ $(function() $('#freightfee-region-popup').modal(); $('#freightfee-region-popup').attr('data-index', index); - // 清楚选中 + // 清除选中 $('#freightfee-region-popup').find('.province-name').removeClass('selected').removeClass('selected-may'); $('#freightfee-region-popup').find('.city-name').parent('li').removeClass('selected'); @@ -216,6 +221,7 @@ $(function() { var name_all = []; var ids_all = []; + var show_ids_all = []; var city_index = 0; var province_index = 0; var province_id = 0; @@ -229,12 +235,14 @@ $(function() { province_id = temp_province_id; name_all[province_index] = $(this).parent('.city-list').prev('.province-name').text(); + show_ids_all[province_index] = temp_province_id; province_index++; } } else { if($(this).hasClass('selected')) { name_all[province_index] = $(this).find('.city-name').text(); + show_ids_all[province_index] = $(this).find('.city-name').data('city-id'); province_index++; } } @@ -253,7 +261,8 @@ $(function() $content.addClass('none'); } - $('.data-list-'+$('#freightfee-region-popup').attr('data-index')+' td.first input').val(ids_all.join('-')); + $('.data-list-'+$('#freightfee-region-popup').attr('data-index')+' td.first input.region-name').val(ids_all.join('-')); + $('.data-list-'+$('#freightfee-region-popup').attr('data-index')+' td.first input.region-name-show').val(show_ids_all.join('-')); $('#freightfee-region-popup').modal('close'); });