From ddfb8066cc166fbe68b3673da99ed4915f15c32d Mon Sep 17 00:00:00 2001 From: devil_gong Date: Mon, 15 Oct 2018 11:17:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/Application/Common/Lang/zh-cn.php | 5 +- .../Controller/CommonController.class.php | 8 +- .../Controller/MessageController.class.php | 92 ++++++++++++ .../Home/Controller/OrderController.class.php | 6 +- .../Home/View/Default/Message/Index.html | 134 ++++++++++++++++++ .../Home/View/Default/Order/Index.html | 4 +- .../View/Default/Public/HeaderTopNav.html | 13 +- .../Home/View/Default/User/Index.html | 2 +- .../Application/Service/BuyService.class.php | 22 ++- .../Service/MessageService.class.php | 89 ++++++++++-- .../Service/OrderService.class.php | 38 ++--- service/Public/Home/Default/Css/Message.css | 32 +++++ service/Public/Home/Default/Css/Order.css | 2 +- service/Public/Home/Default/Js/Order.js | 22 --- 14 files changed, 400 insertions(+), 69 deletions(-) create mode 100644 service/Application/Home/Controller/MessageController.class.php create mode 100644 service/Application/Home/View/Default/Message/Index.html create mode 100644 service/Public/Home/Default/Css/Message.css diff --git a/service/Application/Common/Lang/zh-cn.php b/service/Application/Common/Lang/zh-cn.php index 724e2e41b..4f8056042 100755 --- a/service/Application/Common/Lang/zh-cn.php +++ b/service/Application/Common/Lang/zh-cn.php @@ -424,7 +424,7 @@ return array( // 消息类型 'common_message_type_list' => array( - 0 => array('id' => 0, 'name' => '普通通知', 'checked' => true), + 0 => array('id' => 0, 'name' => '默认', 'checked' => true), ), // 支付类型 @@ -435,7 +435,8 @@ return array( // 业务类型 'common_business_type_list' => array( - 0 => array('id' => 0, 'name' => '订单', 'checked' => true), + 0 => array('id' => 0, 'name' => '默认', 'checked' => true), + 1 => array('id' => 1, 'name' => '订单'), ), // 用户积分 - 操作类型 diff --git a/service/Application/Home/Controller/CommonController.class.php b/service/Application/Home/Controller/CommonController.class.php index 177026e4e..c063ee60a 100755 --- a/service/Application/Home/Controller/CommonController.class.php +++ b/service/Application/Home/Controller/CommonController.class.php @@ -6,6 +6,7 @@ use Think\Controller; use Service\GoodsService; use Service\NavigationService; use Service\BuyService; +use Service\MessageService; /** * 前台 @@ -161,9 +162,14 @@ class CommonController extends Controller $this->assign('goods_category_list', GoodsService::GoodsCategory()); // 购物车商品总数 - $common_cart_total = BuyService::CartTotal(['user'=>$this->user]); + $common_cart_total = BuyService::UserCartTotal(['user'=>$this->user]); $this->assign('common_cart_total', ($common_cart_total > 99) ? '99+' : $common_cart_total); + // 未读消息总数 + $params = ['user'=>$this->user, 'is_more'=>1, 'is_read'=>0]; + $common_message_total = MessageService::UserMessageTotal($params); + $this->assign('common_message_total', ($common_message_total > 99) ? '99+' : $common_message_total); + // 当前控制器名称 $this->assign('controller_name', CONTROLLER_NAME); } diff --git a/service/Application/Home/Controller/MessageController.class.php b/service/Application/Home/Controller/MessageController.class.php new file mode 100644 index 000000000..c5eda0b97 --- /dev/null +++ b/service/Application/Home/Controller/MessageController.class.php @@ -0,0 +1,92 @@ +Is_Login(); + } + + /** + * 消息列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-28 + * @desc description + */ + public function Index() + { + // 参数 + $params = array_merge($_POST, $_GET); + $params['user'] = $this->user; + + // 分页 + $number = 10; + + // 条件 + $where = MessageService::UserMessgeListWhere($params); + + // 获取总数 + $total = MessageService::MessageTotal($where); + + // 分页 + $page_params = array( + 'number' => $number, + 'total' => $total, + 'where' => $params, + 'url' => U('Home/Message/Index'), + ); + $page = new \Library\Page($page_params); + $this->assign('page_html', $page->GetPageHtml()); + + // 获取列表 + $data_params = array( + 'limit_start' => $page->GetPageStarNumber(), + 'limit_number' => $number, + 'where' => $where, + ); + $data = MessageService::MessageList($data_params); + $this->assign('data_list', $data['data']); + + // 消息更新未已读 + MessageService::MessageRead($params); + + // 业务类型 + $this->assign('common_business_type_list', L('common_business_type_list')); + + // 消息类型 + $this->assign('common_message_type_list', L('common_message_type_list')); + + // 是否已读 + $this->assign('common_is_read_list', L('common_is_read_list')); + + // 参数 + $this->assign('params', $params); + $this->display('Index'); + } + +} +?> \ No newline at end of file diff --git a/service/Application/Home/Controller/OrderController.class.php b/service/Application/Home/Controller/OrderController.class.php index a9183c646..ca322f5b6 100755 --- a/service/Application/Home/Controller/OrderController.class.php +++ b/service/Application/Home/Controller/OrderController.class.php @@ -48,7 +48,7 @@ class OrderController extends CommonController $number = 10; // 条件 - $where = OrderService::HomeOrderListWhere($params); + $where = OrderService::UserOrderListWhere($params); // 获取总数 $total = OrderService::OrderTotal($where); @@ -107,7 +107,7 @@ class OrderController extends CommonController $params['user'] = $this->user; // 条件 - $where = OrderService::HomeOrderListWhere($params); + $where = OrderService::UserOrderListWhere($params); // 获取列表 $data_params = array( @@ -144,7 +144,7 @@ class OrderController extends CommonController $params['user'] = $this->user; // 条件 - $where = OrderService::HomeOrderListWhere($params); + $where = OrderService::UserOrderListWhere($params); // 获取列表 $data_params = array( diff --git a/service/Application/Home/View/Default/Message/Index.html b/service/Application/Home/View/Default/Message/Index.html new file mode 100644 index 000000000..2b0dfc49a --- /dev/null +++ b/service/Application/Home/View/Default/Message/Index.html @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
+
+
+ {{$params.keywords}}" /> + + + +
+ +
+ none"> + + + + + + + + + + +
+ 类型: + + + 业务: + +
+ 状态: + + + + 清除条件 +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
标题类型业务详情状态时间
{{$v.title}}{{$v.type_name}}{{$v.business_type_name}}{{$v.detail}}{{$v.is_read_name}}{{$v.add_time_time}}
+
{{:L('common_not_data_tips')}}
+
+
+ + + + {{$page_html}} + +
+
+ +
+ + + + \ No newline at end of file diff --git a/service/Application/Home/View/Default/Order/Index.html b/service/Application/Home/View/Default/Order/Index.html index 6e73f3f1a..1660f9d4f 100755 --- a/service/Application/Home/View/Default/Order/Index.html +++ b/service/Application/Home/View/Default/Order/Index.html @@ -30,13 +30,13 @@ -