修复套餐对比的bug

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

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

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

@ -18,14 +18,14 @@ const mountedAction = () => {
const AnalysisTypeGetList = async () => {
const response = await $api("AnalysisTypeGetList");
$response(response, () => {
console.log(response)
console.log(response);
list.value = response.data.list;
});
};
const toRouter = (index, i) => {
const toRouter = (id) => {
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 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
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 }}
</view>
<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 :style="{'background-color': val.color}" class="w-60rpx h-60rpx rounded-full mr-30rpx"></view>
<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">
<text class="text-#222222 text-28rpx">{{ val.name }}</text>
<text class="text-#939898 text-22rpx">{{ val.desc }}</text>
</view>
<uni-icons type="right" size="15" color="#6A6A6A"></uni-icons>
</view>
</view>
</view>

@ -1,198 +1,234 @@
<script setup>
/**
/**
* name
* usersa0ChunLuyu
* date2023年3月19日 14:25:22
*/
import AnalysisChart1 from '@/components/analysis/chart1.vue'
import AnalysisChart2 from '@/components/analysis/chart2.vue'
import {
onMounted,
ref
} from 'vue'
import {
ReportAnalysisAction,
$image,
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
import AnalysisChart1 from "@/pages/components/analysis/chart1.vue";
import AnalysisChart2 from "@/pages/components/analysis/chart2.vue";
import { onMounted, ref } from "vue";
import { $image, $response, $api } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
const $store = useStore();
const analysis_content = ref({
title: '',
result: '',
name: '',
value: '',
date: '',
content: '',
const $props = defineProps({
id: {
type: String,
default: "",
},
});
let type = ref(1);
const analysis_content = ref({
title: "",
result: "",
name: "",
value: "",
date: "",
content: "",
table: {
name: '',
list: []
}
})
const chart1_option = ref({
name: "",
list: [],
},
});
const chart1_option = ref({
show: false,
range: [],
min: 0,
max: 0
})
const chart2_option = ref({
max: 0,
});
const chart2_option = ref({
show: false,
data: [],
min: 0,
max: 0,
unit: '',
})
onMounted(() => {
GetGreySet()
ReportAnalysis()
})
const date_active = ref(0)
const data_show = ref(false)
const ReportAnalysis = async () => {
unit: "",
});
onMounted(() => {
GetGreySet();
ReportAnalysis();
});
const date_active = ref(0);
const data_show = ref(false);
const ReportAnalysis = async () => {
uni.showLoading({
title: '加载中...'
title: "加载中...",
});
const response = await ReportAnalysisAction({
id_number: $props.id_number,
const response = await $api("ReportAnalysis", {
id_number: $store.getUser().id_number,
id: $props.id,
date: $props.date,
})
});
$response(response, () => {
uni.hideLoading();
analysis_content.value = response.data.info
response.data.chart1_option.min = Number(response.data.chart1_option.min)
response.data.chart1_option.max = Number(response.data.chart1_option.max)
chart1_option.value = response.data.chart1_option
chart2_option.value = response.data.chart2_option
data_show.value = response.data.show
analysis_content.value = response.data.info;
console.log(analysis_content.value);
response.data.chart1_option.min = Number(response.data.chart1_option.min);
response.data.chart1_option.max = Number(response.data.chart1_option.max);
chart1_option.value = response.data.chart1_option;
chart2_option.value = response.data.chart2_option;
data_show.value = !response.data.show;
date_arr.value = response.data.date_list.map((item, key) => {
if (response.data.date === item) {
date_active.value = key
date_active.value = key;
}
return {
label: item,
value: item
}
})
value: item,
};
});
uni.setNavigationBarTitle({
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: ''
},
title: analysis_content.value.title,
});
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 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 GetGreySet=()=>{
const chooseTypeClick = (status) => {
if (type.value == status) return;
type.value = status;
// 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 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 GetGreySet = () => {
uni.getStorage({
key: 'SysGreytype',
key: "SysGreytype",
success: function (res) {
console.log(res.data);
if(res.data==1){
SysGreyType.value=1
}
if (res.data == 1) {
SysGreyType.value = 1;
}
},
});
}
};
</script>
<template>
<view>
<view v-if="data_show" class="info_wrapper" :class="SysGreyType==1? 'grey' :''">
<view v-if="chart1_option.show" class="info_chart_wrapper">
<view
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>
</view>
<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_content_wrapper">
<view>{{ analysis_content.name }}{{ analysis_content.value }}</view>
<view class="info_content_date_wrapper">
<view>日期</view>
<picker v-if="date_arr.length" @change="dateChange" :value="date_active" :range="date_arr"
range-key="label">
<!-- <picker
v-if="date_arr.length"
@change="dateChange"
:value="date_active"
:range="date_arr"
range-key="label"
>
</picker> -->
<view>{{ analysis_content.date }}</view>
</picker>
</view>
</view>
</view>
</view>
<view v-if="data_show" class="table_wrapper">
<view class="table_type_group_wrapper" :class="SysGreyType==1? 'grey' :''">
<view @click="chooseTypeClick(1)" class="table_type_group_item_wrapper"
:class="[Number($props.type) === 1 ? 'table_type_group_item_active_wrapper' : '']">趋势图表</view>
<view @click="chooseTypeClick(2)" class="table_type_group_item_wrapper"
:class="[Number($props.type) === 2 ? 'table_type_group_item_active_wrapper' : '']">详细数据</view>
<view
class="table_type_group_wrapper"
:class="SysGreyType == 1 ? 'grey' : ''"
>
<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 class="table_content_wrapper" :class="SysGreyType==1? 'grey' :''">
<AnalysisChart2 :option="chart2_option" v-if="chart2_option.show && Number($props.type) === 1"></AnalysisChart2>
<view class="table_content_table_wrapper" v-if="Number($props.type) === 2">
<view
class="table_content_wrapper"
: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_item_wrapper table_content_table_title_wrapper">临床意义
<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_line_center_wrapper table_content_table_title_wrapper">
{{ analysis_content.table.name }}
class="table_content_table_line_item_wrapper table_content_table_line_center_wrapper table_content_table_title_wrapper"
>
{{ analysis_content.table?.name }}
</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 class="table_content_table_line_wrapper" v-for="(i,k) in analysis_content.table.list" :key="k">
<view class="table_content_table_line_item_wrapper" :class="[
!!(k%2) ? '' : 'table_content_table_line_item_active_wrapper'
]">{{ i.date }}
<view
class="table_content_table_line_wrapper"
v-for="(i, k) in analysis_content?.table?.list"
:key="k"
>
<view
class="table_content_table_line_item_wrapper"
:class="[
!!(k % 2) ? '' : 'table_content_table_line_item_active_wrapper',
]"
>{{ i.date }}
</view>
<view class="table_content_table_line_item_wrapper table_content_table_line_center_wrapper" :class="[
!!(k%2) ? '' : 'table_content_table_line_item_active_wrapper'
]">{{ 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
class="table_content_table_line_item_wrapper table_content_table_line_center_wrapper"
:class="[
!!(k % 2) ? '' : 'table_content_table_line_item_active_wrapper',
]"
>{{ 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 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_icon_wrapper">
<image :src="$image('/storage/assets/report/report/竖线@2x.png')"></image>
<image
:src="$image('/storage/assets/report/report/竖线@2x.png')"
></image>
</view>
<view class="analysis_title_text_wrapper">临床意义</view>
</view>
@ -203,12 +239,12 @@
</view>
</template>
<style scoped>
.info_content_date_wrapper {
.info_content_date_wrapper {
display: flex;
align-items: center;
}
}
.table_content_table_line_item_wrapper {
.table_content_table_line_item_wrapper {
width: 210rpx;
text-align: center;
height: 60rpx;
@ -217,68 +253,68 @@
color: #333333;
line-height: 60rpx;
margin-top: 10rpx;
}
}
.table_content_table_line_item_active_wrapper {
background: #F1F5F8;
}
.table_content_table_line_item_active_wrapper {
background: #f1f5f8;
}
.table_content_table_title_wrapper {
background: #EFEFEF;
}
.table_content_table_title_wrapper {
background: #efefef;
}
.table_content_table_line_center_wrapper {
.table_content_table_line_center_wrapper {
margin-left: 3rpx;
margin-right: 3rpx;
}
}
.table_content_table_wrapper {
.table_content_table_wrapper {
margin-top: 45rpx;
}
}
.table_content_table_line_wrapper {
.table_content_table_line_wrapper {
display: flex;
justify-content: center;
}
}
.table_type_group_item_wrapper {
.table_type_group_item_wrapper {
font-size: 28rpx;
font-weight: normal;
color: #757575;
line-height: 68rpx;
text-align: center;
width: 212rpx;
}
}
.table_type_group_wrapper {
.table_type_group_wrapper {
width: 430rpx;
height: 62rpx;
background: #d0f3ee;
border-radius: 8rpx;
margin: 30rpx auto 0;
border: #16C5A9 solid 3rpx;
border: #16c5a9 solid 3rpx;
display: flex;
justify-content: space-between;
overflow: hidden;
}
}
.table_type_group_item_active_wrapper {
background: #16C5A9;
color: #FFFFFF;
}
.table_type_group_item_active_wrapper {
background: #16c5a9;
color: #ffffff;
}
.content_text_wrapper {
.content_text_wrapper {
font-size: 24rpx;
font-weight: 500;
color: #343434;
line-height: 48rpx;
padding: 15rpx 35rpx;
}
}
.info_content_content_wrapper {
.info_content_content_wrapper {
width: 318rpx;
padding-bottom: 10rpx;
background: #FFF8ED;
background: #fff8ed;
border-radius: 1rpx;
margin-top: 9rpx;
font-size: 26rpx;
@ -287,90 +323,90 @@
line-height: 50rpx;
padding-top: 20rpx;
padding-left: 12rpx;
}
}
.info_content_line_wrapper {
.info_content_line_wrapper {
width: 330rpx;
height: 1rpx;
background: #BFBFBF;
background: #bfbfbf;
border-radius: 1rpx;
margin-top: 21rpx;
}
}
.info_content_result_wrapper {
.info_content_result_wrapper {
font-size: 30rpx;
font-weight: 500;
color: #D38014;
color: #d38014;
line-height: 1;
margin-left: 12rpx;
}
}
.info_content_wrapper {
.info_content_wrapper {
width: 330rpx;
margin-left: 39rpx;
}
}
.info_chart_wrapper {
.info_chart_wrapper {
width: 294rpx;
height: 338rpx;
}
}
.content_wrapper {
.content_wrapper {
width: 750rpx;
padding-bottom: 100rpx;
background: #FFFFFF;
background: #ffffff;
box-shadow: 0px 1rpx 1rpx 0px rgba(2, 2, 4, 0.05);
border-radius: 10rpx;
margin-top: 15rpx;
}
}
.table_wrapper {
.table_wrapper {
width: 750rpx;
background: #FFFFFF;
background: #ffffff;
box-shadow: 0px 1rpx 1rpx 0px rgba(2, 2, 4, 0.05);
border-radius: 10rpx;
margin-top: 15rpx;
overflow: hidden;
padding-bottom: 34rpx;
}
}
.info_wrapper {
.info_wrapper {
width: 750rpx;
height: 375rpx;
background: #FFFFFF;
background: #ffffff;
box-shadow: 0px 1rpx 1rpx 0px rgba(2, 2, 4, 0.05);
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
.analysis_title_text_wrapper {
color: #57C1B0;
.analysis_title_text_wrapper {
color: #57c1b0;
font-size: 28rpx;
font-weight: bold;
line-height: 1;
margin-left: 18rpx;
}
}
.analysis_title_icon_wrapper image {
.analysis_title_icon_wrapper image {
width: 10rpx;
height: 32rpx;
display: block;
}
}
.analysis_title_icon_wrapper {
.analysis_title_icon_wrapper {
width: 10rpx;
height: 32rpx;
margin-left: 31rpx;
}
}
.analysis_title_wrapper {
.analysis_title_wrapper {
height: 80rpx;
display: flex;
align-items: center;
}
.grey{
}
.grey {
filter: grayscale(100%);
}
}
</style>

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

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

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

Loading…
Cancel
Save