consultationFee.vue
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<template>
<u-navbar title="诊费明细" :autoBack="true" bgColor="#ffffff" placeholder safeAreaInsetTop :titleStyle="{ color: '#000' }"></u-navbar>
<view class="consultationFee">
<view class="main">
<view class="main-title flexC">选择服务</view>
<view class="listitem" v-for="(_, index) in list" :key="index">
<view class="center">
<view>
<view class="title">{{ _.title }}</view>
<view class="text">{{ _.text }}</view>
<view class="money">¥{{ _.money }}元/单</view>
</view>
<image :src="_.imgUrl" mode="aspectFill" />
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { getConsultation_fee_detail } from '@/api'
import type { Consultation_fee_detailType } from '../../types'
const list = ref([
{ title: '图文问诊', text: '', money: 0, imgUrl: '/static/images/mimage.png', textKeyName: 'textContent', keyName: 'textAmount' },
{ title: '视频问诊', text: '', money: 0, imgUrl: '/static/images/mvideo.png', textKeyName: 'videoContent', keyName: 'vedioAmount' },
{ title: '电话问诊', text: '', money: 0, imgUrl: '/static/images/mophone.png', textKeyName: 'phoneContent', keyName: 'phoneAmount' }
])
onMounted(async () => {
const { result }: { result: Consultation_fee_detailType } = await getConsultation_fee_detail()
list.value = list.value.map(_ => ({ ..._, money: result[_.keyName] ?? 0, text: result[_.textKeyName] ?? '暂无介绍' }))
})
</script>
<style>
page {
background: #f7f8fa !important;
}
</style>
<style lang="scss" scoped>
.consultationFee {
box-sizing: border-box;
padding: 50rpx 24rpx;
.main {
box-sizing: border-box;
padding: 38rpx 24rpx 70rpx;
border-radius: 24rpx;
background: #fff;
.listitem {
box-sizing: border-box;
padding: 38rpx 32rpx;
background: #f9f9f9;
margin-bottom: 18rpx;
.center {
display: flex;
justify-content: space-between;
align-items: flex-end;
.title {
color: #323233;
font-size: 34rpx;
font-weight: 700;
margin-bottom: 8rpx;
}
.text {
color: #666666;
font-size: 24rpx;
margin-bottom: 20rpx;
}
.money {
color: #fc4338;
font-size: 28rpx;
}
image {
max-width: 96rpx;
max-height: 96rpx;
}
}
}
&-title {
color: #999999;
font-size: 26rpx;
font-weight: 700;
margin-bottom: 28rpx;
}
}
}
</style>