Commit 26a71087a1b387cacb66053c8af0a763db258a12
1 parent
0f3b6581
add 兑换券
Showing
1 changed file
with
4 additions
and
49 deletions
js/dynCodePay.js
... | ... | @@ -8,7 +8,7 @@ var webAppParams = null;//URL参数 |
8 | 8 | var $btnObj = null; |
9 | 9 | var $btnLoad = null; |
10 | 10 | var webAppCode = null;//如果是微信,先获取微信code |
11 | -var flag = 0; | |
11 | +// var flag = 0; | |
12 | 12 | window.onload = function () { |
13 | 13 | $btnObj = getObjectByID("btnPayOK"); |
14 | 14 | $btnLoad = getObjectByID("loading"); |
... | ... | @@ -47,51 +47,7 @@ window.onload = function () { |
47 | 47 | } |
48 | 48 | /**/ |
49 | 49 | var webAppClass = { |
50 | - //优惠券兑换 | |
51 | - codediscountClick:function(tmpObj){ | |
52 | - discountVal = document.getElementById("discountBox").value; | |
53 | - // console.log(discountVal) | |
54 | - // console.log(discountVal.length) | |
55 | - if(discountVal.length > 0){ | |
56 | - $btnObj.style.display = "none"; | |
57 | - $btnLoad.style.display = "block"; | |
58 | - $discountBtn.disabled = true | |
59 | - console.log(webAppParams.orderId) | |
60 | - var url = webAppRoot + window.webAppH5.discountServer; | |
61 | - var discountParams = { | |
62 | - app_id:'1', | |
63 | - salt:'1', | |
64 | - deviceInfo:'1', | |
65 | - sign_type:'1', | |
66 | - sign:'1', | |
67 | - token:'1', | |
68 | - terminalSource:7, | |
69 | - orderId:webAppParams.orderId, | |
70 | - cardNo:discountVal, | |
71 | - codeType:1 | |
72 | - } | |
73 | - postRequest(url, discountParams, function (res) { | |
74 | - console.log(res) | |
75 | - if(res.code==0){ | |
76 | 50 | |
77 | - document.getElementById("sumMoney").innerHTML = (res.data.orderFee/100) | |
78 | - document.getElementById("discountTip").innerHTML = res.data.couponDescribe | |
79 | - // document.getElementById("discountFee").innerHTML = (res.data.discountFee/100) | |
80 | - // document.getElementById("discountDesc").style.display="none" | |
81 | - $btnLoad.style.display = "none"; | |
82 | - $btnObj.style.display = "block"; | |
83 | - flag = 1 | |
84 | - webAppClass.okPay(tmpObj);//唤醒支付 | |
85 | - }else{ | |
86 | - $discountBtn.disabled = false | |
87 | - document.getElementById("discountTip").innerHTML = res.message | |
88 | - } | |
89 | - }) | |
90 | - | |
91 | - }else{ | |
92 | - return | |
93 | - } | |
94 | - }, | |
95 | 51 | discountClick: function(){ |
96 | 52 | discountVal = document.getElementById("discountBox").value; |
97 | 53 | // console.log(discountVal) |
... | ... | @@ -125,7 +81,7 @@ var webAppClass = { |
125 | 81 | $btnLoad.style.display = "none"; |
126 | 82 | $btnObj.style.display = "block"; |
127 | 83 | document.getElementById("discountBox").setAttribute('readonly','readonly'); |
128 | - flag = 1 | |
84 | + // flag = 1 | |
129 | 85 | }else{ |
130 | 86 | $discountBtn.disabled = false |
131 | 87 | document.getElementById("discountTip").innerHTML = res.message |
... | ... | @@ -148,9 +104,8 @@ var webAppClass = { |
148 | 104 | |
149 | 105 | //确定支付 |
150 | 106 | okPay: function (params) { |
151 | - if(flag == 1){ | |
152 | - webAppClass.codediscountClick(tmpObj); | |
153 | - } | |
107 | + console.log(params) | |
108 | + | |
154 | 109 | var orderID = params.orderId;//订单号 |
155 | 110 | //第一首先判断当前哪种浏览器方式[微信内置、支付宝内置、第三方浏览器] |
156 | 111 | var clientType = clientBrowserEx(); | ... | ... |