axios获取数据

2019-09-28  本文已影响0人  Hello杨先生
axios.get("https://search.damai.cn/searchajax.html", {
                        params: {
                            //数据
                            keyword: this.keywords,
                            cty: this.citylist[this.activeCityId] ? this.citylist[this.activeCityId]
                                .name : '',
                            ctl: this.kindlist[this.activeKindId] ? this.kindlist[this.activeKindId]
                                .name : '',
                            currPage: this.activeIndex
                        }
                    }).then((res) => {
                        console.log(res)
                        // console.log(res.data.pageData.resultData)
                        // console.log(res.data.pageData.factMap.categoryname)
                        // console.log(res.data.pageData.factMap.categoryname)
                        // console.log(res.data.pageData.factMap.cityname)
                        this.goodsList = res.data.pageData.resultData
                        this.citylist = res.data.pageData.factMap.cityname
                        // this.cityLength = res.data.pageData.factMap.cityname.length
                        this.kindlist = res.data.pageData.factMap.categoryname
                    })

axios.get(url + {参数} ).then((res)=>{
console.log(res)
})

上一篇下一篇

猜你喜欢

热点阅读