求大佬解答啊啊啊啊?

小程序 文章 2022-04-01 17:20 330 0 全屏看文

AI助手支持GPT4.0

求大佬解答啊啊啊啊?Ask the big guy to answer ah ah ah ah?

求大佬解答啊啊啊啊?
//wxml<!--显示现有仓库--><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>//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<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

回答:

呵呵:

八九:

看下数据格式,对应渲染

禹:

数据取到了,前端页面没显示了,求大佬解答!

-EOF-

AI助手支持GPT4.0