|
|
|
@ -1,26 +1,26 @@ |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
id: +this.$route.query.id |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
site() { |
|
|
|
|
site () { |
|
|
|
|
return this.$route.query.siteId || this.$store.state.content.site |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
mounted () { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 点击栏目回调
|
|
|
|
|
columnTo(to) { |
|
|
|
|
const { typeId,menuVisible } = to |
|
|
|
|
columnTo (to) { |
|
|
|
|
const { typeId, menuVisible } = to |
|
|
|
|
// 跳转链接
|
|
|
|
|
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 |
|
|
|
|
const cType = to.connectionType |
|
|
|
|
if (cType !== 2) { // 非站外链接
|
|
|
|
@ -41,9 +41,9 @@ export default { |
|
|
|
|
if (to.isOpen) { |
|
|
|
|
var userAgent = navigator.userAgent; |
|
|
|
|
var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); |
|
|
|
|
if(isSafari) { |
|
|
|
|
if (isSafari) { |
|
|
|
|
window.location.href = href |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
window.open(href) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -51,12 +51,12 @@ export default { |
|
|
|
|
} |
|
|
|
|
} else if (typeId !== 4 || (typeId === 4 && !to.children.length)) { |
|
|
|
|
// 常规栏目跳转到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) { |
|
|
|
|
if (item.listStyleId === 74) return false |
|
|
|
|
toArtice (item) { |
|
|
|
|
if (item.listStyleId === 74) return false |
|
|
|
|
if (item.articleTemplate === 24) { // 链接
|
|
|
|
|
let href = item.linkAddress |
|
|
|
|
const cType = item.connectionType |
|
|
|
@ -78,16 +78,21 @@ export default { |
|
|
|
|
if (item.isOpen) { |
|
|
|
|
var userAgent = navigator.userAgent; |
|
|
|
|
var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); |
|
|
|
|
if(isSafari) { |
|
|
|
|
if (isSafari) { |
|
|
|
|
window.location.href = href |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
window.open(href) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
location.href = href |
|
|
|
|
} |
|
|
|
|
} 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) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|