塔罗:新增下单传参

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