diff --git a/h5/pages.json b/h5/pages.json
index 6b9c544..167a480 100644
--- a/h5/pages.json
+++ b/h5/pages.json
@@ -71,6 +71,14 @@
"style": {
"navigationBarTitleText": "支付完成"
}
+ },
+ {
+ "path": "pages/main/optionalProject/optionalDetails",
+ "style": {
+ "navigationBarTitleText": "自选项目详情",
+ "navigationBarBackgroundColor": "#D8EDF2",
+ "navigationBarTextStyle": "black"
+ }
}
],
"globalStyle": {
diff --git a/h5/pages/main/optionalProject/optionalDetails.vue b/h5/pages/main/optionalProject/optionalDetails.vue
new file mode 100644
index 0000000..dd2f9db
--- /dev/null
+++ b/h5/pages/main/optionalProject/optionalDetails.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/h5/pages/main/optionalProject/optionalProject.vue b/h5/pages/main/optionalProject/optionalProject.vue
index bba1ca0..22054a4 100644
--- a/h5/pages/main/optionalProject/optionalProject.vue
+++ b/h5/pages/main/optionalProject/optionalProject.vue
@@ -10,10 +10,6 @@ import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
const $props = defineProps({
- hospital: {
- type: String,
- default: "",
- },
comboId: {
type: String,
default: "",
@@ -38,6 +34,22 @@ let optionalOriginalPrice = ref(0); //自选原始价格
let totalPrice = ref(0); // 总折扣价格
let totalOriginalPrice = ref(0); // 总原始价格
let total = ref(0); // 总项目数
+let comboId = ref(0); // 套餐id
+let recommendPackageList = ref([]); // 推荐套餐列表
+let popup = ref(null);
+
+const getComboRecommend = async () => {
+ const response = await $api("ComboRecommend", {
+ person_id: $store.save_info.user_id || 1,
+ item_ids: selectIds.value,
+ });
+ $response(response, () => {
+ recommendPackageList.value = response.data.combos;
+ if (recommendPackageList.value.length) {
+ popup.value.open("center");
+ }
+ });
+};
const getAllItems = async (e) => {
// 获取全部项目
@@ -56,11 +68,15 @@ const getAllItems = async (e) => {
};
const getBuyInfo = async () => {
- const response = await $api("BuyInfo", {
+ // 获取购买信息
+ let obj = {
item_ids: selectIds.value,
- hospital: $props.hospital,
- combo_id: $props.comboId,
- });
+ hospital: $store.save_info.hospital,
+ };
+ if (comboId.value) {
+ obj.combo_id = comboId.value;
+ }
+ const response = await $api("BuyInfo", obj);
$response(response, () => {
packagePrice.value = response.data.combo_info.price;
packageOriginalPrice.value = response.data.combo_info.original_price;
@@ -74,8 +90,12 @@ const getBuyInfo = async () => {
const mountedAction = () => {
selectIds.value = $props.itemIds?.split(",") || [];
+ comboId.value = Number($props.comboId);
getAllItems(); // 获取全部项目
- getBuyInfo(); // 获取购买信息
+ getComboRecommend();
+ if (comboId.value) {
+ getBuyInfo(); // 获取购买信息
+ }
};
const config_ref = ref(null);
@@ -98,6 +118,17 @@ onShow(() => {
+
+
+
+ 推荐套餐
+
+
+
+
+
+
+
{
'bg-gradient-to-r from-#edf6f5 to-#bbdfe2': tabIndex == index,
}"
@click="
- (tabIndex = index),
- (rightLeft = item.children),
- (headImg = item.head_img)
+ () => {
+ tabIndex = index;
+ rightLeft = item.children;
+ headImg = item.head_img;
+ }
"
>
{{ item.title }}
-
+
{
'!b-0': index == rightLeft.length - 1,
}"
class="flex justify-between center py-30rpx px-20rpx b-b-1px b-b-solid b-b-#e5e5e5"
- @click="
- () => {
- if (selectIds.includes(item.id)) {
- selectIds.splice(selectIds.indexOf(item.id), 1);
- } else {
- selectIds.push(item.id);
- }
- getBuyInfo();
- }
- "
>
- {{ item.title }}
-
+
+ {{ item.title }}
+
+
+
+
+
+ {{ item.desc }}
+
+
+
+
+
+
+
+ {
+ if (selectIds.includes(item.id)) {
+ selectIds.splice(selectIds.indexOf(item.id), 1);
+ } else {
+ selectIds.push(item.id);
+ }
+ getBuyInfo();
+ }
+ "
+ >
¥ {{ item.price }}
¥ {{ item.original_price }} {
您需付费 \n{{ total }}个项目
-
+
套餐价格
¥ {{ packagePrice }} {
-