<template name="date">
  <view class="show_data_content">
    <view class="show_data_card">
      <view class="items" @click="toPage('/BILL/outstanding_fee/index/index')">
        <view class="numbers">{{
          userLoginStatus ? useModel?.userData?.value?.arrearage_house_num || '0' : '-'
          }}</view>
        <view class="label">欠费房屋</view>
      </view>
      <view class="items" @click="toPage('/WORKORDER/list/index')">
        <view class="numbers">{{
          userLoginStatus ? useModel?.userData?.value?.work_order_num || '0' : '-'
          }}</view>
        <view class="label">工单任务</view>
      </view>
      <view class="items">
        <view class="numbers">-</view>
        <view class="label">托收任务</view>
      </view>
      <view class="items">
        <view class="numbers">-</view>
        <view class="label">推送任务</view>
      </view>
    </view>
    <!-- <view class="notice_bar">
      <view>
        <uni-icons type="notification" color="#0082FA" size="18"></uni-icons>
      </view>
      <view class="notice_content">
        <swiper autoplay vertical circular>
          <template v-for="(i, index) in newsData" :key="`items_${index}`">
            <swiper-item>
              <view class="news_item_contents">
                {{ i }}
              </view>
            </swiper-item>
          </template>
</swiper>
</view>
</view> -->
  </view>
</template>
<script setup lang="ts">
import { default as getUser, default as getUserLogin } from '@/common/libraries/userUserLogin'
import { onShow } from '@dcloudio/uni-app'
import { getCurrentInstance, onMounted, ref } from 'vue'
import useModel from '../model'
const userLoginStatus = ref(false)
const newsData = [
  '【王三平】8栋1101，已支付10月物业费，987元',
  '【酆志明】7栋1101，已支付10月物业费，123.81元',
  '【滕志勇】8栋2101，已支付10月物业费，378元',
  '【康春芳】7栋1101，已支付10月物业费，322元',
  '【康春芳】5栋0301，已支付10月物业费，322元',
  '【沈妹】5栋1001，已支付10月停车月卡费，600元',
  '【袁小丽】5栋1201，已支付10月物业费，222.21元',
  '【雷海龙】1栋1102，已支付10月物业费，762元',
  '【黄雪松】2栋1202，已支付10月停车月卡费，600元',
  '【孟丽华】1栋0903，已支付10月物业费，882元'
]

const toPage = (url: string) => {
  uni.navigateTo({
    url: !getUserLogin?.getLoginStatus() ? '/pages/login' : url || ''
  })
}

onMounted(async () => {
  await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched
  userLoginStatus.value = getUser?.getLoginStatus()
  console.log('useModel?.userData?.value', useModel?.userData?.value)
})
onShow(async () => {
  await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched
  userLoginStatus.value = getUser?.getLoginStatus()
  console.log('useModel?.userData?.value', useModel?.userData?.value)
})
</script>

<style lang="scss" scoped>
.show_data_content {
  background-color: #fff;
  margin: 30rpx 30rpx 0 30rpx;
  border-radius: 15rpx;
}

.show_data_card {
  display: flex;
  align-items: center;
  padding: 40rpx 0 30rpx 0;
  text-align: center;

  .items {
    flex: 1;
  }

  .numbers {
    font-size: 36rpx;
    font-weight: 550;
  }

  .label {
    font-size: 24rpx;
    color: #666;
  }
}

.notice_bar {
  border-top: 1rpx solid #eee;
  height: 80rpx;
  line-height: 80rpx;
  color: #333;
  font-size: 24rpx;
  padding: 0 30rpx;
  display: flex;

  .notice_content {
    flex: 1;
    padding-left: 5rpx;
  }

  swiper {
    height: 80rpx;
  }
}
</style>
