Browse Source

解决搜索结果商品无图片显示时闪退问题

master
dy-hu 11 months ago
parent
commit
fd505056d2
  1. 4
      components/canvasShow/config/api.js
  2. 1
      pages_category_page1/goodsModule/goodsDetails.vue
  3. 6
      pages_category_page1/goodsModule/goodsList.vue

4
components/canvasShow/config/api.js

@ -2,9 +2,9 @@
// 获取当前环境变量 true => 生产环境 false => 开发环境
// const BASEURL = process.env.VUE_APP_DOMAIN_PREFIX
// const BASEURL = (process.env.NODE_ENV === 'production') ? 'http://36.138.125.206:8081/ceres-app-api' : 'http://36.138.125.206:8081/ceres-app-api'
const BASEURL = (process.env.NODE_ENV === 'production') ? 'http://36.138.125.206:8081/ceres-app-api' : 'http://36.138.125.206:8081/ceres-app-api'
// const BASEURL = (process.env.NODE_ENV === 'production') ? 'https://http://36.138.125.206:8081/ceres-local-filehnthee.com/ceres-app-api' : 'https://http://36.138.125.206:8081/ceres-local-filehnthee.com/ceres-app-api'
const BASEURL = (process.env.NODE_ENV === 'production') ? 'http://127.0.0.1:9007' : 'http://127.0.0.1:9007'
//const BASEURL = (process.env.NODE_ENV === 'production') ? 'http://127.0.0.1:9007' : 'http://127.0.0.1:9007'
// const BASEURL = '/ceres-app-api'

1
pages_category_page1/goodsModule/goodsDetails.vue

@ -731,7 +731,6 @@ export default {
this.isFirstComeIn = false
this.loading = false
this.productData = res.data
console.log('productData-->', this.productData)
this.markTools = res.data.markTools //
this.shopMarkTools = res.data.shopMarkTools //
this.currentActive = this.markTools.length === 0 && this.shopMarkTools.length > 0 ? 1 : 0

6
pages_category_page1/goodsModule/goodsList.vue

@ -99,7 +99,7 @@
<img
:src="item.image"
class="pic-img default-img"
onerror="this.src='url(http://36.138.125.206:8081/ceres-local-file/image/default.png) no-repeat center';this.οnerrοr=null"
@error="onImageError"
>
</view>
<view class="itemInfo">
@ -301,6 +301,10 @@ export default {
uni.navigateTo({
url: 'goodsDetails?shopId=' + shopId + '&productId=' + productId + '&skuId=' + skuId
})
},
onImageError(e) {
e.target.src = 'http://36.138.125.206:8081/ceres-local-file/image/default.png';
}
}
}

Loading…
Cancel
Save