import { Checkbox, Icon, Popup } from "vant"; import { defineComponent } from "vue"; import styles from './index.module.less'; import activeButtonIcon from '@common/images/icon_checkbox.png'; import inactiveButtonIcon from '@common/images/icon_checkbox_default.png'; export default defineComponent({ name: 'protocol', props: { value: { type: Boolean, default: false } }, data() { return { checked: false, popupStatus: false, protocolHTML: '', protocolPopup: null as any, } }, mounted() { window.addEventListener('hashchange', this.onHash, false) }, unmounted() { window.removeEventListener('hashchange', this.onHash, false) }, methods: { onHash() { this.popupStatus = false; }, onPopupClose() { // 判断是否有协议内容 // if (!this.protocolHTML) { // return // } this.popupStatus = !this.popupStatus // 打开弹窗 if (this.popupStatus) { const route = this.$route let times = 0; for (let i in route.query) { times += 1 } const origin = window.location.href const url = times > 0 ? '&pto=' + (+new Date()) : '?pto=' + (+new Date()) history.pushState("", "", `${origin}${url}`) } else { window.history.go(-1) } if (this.protocolPopup) { (this.protocolPopup as any).scrollTop = 0 } } }, render() { return (
( ) }} > 我已阅读并同意 《酷乐秀平台服务协议》
酷乐秀平台服务协议
呆头呆脑的协议内容
) } })