123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <template>
- <view class="home">
- <TopCard :info="info" />
- <!-- 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">
- <!-- <pub-list-scroll :loaded="loaded" :text="loadText" :status="status"> -->
- <CfStatus v-if="tabCurId==0" />
- <!-- </pub-list-scroll> -->
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script lang="ts" setup>
- import { ref, nextTick, onMounted } from 'vue'
- import TopCard from './TopCard.vue'
- import CfStatus from './CfStatus.vue'
- const topCardRef = ref()
- const info = ref({
- name: '陈*丽',
- addr: '成都市大竹林街道*************',
- sex: '女',
- text: '近三个月就诊记录',
- idCard: '************** 9253',
- date: '2024-04-22'
- })
- const tabCurId = ref(0)//当前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 - ${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>
|