diff --git a/app/Http/Controllers/Api/UserAddressController.php b/app/Http/Controllers/Api/UserAddressController.php index df07d4c..9459a93 100644 --- a/app/Http/Controllers/Api/UserAddressController.php +++ b/app/Http/Controllers/Api/UserAddressController.php @@ -101,18 +101,14 @@ class UserAddressController extends CommonController $data['id'] = $request->input('id',null); $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('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('country',null)!==null){$data['country'] = $request->input('country');} if($request->input('is_default',null)!==null){$data['is_default'] = $request->input('is_default');} - if($data['id']===null || $data['name']===null || $data['mobile']===null || $data['address']===null || $data['country']===null || $data['province']===null || $data['city']===null || $data['district']===null) + if($data['id']===null || $data['name']===null || $data['mobile']===null || $data['address']===null || $data['province']===null || $data['city']===null || $data['district']===null) { return ReturnData::create(ReturnData::PARAMS_ERROR); } diff --git a/app/Http/Controllers/Weixin/GoodsController.php b/app/Http/Controllers/Weixin/GoodsController.php index 89d8762..a4ca78a 100644 --- a/app/Http/Controllers/Weixin/GoodsController.php +++ b/app/Http/Controllers/Weixin/GoodsController.php @@ -11,8 +11,32 @@ class GoodsController extends CommonController parent::__construct(); } + //商品详情 + public function goodsDetail(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.goodsDetail', $data); + } + //商品列表 - public function goodslist(Request $request) + public function goodsList(Request $request) { if($request->input('typeid', '') != ''){$data['typeid'] = $request->input('typeid');} if($request->input('tuijian', '') != ''){$data['tuijian'] = $request->input('tuijian');} @@ -32,6 +56,6 @@ class GoodsController extends CommonController $goods_list = curl_request($url,$postdata,'GET'); $data['goods_list'] = $goods_list['data']['list']; - return view('weixin.goods.goodslist', $data); + return view('weixin.goods.goodsList', $data); } } \ No newline at end of file diff --git a/app/Http/Model/UserAddress.php b/app/Http/Model/UserAddress.php index 9263302..ee3effd 100644 --- a/app/Http/Model/UserAddress.php +++ b/app/Http/Model/UserAddress.php @@ -134,7 +134,7 @@ class UserAddress extends BaseModel $model->user_id = $user_id; $model->is_default = isset($is_default) ? $is_default : 0; - if(isset($name)){$model->name = $country;} + if(isset($name)){$model->name = $name;} if(isset($country)){$model->country = $country;} if(isset($province)){$model->province = $province;} if(isset($city)){$model->city = $city;} diff --git a/resources/views/weixin/address/userAddressUpdate.blade.php b/resources/views/weixin/address/userAddressUpdate.blade.php index 986f8da..b73f5ae 100644 --- a/resources/views/weixin/address/userAddressUpdate.blade.php +++ b/resources/views/weixin/address/userAddressUpdate.blade.php @@ -26,6 +26,7 @@ .adr-form-group select{padding:5px;margin-right:10px;} .bottoma{display:block;font-size:18px;padding:10px;color:white;background-color: #f23030;text-align:center;} +
@@ -178,7 +179,8 @@ function adr_dosubmit() { var access_token = ''; - var url = ''; + var url = ''; + var id = $("#id").val(); var name = $("#name").val(); var mobile = $("#mobile").val(); var address = $("#address").val(); @@ -238,7 +240,7 @@ function adr_dosubmit() return false; } - $.post(url,{access_token:access_token,name:name,mobile:mobile,address:address,province:province,city:city,district:district,is_default:is_default},function(res) + $.post(url,{access_token:access_token,id:id,name:name,mobile:mobile,address:address,province:province,city:city,district:district,is_default:is_default},function(res) { if(res.code==0) { diff --git a/resources/views/weixin/goods/goods.blade.php b/resources/views/weixin/goods/goodsDetail.blade.php similarity index 100% rename from resources/views/weixin/goods/goods.blade.php rename to resources/views/weixin/goods/goodsDetail.blade.php diff --git a/resources/views/weixin/user/userinfo.blade.php b/resources/views/weixin/user/userinfo.blade.php index 84ef829..b0ddb73 100644 --- a/resources/views/weixin/user/userinfo.blade.php +++ b/resources/views/weixin/user/userinfo.blade.php @@ -47,8 +47,6 @@ function update_avator() } $(function(){ - - $("#fileupload").change(function(){ $("#head_img").ajaxSubmit({ dataType: 'json', diff --git a/routes/web.php b/routes/web.php index 767d642..0201621 100644 --- a/routes/web.php +++ b/routes/web.php @@ -61,8 +61,8 @@ Route::group(['prefix' => 'weixin', 'namespace' => 'Weixin'], function () { Route::get('/cat{cat}', 'ArticleController@category')->name('weixin_article_category'); //分类页 Route::get('/tag{tag}', 'IndexController@tag')->name('weixin_tag'); //标签页 Route::get('/page/{id}', 'IndexController@page')->name('weixin_singlepage'); //单页 - Route::get('/goods/{id}', 'GoodsController@goods')->name('weixin_goods_detail'); //商品详情页 - Route::get('/goodslist', 'GoodsController@goodslist')->name('weixin_goods_list'); //产品分类页 + Route::get('/goods/{id}', 'GoodsController@goodsDetail')->name('weixin_goods_detail'); //商品详情页 + Route::get('/goodslist', 'GoodsController@goodsList')->name('weixin_goods_list'); //产品分类页 Route::any('/login', 'UserController@login')->name('weixin_login'); Route::any('/register', 'UserController@register')->name('weixin_register');