yanzai 1 year ago
commit 877e768345

@ -254,13 +254,19 @@ 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(); let time = setTimeout(() => {
clearTimeout(time);
mountedAction();
}, 500);
} }
}; };
onShow(() => { onShow(() => {
if (!!config_ref.value) { if (!!config_ref.value) {
mountedAction(); let time = setTimeout(() => {
clearTimeout(time);
mountedAction();
}, 500);
} }
}); });
</script> </script>

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

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

Loading…
Cancel
Save