From 278eb49fbdaf00ad2a74d21b0221ebb82bc30710 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: Tue, 10 Oct 2017 23:22:24 +0800
Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E6=94=B6=E8=97=8F=E5=88=97?=
=?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/Api/UserAddressController.php | 15 +-
.../Controllers/Weixin/AddressController.php | 87 ++++++++
.../Weixin/CollectGoodsController.php | 50 +++--
.../Controllers/Weixin/UserController.php | 22 +-
app/Http/Model/CollectGoods.php | 20 +-
app/Http/Model/User.php | 2 +-
app/Http/Model/UserAddress.php | 74 ++++---
public/css/weixin/style.css | 20 +-
.../images/weixin/{user68.jpg => no_user.jpg} | Bin
.../views/weixin/address/index.blade.php | 139 +++++++++++++
.../weixin/address/userAddressAdd.blade.php | 110 ++++++++++
.../weixin/collect_goods/index.blade.php | 111 ++++++++++
resources/views/weixin/user/index.blade.php | 4 +-
.../weixin/user/userGoodsHistory.blade.php | 5 +-
resources/views/welcome.blade.php | 89 --------
routes/web.php | 192 +++++++++---------
16 files changed, 658 insertions(+), 282 deletions(-)
create mode 100644 app/Http/Controllers/Weixin/AddressController.php
rename public/images/weixin/{user68.jpg => no_user.jpg} (100%)
create mode 100644 resources/views/weixin/address/index.blade.php
create mode 100644 resources/views/weixin/address/userAddressAdd.blade.php
create mode 100644 resources/views/weixin/collect_goods/index.blade.php
delete mode 100644 resources/views/welcome.blade.php
diff --git a/app/Http/Controllers/Api/UserAddressController.php b/app/Http/Controllers/Api/UserAddressController.php
index 9d8773d..df07d4c 100644
--- a/app/Http/Controllers/Api/UserAddressController.php
+++ b/app/Http/Controllers/Api/UserAddressController.php
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api;
use App\Http\Controllers\Api\CommonController;
use Illuminate\Http\Request;
use App\Common\ReturnData;
+use App\Common\Token;
use App\Http\Model\UserAddress;
@@ -23,6 +24,7 @@ class UserAddressController extends CommonController
$data['user_id'] = Token::$uid;
$res = UserAddress::getList($data);
+
if(!$res)
{
return ReturnData::create(ReturnData::SYSTEM_FAIL);
@@ -68,18 +70,16 @@ class UserAddressController extends CommonController
$data['user_id'] = Token::$uid;
$data['name'] = $request->input('name',null);
$data['mobile'] = $request->input('mobile',null);
- $data['country'] = $request->input('country',null);
$data['province'] = $request->input('province',null);
$data['city'] = $request->input('city',null);
$data['district'] = $request->input('district',null);
$data['address'] = $request->input('address',null);
+ if($request->input('country',null)!==null){$data['country'] = $request->input('country');}
if($request->input('telphone',null)!==null){$data['telphone'] = $request->input('telphone');}
if($request->input('zipcode',null)!==null){$data['zipcode'] = $request->input('zipcode');}
- if($request->input('email',null)!==null){$data['email'] = $request->input('email');}
- if($request->input('best_time',null)!==null){$data['best_time'] = $request->input('best_time');}
if($request->input('is_default',null)!==null){$data['is_default'] = $request->input('is_default');}
- if($data['name']===null || $data['mobile']===null || $data['address']===null || $data['country']===null || $data['province']===null || $data['city']===null || $data['district']===null)
+ if($data['name']===null || $data['mobile']===null || $data['address']===null || $data['province']===null || $data['city']===null || $data['district']===null)
{
return ReturnData::create(ReturnData::PARAMS_ERROR);
}
@@ -130,7 +130,12 @@ class UserAddressController extends CommonController
public function userAddressDelete(Request $request)
{
//参数
- $id = $request->input('id',null);
+ $id = $request->input('id','');
+
+ if($id == '')
+ {
+ return ReturnData::create(ReturnData::PARAMS_ERROR);
+ }
$res = UserAddress::remove($id,Token::$uid);
if(!$res)
diff --git a/app/Http/Controllers/Weixin/AddressController.php b/app/Http/Controllers/Weixin/AddressController.php
new file mode 100644
index 0000000..6fc6184
--- /dev/null
+++ b/app/Http/Controllers/Weixin/AddressController.php
@@ -0,0 +1,87 @@
+ $pagesize,
+ 'offset' => $offset,
+ 'access_token' => $_SESSION['weixin_user_info']['access_token']
+ );
+ $url = env('APP_API_URL')."/user_address_list";
+ $res = curl_request($url,$postdata,'GET');
+ $data['list'] = $res['data']['list'];
+
+ $data['totalpage'] = ceil($res['data']['count']/$pagesize);
+ if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1)
+ {
+ $html = '';
+
+ if($res['data']['list'])
+ {
+ foreach($res['data']['list'] as $k => $v)
+ {
+ $html .= '
';
+
+ if($v['is_default']==1)
+ {
+ $html .= '
'.$v['mobile'].'默认
';
+ }
+ else
+ {
+ $html .= '
'.$v['mobile'].'
';
+ }
+
+ $html .= '
'.$v['province'].$v['city'].$v['district'].' '.$v['address'].'
';
+ $html .= '
';
+ $html .= '
';
+ }
+ }
+
+ exit(json_encode($html));
+ }
+
+ return view('weixin.address.index', $data);
+ }
+
+ //收货地址添加
+ public function userAddressAdd(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(
+ 'access_token' => $_SESSION['weixin_user_info']['access_token'],
+ 'limit' => 10,
+ 'offset' => 0
+ );
+ $url = env('APP_API_URL')."/user_address_list";
+ $goods_list = curl_request($url,$postdata,'GET');
+ $data['user_address_list'] = $goods_list['data']['list'];
+
+ return view('weixin.address.userAddressAdd', $data);
+ }
+}
\ No newline at end of file
diff --git a/app/Http/Controllers/Weixin/CollectGoodsController.php b/app/Http/Controllers/Weixin/CollectGoodsController.php
index 8858034..413fde2 100644
--- a/app/Http/Controllers/Weixin/CollectGoodsController.php
+++ b/app/Http/Controllers/Weixin/CollectGoodsController.php
@@ -11,27 +11,43 @@ class CollectGoodsController extends CommonController
parent::__construct();
}
- //商品列表
- public function goodslist(Request $request)
+ //商品收藏列表
+ public function index(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;}
+ $pagesize = 10;
+ $offset = 0;
+ if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;}
- //商品列表
$postdata = array(
- 'limit' => 10,
- 'offset' => 0
+ 'limit' => $pagesize,
+ 'offset' => $offset,
+ 'access_token' => $_SESSION['weixin_user_info']['access_token']
);
- $url = env('APP_API_URL')."/goods_list";
- $goods_list = curl_request($url,$postdata,'GET');
- $data['goods_list'] = $goods_list['data']['list'];
+ $url = env('APP_API_URL')."/collect_goods_list";
+ $res = curl_request($url,$postdata,'GET');
+ $data['list'] = $res['data']['list'];
- return view('weixin.goods.goodslist', $data);
+ $data['totalpage'] = ceil($res['data']['count']/$pagesize);
+
+ if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1)
+ {
+ $html = '';
+
+ if($res['data']['list'])
+ {
+ foreach($res['data']['list'] as $k => $v)
+ {
+ $html .= '';
+ $html .= ''.$v['goods']['title'].'
';
+ $html .= '
¥'.$v['goods']['price'].'
';
+ $html .= '
删除
';
+ $html .= '
';
+ }
+ }
+
+ exit(json_encode($html));
+ }
+
+ return view('weixin.collect_goods.index', $data);
}
}
\ No newline at end of file
diff --git a/app/Http/Controllers/Weixin/UserController.php b/app/Http/Controllers/Weixin/UserController.php
index 9dacf6f..1f3c36e 100644
--- a/app/Http/Controllers/Weixin/UserController.php
+++ b/app/Http/Controllers/Weixin/UserController.php
@@ -14,24 +14,16 @@ class UserController extends CommonController
//个人中心
public function index(Request $request)
- {$_SESSION['weixin_user_info']['access_token'] = '72d623d26a1a6d61186a97f9ccf752f7';
- 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;}
+ {
+ $_SESSION['weixin_user_info']['access_token'] = '72d623d26a1a6d61186a97f9ccf752f7';
- //商品列表
+ //获取会员信息
$postdata = array(
- 'limit' => 10,
- 'offset' => 0
+ 'access_token' => $_SESSION['weixin_user_info']['access_token']
);
- $url = env('APP_API_URL')."/goods_list";
- $goods_list = curl_request($url,$postdata,'GET');
- $data['goods_list'] = $goods_list['data']['list'];
+ $url = env('APP_API_URL')."/user_info";
+ $res = curl_request($url,$postdata,'GET');
+ $data['user_info'] = $res['data'];
return view('weixin.user.index', $data);
}
diff --git a/app/Http/Model/CollectGoods.php b/app/Http/Model/CollectGoods.php
index a21e862..caa909d 100644
--- a/app/Http/Model/CollectGoods.php
+++ b/app/Http/Model/CollectGoods.php
@@ -37,7 +37,17 @@ class CollectGoods extends BaseModel
if($res['count']>0)
{
- $res['list'] = $model->skip($offset)->take($limit)->orderBy('id','desc')->get()->toArray();
+ $res['list'] = $model->skip($offset)->take($limit)->orderBy('id','desc')->get();
+
+ if($res['list'])
+ {
+ foreach($res['list'] as $k=>$v)
+ {
+ $goods = Goods::getOne(array('id'=>$v['goods_id'],'field'=>array('id', 'typeid', 'tuijian', 'click', 'title', 'sn', 'price','litpic', 'pubdate', 'add_time', 'market_price', 'goods_number', 'sale', 'comments','promote_start_date','promote_price','promote_end_date','goods_img','spec','point')));
+
+ $res['list'][$k]['goods'] = $goods;
+ }
+ }
}
else
{
@@ -47,9 +57,13 @@ class CollectGoods extends BaseModel
return $res;
}
- public static function getOne($id)
+ public static function getOne(array $param)
{
- return self::where('id', $id)->first()->toArray();
+ extract($param); //参数
+
+ $where['id'] = $id;
+
+ return self::where($where)->first();
}
public static function add(array $data)
diff --git a/app/Http/Model/User.php b/app/Http/Model/User.php
index 210360b..9b29505 100644
--- a/app/Http/Model/User.php
+++ b/app/Http/Model/User.php
@@ -16,7 +16,7 @@ class User extends BaseModel
* @var array
*/
protected $guarded = [];
-
+ protected $hidden = ['password'];
/**
* 获取关联到用户的角色
*/
diff --git a/app/Http/Model/UserAddress.php b/app/Http/Model/UserAddress.php
index 84cba78..c998ab6 100644
--- a/app/Http/Model/UserAddress.php
+++ b/app/Http/Model/UserAddress.php
@@ -25,24 +25,24 @@ class UserAddress extends BaseModel
$limit = isset($limit) ? $limit : 10;
$offset = isset($offset) ? $offset : 0;
- $model = self::where('user_id', $user_id);
+ $model = self::where(array('user_id'=>$user_id));
$res['count'] = $model->count();
$res['list'] = array();
if($res['count']>0)
{
- $res['list'] = $model->skip($offset)->take($limit)->get()->toArray();
+ $res['list'] = $model->skip($offset)->take($limit)->get();
if($res['list'])
{
- foreach($res['list'] as $k=>$v)
+ /* foreach($res['list'] as $k=>$v)
{
$res['list'][$k]['country_name'] = Region::getRegionName($v['country']);
$res['list'][$k]['province_name'] = Region::getRegionName($v['province']);
$res['list'][$k]['city_name'] = Region::getRegionName($v['city']);
$res['list'][$k]['district_name'] = Region::getRegionName($v['district']);
- }
+ } */
}
}
else
@@ -62,13 +62,13 @@ class UserAddress extends BaseModel
{
$arr = self::where('id',$address_id)->first();
- if($arr)
+ /* if($arr)
{
$arr->country_name = Region::getRegionName($arr->country);
$arr->province_name = Region::getRegionName($arr->province);
$arr->city_name = Region::getRegionName($arr->city);
$arr->district_name = Region::getRegionName($arr->district);
- }
+ } */
return $arr;
}
@@ -77,16 +77,16 @@ class UserAddress extends BaseModel
{
// 取默认地址
$arr = self::join('user','user_address.id', '=', 'user.address_id')
- ->where('user.id',$user_id)->select('user_address.id','user_address.name','country','province','city','district','address','user_address.mobile','zipcode','best_time')
+ ->where('user.id',$user_id)->select('user_address.id','user_address.name','country','province','city','district','address','user_address.mobile','zipcode')
->first();
- if($arr)
+ /* if($arr)
{
$arr->country_name = Region::getRegionName($arr->country);
$arr->province_name = Region::getRegionName($arr->province);
$arr->city_name = Region::getRegionName($arr->city);
$arr->district_name = Region::getRegionName($arr->district);
- }
+ } */
}
return $arr;
@@ -97,20 +97,18 @@ class UserAddress extends BaseModel
extract($param);
$model = new UserAddress;
- $model->user_id = $user_id;
- $model->name = $name;
- $model->email = isset($email) ? $email : '';
- $model->country = isset($country) ? $country : 0;
- $model->province = isset($province) ? $province : 0;
- $model->city = isset($city) ? $city : 0;
- $model->district = isset($district) ? $district : 0;
- $model->address = $address;
- $model->mobile = isset($mobile) ? $mobile : '';
- $model->telphone = isset($telphone) ? $telphone : '';
- $model->zipcode = isset($zipcode) ? $zipcode : '';
- $model->sign_building = isset($sign_building) ? $sign_building : '';
- $model->best_time = isset($best_time) ? $best_time : '';
- $model->is_default = isset($is_default) ? $is_default : 0;
+ $model->user_id = $user_id;
+ $model->name = $name;
+ $model->address = $address;
+ $model->mobile = $mobile;
+ $model->is_default = isset($is_default) ? $is_default : 0;
+
+ if(isset($country)){$model->country = isset($country) ? $country : 0;}
+ if(isset($province)){$model->province = isset($province) ? $province : 0;}
+ if(isset($city)){$model->city = isset($city) ? $city : 0;}
+ if(isset($district)){$model->district = isset($district) ? $district : 0;}
+ if(isset($telphone)){$model->telphone = isset($telphone) ? $telphone : '';}
+ if(isset($zipcode)){$model->zipcode = isset($zipcode) ? $zipcode : '';}
if ($model->save())
{
@@ -118,7 +116,7 @@ class UserAddress extends BaseModel
if (!UserAddress::where('id', $user->address_id)->first() || $model->is_default!=0)
{
- self::setDefault($model->id);
+ self::setDefault($model->id,$user_id);
}
return $model->toArray();
@@ -134,25 +132,23 @@ class UserAddress extends BaseModel
if ($model = UserAddress::where('id', $id)->where('user_id', $user_id)->first())
{
$model->user_id = $user_id;
- $model->name = $name;
- $model->email = isset($email) ? $email : '';
- $model->country = isset($country) ? $country : 0;
- $model->province = isset($province) ? $province : 0;
- $model->city = isset($city) ? $city : 0;
- $model->district = isset($district) ? $district : 0;
- $model->address = $address;
- $model->mobile = isset($mobile) ? $mobile : '';
- $model->telphone = isset($telphone) ? $telphone : '';
- $model->zipcode = isset($zipcode) ? $zipcode : '';
- $model->sign_building = isset($sign_building) ? $sign_building : '';
- $model->best_time = isset($best_time) ? $best_time : '';
- $model->is_default = isset($is_default) ? $is_default : 0;
+ $model->is_default = isset($is_default) ? $is_default : 0;
+
+ if(isset($name)){$model->name = $country;}
+ if(isset($country)){$model->country = $country;}
+ if(isset($province)){$model->province = $province;}
+ if(isset($city)){$model->city = $city;}
+ if(isset($district)){$model->district = $district;}
+ if(isset($address)){$model->address = $address;}
+ if(isset($mobile)){$model->mobile = $mobile;}
+ if(isset($telphone)){$model->telphone = $telphone;}
+ if(isset($zipcode)){$model->zipcode = $zipcode;}
if ($model->save())
{
if ($model->is_default!=0)
{
- self::setDefault($model->id);
+ self::setDefault($model->id,$user_id);
}
return $model->toArray();
@@ -175,6 +171,8 @@ class UserAddress extends BaseModel
{
$user->address_id = $address->id;
$user->save();
+
+ self::where('id',$address->id)->update(array('is_default' => 1));
}
}
}
diff --git a/public/css/weixin/style.css b/public/css/weixin/style.css
index 44717b1..fd4f006 100644
--- a/public/css/weixin/style.css
+++ b/public/css/weixin/style.css
@@ -768,17 +768,15 @@ margin:5px 0
}
.setting .close a {
- display: block;
- background: #ec5151;
- text-align: center;
- width: 100%;
- height:40px;
- line-height:40px;
- color: #fff;
- font-size:18px;
- -moz-border-radius:5px;
- -webkit-border-radius:5px;
- border-radius:5px
+display: block;
+background: #ec5151;
+text-align: center;
+padding:10px;
+color: #fff;
+font-size:18px;
+-moz-border-radius:5px;
+-webkit-border-radius:5px;
+border-radius:5px
}
h1.arc_tit, h2.arc_tit{font-weight: normal;font-size: 1.4em;padding: 10px;}
diff --git a/public/images/weixin/user68.jpg b/public/images/weixin/no_user.jpg
similarity index 100%
rename from public/images/weixin/user68.jpg
rename to public/images/weixin/no_user.jpg
diff --git a/resources/views/weixin/address/index.blade.php b/resources/views/weixin/address/index.blade.php
new file mode 100644
index 0000000..32a9486
--- /dev/null
+++ b/resources/views/weixin/address/index.blade.php
@@ -0,0 +1,139 @@
+
+收货地址管理
+
+
+
+
+
+
+
+
+
+新增地址
+
+
+
+
+
+
+@include('weixin.common.footer')
+
\ No newline at end of file
diff --git a/resources/views/weixin/address/userAddressAdd.blade.php b/resources/views/weixin/address/userAddressAdd.blade.php
new file mode 100644
index 0000000..ad6bb0b
--- /dev/null
+++ b/resources/views/weixin/address/userAddressAdd.blade.php
@@ -0,0 +1,110 @@
+
+新增收货地址
+
+
+
+
+
+
+
+
+
+提交
+
+
+
\ No newline at end of file
diff --git a/resources/views/weixin/collect_goods/index.blade.php b/resources/views/weixin/collect_goods/index.blade.php
new file mode 100644
index 0000000..cbc3cc4
--- /dev/null
+++ b/resources/views/weixin/collect_goods/index.blade.php
@@ -0,0 +1,111 @@
+
+我的收藏
+
+
+
+
+
+
+
+
+ $v){ ?>
+ -
+
+
+
+
+
+
+@include('weixin.common.footer')
+
\ No newline at end of file
diff --git a/resources/views/weixin/user/index.blade.php b/resources/views/weixin/user/index.blade.php
index b0a0f48..1d6777c 100644
--- a/resources/views/weixin/user/index.blade.php
+++ b/resources/views/weixin/user/index.blade.php
@@ -7,11 +7,11 @@
-
+
- 15280719357
+
diff --git a/resources/views/weixin/user/userGoodsHistory.blade.php b/resources/views/weixin/user/userGoodsHistory.blade.php
index fe88526..9771de4 100644
--- a/resources/views/weixin/user/userGoodsHistory.blade.php
+++ b/resources/views/weixin/user/userGoodsHistory.blade.php
@@ -78,9 +78,8 @@ $(function(){
},'json');
}
}
- });
-
-})
+ });
+});
@include('weixin.common.footer')
diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php
deleted file mode 100644
index 541f457..0000000
--- a/resources/views/welcome.blade.php
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-Laravel
-
-
-
-
- @if (Route::has('login'))
-
- @endif
-
-
-
-
-
diff --git a/routes/web.php b/routes/web.php
index 5d00a8c..bd332c9 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -75,8 +75,10 @@ Route::group(['prefix' => 'weixin', 'namespace' => 'Weixin'], function () {
Route::get('/cart', 'CartController@index')->name('weixin_cart');
+ //收货地址
Route::get('/user_address', 'AddressController@index')->name('weixin_user_address_list');
-
+ Route::get('/user_address_add', 'AddressController@userAddressAdd')->name('weixin_user_address_add');
+ Route::get('/user_address_update', 'AddressController@userAddressUpdate')->name('weixin_user_address_update');
//页面跳转
Route::get('/jump', 'IndexController@jump')->name('weixin_jump');
@@ -84,6 +86,96 @@ Route::group(['prefix' => 'weixin', 'namespace' => 'Weixin'], function () {
});
+//无需token验证,全局
+Route::group(['middleware' => ['web']], function () {
+ Route::post('/dataapi/listarc', 'Api\IndexController@listarc')->name('api_listarc');
+ Route::post('/dataapi/customer_login', 'Api\WechatAuthController@customerLogin');
+ Route::post('/dataapi/', 'Api\UserController@signin'); //签到
+});
+
+//API接口路由,无需token验证
+Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web']], function () {
+ //轮播图
+ Route::get('/slide_list', 'SlideController@slideList');
+ //文章
+ Route::get('/article_list', 'ArticleController@articleList');
+ Route::get('/article_detail', 'ArticleController@articleDetail');
+ Route::get('/arctype_list', 'ArctypeController@arctypeList');
+ Route::get('/arctype_detail', 'ArctypeController@arctypeDetail');
+ //商品
+ Route::get('/goods_list', 'GoodsController@goodsList'); //商品列表
+ Route::get('/goodstype_list', 'GoodsTypeController@goodsTypeList'); //商品分类列表
+});
+
+//API接口路由,需token验证
+Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web','token']], function () {
+ //用户中心
+ Route::post('/user_signin', 'UserController@signin'); //签到
+ Route::get('/user_info', 'UserController@userInfo'); //用户详细信息
+ Route::post('/user_info_update', 'UserController@userInfoUpdate'); //修改用户信息
+ Route::get('/user_list', 'UserController@userList'); //用户列表
+
+ Route::get('/user_money_list', 'UserMoneyController@userMoneyList'); //用户余额明细
+ Route::post('/user_money_add', 'UserMoneyController@userMoneyAdd'); //添加余额明细
+ //浏览记录
+ Route::get('/user_goods_history_list', 'UserGoodsHistoryController@userGoodsHistoryList'); //我的足迹列表
+ Route::post('/user_goods_history_delete', 'UserGoodsHistoryController@userGoodsHistoryDelete'); //我的足迹删除一条
+ Route::post('/user_goods_history_clear', 'UserGoodsHistoryController@userGoodsHistoryClear'); //我的足迹清空
+
+ //商品评价
+ Route::get('/goods_comment_list', 'CommentController@goodsCommentList'); //商品评价列表
+ Route::post('/goods_comment_add', 'CommentController@goodsCommentAdd'); //商品评价添加
+ Route::post('/goods_comment_update', 'CommentController@goodsCommentUpdate'); //商品评价修改
+ Route::post('/goods_comment_delete', 'CommentController@goodsCommentDelete'); //商品评价删除
+ //商品收藏
+ Route::get('/collect_goods_list', 'CollectGoodsController@collectGoodsList'); //收藏商品列表
+ Route::post('/collect_goods_add', 'CollectGoodsController@collectGoodsAdd'); //收藏商品
+ Route::post('/collect_goods_delete', 'CollectGoodsController@collectGoodsDelete'); //取消收藏商品
+ //订单
+
+ //购物车
+ Route::get('/cart_list', 'CartController@cartList'); //购物车列表
+ Route::post('/cart_clear', 'CartController@cartClear'); //清空购物车
+ Route::post('/cart_add', 'CartController@cartAdd'); //添加购物车
+ Route::post('/cart_update', 'CartController@cartUpdate'); //修改购物车
+ //分销
+
+ //积分
+ Route::get('/user_point_list', 'UserPointController@userPointList'); //用户积分列表
+ Route::post('/user_point_add', 'UserPointController@userPointAdd');
+ //优惠券
+ Route::get('/user_bonus_list', 'BonusController@userBonusList'); //用户优惠券列表
+ Route::post('/user_get_bonus', 'BonusController@userGetBonus'); //用户获取优惠券
+ Route::get('/bonus_list', 'BonusController@bonusList'); //可用获取的优惠券列表
+ Route::post('/bonus_add', 'BonusController@bonusAdd'); //添加优惠券
+ Route::post('/bonus_update', 'BonusController@bonusUpdate'); //修改优惠券
+ Route::post('/bonus_delete', 'BonusController@bonusDelete'); //删除优惠券
+ //微信
+
+ //意见反馈
+ Route::get('/feedback_list', 'FeedBackController@feedbackList');
+ Route::post('/feedback_add', 'FeedBackController@feedbackAdd');
+
+ //其它
+ Route::get('/verifycode_check', 'VerifyCodeController@check'); //验证码校验
+ Route::get('/andriod_upgrade', 'IndexController@andriodUpgrade'); //安卓升级
+ //图片上传
+ Route::post('/image_upload', 'ImageController@imageUpload'); //普通文件/图片上传
+ //二维码
+ Route::get('/create_simple_qrcode', 'QrcodeController@createSimpleQrcode');
+ //收货地址
+ Route::get('/user_address_list', 'UserAddressController@userAddressList');
+ Route::get('/user_address_detail', 'UserAddressController@userAddressDetail');
+ Route::post('/user_address_setdefault', 'UserAddressController@userAddressSetDefault');
+ Route::post('/user_address_add', 'UserAddressController@userAddressAdd');
+ Route::post('/user_address_update', 'UserAddressController@userAddressUpdate');
+ Route::post('/user_address_delete', 'UserAddressController@userAddressDelete');
+ //地区,省市区
+ Route::get('/region_list', 'RegionController@regionList');
+ Route::get('/region_detail', 'RegionController@regionDetail');
+});
+
+
//后台路由
Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['web']], function () {
Route::get('/', 'IndexController@index')->name('admin');
@@ -207,100 +299,4 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w
Route::get('/jump', 'LoginController@jump')->name('admin_jump');
//测试
Route::get('/test', 'LoginController@test')->name('admin_test');
-});
-
-//无需token验证,全局
-Route::group(['middleware' => ['web']], function () {
- Route::post('/dataapi/listarc', 'Api\IndexController@listarc')->name('api_listarc');
- Route::post('/dataapi/customer_login', 'Api\WechatAuthController@customerLogin');
- Route::post('/dataapi/', 'Api\UserController@signin'); //签到
-});
-
-//API接口路由,无需token验证
-Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web']], function () {
- //轮播图
- Route::get('/slide_list', 'SlideController@slideList');
- //文章
- Route::get('/article_list', 'ArticleController@articleList');
- Route::get('/article_detail', 'ArticleController@articleDetail');
- Route::get('/arctype_list', 'ArctypeController@arctypeList');
- Route::get('/arctype_detail', 'ArctypeController@arctypeDetail');
- //商品
- Route::get('/goods_list', 'GoodsController@goodsList'); //商品列表
- Route::get('/goodstype_list', 'GoodsTypeController@goodsTypeList'); //商品分类列表
-});
-
-//API接口路由,需token验证
-Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web','token']], function () {
- //用户中心
- Route::post('/user_signin', 'UserController@signin'); //签到
- Route::get('/user_info', 'UserController@userInfo'); //用户详细信息
- Route::post('/user_info_update', 'UserController@userInfoUpdate'); //修改用户信息
- Route::get('/user_list', 'UserController@userList'); //用户列表
-
- Route::get('/user_money_list', 'UserMoneyController@userMoneyList'); //用户余额明细
- Route::post('/user_money_add', 'UserMoneyController@userMoneyAdd'); //添加余额明细
- //浏览记录
- Route::get('/user_goods_history_list', 'UserGoodsHistoryController@userGoodsHistoryList'); //我的足迹列表
- Route::post('/user_goods_history_delete', 'UserGoodsHistoryController@userGoodsHistoryDelete'); //我的足迹删除一条
- Route::post('/user_goods_history_clear', 'UserGoodsHistoryController@userGoodsHistoryClear'); //我的足迹清空
-
- //商品评价
- Route::get('/goods_comment_list', 'CommentController@goodsCommentList'); //商品评价列表
- Route::post('/goods_comment_add', 'CommentController@goodsCommentAdd'); //商品评价添加
- Route::post('/goods_comment_update', 'CommentController@goodsCommentUpdate'); //商品评价修改
- Route::post('/goods_comment_delete', 'CommentController@goodsCommentDelete'); //商品评价删除
- //商品收藏
- Route::get('/collect_goods_list', 'CollectGoodsController@collectGoodsList'); //收藏商品列表
- Route::post('/collect_goods_add', 'CollectGoodsController@collectGoodsAdd'); //收藏商品
- Route::post('/collect_goods_delete', 'CollectGoodsController@collectGoodsDelete'); //取消收藏商品
- //订单
-
- //购物车
- Route::get('/cart_list', 'CartController@cartList'); //购物车列表
- Route::post('/cart_clear', 'CartController@cartClear'); //清空购物车
- Route::post('/cart_add', 'CartController@cartAdd'); //添加购物车
- Route::post('/cart_update', 'CartController@cartUpdate'); //修改购物车
- //分销
-
- //积分
- Route::get('/user_point_list', 'UserPointController@userPointList'); //用户积分列表
- Route::post('/user_point_add', 'UserPointController@userPointAdd');
- //优惠券
- Route::get('/user_bonus_list', 'BonusController@userBonusList'); //用户优惠券列表
- Route::post('/user_get_bonus', 'BonusController@userGetBonus'); //用户获取优惠券
- Route::get('/bonus_list', 'BonusController@bonusList'); //可用获取的优惠券列表
- Route::post('/bonus_add', 'BonusController@bonusAdd'); //添加优惠券
- Route::post('/bonus_update', 'BonusController@bonusUpdate'); //修改优惠券
- Route::post('/bonus_delete', 'BonusController@bonusDelete'); //删除优惠券
- //微信
-
- //意见反馈
- Route::get('/feedback_list', 'FeedBackController@feedbackList');
- Route::post('/feedback_add', 'FeedBackController@feedbackAdd');
-
- //其它
- Route::get('/verifycode_check', 'VerifyCodeController@check'); //验证码校验
- Route::get('/andriod_upgrade', 'IndexController@andriodUpgrade'); //安卓升级
- //图片上传
- Route::post('/image_upload', 'ImageController@imageUpload'); //普通文件/图片上传
- //二维码
- Route::get('/create_simple_qrcode', 'QrcodeController@createSimpleQrcode');
- //收货地址
- Route::get('/user_address_list', 'UserAddressController@userAddressList');
- Route::get('/user_address_detail', 'UserAddressController@userAddressDetail');
- Route::post('/user_address_setdefault', 'UserAddressController@userAddressSetDefault');
- Route::post('/user_address_add', 'UserAddressController@userAddressAdd');
- Route::post('/user_address_update', 'UserAddressController@userAddressUpdate');
- Route::post('/user_address_delete', 'UserAddressController@userAddressDelete');
- //地区,省市区
- Route::get('/region_list', 'RegionController@regionList');
- Route::get('/region_detail', 'RegionController@regionDetail');
-});
-
-
-
-
-
-
-
+});
\ No newline at end of file