12小时前小编发现微信小程序用户:【彭为伟】提出了一个关于“请教onReachBottom页面向下滑动到底部,然后页面卡住了,请教,谢谢,为什么呢?”的问题,在问题中开发者彭为伟对该问题做了如下阐述:
功能是发帖后,然后展示帖,展示帖可以向下滑动,然后滑到下面就卡住了。
js部分代码
Page({
data: {},
e(t, “hasMoreData”, !0),
。。。
onReachBottom: function () {
this.data.hasMoreData ? (this.setData({
reachBottom: !0
}), this.ShowBbs1(“”)) : this.setData({
morestr: “没有更多了”
});
},
wxml代码
<template name=”txt”>
<view class=”content”>
<text space=”nbsp” userSelect=”true”>{{item.data}}</text>
</view>
<view style=”height:5px;”></view>
</template>
<template name=”img”>
<view>
<image bindload=”imageLoad” bindtap=”previewImage” data-index=”{{item.orders}}” data-src=”{{item.data}}” lazyLoad=”{{true}}” src=”{{item.datas}}” style=”width:{{images[item.orders].width}}rpx; height:{{images[item.orders].height}}rpx;”></image>
</view>
</template>
<scroll-view>
<view class=”body” wx:if=”{{loaded}}”>
<view hidden=”true”>
<input name=”current” value=”{{current}}”></input>
<input name=”maxorder” value=”{{maxorder}}”></input>
<input name=”followk” value=”{{followk}}”></input>
<input name=”tid” value=”{{tid}}”></input>
<input name=”tel” value=”{{tel}}”></input>
</view>
<view class=”card”>
<view class=”topic”>
<text space=”nbsp” userSelect=”true”>{{words[0].subject}}</text>
</view>
<view class=”flex” style=”width:98%;margin-top:10rpx;” wx:for=”{{words[0].img_arr}}” wx:for-item=”item” wx:key=”key”>
<image src=”{{item}}”></image>
</view>
<view class=”userinfo”>
<view class=”userpic”>
<image src=”{{words[0].avatar}}” style=”width:60rpx;height:60rpx;border-radius:50rpx;”></image>
</view>
<view class=”username”>
<view class=”author”>{{words[0].author}} <text class=”level” style=”background-color:{{words[0].namecolor}};”>{{words[0].userlevel}}</text>
</view>
<view class=”userlevel”>
<view class=”date”>{{words[0].dateline}}</view>
<view wx:if=”{{adminrole || words[0].isauthor}}”>
<button bindtap=”delMybbs” class=”reply” hoverClass=”none” id=”{{words[0].tid}}”>删除</button>
</view>
<view class=”views”>跟帖:{{words[0].replies}}条</view>
<view class=”views”>浏览:{{words[0].views}}次</view>
</view>
</view>
</view>
<view class=”line”></view>
<view style=”height:5px;”></view>
<view bindlongtap=”bingLongTap” bindtouchend=”bindTouchEnd” bindtouchstart=”bindTouchStart” class=”flex” data-title=”{{words.subject}}” id=”{{words.tid}}” style=”width:100%”>
<view class=”content”>
<view class=”content”>报名时间:{{words[0].signtime}}</view>
<view class=”content”>活动时间:{{words[0].acttime}}</view>
<view class=”content”>活动地点:{{words[0].actplace}}</view>
<view class=”content”>活动人数:{{words[0].signnum}}</view>
<view class=”content”>联系电话:{{words[0].contactphone}}</view>
<view class=”content”>活动费用:{{words[0].cost}}</view>
<view class=”content”>{{words[0].message}}</view>
</view>
</view>
</view>
<view class=”h_line”></view>
<view data-num=”{{index}}” style=”display:flex;width:96%;background-color:#fff;flex-direction:column;padding:10rpx;margin-left:10rpx;margin-top:10rpx;” wx:for=”{{contentlist}}” wx:key=”key”>
<view class=”userinfo” style=”margin-left:10rpx;”>
<view class=”userpic”>
<image mode=”widthFix” src=”{{item.avatar}}” style=”padding:0rpx;width:60rpx;height:60rpx;border-radius:50rpx;”></image>
</view>
<view class=”username” style=”margin-top:16rpx;”>
<view class=”author” style=”color:#4a6495″>{{item.author}} <text class=”level” style=”background-color:{{item.namecolor}};”>{{item.userlevel}}</text>
</view>
</view>
</view>
<view bindlongtap=”DelBbs” bindtouchend=”bindTouchEnd” bindtouchstart=”bindTouchStart” data-title=”{{item.subject}}” id=”{{item.id}}” style=”padding-left:70rpx;”>
<view class=”pid_str” wx:if=”{{item.parent_id != item.ancestor_id}}”>
<view style=”width:100%”>{{item.subject}}</view>
<view style=”width:100%”>{{item.subject2}}</view>
</view>
<view class=”content”>
<view style=”width:100%”>{{item.message}}</view>
</view>
<view class=”flex” style=”width:94%;margin-top:10rpx;” wx:for=”{{item.img_arr}}” wx:for-item=”item2″ wx:key=”key”>
<image src=”{{item2}}”></image>
</view>
<view class=”flex” style=”width:95%”>
<view wx:for=”{{item.title}}” wx:for-index=”idx” wx:for-item=”item1″ wx:key=”key”>
<view wx:if=”{{item1.type==’img’}}”>
<image bindload=”imageLoad1″ bindtap=”previewImage” class=”content-img” data-index=”{{item1.orders}}” data-src=”{{item1.data}}” src=”{{item1.datas}}” style=”width:{{images[item1.orders].width}}rpx; height:{{images[item1.orders].height}}rpx;”></image>
</view>
<view style=”margin-left:5rpx;margin-right:5rpx;” wx:elif=”{{item1.type==’mote’}}”>
<image bindload=”imageLoad1″ class=”content-img” data-index=”{{item1.orders}}” data-src=”{{item1.data}}” src=”{{item1.datas}}” style=”width:{{images[item1.orders].width}}rpx; height:{{images[item1.orders].height}}rpx;”></image>
</view>
<view wx:else>
<view class=”content_r”>
<text space=”nbsp” userSelect=”true”>{{item1.data}}</text>
</view>
<view style=”height:5px;”></view>
</view>
</view>
</view>
<view class=”flex” style=”width:95%”>
<view wx:for=”{{item.content}}” wx:for-index=”idx” wx:for-item=”item1″ wx:key=”key”>
<view wx:if=”{{item1.type==’img’}}”>
<image bindload=”imageLoad1″ bindtap=”previewImage” class=”content-img” data-index=”{{item1.orders}}” data-src=”{{item1.data}}” src=”{{item1.datas}}” style=”width:{{images[item1.orders].width}}rpx; height:{{images[item1.orders].height}}rpx;”></image>
</view>
<view style=”margin-left:5rpx;margin-right:5rpx;” wx:elif=”{{item1.type==’mote’}}”>
<image bindload=”imageLoad1″ class=”content-img” data-index=”{{item1.orders}}” data-src=”{{item1.data}}” src=”{{item1.datas}}” style=”width:{{images[item1.orders].width}}rpx; height:{{images[item1.orders].height}}rpx;”></image>
</view>
<view wx:else>
<view class=”content_r”>
<text space=”nbsp” userSelect=”true”>{{item1.data}}</text>
</view>
<view style=”height:5px;”></view>
</view>
</view>
</view>
<view class=”r_date”>
<view class=”lou”>#{{index+2}}</view>
<view>{{item.dateline}}</view>
<button bindtap=”reply” class=”reply” hoverClass=”none” id=”{{item.tid}}”>回复</button>
<view wx:if=”{{adminrole || item.isauthor}}”>
<button bindtap=”delMybbs” class=”reply” hoverClass=”none” id=”{{item.tid}}”>删除</button>
</view>
</view>
</view>
<view class=”line”></view>
</view>
<view wx:if=”{{reachBottom}}”>
<view style=”padding:10rpx;height:50rpx;text-align:center;”>{{morestr}}</view>
</view>
<view id=”bottom” style=”height:200rpx;”></view>
</view>
</scroll-view>
<view bindtap=”hide_bg” class=”page_bg” wx:if=”{{block}}”>
<view class=”btn_bg” wx:if=”{{block}}”>
<view wx:for=”{{infos.tels}}” wx:key=”key”>
<button bindtap=”tel” class=”sp_tit” id=”{{item.number}}”>拨打 {{item.number}} </button>
</view>
</view>
</view>
<view id=”recordWrapper”></view>
<view class=”bottom” wx:if=”{{loaded}}”>
<view >
<view class=”input”>
<button bindtap=”reply” class=”input_txt_left” hoverClass=”none” id=”{{words[0].tid}}”>
<image src=”image/input.png” style=”vertical-align:middle;width:36rpx;height:42rpx;”></image>
<text> 回复楼主 已有{{words.replies}}条回复</text>
</button>
<button class=”share” id=”{{words[0].tid}}” openType=”share”>
<image src=”image/share.png” style=”vertical-align:middle;width:45rpx;height:40rpx;”></image>
</button>
</view>
</view>
</view>
注:以上是微信小程序开发者:”彭为伟”对于本问题的一些阐述,这里做一个引用,我们将实时关注微信小程序助手对该问题提出的解决方案。
【1小时前】微信小程序技术运营专员对用户彭为伟提出的请教onReachBottom页面向下滑动到底部,然后页面卡住了,请教,谢谢,为什么呢?给予如下回复
e.setData({
loaded: 1,
// act: 0,
// sharetit: res.data.subject
words: res.result.data,
hasMoreData:!1, 增加了这个就可以了。
onReachBottom: function () {
this.data.hasMoreData ? (this.setData({
reachBottom: !0
}), this.ShowBbs1(“”)) : this.setData({
morestr: “没有更多了”
});
},
流量变现是移动互联网永远的话题。由于用户属性和所属行业等原因,部分APP空有流量,但变现能力较弱。受制于原生APP单一的功能,这类企业对变现模式的探索屡屡碰壁。加入微信官方智能小程序,可以用智能小程序提升自己的商业化效率。
如果您也在使用微信小程序,请关注我们,如果您有关于微信小程序的使用问题请关注我们,如果您要找百度小程序模板、微信小程序模板请关注小程序模板网或者去微信开放社区找官方人员给予解决,相信微信官方在小程序上的发力会是一个里程碑!