求大佬解答啊啊啊啊?Ask the big guy to answer ah ah ah ah?
求大佬解答啊啊啊啊?
<!--显示现有仓库--><scroll-view scroll-y="true" class="showStore" style="height: 1000rpx;"> <block wx:for="{{storeList}}" wx:key="item.index"> <view class="name">{{item.name}}</view> <view class="delete" data-id="{{item._id}}" bindtap="delStore">删除</view> </block></scroll-view><!--提交表单--><form action="submit" bindsubmit="createStore"> <input type="text" name="storename" placeholder="请输入仓库名称"/><button class="createSt" bindtap="flashPage" type="primary" form-type="submit" >创建仓库</button></form>Page({ data: { title:null, store_name:null, storeList:[], num:null, total:null, beachTimes:null, }, getStoreList(){ const max_num = 20; db.collection('store').count().then(res=>{ console.log(res) this.setData({ total:res.total, }) this.setData({ beachTimes:Math.ceil(this.data.total/20) }) console.log(this.data.beachTimes) console.log(this.data.total) var list = []; for(let j = 0;j<this.data.beachTimes;j++){ db.collection('store').skip(j*max_num).limit(max_num).get().then(rez=>{ console.log(rez) for(let i = 0;i<this.data.total;i++){ var obj = { name:rez.data[i].store_name, _id:rez.data[i]._id } list.push(obj) console.log(list) } }) } this.setData({ storeList:list }) }) console.log('storeList是',this.data.storeList) },

//wxml {{item.name}} 删除
//JSPage({ /** * 页面的初始数据 */ data: { title:null, store_name:null, storeList:[], num:null, total:null, beachTimes:null, }, //获取仓库信息 getStoreList(){ const max_num = 20; db.collection('store').count().then(res=>{ console.log(res) this.setData({ total:res.total, }) this.setData({ beachTimes:Math.ceil(this.data.total/20) }) console.log(this.data.beachTimes) console.log(this.data.total) var list = []; for(let j = 0;j
{ console.log(rez) for(let i = 0;i