修改友链
This commit is contained in:
@ -2,11 +2,6 @@
|
||||
.pageList
|
||||
.articleContent(ref='articleImgs', v-if='Articels')
|
||||
article.articleList(v-for='(post, index) in Articels', :key='index')
|
||||
.articleImgs(v-if='post.postImages.length')
|
||||
nuxt-link(:to='"/post/" + post.ID')
|
||||
Swiper(:style='"height: " + imageHeight + "px"')
|
||||
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
|
||||
img(:src='imgUrl')
|
||||
.articleAbstract
|
||||
nuxt-link(:to='"/post/" + post.ID')
|
||||
.articleTitle(v-html='post.post_title')
|
||||
@ -80,8 +75,6 @@ export default {
|
||||
Articels[n].postmetum = {}
|
||||
Articels[n].postmetum.meta_value = 0
|
||||
}
|
||||
|
||||
Articels[n].postImages = []
|
||||
}
|
||||
} else if (data.status === 404) {
|
||||
Info = '未找到文章。'
|
||||
@ -100,25 +93,6 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
this.$finishLoad()
|
||||
this.analyseImages()
|
||||
},
|
||||
methods: {
|
||||
async analyseImages () { // 图片大小分析及处理
|
||||
const articleImgsWidth = this.$refs.articleImgs.getBoundingClientRect().width
|
||||
this.imageHeight = articleImgsWidth * 0.5625
|
||||
for (const n in this.Articels) {
|
||||
if (this.Articels[n].postimages.length !== 0) {
|
||||
for (const i in this.Articels[n].postimages) {
|
||||
const data = await this.$axios.$get(this.Articels[n].postimages[i].guid + '?x-oss-process=image/info')
|
||||
const widthValue = data.ImageWidth.value
|
||||
const heightValue = data.ImageHeight.value
|
||||
if (widthValue > articleImgsWidth && (articleImgsWidth * heightValue / widthValue > this.imageHeight) && this.Articels[n].postImages.length < 10) {
|
||||
this.Articels[n].postImages.push(this.Articels[n].postimages[i].guid + '?x-oss-process=image/resize,m_lfit,w_' + articleImgsWidth)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -2,11 +2,6 @@
|
||||
.pageList
|
||||
.articleContent(ref='articleImgs', v-if='Articels')
|
||||
article.articleList(v-for='(post, index) in Articels', :key='index')
|
||||
.articleImgs(v-if='post.postImages.length')
|
||||
nuxt-link(:to='"/post/" + post.ID')
|
||||
Swiper(:style='"height: " + imageHeight + "px"')
|
||||
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
|
||||
img(:src='imgUrl')
|
||||
.articleAbstract
|
||||
nuxt-link(:to='"/post/" + post.ID')
|
||||
.articleTitle(v-html='post.post_title')
|
||||
@ -77,8 +72,6 @@ export default {
|
||||
Articels[n].postmetum = {}
|
||||
Articels[n].postmetum.meta_value = 0
|
||||
}
|
||||
|
||||
Articels[n].postImages = []
|
||||
}
|
||||
} else if (data.status === 404) {
|
||||
Info = '未找到文章。'
|
||||
@ -97,25 +90,6 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
this.$finishLoad()
|
||||
this.analyseImages()
|
||||
},
|
||||
methods: {
|
||||
async analyseImages () { // 图片大小分析及处理
|
||||
const articleImgsWidth = this.$refs.articleImgs.getBoundingClientRect().width
|
||||
this.imageHeight = articleImgsWidth * 0.5625
|
||||
for (const n in this.Articels) {
|
||||
if (this.Articels[n].postimages.length !== 0) {
|
||||
for (const i in this.Articels[n].postimages) {
|
||||
const data = await this.$axios.$get(this.Articels[n].postimages[i].guid + '?x-oss-process=image/info')
|
||||
const widthValue = data.ImageWidth.value
|
||||
const heightValue = data.ImageHeight.value
|
||||
if (widthValue > articleImgsWidth && (articleImgsWidth * heightValue / widthValue > this.imageHeight) && this.Articels[n].postImages.length < 10) {
|
||||
this.Articels[n].postImages.push(this.Articels[n].postimages[i].guid + '?x-oss-process=image/resize,m_lfit,w_' + articleImgsWidth)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user