Commit f7780c28 authored by yaya's avatar yaya

feat:修改编辑图片展示问题

parent fac05f30
...@@ -177,18 +177,20 @@ export default { ...@@ -177,18 +177,20 @@ export default {
this.goods = response.data.data.goods this.goods = response.data.data.goods
this.goods.detail = this.trimHtml(this.goods.detail) this.goods.detail = this.trimHtml(this.goods.detail)
this.categoryIds = response.data.data.categoryIds this.categoryIds = response.data.data.categoryIds
this.goods.images = response.data.data.images || []
this.itemImages = [] this.itemImages = []
if (this.goods.topImage && this.goods.images.indexOf(this.goods.topImage) === -1) { if (this.goods.topImage && this.goods.images.indexOf(this.goods.topImage) === -1) {
this.itemImages.push({ this.itemImages.push({
url: this.goods.topImage url: this.goods.topImage
}) })
} }
if (this.goods.images && this.goods.images.length > 0) {
for (var i = 0; i < this.goods.images.length; i++) { for (var i = 0; i < this.goods.images.length; i++) {
this.itemImages.push({ this.itemImages.push({
url: this.goods.images[i] url: this.goods.images[i]
}) })
} }
}
}) })
listCategories().then(response => { listCategories().then(response => {
......
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