xuekang
2024-08-28 1d8fb91684da7c04bdfef00cfa6f09ff5aad09a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import {
    config
} from '@/common/config.js';
 
const http = uni.$u.http;
const URL = config.baseURL;
 
/* 根据cid获取商铺信息 */
export const queryShopByCid = (params, config = {}) => http.get(URL +
    '/payfour-merchant/v1/web/aggregatePayAllin/queryShopById', params, config)
 
/* 根据shopId获取商铺信息 */
export const queryShopByShopId = (params, config = {}) => http.get(URL +
    '/payfour-merchant/v1/web/aggregatePayAllin/queryShopByShopId', params, config)
 
/*统一授权*/
export const userLogin = (params, config = {}) => {
    let path = '/payfour-merchant/v1/web/aggregatePayAllin/getOpenId' //微信授权
    if (params.platform == 5) { //支付宝授权
        path = '/payfour-merchant/v1/web/h5PayAli/getUserIdByCode'
    }
    if (params.platform == 15) { //云闪付授权
        path = '/payfour-merchant/v1/web/h5PayUnionPay/getUserIdByCode'
    }
    return http.get(URL + path,
        params, config = {})
};
 
/* 获取用户可用优惠券 面值最大的*/
export const queryMyUseSweepPayMaxCoupon = (params, config = {}) => http.get(URL +
    '/payfour-merchant/v1/web/aggregatePayAllin/queryMyUseSweepPayMaxCoupon', params, config = {});
 
/* 获取用户可用优惠券 */
export const queryUseSweepPayCoupon = (params, config = {}) => http.get(URL +
    '/payfour-merchant/v1/web/aggregatePayAllin/queryUseSweepPayCoupon', params, config = {});
 
/* 获取微信js sdk配置 */
export const getWechatConfigInfo = (params, config = {}) => http.post(URL +
    '/payfour-merchant/v1/web/aggregatePayAllin/getWechatConfigInfo', params, config = {});
 
/*统一支付*/
export const saveOrder = (params, config = {}) => http.post(URL +
    '/payfour-merchant/v1/web/aggregatePayAllin/saveOrder', params, config = {});
 
/*取消订单*/
export const closeOrder = (params, config = {}) => http.get(URL +
    '/payfour-merchant/v1/web/aggregatePayAllin/scanPayOrderClose', params, config = {});
 
/* 微信支付结果 */
export const getWxOrderInfo = (params, config = {}) => http.post(URL +
    '/payfour-merchant/v1/web/aggregatePayAllin/getWxOrderInfo',
    params, config = {});