diff --git a/src/views/open/jd/promoter/index.vue b/src/views/open/jd/promoter/index.vue index cf9cc0e..82f2bdf 100644 --- a/src/views/open/jd/promoter/index.vue +++ b/src/views/open/jd/promoter/index.vue @@ -21,6 +21,7 @@
{{ item.shopName }}
@@ -43,10 +44,11 @@
🖼
@@ -126,8 +128,21 @@ export default { onLogoError(e) { e.target.src = this.defaultLogo }, - onImageError(e) { - e.target.style.display = 'none' + onImageError(item, e) { + const tryCount = item._imgTry || 0 + const fallbacks = item.skuId + ? [ + `https://img14.360buyimg.com/n5/s450x450_${item.skuId}.jpg`, + `https://img10.360buyimg.com/n1/s450x450_${item.skuId}.jpg`, + `https://img14.360buyimg.com/n1/s240x240_${item.skuId}.jpg` + ] + : [] + if (tryCount < fallbacks.length) { + this.$set(item, '_imgTry', tryCount + 1) + e.target.src = fallbacks[tryCount] + return + } + this.$set(item, '_imgFailed', true) } } }