个人案例
M小黎
展示社区月度贡献名单和贡献值排行
M小黎扫码体验
只查询当前tab页的数据啊,你的方法里面所有tab页的查询都执行了
当只有一条或者没有数据的情况时,一直显示正在加载中?当只有一条或者没有数据的情况下,一直显示正在加载中,如果全部项下拉加载出数据后,才会显示没有更多如图1。再就是当下拉加载时,第二次下拉时显示的没有更多数据,而不是显示正在加载中如图2。好像是和其他项有冲突。这个问题怎么解决? 图片:[图片][图片] 代码: <!--components/loadingmore/loadingmore.wxml--> <button class="loading-btn" loading="{{hasmore}}" style="height:{{height}}px;"> <block wx:if="{{hasmore}}"> <text class="loadingtext">{{loadingtext}}</text> </block> <block wx:else> <text class="loadingtext">{{loadedtext}}</text> </block> </button> index.wxml代码: <segment-carpool items="{{items}}" result="{{result}}" resultthree="{{result3}}" resultfous="{{result4}}" binditemchengde="onItemChengdeEvent" defaultIndex="0" > <view slot="0" class="segment-page wehicle-page"> <view class="comment-title">全部信息(共有{{result}}条)</view> <whole wx:for="{{wehicles}}" wx:key="wehicle" wx:for-item="wehicle" wehicle="{{wehicle}}"></whole> </view> <view slot="1" class="segment-page people-page"> <view class="comment-title">全部信息(共有{{result1}}条)</view> <wehicle wx:for="{{listones}}" wx:key="key" wx:for-item="listone" list1="{{listone}}"></wehicle> </view> <view slot="2" class="segment-page train-page"> <view class="comment-title">全部信息(共有{{result2}}条)</view> <people wx:if="{{listtwos}}" wx:for="{{listtwos}}" wx:key="key" wx:for-item="listtwo" list2="{{listtwo}}"></people> </view> <view slot="3" class="segment-page money-page"> <view class="comment-title">全部信息(共有{{result3}}条)</view> <train wx:for="{{listthrees}}" wx:key="key" wx:for-item="listthree" list3="{{listthree}}"></train> </view> <view slot="4" class="segment-page money-page" > <view class="comment-title">全部信息(共有{{result4}}条)</view> <money wx:for="{{listfours}}" wx:key="key" wx:for-item="listfour" list4="{{listfour}}"></money> </view> </segment-carpool> <loadingmore hasmore="{{hasmore}}"></loadingmore> index.jd代码: const db = wx.cloud.database(); Page({ /** * 页面的初始数据 */ data: { items: ["全部", "我要找车", "我要找人", "我找货车", "我要找货"], hasmore: true, wehicles: [], result: 0, result1: 0, result2: 0, result3: 0, result4: 0, startPoint:'', goal: '', isQuerying: false, list:[], listones:[], listtwos:[], listthrees:[], listfours:[], }, /** * 获取起点输入信息 */ onStartPointEvent(event) { const that = this; const startPoint = event.detail.value console.log('起点', startPoint); that.setData({ startPoint: startPoint }) }, /** * 获取终点输入信息 */ onGoalEvent(event) { const that = this; const goal = event.detail.value console.log('终点', goal); that.setData({ goal: goal }) }, /** * 按条件查询数据 */ formSubmit(event) { console.log(event); const that = this; that.setData({ isQuerying: true }) let list = db.collection("wehicle").where({ startPoint: that.data.startPoint, goal: that.data.goal, }); if (event > 0) { list = list.skip(event); } list.limit(5).orderBy("create_time", "desc").get().then(res => { console.log(res); const wehicles = res.data; let hasmore = true if (wehicles.length == 0) { hasmore = false } let newWehicles = []; if (event > 0) { newWehicles = that.data.wehicles.concat(wehicles); } else { newWehicles = wehicles; } newWehicles.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ wehicles: newWehicles, hasmore: hasmore, }) }); list.count().then(res => { console.log(res) that.setData({ result:res.total }) }) let list1 = db.collection("wehicle").where({ startPoint: that.data.startPoint, goal: that.data.goal, carpool:'我要找车' }); if (event > 0) { list1 = list1.skip(event); } list1.limit(5).orderBy("create_time", "desc").get().then(res => { const listones = res.data; let hasmore = true if (listones.length == 0) { hasmore = false } let newones = []; if (event > 0) { newones = that.data.listones.concat(listones); } else { newones = listones; } newones.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ listones: newones, hasmore: hasmore, }) }); list1.count().then(res => { console.log(res) that.setData({ result1:res.total }) }) let list2 = db.collection("wehicle").where({ startPoint: that.data.startPoint, goal: that.data.goal, carpool:'我要找人' }); if (event > 0) { list2 = list2.skip(event); } list2.limit(5).orderBy("create_time", "desc").get().then(res => { console.log(res); const listtwos = res.data; let hasmore = true // let hasmore = listtwos.length > 0; if (listtwos.length == 0) { hasmore = false } let newtwos = []; if (event > 0) { newtwos = that.data.listtwos.concat(listtwos); } else { newtwos = listtwos; } newtwos.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ listtwos: newtwos, hasmore: hasmore, }) }); list2.count().then(res => { console.log(res) that.setData({ result2:res.total }) }) let list3 = db.collection("wehicle").where({ startPoint: that.data.startPoint, goal: that.data.goal, carpool:'我找货车' }); if (event > 0) { list3 = list3.skip(event); } list3.limit(5).orderBy("create_time", "desc").get().then(res => { console.log(res); const listthrees = res.data; let hasmore = true // let hasmore = listthrees.length > 0; if (listthrees.length == 0) { hasmore = false } let newthrees = []; if (event > 0) { newthrees = that.data.listthrees.concat(listthrees); } else { newthrees = listthrees; } newthrees.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ listthrees: newthrees, hasmore: hasmore, }) }); list3.count().then(res => { console.log(res) that.setData({ result3:res.total }) }) let list4 = db.collection("wehicle").where({ startPoint: that.data.startPoint, goal: that.data.goal, carpool:'我要找货' }); if (event > 0) { list4 = list4.skip(event); } list4.limit(5).orderBy("create_time", "desc").get().then(res => { console.log(res); const listfours = res.data; let hasmore = true // let hasmore = listfours.length > 0; if (listfours.length == 0) { hasmore = false } let newfours = []; if (event > 0) { newfours = that.data.listfours.concat(listfours); } else { newfours = listfours; } newfours.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ listfours: newfours, hasmore: hasmore, }) }); list4.count().then(res => { console.log(res) that.setData({ result4:res.total }) }) // that.updateCount(index); that.setData({ startPoint:'', goal:'', }) }, /** * 获取选项卡计数 */ onItemChengdeEvent(event) { const that = this; var index = event.detail.index; }, /** * 获取数据库数据 */ lowdrelease(start = 0) { const that = this; let list = db.collection("wehicle"); if (start > 0) { list = list.skip(start); } list.limit(5).orderBy("create_time", "desc").get().then(res => { console.log(res); const wehicles = res.data; let hasmore = true if (wehicles.length == 0) { hasmore = false } let newWehicles = []; if (start > 0) { newWehicles = that.data.wehicles.concat(wehicles); } else { newWehicles = wehicles; } newWehicles.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ wehicles: newWehicles, hasmore: hasmore, }) }); list.count().then(res => { console.log(res) that.setData({ result:res.total }) }) let list1 = db.collection("wehicle").where({carpool:'我要找车'}); if (start > 0) { list1 = list1.skip(start); } list1.limit(5).orderBy("create_time", "desc").get().then(res => { console.log(res); const listones = res.data; let hasmore = true if (listones.length == 0) { hasmore = false } let newones = []; if (start > 0) { newones = that.data.listones.concat(listones); } else { newones = listones; } newones.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ listones: newones, hasmore: hasmore, }) }); list1.count().then(res => { console.log(res) that.setData({ result1:res.total }) }) let list2 = db.collection("wehicle").where({carpool:'我要找人'}); if (start > 0) { list2 = list2.skip(start); } list2.limit(5).orderBy("create_time", "desc").get().then(res => { console.log(res); const listtwos = res.data; let hasmore = true if (listtwos.length == 0) { hasmore = false } let newtwos = []; if (start > 0) { newtwos = that.data.listtwos.concat(listtwos); } else { newtwos = listtwos; } newtwos.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ listtwos: newtwos, hasmore: hasmore, }) }); list2.count().then(res => { console.log(res) that.setData({ result2:res.total }) }) let list3 = db.collection("wehicle").where({carpool:'我找货车'}); if (start > 0) { list3 = list3.skip(start); } list3.limit(5).orderBy("create_time", "desc").get().then(res => { console.log(res); const listthrees = res.data; let hasmore = true // let hasmore = listthrees.length > 0; if (listthrees.length == 0) { hasmore = false } let newthrees = []; if (start > 0) { newthrees = that.data.listthrees.concat(listthrees); } else { newthrees = listthrees; } newthrees.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ listthrees: newthrees, hasmore: hasmore, }) }); list3.count().then(res => { console.log(res) that.setData({ result3:res.total }) }) let list4 = db.collection("wehicle").where({carpool:'我要找货'}); if (start > 0) { list4 = list4.skip(start); } list4.limit(5).orderBy("create_time", "desc").get().then(res => { console.log(res); const listfours = res.data; let hasmore = true // let hasmore = listfours.length > 0; if (listfours.length == 0) { hasmore = false } let newfours = []; if (start > 0) { newfours = that.data.listfours.concat(listfours); } else { newfours = listfours; } newfours.forEach((wehicle, index) => { wehicle.create_time = wehicle.create_time.toString(); }) that.setData({ listfours: newfours, hasmore: hasmore, }) }); list4.count().then(res => { console.log(res) that.setData({ result4:res.total }) }) }, /** * 生命周期函数--监听页面显示 */ onShow() { this.lowdrelease(0); }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { this.lowdrelease(0); this.setData({ isQuerying:false }) wx.stopPullDownRefresh(); }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { if(!this.data.isQuerying) { this.lowdrelease(this.data.wehicles.length); }else{ this.data.isQuerying } }, })
2024-08-06点菜单切换一下,再点回去就好了,应该是bug[图片]
小程序后台管理-开发管理是不是改版出问题了?[图片] 刷新然后页面布局变了,白名单配置等都找不到了
2024-08-06上传最新的资料认证,再备案,不更新认证的话怕备案的时候主体信息和法人信息不一致导致备案失败,你也可以先直接备案看看,不给提示就不管认证下次重新认证就行了
未备案情况下,营业执照法人发生变动 如何修改最新信息?创建账号时得营业执照现在法人变了 还没备案 我是直接备案还是 先上传最新的营业执照 具体如何操作
2024-08-06更新一下开放工具呢
开发者工具?[图片] 就访问了两个就接口,但是编辑器显示这么多,清缓存也不好使,怎么整?
2024-08-06语言不互通
请问怎么用c++编写小程序呢?或者怎么用插件将c++代码插入小程序呢?(求具体步骤…感谢大佬)本人想请教一下,作为一个c++er,能否实现用c语言编写小程序呢?
2024-08-06符合以下任一条件即可绑定成功: 1)公众号和视频号是同一主体 2)公众号管理员的微信号和视频号管理员的微信号一致 公众号可以辅助认证视频号,不需要二次缴费
公众号和视频号绑定必须是同一个手机号吗?公司的公众号由A手机号注册,现想开通视频号并绑定,是必须用A手机号开通视频号才可以吗?另外,公众号以进行企业认证,视频号还需要另外提交材料认证吗?需要另外缴纳认证费吗?
2024-08-06看有没有站内信,进行申诉
小程序和微信公众号关联,插入小程序链接被限制搜索,如何解决?小程序和微信公众号关联,插入小程序链接被限制搜索,如何解决[图片][图片]
2024-08-06点击“隐私接口权限被回收”可查看问题排查指引文档:https://developers.weixin.qq.com/community/develop/doc/00062a6d514c88baacdf52e8a56009 或检查是否更新或完善小程序《用户隐私保护指引》。可前往“https://mp.weixin.qq.com/登录你的小程序-设置-服务内容声明模块”或代码提审时完善《用户隐私保护指引》
微信接口被回收了咋找回?[图片]
2024-08-06没生效是什么意思?通过第三方发布的小程序组件没生效?
使用三方代开小程序 ext.json里面的usingComponents应该怎么添加?ext.json里面的usingComponents应该怎么添加 ,这样可以不 试了一下好像没生效 { "extEnable": true, "extAppid": "xxx", "ext": { //自定义内容 }, "usingComponents": { "xxx": "/xxx/xxx/xxx" } }
2024-08-05你这个商城和微信没关系吧
怎么确定我续费的是自己的小程序?[图片]微信备案通过了。小程序也年审交钱了。现在小程序连着的商城用不了了。我怎么去续费?哪位大臣帮忙解答一下。谢谢
2024-08-05