From ece92c66b0ae9bb2f23a6f6fe04f59aaa662005c Mon Sep 17 00:00:00 2001 From: devil_gong Date: Mon, 27 May 2019 18:40:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=94=AE=E5=90=8E=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Common.php | 3 +- application/admin/controller/Customview.php | 2 +- application/admin/controller/Error.php | 3 +- application/admin/controller/Order.php | 2 +- .../admin/controller/Orderaftersale.php | 160 +++++++ .../admin/view/default/order/index.html | 2 +- .../view/default/orderaftersale/index.html | 394 ++++++++++++++++++ .../index/controller/Orderaftersale.php | 25 +- application/index/controller/Safety.php | 9 +- .../index/view/default/order/index.html | 22 +- .../view/default/orderaftersale/index.html | 7 +- .../index/view/default/public/header_nav.html | 2 +- application/service/OrderAftersaleService.php | 79 +++- config/shopxo.sql | 26 +- public/static/admin/default/css/common.css | 22 +- .../admin/default/css/orderaftersale.css | 49 +++ .../static/admin/default/js/orderaftersale.js | 42 ++ .../default/css/orderaftersale.index.css | 20 +- 18 files changed, 816 insertions(+), 53 deletions(-) create mode 100644 application/admin/controller/Orderaftersale.php create mode 100644 application/admin/view/default/orderaftersale/index.html create mode 100644 public/static/admin/default/css/orderaftersale.css create mode 100644 public/static/admin/default/js/orderaftersale.js diff --git a/application/admin/controller/Common.php b/application/admin/controller/Common.php index c640e4025..38144d0db 100755 --- a/application/admin/controller/Common.php +++ b/application/admin/controller/Common.php @@ -217,7 +217,8 @@ class Common extends Controller { exit(json_encode(DataReturn($name.' 非法访问', -1000))); } else { - exit($name.' 非法访问'); + $this->assign('msg', $name.' 非法访问'); + return $this->fetch('public/tips_error'); } } } diff --git a/application/admin/controller/Customview.php b/application/admin/controller/Customview.php index 785ba0311..532783a25 100755 --- a/application/admin/controller/Customview.php +++ b/application/admin/controller/Customview.php @@ -53,7 +53,7 @@ class CustomView extends Common $params = input(); // 分页 - $number = 10; + $number = MyC('admin_page_number', 10, true); // 条件 $where = CustomViewService::CustomViewListWhere($params); diff --git a/application/admin/controller/Error.php b/application/admin/controller/Error.php index bee958983..d403463a6 100755 --- a/application/admin/controller/Error.php +++ b/application/admin/controller/Error.php @@ -37,7 +37,8 @@ class Error extends Common { exit(json_encode(DataReturn($request->controller().' 控制器不存在', -1000))); } else { - exit($request->controller().' 控制器不存在'); + $this->assign('msg', $request->controller().' 控制器不存在'); + return $this->fetch('public/tips_error'); } } } diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 78a062d71..5b7c78ee8 100755 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -57,7 +57,7 @@ class Order extends Common $params['user_type'] = 'admin'; // 分页 - $number = 10; + $number = MyC('admin_page_number', 10, true); // 条件 $where = OrderService::OrderListWhere($params); diff --git a/application/admin/controller/Orderaftersale.php b/application/admin/controller/Orderaftersale.php new file mode 100644 index 000000000..823f7b846 --- /dev/null +++ b/application/admin/controller/Orderaftersale.php @@ -0,0 +1,160 @@ +IsLogin(); + + // 权限校验 + $this->IsPower(); + } + + /** + * 订单列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-28 + * @desc description + */ + public function Index() + { + // 参数 + $params = input(); + $params['admin'] = $this->admin; + $params['user_type'] = 'admin'; + + // 分页 + $number = MyC('admin_page_number', 10, true); + + // 条件 + $where = OrderAftersaleService::OrderAftersaleListWhere($params); + + // 获取总数 + $total = OrderAftersaleService::OrderAftersaleTotal($where); + + // 分页 + $page_params = array( + 'number' => $number, + 'total' => $total, + 'where' => $params, + 'page' => isset($params['page']) ? intval($params['page']) : 1, + 'url' => MyUrl('index/orderaftersale/index'), + ); + $page = new \base\Page($page_params); + $this->assign('page_html', $page->GetPageHtml()); + + // 获取列表 + $data_params = array( + 'm' => $page->GetPageStarNumber(), + 'n' => $number, + 'where' => $where, + 'is_public' => 0, + ); + $data = OrderAftersaleService::OrderAftersaleList($data_params); + $this->assign('data_list', $data['data']); + + // 静态数据 + $this->assign('common_order_aftersale_type_list', lang('common_order_aftersale_type_list')); + $this->assign('common_order_aftersale_status_list', lang('common_order_aftersale_status_list')); + $this->assign('common_order_aftersale_refundment_list', lang('common_order_aftersale_refundment_list')); + + // 参数 + $this->assign('params', $params); + return $this->fetch(); + } + + /** + * 确认 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-05-23 + * @desc description + */ + public function Confirm() + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + $params = input(); + return OrderAftersaleService::AftersaleConfirm($params); + } + + /** + * 审核 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-05-23 + * @desc description + */ + public function Audit() + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + $params = input(); + return OrderAftersaleService::AftersaleAudit($params); + } + + /** + * 订单取消 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-30 + * @desc description + */ + public function Cancel() + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + $params = input(); + return OrderAftersaleService::AftersaleCancel($params); + } +} +?> \ No newline at end of file diff --git a/application/admin/view/default/order/index.html b/application/admin/view/default/order/index.html index 489ac9126..350d74f05 100755 --- a/application/admin/view/default/order/index.html +++ b/application/admin/view/default/order/index.html @@ -95,7 +95,7 @@ - +
diff --git a/application/admin/view/default/orderaftersale/index.html b/application/admin/view/default/orderaftersale/index.html new file mode 100644 index 000000000..ebc416287 --- /dev/null +++ b/application/admin/view/default/orderaftersale/index.html @@ -0,0 +1,394 @@ +{{include file="public/header" /}} + + +
+
+ + +
+
+ + + + +
+ +
+
基础信息
+ + + + + + + + + + +
+ 类型: + + + 状态: + +
+ 退款: + + + + 清除条件 +
+ + + + + + + + + + + + + + + + + + + {{if !empty($data_list)}} + {{foreach $data_list as $v}} + + + + + + + + + + + {{/foreach}} + {{/if}} + +
商品信息申请信息凭证状态快递信息更多操作
+
+ + + +
+ {{$v.order_data.items.title}} + {{if !empty($v.order_data.items.spec)}} +
    + {{foreach $v.order_data.items.spec as $spec}} +
  • {{$spec.type}}:{{$spec.value}}
  • + {{/foreach}} +
+ {{/if}} +
+
+ {{if $v.order_data.items.original_price gt 0}} +

¥{{$v.order_data.items.original_price}}

+ {{/if}} +

¥{{$v.order_data.items.price}} x {{$v.order_data.items.buy_number}}

+
+ 类型:{{$v.type_text}}
+ 原因:{{$v.reason}}
+ 数量:{{$v.number}}
+ 金额:{{$v.price}}
+ 说明:{{$v.msg}}
+ 时间:{{$v.apply_time_time}} +
+ {{if !empty($v['images'])}} +
+
    + {{foreach $v.images as $img}} +
  • + +
  • + {{/foreach}} +
+
+ {{/if}} +
+

{{$v.status_text}}

+ {{if $v['status'] eq 3 and !empty($v['refundment_text'])}} + {{$v.refundment_text}} + {{/if}} + {{if $v['status'] eq 4 and !empty($v['refuse_reason'])}} + {{$v.refuse_reason}} + {{/if}} +
+ {{if $v['type'] eq 1 and in_array($v['status'], [2,3])}} + 快递:{{$v.express_name}}
+ 单号:{{$v.express_number}}
+ 时间:{{$v.delivery_time_time}} + {{/if}} +
+ 查看更多 +
+
+
+

详情内容

+ × +
+
+
+
用户信息
+ + +
商品信息
+
+
+ + + +
+ {{$v.order_data.items.title}} + {{if !empty($v.order_data.items.spec)}} +
    + {{foreach $v.order_data.items.spec as $spec}} +
  • {{$spec.type}}:{{$spec.value}}
  • + {{/foreach}} +
+ {{/if}} +
+
+ {{if $v.order_data.items.original_price gt 0}} +

¥{{$v.order_data.items.original_price}}

+ {{/if}} +

¥{{$v.order_data.items.price}} x {{$v.order_data.items.buy_number}}

+
+ +
申请信息
+
+ 类型:{{$v.type_text}}
+ 原因:{{$v.reason}}
+ 数量:{{$v.number}}
+ 金额:{{$v.price}}
+ 说明:{{$v.msg}}
+ 时间:{{$v.apply_time_time}} +
+ +
凭证
+
+ {{if !empty($v['images'])}} + {{foreach $v.images as $img}} + + + + {{/foreach}} + {{/if}} +
+ +
状态
+
+

{{$v.status_text}}

+ {{if $v['status'] eq 3 and !empty($v['refundment_text'])}} + {{$v.refundment_text}} + {{/if}} + {{if $v['status'] eq 4 and !empty($v['refuse_reason'])}} + {{$v.refuse_reason}} + {{/if}} +
+ +
快递信息
+
+ {{if $v['type'] eq 1 and in_array($v['status'], [2,3])}} + 快递:{{$v.express_name}}
+ 单号:{{$v.express_number}}
+ 时间:{{$v.delivery_time_time}} + {{/if}} +
+ +
申请时间
+
{{$v.apply_time_time}}
+ +
确认时间
+
{{$v.confirm_time_time}}
+ +
退货时间
+
{{$v.delivery_time_time}}
+ +
审核时间
+
{{$v.audit_time_time}}
+ +
取消时间
+
{{$v.cancel_time_time}}
+ +
添加时间
+
{{$v.add_time_time}}
+ +
更新时间
+
{{$v.upd_time_time}}
+
+
+
+
+
+ {{if $v['status'] eq 0 and $v['type'] eq 1}} + + {{/if}} + {{if $v['status'] eq 2}} + + {{/if}} + {{if in_array($v['status'], [0,2])}} + + {{/if}} + {{if in_array($v['status'], [1,2])}} + + {{/if}} + {{if in_array($v['status'], [4,5])}} + + {{/if}} +
+ {{if empty($data_list)}} +
没有相关数据
+ {{/if}} + + + +
+
+
+

审核操作

+ × +
+
+
+
用户信息
+ +
+ +
+
+ + {{if !empty($common_order_aftersale_refundment_list)}} + {{foreach $common_order_aftersale_refundment_list as $k=>$v}} + + {{/foreach}} + {{/if}} +
+ +
+ + +
+
+
+
+
+ + +
+
+
+

拒绝操作

+ × +
+
+
+
用户信息
+ +
+ +
+
+ + +
+ +
+ + +
+
+
+
+
+ + + {{if !empty($data_list)}} + {{$page_html|raw}} + {{/if}} + + + + + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/index/controller/Orderaftersale.php b/application/index/controller/Orderaftersale.php index 849d9a48b..d6cedd730 100644 --- a/application/index/controller/Orderaftersale.php +++ b/application/index/controller/Orderaftersale.php @@ -196,6 +196,13 @@ class Orderaftersale extends Common */ public function Create() { + // 是否ajax请求 + if(!IS_AJAX) + { + $this->assign('msg', '非法访问'); + return $this->fetch('public/tips_error'); + } + $params = input(); $params['user'] = $this->user; return OrderAftersaleService::AftersaleCreate($params); @@ -211,6 +218,13 @@ class Orderaftersale extends Common */ public function Delivery() { + // 是否ajax请求 + if(!IS_AJAX) + { + $this->assign('msg', '非法访问'); + return $this->fetch('public/tips_error'); + } + $params = input(); $params['user'] = $this->user; return OrderAftersaleService::AftersaleDelivery($params); @@ -226,15 +240,16 @@ class Orderaftersale extends Common */ public function Cancel() { - if(input('post.')) + // 是否ajax请求 + if(!IS_AJAX) { - $params = input('post.'); - $params['user'] = $this->user; - return OrderAftersaleService::AftersaleCancel($params); - } else { $this->assign('msg', '非法访问'); return $this->fetch('public/tips_error'); } + + $params = input('post.'); + $params['user'] = $this->user; + return OrderAftersaleService::AftersaleCancel($params); } } ?> \ No newline at end of file diff --git a/application/index/controller/Safety.php b/application/index/controller/Safety.php index bc5a3259e..c2dcf35f0 100755 --- a/application/index/controller/Safety.php +++ b/application/index/controller/Safety.php @@ -187,7 +187,8 @@ class Safety extends Common // 是否ajax请求 if(!IS_AJAX) { - return $this->error('非法访问'); + $this->assign('msg', '非法访问'); + return $this->fetch('public/tips_error'); } // 开始处理 @@ -209,7 +210,8 @@ class Safety extends Common // 是否ajax请求 if(!IS_AJAX) { - return $this->error('非法访问'); + $this->assign('msg', '非法访问'); + return $this->fetch('public/tips_error'); } // 开始处理 @@ -230,7 +232,8 @@ class Safety extends Common // 是否ajax请求 if(!IS_AJAX) { - return $this->error('非法访问'); + $this->assign('msg', '非法访问'); + return $this->fetch('public/tips_error'); } // 开始处理 diff --git a/application/index/view/default/order/index.html b/application/index/view/default/order/index.html index 62302dac2..9eeab548a 100755 --- a/application/index/view/default/order/index.html +++ b/application/index/view/default/order/index.html @@ -126,16 +126,18 @@
- - - - - - - - - -
商品单价数量商品操作合计状态操作
+ + + 商品 + 单价 + 数量 + 商品操作 + 合计 + 状态 + 操作 + + +
diff --git a/application/index/view/default/orderaftersale/index.html b/application/index/view/default/orderaftersale/index.html index 5fdfb0995..a486e489d 100644 --- a/application/index/view/default/orderaftersale/index.html +++ b/application/index/view/default/orderaftersale/index.html @@ -166,8 +166,11 @@ {{/if}} - {{if in_array($v['status'], [0,3])}} - + {{if $v['status'] eq 1 and $v['type'] eq 1}} + 发货 + {{/if}} + {{if !in_array($v['status'], [3,4,5])}} + {{/if}} 详情 diff --git a/application/index/view/default/public/header_nav.html b/application/index/view/default/public/header_nav.html index 10c715031..6538c3a5c 100755 --- a/application/index/view/default/public/header_nav.html +++ b/application/index/view/default/public/header_nav.html @@ -16,7 +16,7 @@