小程序预约自动选择当日,不可手动选择日期

main
yanzai 2 years ago
parent 77177ceb1f
commit 90d955278b

@ -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')

@ -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,

@ -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) {

@ -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',

@ -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']);//选择当日

@ -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_;

@ -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

@ -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))
})
</script>
<template>
<view >
<view>
<view class="top_line_wrapper" :class="SysGreyType==1? 'grey' :''"></view>
<view v-if="!!buy_info" >
<view v-if="!!buy_info">
<view v-if="!!buy_info.combo" class="combo_info_wrapper" :class="SysGreyType==1? 'grey' :''">
<view class="combo_info_name_wrapper">{{ buy_info.combo.name }}</view>
<view class="combo_info_tag_wrapper">
<view class="combo_tag_sex_wrapper combo_tag_sex_all_wrapper" v-if="buy_info.combo.sex==='全部'"></view>
<view class="combo_tag_sex_wrapper combo_tag_sex_nan_wrapper" v-if="buy_info.combo.sex==='男'"></view>
<view class="combo_tag_sex_wrapper combo_tag_sex_nv_wrapper" v-if="buy_info.combo.sex==='女'"></view>
<view class="combo_tag_sex_wrapper combo_tag_sex_all_wrapper" v-if="buy_info.combo.sex==='全部'">
</view>
<view class="combo_tag_sex_wrapper combo_tag_sex_nan_wrapper" v-if="buy_info.combo.sex==='男'">
</view>
<view class="combo_tag_sex_wrapper combo_tag_sex_nv_wrapper" v-if="buy_info.combo.sex==='女'">
</view>
</view>
</view>
<view class="person_info_wrapper" :class="SysGreyType==1? 'grey' :''">
@ -134,7 +180,8 @@
<view v-if="$store.buy_info.person.length > 0">
<view class="person_info_name_wrapper">{{ $store.buy_info.person[0].name }}</view>
<view class="person_info_info_wrapper">
<view class="person_info_sex_wrapper">{{ Number($store.buy_info.person[0].sex) === 1 ? '男' : '女' }}</view>
<view class="person_info_sex_wrapper">
{{ Number($store.buy_info.person[0].sex) === 1 ? '男' : '女' }}</view>
<view class="person_info_marriage_wrapper">
{{ Number($store.buy_info.person[0].marriage) === 1 ? '已婚' : '未婚' }}
</view>
@ -152,10 +199,10 @@
<input type="text" v-model="referral" placeholder="请输入">
</view>
</view>
<view @click="chooseTimeClick()" class="time_wrapper">
<view class="time_wrapper">
<view class="time_title_wrapper">体检时间</view>
<view class="time_content_wrapper">
{{ buy_info.time.id !== 0 ? buy_info.time.show : '请选择体检时间'}}
{{ buy_info.time.id !== 0 ? buy_info.time.show : '今日已无可用名额'}}
</view>
</view>
<view class="tip_wrapper" :class="SysGreyType==1? 'grey' :''">
@ -400,7 +447,8 @@
color: #EF7389;
border-color: #EF7389;
}
.grey{
filter: grayscale(100%);
}
.grey {
filter: grayscale(100%);
}
</style>

@ -74,6 +74,10 @@
return
}
if (tab_active.value !== 1 && next_text.value !== '下一步' && !auto) return
if (time_end==true) {
toNext()
return false;
}
if (readme_config.value.time <= 0) {
next_text.value = '下一步'
@ -100,6 +104,7 @@
clearInterval(tt1);
console.log('setInterval 已清除');
next_text.value = '下一步'
readme_config.value.time=5
time_end=true
}, 5000);
}
@ -119,7 +124,7 @@
const tabChange = (type) => {
tab_active.value = type
if (type === 1) nextClick(false)
//if (type === 1) nextClick(false)
if (type === 0) next_text.value = '下一步'
}
//

@ -28,8 +28,12 @@
}
});
onShow(() => {
GetGreySet();
UserPersonList();
uni.$lu.hospital((info) => {
hospital.value=info
})
})
//
const SysGreyType=ref(0)
@ -45,27 +49,26 @@
});
}
const user_person_list = ref([])
const UserPersonList = async () => {
const response = await UserPersonListAction()
$response(response, () => {
user_person_list.value = response.data.list
})
}
let hospital=ref('')
const ChaXunFenZhenInfo= async(info)=>{
uni.showLoading({
title: '加载中'
});
const response = await FenzhenChaXunAction( {sfz:info.id_number})
const response = await FenzhenChaXunAction( {person_id:info.id,hospital:hospital.value.id})
$response(response, () => {
uni.hideLoading();
if(response.data.list !=undefined && response.data.list.length>0){
uni.navigateTo({
url: '/pages/order/fenzhen/fenzhen_info?sfz='+info.id_number
url: '/pages/order/fenzhen/fenzhen_info?personid='+info.id+'&hospital='+hospital.value.id
})
}else{
uni.showToast({

@ -2,13 +2,13 @@
<view class="fenzhen_info">
<view class="header">
<view class="name">{{userInfo.name}} <span style="font-size: 30rpx;"> {{userInfo.sex}} | {{userInfo.age}}</span></view>
<view class="riqi">体检套餐{{userInfo.comboName}}</view>
<view class="riqi">体检日期{{userInfo.appointment_date}}</view>
<!-- <view class="riqi">体检套餐{{userInfo.comboName}}</view>
<view class="riqi">体检日期{{userInfo.appointment_date}}</view> -->
</view>
<view class="tiaoma" >
<view class="tiaoma2" v-html="userInfo.tiaoma">
</view>
<view >
<view style="" >
{{userInfo.tiaoma_num}}
</view>
</view>
@ -70,16 +70,18 @@
} from '@/api'
let sfz=ref('');
let personid=ref('');
let userInfo=ref('');
let fenzhen_list=ref([]);
let wancheng_count=ref(0);
let keshi_ids=ref([])
let hospital=ref('')
const ChaXunFenZhenInfo= async(info)=>{
uni.showLoading({
title: '加载中'
});
const response = await FenzhenChaXunAction( {sfz:sfz.value})
const response = await FenzhenChaXunAction( {person_id:personid.value,hospital:hospital.value})
$response(response, () => {
uni.hideLoading();
userInfo.value=response.data.user_info
@ -99,10 +101,12 @@
}
onMounted(()=>{
})
onLoad((option)=>{
sfz.value=option.sfz
personid.value=option.personid
hospital.value=option.hospital
console.log(option)
ChaXunFenZhenInfo()

Loading…
Cancel
Save