Commit 84dc521b authored by yaya's avatar yaya

feat:修改图片展示

parent dc39ffc7
......@@ -249,6 +249,9 @@ export default {
url = file.response.data.url
}
if (url === this.goods.topImage) {
this.goods.topImage = ''
}
if (this.goods.images[i] === url) {
this.goods.images.splice(i, 1)
}
......
......@@ -319,7 +319,7 @@ export default {
handleScroll() {
const scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
const testEle = this.$refs.top
if (scrollTop > testEle.offsetTop) {
if (scrollTop > (testEle && testEle.offsetTop)) {
this.isFixed = true
} else {
this.isFixed = false
......@@ -372,12 +372,16 @@ export default {
if (this.goodsParams.categoryIds) {
this.categoryIds = this.goodsParams.categoryIds || []
}
if (response.data.data.images) {
if (response.data.data.images && response.data.data.images.length > 0) {
this.goodsParams.images = response.data.data.images.split(';') || []
}
if (this.goodsParams.topImage) {
if (this.goodsParams.topImage && this.goodsParams.topImage.length > 0) {
const list = [this.goodsParams.topImage]
this.goodsParams.images = list.concat(this.goodsParams.images)
if (this.goodsParams.images && this.goodsParams.images.length > 0) {
this.goodsParams.images = list.concat(this.goodsParams.images)
} else {
this.goodsParams.images = list
}
}
})
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment