Commit 17616392 authored by Damon's avatar Damon

fix: 图片默认值

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