修复套餐对比的bug

wenjuan
刘佳宇 1 year ago
parent 7594ea63cb
commit b9b71b0e31

@ -1,6 +1,6 @@
{ {
"dependencies": { "dependencies": {
"echarts": "^5.5.1", "echarts": "^5.4.2",
"weixin-js-sdk": "^1.6.5" "weixin-js-sdk": "^1.6.5"
}, },
"devDependencies": { "devDependencies": {

@ -28,6 +28,8 @@
}); });
import * as echarts from 'echarts'; import * as echarts from 'echarts';
console.log(echarts)
onMounted(() => { onMounted(() => {
drawChart() drawChart()
}) })

@ -18,14 +18,14 @@ const mountedAction = () => {
const AnalysisTypeGetList = async () => { const AnalysisTypeGetList = async () => {
const response = await $api("AnalysisTypeGetList"); const response = await $api("AnalysisTypeGetList");
$response(response, () => { $response(response, () => {
console.log(response) console.log(response);
list.value = response.data.list; list.value = response.data.list;
}); });
}; };
const toRouter = (index, i) => { const toRouter = (id) => {
uni.navigateTo({ uni.navigateTo({
url: "/pages/main/bgcx/qsfx/qsfxxq?i=" + i + "&index=" + index, url: "/pages/main/bgcx/qsfx/qsfxxq?id=" + id,
}); });
}; };
@ -50,21 +50,32 @@ onShow(() => {
</view> </view>
<view> <view>
<view v-for="(item, index) in list" :key="index" class="flex flex-col mt-25rpx"> <view
v-for="(item, index) in list"
:key="index"
class="flex flex-col mt-25rpx"
>
<view <view
class="w-180rpx rounded-r-full text-#0E0E0E text-25rpx px-40rpx center justify-start h-60rpx box-border bg-gradient-to-r from-#edf6f5 to-#bbdfe2" class="w-180rpx rounded-r-full text-#0E0E0E text-25rpx px-40rpx center justify-start h-60rpx box-border bg-gradient-to-r from-#edf6f5 to-#bbdfe2"
> >
{{ item.title }} {{ item.title }}
</view> </view>
<view class="p-20rpx"> <view class="p-20rpx">
<view v-for="(val, i) in item.list" :key="i" class="mb-10rpx p-[25rpx_20rpx_0rpx_10rpx] box-border between bg-#F1F7F7 rounded-10rpx" @click="toRouter(index, i)"> <view
<view :style="{'background-color': val.color}" class="w-60rpx h-60rpx rounded-full mr-30rpx"></view> v-for="(val, i) in item.list"
:key="i"
class="mb-10rpx p-[25rpx_20rpx_25rpx_10rpx] box-border between bg-#F1F7F7 rounded-10rpx"
@click="toRouter(val.id)"
>
<view
:style="{ 'background-color': val.color }"
class="w-60rpx h-60rpx rounded-full mr-30rpx"
></view>
<view class="flex flex-col mr-auto"> <view class="flex flex-col mr-auto">
<text class="text-#222222 text-28rpx">{{ val.name }}</text> <text class="text-#222222 text-28rpx">{{ val.name }}</text>
<text class="text-#939898 text-22rpx">{{ val.desc }}</text> <text class="text-#939898 text-22rpx">{{ val.desc }}</text>
</view> </view>
<uni-icons type="right" size="15" color="#6A6A6A"></uni-icons> <uni-icons type="right" size="15" color="#6A6A6A"></uni-icons>
</view> </view>
</view> </view>
</view> </view>

@ -4,195 +4,231 @@
* usersa0ChunLuyu * usersa0ChunLuyu
* date2023年3月19日 14:25:22 * date2023年3月19日 14:25:22
*/ */
import AnalysisChart1 from '@/components/analysis/chart1.vue' import AnalysisChart1 from "@/pages/components/analysis/chart1.vue";
import AnalysisChart2 from '@/components/analysis/chart2.vue' import AnalysisChart2 from "@/pages/components/analysis/chart2.vue";
import { import { onMounted, ref } from "vue";
onMounted, import { $image, $response, $api } from "@/api";
ref import { onShow } from "@dcloudio/uni-app";
} from 'vue' import { useStore } from "@/store";
import { const $store = useStore();
ReportAnalysisAction,
$image, const $props = defineProps({
$response id: {
} from '@/api' type: String,
import { default: "",
onShow },
} from '@dcloudio/uni-app' });
let type = ref(1);
const analysis_content = ref({ const analysis_content = ref({
title: '', title: "",
result: '', result: "",
name: '', name: "",
value: '', value: "",
date: '', date: "",
content: '', content: "",
table: { table: {
name: '', name: "",
list: [] list: [],
} },
}) });
const chart1_option = ref({ const chart1_option = ref({
show: false, show: false,
range: [], range: [],
min: 0, min: 0,
max: 0 max: 0,
}) });
const chart2_option = ref({ const chart2_option = ref({
show: false, show: false,
data: [], data: [],
min: 0, min: 0,
max: 0, max: 0,
unit: '', unit: "",
}) });
onMounted(() => { onMounted(() => {
GetGreySet() GetGreySet();
ReportAnalysis() ReportAnalysis();
}) });
const date_active = ref(0) const date_active = ref(0);
const data_show = ref(false) const data_show = ref(false);
const ReportAnalysis = async () => { const ReportAnalysis = async () => {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: "加载中...",
}); });
const response = await ReportAnalysisAction({ const response = await $api("ReportAnalysis", {
id_number: $props.id_number, id_number: $store.getUser().id_number,
id: $props.id, id: $props.id,
date: $props.date, });
})
$response(response, () => { $response(response, () => {
uni.hideLoading(); uni.hideLoading();
analysis_content.value = response.data.info analysis_content.value = response.data.info;
response.data.chart1_option.min = Number(response.data.chart1_option.min) console.log(analysis_content.value);
response.data.chart1_option.max = Number(response.data.chart1_option.max) response.data.chart1_option.min = Number(response.data.chart1_option.min);
chart1_option.value = response.data.chart1_option response.data.chart1_option.max = Number(response.data.chart1_option.max);
chart2_option.value = response.data.chart2_option chart1_option.value = response.data.chart1_option;
data_show.value = response.data.show chart2_option.value = response.data.chart2_option;
data_show.value = !response.data.show;
date_arr.value = response.data.date_list.map((item, key) => { date_arr.value = response.data.date_list.map((item, key) => {
if (response.data.date === item) { if (response.data.date === item) {
date_active.value = key date_active.value = key;
} }
return { return {
label: item, label: item,
value: item value: item,
} };
}) });
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: analysis_content.value.title title: analysis_content.value.title,
})
})
}
const $props = defineProps({
type: {
type: String,
default: '1'
},
id: {
type: String,
default: '1'
},
id_number: {
type: String,
default: ''
},
date: {
type: String,
default: ''
},
hospital: {
type: String,
default: ''
},
}); });
const chooseTypeClick = (type) => { });
if (Number($props.type) === type) return };
let date = $props.date || analysis_content.value.date
uni.redirectTo({
url: `/pages/main/analysis_content/analysis_content?hospital=${$props.hospital}&type=${type}&id=${$props.id}&id_number=${$props.id_number}&date=${date}`
})
}
const date_arr = ref([]) const chooseTypeClick = (status) => {
const dateChange = (e) => { if (type.value == status) return;
let index = Number(e.detail.value) type.value = status;
let date = date_arr.value[index].value // let date = $props.date || analysis_content.value.date;
uni.redirectTo({ // uni.redirectTo({
url: `/pages/main/analysis_content/analysis_content?hospital=${$props.hospital}&type=${$props.type}&id=${$props.id}&id_number=${$props.id_number}&date=${date}` // url: `/pages/main/analysis_content/analysis_content?hospital=${$props.hospital}&type=${type}&id=${$props.id}&id_number=${$props.id_number}&date=${date}`,
}) // });
} };
const date_arr = ref([]);
// const dateChange = (e) => {
// let index = Number(e.detail.value);
// let date = date_arr.value[index].value;
// uni.redirectTo({
// url: `/pages/main/analysis_content/analysis_content?hospital=${$props.hospital}&type=${$props.type}&id=${$props.id}&id_number=${$props.id_number}&date=${date}`,
// });
// };
// //
const SysGreyType=ref(0) const SysGreyType = ref(0);
const GetGreySet = () => { const GetGreySet = () => {
uni.getStorage({ uni.getStorage({
key: 'SysGreytype', key: "SysGreytype",
success: function (res) { success: function (res) {
console.log(res.data); console.log(res.data);
if (res.data == 1) { if (res.data == 1) {
SysGreyType.value=1 SysGreyType.value = 1;
}
} }
},
}); });
} };
</script> </script>
<template> <template>
<view> <view>
<view v-if="data_show" class="info_wrapper" :class="SysGreyType==1? 'grey' :''"> <view
<view v-if="chart1_option.show" class="info_chart_wrapper"> v-if="data_show"
class="info_wrapper"
:class="SysGreyType == 1 ? 'grey' : ''"
>
<view v-if="!chart1_option.show" class="info_chart_wrapper">
<AnalysisChart1 :option="chart1_option"></AnalysisChart1> <AnalysisChart1 :option="chart1_option"></AnalysisChart1>
</view> </view>
<view class="info_content_wrapper"> <view class="info_content_wrapper">
<view class="info_content_result_wrapper">本次体检{{ analysis_content.result }}</view> <view class="info_content_result_wrapper"
>本次体检{{ analysis_content.result }}</view
>
<view class="info_content_line_wrapper"></view> <view class="info_content_line_wrapper"></view>
<view class="info_content_content_wrapper"> <view class="info_content_content_wrapper">
<view>{{ analysis_content.name }}{{ analysis_content.value }}</view> <view>{{ analysis_content.name }}{{ analysis_content.value }}</view>
<view class="info_content_date_wrapper"> <view class="info_content_date_wrapper">
<view>日期</view> <view>日期</view>
<picker v-if="date_arr.length" @change="dateChange" :value="date_active" :range="date_arr" <!-- <picker
range-key="label"> v-if="date_arr.length"
@change="dateChange"
:value="date_active"
:range="date_arr"
range-key="label"
>
</picker> -->
<view>{{ analysis_content.date }}</view> <view>{{ analysis_content.date }}</view>
</picker>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="data_show" class="table_wrapper"> <view v-if="data_show" class="table_wrapper">
<view class="table_type_group_wrapper" :class="SysGreyType==1? 'grey' :''"> <view
<view @click="chooseTypeClick(1)" class="table_type_group_item_wrapper" class="table_type_group_wrapper"
:class="[Number($props.type) === 1 ? 'table_type_group_item_active_wrapper' : '']">趋势图表</view> :class="SysGreyType == 1 ? 'grey' : ''"
<view @click="chooseTypeClick(2)" class="table_type_group_item_wrapper" >
:class="[Number($props.type) === 2 ? 'table_type_group_item_active_wrapper' : '']">详细数据</view> <view
@click="chooseTypeClick(1)"
class="table_type_group_item_wrapper"
:class="type == 1 ? 'table_type_group_item_active_wrapper' : ''"
>趋势图表</view
>
<view
@click="chooseTypeClick(2)"
class="table_type_group_item_wrapper"
:class="type == 2 ? 'table_type_group_item_active_wrapper' : ''"
>详细数据</view
>
</view> </view>
<view class="table_content_wrapper" :class="SysGreyType==1? 'grey' :''"> <view
<AnalysisChart2 :option="chart2_option" v-if="chart2_option.show && Number($props.type) === 1"></AnalysisChart2> class="table_content_wrapper"
<view class="table_content_table_wrapper" v-if="Number($props.type) === 2"> :class="SysGreyType == 1 ? 'grey' : ''"
>
<AnalysisChart2
:option="chart2_option"
v-if="chart2_option.show && type === 1"
></AnalysisChart2>
<view class="table_content_table_wrapper" v-if="type === 2">
<view class="table_content_table_line_wrapper"> <view class="table_content_table_line_wrapper">
<view class="table_content_table_line_item_wrapper table_content_table_title_wrapper">临床意义 <view
class="table_content_table_line_item_wrapper table_content_table_title_wrapper"
>临床意义
</view> </view>
<view <view
class="table_content_table_line_item_wrapper table_content_table_line_center_wrapper table_content_table_title_wrapper"> class="table_content_table_line_item_wrapper table_content_table_line_center_wrapper table_content_table_title_wrapper"
{{ analysis_content.table.name }} >
{{ analysis_content.table?.name }}
</view> </view>
<view class="table_content_table_line_item_wrapper table_content_table_title_wrapper">评估</view> <view
class="table_content_table_line_item_wrapper table_content_table_title_wrapper"
>评估</view
>
</view> </view>
<view class="table_content_table_line_wrapper" v-for="(i,k) in analysis_content.table.list" :key="k"> <view
<view class="table_content_table_line_item_wrapper" :class="[ class="table_content_table_line_wrapper"
!!(k%2) ? '' : 'table_content_table_line_item_active_wrapper' v-for="(i, k) in analysis_content?.table?.list"
]">{{ i.date }} :key="k"
>
<view
class="table_content_table_line_item_wrapper"
:class="[
!!(k % 2) ? '' : 'table_content_table_line_item_active_wrapper',
]"
>{{ i.date }}
</view> </view>
<view class="table_content_table_line_item_wrapper table_content_table_line_center_wrapper" :class="[ <view
!!(k%2) ? '' : 'table_content_table_line_item_active_wrapper' class="table_content_table_line_item_wrapper table_content_table_line_center_wrapper"
]">{{ i.value }}</view> :class="[
<view class="table_content_table_line_item_wrapper" :class="[ !!(k % 2) ? '' : 'table_content_table_line_item_active_wrapper',
!!(k%2) ? '' : 'table_content_table_line_item_active_wrapper' ]"
]">{{ i.assess }}</view> >{{ i.value }}</view
>
<view
class="table_content_table_line_item_wrapper"
:class="[
!!(k % 2) ? '' : 'table_content_table_line_item_active_wrapper',
]"
>{{ i.assess }}</view
>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="data_show" class="content_wrapper" :class="SysGreyType==1? 'grey' :''"> <view
v-if="data_show"
class="content_wrapper"
:class="SysGreyType == 1 ? 'grey' : ''"
>
<view class="analysis_title_wrapper"> <view class="analysis_title_wrapper">
<view class="analysis_title_icon_wrapper"> <view class="analysis_title_icon_wrapper">
<image :src="$image('/storage/assets/report/report/竖线@2x.png')"></image> <image
:src="$image('/storage/assets/report/report/竖线@2x.png')"
></image>
</view> </view>
<view class="analysis_title_text_wrapper">临床意义</view> <view class="analysis_title_text_wrapper">临床意义</view>
</view> </view>
@ -220,11 +256,11 @@
} }
.table_content_table_line_item_active_wrapper { .table_content_table_line_item_active_wrapper {
background: #F1F5F8; background: #f1f5f8;
} }
.table_content_table_title_wrapper { .table_content_table_title_wrapper {
background: #EFEFEF; background: #efefef;
} }
.table_content_table_line_center_wrapper { .table_content_table_line_center_wrapper {
@ -256,15 +292,15 @@
background: #d0f3ee; background: #d0f3ee;
border-radius: 8rpx; border-radius: 8rpx;
margin: 30rpx auto 0; margin: 30rpx auto 0;
border: #16C5A9 solid 3rpx; border: #16c5a9 solid 3rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
overflow: hidden; overflow: hidden;
} }
.table_type_group_item_active_wrapper { .table_type_group_item_active_wrapper {
background: #16C5A9; background: #16c5a9;
color: #FFFFFF; color: #ffffff;
} }
.content_text_wrapper { .content_text_wrapper {
@ -278,7 +314,7 @@
.info_content_content_wrapper { .info_content_content_wrapper {
width: 318rpx; width: 318rpx;
padding-bottom: 10rpx; padding-bottom: 10rpx;
background: #FFF8ED; background: #fff8ed;
border-radius: 1rpx; border-radius: 1rpx;
margin-top: 9rpx; margin-top: 9rpx;
font-size: 26rpx; font-size: 26rpx;
@ -292,7 +328,7 @@
.info_content_line_wrapper { .info_content_line_wrapper {
width: 330rpx; width: 330rpx;
height: 1rpx; height: 1rpx;
background: #BFBFBF; background: #bfbfbf;
border-radius: 1rpx; border-radius: 1rpx;
margin-top: 21rpx; margin-top: 21rpx;
} }
@ -300,7 +336,7 @@
.info_content_result_wrapper { .info_content_result_wrapper {
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
color: #D38014; color: #d38014;
line-height: 1; line-height: 1;
margin-left: 12rpx; margin-left: 12rpx;
} }
@ -318,7 +354,7 @@
.content_wrapper { .content_wrapper {
width: 750rpx; width: 750rpx;
padding-bottom: 100rpx; padding-bottom: 100rpx;
background: #FFFFFF; background: #ffffff;
box-shadow: 0px 1rpx 1rpx 0px rgba(2, 2, 4, 0.05); box-shadow: 0px 1rpx 1rpx 0px rgba(2, 2, 4, 0.05);
border-radius: 10rpx; border-radius: 10rpx;
margin-top: 15rpx; margin-top: 15rpx;
@ -326,7 +362,7 @@
.table_wrapper { .table_wrapper {
width: 750rpx; width: 750rpx;
background: #FFFFFF; background: #ffffff;
box-shadow: 0px 1rpx 1rpx 0px rgba(2, 2, 4, 0.05); box-shadow: 0px 1rpx 1rpx 0px rgba(2, 2, 4, 0.05);
border-radius: 10rpx; border-radius: 10rpx;
margin-top: 15rpx; margin-top: 15rpx;
@ -337,7 +373,7 @@
.info_wrapper { .info_wrapper {
width: 750rpx; width: 750rpx;
height: 375rpx; height: 375rpx;
background: #FFFFFF; background: #ffffff;
box-shadow: 0px 1rpx 1rpx 0px rgba(2, 2, 4, 0.05); box-shadow: 0px 1rpx 1rpx 0px rgba(2, 2, 4, 0.05);
border-radius: 10rpx; border-radius: 10rpx;
display: flex; display: flex;
@ -346,7 +382,7 @@
} }
.analysis_title_text_wrapper { .analysis_title_text_wrapper {
color: #57C1B0; color: #57c1b0;
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
line-height: 1; line-height: 1;

@ -173,7 +173,14 @@ const contrastClick = async (item) => {
if (comboIds.value.includes(item.combo_id)) { if (comboIds.value.includes(item.combo_id)) {
comboIds.value.splice(comboIds.value.indexOf(item.combo_id), 1); comboIds.value.splice(comboIds.value.indexOf(item.combo_id), 1);
} else { } else {
if (comboIds.value.length < 3) {
comboIds.value.push(item.combo_id); comboIds.value.push(item.combo_id);
} else {
uni.showToast({
title: "最多对比3个套餐",
icon: "none",
});
}
} }
$store.setComboContrast(comboIds.value); $store.setComboContrast(comboIds.value);
}; };
@ -253,7 +260,7 @@ const toRouter = () => {
title: "请先选择套餐", title: "请先选择套餐",
icon: "none", icon: "none",
}); });
return return;
} }
uni.navigateTo({ uni.navigateTo({
url: "/pages/main/combo/tcdb", url: "/pages/main/combo/tcdb",
@ -271,11 +278,7 @@ const toRouter = () => {
@click="toRouter" @click="toRouter"
class="center fixed pt-10rpx box-border left-40rpx bottom-5% rounded-full w-110rpx h-110rpx bg-#239EA3 flex-col" class="center fixed pt-10rpx box-border left-40rpx bottom-5% rounded-full w-110rpx h-110rpx bg-#239EA3 flex-col"
> >
<uni-badge <uni-badge :text="comboIds.length" absolute="rightTop" size="small">
:text="comboIds.length"
absolute="rightTop"
size="small"
>
<image <image
src="@/static/assets/slices/duibi.png" src="@/static/assets/slices/duibi.png"
mode="widthFix" mode="widthFix"

@ -32,6 +32,7 @@ const getdbAxios = async () => {
}); });
}; };
const clickdb = async () => { const clickdb = async () => {
$store.setComboContrast(comboIds.value);
uni.navigateTo({ uni.navigateTo({
url: "/pages/buy/contrast/contrast", url: "/pages/buy/contrast/contrast",
}); });

@ -25,7 +25,7 @@ export const useStore = defineStore('counter', {
actions: { actions: {
setComboContrast(comboContrast) { setComboContrast(comboContrast) {
this.combo_compare = comboContrast; this.combo_compare = comboContrast;
uni.setStorageSync('COMBO_CONTRAST', JSON.stringify(this.comboContrast)); uni.setStorageSync('COMBO_CONTRAST', JSON.stringify(this.combo_compare));
}, },
getComboContrast(){ getComboContrast(){
return JSON.parse(uni.getStorageSync('COMBO_CONTRAST') || '[]') || this.combo_compare; return JSON.parse(uni.getStorageSync('COMBO_CONTRAST') || '[]') || this.combo_compare;

Loading…
Cancel
Save