Commit ebedfd3e6f13fac14126af40fbaf9645a49fe0c1
1 parent
cbd179f6
样式图片修改
Showing
4 changed files
with
13 additions
and
14 deletions
components/goods_list/goods_list.wxml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <wxs module="filter" src="../../utils/filter.wxs"></wxs> |
3 | 3 | <view class="collects"> |
4 | 4 | <view class="hang "> |
5 | - <!-- 商品详情 --> | |
5 | + <!-- 商品详情 --> | |
6 | 6 | <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> |
7 | 7 | <!-- 商品图片 --> |
8 | 8 | <image class="sp" src="{{url+item.original_img}}" mode="scaleToFill" binderror="bind_bnerr_xc" data-url="{{item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image> | ... | ... |
pages/index/index/index.js
... | ... | @@ -76,10 +76,6 @@ Page({ |
76 | 76 | |
77 | 77 | }, |
78 | 78 | async onShow() { |
79 | - | |
80 | - | |
81 | - | |
82 | - | |
83 | 79 | var th=this; |
84 | 80 | await this.init_load(); |
85 | 81 | //显示的时候要开启计时器 |
... | ... | @@ -388,14 +384,15 @@ Page({ |
388 | 384 | |
389 | 385 | //图片失败,默认图片 |
390 | 386 | bind_bnerr2: function (e) { |
387 | + console.log("图片失败,默认图片的对象",e); | |
391 | 388 | var _errImg = e.target.dataset.errorimg; |
389 | + console.log("图片失败,默认图片的对象", _errImg ); | |
392 | 390 | var _errurl = e.target.dataset.url; |
393 | - //var ii = _errurl.indexOf(o.imghost); | |
394 | - // if (ii != -1) { | |
395 | - // var _errObj = {}; | |
396 | - // _errObj[_errImg] = this.data.url + "/miniapp/images/default_g_img.gif"; | |
397 | - // this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
398 | - // } | |
391 | + var _errObj = {}; | |
392 | + _errObj[_errImg] = this.data.url + "/miniapp/images/default_g_img.gif"; | |
393 | + console.log(_errObj,"图片失败,默认图片 _errObj[_errImg]", _errObj[_errImg]); | |
394 | + this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
395 | + | |
399 | 396 | }, |
400 | 397 | //图片失败,默认图片 |
401 | 398 | bind_bnerr3: function (e) { | ... | ... |
pages/index/index/index.wxml
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <block wx:if="{{banner}}"> |
5 | 5 | <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image> |
6 | 6 | </block> |
7 | - <!--搜索框--> | |
7 | + <!--搜索框--> | |
8 | 8 | <view class="{{banner==null?'pink-b ':''}} search-box {{scrollTop>10?'search-fixed':''}} flex-center white "> |
9 | 9 | <view class="classify-frame t-c" bindtap="go_cate"> |
10 | 10 | <image class="classify-img" src="{{url}}/miniapp/images/classify.png"></image> |
... | ... | @@ -183,13 +183,13 @@ |
183 | 183 | </navigator> |
184 | 184 | <view class="seckill-lists rel"> |
185 | 185 | <swiper class="s_proms" indicator-active-color='red' bindchange="ptSwiperChange"> |
186 | - <swiper-item wx:for="{{pindGoods}}" wx:key="{{index}}"> | |
186 | + <swiper-item wx:for="{{pindGoods}}" wx:key="{{index}}" wx:for-index="pix"> | |
187 | 187 | <view class="teamheight" style='display:block;' wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> |
188 | 188 | <view class="kill-item"> |
189 | 189 | <navigator class="flex navwidth" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}"> |
190 | 190 | <view class="kill-pic"> |
191 | 191 | <image class="wh100" src="{{url+aitem.original_img}}" data-val="{{aitem.original_img}}" |
192 | - data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"> | |
192 | + data-errorimg="pindGoods[{{pix}}][{{aind}}].original_img" binderror="bind_bnerr2" lazy-load="true"> | |
193 | 193 | </image> |
194 | 194 | </view> |
195 | 195 | ... | ... |