|
|
|
const $host = require('./api').baseURL;
|
|
|
|
const request = require('./api').request;
|
|
|
|
const baseURL = `${$host}applets/map/`
|
|
|
|
|
|
|
|
const GET = 'GET';
|
|
|
|
const POST = 'POST';
|
|
|
|
const PUT = 'PUT';
|
|
|
|
const FORM = 'FORM';
|
|
|
|
const DELETE = 'DELETE';
|
|
|
|
|
|
|
|
|
|
|
|
// function request(method, url, data, hasToke = true) {
|
|
|
|
|
|
|
|
// let token = wx.getStorageSync('access_token')
|
|
|
|
// let Authorization = token && hasToke ? `Bearer ${token}` : 'Basic YXBwOmFwcA==';
|
|
|
|
|
|
|
|
|
|
|
|
// // console.log(Authorization)
|
|
|
|
// // console.log(method,url, data,hasToke)
|
|
|
|
|
|
|
|
// return new Promise(function (resolve, reject) {
|
|
|
|
// let header = {
|
|
|
|
// 'content-type': 'application/json',
|
|
|
|
// 'Authorization': Authorization,
|
|
|
|
// };
|
|
|
|
// wx.request({
|
|
|
|
// url: baseURL + url,
|
|
|
|
// method: method,
|
|
|
|
// data: method === POST ? JSON.stringify(data) : data,
|
|
|
|
// header: header,
|
|
|
|
// success(res) {
|
|
|
|
// // console.log(res);
|
|
|
|
// if (res.statusCode == 401) {
|
|
|
|
// wx.showToast({
|
|
|
|
// title: '登录过期,请重新登录',
|
|
|
|
// icon: "none",
|
|
|
|
// mask: true,
|
|
|
|
// })
|
|
|
|
// wx.clearStorage();
|
|
|
|
// wx.navigateTo({
|
|
|
|
// url: "/pages/auth/auth",
|
|
|
|
// })
|
|
|
|
// // setTimeout(() => {
|
|
|
|
|
|
|
|
// // }, 1500)
|
|
|
|
// } else {
|
|
|
|
// resolve(res.data);
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// fail(err) {
|
|
|
|
// //请求失败
|
|
|
|
// reject(err)
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
const API = {
|
|
|
|
getLandListing: (data) => request(GET, `applets/map/getLandListing`, data), //已出让
|
|
|
|
getLandList: (data) => request(GET, `applets/map/getLandList`, data), //挂牌中
|
|
|
|
getRegionByLocation: (data) => request(GET, `applets/map/getRegionByLocation`, data), //行政区
|
|
|
|
getLandToList: (data) => request(GET, `applets/map/getLandToList`, data), //待挂牌
|
|
|
|
getFacilitiesByLocation: (data) => request(GET, `applets/map/getFacilitiesByLocation`, data), //配套
|
|
|
|
getLoopLine: (data) => request(GET, `applets/map/getLoopLine`, data), //环线
|
|
|
|
getTypeRegionByLocation: (data) => request(GET, `applets/map/getTypeRegionByLocation`, data), //大组团或者小组团
|
|
|
|
AJAX: (GET, url, data, is_token) => request(GET, 'applets/map/' + url, data, is_token),
|
|
|
|
};
|
|
|
|
module.exports = {
|
|
|
|
API: API
|
|
|
|
}
|