塔罗:新增下单传参

This commit is contained in:
Dragon
2023-03-23 21:23:16 +08:00
parent f5ad57fd3d
commit 9bcfeb10be

View File

@@ -11,91 +11,92 @@ const PAY_STATUS_SUCCESS = 2;
const PAY_STATUS_FAIL = 3; const PAY_STATUS_FAIL = 3;
const toastMsg = (content = '操作完成', time = 2) => { const toastMsg = (content = '操作完成', time = 2) => {
layer.open({ layer.open({
content, content,
skin: 'msg', skin: 'msg',
time time
}); });
} }
function requestTaroTDrawStatus(chargeRecordId, luckyTarotRecordId, success, fail) { function requestTaroTDrawStatus (chargeRecordId, luckyTarotRecordId, success, fail) {
networkRequest({ networkRequest({
type: 'POST', type: 'POST',
url: urlPrefix + '/lucky/tarot/draw/status', url: urlPrefix + '/lucky/tarot/draw/status',
data: { data: {
chargeRecordId, chargeRecordId,
luckyTarotRecordId, luckyTarotRecordId,
uid: pubInfo.uid, uid: pubInfo.uid,
}, },
success: function (res) { success: function (res) {
if(res.code == 200){ if (res.code == 200) {
success && success(res); success && success(res);
} else { } else {
fail && fail(res);
}
lock = true;
},
error: function (res) {
fail && fail(res); fail && fail(res);
} lock = true;
lock = true; }
}, })
error: function (res) {
fail && fail(res);
lock = true;
}
})
}; };
function requestTaroCharge(chargeProdId, roomUid, cardList, success, fail) { function requestTaroCharge (chargeProdId, roomUid, cardList, success, fail) {
if (!cardList || !(cardList instanceof Array) || cardList.length <= 0) { if (!cardList || !(cardList instanceof Array) || cardList.length <= 0) {
toastMsg('请选择卡片'); toastMsg('请选择卡片');
return ; return;
} }
if (!chargeProdId) { if (!chargeProdId) {
toastMsg('请选择等级'); toastMsg('请选择等级');
return ; return;
} }
networkRequest({ networkRequest({
type: 'POST', type: 'POST',
url: urlPrefix + '/lucky/tarot/charge', url: urlPrefix + '/lucky/tarot/charge',
data: { data: {
chargeProdId, payType,
roomUid, chargeProdId,
cardList: JSON.stringify(cardList), roomUid,
uid: pubInfo.uid, cardList: JSON.stringify(cardList),
successUrl: urlPrefix + '/yinmeng/modules/tarot/payment_result.html' uid: pubInfo.uid,
}, successUrl: urlPrefix + '/yinmeng/modules/tarot/payment_result.html'
success: function (res) { },
if(res.code == 200){ success: function (res) {
success && success(res); if (res.code == 200) {
} else { success && success(res);
} else {
fail && fail(res);
}
},
error: function (res) {
fail && fail(res); fail && fail(res);
} }
}, })
error: function (res) {
fail && fail(res);
}
})
} }
// 塔罗充值预下单接口 // 塔罗充值预下单接口
function preCharge(chargeProdId, roomUid, cardList, success, fail) { function preCharge (chargeProdId, roomUid, cardList, success, fail) {
networkRequest({ networkRequest({
type: 'post', type: 'post',
url: urlPrefix + '/lucky/tarot/pre/create', url: urlPrefix + '/lucky/tarot/pre/create',
data: { data: {
chargeProdId, chargeProdId,
// roomUid: 1005064, // roomUid: 1005064,
roomUid, roomUid,
cardList: JSON.stringify(cardList), cardList: JSON.stringify(cardList),
uid: pubInfo.uid, uid: pubInfo.uid,
}, },
success: function (res) { success: function (res) {
if (res.code == 200) { if (res.code == 200) {
success && success(res); success && success(res);
} }
}, },
error: function (res) { error: function (res) {
fail && fail(res); fail && fail(res);
} }
}) })
} }