Commit 17616392 authored by Damon's avatar Damon

fix: 图片默认值

parent bb32f329
......@@ -5,7 +5,7 @@
</view>
<view class="u-flex right">
<view class="right-img">
<u-image :src="info.images" width="200rpx" height="200rpx" />
<u-image :src="info.images || noPartsImage" width="200rpx" height="200rpx" />
</view>
<view class="u-flex right-content">
<view class="right-content-name">{{ info.name }}</view>
......@@ -45,6 +45,11 @@
}
}
},
computed: {
noPartsImage() {
return process.uniEnv.qn_base_url + 'morentupian.png'
}
},
data() {
return {
}
......
......@@ -78,6 +78,8 @@
v.max = v.stock
v.checked = false
v.quantity = v.stock
const images = v.images ? v.images.split(',') : []
v.images = images[0]
return v
})
}
......
......@@ -151,7 +151,6 @@ export default {
this.$u.api.getBrandList({categoryId: this.categaryId}).then(res => {
if (res.code === 200) {
const data = res.data
console.log("data", data)
if (data.length > 0) {
this.brand = data.map(v => {
v.label = v.brandName
......@@ -183,6 +182,8 @@ export default {
v.quantity = 0
v.disabled = true
v.max = 999
const images = v.images ? v.images.split(',') : []
v.images = images[0]
return v
})
this.lists = this.lists.concat(lists)
......
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