import { browser } from '@/helpers/utils' import { Button, Toast } from 'vant' import { defineComponent } from 'vue' import styles from './index.module.less' export const getAssetsHomeFile = (fileName: string) => { const path = `./images/${fileName}` const modules = import.meta.globEager('./images/*') return modules[path].default } export default defineComponent({ name: 'download', data() { const query = this.$route.query return { type: query.type || 'student', wxStatus: false } }, mounted() { if (this.type === 'student') { document.title = '酷乐秀学院下载' } else if (this.type === 'teacher') { document.title = '酷乐秀下载' } }, methods: { downLoadApp() { if (browser().weixin) { this.wxStatus = true return } if ( browser().ios || /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent) ) { if (this.type == 'student') { window.location.href = 'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E8%BF%B7/id1487054260' } else if (this.type == 'teacher') { window.location.href = 'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E8%BF%B7/id1487054260' } } else if (/(Android)/i.test(navigator.userAgent)) { if (this.type == 'student') { window.location.href = 'https://sj.qq.com/myapp/detail.htm?apkName=com.daya.studaya_android' } else if (this.type == 'teacher') { window.location.href = 'https://sj.qq.com/myapp/detail.htm?apkName=com.daya.studaya_android' } } else { this.$toast('请用手机或移动设备打开') } } }, render() { return (