diff --git a/service/Application/Common/Common/function.php b/service/Application/Common/Common/function.php index 4c7038325..a9b870449 100755 --- a/service/Application/Common/Common/function.php +++ b/service/Application/Common/Common/function.php @@ -1266,6 +1266,12 @@ function params_checked($data, $params) if (!isset($data[$v['key_name']]) || !in_array($data[$v['key_name']], $v['checked_data'])) { return $v['error_msg']; } + + case 'is_array' : + if (!isset($data[$v['key_name']]) || !is_array($data[$v['key_name']])) { + return $v['error_msg']; + } + break; } } return true; diff --git a/service/Application/Home/Controller/OrderController.class.php b/service/Application/Home/Controller/OrderController.class.php index 631133245..77be2e355 100755 --- a/service/Application/Home/Controller/OrderController.class.php +++ b/service/Application/Home/Controller/OrderController.class.php @@ -40,6 +40,48 @@ class OrderController extends CommonController */ public function Index() { + // 参数 + $params = array_merge($_POST, $_GET); + $params['user'] = $this->user; + + // 分页 + $number = 10; + + // 条件 + $where = OrderService::HomeOrderListWhere($params); + + + // 获取总数 + $total = OrderService::OrderTotal($where); + + // 分页 + $page_params = array( + 'number' => $number, + 'total' => $total, + 'where' => $params, + 'url' => U('Home/Order/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 = OrderService::OrderList($data_params); + $this->assign('data_list', $data['data']); + + // 品牌分类 + // $brand_category = M('BrandCategory')->where(['is_enable'=>1])->field('id,name')->select(); + // $this->assign('brand_category', $brand_category); + + // 参数 + $this->assign('params', $params); + + // 数据列表 + $this->assign('list', $list); $this->display('Index'); } diff --git a/service/Application/Home/Lang/zh-cn.php b/service/Application/Home/Lang/zh-cn.php index bc4aca07e..b9a4758e5 100755 --- a/service/Application/Home/Lang/zh-cn.php +++ b/service/Application/Home/Lang/zh-cn.php @@ -11,21 +11,21 @@ return array( // 用户中心菜单, is_show = [0禁用, 1启用] 'user_left_menu' => array( array( - 'control' => 'Bubble', + 'control' => 'User', 'action' => 'Index', - 'name' => '冒泡广场', + 'name' => '个人中心', 'is_show' => 1, - 'icon' => 'am-icon-slideshare', + 'icon' => 'am-icon-home', ), array( - 'name' => '学生信息', + 'name' => '我的交易', 'is_show' => 1, - 'icon' => 'am-icon-mortar-board fs-12', + 'icon' => 'am-icon-mortar-board', 'item' => array( array( - 'control' => 'Student', + 'control' => 'Order', 'action' => 'Index', - 'name' => '学生列表', + 'name' => '订单管理', 'is_show' => 1, 'icon' => 'am-icon-th-list', ) @@ -94,7 +94,7 @@ return array( 'action' => 'Index', 'name' => '学生', 'is_show' => 1, - 'icon' => 'am-icon-mortar-board fs-12 w-14', + 'icon' => 'am-icon-mortar-board', ), array( 'control' => 'Safety', diff --git a/service/Application/Home/View/Default/Order/Index.html b/service/Application/Home/View/Default/Order/Index.html index c6dadd2a2..b2823e5eb 100755 --- a/service/Application/Home/View/Default/Order/Index.html +++ b/service/Application/Home/View/Default/Order/Index.html @@ -13,12 +13,175 @@ -
- - 订单管理 - -
{{:L('common_not_data_tips')}}
-
+
+ + + + + +
+
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + + + + +
+ 时间: + + + + ~ + + + + + 价格: + + + + ~ + + + +
+ 支付: + + + 付款: + +
+ 状态: + +
+ + 清除条件 +
+
+ + + +
+ + + + + + + + + +
商品单价数量合计状态操作
+
+ + + + data-ongoing"> + + + + + + + + + + + + + + + + + + +
+ title +
+
+ + + +
+ {{$goods.title}} + +
    + +
  • {{$attr.attr_type_name}}:{{$attr.attr_name}}
  • +
    +
+
+
+
+
+ + ¥{{$goods.original_price}} + + ¥{{$goods.price}} + x{{$goods.stock}} +
+
+ +

¥{{$goods.original_price}}

+
+

¥{{$goods.price}}

+
+ x{{$goods.buy_number}} + + ¥{{$order.total_price}} +
+
+ + + + + {{$page_html}} + +
+
+
diff --git a/service/Application/Home/View/Default/Public/Footer.html b/service/Application/Home/View/Default/Public/Footer.html index 56c3c0c64..73050dce0 100755 --- a/service/Application/Home/View/Default/Public/Footer.html +++ b/service/Application/Home/View/Default/Public/Footer.html @@ -30,6 +30,9 @@ + + + diff --git a/service/Application/Home/View/Default/User/Index.html b/service/Application/Home/View/Default/User/Index.html index 7bf5a24ed..4691cfbc9 100755 --- a/service/Application/Home/View/Default/User/Index.html +++ b/service/Application/Home/View/Default/User/Index.html @@ -1,27 +1,32 @@ - - - + + -
style="{{$max_width_style}}"> + + + + + + + + + + +
-
- SchoolCMS +
+ ShopXO
- - - - \ No newline at end of file diff --git a/service/Application/Service/OrderService.class.php b/service/Application/Service/OrderService.class.php index 419fed9bd..8424781be 100755 --- a/service/Application/Service/OrderService.class.php +++ b/service/Application/Service/OrderService.class.php @@ -229,5 +229,116 @@ class OrderService { return substr($out_trade_no, 14); } + + /** + * 前端订单列表条件 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-29 + * @desc description + * @param [array] $params [输入参数] + */ + public static function HomeOrderListWhere($params = []) + { + $where = [ + 'is_delete_time' => 0, + ]; + + // 用户id + if(!empty($params['user'])) + { + $where['user_id'] = $params['user']['id']; + } + + return $where; + } + + /** + * 订单总数 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-29 + * @desc description + * @param [array] $where [条件] + */ + public static function OrderTotal($where = []) + { + return (int) M('Order')->where($where)->count(); + } + + /** + * 订单列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-29 + * @desc description + * @param [array] $params [输入参数] + */ + public static function OrderList($params = []) + { + // 请求参数 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'where', + 'error_msg' => '条件不能为空', + ], + [ + 'checked_type' => 'is_array', + 'key_name' => 'where', + 'error_msg' => '条件格式有误', + ], + [ + 'checked_type' => 'isset', + 'key_name' => 'limit_start', + 'error_msg' => '分页起始值有误', + ], + [ + 'checked_type' => 'isset', + 'key_name' => 'limit_number', + 'error_msg' => '分页数量不能为空', + ], + ]; + $ret = params_checked($params, $p); + if($ret !== true) + { + return DataReturn($ret, -1); + } + + $limit_start = max(0, intval($params['limit_start'])); + $limit_number = max(1, intval($params['limit_number'])); + $order_by = empty($params['$order_by']) ? 'id desc' : I('order_by', '', '', $params); + + // 获取订单 + $data = M('Order')->where($params['where'])->limit($limit_start, $limit_number)->order($order_by)->select(); + if(!empty($data)) + { + $detail_m = M('OrderDetail'); + $detail_field = 'id,goods_id,title,images,original_price,price,attribute,buy_number'; + $images_host = C('IMAGE_HOST'); + $total_price = 0; + foreach($data as &$v) + { + $items = $detail_m->where(['order_id'=>$v['id']])->field($detail_field)->select(); + if(!empty($items)) + { + foreach($items as &$vs) + { + $vs['images'] = empty($vs['images']) ? null : $images_host.$vs['images']; + $vs['attribute'] = empty($vs['attribute']) ? null : json_decode($vs['attribute'], true); + $vs['goods_url'] = HomeUrl('Goods', 'Index', ['id'=>$vs['goods_id']]); + $total_price += $vs['buy_number']*$vs['price']; + } + } + $v['items'] = $items; + $v['items_count'] = count($items); + $v['total_price'] = $total_price; + } + } + return DataReturn('处理成功', 0, $data); + } } ?> \ No newline at end of file diff --git a/service/Public/Common/Js/Common.js b/service/Public/Common/Js/Common.js index 47179068f..472f98d40 100755 --- a/service/Public/Common/Js/Common.js +++ b/service/Public/Common/Js/Common.js @@ -352,6 +352,12 @@ function FromInit(form_name) var request_value = $form.attr('request-value'); var ajax_all = ['ajax-reload', 'ajax-url', 'ajax-fun']; + // 不是form表单直接通过 + if(request_type == 'form') + { + return true; + } + // 参数校验 if(ajax_all.indexOf(request_type) == -1 || action == undefined || action == '' || method == undefined || method == '') { diff --git a/service/Public/Home/Default/Css/Common.css b/service/Public/Home/Default/Css/Common.css index 1d90f1511..af95ce047 100755 --- a/service/Public/Home/Default/Css/Common.css +++ b/service/Public/Home/Default/Css/Common.css @@ -48,7 +48,7 @@ a { text-decoration: none; } a:link,a:visited,a:hover{ outline:none;} -a:hover, a:focus { color: #d2364c !important; text-decoration: underline; } +a:hover, a:focus { color: #d2364c; text-decoration: underline; } .spatic{width:100%; height:16px;} h5{float: right;color: #666;padding-right:20px;} @@ -556,3 +556,41 @@ background:url(../Images/ibar_sprites.png) no-repeat;background-position:0px -23 } .am-popup-hd .am-popup-title { font-size: 18px; } + + +/** + * 用户中心布局样式 + */ +.user-menu {position:fixed;z-index:10;bottom:30px;right:20px;} +.user-sidebar {width:145px;min-height:100%;float:left;} +.user-sidebar .am-active {z-index:1600;} +.user-sidebar .am-active a, .user-sidebar-list li a:hover {background:#fff1f5; text-decoration: none; color: #d2364c; } +.user-sidebar-list li a {color:#5c5c5c;padding-left:10px;padding: 0.8rem;} +.user-sidebar-list li:first-child {border-top:none;} +.user-offcanvas-bar .am-list > li { border: 1px solid #ffe8ef; } +.user-sidebar-sub {margin-top:0;margin-bottom:0;} +.user-sidebar-sub li { border-left: 0!important; border-right: 0!important; } +.user-sidebar-sub li a { padding-left:35px; } +.user-content {display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;background:#fff;} +.user-content-body {-webkit-box-flex:1;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto; } +.user-offcanvas-bar { z-index: 900; } +@media only screen and (min-width:640px) { + .user-sidebar {display:block;position:static;background:none; border-top: 5px solid #f78590;} + .user-offcanvas-bar {position:static;width:auto;background:none;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);overflow-y:hidden;} + .user-offcanvas-bar:after {content:none;} + .user-main { padding: 0 5px; } + .user-content-body { padding: 0 5px 5px 10px; } +} +@media only screen and (min-width: 1025px) { + .user-main { padding: 0; } +} +@media only screen and (max-width:640px) { + .user-sidebar {width:inherit;} + .user-offcanvas-bar {background:#f3f3f3;} + .user-offcanvas-bar:after {background:#BABABA;} + .user-sidebar-list a:hover,.user-sidebar-list a:active {-webkit-transition:background-color .3s ease;-moz-transition:background-color .3s ease;-ms-transition:background-color .3s ease;-o-transition:background-color .3s ease;transition:background-color .3s ease;background:#E4E4E4;} + .user-content-body { padding: 0 5px 5px 5px; } +} +.user-main { padding-top: 10px; } + +.more-icon-rotate {-webkit-transform: rotate(-90deg);transform: rotate(-90deg);-webkit-transition: all 300ms;transition: all 300ms;} \ No newline at end of file diff --git a/service/Public/Home/Default/Css/Order.css b/service/Public/Home/Default/Css/Order.css new file mode 100644 index 000000000..c3dc20ca6 --- /dev/null +++ b/service/Public/Home/Default/Css/Order.css @@ -0,0 +1,97 @@ +/* 筛选 */ +.thin, .pay-list { overflow:hidden; } +.thin .so { width:66%; } +.thin_sub { font-weight:100; margin:10px 0px 0px 10px; cursor: pointer; } +.so-list { width:100%; margin-top: 20px; } +.so-list * { font-size:1.2rem !important; } +.so-list span { color:#666; } +.so-list input { height:28px; display:inline !important; } +.time input, .so-list .chosen-container { background:#FFF !important; } +.time input { width:100px !important; } +.time i { position:absolute; margin:4px 0px 0px -15px; } +.price input { width:101px !important; } +.time, .time { width:50%; } +.so-list tr+tr>td:first-child { padding-top:10px; } +.so-list .chosen-container { border-radius:2px; } +.text-grey { color: #999; } +.chosen-container-single .chosen-single, .so-list select { height: 28px; line-height: 28px; width: 100%; } +.reset-submit { margin-left: 20px; } +.so-list select { padding: 0 0 0 8px; } + + +@media only screen and (min-width: 641px){ + .so-list .chosen-container, .so-list select { width:217px !important; display: -webkit-inline-box; } + .thin_sub:hover { color:#F60; } + + .row-content { width:30%; } + .row-price { width:15%; } + .row-number { width:15%; } + .row-total-price { width:15%; } + .row-status { width:15%; } + .row-operate { width:10%; } +} +@media only screen and (max-width: 641px){ + .so-list input { width:40% !important; } + .so-list td { width:100%; display:block; } + .so-list tr td:last-child { margin-top:10px; } + .so-list .chosen-container { width:85%; } + .so-list .chosen-container { width:100%; } + .so-list tr td:last-child { padding-top:0px !important; } + .chosen-container-single .chosen-search input[type="text"] { width: 100% !important; } + + .row-content { width:40%; } + .row-price { width:30%; } + .row-operate { width:10%; } +} + +/** + * 订单列表 + */ +/* 列表 */ +table { width: 100%; } +table.data-list { margin-top: 10px; } +table.data-list-success, table.data-list-success td { border:1px solid #daf3ff; } +table.data-list { background:#FFF; border-radius:2px; -moz-border-radius:2px; -webkit-border-radius:2px; } +table.data-list * { font-size:12px; } +table.data-list td { padding:10px; } +.content-title th { text-align:center; } + +.content img { width:80px; height:80px; } +.content p { margin:0px; } +.content a:hover { color:#F60; } +.row-content { min-width:102px; } +table.data-list tr td+td { text-align:center; } +.content-checkbox-operate { padding:3px 5px; } + + +/* 不在进行中 */ +table.data-list { border-left: 1px solid #eee; border-right: 1px solid #eee; } +table.data-list td.row-number, table.data-list td.row-total-price, table.data-list td.row-status { border-right: 1px solid #eee; } +table.data-list td { border-bottom:1px solid #eee; } +table.data-list .content-hd td { background:#EEE; border-bottom-color:#EEE; } +table.data-list:hover { box-shadow:0 1px 1px #E4E4E4; background:#FCFCFC; } + + +/* 进行中 */ +table.data-ongoing { border-left: 1px solid #daf3ff; border-right: 1px solid #daf3ff; } +table.data-ongoing td.row-number, table.data-ongoing td.row-total-price, table.data-ongoing td.row-status { border-right: 1px solid #daf3ff; } +table.data-ongoing td { border-bottom:1px solid #daf3ff; } +table.data-ongoing .content-hd td { background: #eaf8ff; border-bottom-color:#eaf8ff; } +table.data-ongoing:hover { box-shadow:0 1px 1px #9AD6F3; background:#F9FDFF; } + + +/** + * 商品列表 + */ +.goods-detail img { width: 80px; height: 80px; } +.goods-detail { position: relative; } +.goods-title { display: block; max-height: 36px; overflow: hidden; text-overflow: ellipsis; } +.goods-title:hover { text-decoration: underline; } +.goods-base { position: absolute; top: 0; left: 85px; } +.goods-attr { margin-top: 5px; } +.goods-attr li { color: #888; line-height: 16px; } +.original-price, .line-price { font-family: Verdana,Tahoma,arial; } +.original-price { color: #9c9c9c; text-decoration: line-through; } +.line-price { color: #3c3c3c; } +.line-price, strong.total-price-content { font-weight: 700; } +strong.total-price-content { color: #d2364c; font-size: 16px; } diff --git a/service/Public/Home/Default/Js/Common.js b/service/Public/Home/Default/Js/Common.js index 9f874aafe..4f5c51a7e 100755 --- a/service/Public/Home/Default/Js/Common.js +++ b/service/Public/Home/Default/Js/Common.js @@ -99,5 +99,11 @@ $(function() } }); + // 用户中心菜单 + $('.user-item-parent').on('click', function() + { + console.log(1) + $(this).find('.am-icon-angle-down').toggleClass('more-icon-rotate'); + }); }); \ No newline at end of file diff --git a/service/Public/Home/Default/Js/Order.js b/service/Public/Home/Default/Js/Order.js new file mode 100644 index 000000000..b4a75fbb7 --- /dev/null +++ b/service/Public/Home/Default/Js/Order.js @@ -0,0 +1,25 @@ +$(function() +{ + /* 搜索切换 */ + var $so_list = $('.so-list'); + $thin_sub = $('.thin_sub'); + $thin_sub.find('input[name="so_type"]').change(function() + { + if($thin_sub.find('i').hasClass('am-icon-angle-down')) + { + $thin_sub.find('i').removeClass('am-icon-angle-down'); + $thin_sub.find('i').addClass('am-icon-angle-up'); + } else { + $thin_sub.find('i').addClass('am-icon-angle-down'); + $thin_sub.find('i').removeClass('am-icon-angle-up'); + } + + if($thin_sub.find('input[name="so_type"]:checked').val() == undefined) + { + $so_list.addClass('none'); + } else { + $so_list.removeClass('none'); + } + }); + +}); \ No newline at end of file