import { defineComponent } from 'vue'
import styles from './index.module.less'
import img404 from '@/common/images/404.png'
import img404Tenant from '@/components/col-result/images/notFond_tenant.png'
import { Button, Image } from 'vant'
import { postMessage } from '@/helpers/native-message'
import { browser } from '@/helpers/utils'
import { state } from '@/state'
import ColHeader from '@/components/col-header'

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