From f1f2a7d1bfdfb645e57f85fc983ecef52a39df47 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Mon, 21 Aug 2023 18:05:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E7=89=A9=E6=B5=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E5=86=85=E5=AE=B9=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Resources/LogisticsResource.php | 10 +- .../views/pages/logistics/index.blade.php | 94 ++++++++++++--- resources/lang/en/admin/logistics.php | 1 + resources/lang/zh_cn/admin/logistics.php | 112 +++++++++--------- 4 files changed, 141 insertions(+), 76 deletions(-) diff --git a/beike/Admin/Http/Resources/LogisticsResource.php b/beike/Admin/Http/Resources/LogisticsResource.php index f77d9ba8..081a299d 100644 --- a/beike/Admin/Http/Resources/LogisticsResource.php +++ b/beike/Admin/Http/Resources/LogisticsResource.php @@ -2,6 +2,7 @@ namespace Beike\Admin\Http\Resources; +use Beike\Repositories\CountryRepo; use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; @@ -14,15 +15,16 @@ class LogisticsResource extends JsonResource * @return array * @throws \Exception */ - public function toArray($request): array - { - + public function toArray($request): array{ + $countryIds = (array)explode(',',$this->country_ids); + $countryList = CountryRepo::getInList($countryIds); + $countryNames = implode(',',array_column($countryList,'name')); $data = [ 'id' => $this->id, 'name' => $this->name ?? '', 'warehouse_name' => $this->warehouse_name ?? '', 'country_id' => $this->country_id, - 'country' => $this->country ? $this->country->name : '', + 'country' => $countryNames,//$this->country ? $this->country->name : '', 'type' => $this->type, 'first_weight' => $this->first_weight, diff --git a/resources/beike/admin/views/pages/logistics/index.blade.php b/resources/beike/admin/views/pages/logistics/index.blade.php index 16b8e6a2..44957eca 100644 --- a/resources/beike/admin/views/pages/logistics/index.blade.php +++ b/resources/beike/admin/views/pages/logistics/index.blade.php @@ -3,6 +3,45 @@ @section('title', __('admin/common.logistics')) @section('content') + @if ($errors->has('error')) @endif @@ -36,13 +75,9 @@ {{ __('common.id') }} {{ __('admin/logistics.logistics_name') }} {{ __('admin/logistics.warehouse_name') }} - {{ __('admin/country.index') }} + {{ __('admin/country.index') }} {{ __('admin/logistics.type') }} - {{ __('admin/logistics.first_weight') }} - {{ __('admin/logistics.first_weight_fee') }} - {{ __('admin/logistics.add_weight') }} - {{ __('admin/logistics.continuation_weight_fee') }} - {{ __('admin/logistics.throwing_ratio') }} + {{ __('admin/logistics.freight_calculation_method') }} {{ __('admin/logistics.day') }} {{ __('common.sort_order') }} {{ __('common.created_at') }} @@ -58,15 +93,46 @@ {{ $logistic['id'] }} {{ $logistic['name'] }} {{ $logistic['warehouse_name'] }} - {{ $logistic['country'] }} + {{ $logistic['country'] }} {{ __('admin/logistics.type_' . $logistic['type']) }} - {{ $logistic['first_weight'] }} - {{ $logistic['first_weight_fee'] }} -{{-- {{ $logistic['continuation_weight_max'] }}--}} - {{ $logistic['add_weight'] }} - {{ $logistic['continuation_weight_fee'] }} -{{-- {{ $logistic['num_fee'] }}--}} - {{ $logistic['throwing_ratio'] }} + +
+
+
{{ __('admin/logistics.first_weight') }}
+
{{ $logistic['first_weight'] }}KG
+
+
+
{{ __('admin/logistics.first_weight_fee') }}
+
{{ $logistic['first_weight_fee'] }}USD
+
+
+
+
+
{{ __('admin/logistics.add_weight') }}
+
{{ $logistic['add_weight'] }}KG
+
+
+
{{ __('admin/logistics.continuation_weight_fee') }}
+
{{ $logistic['continuation_weight_fee'] }}USD
+
+
+ + + + + + {{----}} + {{--{{ $logistic['first_weight_fee'] }}--}} + {{-- {{ $logistic['continuation_weight_max'] }}--}} + {{--{{ $logistic['add_weight'] }}--}} + {{--{{ $logistic['continuation_weight_fee'] }}--}} + {{-- {{ $logistic['num_fee'] }}--}} + {{--{{ $logistic['throwing_ratio'] }}--}} + + {{ $logistic['day_min'] }} - {{ $logistic['day_max'] }} {{ __('admin/logistics.work_day') }} {{ $logistic['position'] }} {{ $logistic['created_at'] }} diff --git a/resources/lang/en/admin/logistics.php b/resources/lang/en/admin/logistics.php index e716fb60..c90e8fe7 100644 --- a/resources/lang/en/admin/logistics.php +++ b/resources/lang/en/admin/logistics.php @@ -76,4 +76,5 @@ return [ 'first_num_fee'=>'First num fee', 'add_num'=>'Add num', 'continuation_num_fee'=>'Continuation num fee', + 'freight_calculation_method'=>'Freight calculation method', ]; diff --git a/resources/lang/zh_cn/admin/logistics.php b/resources/lang/zh_cn/admin/logistics.php index b81aa575..d2464b26 100644 --- a/resources/lang/zh_cn/admin/logistics.php +++ b/resources/lang/zh_cn/admin/logistics.php @@ -1,14 +1,12 @@ * @created 2022-08-02 14:22:41 * @modified 2022-08-02 14:22:41 */ - return [ 'logistics_index' => '物流列表', 'logistics_name' => '物流名称', @@ -19,65 +17,63 @@ return [ 'logistics_delete' => '删除物流', 'logistics_trashed' => '回收站', 'logistics_restore' => '恢复回收站', - 'clear_restore' => '清空回收站', + 'clear_restore' => '清空回收站', 'logistics_filter_index' => '查看高级筛选', 'logistics_filter_update' => '修改高级筛选', - - 'batch_delete' => '批量删除', - 'batch_active' => '批量上架', - 'batch_inactive' => '批量下架', - - 'basic_information' => '基础信息', - 'product_details' => '物流详情', - 'product_relations' => '相关物流', - 'stocks' => '物流库存', - 'model' => '型号', - 'price' => '价格', - 'origin_price' => '原价', - 'cost_price' => '成本价', - 'quantity' => '数量', - 'enable_multi_spec' => '启用多规格', - 'image_help' => '第一张图片将作为物流主图,支持同时上传多张图片,多张图片之间可随意调整位置', - 'video_help' => '如果提示超出系统大小限制,请修改 php.ini 参数 post_max_size', - 'add_variable' => '添加规格', - 'add_variable_value' => '添加规格值', - 'add_variable_image' => '添加规格图片', - 'default_main_product' => '默认主物流', - 'modify_order' => '双击修改、拖动调整顺序', - 'weight_text' => '重量', - 'length_width_height' => '长宽高', - 'length' => '长', - 'width' => '宽', - 'height' => '高', - 'weight_class' => '重量单位', - - 'confirm_batch_product' => '确认要批量删除选中的物流吗?', - 'confirm_batch_status' => '确认要批量修改选中的物流的状态吗?', - 'confirm_batch_restore' => '确认要恢复选中的物流吗?', - 'confirm_delete_restore' => '确认要清空回收站吗?', - 'price_setting' => '价格设置', - 'price_setting_by' =>[ + 'batch_delete' => '批量删除', + 'batch_active' => '批量上架', + 'batch_inactive' => '批量下架', + 'basic_information' => '基础信息', + 'product_details' => '物流详情', + 'product_relations' => '相关物流', + 'stocks' => '物流库存', + 'model' => '型号', + 'price' => '价格', + 'origin_price' => '原价', + 'cost_price' => '成本价', + 'quantity' => '数量', + 'enable_multi_spec' => '启用多规格', + 'image_help' => '第一张图片将作为物流主图,支持同时上传多张图片,多张图片之间可随意调整位置', + 'video_help' => '如果提示超出系统大小限制,请修改 php.ini 参数 post_max_size', + 'add_variable' => '添加规格', + 'add_variable_value' => '添加规格值', + 'add_variable_image' => '添加规格图片', + 'default_main_product' => '默认主物流', + 'modify_order' => '双击修改、拖动调整顺序', + 'weight_text' => '重量', + 'length_width_height' => '长宽高', + 'length' => '长', + 'width' => '宽', + 'height' => '高', + 'weight_class' => '重量单位', + 'confirm_batch_product' => '确认要批量删除选中的物流吗?', + 'confirm_batch_status' => '确认要批量修改选中的物流的状态吗?', + 'confirm_batch_restore' => '确认要恢复选中的物流吗?', + 'confirm_delete_restore' => '确认要清空回收站吗?', + 'price_setting' => '价格设置', + 'price_setting_by' => [ 'sku' => '根据规格设置价格', 'num' => '根据数量设置价格', ], - 'warehouse_name' => '仓库名称', - 'type'=>'类型', - 'first_weight'=>'首重', - 'first_weight_fee'=>'首重运费', - 'continuation_weight_max'=>'续重范围', - 'add_weight'=>'每增加重量', - 'continuation_weight_fee'=>'续重运费', - 'num_fee'=>'一件价格', - 'throwing_ratio'=>'计抛比', - 'day_min'=>'最短时间', - 'day_max'=>'最长时间', - 'day'=>'时效', - 'work_day'=>'工作天', - 'type_weight'=>'按重量计费', - 'type_num'=>'按数量计费', - 'type_free'=>'商家包邮', - 'first_num'=>'首件数量', - 'first_num_fee'=>'首件运费', - 'add_num'=>'每增加件', - 'continuation_num_fee'=>'续件运费', + 'warehouse_name' => '仓库名称', + 'type' => '类型', + 'first_weight' => '首重', + 'first_weight_fee' => '首重运费', + 'continuation_weight_max' => '续重范围', + 'add_weight' => '每增加重量', + 'continuation_weight_fee' => '续重运费', + 'num_fee' => '一件价格', + 'throwing_ratio' => '计抛比', + 'day_min' => '最短时间', + 'day_max' => '最长时间', + 'day' => '时效', + 'work_day' => '工作天', + 'type_weight' => '按重量计费', + 'type_num' => '按数量计费', + 'type_free' => '商家包邮', + 'first_num' => '首件数量', + 'first_num_fee' => '首件运费', + 'add_num' => '每增加件', + 'continuation_num_fee' => '续件运费', + 'freight_calculation_method' => '运费计算方式', ];