鹿和sa0ChunLuyu 1 year ago
commit 686feeb0c5

@ -1,81 +1,71 @@
<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 {
onShow
} from '@dcloudio/uni-app'
import {
useStore
} from '@/store'
const $store = useStore()
let dqDate = ref('')
let yytjInfo = ref({}); //
const $props = defineProps({
date: { date: {
type: String, type: String,
default: "", 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;
yytjInfo.value.nmrIndex = -1;
$store.setYytjInfo(yytjInfo.value); $store.setYytjInfo(yytjInfo.value);
// item.name // item.name
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1,
}); });
};
} onShow(() => {
onShow(() => {
if (!!config_ref.value) { if (!!config_ref.value) {
mountedAction() mountedAction();
} }
}) });
</script> </script>
<template> <template>
<DraggableButton /> <DraggableButton />
@ -83,43 +73,50 @@ import DraggableButton from "@/pages/components/goHome.vue";
<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"
:key="index"
class="p-10rpx"
>
<view class="flex flex-row text-#8B8B8B text-23rpx">
<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-1 flex flex-col flex-justify-start pr-20rpx">
<view class="text-#0E0E0E text-36rpx"> <view class="text-#0E0E0E text-36rpx">
{{item.name}} {{ item.name }}
<span class="text-26rpx text-#515151 ml-10rpx">{{item.level}}</span> <span class="text-26rpx text-#515151 ml-10rpx">{{
item.level
}}</span>
</view> </view>
<view class="mt-33rpx mb-10rpx line-clamp-1"> <view class="mt-33rpx mb-10rpx line-clamp-1">
{{item.hospital}}: {{ item.hospital }}:
<span class="ml-11rpx ">{{item.time}}</span> <span class="ml-11rpx">{{ item.time }}</span>
</view> </view>
<view class="line-clamp-2"> <view class="line-clamp-2">
{{item.desc}} {{ 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 @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> </view>
<view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" /> <view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" />
</view> </view>
</view> </view>
</view> </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) {
//
if (yytjInfo.value.doctor_date) {
currentDate.value = yytjInfo.value.doctor_date;
}
clickDoctor(1);
} else {
//
xmmcClick(yytjInfo.value.nmr_list[nmrIndex.value], nmrIndex.value); 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;
nmrIndex.value = -1;
moreTime(null, 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,18 +615,17 @@ 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" v-if="date_list && !calendarShow"
> >
<view class=""> <view class="">
<view <view
class="text-30rpx text-#0E0E0E pb-34rpx font-500" class="text-30rpx text-#0E0E0E pb-34rpx font-500"
v-if="yytjInfo.nmr_list[nmrIndex].name" v-if="yytjInfo.nmr_list[nmrIndex]?.name"
> >
{{ yytjInfo.nmr_list[nmrIndex].name }} {{ yytjInfo.nmr_list[nmrIndex]?.name }}
</view> </view>
<view class="flex mb-30rpx items-center"> <view class="flex mb-30rpx items-center">
<view <view
@ -583,11 +661,7 @@ onShow(() => {
class="flex-1 col center text-#239EA3 text-20rpx bs b-#E7E7E7 b-l-1 h-80rpx" class="flex-1 col center text-#239EA3 text-20rpx bs b-#E7E7E7 b-l-1 h-80rpx"
@click="moreTime(null, 0)" @click="moreTime(null, 0)"
> >
<uni-icons <uni-icons type="calendar" size="30" color="#239EA3"></uni-icons>
type="calendar"
size="30"
color="#239EA3"
></uni-icons>
<text>更多</text> <text>更多</text>
</view> </view>
</view> </view>
@ -645,7 +719,8 @@ onShow(() => {
</view> </view>
<view <view
class="p-20rpx pl-10rpx pr-10rpx rounded-15rpx between" class="p-20rpx pl-10rpx pr-10rpx rounded-15rpx between"
@click="clickDoctor" :class="nmrIndex == -1 ? 'acitvetc' : ''"
@click="clickDoctor()"
> >
<text>体检医生</text> <text>体检医生</text>
<text class="ml-10rpx text-#0E0E0E center"> <text class="ml-10rpx text-#0E0E0E center">
@ -664,7 +739,6 @@ onShow(() => {
确定 确定
</view> </view>
</view> </view>
</template>
</view> </view>
</view> </view>
</template> </template>

Loading…
Cancel
Save