yanzai 1 year ago
commit 877e768345

@ -254,13 +254,19 @@ const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
mountedAction();
let time = setTimeout(() => {
clearTimeout(time);
mountedAction();
}, 500);
}
};
onShow(() => {
if (!!config_ref.value) {
mountedAction();
let time = setTimeout(() => {
clearTimeout(time);
mountedAction();
}, 500);
}
});
</script>

@ -66,10 +66,10 @@ const getnmrList = async () => {
const comfrimyy = async () => {
let plan_id = "";
let plan_nmr_id = "";
if(!yytjInfo.value?.doctor_name){
uni.$lu.toast("请选择医生");
return;
}
// if(!yytjInfo.value?.doctor_name){
// uni.$lu.toast("");
// return;
// }
console.log(yytjInfo.value?.nmr_list);
for(let i = 0; i < yytjInfo.value?.nmr_list?.length; i++){
if(!yytjInfo.value?.nmr_list[i].time){
@ -99,7 +99,7 @@ const comfrimyy = async () => {
const response = await $api("OrderCreate", obj);
$response(response, () => {
if(response.status && !response.action){
if(response.status){
if(response.action == "pay"){
StartPay();
}else{
@ -353,7 +353,7 @@ const toRouter = (url, status) => {
>
<view class="text-#0E0E0E text-30rpx mb-35rpx">套餐名称</view>
<view class="text-24rpx between">
<text class="text-#0E0E0E">{{ comboInfo?.crowd_name || groupInfo?.crowd_name }}</text>
<text class="text-#0E0E0E">{{ comboInfo?.combo_name || groupInfo?.combo_name }}</text>
<text>¥{{ comboInfo?.price || groupInfo?.sixi_zong_ji_jin_e }}</text>
</view>
</view>

@ -39,9 +39,9 @@ const mountedAction = async () => {
};
onBeforeUnmount(() => {
if(!status.value){
$store.setYytjInfo(uni.getStorageSync("yytjInfoS"));
}
if (!status.value) {
$store.setYytjInfo(uni.getStorageSync("yytjInfoS"));
}
});
const init = async () => {};
@ -62,14 +62,14 @@ const getnmrList = async () => {
return {
...val,
time: "",
id: "",
id: "",
};
});
yytjInfo.value.nmr_list.push({
item_id: -1,
name: "体检时间",
time: "",
id: "",
id: "",
});
}
uni.hideLoading();
@ -87,20 +87,32 @@ const getToday = () => {
//
return year + "-" + month + "-" + day;
};
const getTjTimeList = async (timeItem) => {
const getTjTimeList = async (val) => {
console.log($store.getCheckupTypeId());
console.log(val);
//
let obj = {
hospital: buyInfo.value.hospital,
person_id: buyInfo.value.person_id,
date: currentDate.value, //currentDate.value
use_type: buyInfo.value.group_id ? 2 : 1,
checkup_type_id: buyInfo.value.group_id
? $store.getGroupInfo()?.checkup_type_id
: $store.getCheckupTypeId().id,
amount: truePrice.value,
};
const response = await $api("GetDayPlanList", obj);
let obj = {};
let apiText = "";
if (val.item_id == -1) {
obj = {
hospital: buyInfo.value.hospital,
person_id: buyInfo.value.person_id,
date: currentDate.value, //currentDate.value
use_type: buyInfo.value.group_id ? 2 : 1,
checkup_type_id: buyInfo.value.group_id
? $store.getGroupInfo()?.checkup_type_id
: $store.getCheckupTypeId().id,
amount: truePrice.value,
};
apiText = "GetDayPlanList";
} else {
obj = {
hospital_id: buyInfo.value.hospital,
date: currentDate.value,
};
apiText = "NMRGetDayPlanList";
}
const response = await $api(apiText, obj);
$response(response, () => {
console.log(response, "response");
// currentXmmcObj.value["sj"] = ""; //
@ -111,15 +123,18 @@ const getTjTimeList = async (timeItem) => {
time_list.value.forEach((item) => {
console.log(item.date);
item.newTime = item.time.slice(0, 5);
item.date = currentDate.value;
});
date_list.value.forEach((item) => {
console.log(item)
item.item_id = val.item_id;
const [year, month, day] = item.date.split("-");
item.newMonthDate = `${month}/${day}`; //
item.newWeek = item.xingqi.replace("星期", "周");
});
if (timeItem) {
if (val.time) {
timeIndex.value = time_list.value.findIndex(
(item) => item.newTime == timeItem.split(" ")[1]
(item) => item.newTime == val.time.split(" ")[1]
);
}
uni.hideLoading();
@ -136,14 +151,17 @@ const getCurrentClick = (item, i) => {
timeIndex.value = null;
yytjInfo.value.nmr_list[nmrIndex.value].time = "";
yytjInfo.value.nmr_list[nmrIndex.value].id = "";
console.log(yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time, "xxsxsx");
if(!yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time){
yytjInfo.value.doctor_name = "";
}
console.log(
yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time,
"xxsxsx"
);
if (!yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time) {
yytjInfo.value.doctor_name = "";
}
$store.setYytjInfo(yytjInfo.value);
status.value = 0;
status.value = 0;
currentDate.value = item.date;
getTjTimeList(); //
getTjTimeList(item); //
};
const getCurrentTime = (item, index) => {
//
@ -151,22 +169,23 @@ const getCurrentTime = (item, index) => {
uni.$lu.toast("该号源已被其他人预约");
return;
}
console.log(item);
console.log(item);
timeIndex.value = index;
yytjInfo.value.nmr_list[nmrIndex.value].time = item.date + " " + item.newTime;
yytjInfo.value.nmr_list[nmrIndex.value].id = item.id;
status.value = 0;
status.value = 0;
$store.setYytjInfo(yytjInfo.value);
};
const xmmcClick = (val, index) => {
//
//
nmrIndex.value = index;
time.value = "";
timeIndex.value = null;
if (val.time) {
currentDate.value = val.time.split(" ")[0];
}
getTjTimeList(val.time);
//
getTjTimeList(val);
};
const clickDoctor = () => {
@ -175,16 +194,14 @@ const clickDoctor = () => {
uni.$lu.toast("请先选择体检时间");
return;
}
status.value = 0;
status.value = 0;
uni.navigateTo({
url: `/pages/main/selectDoctor/selectDoctor?date=${currentDate.value}`,
});
};
const comfrimyy = () => {
status.value = 1;
status.value = 1;
uni.navigateBack({
delta: 1,
});

Loading…
Cancel
Save