From 9bcfeb10be7a5dca3f01b5dbb09e8efea63b28f7 Mon Sep 17 00:00:00 2001 From: Dragon <13925835632@139.com> Date: Thu, 23 Mar 2023 21:23:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A1=94=E7=BD=97=EF=BC=9A=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/yinmeng/modules/tarot/js/api.js | 151 ++++++++++++++------------- 1 file changed, 76 insertions(+), 75 deletions(-) diff --git a/view/yinmeng/modules/tarot/js/api.js b/view/yinmeng/modules/tarot/js/api.js index c354087..62a795d 100644 --- a/view/yinmeng/modules/tarot/js/api.js +++ b/view/yinmeng/modules/tarot/js/api.js @@ -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); + } + }) } \ No newline at end of file