日历微调

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,20 +1,30 @@
<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
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
const $store = useStore();
let dqDate = ref("");
let yytjInfo = ref({}); //
let user_person = ref({});
let zhou_firstday = ref('');
const $props = defineProps({
date: { date: {
type: String, type: String,
default: "", default: "",
@ -23,18 +33,18 @@ const $props = defineProps({
type: String, type: String,
default: "", 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,
} }
@ -42,19 +52,19 @@ const mountedAction = () => {
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: "加载中",
@ -63,55 +73,81 @@ const getdoctorList = async () => {
$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();
});
};
const RiLiGetDoctorPaiBan=ref([]);
const RiLiGetDoctorPaiBanFuc=async()=>{
return false;
let c_type = $store.getCheckupTypeId()
//
let obj = {
hospital: $store.save.hospital,
date: "",
month: nowMonth.value,
person_id: user_person.value.person_id,
checkup_type: c_type.id,
zhou_firstday: zhou_firstday.value
};
uni.showLoading({
title: "加载中",
});
const response = await $api("DoctorGetList", obj);
$response(response, () => {
RiLiGetDoctorPaiBan=res.data.
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.doctor_id = item.id; yytjInfo.value.doctor_id = item.id;
yytjInfo.value.nmrIndex = -1; yytjInfo.value.nmrIndex = -1;
$store.setYytjInfo(yytjInfo.value); $store.setYytjInfo(yytjInfo.value);
if($props.month=='all'){ if ($props.month == 'all') {
uni.navigateTo({ uni.navigateTo({
url:'/pages/main/ysdate/ysdate_new' url: '/pages/main/ysdate/ysdate_new'
}) })
}else{ } else {
// item.name // item.name
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
}); });
} }
}; };
let selectedDate=ref(""); let selectedDate = ref("");
const selectDateFunc=(date)=>{ const selectDateFunc = (date) => {
selectedDate.value=date selectedDate.value = date
dqDate.value=date dqDate.value = date
getdoctorList() getdoctorList()
} }
let YueLiRef=ref(null); let YueLiRef = ref(null);
// let nowMonth = ref('');
const ClickMore=()=>{ //
const ClickMore = async () => {
YueLiRef.value.open() YueLiRef.value.open()
} RiLiGetDoctorPaiBanFuc()
const getToday = () => { }
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,24 +168,26 @@ 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 />
@ -160,13 +198,12 @@ onShow(() => {
<view class="pb-40rpx"> <view class="pb-40rpx">
<view class="h-38rpx pl-20rpx pr-20rpx box-border"> <view class="h-38rpx pl-20rpx pr-20rpx box-border">
<view style="height: 20rpx;"></view> <view style="height: 20rpx;"></view>
<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="pb-80rpx pt-30rpx rounded-15rpx bg-#fff">
class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff"
>
<view class="zhou" v-if="week7.length>1"> <view class="zhou" v-if="week7.length>1">
<view class="day" v-for="(item,index) in week7"> <view class="day" v-for="(item,index) in week7">
<view :class="item.date==selectedDate?'day_top selected':'day_top'" @click="selectDateFunc(item.date)"> <view :class="item.date==selectedDate?'day_top selected':'day_top'"
@click="selectDateFunc(item.date)">
<view>{{item.date.split('-').slice(1).join('/')}}</view> <view>{{item.date.split('-').slice(1).join('/')}}</view>
<view class="zhou_title">{{ item.xingqi.replace('星期', '周').replace('日', '天')}}</view> <view class="zhou_title">{{ item.xingqi.replace('星期', '周').replace('日', '天')}}</view>
</view> </view>
@ -197,25 +234,24 @@ onShow(() => {
<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>
<view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx" > </view> <view class="w-100% h-1rpx bg-#E6E9E9 mt-15rpx"> </view>
</view> </view>
</view> </view>
<view v-else> <view v-else>
<view v-if="doctor_list!==false" style="font-size: 26rpx; text-align: center;color: #ccc;padding-top: 40rpx;"></view> <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> </view>
<uni-calendar ref="YueLiRef" :selected="MonthList" :startDate="getToday()" :insert="false" <uni-calendar class="ylrl" ref="YueLiRef" :selected="MonthList" :startDate="getToday()" :insert="false"
@confirm="RiLiDateFunc" @monthSwitch="monthSwitch" /> @confirm="RiLiDateFunc" @monthSwitch="monthSwitch" />
</view> </view>
</template> </template>
@ -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>

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