diff --git a/app/Http/Controllers/AppointmentController.php b/app/Http/Controllers/AppointmentController.php index 3586695..dc47897 100644 --- a/app/Http/Controllers/AppointmentController.php +++ b/app/Http/Controllers/AppointmentController.php @@ -248,14 +248,35 @@ class AppointmentController extends Controller $appointments = $query->where('del', 2)->orderBy('date', 'desc')->paginate(20); return Yo::echo($appointments); } +//自动选择当日 + public function SelectToday(Request $request) + { + Login::user(); + $hospital = $request->post('hospital'); + $date = date('Y-m-d'); + $nowtime= date("H:i:s"); + //var_dump($nowtime); + $appointments = Appointment::where('hospital', $hospital) + ->where('date', $date) + ->where('status', 1) + ->where('del', 2) + ->where('stop_time','>',$nowtime) + ->first(); + + return Yo::echo([ + 'time' => $appointments, + ]); + + } public function mp_list(Request $request) { Login::user(); $month = $request->post('month'); $hospital = $request->post('hospital'); $appointments = Appointment::where('hospital', $hospital) - ->where('date', 'like', $month . '%') + // ->where('date', 'like', $month . '%') + ->where('date', date('Y-m-d')) ->where('status', 1) ->where('del', 2) ->orderBy('date') diff --git a/app/Http/Controllers/FenZhenController.php b/app/Http/Controllers/FenZhenController.php index e38b4e4..a6f8f34 100644 --- a/app/Http/Controllers/FenZhenController.php +++ b/app/Http/Controllers/FenZhenController.php @@ -79,21 +79,18 @@ class FenZhenController extends Controller //查询分诊那边的记录 public function FenZhenChaXun(Request $request){ + // Login::user(); + $personid = $request->post('person_id'); + $hospital = $request->post('hospital'); + $person_info= DB::table('user_people')->where('id', $personid)->first(); - Login::user(); - $sfz = $request->post('sfz'); - $order_info= DB::table('user_orders')->where(['user'=>Login::$info->id,'id_number'=>$sfz]) - ->whereNotNull('fenzhen_create_ids') - ->where('fenzhen_create_ids', '!=', '') - ->orderBy('id','desc')->first(); - - if(!!$order_info){ - $hospitalInfo=DB::table('hospitals')->where('id', $order_info->hospital)->first(); + if(!!$hospital){ + $hospitalInfo=DB::table('hospitals')->where('id',$hospital)->first(); $url = $hospitalInfo->fenzhen_base_url.'/in/get_list.php'; //用户信息 - $buy_info=json_decode($order_info->buy_info, true); - $sex=$order_info->sex; - $birthday = new DateTime($order_info->birthday); + // $buy_info=json_decode($order_info->buy_info, true); + $sex=$person_info->sex; + $birthday = new DateTime($person_info->birthday); // 今天的日期 $today = new DateTime(); // 计算年龄差 @@ -101,10 +98,10 @@ class FenZhenController extends Controller - $create_ids=json_decode($order_info->fenzhen_create_ids, true); - $group_id= min($create_ids); + // $create_ids=json_decode($order_info->fenzhen_create_ids, true); + // $group_id= min($create_ids); $array = array( - "group_id" => $group_id, + "id_number" => $person_info->id_number, ); $res = self::post($url,$array,'Bearer password.123456'); $res=json_decode($res,true); @@ -112,12 +109,12 @@ class FenZhenController extends Controller if($res['code']===200){ $reg_num= isset($res['data']['list'][0]['reg_number'])?$res['data']['list'][0]['reg_number']:'0'; $generator = new \Picqer\Barcode\BarcodeGeneratorHTML(); - $a= $generator->getBarcode($reg_num, $generator::TYPE_CODE_128, 3, 50); + $a= $generator->getBarcode($reg_num, $generator::TYPE_CODE_128, 2, 50); $user_info=[ - "name" => $order_info->name, + "name" => $person_info->name, "sex" => $sex==1?'男':'女', "comboName" =>isset($buy_info['combo']['name'])? $buy_info['combo']['name']:'' , - "appointment_date" => substr($order_info->appointment_time, 0, 10), + // "appointment_date" => substr($order_info->appointment_time, 0, 10), "age"=>$diff->y, 'tiaoma'=>$a, 'tiaoma_num'=>$reg_num, diff --git a/app/Http/Controllers/UserOrderController.php b/app/Http/Controllers/UserOrderController.php index f7cc9fa..bbf54c9 100644 --- a/app/Http/Controllers/UserOrderController.php +++ b/app/Http/Controllers/UserOrderController.php @@ -40,8 +40,8 @@ class UserOrderController extends Controller $user_order->save(); //通知分诊登记 - $fenzhen= new FenZhenController(); - $fenzhen->FenZhenDengJI($user_order->id); + // $fenzhen= new FenZhenController(); + // $fenzhen->FenZhenDengJI($user_order->id); $hospital_sharing_content = self::sharing_config($user_order->hospital, false); if ($hospital_sharing_content['open'] == 1) { diff --git a/public/admin/index.html b/public/admin/index.html index bcf7303..3b6b047 100644 --- a/public/admin/index.html +++ b/public/admin/index.html @@ -21,10 +21,10 @@ // env = 'online' // env = 'dev' const api_url = { - main: 'https://bjgk-api.sixinyun.com' + main: 'http://beijingguokang' } if (env === 'dev') { - api_url.main = 'http://localhostlanketijian' + api_url.main = 'http://beijingguokang' } const config_data = { token_key: 'TOKEN', diff --git a/routes/web.php b/routes/web.php index da89b9c..8fb5aec 100644 --- a/routes/web.php +++ b/routes/web.php @@ -174,3 +174,4 @@ Route::post("api/$admin_api/Chat/adminInsertMsg", [\App\Http\Controllers\ChatCon Route::post("api/$admin_api/Chat/changeWorkOrder", [\App\Http\Controllers\ChatController::class, 'changeWorkOrder']); Route::post("api/$mp_api/Fenzhen/Dengji", [\App\Http\Controllers\FenZhenController::class, 'FenZhenDengJI']); Route::any("api/$mp_api/Fenzhen/ChaXun", [\App\Http\Controllers\FenZhenController::class, 'FenZhenChaXun']); +Route::any("api/$mp_api/Appointment/SelectToday", [\App\Http\Controllers\AppointmentController::class, 'SelectToday']);//选择当日 diff --git a/北京国康小程序/api/api.js b/北京国康小程序/api/api.js index 8f8171e..41cb667 100644 --- a/北京国康小程序/api/api.js +++ b/北京国康小程序/api/api.js @@ -2,7 +2,7 @@ let url_ = "https://bjgk-api.sixinyun.com"; let report_url_ = "https://bjgk-api.sixinyun.com"; //let report_url_ = "http://192.168.31.106:5173"; let h5_url_ = "https://bjgk-api.sixinyun.com"; -const dev =1; +const dev =0; if (dev === 1) { url_ = "http://beijingguokang"; report_url_ = "http://192.168.31.106:5173"; @@ -41,6 +41,7 @@ url_array['Hospital/info'] = `${url_}/api/Mp/Hospital/info`; url_array['Carousel/list'] = `${url_}/api/Mp/Carousel/list`; url_array['Config/get'] = `${url_}/api/Mp/Config/get`; url_array['Fenzhen/chaxun'] = `${url_}/api/Mp/Fenzhen/ChaXun`; +url_array['Appointment/SelectToday'] = `${url_}/api/Mp/Appointment/SelectToday`; url_array['YO'] = `${url_}/api/yo`; const api = (mark) => { if (mark === '') return url_; diff --git a/北京国康小程序/api/index.js b/北京国康小程序/api/index.js index d95ff82..3e1ab8c 100644 --- a/北京国康小程序/api/index.js +++ b/北京国康小程序/api/index.js @@ -4,7 +4,7 @@ import { import $api from './api.js' let url_ = "https://bjgk-api.sixinyun.com"; let chat_url = "https://bjgk-api.sixinyun.com" -const dev = 1 +const dev = 0 if (dev === 1) { url_ = "http://beijingguokang" chat_url = "http://192.168.31.106:5173" @@ -129,6 +129,10 @@ export const FenzhenChaXunAction = async (data) => await $post({ url: 'Fenzhen/chaxun', data }) +export const AppointmentSelectToday = async (data) => await $post({ + url: 'Appointment/SelectToday', + data +}) export const yo = async (data) => await $post({ url: 'YO', data diff --git a/北京国康小程序/pages/buy/check/check.vue b/北京国康小程序/pages/buy/check/check.vue index 2531a8d..46a7d1e 100644 --- a/北京国康小程序/pages/buy/check/check.vue +++ b/北京国康小程序/pages/buy/check/check.vue @@ -11,6 +11,7 @@ OrderCreateAction, OrderPayAction, BuyInfoAction, + AppointmentSelectToday, $image, $response } from '@/api' @@ -23,11 +24,15 @@ const $store = useStore() const buy_info = ref(false) const BuyInfo = async () => { + uni.showLoading({ + title: '加载中' + }); const response = await BuyInfoAction($store.buy_info) $response(response, () => { buy_info.value = response.data $store.buy_info.time = buy_info.value.time }) + uni.hideLoading(); } const user_info = ref(false) @@ -36,6 +41,7 @@ user_info.value = info if (!!user_info.value.id) BuyInfo() }) + } const nextClick = () => { @@ -85,6 +91,7 @@ } const OrderCreate = async () => { pay_action.value = true + const response = await OrderCreateAction({ ...$store.buy_info, referral: referral.value @@ -98,34 +105,73 @@ const referral = ref('') const pay_action = ref(false) //设置灰度 - const SysGreyType=ref(0) - const GetGreySet=()=>{ - uni.getStorage({ - key: 'SysGreytype', - success: function (res) { - console.log(res.data); - if(res.data==1){ - SysGreyType.value=1 - } + const SysGreyType = ref(0) + const GetGreySet = () => { + uni.getStorage({ + key: 'SysGreytype', + success: function(res) { + // console.log(res.data); + if (res.data == 1) { + SysGreyType.value = 1 } - }); - } + } + }); + } + let hospital = ref(''); + const autoSelectTime = async () => { //自动选择日期 + uni.showLoading({ + title: '加载中' + }); + const response = await AppointmentSelectToday({ + hospital: hospital.value.id + }) + $response(response, () => { + uni.hideLoading(); + if(response.data.time !==null){ + $store.buy_info.time={ + date:response.data.time.date, + id:response.data.time.id, + + } + buy_info.value={time:''} + buy_info.value.time= $store.buy_info.time + console.log('-------', buy_info.value) + + }else{ + uni.showToast({ + title: "今日已无可预约名额", + icon:'none' + }) + } + getUserInfo() + }) + } + onShow(() => { + uni.$lu.hospital((info) => { + hospital.value = info + autoSelectTime() + }) + GetGreySet() - getUserInfo() + console.log(JSON.stringify($store.buy_info)) + })