Commit 2d289783 by 周志凯

接口管理

1 parent 45a5c346
const baseUrl = 'https://store.keliuyun.com/report'; // window.url;
export default {
LOAD_ACCOUNT_LIST: `${baseUrl}/accounts`,
LOAD_MALL_LIST: `${baseUrl}/malls`,
LOAD_FLOOR_LIST: `${baseUrl}/floors`,
LOAD_ZONE_LIST: `${baseUrl}/zones`,
LOAD_GATE_LIST: `${baseUrl}/gates`,
LOAD_DICT_LIST: `${baseUrl}/dataDics`,
LOAD_FACERECOGNITION_LIST: `${baseUrl}/faceRecognitions`,
}
\ No newline at end of file
import configApi from './configApi'
// 第一种写法
export function fetch(method = 'GET', url, params = null, headers = {}) {
method = method.toLocaleUpperCase();
return new Promise((resolve, reject) => {
......@@ -16,8 +19,88 @@ export function fetch(method = 'GET', url, params = null, headers = {}) {
})
}
// export default {
// getMallList() {
// return fetch('get', '/malls')
// }
// }
\ No newline at end of file
// 第二种写法
const http = (options) => {
const { method = 'get', data, url, headers = {} } = options;
method = method.toLocaleUpperCase();
return new Promise((resolve, reject) => {
uni.request({
url: url,
method: method,
data: data,
header: headers,
success: (res) => {
resolve(res)
},
fail: (err) => {
reject(err);
}
})
})
}
export default {
// 集团列表
loadAccountList(data, headers) {
return http({
url: configApi.LOAD_ACCOUNT_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 商场列表
loadMallList(data, headers) {
return http({
url: configApi.LOAD_MALL_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 楼层列表
loadFloorList(data, headers) {
return http({
url: configApi.LOAD_FLOOR_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 店铺列表
loadZoneList(data, headers) {
return http({
url: configApi.LOAD_ZONE_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 监控点列表
loadGateList(data, headers) {
return http({
url: configApi.LOAD_GATE_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 字典列表
loadDictList(data, headers) {
return http({
url: configApi.LOAD_DICT_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 抓拍记录列表
loadFacerecognitionList(data, headers) {
return http({
url: configApi.LOAD_FACERECOGNITION_LIST,
method: 'get',
data: data,
headers: headers
})
}
}
......@@ -193,7 +193,7 @@
},
goGateList() {
uni.navigateTo({
url:"../../conditionList/multiGateList?backUrl=../passenger/conditions/groupTimeCondition&analysisLevel=" + this.activeType,
url:"../../conditionList/multiGateList?backUrl=../passenger/conditions/groupTimeOption&analysisLevel=" + this.activeType,
animationType: 'slide-in-right',
animationDuration: 200
})
......
// 生成年月日时分秒数据
let dic = {
'Y': '年',
'EnY': 'year',
'M': '月',
'EnM': 'month',
'D': '日',
'EnD': 'day',
'h': '时',
'Enh': 'hour',
'm': '分',
'Enm': 'minutes',
's': '秒',
'Ens': 'seconds',
}
function createDateData(formatString) {
// if(dic[formatString])
}
\ No newline at end of file
......@@ -25,22 +25,4 @@ const conditionList = {
}
}
/*
* 获取门店列表
*/
function getMallId() {
return new Promise((reslove, reject) => {
//
})
}
/*
* 获取出入口列表
*/
function getGateId() {
return new Promise((reslove, reject) => {
//
})
}
export default conditionList;
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!