当前位置: 首页>后端>正文

picker的坑

picker回显的问题,三次遍历之后需要set值后再调用this.rangData(res.data,arr,this.categorysIndex)这个方法

//获取经营类目和数据处理
getCategorysData(){
    this.$util.request(this.$server.globalOtherUrlV3 + 'common/getAliCategoryList', {}, 'get', false).then(res => {
        let arr=[]
        this.cateArr = res.data
        
        if(this.thirdCategory){
            let nowSelect = this.filterArr(res.data, this.thirdCategory, 'kndAliPaySignCategoryVoList')
            this.categorySelect.name=nowSelect.categoryName
        }
        this.cateArr.map((item1, index1) => {
            let arr1 = item1                    
            if(this.thirdCategoryId[0] == arr1.id) {
                this.$set(this.categorysIndex,0,index1)
                
                arr1.kndAliPaySignCategoryVoList.map((item2, index2) => {
                    let arr2 = item2                        
                    if(this.thirdCategoryId[1] == arr2.id) {
                        this.$set(this.categorysIndex,1,index2)
                        
                        arr2.kndAliPaySignCategoryVoList.map((item3, index3) => {
                            let arr3 = item3
                            if(this.thirdCategoryId[2] == arr3.id) {
                                this.$set(this.categorysIndex,2,index3)
                                this.categorySelect.id = arr3.id
                                this.categorySelect.name = arr3.categoryName
                                this.rangData(res.data,arr,this.categorysIndex)
                                this.categoryArray=arr.splice(0, 3)
                            }
                        })
                    }
                })
            }
        })
    })
},

后端传过来的数据


picker的坑,第1张
1602156439(1).jpg

https://www.xamrdz.com/backend/3m71997629.html

相关文章: