销售统计

This commit is contained in:
duan
2024-09-13 14:56:53 +08:00
parent 30a2251ec1
commit 9821d970a3
12 changed files with 1760 additions and 34 deletions

View File

@@ -2,12 +2,12 @@
* 因为两个小程序接口不一致餐饮商超商家端的接口使用该http
*/
import useStorage from '@/commons/utils/useStroage.js'
import go from '@/commons/utils/go.js';
// const baseURL = 'http://192.168.2.128:9000/cashierService'
// const baseURL = 'http://192.168.2.41:9888/cashierService'
let baseURL = 'https://wxcashiertest.sxczgkj.cn/cashierService'
// #ifdef H5
baseURL = '/shopApi'
baseURL = '/ysk'
// #endif
// const baseURL = 'https://cashier.sxczgkj.cn/cashierService'
export default function(api = '', data = {}, method = 'GET') {
@@ -20,7 +20,8 @@ export default function(api = '', data = {}, method = 'GET') {
'environment': 'wx',
'type': 'ios',
'version': '1.0.0',
'token': useStorage.get('token'),
'token': useStorage.get('iToken'),
'Authorization': useStorage.get('iToken'),
'Content-Type': 'application/json'
},
success: res => {
@@ -31,6 +32,11 @@ export default function(api = '', data = {}, method = 'GET') {
icon: 'none',
"title": res.data.msg
})
if(res.data.code==-4){
setTimeout(()=>{
go.to('PAGES_LOGIN', {}, 'redirect')
},2000)
}
reject(res.data.msg)
}
},

20
http/yskApi/requestAll.js Normal file
View File

@@ -0,0 +1,20 @@
import http from './http.js'
const request = http.request
// 销售总会list
export function summaryTrade(data) {
return request({
url: '/api/summary/trade',
method: 'post',
data: {
...data
}
})
}
// 销售排行榜
export function dateProduct(params) {
return request({
url: '/api/summary/dateProduct',
method: 'get',
params
})
}