From 7df8174c06e19ec0cfaab43d41eafd16d8db09b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=80=E5=B3=B0?= <1feng.0595@gmail.com> Date: Thu, 30 Nov 2017 00:42:06 +0800 Subject: [PATCH] goods list --- .../Controllers/Weixin/GoodsController.php | 24 ++ .../Controllers/Weixin/IndexController.php | 7 + app/Http/Model/Order.php | 20 +- .../weixin/goods/categoryGoodsList.blade.php | 59 +++++ .../views/weixin/goods/goodslist.blade.php | 2 +- .../views/weixin/index/category.blade.php | 209 ++++++++++++++++++ resources/views/weixin/index/index.blade.php | 2 +- .../views/weixin/order/orderDetail.blade.php | 12 +- .../views/weixin/order/orderList.blade.php | 33 ++- routes/web.php | 5 +- 10 files changed, 356 insertions(+), 17 deletions(-) create mode 100644 resources/views/weixin/goods/categoryGoodsList.blade.php create mode 100644 resources/views/weixin/index/category.blade.php diff --git a/app/Http/Controllers/Weixin/GoodsController.php b/app/Http/Controllers/Weixin/GoodsController.php index 489aaf6..25b26b2 100644 --- a/app/Http/Controllers/Weixin/GoodsController.php +++ b/app/Http/Controllers/Weixin/GoodsController.php @@ -61,4 +61,28 @@ class GoodsController extends CommonController return view('weixin.goods.goodsList', $data); } + + //商品列表 + public function categoryGoodsList(Request $request) + { + if($request->input('typeid', '') != ''){$data['typeid'] = $request->input('typeid');} + if($request->input('tuijian', '') != ''){$data['tuijian'] = $request->input('tuijian');} + if($request->input('keyword', '') != ''){$data['keyword'] = $request->input('keyword');} + if($request->input('status', '') != ''){$data['status'] = $request->input('status');} + if($request->input('is_promote', '') != ''){$data['is_promote'] = $request->input('is_promote');} + if($request->input('orderby', '') != ''){$data['orderby'] = $request->input('orderby');} + if($request->input('max_price', '') != ''){$data['max_price'] = $request->input('max_price');}else{$data['max_price'] = 99999;} + if($request->input('min_price', '') != ''){$data['min_price'] = $request->input('min_price');}else{$data['min_price'] = 0;} + + //商品列表 + $postdata = array( + 'limit' => 10, + 'offset' => 0 + ); + $url = env('APP_API_URL')."/goods_list"; + $goods_list = curl_request($url,$postdata,'GET'); + $data['goods_list'] = $goods_list['data']['list']; + + return view('weixin.goods.categoryGoodsList', $data); + } } \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/IndexController.php b/app/Http/Controllers/Weixin/IndexController.php index 06a414a..cd7afc8 100644 --- a/app/Http/Controllers/Weixin/IndexController.php +++ b/app/Http/Controllers/Weixin/IndexController.php @@ -57,6 +57,13 @@ class IndexController extends CommonController return view('weixin.index.index',$data); } + //分类 + public function category() + { + $data['aaa'] = 111; + return view('weixin.index.category',$data); + } + //标签详情页,共有3种显示方式,1正常列表,2列表显示文章,3显示描述 public function tag($tag, $page=0) { diff --git a/app/Http/Model/Order.php b/app/Http/Model/Order.php index cdc656b..7990042 100644 --- a/app/Http/Model/Order.php +++ b/app/Http/Model/Order.php @@ -72,7 +72,9 @@ class Order extends BaseModel { foreach($order_list as $k=>$v) { - $order_list[$k]['order_status_text'] = self::getOrderStatusText($v); + $order_status_arr = self::getOrderStatusText($v); + $order_list[$k]['order_status_text'] = $order_status_arr['text']; + $order_list[$k]['order_status_num'] = $order_status_arr['num']; $order_goods = OrderGoods::where(array('order_id'=>$v['id']))->get(); $order_list[$k]['goods_list'] = $order_goods; @@ -102,7 +104,9 @@ class Order extends BaseModel return ReturnData::create(ReturnData::SYSTEM_FAIL); } - $res['order_status_text'] = self::getOrderStatusText($res); + $order_status_arr = self::getOrderStatusText($res); + $res['order_status_text'] = $order_status_arr['text']; + $res['order_status_num'] = $order_status_arr['num']; $res['province_name'] = Region::getRegionName($res['province']); $res['city_name'] = Region::getRegionName($res['city']); @@ -163,7 +167,7 @@ class Order extends BaseModel 'place_type' => $place_type, //订单来源 'bonus_id' => !empty($user_bonus)?$user_bonus['id']:0, 'bonus_money' => !empty($user_bonus)?$user_bonus['money']:0.00, - 'message' => $message + 'message' => !empty($message)?$message:'', ); //插入订单 @@ -245,23 +249,23 @@ class Order extends BaseModel $res = ''; if($where['order_status'] == 0 && $where['pay_status'] ==0) { - $res = '待付款'; + $res = array('text'=>'待付款','num'=>1); } elseif($where['order_status'] == 0 && $where['shipping_status'] == 0 && $where['pay_status'] == 1) { - $res = '待发货'; + $res = array('text'=>'待发货','num'=>2); } elseif($where['order_status'] == 0 && $where['refund_status'] == 0 && $where['shipping_status'] == 1 && $where['pay_status'] == 1) { - $res = '待收货'; + $res = array('text'=>'待收货','num'=>3); } elseif($where['order_status'] == 3 && $where['refund_status'] == 0 && $where['shipping_status'] == 2 && $where['is_comment'] == 0) { - $res = '交易成功'; + $res = array('text'=>'交易成功','num'=>4); } elseif($where['order_status'] == 3 && $where['refund_status'] == 1) { - $res = '售后'; + $res = array('text'=>'售后','num'=>5); } return $res; diff --git a/resources/views/weixin/goods/categoryGoodsList.blade.php b/resources/views/weixin/goods/categoryGoodsList.blade.php new file mode 100644 index 0000000..d77e17c --- /dev/null +++ b/resources/views/weixin/goods/categoryGoodsList.blade.php @@ -0,0 +1,59 @@ +
+电池 电源 充电器
+ +贴膜,保护套
+ +数码相机
+ +单反相机
+ +摄像机
+ +镜头
+ +数码相框
+ +选号码
+ +办套餐
+ +合约机
+ +中国移动
+ +音响麦克风
+ +耳机/耳麦
+ +学生平板
+ +点读机
+ +电纸书
+ +电子词典
+ +复读机
+ +@@ -27,12 +35,12 @@
¥x
合计: ¥ (含运费:¥)
diff --git a/resources/views/weixin/order/orderList.blade.php b/resources/views/weixin/order/orderList.blade.php index 4ad1795..fd78867 100644 --- a/resources/views/weixin/order/orderList.blade.php +++ b/resources/views/weixin/order/orderList.blade.php @@ -10,6 +10,32 @@