123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <template>
- <view class="home">
- <TopCard />
- <!-- tab导航栏 -->
- <view class="tabs">
- <view v-for="(item, index) in navList" :key="index" class="tab" :class="{'is-active': tabCurId === item.id}"
- @click="tabClick(index)">
- {{item.text}}
- </view>
- </view>
- <swiper :current="tabCurId" class="swiper-box" duration="300" @change="onChangeTab">
- <swiper-item class="tab-content" v-for="(_tabItem,tabIndex) in navList" :key="tabIndex">
- <CfStatus v-if="tabCurId==0" />
- <CfLogistics v-if="tabCurId==1" />
- <CfContent v-if="tabCurId==2" />
- <CfAppraise v-if="tabCurId==3" />
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script lang="ts" setup>
- import { ref, nextTick, onMounted } from 'vue'
- import rest from '@/stores/rest'
- import { BasicInfoVO } from '../../lib/type'
- import TopCard from './TopCard.vue'
- import CfStatus from './CfStatus.vue'
- import CfLogistics from './CfLogistics.vue'
- import CfContent from './CfContent.vue'
- import CfAppraise from './CfAppraise.vue'
- import {
- getSexByCardNo,
- maskCardNo,
- maskName,
- } from '@/lib/util'
-
- const topCardRef = ref()
-
- const tabCurId = ref(2)//当前tab选中Id
- // const loaded = ref(false)
- // const status = ref('loading')
- // const loadText = ref('数据加载中...')
- const navList = ref([{
- id: 0,
- text: '处方状态',
- },
- {
- id: 1,
- text: '物流信息',
- },
- {
- id: 2,
- text: '处方内容',
- },
- {
- id: 3,
- text: '处方评价',
- }
- ])
- const swiperBoxStyle = () => {
- let _h = `calc(100% - 72rpx -
- cfListDtos: boolean;${topCardRef.value?.offsetHeight})`;
- console.log("_h", _h)
- return {
- height: '200px',
- };
- };
- //顶部tab点击
- const tabClick = (idx : number) => {
- tabCurId.value = idx;
- }
- //滑动标签页
- const onChangeTab = (e) => {
- let _inx = e.detail.current;
- tabClick(_inx);
- }
- onMounted(() => {
- })
- </script>
- <style lang="scss" scoped>
- .home {
- display: flex;
- flex-direction: column;
- height: 100%;
- .tabs {
- margin: $uni-spacing-row-s4 0 $uni-spacing-row-s3;
- height: 88rpx;
- background-color: #fff;
- padding: 0 24rpx;
- @include flex-between;
- .tab {
- height: 100%;
- @include flex-center;
- &.is-active {
- color: $uni-color-primary;
- position: relative;
- &::after {
- content: '';
- position: absolute;
- bottom: 0;
- left: 0;
- background: $uni-color-primary;
- width: 100%;
- height: 4rpx;
- }
- }
- }
- }
- .swiper-box {
- flex: 1;
- .tab-content {
- :deep(.pub-loading) {
- height: 100%;
- }
- }
- }
- }
- </style>
|