<template>
  <web-view
    :update-title="false"
    :src="`https://wx.jxc4.com/billshow/${path}`"
    v-if="path !== ''"
  ></web-view>
  <jx-empty title="暂无新订单" v-else />

  <!-- 公共组件 -->
  <jx-loading />
</template>

<script lang="ts" setup>
import JxEmpty from '@/components/jx-empty/jx-empty.vue'
import { setStorage } from '@/utils/storage'
import { onLoad } from '@dcloudio/uni-app'
import { Ref, ref } from 'vue'

const path: Ref<string> = ref('')
onLoad((options) => {
  path.value = options?.url ? `?path=${options?.url}` : ''
  if (options?.index == 0) {
    // 清楚新账单记号
    setStorage('newBillUrl', options?.url)
  }
})
</script>

<style>
</style>