鹿和sa0ChunLuyu 1 year ago
commit 686feeb0c5

@ -1,125 +1,122 @@
<script setup> <script setup>
import DraggableButton from "@/pages/components/goHome.vue"; import DraggableButton from "@/pages/components/goHome.vue";
/** /**
* name * name
* userselectDoctor * userselectDoctor
* date2024年9月24日 16:24:50 * date2024年9月24日 16:24:50
*/ */
import { import { ref } from "vue";
ref import { $api, $response, $image } from "@/api";
} from 'vue' import { onShow } from "@dcloudio/uni-app";
import { import { useStore } from "@/store";
$api, const $store = useStore();
$response, let dqDate = ref("");
$image let yytjInfo = ref({}); //
} from '@/api' const $props = defineProps({
import { date: {
onShow type: String,
} from '@dcloudio/uni-app' default: "",
import { },
useStore });
} from '@/store'
const $store = useStore()
let dqDate = ref('')
let yytjInfo = ref({}); //
const $props = defineProps({
date: {
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'; dqDate.value = $props.date ? $props.date : "2024-08-01";
if (dqDate.value) { if (dqDate.value) {
getdoctorList(); // getdoctorList(); //
} }
} };
const doctor_list = ref(false) const doctor_list = ref(false);
const getdoctorList = async () => { const getdoctorList = async () => {
// //
console.log($store, 'store') console.log($store, "store");
let obj = { let obj = {
"date": dqDate.value date: dqDate.value,
}; };
const response = await $api("DoctorGetList", obj); const response = await $api("DoctorGetList", obj);
$response(response, () => { $response(response, () => {
console.log(response, 'response') console.log(response, "response");
doctor_list.value = response.data.list; doctor_list.value = response.data.list;
uni.hideLoading(); uni.hideLoading();
}); });
}; };
const config_ref = ref(null) const config_ref = ref(null);
const configRef = (e) => { const configRef = (e) => {
if (!config_ref.value) { if (!config_ref.value) {
config_ref.value = e config_ref.value = e;
mountedAction() mountedAction();
} }
} };
const clickDoctor = (item) => { const clickDoctor = (item) => {
yytjInfo.value.doctor_name = item.name; yytjInfo.value.doctor_name = item.name;
$store.setYytjInfo(yytjInfo.value); yytjInfo.value.nmrIndex = -1;
// item.name $store.setYytjInfo(yytjInfo.value);
uni.navigateBack({ // item.name
delta: 1 uni.navigateBack({
}); delta: 1,
});
};
} onShow(() => {
if (!!config_ref.value) {
onShow(() => { mountedAction();
if (!!config_ref.value) { }
mountedAction() });
}
})
</script> </script>
<template> <template>
<DraggableButton /> <DraggableButton />
<view> <view>
<view v-if="!!$store.config"> <view v-if="!!$store.config">
<view :ref="configRef"></view> <view :ref="configRef"></view>
</view> </view>
<view class=" pb-40rpx"> <view class="pb-40rpx">
<view class="h-38rpx bg-#239EA3 pl-20rpx pr-20rpx box-border"> <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);" <view
class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff"> style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
<view v-for="(item,index) in doctor_list" :key="index" class="p-10rpx "> class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff"
<view class="flex flex-row text-#8B8B8B text-23rpx "> >
<image :src="$image(item.head_img)" class="w-170rpx h-226rpx mr-20rpx "></image> <view
v-for="(item, index) in doctor_list"
<view class="flex-1 flex flex-col flex-justify-start pr-20rpx"> :key="index"
<view class="text-#0E0E0E text-36rpx"> class="p-10rpx"
{{item.name}} >
<span class="text-26rpx text-#515151 ml-10rpx">{{item.level}}</span> <view class="flex flex-row text-#8B8B8B text-23rpx">
</view> <image
<view class="mt-33rpx mb-10rpx line-clamp-1"> :src="$image(item.head_img)"
{{item.hospital}}: class="w-170rpx h-226rpx mr-20rpx"
<span class="ml-11rpx ">{{item.time}}</span> ></image>
</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 class="flex-1 flex flex-col flex-justify-start pr-20rpx">
</view> <view class="text-#0E0E0E text-36rpx">
</view> {{ item.name }}
</view> <span class="text-26rpx text-#515151 ml-10rpx">{{
</view> item.level
}}</span>
</view>
<view class="mt-33rpx mb-10rpx line-clamp-1">
{{ item.hospital }}:
<span class="ml-11rpx">{{ item.time }}</span>
</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>
</template> </template>
<style scoped> <style scoped></style>
</style>

@ -289,7 +289,7 @@ const comfrimyy = async () => {
console.log(obj); console.log(obj);
const response = await $api("OrderCreate", obj); const response = await $api("OrderCreate", obj);
// return return;
$response(response, () => { $response(response, () => {
if (response.status) { if (response.status) {
if (response.data.action == "pay") { if (response.data.action == "pay") {
@ -361,12 +361,36 @@ onShow(() => {
}); });
const toRouter = (url, status, index) => { const toRouter = (url, status, index) => {
let i = index;
if (status) { if (status) {
console.log(index); if (
yytjInfo.value.nmrIndex = index; yytjInfo.value.nmr_list.length > 1 &&
yytjInfo.value.nmr_list[0].time == ""
) {
//
i = 0;
}
// if (yytjInfo.value.nmr_list.length == 1 && yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time == "") {
// //
// if(index = -1){
// //
// }else{
// //
// }
// nmrIndex.value = 1;
// moreTime(null, 1);
// return;
// }
yytjInfo.value.nmrIndex = i;
console.log(yytjInfo.value); console.log(yytjInfo.value);
uni.setStorageSync("yytjInfoS", yytjInfo.value); uni.setStorageSync("yytjInfoS", yytjInfo.value);
$store.setYytjInfo(yytjInfo.value); $store.setYytjInfo(yytjInfo.value);
if (yytjInfo.value.doctor_date && i == -1) {
uni.navigateTo({
url: `/pages/main/selectDoctor/selectDoctor?date=${yytjInfo.value.doctor_date}`,
});
return;
}
} }
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
@ -625,9 +649,7 @@ const toRouter = (url, status, index) => {
<view <view
class="mb-20rpx between" class="mb-20rpx between"
v-for="(val, index) in yytjInfo?.nmr_list" v-for="(val, index) in yytjInfo?.nmr_list"
@click=" @click="toRouter('/pages/main/yytjsj/yytjsj', 1, index)"
toRouter('/pages/main/yytjsj/yytjsj', 1, val.time ? index : 0)
"
:key="index" :key="index"
v-if="yytjInfo?.nmr_list?.length" v-if="yytjInfo?.nmr_list?.length"
> >
@ -643,7 +665,7 @@ const toRouter = (url, status, index) => {
</view> </view>
<view <view
class="mb-20rpx between" class="mb-20rpx between"
@click="toRouter('/pages/main/yytjsj/yytjsj', 1, 0)" @click="toRouter('/pages/main/yytjsj/yytjsj', 1, -1)"
> >
<text>体检医生</text> <text>体检医生</text>
<text class="text-30rpx">{{ <text class="text-30rpx">{{

@ -76,13 +76,22 @@ const getnmrList = async () => {
}); });
} }
nmrIndex.value = yytjInfo.value.nmrIndex; nmrIndex.value = yytjInfo.value.nmrIndex;
console.log(yytjInfo.value.nmr_list[nmrIndex.value]); if (nmrIndex.value == -1) {
xmmcClick(yytjInfo.value.nmr_list[nmrIndex.value], nmrIndex.value); //
if (yytjInfo.value.doctor_date) {
currentDate.value = yytjInfo.value.doctor_date;
}
clickDoctor(1);
} else {
//
xmmcClick(yytjInfo.value.nmr_list[nmrIndex.value], nmrIndex.value);
}
uni.hideLoading(); uni.hideLoading();
}); });
}; };
const moreTime = async (m, status) => { const moreTime = async (m, status) => {
uni.showLoading({ title: "加载中" });
isClickDoctor.value = status; isClickDoctor.value = status;
// //
const [year, month, day] = currentDate.value.split("-"); const [year, month, day] = currentDate.value.split("-");
@ -128,6 +137,7 @@ const moreTime = async (m, status) => {
console.log(rlArr); console.log(rlArr);
rl_list.value = rlArr; rl_list.value = rlArr;
calendarShow.value = true; calendarShow.value = true;
uni.hideLoading();
}); });
}; };
@ -196,7 +206,7 @@ const getTjTimeList = async (val) => {
time_list.value.forEach((item) => { time_list.value.forEach((item) => {
console.log(item.date); console.log(item.date);
item.newTime = item.time.slice(0, 5); item.newTime = item?.time.slice(0, 5);
item.date = currentDate.value; item.date = currentDate.value;
}); });
date_list.value.forEach((item) => { date_list.value.forEach((item) => {
@ -232,11 +242,36 @@ const changerl = (e) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/main/selectDoctor/selectDoctor?date=${e.fulldate}`, url: `/pages/main/selectDoctor/selectDoctor?date=${e.fulldate}`,
}); });
return;
} }
if (date_list.value[3]?.date == e.fulldate) { if (date_list.value[3]?.date == e.fulldate) {
calendarShow.value = false; calendarShow.value = false;
return; return;
} }
if (
nmrIndex.value == yytjInfo.value.nmr_list.length - 1 &&
yytjInfo.value.doctor_date
) {
console.log("切换体检时间");
uni.showModal({
title: "提示",
content: "已选择医生,切换日期将重新选择医生,是否继续",
showCancel: true,
success: ({ confirm }) => {
if (confirm) {
currentDate.value = e.fulldate;
time.value = "";
timeIndex.value = null;
yytjInfo.value.nmr_list[nmrIndex.value].time = "";
yytjInfo.value.nmr_list[nmrIndex.value].id = "";
yytjInfo.value.doctor_name = ""; //
getTjTimeList(yytjInfo.value.nmr_list[nmrIndex.value]);
calendarShow.value = false;
}
},
});
return;
}
// uni.showLoading({ // uni.showLoading({
// title: "", // title: "",
// }); // });
@ -263,6 +298,42 @@ const getCurrentClick = (item, i) => {
return; return;
} }
if (i != 3) { if (i != 3) {
if (
nmrIndex.value == yytjInfo.value.nmr_list.length - 1 &&
yytjInfo.value.doctor_date
) {
console.log("切换体检时间");
uni.showModal({
title: "提示",
content: "已选择医生,切换日期将重新选择医生,是否继续",
showCancel: true,
success: ({ confirm }) => {
console.log(confirm);
if (confirm) {
if (yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0) {
yytjInfo.value.nmr_list = yytjInfo.value.nmr_list.map((val) => {
return {
...val,
time: "",
id: "",
};
});
}
time.value = "";
timeIndex.value = null;
yytjInfo.value.nmr_list[nmrIndex.value].time = "";
yytjInfo.value.nmr_list[nmrIndex.value].id = "";
yytjInfo.value.doctor_name = ""; //
yytjInfo.value.doctor_date = ""; //
$store.setYytjInfo(yytjInfo.value);
status.value = 0;
currentDate.value = item.date;
getTjTimeList(item); //
}
},
});
return;
}
if (yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0) { if (yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0) {
yytjInfo.value.nmr_list = yytjInfo.value.nmr_list.map((val) => { yytjInfo.value.nmr_list = yytjInfo.value.nmr_list.map((val) => {
return { return {
@ -305,14 +376,16 @@ const xmmcClick = (val, index, status) => {
if ( if (
yytjInfo.value.nmr_list.length > 1 && yytjInfo.value.nmr_list.length > 1 &&
index != 0 && index != 0 &&
yytjInfo.value.nmr_list[0].time == "" yytjInfo.value.nmr_list[0]?.time == ""
) { ) {
uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0].name + "时间"); uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0]?.name + "时间");
return; return;
} }
nmrIndex.value = index; nmrIndex.value = index;
time.value = ""; time.value = "";
timeIndex.value = null; timeIndex.value = null;
isClickDoctor.value = 0;
calendarShow.value = false;
if (val.time) { if (val.time) {
currentDate.value = val.time.split(" ")[0]; currentDate.value = val.time.split(" ")[0];
} else { } else {
@ -331,23 +404,29 @@ const xmmcClick = (val, index, status) => {
getTjTimeList(val); getTjTimeList(val);
}; };
const clickDoctor = () => { const clickDoctor = (s) => {
// //
console.log(yytjInfo.value.nmr_list[0]?.time);
console.log(yytjInfo.value.nmr_list[0]?.name);
if ( if (
yytjInfo.value.nmr_list.length > 1 && yytjInfo.value.nmr_list.length > 1 &&
yytjInfo.value.nmr_list[0].time == "" yytjInfo.value.nmr_list[0]?.time == ""
) { ) {
uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0].name + "时间"); uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0]?.name + "时间");
return; return;
} }
if (yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time == "") { // if (yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1]?.time == "") {
nmrIndex.value = yytjInfo.value.nmr_list?.length - 1; // nmrIndex.value = yytjInfo.value.nmr_list?.length - 1;
moreTime(null, 1); nmrIndex.value = -1;
moreTime(null, 1);
// return;
// }
if (s) {
return; return;
} }
status.value = 0; status.value = 0;
let date = let date =
yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time?.split( yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1]?.time?.split(
" " " "
)[0]; )[0];
yytjInfo.value.doctor_date = date; yytjInfo.value.doctor_date = date;
@ -460,7 +539,7 @@ onShow(() => {
/> />
<view class="flex items-center grow"> <view class="flex items-center grow">
<text class="text-#707070 text-24rpx">您好</text> <text class="text-#707070 text-24rpx">您好</text>
<text class="text-#0E0E0E text-32rpx">{{ groupInfo.name }}</text> <text class="text-#0E0E0E text-32rpx">{{ groupInfo?.name }}</text>
</view> </view>
</view> </view>
<view class="text-24rpx mt-40rpx"> <view class="text-24rpx mt-40rpx">
@ -536,135 +615,130 @@ onShow(() => {
@monthSwitch="monthSwitch" @monthSwitch="monthSwitch"
/> />
</view> </view>
<template v-else> <view
<view 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="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff mt-15rpx"
class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff mt-15rpx" v-if="date_list && !calendarShow"
v-if="date_list" >
> <view class="">
<view class=""> <view
class="text-30rpx text-#0E0E0E pb-34rpx font-500"
v-if="yytjInfo.nmr_list[nmrIndex]?.name"
>
{{ yytjInfo.nmr_list[nmrIndex]?.name }}
</view>
<view class="flex mb-30rpx items-center">
<view <view
class="text-30rpx text-#0E0E0E pb-34rpx font-500" class="flex-1 text-center text-18rpx"
v-if="yytjInfo.nmr_list[nmrIndex].name" v-for="(item, index) in date_list"
:key="index"
> >
{{ yytjInfo.nmr_list[nmrIndex].name }}
</view>
<view class="flex mb-30rpx items-center">
<view <view
class="flex-1 text-center text-18rpx" @click="getCurrentClick(item, index)"
v-for="(item, index) in date_list" :class="{
:key="index" activeTime: 3 == index,
'bg-#efefef text-#aaa8a8':
item.count < 0 ||
new Date(item.date).getTime() <
new Date(getToday()).getTime(),
}"
class="rounded-12rpx pt-10rpx pb-10rpx ml-10rpx mr-10rpx mb-6rpx"
> >
<view <view> {{ item.newMonthDate }} </view>
@click="getCurrentClick(item, index)" <view class="text-26rpx font-500"> {{ item.newWeek }} </view>
</view>
<view class="ma" v-if="item.count > -1">
<text
:class="{ :class="{
activeTime: 3 == index, 'text-#239EA3 !bg-#E1F4F8': 3 == index,
'bg-#efefef text-#aaa8a8':
item.count < 0 ||
new Date(item.date).getTime() <
new Date(getToday()).getTime(),
}" }"
class="rounded-12rpx pt-10rpx pb-10rpx ml-10rpx mr-10rpx mb-6rpx" class="bg-#EFEFEF rounded-10rpx h-28rpx pl-10rpx pr-10rpx"
>{{ item.count }}</text
> >
<view> {{ item.newMonthDate }} </view>
<view class="text-26rpx font-500"> {{ item.newWeek }} </view>
</view>
<view class="ma" v-if="item.count > -1">
<text
:class="{
'text-#239EA3 !bg-#E1F4F8': 3 == index,
}"
class="bg-#EFEFEF rounded-10rpx h-28rpx pl-10rpx pr-10rpx"
>{{ item.count }}</text
>
</view>
</view>
<view
class="flex-1 col center text-#239EA3 text-20rpx bs b-#E7E7E7 b-l-1 h-80rpx"
@click="moreTime(null, 0)"
>
<uni-icons
type="calendar"
size="30"
color="#239EA3"
></uni-icons>
<text>更多</text>
</view> </view>
</view> </view>
<view <view
class="flex flex-wrap pt-30rpx pb-30rpx b-0 b-t-1 b-solid b-#E1ECEE" class="flex-1 col center text-#239EA3 text-20rpx bs b-#E7E7E7 b-l-1 h-80rpx"
v-if="time_list.length" @click="moreTime(null, 0)"
> >
<view <uni-icons type="calendar" size="30" color="#239EA3"></uni-icons>
class="w-20% text-center box-border p-20rpx" <text>更多</text>
v-for="(item, index) in time_list"
:key="index"
:class="{
'text-red': item.status == 2,
}"
@click="getCurrentTime(item, index)"
>
<view
class="text-24rpx rounded-12rpx h-54rpx flex flex-items-center flex-justify-center"
:class="timeIndex == index ? 'activeTime' : ''"
>
{{ item.newTime }}
</view>
</view>
</view> </view>
</view> </view>
</view> <view
<view class="flex flex-wrap pt-30rpx pb-30rpx b-0 b-t-1 b-solid b-#E1ECEE"
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)" v-if="time_list.length"
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>{{
buyInfo.group_id
? $store.getGroupInfo()?.name
: $store.getUser()?.name
}}</text>
<view <view
class="bg-#EFEFEF rounded-15rpx p-10rpx pb-15rpx pt-15rpx mt-20rpx" class="w-20% text-center box-border p-20rpx"
v-for="(item, index) in time_list"
:key="index"
:class="{
'text-red': item.status == 2,
}"
@click="getCurrentTime(item, index)"
> >
<view <view
v-for="(item, index) in yytjInfo.nmr_list" class="text-24rpx rounded-12rpx h-54rpx flex flex-items-center flex-justify-center"
:key="index" :class="timeIndex == index ? 'activeTime' : ''"
@click="xmmcClick(item, index, 1)"
:class="nmrIndex == index ? 'acitvetc' : ''"
class="flex flex-justify-around p-20rpx pl-10rpx pr-10rpx rounded-15rpx"
>
<view class="flex-col flex flex-1 line-clamp-1">
<text v-for="(v, i) in item.name?.split('/')" :key="i">{{
v
}}</text>
</view>
<view class="center">
{{ item.time }}
</view>
</view>
<view
class="p-20rpx pl-10rpx pr-10rpx rounded-15rpx between"
@click="clickDoctor"
> >
<text>体检医生</text> {{ item.newTime }}
<text class="ml-10rpx text-#0E0E0E center">
{{ yytjInfo?.doctor_name || "请选择" }}
<uni-icons type="right" size="14"></uni-icons>
</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="pb-100rpx"> </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>{{
buyInfo.group_id
? $store.getGroupInfo()?.name
: $store.getUser()?.name
}}</text>
<view <view
@click="comfrimyy" class="bg-#EFEFEF rounded-15rpx p-10rpx pb-15rpx pt-15rpx mt-20rpx"
class="text-#fff text-32rpx rounded-45rpx bg-#239EA3 mt-40rpx ma w-520rpx h-90rpx flex flex-items-center flex-justify-center"
> >
确定 <view
v-for="(item, index) in yytjInfo.nmr_list"
:key="index"
@click="xmmcClick(item, index, 1)"
:class="nmrIndex == index ? 'acitvetc' : ''"
class="flex flex-justify-around p-20rpx pl-10rpx pr-10rpx rounded-15rpx"
>
<view class="flex-col flex flex-1 line-clamp-1">
<text v-for="(v, i) in item.name?.split('/')" :key="i">{{
v
}}</text>
</view>
<view class="center">
{{ item.time }}
</view>
</view>
<view
class="p-20rpx pl-10rpx pr-10rpx rounded-15rpx between"
:class="nmrIndex == -1 ? 'acitvetc' : ''"
@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>
</template> </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>
</view> </view>
</template> </template>

Loading…
Cancel
Save