<template>
  <app-view class="app-html">
    <template #header>
      <app-navbar title="现货合同" />
    </template>
    <div style="padding: .2rem;">
      <div style="text-align: center;background-color: #fff;padding: 1rem 0;margin-bottom: .2rem;">
        <h4 style="margin-bottom: .32rem;">现货贸易合同（买方）.docx</h4>
        <Button type="primary" style="width: 50%;" round @click="download('/html/ht_xh_b.docx')">下载文档</Button>
      </div>
      <div style="text-align: center;background-color: #fff;padding: 1rem 0;">
        <h4 style="margin-bottom: .32rem;">现货贸易合同（卖方）.docx</h4>
        <Button type="primary" style="width: 50%;" round @click="download('/html/ht_xh_s.docx')">下载文档</Button>
      </div>
    </div>
  </app-view>
</template>

<script lang="ts" setup>
import { Button } from 'vant'
import { getServiceUrl } from '@/services/http'
import plus from '@/utils/h5plus'

const download = (filePath: string) => {
  const url = getServiceUrl('mobileOpenUrl')
  plus.openURL(url + filePath)
}
</script>