65 lines
1.5 KiB
JavaScript
65 lines
1.5 KiB
JavaScript
import {
|
|
httpUrlFormat,
|
|
ajaxCarryAuthorization,ajaxSync
|
|
} from '@/utils/httpUtils.js'
|
|
|
|
|
|
import { ApiVersion,AppVersion } from '@/config/baseConfig.js'
|
|
|
|
const headerVersion = {
|
|
'API-Version': ApiVersion(),
|
|
'APP-Version':AppVersion()
|
|
}
|
|
|
|
const _flag = 'apiBaseUrl' // 请求的api空间
|
|
|
|
const apiUrl = {
|
|
'createOrderPay': httpUrlFormat('/pay/create_order', _flag),
|
|
'orderPaid': httpUrlFormat('/order/box_order_paid', _flag),
|
|
'orderShopPaid': httpUrlFormat('/order/order_paid', _flag),
|
|
'mpScheme': httpUrlFormat('/other/wechat/mp/scheme', _flag),
|
|
|
|
}
|
|
|
|
export function createOrderPay(data) {
|
|
return ajaxCarryAuthorization({
|
|
header: headerVersion,
|
|
// header: {'Content-Type': 'application/x-www-form-urlencoded'},
|
|
url: apiUrl.createOrderPay,
|
|
method: 'POST',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 查询盲盒订单是否成功
|
|
export function orderPaid(data) {
|
|
return ajaxCarryAuthorization({
|
|
header: headerVersion,
|
|
// header: {'Content-Type': 'application/x-www-form-urlencoded'},
|
|
url: apiUrl.orderPaid,
|
|
method: 'GET',
|
|
data: data
|
|
})
|
|
}
|
|
// 查询商品订单是否成功
|
|
export function orderShopPaid(data) {
|
|
return ajaxCarryAuthorization({
|
|
header: headerVersion,
|
|
// header: {'Content-Type': 'application/x-www-form-urlencoded'},
|
|
url: apiUrl.orderShopPaid,
|
|
method: 'GET',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// https://test.06zk.com/test/pay/create_order
|
|
|
|
export function mpScheme(data) {
|
|
return ajaxCarryAuthorization({
|
|
header: headerVersion,
|
|
// header: {'Content-Type': 'application/x-www-form-urlencoded'},
|
|
url: apiUrl.mpScheme,
|
|
method: 'GET',
|
|
data
|
|
})
|
|
} |