diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index dce4c51..aa3b246 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -161,12 +161,10 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group ['name' => '3000以上', 'id' => 5], ]; $item_label = [ - ["id" => 1, 'name' => '一般检查'], - ["id" => 2, 'name' => '血常规'], - ["id" => 3, 'name' => '尿常规'], - ["id" => 4, 'name' => '肝功能'], - ["id" => 5, 'name' => '肾功能'], - ["id" => 6, 'name' => '血糖'] + ["id" => 3468454, 'name' => '内科检查'], + ["id" => 1812, 'name' => '尿常规'], + ["id" => 1955, 'name' => '肝功能'], + ["id" => 1958, 'name' => '肾功能'], ]; return \Yz::Return(true, "查询成功", ['sort_list' => $sort_list, 'combo_type' => $type, 'combo_crowd' => $crowd, 'combo_price' => $price_list, 'combo_item' => $item_label]); } diff --git a/h5/pages/main/combo/combo.vue b/h5/pages/main/combo/combo.vue index c68e74d..ea4900e 100644 --- a/h5/pages/main/combo/combo.vue +++ b/h5/pages/main/combo/combo.vue @@ -501,7 +501,7 @@ const toRouter = () => { - 适用人群 + 体检项目(多选) -import DraggableButton from "@/pages/components/goHome.vue"; -/** - * name: - * user:sa0ChunLuyu - * date:2024年9月11日 19:24:50 - */ -import { ref } from "vue"; -import { $api, $response, $image } from "@/api"; -import { onShow } from "@dcloudio/uni-app"; -import { useStore } from "@/store"; -const $store = useStore(); + import DraggableButton from "@/pages/components/goHome.vue"; + /** + * name: + * user:sa0ChunLuyu + * date:2024年9月11日 19:24:50 + */ + import { + ref + } from "vue"; + import { + $api, + $response, + $image + } from "@/api"; + import { + onShow + } from "@dcloudio/uni-app"; + import { + useStore + } from "@/store"; + const $store = useStore(); -// groupId + // groupId -let comboInfo = ref({}); // 套餐详情 -let selectIds = ref([]); // 选中自选ID -let itemsInfo = ref({}); // 自选项目详情 -let comboId = ref(""); // 套餐id -let personId = ref(""); // 患者id -let groupId = ref(""); // 团检id -let tabIndex = ref(0); // 标签索引 -let totalPrice = ref(0); // 总折扣价格 -let groupInfo = ref({}); // 团检信息 -let status = ref(0); // 1个检套餐 2个检自选 3团检套餐 4团检自选 -let buyText = ref("立即购买"); // 购买按钮文字 -let notice = ref({}); // 体检须知 + let comboInfo = ref({}); // 套餐详情 + let selectIds = ref([]); // 选中自选ID + let itemsInfo = ref({}); // 自选项目详情 + let comboId = ref(""); // 套餐id + let personId = ref(""); // 患者id + let groupId = ref(""); // 团检id + let tabIndex = ref(0); // 标签索引 + let totalPrice = ref(0); // 总折扣价格 + let groupInfo = ref({}); // 团检信息 + let status = ref(0); // 1个检套餐 2个检自选 3团检套餐 4团检自选 + let buyText = ref("立即购买"); // 购买按钮文字 + let notice = ref({}); // 体检须知 -const GetReadmeDetails = async () => { - const response = await $api("GetReadme"); - $response(response, () => { - notice.value = response.data || false; - if (tabIndex.value == 0) { - let num = 5; - buyText.value = "0" + num; - tabIndex.value = 1; - let timer = setInterval(() => { - num--; - buyText.value = "0" + num; - if (num == 0) { - buyText.value = "立即购买"; - clearInterval(timer); - } - }, 1000); - return; - } - uni.hideLoading(); - }); -}; + const GetReadmeDetails = async () => { + const response = await $api("GetReadme"); + $response(response, () => { + notice.value = response.data || false; + if (tabIndex.value == 0) { + let num = 5; + buyText.value = "0" + num; + tabIndex.value = 1; + let timer = setInterval(() => { + num--; + buyText.value = "0" + num; + if (num == 0) { + buyText.value = "立即购买"; + clearInterval(timer); + } + }, 1000); + return; + } + uni.hideLoading(); + }); + }; -const $props = defineProps({ - comboId: { - type: String, - default: "", - }, - personId: { - type: String, - default: "", - }, - groupId: { - type: String, - default: "", - }, - itemIds: { - type: String, - default: "", - }, -}); + const $props = defineProps({ + comboId: { + type: String, + default: "", + }, + personId: { + type: String, + default: "", + }, + groupId: { + type: String, + default: "", + }, + itemIds: { + type: String, + default: "", + }, + }); -const mountedAction = async () => { - selectIds.value = $props.itemIds?.split(",") || []; - console.log($store.user); - comboId.value = $props.comboId || ""; - personId.value = $store.getUser().person_id || ""; - groupId.value = $props.groupId || ""; - // 团检空项目 - 套餐列表 - 套餐详情 - 自选 - 弹剩余额度提醒 - 团检详情 - // | - // 自选 - 弹推荐套餐/剩余额度提醒 - 团检详情 + const mountedAction = async () => { + selectIds.value = $props.itemIds?.split(",") || []; + console.log($store.user); + comboId.value = $props.comboId || ""; + personId.value = $store.getUser().person_id || ""; + groupId.value = $props.groupId || ""; + // 团检空项目 - 套餐列表 - 套餐详情 - 自选 - 弹剩余额度提醒 - 团检详情 + // | + // 自选 - 弹推荐套餐/剩余额度提醒 - 团检详情 - // 团检有项目 - 团检详情 - 自选 - 团检详情 + // 团检有项目 - 团检详情 - 自选 - 团检详情 - // comboId && person_id - // 个检 - 套餐列表 - 套餐详情 - 自选 - 个检详情 - // | - // 自选 - 弹推荐套餐 - 个检详情 + // comboId && person_id + // 个检 - 套餐列表 - 套餐详情 - 自选 - 个检详情 + // | + // 自选 - 弹推荐套餐 - 个检详情 - if (groupId.value) { - if (comboId.value) { - // 团检套餐 - status.value = 3; - } else { - // 团检自选 - status.value = 4; - } - } else { - if (comboId.value) { - // 个检套餐 - status.value = 1; - } else { - // 个检自选 - status.value = 2; - } - } - console.log(status.value, "1个检套餐 2个检自选 3团检套餐 4团检自选"); - uni.showLoading({ - title: "加载中", - }); - getBuyInfo(); // 获取购买信息 -}; + if (groupId.value) { + if (comboId.value) { + // 团检套餐 + status.value = 3; + } else { + // 团检自选 + status.value = 4; + } + } else { + if (comboId.value) { + // 个检套餐 + status.value = 1; + } else { + // 个检自选 + status.value = 2; + } + } + console.log(status.value, "1个检套餐 2个检自选 3团检套餐 4团检自选"); + uni.showLoading({ + title: "加载中", + }); + getBuyInfo(); // 获取购买信息 + }; -const buy = () => { - if (tabIndex.value == 0) { - GetReadmeDetails(); - } - if (tabIndex.value == 1 && buyText.value == "立即购买") { - $store.setBuyInfo({ - combo_id: comboId.value, - person_id: personId.value, - group_id: groupId.value, - item_ids: selectIds.value, - hospital: $store.save_info.hospital, - }); - $store.setYytjInfo({}); - uni.navigateTo({ - url: "/pages/main/tjyy/tjyy", - }); - } -}; + const buy = () => { + if (tabIndex.value == 0) { + GetReadmeDetails(); + } + if (tabIndex.value == 1 && buyText.value == "立即购买") { + $store.setBuyInfo({ + combo_id: comboId.value, + person_id: personId.value, + group_id: groupId.value, + item_ids: selectIds.value, + hospital: $store.save_info.hospital, + }); + $store.setYytjInfo({}); + uni.navigateTo({ + url: "/pages/main/tjyy/tjyy", + }); + } + }; -const getBuyInfo = async () => { - // 获取购买信息 - let obj = { - item_ids: selectIds.value, - combo_id: comboId.value, - hospital: $store.save_info.hospital, - person_id: personId.value, - group_id: groupId.value, - }; - const response = await $api("BuyInfo", obj); - $response(response, () => { - uni.hideLoading(); - if (groupId.value && response.data.group_info.length) { - // 团检 - groupInfo.value = response.data.group_info[0]; - if(response.data.group_info[0].items?.length){ - status.value = 3; - } - } - comboInfo.value = response.data.combo_info; - itemsInfo.value = response.data.items_info; - totalPrice.value = response.data.true_price; - }); -}; + const getBuyInfo = async () => { + // 获取购买信息 + let obj = { + item_ids: selectIds.value, + combo_id: comboId.value, + hospital: $store.save_info.hospital, + person_id: personId.value, + group_id: groupId.value, + }; + const response = await $api("BuyInfo", obj); + $response(response, () => { + uni.hideLoading(); + if (groupId.value && response.data.group_info.length) { + // 团检 + groupInfo.value = response.data.group_info[0]; + if (response.data.group_info[0].items?.length) { + status.value = 3; + } + } + comboInfo.value = response.data.combo_info; + itemsInfo.value = response.data.items_info; + totalPrice.value = response.data.true_price; + }); + }; -const addCombo = () => { - // 增加项目 - let itemIds = $props.itemIds ? $props.itemIds : ""; - let query = "?comboId=" + comboId.value + "&itemIds=" + itemIds; - if (groupId.value) { - query += "&groupId=" + groupId.value; - } - uni.navigateTo({ - url: "/pages/main/tj/tjzx?" + query, - }); -}; + const addCombo = () => { + // 增加项目 + let itemIds = $props.itemIds ? $props.itemIds : ""; + let query = "?comboId=" + comboId.value + "&itemIds=" + itemIds; + if (groupId.value) { + query += "&groupId=" + groupId.value; + } + uni.navigateTo({ + url: "/pages/main/tj/tjzx?" + query, + }); + }; -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(); + } + }; -onShow(() => { - if (!!config_ref.value) { - mountedAction(); - } -}); + onShow(() => { + if (!!config_ref.value) { + mountedAction(); + } + }); + &::after { + content: ""; + width: 26rpx; + height: 3rpx; + background-color: #239ea3; + position: absolute; + left: 50%; + bottom: -10rpx; + transform: translateX(-50%); + } + } + } + \ No newline at end of file