import { defineComponent } from 'vue'
import styles from './index.module.less'
import img404 from '@/common/images/404.png'
import { Button, Image } from 'vant'
import { postMessage } from '@/helpers/native-message'
import { browser } from '@/helpers/utils'

export default defineComponent({
  name: 'NotFound',
  render() {
    return (
      <div class={styles.f404}>
        <Image src={img404} />
        <p>页面找不到了</p>
        <Button
          type="primary"
          plain
          round
          onClick={() => {
            if (browser().iPhone) {
              postMessage({ api: 'back' })
            } else {
              this.$router.back()
            }
          }}
        >
          返回
        </Button>
      </div>
    )
  }
})
