携带数据 type和query是可以随便换的 根据项目变
//携带全部数据 后台数据收到的是query全部数据 query是可以随便换的
query:{
type:null,
categoryId:null,
pageNum:1,
pageSize:10
},//样片请求参数
getList(){
this.$u.api.getSampleSeriesList(this.query).then(result => {
console.log(result,'result')
let array = result.rows
}).catch(error => {
console.error('请求失败:', error);
});
},
--------------------------------------------------------------
//直接带数据 后台数据收到的是type : 1 的数据 type是可以随便换的
getList(){
this.$u.api.getSampleSeriesList({type:1}).then(result => {
console.log(result,'result')
let array = result.rows
}).catch(error => {
console.error('请求失败:', error);
});
},
map遍历
categrayList: [],//分类
this.categrayList = result.data.map(item => ({
id: item.id,
name: item.categoryName
}));
传值 每个项目的也可能会不一样 随缘吧
uniapp
<!-- uniapp get post接口 -->
<!-- 真实接口的数据链接 传值 传id 和 全部数据-->
let makeupDelete = (params = {}) => vm.$u.post(Vue.prototype.currshop.value+'/makeupArtist/delete?id='+params.id, params, normalHeader);
<!-- 真实接口的数据链接 传值 传id-->
let makeupDelete = (params = {}) => vm.$u.post(Vue.prototype.currshop.value+'/makeupArtist/delete?id='+params.id);
<!-- 真是接口的数据链接 传值 传全部-->
let getSampleSeriesList = (params = {}) => vm.$u.get(Vue.prototype.currshop.value+'/sample/getSampleSeriesList', params,
normalHeader);
<!-- 模拟接口的数据链接 -->
let getSampleSeriesList = (params = {}) => vm.$u.get('http://localhost:8080/travelPhotography-shop/sample/getSampleSeriesList', params, normalHeader);
vue
<!-- vue 普通接口 -->
<!-- get 全部值 ande get id传值-->
export const carouselList = (dataForm: any) => { return service.get('/carousel/page', { params: dataForm }) }
export const sandelete = (id: any) => { return service.get('/agThirdParty/del' + '?id=' + id) }
<!-- delet -->
export const carouseldelete = (dataForm: any) => { return service.delete(`/carousel/delete/${dataForm}`) }
<!-- post -->
export const CarouselNewdedit = (dataForm: any) => { return service.post('/industryInnovation/saveOrUpdate', dataForm) }