123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <template>
- <span v-bind="$attrs" @click="btnClick"> 免费试用 </span>
- </template>
- <script>
- export default {
- name: "freeTrialBtn",
- props: {
- myType: {
- type: String,
- default: 'kaoshi'
- }
- },
- methods: {
- isPC() {
- const browserWidth = document.documentElement.clientWidth;
- if (browserWidth <= 768) {
- return false;
- } else {
- return true;
- }
- },
- btnClick() {
- // 执行业务
- this.FreeTrial();
- // 执行通知
- if (this.isPC()) {
- this.$emit('active-pc', this.myType)
- } else {
- this.$emit('active-h5', this.myType)
- }
- },
- FreeTrial() {
- if (!this.isPC()) {
- // H5
- if (this.myType === 'kaoshi') {
- window.open('https://cdnks.mtavip.com/mdist/#/webRegister?flug=1')
- } else {
- window.open('https://cdnks.mtavip.com/mdist/#/webRegister?flug=2')
- }
- } else {
- if (this.myType === 'kaoshi') {
- window.open('https://cdnks.mtavip.com/a/register?flug=1')
- } else {
- window.open('https://cdnks.mtavip.com/a/register?flug=2')
- }
- }
- },
- }
- }
- </script>
- <style scoped>
- </style>
|