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 @@ + +商城 + + + + +
+
返回
+
所有分类
+ +
+ +@include('weixin.common.headerNav') + +
+
+ +
+
+ +
+
+ +@include('weixin.common.footer') + \ No newline at end of file diff --git a/resources/views/weixin/goods/goodslist.blade.php b/resources/views/weixin/goods/goodslist.blade.php index 7b706b4..b9b1718 100644 --- a/resources/views/weixin/goods/goodslist.blade.php +++ b/resources/views/weixin/goods/goodslist.blade.php @@ -15,7 +15,7 @@
  • - 销量 + 销量
  • diff --git a/resources/views/weixin/index/category.blade.php b/resources/views/weixin/index/category.blade.php new file mode 100644 index 0000000..3cbc872 --- /dev/null +++ b/resources/views/weixin/index/category.blade.php @@ -0,0 +1,209 @@ + +微商城 + + + + +
    +
    返回
    +
    所有分类
    + +
    + +@include('weixin.common.headerNav') + +
    +
    + +
    + +
    + +@include('weixin.common.footer') + \ No newline at end of file diff --git a/resources/views/weixin/index/index.blade.php b/resources/views/weixin/index/index.blade.php index 1f8ea68..5ef0d95 100644 --- a/resources/views/weixin/index/index.blade.php +++ b/resources/views/weixin/index/index.blade.php @@ -104,7 +104,7 @@ var swiper = new Swiper('.swiper-nav', { 团购 团购 - + 我的订单 我的订单 diff --git a/resources/views/weixin/order/orderDetail.blade.php b/resources/views/weixin/order/orderDetail.blade.php index 8dfb260..18f526c 100644 --- a/resources/views/weixin/order/orderDetail.blade.php +++ b/resources/views/weixin/order/orderDetail.blade.php @@ -11,6 +11,14 @@ @include('weixin.common.headerNav') + +
    +

    +
    + +

    @@ -27,12 +35,12 @@
    订单商品
      -$value){ ?> +$value){ ?>
    • 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 @@
    @include('weixin.common.headerNav') + + + + + + + + + $value){ ?> - + +
    暂无记录
    + -@include('weixin.common.footer') \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 86a330d..c0fee43 100644 --- a/routes/web.php +++ b/routes/web.php @@ -55,7 +55,9 @@ Route::group(['namespace' => 'Home'], function () { //微信路由,无需登录 Route::group(['prefix' => 'weixin', 'namespace' => 'Weixin'], function () { Route::get('/', 'IndexController@index')->name('weixin'); - Route::get('/page404', 'IndexController@page404')->name('weixin_page404'); //404页面 + Route::get('/category', 'IndexController@category')->name('weixin_category'); + Route::get('/category_goods_list', 'GoodsController@categoryGoodsList')->name('weixin_category_goods_list'); //产品分类页 + Route::get('/page404', 'IndexController@page404')->name('weixin_page404'); //404页面 Route::get('/search', 'IndexController@search')->name('weixin_search'); //搜索页面 Route::get('/p/{id}', 'ArticleController@detail')->name('weixin_article_detail'); //文章详情页 Route::get('/cat{cat}', 'ArticleController@category')->name('weixin_article_category'); //分类页 @@ -77,7 +79,6 @@ Route::group(['prefix' => 'weixin', 'namespace' => 'Weixin'], function () { //微信路由,需登录,全局 Route::group(['prefix' => 'weixin', 'namespace' => 'Weixin', 'middleware' => ['web','wxlogin']], function () { - Route::get('/category', 'CartController@index')->name('weixin_category'); //个人中心 Route::get('/user', 'UserController@index')->name('weixin_user'); Route::get('/userinfo', 'UserController@userinfo')->name('weixin_userinfo');