Skip to content

Commit

Permalink
去除加载后显示
Browse files Browse the repository at this point in the history
  • Loading branch information
Zing22 committed Oct 16, 2021
1 parent 48a0c04 commit a6b3172
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
11 changes: 0 additions & 11 deletions miniprogram/pages/genealogy/genealogy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ Page({
loading: false, // 正在加载
loadnomore: false, // 没有再多了

imgLoadedCount: 0,

// 广告是否展示
ad_show: {},
},
Expand Down Expand Up @@ -332,13 +330,6 @@ Page({

},

bindImageLoaded(e){
this.setData({
imgLoadedCount: this.data.imgLoadedCount+1
},
);
},

// 点击猫猫卡片
clickCatCard(e, isCatId = false) {
const cat_id = isCatId ? e : e.currentTarget.dataset.cat_id;
Expand Down Expand Up @@ -541,8 +532,6 @@ Page({
return res.length ? _.and(res) : {};
},
fComfirm: function () {
this.setData({imgLoadedCount:0});

if (!this.data.filters_legal) {
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions miniprogram/pages/genealogy/genealogy.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@

<scroll-view enable-flex='true' class='cards' style='height: {{heights.windowHeight - heights.filters}}px;' scroll-y='true' enable-back-to-top='true' bindscrolltolower='onReachBottom' bindscroll='fScroll' lower-threshold='{{main_lower_threshold}}'>
<block wx:for='{{cats}}' wx:key="_id">
<view hidden="{{index > imgLoadedCount-1}}" class='card' bindtap='clickCatCard' bindlongpress='bindManageCat' data-cat_id='{{item._id}}'>
<view class='card' bindtap='clickCatCard' bindlongpress='bindManageCat' data-cat_id='{{item._id}}'>
<view class='label' wx:if="{{item.mphoto_new}}">有新相片!</view>
<view class='image {{item.to_star? "to_star": ""}}'>
<image bindload="bindImageLoaded" mode='aspectFill' src='{{item.photo.photo_compressed || item.photo.photo_id}}'></image>
<view class='image-title' wx:if='{{!item.photo_count || item.photo_count === 0}}'>暂无照片...</view>
<view class='image-title' wx:if='{{!item.photo_count || item.photo_count === 0}}'>暂无封面...</view>
<view class='image-title' wx:else>{{item.photo.photo_id? ('Photo by ' + (item.photo.photographer ||(item.photo.userInfo? item.photo.userInfo.nickName: '匿名猫友'))): '加载照片ing'}}</view>
</view>
<view class='info' hover-class="hoverInfo">
Expand Down Expand Up @@ -89,7 +89,7 @@
</view>
</view>
</view>
<view hidden="{{index > imgLoadedCount-1}}" wx:if="{{adStep && (index+1)%adStep===0}}" class="card-ad {{ad_show['ad-'+(index+1)]? '': 'hidden'}}">
<view wx:if="{{adStep && (index+1)%adStep===0}}" class="card-ad {{ad_show['ad-'+(index+1)]? '': 'hidden'}}">
<ad unit-id="adunit-9a7dcb84fe2c4db1" ad-intervals="120"
bindload="adLoad" binderror="adError" bindclose="adClose" data-ad_id='ad-{{(index+1)}}'></ad>
</view>
Expand Down

0 comments on commit a6b3172

Please sign in to comment.