You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
const baseURL = 'https://yoursairdata.com/gis/' |
|
const GET = 'GET'; |
|
const POST = 'POST'; |
|
const PUT = 'PUT'; |
|
const FORM = 'FORM'; |
|
const DELETE = 'DELETE'; |
|
|
|
|
|
function request(method, url, data) { |
|
return new Promise(function (resolve, reject) { |
|
let header = { |
|
'content-type': 'application/json' |
|
}; |
|
wx.request({ |
|
url: baseURL + url, |
|
method: method, |
|
data: method === POST ? JSON.stringify(data) : data, |
|
header: header, |
|
success(res) { |
|
resolve(res.data); |
|
}, |
|
fail(err) { |
|
//请求失败 |
|
reject(err) |
|
} |
|
}) |
|
}) |
|
} |
|
|
|
|
|
const API = { |
|
getLandListing: (data) => request(GET, `getLandListing`,data), //已出让 |
|
getLandList: (data) => request(GET, `getLandList`,data), //挂牌中 |
|
getRegionByLocation: (data) => request(GET, `getRegionByLocation`,data), //行政区 |
|
getLandToList: (data) => request(GET, `getLandToList`,data), //待挂牌 |
|
getFacilitiesByLocation: (data) => request(GET, `getFacilitiesByLocation`,data), //配套 |
|
getLoopLine: (data) => request(GET, `getLoopLine`,data), //环线 |
|
getTypeRegionByLocation: (data) => request(GET, `getTypeRegionByLocation`,data), //大组团或者小组团 |
|
}; |
|
module.exports = { |
|
API: API |
|
} |