详情页面增加了团检和个人自选的逻辑,增加了团检选择类型的页面

wenjuan
刘佳宇 1 year ago
parent cad351a57a
commit e71f63f064

@ -96,6 +96,22 @@
"navigationBarTitleText" : "", "navigationBarTitleText" : "",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
},
{
"path" : "pages/main/optionalProject/choose",
"style" :
{
"navigationBarTitleText" : "团检预约",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/main/optionalProject/selectType",
"style" :
{
"navigationBarTitleText" : "团检预约",
"enablePullDownRefresh" : false
}
} }
], ],
"globalStyle": { "globalStyle": {

@ -0,0 +1,238 @@
<script setup>
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import { ref } from "vue";
import { $api, $image, $response } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
const $store = useStore();
const person_list = ref([]);
let popup = ref(null);
let unitList = ref([]); //
const getPersonList = async () => {
const response = await $api("GetPersonList");
$response(response, () => {
person_list.value = response.data.list;
});
};
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
getPersonList();
}
};
const choosePersonClick = async (info) => {
// ID
const response = await $api("GetGroupUnit", {
hospital_id: $store.save.hospital,
id_number: info.id_number,
phone: info.phone,
});
$response(response, () => {
unitList.value = response.data.unit;
if (response.data.unit.length > 1) {
popup.value.open("bottom");
}
if (response.data.unit.length == 1) {
// selectUnit(response.data.unit[0]);
getGroupCombo(response.data.unit[0]);
}
});
};
const getGroupCombo = async (info) => {
//
const response = await $api("GetGroupCombo", {
hospital_id: $store.save.hospital,
group_id: info.group_id,
});
$response(response, () => {
console.log(response);
if (response.data.unit.length) {
let data = response.data.unit[0];
$store.setGroupInfo(data);
if (!data.items.length && data.tongshou_xiane > 0) {
//
uni.navigateTo({
url:
"/pages/main/optionalProject/selectType"
});
} else {
uni.navigateTo({
url:
"/pages/main/optionalProject/optionalDetails?groupId=" +
info.group_id
});
}
}
});
};
const selectUnit = async (info) => {
popup.value.close();
uni.navigateTo({
url: "/pages/main/optionalProject/optionalDetails?groupId=" + info.group_id,
});
};
onShow(() => {
if (!!config_ref.value) {
getPersonList();
}
});
</script>
<template>
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<view class="person_list_wrapper">
<view
class="person_item_wrapper"
v-for="(i, k) in person_list"
:key="k"
@click="choosePersonClick(i)"
>
<view class="person_avatar_wrapper">
<image v-if="i.sex === 1" src="@/static/assets/userm.png"></image>
<image v-else src="@/static/assets/userw.png"></image>
</view>
<view class="person_info_wrapper">
<view class="person_text_wrapper">
<view class="person_name_wrapper">{{ i.name }}</view>
<view class="person_sex_wrapper"
>{{ i.sex === 1 ? "男" : "女" }}</view
>
</view>
<view class="person_idnumber_wrapper">{{ i.id_number }}</view>
</view>
<view v-if="!!i.relation" class="person_type_wrapper">{{
i.relation
}}</view>
<view class="person_type_wrapper">本人</view>
<!-- <view v-if="i.is_default === 2" @click="choosePersonClick(i)" class="person_choose_wrapper"></view> -->
</view>
</view>
<uni-popup ref="popup">
<view
class="center relative pt-47rpx pb-32rpx text-36rpx bg-#fff rounded-t-15rpx box-border"
>
<text class="line-height-[1] text-32rpx">请选择单位</text>
<uni-icons
@click="popup.close()"
type="closeempty"
color="#A6A6A6"
size="26"
class="absolute right-40rpx top-30rpx"
></uni-icons>
</view>
<view class="bg-#fff pb-40rpx">
<view
class="pt-20rpx pb-20rpx texdt-28rpx text-center"
v-for="(i, k) in unitList"
:key="k"
@click="getGroupCombo(i)"
>{{ i.group_name }}</view
>
</view>
</uni-popup>
</view>
</template>
<style scoped>
.person_list_wrapper {
width: 750rpx;
margin: 0 auto;
overflow-y: auto;
}
.person_item_wrapper {
width: 690rpx;
height: 166rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04);
border-radius: 15rpx;
position: relative;
display: flex;
align-items: center;
margin: 20rpx auto 0;
}
.person_avatar_wrapper {
width: 105rpx;
height: 105rpx;
margin-left: 47rpx;
}
.person_avatar_wrapper image {
width: 105rpx;
height: 105rpx;
display: inline-block;
object-fit: contain;
}
.person_info_wrapper {
margin-left: 38rpx;
}
.person_text_wrapper {
display: flex;
align-items: end;
}
.person_name_wrapper {
font-weight: 500;
font-size: 32rpx;
color: #0e0e0e;
line-height: 1;
}
.person_sex_wrapper {
font-size: 24rpx;
color: #9e9e9e;
line-height: 1;
margin-left: 10rpx;
}
.person_idnumber_wrapper {
font-size: 26rpx;
color: #0e0e0e;
line-height: 1;
margin-top: 20rpx;
}
.person_type_wrapper {
position: absolute;
width: 100rpx;
height: 46rpx;
background: #c0c0c0;
border-radius: 0rpx 15rpx 0rpx 15rpx;
right: 0;
top: 0;
font-weight: 500;
font-size: 24rpx;
color: #ffffff;
line-height: 46rpx;
text-align: center;
}
.person_choose_wrapper {
position: absolute;
right: 10rpx;
bottom: 10rpx;
width: 130rpx;
height: 50rpx;
background: #239ea3;
border-radius: 25rpx;
font-weight: 400;
font-size: 22rpx;
color: #ffffff;
line-height: 50rpx;
text-align: center;
}
</style>

@ -18,6 +18,8 @@ let personId = ref(""); // 患者id
let groupId = ref(""); // id let groupId = ref(""); // id
let tabIndex = ref(0); // let tabIndex = ref(0); //
let totalPrice = ref(0); // let totalPrice = ref(0); //
let patientInfo = ref({}); // ()
let groupInfo = ref({}); //
const $props = defineProps({ const $props = defineProps({
comboId: { comboId: {
@ -36,7 +38,7 @@ const $props = defineProps({
const mountedAction = async () => { const mountedAction = async () => {
selectIds.value = $props.itemIds?.split(",") || []; selectIds.value = $props.itemIds?.split(",") || [];
console.log($store.user);
comboId.value = $props.comboId || ""; comboId.value = $props.comboId || "";
personId.value = $props.personId || ""; personId.value = $props.personId || "";
groupId.value = $props.groupId || ""; groupId.value = $props.groupId || "";
@ -57,10 +59,14 @@ const getBuyInfo = async () => {
}; };
const response = await $api("BuyInfo", obj); const response = await $api("BuyInfo", obj);
$response(response, () => { $response(response, () => {
uni.hideLoading();
if (groupId.value) {
groupInfo.value = response.data.group_info[0];
return;
}
comboInfo.value = response.data.combo_info; comboInfo.value = response.data.combo_info;
itemsInfo.value = response.data.items_info; itemsInfo.value = response.data.items_info;
totalPrice.value = response.data.true_price; totalPrice.value = response.data.true_price;
uni.hideLoading();
}); });
}; };
@ -127,7 +133,7 @@ onShow(() => {
" "
/> />
</view> </view>
<view> <view v-if="comboInfo.tags2.length">
<text <text
v-for="(val, i) in comboInfo.tags2" v-for="(val, i) in comboInfo.tags2"
:key="i" :key="i"
@ -163,13 +169,34 @@ onShow(() => {
<text class="text-#0E0E0E">{{ comboInfo.hospital_name }}</text> <text class="text-#0E0E0E">{{ comboInfo.hospital_name }}</text>
</view> </view>
</view> </view>
<view v-else class="px-15rpx pt-10rpx">
<view class="flex items-center">
<image src="@/static/assets/userm.png" class="w-70rpx h-70rpx mr-35rpx" />
<view class="flex items-center grow">
<text class="text-#707070 text-24rpx">您好</text>
<text class="text-#0E0E0E text-32rpx">{{groupInfo.name}}</text>
</view>
</view>
<view v-if="groupId" class="text-24rpx mt-40rpx">
<view class="pb-30rpx">
<text class="text-#8B8B8B">单位名称</text>
<text>{{ groupInfo.group_name }}</text>
</view>
<view class="pb-30rpx">
<text class="text-#8B8B8B">部门名称</text>
<text>{{ groupInfo.group_name }}</text>
</view>
<view v-if="groupInfo.combo_name">
<text class="text-#8B8B8B">套餐名称</text>
<text>{{ groupInfo.combo_name }}</text>
</view>
</view>
</view>
</view> </view>
<view class="pb-300rpx"> <view class="pb-300rpx">
<view <view class="flex items-center justify-around px-30rpx mt-30rpx">
class="flex items-center justify-around px-30rpx mt-30rpx"
v-if="comboId"
>
<text <text
v-if="comboId || groupId"
@click="tabIndex = 0" @click="tabIndex = 0"
:class="tabIndex == 0 ? 'active' : ''" :class="tabIndex == 0 ? 'active' : ''"
class="text-30rpx text-#2E2E2E" class="text-30rpx text-#2E2E2E"
@ -187,7 +214,7 @@ onShow(() => {
class="mt-20rpx bg-#fff py-40rpx px-14rpx box-border flex-col flex" class="mt-20rpx bg-#fff py-40rpx px-14rpx box-border flex-col flex"
> >
<!-- 套餐内容 --> <!-- 套餐内容 -->
<view v-if="comboId" class="mb-20rpx"> <view v-if="comboInfo.items?.length" class="mb-20rpx">
<!-- 套餐 --> <!-- 套餐 -->
<view class="text-#2E2E2E text-30rpx center mb-20rpx" <view class="text-#2E2E2E text-30rpx center mb-20rpx"
>套餐项目{{ comboInfo.items?.length }}</view >套餐项目{{ comboInfo.items?.length }}</view

@ -0,0 +1,216 @@
<script setup>
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import { ref } from "vue";
import { $api, $response } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
const $store = useStore();
let groupInfo = ref({});
const mountedAction = () => {
groupInfo.value = $store.getGroupInfo();
console.log(groupInfo.value);
};
const config_ref = ref(null);
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e;
mountedAction();
}
};
onShow(() => {
if (!!config_ref.value) {
mountedAction();
}
});
const toDetails = (type) => {
let url = "";
if(type == 1){
url = "/pages/main/optionalProject/optionalProject?projectId=" + groupInfo.project_id;
}else{
url = "/pages/main/optionalProject/optionalDetails";
}
uni.navigateTo({
url: url,
});
};
</script>
<template>
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
</view>
<view class="px-30rpx box-border comboInfo">
<view
class="pt-35rpx rounded-15rpx px-10rpx bg-#fff pb-30rpx box-border b-0 b-t-1 b-solid b-#E1ECEE"
>
<view class="px-15rpx pt-10rpx">
<view class="flex items-center">
<image src="@/static/assets/userm.png" class="w-70rpx h-70rpx mr-35rpx" />
<view class="flex items-center grow">
<text class="text-#707070 text-24rpx">您好</text>
<text class="text-#0E0E0E text-32rpx">{{ groupInfo.name }}</text>
</view>
</view>
<view class="text-24rpx mt-40rpx">
<view class="pb-30rpx">
<text class="text-#8B8B8B">单位名称</text>
<text>{{ groupInfo.group_name }}</text>
</view>
<view class="pb-30rpx">
<text class="text-#8B8B8B">部门名称</text>
<text>{{ groupInfo.group_name }}</text>
</view>
<view class="pb-30rpx">
<text class="text-#8B8B8B">套餐名称</text>
<text>{{ groupInfo.combo_name }}</text>
</view>
<view>
<text class="text-#8B8B8B">体检额度</text>
<text>{{ groupInfo.tongshou_xiane }}</text>
</view>
</view>
</view>
<!-- <view class="flex w-full" v-if="comboId">
<image
:src="$image(comboInfo.img)"
class="w-190rpx h-190rpx mr-37rpx"
mode="widthFix"
/>
<view class="flex flex-col grow">
<text>{{ comboInfo.combo_name }}</text>
<view class="mt-13rpx mb-18rpx">
<uni-tag
v-for="(val, i) in comboInfo.tag"
:key="i"
size="small"
:inverted="true"
:text="val.text"
class="mr-8rpx"
:custom-style="
'background-color:' +
val.color +
';border-color:' +
val.color +
'; color:' +
val.text_color +
';'
"
/>
</view>
<view v-if="comboInfo.tags2.length">
<text
v-for="(val, i) in comboInfo.tags2"
:key="i"
class="text-#8B8B8B text-20rpx line-height-[1] px-5rpx b-0 b-solid b-#8B8B8B"
:class="i == comboInfo.tags2.length - 1 ? 'b-r-0' : 'b-r-2'"
>{{ val }}</text
>
</view>
<view class="mt-20rpx w-full flex items-end">
<text class="text-18rpx text-#EC3D15">¥</text>
<text class="text-38rpx text-#EC3D15 mx-10rpx -mb-8rpx">{{
comboInfo.price
}}</text>
<text class="text-18rpx text-#878787 line-through">{{
comboInfo.original_price
}}</text>
<text class="text-18rpx text-#878787 ml-auto mr-55rpx"
>已售{{ comboInfo.sale_count }}</text
>
</view>
</view>
</view>
<view
v-if="comboId"
class="mt-25rpx pt-25rpx b-0 b-t-1 b-solid b-#E1ECEE bettween flex-col text-24rpx"
>
<view>
<text class="text-#8B8B8B">适用人群</text>
<text class="text-#0E0E0E">{{ comboInfo.crowd_name }}</text>
</view>
<view>
<text class="text-#8B8B8B">适用院区</text>
<text class="text-#0E0E0E">{{ comboInfo.hospital_name }}</text>
</view>
</view> -->
</view>
<view class="mt-30rpx pt-35rpx px-25rpx pb-200rpx box-border bg-#fff">
<view v-if="groupInfo.tongshou_xiane" class="mb-70rpx bg-#FFF8EB text-center text-#DA9616 text-24rpx py-22rpx">
<text>本次团队体检您有</text>
<text class="text-#239EA3">{{ groupInfo.tongshou_xiane }}</text>
<text>体检额度</text>
<br />
<text>我们提供如下两种方式供您自由选择</text>
</view>
<view>
<view class="py-30rpx pl-50rpx pr-130rpx between box-border rounded-15rpx shadow-[0px_1rpx_4rpx_0px_rgba(0,164,172,0.16)]" @click="toDetails(1)">
<view class="center w-82rpx h-82rpx">
<image class="w-40rpx h-40rpx" src="@/static/assets/taocan.png" />
</view>
<text class="text-#000000 text-32rpx">按套餐选择</text>
<uni-icons
type="right"
color="#595757"
size="26"
></uni-icons>
</view>
<view class="py-30rpx mt-70rpx pl-50rpx pr-130rpx between box-border rounded-15rpx shadow-[0px_1rpx_4rpx_0px_rgba(0,164,172,0.16)]" @click="toDetails(2)">
<view class="center w-82rpx h-82rpx">
<image class="w-40rpx h-40rpx" src="@/static/assets/xiangmu.png" />
</view>
<text class="text-#000000 text-32rpx">按项目选择</text>
<uni-icons
type="right"
color="#595757"
size="26"
></uni-icons>
</view>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.comboInfo {
position: relative;
z-index: 1;
&::after {
content: "";
width: 100%;
height: 50rpx;
background-color: #239ea3;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.active {
color: #239ea3;
font-weight: bold;
position: relative;
&::after {
content: "";
width: 26rpx;
height: 3rpx;
background-color: #239ea3;
position: absolute;
left: 50%;
bottom: -10rpx;
transform: translateX(-50%);
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

@ -6,8 +6,10 @@ export const useStore = defineStore('counter', {
state: () => ({ state: () => ({
user: false, user: false,
config: false, config: false,
patientInfo: {}, // 病人信息
groupInfo: {}, // 团检信息
save: { save: {
hospital: 0, hospital: 1,
doctor: 1, doctor: 1,
}, },
api_map: {}, api_map: {},
@ -15,6 +17,20 @@ export const useStore = defineStore('counter', {
loading: 0, loading: 0,
}), }),
actions: { actions: {
setPatientInfo(info){
this.patientInfo = info;
uni.setStorageSync('PATIENT_INFO', JSON.stringify(info));
},
getPatientInfo(){
return JSON.parse(uni.getStorageSync('PATIENT_INFO')) || this.patientInfo;
},
setGroupInfo(info){
this.groupInfo = info;
uni.setStorageSync('GROUP_INFO', JSON.stringify(info));
},
getGroupInfo(){
return JSON.parse(uni.getStorageSync('GROUP_INFO')) || this.groupInfo;
},
resetSaveInfo() { resetSaveInfo() {
this.save = { this.save = {
hospital: 0, hospital: 0,

Loading…
Cancel
Save