|
|
@ -1,26 +1,26 @@ |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import Util from '@/libs/util' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
id: +this.$route.query.id |
|
|
|
id: +this.$route.query.id |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
site() { |
|
|
|
site () { |
|
|
|
return this.$route.query.siteId || this.$store.state.content.site |
|
|
|
return this.$route.query.siteId || this.$store.state.content.site |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 点击栏目回调
|
|
|
|
// 点击栏目回调
|
|
|
|
columnTo(to) { |
|
|
|
columnTo (to) { |
|
|
|
const { typeId,menuVisible } = to |
|
|
|
const { typeId, menuVisible } = to |
|
|
|
// 跳转链接
|
|
|
|
// 跳转链接
|
|
|
|
if (typeId === 2) { |
|
|
|
if (typeId === 2) { |
|
|
|
if ( menuVisible === 1 && to.children.find(i=>i.menuVisible ===1)) return |
|
|
|
if (menuVisible === 1 && to.children.find(i => i.menuVisible === 1)) return |
|
|
|
let href = to.linkAddress |
|
|
|
let href = to.linkAddress |
|
|
|
const cType = to.connectionType |
|
|
|
const cType = to.connectionType |
|
|
|
if (cType !== 2) { // 非站外链接
|
|
|
|
if (cType !== 2) { // 非站外链接
|
|
|
@ -41,9 +41,9 @@ export default { |
|
|
|
if (to.isOpen) { |
|
|
|
if (to.isOpen) { |
|
|
|
var userAgent = navigator.userAgent; |
|
|
|
var userAgent = navigator.userAgent; |
|
|
|
var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); |
|
|
|
var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); |
|
|
|
if(isSafari) { |
|
|
|
if (isSafari) { |
|
|
|
window.location.href = href |
|
|
|
window.location.href = href |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
window.open(href) |
|
|
|
window.open(href) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -51,12 +51,12 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (typeId !== 4 || (typeId === 4 && !to.children.length)) { |
|
|
|
} else if (typeId !== 4 || (typeId === 4 && !to.children.length)) { |
|
|
|
// 常规栏目跳转到column页,长页栏目直接获取path
|
|
|
|
// 常规栏目跳转到column页,长页栏目直接获取path
|
|
|
|
this.$router.push(`/${typeId === 3 ? to.path : 'column'}?id=${to.id}&siteId=${this.site}`).catch(err => {}) |
|
|
|
this.$router.push(`/${typeId === 3 ? to.path : 'column'}?id=${to.id}&siteId=${this.site}`).catch(err => { }) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 跳转文章页面
|
|
|
|
// 跳转文章页面
|
|
|
|
toArtice(item) { |
|
|
|
toArtice (item) { |
|
|
|
if (item.listStyleId === 74) return false |
|
|
|
if (item.listStyleId === 74) return false |
|
|
|
if (item.articleTemplate === 24) { // 链接
|
|
|
|
if (item.articleTemplate === 24) { // 链接
|
|
|
|
let href = item.linkAddress |
|
|
|
let href = item.linkAddress |
|
|
|
const cType = item.connectionType |
|
|
|
const cType = item.connectionType |
|
|
@ -78,16 +78,21 @@ export default { |
|
|
|
if (item.isOpen) { |
|
|
|
if (item.isOpen) { |
|
|
|
var userAgent = navigator.userAgent; |
|
|
|
var userAgent = navigator.userAgent; |
|
|
|
var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); |
|
|
|
var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); |
|
|
|
if(isSafari) { |
|
|
|
if (isSafari) { |
|
|
|
window.location.href = href |
|
|
|
window.location.href = href |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
window.open(href) |
|
|
|
window.open(href) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
location.href = href |
|
|
|
location.href = href |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$router.push(`/article?articleId=${item.id}&siteId=${this.site}&id=${item.columnId}`) |
|
|
|
const path = `/article?articleId=${item.id}&siteId=${this.site}&id=${item.columnId}` |
|
|
|
|
|
|
|
if (this.site == 2) { |
|
|
|
|
|
|
|
window.open(this.$router.resolve(path).href) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$router.push(path) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|