diff --git a/h5/pages.json b/h5/pages.json
index 7779c8f..d35747b 100644
--- a/h5/pages.json
+++ b/h5/pages.json
@@ -1,5 +1,6 @@
{
- "pages": [{
+ "pages": [
+ {
"path": "pages/main/index/index",
"style": {
"navigationBarTitleText": "海南现代妇女儿童医院",
@@ -75,9 +76,17 @@
{
"path": "pages/main/optionalProject/optionalDetails",
"style": {
- "navigationBarTitleText": "自选项目详情",
- "navigationBarBackgroundColor": "#D8EDF2",
- "navigationBarTextStyle": "black"
+ "navigationBarTitleText": "套餐详情",
+ "navigationBarBackgroundColor": "#239EA3",
+ "navigationBarTextStyle": "white"
+ }
+ },
+ {
+ "path": "pages/main/questionnaire/index",
+ "style": {
+ "navigationBarTitleText": "问卷调查",
+ "navigationBarBackgroundColor": "#239EA3",
+ "navigationBarTextStyle": "white"
}
},
{
diff --git a/h5/pages/main/optionalProject/optionalDetails.vue b/h5/pages/main/optionalProject/optionalDetails.vue
index dd2f9db..797890b 100644
--- a/h5/pages/main/optionalProject/optionalDetails.vue
+++ b/h5/pages/main/optionalProject/optionalDetails.vue
@@ -1,49 +1,346 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ comboInfo.combo_name }}
+
+
+
+
+ {{ val }}
+
+
+ ¥
+ {{
+ comboInfo.price
+ }}
+ {{
+ comboInfo.original_price
+ }}
+ 已售{{ comboInfo.sale_count }}
+
+
+
+
+
+ 适用人群:
+ {{ comboInfo.crowd_name }}
+
+
+ 适用院区:
+ {{ comboInfo.hospital_name }}
+
+
+
+
+
+ 套餐内容
+ 体检须知
+
+
+
+
+
+ 套餐项目({{ comboInfo.items?.length }}项)
+
+ 检查项目
+ 检查指标意义
+
+
+
+
+ {{ val.keshi_name }}({{ val.children.length }})
+
+
+ {{ v.name }}
+ {{
+ v.desc || "-"
+ }}
+
+
+
+
+
+
+ 自选项目({{ itemsInfo.items?.length }}项)
+
+ 检查项目
+ 检查指标意义
+
+
+
+
+ {{ val.keshi_name }}({{ val.children.length }})
+
+
+ {{ v.name }}
+ {{
+ v.desc || "-"
+ }}
+
+
+
+
+
+
+
+
+
+
+
+ 套餐价格
+ ¥ {{ comboInfo.price }}
+
+
+ 自选项目价格
+ ¥ {{ itemsInfo.price || 0 }}
+
+
+ 合计费用
+ ¥
+ {{
+ totalPrice
+ }}
+
+
+
+ 增加项目
+ 立即购买
+
+
+
-
\ No newline at end of file
+ &::after {
+ content: "";
+ width: 26rpx;
+ height: 3rpx;
+ background-color: #239ea3;
+ position: absolute;
+ left: 50%;
+ bottom: -10rpx;
+ transform: translateX(-50%);
+ }
+ }
+}
+
diff --git a/h5/pages/main/optionalProject/optionalProject.vue b/h5/pages/main/optionalProject/optionalProject.vue
index 22054a4..a5133f5 100644
--- a/h5/pages/main/optionalProject/optionalProject.vue
+++ b/h5/pages/main/optionalProject/optionalProject.vue
@@ -9,6 +9,8 @@ import { $api, $response, $image } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
+// comboId 套餐ID 没有套餐ID就是个人自选项目
+// itemIds 自选ID
const $props = defineProps({
comboId: {
type: String,
@@ -34,11 +36,12 @@ let optionalOriginalPrice = ref(0); //自选原始价格
let totalPrice = ref(0); // 总折扣价格
let totalOriginalPrice = ref(0); // 总原始价格
let total = ref(0); // 总项目数
-let comboId = ref(0); // 套餐id
+let comboId = ref(""); // 套餐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,
@@ -48,6 +51,7 @@ const getComboRecommend = async () => {
if (recommendPackageList.value.length) {
popup.value.open("center");
}
+ uni.hideLoading();
});
};
@@ -69,6 +73,9 @@ const getAllItems = async (e) => {
const getBuyInfo = async () => {
// 获取购买信息
+ uni.showLoading({
+ title: "加载中",
+ });
let obj = {
item_ids: selectIds.value,
hospital: $store.save_info.hospital,
@@ -85,14 +92,46 @@ const getBuyInfo = async () => {
totalPrice.value = response.data.true_price;
totalOriginalPrice.value = response.data.original_price;
total.value = response.data.pay_item_count;
+ uni.hideLoading();
});
};
-const mountedAction = () => {
+const confirm = async () => {
+ const itemIds = selectIds.value.length > 0 ? selectIds.value.join(",") : "";
+ // 确定
+ if (comboId.value) {
+ // 增加自选
+ uni.navigateBack({
+ delta: 2,
+ success: () => {
+ let time = setTimeout(() => {
+ uni.navigateTo({
+ url:
+ "/pages/main/optionalProject/optionalDetails?comboId=" +
+ comboId.value +
+ "&itemIds=" +
+ itemIds,
+ });
+ clearTimeout(time);
+ }, 500);
+ },
+ });
+ } else {
+ // 自选
+ if (!selectIds.value.length) {
+ uni.$lu.toast("请选择项目");
+ return;
+ }
+ // 自选触发推荐套餐
+ getComboRecommend();
+ }
+};
+
+const mountedAction = async () => {
selectIds.value = $props.itemIds?.split(",") || [];
- comboId.value = Number($props.comboId);
- getAllItems(); // 获取全部项目
- getComboRecommend();
+ comboId.value = $props.comboId ? $props.comboId : "";
+ await getAllItems(); // 获取全部项目
+ // await getComboRecommend();
if (comboId.value) {
getBuyInfo(); // 获取购买信息
}
@@ -122,10 +161,100 @@ onShow(() => {
推荐套餐
-
+
+
+
+
+
+
+ {{ item.name }} {{ item.sex == 0 ? "(男)" : "(女)" }}
+
+
+
+
+ {{ val }}
+
+
+ ¥
+ {{
+ item.price
+ }}
+ {{
+ item.original_price
+ }}
+ 已售{{ item.count }}
+
+
+
+
+
+ 相似度
+ {{ item.recommend?.xiangsidu }}
+ ,{{ item.recommend?.count > 0 ? "增加" : "减少" }}了
+ {{
+ Math.abs(item.recommend?.count)
+ }}
+ 个项目,{{ item.recommend?.money > 0 ? "增加" : "减少" }}了
+ ¥{{ Math.abs(item.recommend?.money) }}
+
+
+
-
-
+
+
@@ -239,9 +368,11 @@ onShow(() => {
自选项目价格
¥ {{ optionalPrice }}¥ {{ optionalPrice || 0 }}
- ¥ {{ optionalOriginalPrice }}
@@ -249,39 +380,18 @@ onShow(() => {
合计费用
¥
{{
- totalPrice
+ totalPrice || 0
}}
- ¥ {{ totalOriginalPrice }}