<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
  return view('welcome');
});

include_once public_path('../routes/web-zhao.php');

//微信登录授权获取code
Route::get('/wxLogin/{env}', function ($env) {
  $redirectUrl = urlencode(config('app.globals.WxRedirectUrl'));
  $url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" . config('app.globals.WxAppid') . "&redirect_uri=" . $redirectUrl . "&response_type=code&scope=snsapi_base&state=" . $env . "#wechat_redirect";
  return redirect($url);
});
//微信登录授权获取openid
Route::get('/wxGetCode', 'App\Http\Controllers\API\mH5\LoginController@wxGetCode');
Route::get('/test', 'App\Http\Controllers\TestController@DBtest');

Route::any('/payNotify', 'App\Http\Controllers\API\H5\PayController@Notify')->middleware('log');//支付回调
Route::group(['prefix' => 'H5'], function () {
  Route::post('/CheckUpTypeGetList', 'App\Http\Controllers\API\H5\CheckUpTypeController@GetList');//获取体检类型分类
  Route::post('/GetComboSort', 'App\Http\Controllers\API\H5\ComboController@GetComboSort');//  //获取套餐类型、适用人群
  Route::post('/ComboCompare', 'App\Http\Controllers\API\H5\ComboController@ComboCompare');//  //套餐对比
  Route::post('/BuyInfo', 'App\Http\Controllers\API\H5\ComboController@BuyInfo');//获取购买详情内容（详情页信息）
  Route::post('/GetAllItems', 'App\Http\Controllers\API\H5\ItemController@GetItems');//获取所有自选项目
  Route::post('/GetReadme', 'App\Http\Controllers\API\H5\HospitalExtraController@GetReadme');//获取注意事项
  Route::post('/GetMonthPlanCount', 'App\Http\Controllers\API\H5\PlanController@GetMonthPlanCount');//获取本月每日剩余号源数量
  Route::post('/GetDayPlanList', 'App\Http\Controllers\API\H5\PlanController@GetDayPlanList');//获取某日号源数量
  Route::post('/OrderCreate', 'App\Http\Controllers\API\H5\OrderController@Create');//创建订单
  Route::post('/GetPersonList', 'App\Http\Controllers\API\H5\UserController@GetPersonList');//获取名下全部体检人
  Route::post('/SetDefaultPerson', 'App\Http\Controllers\API\H5\UserController@SetDefaultPerson');//设置默认体检人
  Route::post('/HospitalIntroduction', 'App\Http\Controllers\API\H5\HospitalExtraController@Introduction');//医院简介
  Route::post('/QuestionGetList', 'App\Http\Controllers\API\H5\QuestionController@GetList');//问题列表
  Route::post('/QuestionSubmitAnswer', 'App\Http\Controllers\API\H5\QuestionController@SubmitAnswer');//提交问题
  Route::post('/ArticleGetList', 'App\Http\Controllers\API\H5\ArticleController@GetList');//文章列表
  Route::post('/ArticleGetDetail', 'App\Http\Controllers\API\H5\ArticleController@GetDetail');//文章详情
  Route::post('/GetPersonInfo', 'App\Http\Controllers\API\H5\UserController@GetPersonInfo');//获取体检人基本信息
});


