Commit f70dc7f5ae591b441f31d2d3a2d53947e2f05e14

Authored by season
1 parent 0d905514

商品分类默认图片显示修改

pages/goods/categoryList/categoryList.js
@@ -535,6 +535,15 @@ Page({ @@ -535,6 +535,15 @@ Page({
535 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 535 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
536 536
537 }, 537 },
  538 +
  539 +
  540 + //---图片失败,默认图片---
  541 + bind_Goodsbnerr: function (e) {
  542 + var _errImg = e.target.dataset.errorimg;
  543 + var _errObj = {};
  544 + _errObj[_errImg] ="/miniapp/images/default_g_img.gif";
  545 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  546 + },
538 // 新的版本分类点击一级分类 547 // 新的版本分类点击一级分类
539 click_classify:function(e){ 548 click_classify:function(e){
540 clearInterval(this.data.timer); 549 clearInterval(this.data.timer);
pages/goods/categoryList/categoryList.wxml
@@ -382,7 +382,7 @@ @@ -382,7 +382,7 @@
382 <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}"> 382 <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}">
383 <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}"> 383 <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}">
384 <view class="img-wrap"> 384 <view class="img-wrap">
385 - <image src="{{url+item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image> 385 + <image src="{{url+item.original_img}}" binderror="bind_Goodsbnerr" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
386 </view> 386 </view>
387 <view class="item-cont"> 387 <view class="item-cont">
388 <view class="title">{{item.goods_name}}</view> 388 <view class="title">{{item.goods_name}}</view>