更新 预约日期逻辑调整

main
鹿和sa0ChunLuyu 1 year ago
parent 29bca06861
commit 48088af219

@ -255,13 +255,18 @@
"style": {
"navigationBarTitleText": ""
}
},
{
"path" : "pages/main/question/choose/choose",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path": "pages/main/question/choose/choose",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/main/ysdate/ysdate",
"style": {
"navigationBarTitleText": "预约医生"
}
}
],

@ -1,136 +1,160 @@
<script setup>
import DraggableButton from "@/pages/components/goHome.vue";
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import { ref } from "vue";
import { $api, $image, $response } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
const $store = useStore();
const $props = defineProps({
url: {
type: String,
default: "",
},
});
import DraggableButton from "@/pages/components/goHome.vue";
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import {
ref
} from "vue";
import {
$api,
$image,
$response
} from "@/api";
import {
onShow
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
const $store = useStore();
const $props = defineProps({
url: {
type: String,
default: "",
},
});
const button_list = ref([]);
const getButtonList = async (api) => {
const response = await $api(api);
$response(response, () => {
button_list.value = response.data.list;
});
};
const button_list = ref([]);
const getButtonList = async (api) => {
const response = await $api(api);
$response(response, () => {
// if (api === 'CheckUpTypeGetList') {
// button_list.value = [
// ...response.data.list,
// {
// created_at: "2024-08-29 16:22:12",
// id: 6,
// is_del: 0,
// logo: "/storage/20240822/sfptyuyue.png",
// name: "",
// status: 1,
// updated_at: "2024-10-26 10:45:52",
// url: "/pages/main/ysdate/ysdate"
// }
// ];
// } else {
button_list.value = response.data.list;
// }
});
};
const checkType = () => {
if ($props.url?.includes("api://")) {
let api = $props.url.split("api://")[1];
if (!!api) {
getButtonList(api);
}
}
};
const checkType = () => {
if ($props.url?.includes("api://")) {
let api = $props.url.split("api://")[1];
if (!!api) {
getButtonList(api);
}
}
};
const mountedAction = () => {
checkType();
};
const mountedAction = () => {
checkType();
};
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
mountedAction();
}
};
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
mountedAction();
}
};
const buttonClick = (info) => {
if (!!info.url) {
if (info.id) {
$store.setCheckupTypeId({ id: info.id });
}
$store.setComboContrast([]); //
uni.navigateTo({
url: info.url,
});
} else {
uni.$lu.toast("暂未开放");
}
};
const buttonClick = (info) => {
if (!!info.url) {
if (info.id) {
$store.setCheckupTypeId({
id: info.id
});
}
$store.setComboContrast([]); //
$store.setYytjInfo({});
uni.navigateTo({
url: info.url,
});
} else {
uni.$lu.toast("暂未开放");
}
};
onShow(() => {
if (!!config_ref.value) {
mountedAction();
}
});
onShow(() => {
if (!!config_ref.value) {
mountedAction();
}
});
</script>
<template>
<DraggableButton />
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<DraggableButton />
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<view class="button_list_wrapper">
<view
@click="buttonClick(i)"
class="button_item_wrapper"
v-for="(i, k) in button_list"
:key="k"
>
<view class="button_icon_wrapper">
<image :src="$image(i.logo)"></image>
</view>
<view class="button_name_wrapper">{{ i.name }}</view>
<view class="button_right_wrapper">
<uni-icons type="right" size="20"></uni-icons>
</view>
</view>
</view>
</view>
<view class="button_list_wrapper">
<view @click="buttonClick(i)" class="button_item_wrapper" v-for="(i, k) in button_list" :key="k">
<view class="button_icon_wrapper">
<image :src="$image(i.logo)"></image>
</view>
<view class="button_name_wrapper">{{ i.name }}</view>
<view class="button_right_wrapper">
<uni-icons type="right" size="20"></uni-icons>
</view>
</view>
</view>
</view>
</template>
<style scoped>
.button_list_wrapper {
width: 750rpx;
margin: 0 auto;
overflow-y: auto;
}
.button_list_wrapper {
width: 750rpx;
margin: 0 auto;
overflow-y: auto;
}
.button_item_wrapper {
width: 552rpx;
height: 140rpx;
background: #ffffff;
box-shadow: 0rpx 1rpx 4rpx 0rpx rgba(0, 164, 172, 0.16);
border-radius: 15rpx;
margin: 50rpx auto 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.button_item_wrapper {
width: 552rpx;
height: 140rpx;
background: #ffffff;
box-shadow: 0rpx 1rpx 4rpx 0rpx rgba(0, 164, 172, 0.16);
border-radius: 15rpx;
margin: 50rpx auto 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.button_icon_wrapper {
width: 82rpx;
height: 82rpx;
margin-left: 48rpx;
}
.button_icon_wrapper {
width: 82rpx;
height: 82rpx;
margin-left: 48rpx;
}
.button_icon_wrapper image {
width: 82rpx;
height: 82rpx;
display: inline-block;
object-fit: contain;
}
.button_icon_wrapper image {
width: 82rpx;
height: 82rpx;
display: inline-block;
object-fit: contain;
}
.button_name_wrapper {
font-weight: 500;
font-size: 32rpx;
color: #000000;
line-height: 1;
}
.button_name_wrapper {
font-weight: 500;
font-size: 32rpx;
color: #000000;
line-height: 1;
}
.button_right_wrapper {
margin-right: 48rpx;
}
</style>
.button_right_wrapper {
margin-right: 48rpx;
}
</style>

@ -137,7 +137,14 @@
duo_xuan_yi: $store.getDuoXuanYi(),
wj: wj.value,
});
$store.setYytjInfo({});
if (!!$store.yytjInfo.doctor_name) {
$store.setYytjInfo({
doctor_name: $store.yytjInfo.doctor_name,
doctor_date: $store.yytjInfo.doctor_date,
});
} else {
$store.setYytjInfo({});
}
uni.setStorageSync("yytjInfoS", {});
uni.navigateTo({
url: "/pages/main/tjyy/tjyy",
@ -211,13 +218,12 @@
<view class="pt-35rpx rounded-15rpx px-10rpx bg-#fff pb-30rpx box-border b-0 b-t-1 b-solid b-#E1ECEE">
<view class="flex w-full" v-if="status == 1">
<!-- 1个检套餐 显示套餐信息 -->
<image v-if="comboInfo.img" :src="$image(comboInfo.img)" class="w-190rpx h-190rpx mr-37rpx"
mode="widthFix" />
<image v-if="comboInfo.img" :src="$image(comboInfo.img)" class="w-190rpx h-190rpx mr-37rpx" mode="widthFix" />
<view class="flex flex-col grow">
<text>{{ comboInfo.combo_name }}</text>
<view class="mt-13rpx mb-18rpx">
<uni-tag v-for="(val, i) in comboInfo.tags" :key="i" size="small" :inverted="true"
:text="val.text" class="mr-8rpx" :custom-style="
<uni-tag v-for="(val, i) in comboInfo.tags" :key="i" size="small" :inverted="true" :text="val.text"
class="mr-8rpx" :custom-style="
'background-color:' +
val.color +
';border-color:' +
@ -311,8 +317,8 @@
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view>
<view class="grow center">{{ val.keshi_name }}{{ val.children.length }}</view>
</view>
<view class="flex bg-#efefef text-#000 text-24rpx rounded-10rpx mt-10rpx"
v-for="(v, i) in val.children" :key="i">
<view class="flex bg-#efefef text-#000 text-24rpx rounded-10rpx mt-10rpx" v-for="(v, i) in val.children"
:key="i">
<view
class="min-w-155rpx break-all max-w-155rpx center b-0 b-r-4 b-solid b-#fff p-10rpx box-border text-center">
{{ v.name }}
@ -339,8 +345,8 @@
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view>
<view class="grow center">{{ val.keshi_name }}{{ val.children.length }}</view>
</view>
<view class="flex bg-#efefef text-#000 text-24rpx rounded-10rpx mt-10rpx"
v-for="(v, i) in val.children" :key="i">
<view class="flex bg-#efefef text-#000 text-24rpx rounded-10rpx mt-10rpx" v-for="(v, i) in val.children"
:key="i">
<view
class="min-w-155rpx break-all max-w-155rpx center b-0 b-r-4 b-solid b-#fff p-10rpx box-border text-center">
{{ v.name }}
@ -366,8 +372,8 @@
<view class="min-w-155rpx max-w-155rpx center b-0 b-r-4 b-solid b-#fff"></view>
<view class="grow center">{{ val.keshi_name }}{{ val.children.length }}</view>
</view>
<view class="flex bg-#efefef text-#000 text-24rpx rounded-10rpx mt-10rpx"
v-for="(v, i) in val.children" :key="i">
<view class="flex bg-#efefef text-#000 text-24rpx rounded-10rpx mt-10rpx" v-for="(v, i) in val.children"
:key="i">
<view
class="min-w-155rpx break-all max-w-155rpx center b-0 b-r-4 b-solid b-#fff p-10rpx box-border text-center">
{{ v.name }}
@ -445,8 +451,7 @@
</view>
</view>
<view class="flex">
<button @click="addCombo()"
class="bg-#ED6907 text-30rpx text-#fff rounded-l-full px-34rpx w-200rpx h-full">
<button @click="addCombo()" class="bg-#ED6907 text-30rpx text-#fff rounded-l-full px-34rpx w-200rpx h-full">
增加项目
</button>
<button @click="buy()" class="bg-#239EA3 text-30rpx text-#fff rounded-r-full px-34rpx w-200rpx h-full">

@ -0,0 +1,313 @@
<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({
id: 1
})
yytjInfo.value = {
nmr_list: [],
doctor_date: "",
doctor_name: "",
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 () => {
const response = await $api('UserInfo')
$response(response, () => {
$store.setUser(response.data.info);
setDefaultInfo()
})
}
const mountedAction = async () => {
uni.showLoading({
title: "加载中",
});
await getUserInfo()
};
onBeforeUnmount(() => {
if (!status.value) {
$store.setYytjInfo(uni.getStorageSync("yytjInfoS"));
}
});
const getnmrList = async () => {
const response = await $api("BuyInfo", buyInfo.value);
$response(response, () => {
uni.hideLoading();
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) => {
uni.showLoading({
title: "加载中"
});
const [year, month, day] = currentDate.value.split("-");
let dqmonth = m || `${year}-${month}`; //
let obj = {};
let methods = "";
obj = {
hospital: buyInfo.value.hospital,
person_id: buyInfo.value.person_id,
month: dqmonth, //
use_type: 1,
checkup_type_id: 1,
amount: 0,
};
const response = await $api("GetMonthPlanCount", obj);
$response(response, () => {
rl_list.value = [];
calendarShow.value = true;
uni.hideLoading();
});
};
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;
yytjInfo.value.doctor_name = '';
$store.setYytjInfo(yytjInfo.value);
clickDoctor()
}
const changerl = (e) => {
let deep_date = JSON.parse(JSON.stringify(currentDate.value))
if (!!yytjInfo.value.doctor_name) {
uni.showModal({
title: "提示",
content: "已选择医生,切换日期将重新选择医生,是否继续",
showCancel: true,
success: ({
confirm
}) => {
if (confirm) {
changeDate(e)
} else {
calendarShow.value = false
currentDate.value = deep_date;
yytjInfo.value.doctor_date = e.fulldate;
nextTick(() => {
calendarShow.value = true
})
}
},
});
} else {
changeDate(e)
}
};
const clickDoctor = (s) => {
status.value = 0;
let date = currentDate.value
uni.navigateTo({
url: `/pages/main/selectDoctor/selectDoctor?date=${date}`,
});
};
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();
}
};
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">
<uni-calendar :selected="rl_list" :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>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save