日历微调

main
yanzai 12 months ago
parent bbc2624bbc
commit 3378e0d8dc

@ -283,7 +283,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10312335</view> <view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">12250922</view>
</view> </view>
</view> </view>
</template> </template>

@ -1,117 +1,153 @@
<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 { ref } from "vue"; import {
import { $api, $response, $image } from "@/api"; ref
import { onShow } from "@dcloudio/uni-app"; } from "vue";
import { useStore } from "@/store"; import {
const $store = useStore(); $api,
let dqDate = ref(""); $response,
let yytjInfo = ref({}); // $image
let user_person=ref({}); } from "@/api";
let zhou_firstday=ref(''); import {
const $props = defineProps({ onShow
date: { } from "@dcloudio/uni-app";
type: String, import {
default: "", useStore
}, } from "@/store";
month: { const $store = useStore();
type: String, let dqDate = ref("");
default: "", let yytjInfo = ref({}); //
}, let user_person = ref({});
}); let zhou_firstday = ref('');
const $props = defineProps({
date: {
type: String,
default: "",
},
month: {
type: String,
default: "",
},
});
const mountedAction = () => { const mountedAction = () => {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
user_person.value= $store.getUser(); user_person.value = $store.getUser();
yytjInfo.value = $store.getYytjInfo(); yytjInfo.value = $store.getYytjInfo();
yytjInfo.value = { yytjInfo.value = {
doctor_date: "", doctor_date: "",
doctor_name: "", doctor_name: "",
doctor_id:"", doctor_id: "",
nmrIndex: -1, nmrIndex: -1,
...yytjInfo.value, ...yytjInfo.value,
} }
dqDate.value = $props.date ? $props.date : ""; dqDate.value = $props.date ? $props.date : "";
if (dqDate.value || $props.month) { if (dqDate.value || $props.month) {
getdoctorList(); // getdoctorList(); //
} }
}; };
const doctor_list = ref(false); const doctor_list = ref(false);
const week7=ref([]) const week7 = ref([])
const getdoctorList = async () => { const getdoctorList = async () => {
let c_type=$store.getCheckupTypeId() let c_type = $store.getCheckupTypeId()
// //
let obj = { let obj = {
hospital: $store.save.hospital, hospital: $store.save.hospital,
date: dqDate.value, date: dqDate.value,
month:$props.month, month: $props.month,
person_id:user_person.value.person_id, person_id: user_person.value.person_id,
checkup_type:c_type.id, checkup_type: c_type.id,
zhou_firstday:zhou_firstday.value zhou_firstday: zhou_firstday.value
}; };
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
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;
week7.value=response.data.week7 week7.value = response.data.week7
uni.hideLoading(); uni.hideLoading();
}); });
}; };
const config_ref = ref(null); const RiLiGetDoctorPaiBan=ref([]);
const configRef = (e) => { const RiLiGetDoctorPaiBanFuc=async()=>{
if (!config_ref.value) { return false;
config_ref.value = e; let c_type = $store.getCheckupTypeId()
mountedAction(); //
} let obj = {
}; hospital: $store.save.hospital,
const clickDoctor = (item) => { date: "",
yytjInfo.value.doctor_name = item.name; month: nowMonth.value,
yytjInfo.value.doctor_id = item.id; person_id: user_person.value.person_id,
yytjInfo.value.nmrIndex = -1; checkup_type: c_type.id,
$store.setYytjInfo(yytjInfo.value); zhou_firstday: zhou_firstday.value
if($props.month=='all'){ };
uni.navigateTo({ uni.showLoading({
url:'/pages/main/ysdate/ysdate_new' title: "加载中",
}) });
}else{ const response = await $api("DoctorGetList", obj);
// item.name $response(response, () => {
uni.navigateBack({
delta: 1,
});
}
}; RiLiGetDoctorPaiBan=res.data.
let selectedDate=ref(""); uni.hideLoading();
const selectDateFunc=(date)=>{ });
selectedDate.value=date }
dqDate.value=date const config_ref = ref(null);
getdoctorList() const configRef = (e) => {
} if (!config_ref.value) {
let YueLiRef=ref(null); config_ref.value = e;
// mountedAction();
const ClickMore=()=>{ }
YueLiRef.value.open() };
} const clickDoctor = (item) => {
const getToday = () => { yytjInfo.value.doctor_name = item.name;
yytjInfo.value.doctor_id = item.id;
yytjInfo.value.nmrIndex = -1;
$store.setYytjInfo(yytjInfo.value);
if ($props.month == 'all') {
uni.navigateTo({
url: '/pages/main/ysdate/ysdate_new'
})
} else {
// item.name
uni.navigateBack({
delta: 1,
});
}
};
let selectedDate = ref("");
const selectDateFunc = (date) => {
selectedDate.value = date
dqDate.value = date
getdoctorList()
}
let YueLiRef = ref(null);
let nowMonth = ref('');
//
const ClickMore = async () => {
YueLiRef.value.open()
RiLiGetDoctorPaiBanFuc()
}
const getToday = () => {
var today = new Date(); var today = new Date();
var year = today.getFullYear(); var year = today.getFullYear();
var month = (today.getMonth() + 1).toString().padStart(2, "0"); var month = (today.getMonth() + 1).toString().padStart(2, "0");
var day = today.getDate().toString().padStart(2, "0"); var day = today.getDate().toString().padStart(2, "0");
return year + "-" + month + "-" + day; return year + "-" + month + "-" + day;
}; };
zhou_firstday.value=getToday() zhou_firstday.value = getToday()
let MonthList=ref([]); nowMonth.value=zhou_firstday.value.substring(0,7)
const moreTime = async (m, status) => { let MonthList = ref([]);
const moreTime = async (m, status) => {
const [year, month, day] = currentDate.value.split("-"); const [year, month, day] = currentDate.value.split("-");
let dqmonth = m || `${year}-${month}`; // let dqmonth = m || `${year}-${month}`; //
let obj = {}; let obj = {};
@ -132,92 +168,92 @@ const moreTime = async (m, status) => {
return false; return false;
} else { } else {
let str = `${givenDate.year}-${givenDate.month}`; let str = `${givenDate.year}-${givenDate.month}`;
nowMonth.value=str
moreTime(str, 0); moreTime(str, 0);
RiLiGetDoctorPaiBanFuc()
} }
}; };
// //
const RiLiDateFunc=(e)=>{ const RiLiDateFunc = (e) => {
console.log(e) console.log(e)
dqDate.value=e.fulldate dqDate.value = e.fulldate
zhou_firstday.value=e.fulldate zhou_firstday.value = e.fulldate
getdoctorList() getdoctorList()
} }
onShow(() => { onShow(() => {
selectedDate.value='' selectedDate.value = ''
dqDate.value='' dqDate.value = ''
console.log($props.month); console.log($props.month);
if (!!config_ref.value) { if (!!config_ref.value) {
mountedAction(); 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 class="pb-40rpx">
<view class="h-38rpx pl-20rpx pr-20rpx box-border">
<view style="height: 20rpx;"></view>
<view
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff"
>
<view class="zhou" v-if="week7.length>1">
<view class="day" v-for="(item,index) in week7">
<view :class="item.date==selectedDate?'day_top selected':'day_top'" @click="selectDateFunc(item.date)">
<view>{{item.date.split('-').slice(1).join('/')}}</view>
<view class="zhou_title">{{ item.xingqi.replace('星期', '周').replace('日', '天')}}</view>
</view>
</view>
<view class="xian_k">
<view class="xian"></view>
</view>
<view class="rili_icon" @click="ClickMore()">
<uni-icons type="calendar" style="font-size: 50rpx;" color="#239EA3"></uni-icons>
<text>更多</text>
</view>
</view> </view>
<view v-if="doctor_list.length>0"> <view class="pb-40rpx">
<view v-for="(item, index) in doctor_list" :key="index" class="p-10rpx"> <view class="h-38rpx pl-20rpx pr-20rpx box-border">
<view class="flex flex-row text-#8B8B8B text-23rpx"> <view style="height: 20rpx;"></view>
<image :src="$image(item.head_img)" class="w-170rpx h-226rpx mr-20rpx"></image> <view style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
<view class="flex-1 flex flex-col flex-justify-start pr-20rpx"> class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff">
<view class="text-#0E0E0E text-36rpx"> <view class="zhou" v-if="week7.length>1">
{{ item.name }} <view class="day" v-for="(item,index) in week7">
<span class="text-26rpx text-#515151 ml-10rpx">{{ <view :class="item.date==selectedDate?'day_top selected':'day_top'"
@click="selectDateFunc(item.date)">
<view>{{item.date.split('-').slice(1).join('/')}}</view>
<view class="zhou_title">{{ item.xingqi.replace('星期', '周').replace('日', '天')}}</view>
</view>
</view>
<view class="xian_k">
<view class="xian"></view>
</view>
<view class="rili_icon" @click="ClickMore()">
<uni-icons type="calendar" style="font-size: 50rpx;" color="#239EA3"></uni-icons>
<text>更多</text>
</view>
</view>
<view v-if="doctor_list.length>0">
<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="text-#0E0E0E text-36rpx">
{{ item.name }}
<span class="text-26rpx text-#515151 ml-10rpx">{{
item.level item.level
}}</span> }}</span>
</view> </view>
<view class="mt-33rpx mb-10rpx line-clamp-1"> <view class="mt-33rpx mb-10rpx line-clamp-1">
<text v-if="false">{{ item.hospital }}:</text> <text v-if="false">{{ item.hospital }}:</text>
<text>{{ item.time }}</text> <text>{{ item.time }}</text>
</view> </view>
<view class="line-clamp-2"> <view class="line-clamp-2">
{{ item.desc }} {{ item.desc }}
</view> </view>
<view <view @click="clickDoctor(item)"
@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">
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>
</view> </view>
<view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" > </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>
</view> </view>
</view> </view>
<view v-else> <uni-calendar class="ylrl" ref="YueLiRef" :selected="MonthList" :startDate="getToday()" :insert="false"
<view v-if="doctor_list!==false" style="font-size: 26rpx; text-align: center;color: #ccc;padding-top: 40rpx;"></view> @confirm="RiLiDateFunc" @monthSwitch="monthSwitch" />
</view> </view>
</view>
</view>
</view>
<uni-calendar ref="YueLiRef" :selected="MonthList" :startDate="getToday()" :insert="false"
@confirm="RiLiDateFunc" @monthSwitch="monthSwitch" />
</view>
</template> </template>
<style scoped> <style scoped>
.zhou { .zhou {
@ -232,7 +268,7 @@ onShow(() => {
align-items: center; align-items: center;
font-size: 25rpx; font-size: 25rpx;
font-weight: 500; font-weight: 500;
color: #131313; color: #636363;
} }
.day_top { .day_top {
@ -286,6 +322,73 @@ onShow(() => {
color: #239EA3; color: #239EA3;
font-weight: 500; font-weight: 500;
} }
</style>
<style lang="scss">
::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> </style>

@ -235,7 +235,7 @@
</view> </view>
<view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" > </view> <view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" > </view>
</view> </view>
<uni-calendar :selected="MonthList" :startDate="getToday()" :insert="true" :date="currentDate" <uni-calendar :selected="MonthList" :startDate="getToday()" :insert="true" :date="currentDate"
@change="changerl" @monthSwitch="monthSwitch" /> @change="changerl" @monthSwitch="monthSwitch" />
</view> </view>
<!-- <view style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)" <!-- <view style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
@ -317,6 +317,13 @@
.uni-calendar-item__weeks-box-text { .uni-calendar-item__weeks-box-text {
font-size: 26rpx; font-size: 26rpx;
color:#ccc;
}
.uni-calendar-item__weeks-box-text:has(+ .uni-calendar-item--extra) {
color: #666 ;
}
.uni-calendar-item__weeks-box-text:has(+ .uni-calendar-item--disable) {
color: #ccc !important;
} }
.uni-calendar-item__weeks-lunar-text { .uni-calendar-item__weeks-lunar-text {
@ -336,5 +343,7 @@
display: none; display: none;
} }
} }
} }
</style> </style>
Loading…
Cancel
Save