<template>
  <div class="page-content p-10">
    <div class="d-flex justify-content-between">
      <van-tag type="primary" size="large">{{ flowData.followType }}</van-tag>
      <div>{{ flowData.sysDate }}</div>
    </div>
    <div class="mt-10" v-if="flowData.fileId">
      <audio :id="`auto${flowData.id}`" :src="flowData.fileUrl" controls></audio>
    </div>
    <div class="mt-10">
      {{ flowData.introduce }}
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import emitter from '@/utils/mitt'
const route = useRoute()
const router = useRouter()
let id: any = ref('')
let flowData: any = ref({})
const init = () => {
  if (route.query && route.query.id) {
    id.value = route.query.id
    emitter.emit('showLoading', '')
    getData()
  } else {
    router.push({ name: '404' })
  }
}
import { stockCompanyFlowInfoInfo } from '@/utils/api'
const getData = async () => {
  const { data }: any = await stockCompanyFlowInfoInfo(id.value)
  data.playFlag = false
  flowData.value = data
  emitter.emit('setTitle', { title: data.sysDate + data.stockName + data.flowType, type: 'comment' })
  emitter.emit('hiddenLoading', '')
}
init()
</script>

<style lang='scss' scoped>
audio {
  height: 36px;
}
</style>
