调整医生预约(差调样式)

main
yanzai 1 year ago
parent aeefb560ac
commit 2f2a1104f3

@ -13,22 +13,51 @@ class DoctorController extends Controller
{ {
$date = request('date'); $date = request('date');
$hospital = request('hospital'); $hospital = request('hospital');
$month = request('month');
$doctor_id = request('doctor_id');
$hospital_map = [ $hospital_map = [
'h1' => '6', 'h1' => '6',
'h4' => '2', 'h4' => '2',
]; ];
$datesArray = [];
if (isset($date)) {
$datesArray[] = $date;
}
if (isset($month) and $month == 'all') {
// 循环30次每次获取一天后的日期
for ($i = 0; $i < 31; $i++) {
// 使用strtotime函数计算$i天后的日期然后用date函数格式化日期
$datesArray[] = date('Y-m-d', strtotime("+$i days"));
}
}
if (isset($month) and (strlen($month) == 7 or strlen($month) == 6)) {
$firstDay = strtotime($month . '-01');
// 获取该月的最后一天
$lastDay = strtotime('+1 month', $firstDay) - 86400; // 减去一天的秒数86400秒得到最后一天
// 从第一天到最后一天,逐天添加到数组中
$currentDay = $firstDay;
while ($currentDay <= $lastDay) {
$datesArray[] = date('Y-m-d', $currentDay);
$currentDay = strtotime('+1 day', $currentDay);
}
}
if (empty($datesArray)) return \Yz::Return(false,"参数错误");
$dnet = new AspNetZhuanController(); $dnet = new AspNetZhuanController();
$res = $dnet->GetDoctorDateList([ $res = $dnet->GetDoctorDateList([
"yyid" => $hospital_map["h$hospital"], "yyid" => $hospital_map["h$hospital"],
"rq" => $date, "data" => $datesArray,
"action" => "1" "action" => "1"
]); ]);
$list = []; $list = [];
if ($res['code'] == '200' && count($res['yisheng']) != 0) { if ($res['code'] == '200' && count($res['yisheng']) != 0) {
foreach ($res['yisheng'] as $key => $value) { foreach ($res['yisheng'] as $key => $value) {
$list[] = [ $list[] = [
'head_img' => 'data:image/jpeg;base64,' . $value['U_IMG'], 'head_img' => 'data:image/jpeg;base64,' . $value['U_IMG'],
'name' => $value['U_NAME'], 'name' => $value['U_NAME'],
'id' => $value['U_ID'],
'level' => $value['ZC_NAME'], 'level' => $value['ZC_NAME'],
'hospital' => '', 'hospital' => '',
'time' => $value['U_GDPB'], 'time' => $value['U_GDPB'],
@ -36,6 +65,39 @@ class DoctorController extends Controller
]; ];
} }
} }
return \Yz::Return(true, "查询完成", ['list' => $list]); $paiban=[];
$dates=[];
if(isset($month) and (strlen($month) == 7 or strlen($month) == 6) and isset($doctor_id)){
$k=0;
foreach ($res['paiban'] as $key => $date_value) {
foreach ($date_value as $key2 => $value2) {
if($value2['YSID']==$doctor_id){
$paiban[]=$value2;
}
}
}
$firstDay = date("Y-m-d", strtotime($month . "-01"));
// 获取当月的最后一天
$lastDay = date("Y-m-t", strtotime($month));
for ($i = $firstDay; $i <= $lastDay; $i = date("Y-m-d", strtotime($i . " +1 day"))) {
foreach ($paiban as $key => $value) {
if(date('Y-m-d', strtotime($value['PBRQ']))==$i){
$dates[]=[
'date'=>$i,
'paiban'=>$value,
];
}
}
$k++;
}
}
return \Yz::Return(true, "查询完成", ['list' => $list, 'paiban' => $dates]);
} }
} }

@ -267,6 +267,12 @@
"style": { "style": {
"navigationBarTitleText": "预约医生" "navigationBarTitleText": "预约医生"
} }
},
{
"path": "pages/main/ysdate/ysdate_new",
"style": {
"navigationBarTitleText": "预约医生"
}
} }
], ],

@ -272,6 +272,13 @@ onShow(() => {
}); });
const buyClick = async (item) => { const buyClick = async (item) => {
let checkup_type_id=$store.getCheckupTypeId();
console.log("----",checkup_type_id.id);
if(checkup_type_id.id=="" || checkup_type_id.id==undefined){
$store.setCheckupTypeId({
id: item.checkup_type_id
});
}
comboId.value = item.combo_id; comboId.value = item.combo_id;
if (item.duo_xuan_yi.length > 0) { if (item.duo_xuan_yi.length > 0) {
popupMultiple.value.open("center"); popupMultiple.value.open("center");

@ -17,15 +17,27 @@ const $props = defineProps({
type: String, type: String,
default: "", default: "",
}, },
month: {
type: String,
default: "",
},
}); });
const mountedAction = () => { const mountedAction = () => {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
yytjInfo.value = $store.getYytjInfo(); yytjInfo.value = $store.getYytjInfo();
dqDate.value = $props.date ? $props.date : "2024-08-01"; yytjInfo.value = {
if (dqDate.value) { doctor_date: "",
doctor_name: "",
doctor_id:"",
nmrIndex: -1,
...yytjInfo.value,
}
dqDate.value = $props.date ? $props.date : "";
if (dqDate.value || $props.month) {
getdoctorList(); // getdoctorList(); //
} }
}; };
@ -36,6 +48,7 @@ const getdoctorList = async () => {
let obj = { let obj = {
hospital: $store.save.hospital, hospital: $store.save.hospital,
date: dqDate.value, date: dqDate.value,
month:$props.month
}; };
const response = await $api("DoctorGetList", obj); const response = await $api("DoctorGetList", obj);
$response(response, () => { $response(response, () => {
@ -53,15 +66,24 @@ const configRef = (e) => {
}; };
const clickDoctor = (item) => { const clickDoctor = (item) => {
yytjInfo.value.doctor_name = item.name; yytjInfo.value.doctor_name = item.name;
yytjInfo.value.doctor_id = item.id;
yytjInfo.value.nmrIndex = -1; yytjInfo.value.nmrIndex = -1;
$store.setYytjInfo(yytjInfo.value); $store.setYytjInfo(yytjInfo.value);
// item.name if($props.month=='all'){
uni.navigateBack({ uni.navigateTo({
delta: 1, url:'/pages/main/ysdate/ysdate_new'
}); })
}else{
// item.name
uni.navigateBack({
delta: 1,
});
}
}; };
onShow(() => { onShow(() => {
console.log($props.month);
if (!!config_ref.value) { if (!!config_ref.value) {
mountedAction(); mountedAction();
} }
@ -79,41 +101,39 @@ onShow(() => {
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)" style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff" class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff"
> >
<view <view v-if="doctor_list.length>0">
v-for="(item, index) in doctor_list" <view v-for="(item, index) in doctor_list" :key="index" class="p-10rpx">
:key="index" <view class="flex flex-row text-#8B8B8B text-23rpx">
class="p-10rpx" <image :src="$image(item.head_img)" class="w-170rpx h-226rpx mr-20rpx"></image>
> <view class="flex-1 flex flex-col flex-justify-start pr-20rpx">
<view class="flex flex-row text-#8B8B8B text-23rpx"> <view class="text-#0E0E0E text-36rpx">
<image {{ item.name }}
:src="$image(item.head_img)" <span class="text-26rpx text-#515151 ml-10rpx">{{
class="w-170rpx h-226rpx mr-20rpx" item.level
></image> }}</span>
</view>
<view class="mt-33rpx mb-10rpx line-clamp-1">
<text v-if="false">{{ item.hospital }}:</text>
<text>{{ item.time }}</text>
</view>
<view class="line-clamp-2">
{{ item.desc }}
</view>
<view
@click="clickDoctor(item)"
class="ml-a mt-25rpx w-190rpx h-55rpx bg-#239EA3 rounded-33rpx text-#fff text-21rpx flex flex-justify-center items-center"
>
预约此医生
</view>
</view>
</view>
<view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" > </view>
</view>
</view>
<view v-else>
<view v-if="doctor_list!==false" style="font-size: 26rpx; text-align: center;color: #ccc;padding-top: 40rpx;"></view>
</view>
<view class="flex-1 flex flex-col flex-justify-start pr-20rpx">
<view class="text-#0E0E0E text-36rpx">
{{ item.name }}
<span class="text-26rpx text-#515151 ml-10rpx">{{
item.level
}}</span>
</view>
<view class="mt-33rpx mb-10rpx line-clamp-1">
<text v-if="false">{{ item.hospital }}:</text>
<text>{{ item.time }}</text>
</view>
<view class="line-clamp-2">
{{ item.desc }}
</view>
<view
@click="clickDoctor(item)"
class="ml-a mt-25rpx w-190rpx h-55rpx bg-#239EA3 rounded-33rpx text-#fff text-21rpx flex flex-justify-center items-center"
>
预约此医生
</view>
</view>
</view>
<view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" />
</view>
</view> </view>
</view> </view>
</view> </view>

@ -0,0 +1,329 @@
<script setup>
import DraggableButton from "@/pages/components/goHome.vue";
/**
* name
* useryytjsj
* date2024年9月25日 10:25:00
*/
import {
ref,
nextTick,
onBeforeUnmount
} from "vue";
import {
$api,
$response,
$image
} from "@/api";
import {
onShow
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
const $store = useStore();
let currentDate = ref(0);
let buyInfo = ref({}); //
let yytjInfo = ref({}); //
let nmrIndex = ref(-1); //
let status = ref(0); // 1 2
let calendarShow = ref(false); //
const rl_list = ref(false); //
const setDefaultInfo = () => {
yytjInfo.value = $store.getYytjInfo();
buyInfo.value = $store.getBuyInfo();
// $store.setCheckupTypeId({})
yytjInfo.value = {
nmr_list: [],
doctor_date: "",
doctor_name: "",
doctor_id:"",
nmrIndex: -1,
...yytjInfo.value,
}
buyInfo.value = {
combo_id: "",
duo_xuan_yi: [],
group_id: "",
hospital: 1,
item_ids: [],
person_id: $store.user.person_id,
wj: "",
...buyInfo.value,
}
getnmrList()
}
const getUserInfo = async () => {
uni.showLoading({
title: "加载中",
});
const response = await $api('UserInfo')
uni.hideLoading();
$response(response, () => {
$store.setUser(response.data.info);
setDefaultInfo()
})
}
const mountedAction = async () => {
await getUserInfo()
};
onBeforeUnmount(() => {
if (!status.value) {
$store.setYytjInfo(uni.getStorageSync("yytjInfoS"));
}
});
const getnmrList = async () => {
let date = null
if (!!yytjInfo.value.doctor_date) {
date = yytjInfo.value.doctor_date
currentDate.value = yytjInfo.value.doctor_date
} else {
currentDate.value = getToday();
yytjInfo.value.doctor_date = currentDate.value;
}
moreTime(date, 1);
};
const moreTime = async (m, status) => {
const [year, month, day] = currentDate.value.split("-");
let dqmonth = m || `${year}-${month}`; //
let obj = {};
let methods = "";
getdoctorList(`${year}-${month}`)
calendarShow.value = true;
};
const monthSwitch = (givenDate) => {
const currentYear = new Date().getFullYear();
const currentMonth = new Date().getMonth() + 1;
//
if (
givenDate.year < currentYear ||
(givenDate.year === currentYear && givenDate.month < currentMonth)
) {
// uni.$lu.toast("");
return false;
} else {
let str = `${givenDate.year}-${givenDate.month}`;
moreTime(str, 0);
}
};
const getToday = () => {
var today = new Date();
var year = today.getFullYear();
var month = (today.getMonth() + 1).toString().padStart(2, "0");
var day = today.getDate().toString().padStart(2, "0");
return year + "-" + month + "-" + day;
};
const changeDate = (e) => {
currentDate.value = e.fulldate;
yytjInfo.value.doctor_date = e.fulldate;
$store.setYytjInfo(yytjInfo.value);
uni.navigateTo({
url: '/pages/main/combo/combo'
})
}
const changerl = (e) => {
changeDate(e)
};
const clickDoctor = (s) => {
status.value = 0;
let date = currentDate.value
};
const comfrimyy = () => {
uni.navigateTo({
url: '/pages/main/combo/combo'
})
};
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
mountedAction();
}
};
let MonthList=ref([]);
let DoctorInfo=ref(false)
const getdoctorList = async (month) => {
//
let obj = {
hospital: $store.save.hospital,
month:month,
doctor_id:yytjInfo.value.doctor_id?yytjInfo.value.doctor_id:null
};
uni.showLoading({
title: "加载中",
});
const response = await $api("DoctorGetList", obj);
uni.hideLoading();
$response(response, () => {
console.log(response, "response");
response.data.list.forEach((item)=>{
if(item.id==yytjInfo.value.doctor_id){
DoctorInfo.value=item
}
})
let rlArr = [];
response.data.paiban.forEach((item) => {
let o = {
date: item.date,
info: "出诊",
};
rlArr.push(o);
});
MonthList.value = rlArr;
uni.hideLoading();
});
};
onShow(() => {
if (!!config_ref.value) {
mountedAction();
}
});
</script>
<template>
<DraggableButton />
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<view class="h-38rpx bg-#239EA3 pl-20rpx pr-20rpx box-border">
<view style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff ylrl" v-if="calendarShow">
<view class="p-10rpx" v-if="DoctorInfo">
<view class="flex flex-row text-#8B8B8B text-23rpx">
<image :src="$image(DoctorInfo.head_img)" class="w-170rpx h-226rpx mr-20rpx"></image>
<view class="flex-1 flex flex-col flex-justify-start pr-20rpx">
<view class="text-#0E0E0E text-36rpx">
{{ DoctorInfo.name }}
<span class="text-26rpx text-#515151 ml-10rpx">{{
DoctorInfo.level
}}</span>
</view>
<view class="mt-33rpx mb-10rpx line-clamp-1">
<text v-if="false">{{ DoctorInfo.hospital }}:</text>
<text>{{ DoctorInfo.time }}</text>
</view>
<view class="line-clamp-2">
{{ DoctorInfo.desc }}
</view>
</view>
</view>
<view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" > </view>
</view>
<uni-calendar :selected="MonthList" :startDate="getToday()" :showMonth="false" :insert="true" :date="currentDate"
@change="changerl" @monthSwitch="monthSwitch" />
</view>
<!-- <view style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="p-30rpx pl-10rpx pr-10rpx rounded-15rpx bg-#fff mt-15rpx text-#101010 text-28rpx">
<view class="bg-#F7F7F7 pl-20rpx pr-20rpx pt-23rpx pb-25rpx">
<text>{{ $store.getUser()?.name }}</text>
<view class="bg-#EFEFEF rounded-15rpx p-10rpx pb-15rpx pt-15rpx mt-20rpx">
<view class="p-20rpx pl-10rpx pr-10rpx rounded-15rpx between" @click="clickDoctor()">
<text>体检医生</text>
<text class="ml-10rpx text-#0E0E0E center">
{{ yytjInfo?.doctor_name || "请选择" }}
<uni-icons type="right" size="14"></uni-icons>
</text>
</view>
</view>
</view>
</view>
<view class="pb-100rpx">
<view @click="comfrimyy"
class="text-#fff text-32rpx rounded-45rpx bg-#239EA3 mt-40rpx ma w-520rpx h-90rpx flex flex-items-center flex-justify-center">
确定
</view>
</view> -->
</view>
</view>
</template>
<style scoped lang="scss">
.activeTime {
background-color: #239ea3;
color: #fff;
}
.acitvetc {
background-color: #e0f1f2;
}
::v-deep .ylrl {
.uni-calendar__header,
.uni-calendar__weeks-day {
border: none;
}
.uni-calendar-item--checked {
background-color: transparent;
.uni-calendar-item__weeks-box-item {
background-color: #239ea3 !important;
border-radius: 12rpx;
.uni-calendar-item--extra {
color: #fff !important;
}
}
}
.uni-calendar-item--isDay {
background-color: #239ea3 !important;
border-radius: 12rpx;
color: #fff !important;
}
.uni-calendar-item--extra {
color: #239ea3;
}
.uni-calendar-item__weeks-box {
// padding: 10rpx;
box-sizing: border-box;
}
.uni-calendar-item__weeks-box-circle {
background-color: rgba(0, 0, 0, 0);
}
.uni-calendar-item--isDay-text {
color: #333;
}
.uni-calendar-item__weeks-box-text {
font-size: 26rpx;
}
.uni-calendar-item__weeks-lunar-text {
font-size: 16rpx;
}
.uni-calendar-item__weeks-box-item {
width: 100%;
}
.uni-calendar__backtoday {
display: none;
}
.uni-calendar-item--disable {
.uni-calendar-item__weeks-lunar-text {
display: none;
}
}
}
</style>
Loading…
Cancel
Save