consultationFee.vue 2.6 KB
<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>