34 lines
776 B
JavaScript
34 lines
776 B
JavaScript
import request from './request'
|
|
let app = getApp();
|
|
|
|
export default {
|
|
community:{
|
|
list:()=>request.get('/api/community')
|
|
},
|
|
address:{
|
|
list(commityId){
|
|
const data = {};
|
|
if(commityId){
|
|
data.community_id = commityId;
|
|
}
|
|
return request.get('/api/address',data)
|
|
},
|
|
add:(data)=>request.post('/api/address',data),
|
|
update:(data)=>request.put(`/api/address/${data.id}`,data),
|
|
},
|
|
building:{
|
|
list(communityId){
|
|
if(!app){
|
|
app = getApp();
|
|
}
|
|
const data = {
|
|
community_id:communityId,
|
|
user_id:app.globalData.userInfo.userid
|
|
}
|
|
return request.get('/api/community/building/list')
|
|
}
|
|
},
|
|
station:{
|
|
list:(community_id)=>request.get('/api/station',{community_id})
|
|
}
|
|
} |