yanzai 1 year ago
commit 3c5c58949e

@ -51,12 +51,14 @@ const getnmrList = async () => {
return {
...val,
time: "",
id: "",
};
});;
yytjInfo.value.nmr_list.push({
item_id: -1,
name: "体检时间",
time: ""
time: "",
id: "",
})
}
uni.hideLoading();
@ -71,19 +73,19 @@ const comfrimyy = async () => {
// 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){
// uni.$lu.toast("");
// return;
// }
// }
for(let i = 0; i < yytjInfo.value?.nmr_list?.length; i++){
if(!yytjInfo.value?.nmr_list[i].time){
uni.$lu.toast("请选择预约时间");
return;
}
}
// if(yytjInfo.value?.nmr_list?.length > 1){
// plan_nmr_id = yytjInfo.value?.nmr_list[0]?.id;
// }
// if(yytjInfo.value?.nmr_list?.length > 1){
// plan_id = yytjInfo.value?.nmr_list[yytjInfo.value?.nmr_list.length - 1]?.id;
// }
if(yytjInfo.value?.nmr_list?.length > 1){
plan_nmr_id = yytjInfo.value?.nmr_list[0]?.id;
}
if(yytjInfo.value?.nmr_list?.length > 1){
plan_id = yytjInfo.value?.nmr_list[yytjInfo.value?.nmr_list.length - 1]?.id;
}
console.log(groupInfo.value);

@ -32,7 +32,8 @@ const mountedAction = async () => {
uni.showLoading({
title: "加载中",
});
await init(); //
console.log($store.getYytjInfo(), "swsw");
console.log($store.getBuyInfo(), "tyuiopiuytr");
yytjInfo.value = $store.getYytjInfo();
buyInfo.value = $store.getBuyInfo();
await getnmrList();
@ -44,8 +45,6 @@ onBeforeUnmount(() => {
}
});
const init = async () => {};
const getnmrList = async () => {
const response = await $api("BuyInfo", buyInfo.value);
$response(response, () => {
@ -57,6 +56,7 @@ const getnmrList = async () => {
itemsInfo.value = response.data.items_info;
truePrice.value = response.data.true_price;
currentDate.value = getToday(); //huo
if (!yytjInfo.value?.nmr_list?.length) {
yytjInfo.value.nmr_list = response.data.nmr_list.map((val) => {
return {
@ -101,7 +101,7 @@ const getTjTimeList = async (val) => {
use_type: buyInfo.value.group_id ? 2 : 1,
checkup_type_id: buyInfo.value.group_id
? $store.getGroupInfo()?.checkup_type_id
: $store.getCheckupTypeId().id,
: $store.getCheckupTypeId()?.id,
amount: truePrice.value,
};
apiText = "GetDayPlanList";
@ -123,11 +123,11 @@ const getTjTimeList = async (val) => {
time_list.value.forEach((item) => {
console.log(item.date);
item.newTime = item.time.slice(0, 5);
item.date = currentDate.value;
item.date = currentDate.value;
});
date_list.value.forEach((item) => {
console.log(item)
item.item_id = val.item_id;
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("星期", "周");
@ -183,6 +183,8 @@ const xmmcClick = (val, index) => {
timeIndex.value = null;
if (val.time) {
currentDate.value = val.time.split(" ")[0];
} else {
currentDate.value = getToday();
}
//
getTjTimeList(val);

@ -22,7 +22,7 @@ export const useStore = defineStore('counter', {
}),
actions: {
getCheckupTypeId() {
return JSON.parse(uni.getStorageSync('CHECKUP_TYPE')) || this.checkup_type;
return JSON.parse(uni.getStorageSync('CHECKUP_TYPE') || '{}') || this.checkup_type;
},
setCheckupTypeId(data) {
this.checkup_type = data;
@ -42,6 +42,7 @@ export const useStore = defineStore('counter', {
uni.setStorageSync('YYTJ_INFO', JSON.stringify(yytjInfo));
},
getYytjInfo() {
console.log(uni.getStorageSync('YYTJ_INFO'));
return JSON.parse(uni.getStorageSync('YYTJ_INFO') || '{}') || this.yytjInfo;
},
setUser(user) {

Loading…
Cancel
Save