Commit 7c0a5069bc13c670fbb339f3c2fcb8319b0c981c
1 parent
b81b7153
银联支付 接口调通
Showing
7 changed files
with
227 additions
and
76 deletions
home.html
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | <div><span>停车时长:</span><span id="staytime"></span></div> |
| 34 | 34 | <div><span>进场时间:</span><span id="inparktime"></span></div> |
| 35 | 35 | <div><span>停车总费用:</span><span id="due"></span></div> |
| 36 | - <div id="businessFeeWrap"><span>商户优惠减免:</span><span id="businessFee"></span></div> | |
| 36 | + <!--<div id="businessFeeWrap"><span>商户优惠减免:</span><span id="businessFee"></span></div>--> | |
| 37 | 37 | <div><span>已支付金额:</span><span id="paid"></span></div> |
| 38 | 38 | <div><span>优惠金额:</span><span id="discountFee"></span><span id="discountDesc"></span></div> |
| 39 | 39 | <div><span>订单编号: </span><span id="orderNum">1234567890</span> </div> |
| ... | ... | @@ -83,10 +83,10 @@ |
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | <script src="js/jquery-3.2.1.min.js"></script> |
| 86 | -<script src="js/config.js?c=3.1"></script> | |
| 86 | +<script src="js/config.js?c=8.1"></script> | |
| 87 | 87 | <script src="js/common.js?b=4.11"></script> |
| 88 | 88 | <!--<script src="js/jweixin-1.0.0.js?v=0.1"></script>--> |
| 89 | -<script src="js/pay.js?u=2.60"></script> | |
| 89 | +<script src="js/pay.js?S=888.60"></script> | |
| 90 | 90 | </body> |
| 91 | 91 | |
| 92 | 92 | </html> | ... | ... |
js/ajax.js
js/config.js
| ... | ... | @@ -6,15 +6,17 @@ |
| 6 | 6 | window.webAppH5 = {}; |
| 7 | 7 | |
| 8 | 8 | /*服务器地址*/ |
| 9 | -// var webAppRoot = "http://pay.service.huangshiparking.com"; | |
| 9 | +var webAppRoot = "http://pay.service.huangshiparking.com"; | |
| 10 | 10 | //test 测试环境 |
| 11 | -var webAppRoot = "http://39.98.54.240:8090"; | |
| 11 | +// var webAppRoot = "http://39.98.54.240:8090"; | |
| 12 | 12 | //微信支付结果回调地址 |
| 13 | 13 | var webAppPayResult = "http://wxgzh.huangshiparking.com/HSwechat/PDA-Payment/wxpayResult.html"; |
| 14 | 14 | |
| 15 | +var doPayroot = webAppRoot | |
| 16 | + | |
| 15 | 17 | /*公共参数*/ |
| 16 | 18 | webAppH5.comParams = { |
| 17 | - app_id: 'wx945eccc8163fd75b', | |
| 19 | + app_id: 'wxa1a66cc7d263afe6', | |
| 18 | 20 | salt: 2, |
| 19 | 21 | deviceInfo: 3, |
| 20 | 22 | sign_type: 'md5', | ... | ... |
js/pay.js
| 1 | -var webAppParams = null; | |
| 1 | +/* | |
| 2 | +@songcxa | |
| 3 | +@2018-12-14 | |
| 4 | +@移动支付 | |
| 5 | +*/ | |
| 6 | +var webAppParams = null; | |
| 2 | 7 | var $btnObj = null; |
| 3 | 8 | var $btnLoad = null; |
| 4 | 9 | var flag = 0; |
| 5 | 10 | var appWxID = getQueryString(window.location).appId; |
| 6 | -// var appWxID = 'wx945eccc8163fd75b' | |
| 11 | + | |
| 12 | + | |
| 7 | 13 | var webAppCode = null;//如果是微信,先获取微信code |
| 8 | 14 | //var $btnLoad = document.getElementById("loading"); |
| 9 | 15 | window.onload = function () { |
| ... | ... | @@ -232,10 +238,19 @@ var webAppClass = { |
| 232 | 238 | console.log(res) |
| 233 | 239 | if (res.code == 0) { |
| 234 | 240 | document.getElementById("paySuccess").style.display = 'block' |
| 235 | - | |
| 241 | + // | |
| 242 | + // document.getElementById("sumMoney").innerHTML = (res.data.orderFee/100) | |
| 243 | + // document.getElementById("discountTip").innerHTML = res.data.couponDescribe | |
| 244 | + // document.getElementById("discountFee").innerHTML = (res.data.discountFee/100) | |
| 245 | + // document.getElementById("discountDesc").style.display="none" | |
| 246 | + // $btnLoad.style.display = "none"; | |
| 247 | + // $btnObj.style.display = "block"; | |
| 248 | + // document.getElementById("discountBox").setAttribute('readonly','readonly'); | |
| 249 | + // flag = 1 | |
| 236 | 250 | } else { |
| 237 | 251 | alert(res.message) |
| 238 | - | |
| 252 | + // $discountBtn.disabled = false | |
| 253 | + // document.getElementById("discountTip").innerHTML = res.message | |
| 239 | 254 | } |
| 240 | 255 | }) |
| 241 | 256 | } else { |
| ... | ... | @@ -245,7 +260,36 @@ var webAppClass = { |
| 245 | 260 | //alert(clientType); |
| 246 | 261 | switch (clientType) { |
| 247 | 262 | case "wxPay"://微信[内置浏览器] |
| 248 | - | |
| 263 | + //var wxPay = webAppH5.wxPayServer; | |
| 264 | + //var wxParams = webAppH5.comParams; | |
| 265 | + //wxParams.orderId = orderID; | |
| 266 | + //wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | |
| 267 | + //wxParams.terminalSource = 3;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | |
| 268 | + //debugger; | |
| 269 | + | |
| 270 | + // //新增start | |
| 271 | + // | |
| 272 | + // var url = " https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx20161110163838f231619da20804912345&package=1037687096"; | |
| 273 | + // //window.location.href = url; | |
| 274 | + // var wxPay = webAppH5.wxPayServer; | |
| 275 | + // var wxParams = webAppH5.comParams; | |
| 276 | + // wxParams.carNumber = getQueryString(window.location).carnum; | |
| 277 | + // wxParams.orderId = orderID; | |
| 278 | + // wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | |
| 279 | + // wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | |
| 280 | + // | |
| 281 | + // wxParams.paySrcType = getQueryString(window.location)._paySrcType;//101停车支付 | |
| 282 | + // | |
| 283 | + // wxParams.recordArreaInfos= JSON.stringify([{"orderId":webAppParams.orderId,"orderNotPayFee":_mon*100,"parkId":getQueryString(window.location).parkCode}]); | |
| 284 | + // | |
| 285 | + // //新增end | |
| 286 | + | |
| 287 | + // if (webAppCode == null || webAppCode == "") {//code检测 | |
| 288 | + // alertMsg(appState.codeNullTip); | |
| 289 | + // $btnObj.style.display = "block"; | |
| 290 | + // $btnLoad.style.display = "none"; | |
| 291 | + // return; | |
| 292 | + // } | |
| 249 | 293 | webAppClass.payAjaxJDK(orderID); |
| 250 | 294 | console.log("wxPay");//微信支付 |
| 251 | 295 | break; |
| ... | ... | @@ -253,10 +297,26 @@ var webAppClass = { |
| 253 | 297 | console.log("aliPay"); |
| 254 | 298 | //订单号 |
| 255 | 299 | var obj = {}; |
| 256 | - | |
| 300 | + //this.payAjax(url, { orderId: "11111", price: 0.01 }); | |
| 257 | 301 | var aliPay = webAppH5.doPay; |
| 258 | - | |
| 259 | - webAppClass.payAliAjax(root + aliPay, utilParams(1, orderID, '')); | |
| 302 | + // var aliParams = webAppH5.comParams; | |
| 303 | + // aliParams.orderId = orderID; | |
| 304 | + // aliParams.carNumber = getQueryString(window.location).carnum; | |
| 305 | + // aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | |
| 306 | + // aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | |
| 307 | + // aliParams.paySrcType = getQueryString(window.location)._paySrcType;//101停车支付 | |
| 308 | + // | |
| 309 | + // aliParams.recordArreaInfos = JSON.stringify([{ | |
| 310 | + // "orderId": webAppParams.orderId, | |
| 311 | + // "orderNotPayFee": _mon * 100, | |
| 312 | + // "parkId": getQueryString(window.location).parkCode | |
| 313 | + // }]); | |
| 314 | + // | |
| 315 | + | |
| 316 | + | |
| 317 | + // webAppClass.payAliAjax(root + aliPay, aliParams); | |
| 318 | + | |
| 319 | + webAppClass.payAliAjax(doPayroot + aliPay,utilParams(1,orderID,'')); | |
| 260 | 320 | break; |
| 261 | 321 | default://第三方浏览器other |
| 262 | 322 | //默认支付宝 |
| ... | ... | @@ -266,25 +326,41 @@ var webAppClass = { |
| 266 | 326 | var obj = {}; |
| 267 | 327 | //this.payAjax(url, { orderId: "11111", price: 0.01 }); |
| 268 | 328 | var aliPay = webAppH5.doPay; |
| 269 | - webAppClass.payAliAjax(root + aliPay, utilParams(1, orderID, '')); | |
| 329 | + // var aliParams = webAppH5.comParams; | |
| 330 | + // aliParams.orderId = orderID; | |
| 331 | + // aliParams.carNumber = getQueryString(window.location).carnum; | |
| 332 | + // aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | |
| 333 | + // aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | |
| 334 | + // aliParams.paySrcType = getQueryString(window.location)._paySrcType;//101停车支付 | |
| 335 | + // | |
| 336 | + // aliParams.recordArreaInfos = JSON.stringify([{ | |
| 337 | + // "orderId": webAppParams.orderId, | |
| 338 | + // "orderNotPayFee": _mon * 100, | |
| 339 | + // "parkId": getQueryString(window.location).parkCode | |
| 340 | + // }]); | |
| 341 | + | |
| 342 | + // webAppClass.payAliAjax(root + aliPay, aliParams); | |
| 343 | + webAppClass.payAliAjax(doPayroot + aliPay, utilParams(1,orderID,'')); | |
| 344 | + | |
| 270 | 345 | } else {//微信页面支付 |
| 271 | 346 | var url = " https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx20161110163838f231619da20804912345&package=1037687096"; |
| 272 | 347 | //window.location.href = url; |
| 273 | - var wxPay = webAppH5.wxPayServer; | |
| 274 | - var wxParams = webAppH5.comParams; | |
| 275 | - wxParams.carNumber = getQueryString(window.location).carnum; | |
| 276 | - wxParams.orderId = orderID; | |
| 277 | - wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | |
| 278 | - wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | |
| 279 | - | |
| 280 | - wxParams.paySrcType = getQueryString(window.location)._paySrcType;//101停车支付 | |
| 281 | - | |
| 282 | - wxParams.recordArreaInfos = JSON.stringify([{ | |
| 283 | - "orderId": webAppParams.orderId, | |
| 284 | - "orderNotPayFee": _mon * 100, | |
| 285 | - "parkId": getQueryString(window.location).parkCode | |
| 286 | - }]); | |
| 287 | - webAppClass.payAjax(root + wxPay, wxParams); | |
| 348 | + var wxPay = webAppH5.doPay; | |
| 349 | + // var wxParams = webAppH5.comParams; | |
| 350 | + // wxParams.carNumber = getQueryString(window.location).carnum; | |
| 351 | + // wxParams.orderId = orderID; | |
| 352 | + // wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | |
| 353 | + // wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | |
| 354 | + // | |
| 355 | + // wxParams.paySrcType = getQueryString(window.location)._paySrcType;//101停车支付 | |
| 356 | + // | |
| 357 | + // wxParams.recordArreaInfos = JSON.stringify([{ | |
| 358 | + // "orderId": webAppParams.orderId, | |
| 359 | + // "orderNotPayFee": _mon * 100, | |
| 360 | + // "parkId": getQueryString(window.location).parkCode | |
| 361 | + // }]); | |
| 362 | + // webAppClass.payAjax(root + wxPay, wxParams); | |
| 363 | + webAppClass.payAliAjax(doPayroot + wxPay,utilParams(1,orderID,'')); | |
| 288 | 364 | console.log("wxPay"); |
| 289 | 365 | } |
| 290 | 366 | break; |
| ... | ... | @@ -296,6 +372,7 @@ var webAppClass = { |
| 296 | 372 | getCode: function () { |
| 297 | 373 | var appID = appWxID; |
| 298 | 374 | var code = getUrlParam('code'); |
| 375 | + | |
| 299 | 376 | var local = window.location.href; |
| 300 | 377 | //alert("local:" + local); |
| 301 | 378 | if (code == null || code === '') { |
| ... | ... | @@ -403,6 +480,7 @@ var webAppClass = { |
| 403 | 480 | var btnOBj = $btnObj; |
| 404 | 481 | //0:页面初始化获取code[webAppCode] |
| 405 | 482 | var codeParams = { code: webAppCode, appId: appWxID }; |
| 483 | + // alert('微信webAppCode'+webAppCode) | |
| 406 | 484 | var openIdUrl = webAppRoot + window.webAppH5.wxGetOpenIdServer; |
| 407 | 485 | |
| 408 | 486 | //1:有code获取OpenId |
| ... | ... | @@ -433,10 +511,35 @@ var webAppClass = { |
| 433 | 511 | //} |
| 434 | 512 | }, |
| 435 | 513 | getPayParams: function (openId, orderID) { |
| 514 | + // var wxPay = window.webAppH5.wxPayServer; | |
| 515 | + // var wxParams = window.webAppH5.comParams; | |
| 516 | + // var _mon = document.getElementById("sumMoney").innerHTML | |
| 517 | + // wxParams.orderId = orderID; | |
| 518 | + // wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | |
| 519 | + // wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | |
| 520 | + // //webAppClass.payAjax(root + wxPay, wxParams); | |
| 521 | + // | |
| 522 | + // //新增start | |
| 523 | + // | |
| 524 | + // wxParams.carNumber = getQueryString(window.location).carnum; | |
| 525 | + // | |
| 526 | + // wxParams.paySrcType = getQueryString(window.location)._paySrcType;//101停车支付 | |
| 527 | + // | |
| 528 | + // wxParams.recordArreaInfos = JSON.stringify([{ | |
| 529 | + // "orderId": webAppParams.orderId, | |
| 530 | + // "orderNotPayFee": _mon * 100, | |
| 531 | + // "parkId": getQueryString(window.location).parkCode | |
| 532 | + // }]); | |
| 436 | 533 | |
| 437 | - var jsondata = utilParams(2, orderID, openId); | |
| 438 | - var payParamsUrl = webAppRoot + window.webAppH5.doPay; | |
| 534 | + //新增end | |
| 535 | + | |
| 536 | + // wxParams.openId = openId; | |
| 537 | + // wxParams.appId = appWxID; | |
| 439 | 538 | |
| 539 | + // var jsondata = JSON.stringify(utilParams(2,orderID,openId)); | |
| 540 | + var jsondata = utilParams(2,orderID,openId); | |
| 541 | + | |
| 542 | + var payParamsUrl = webAppRoot + window.webAppH5.doPay; | |
| 440 | 543 | //alert(payParamsUrl);alert(orderID); |
| 441 | 544 | postRequest(payParamsUrl, jsondata, function (res) { |
| 442 | 545 | $btnObj.style.display = "block"; |
| ... | ... | @@ -445,9 +548,11 @@ var webAppClass = { |
| 445 | 548 | if (res.code == 0) {//进场 |
| 446 | 549 | //alertMsg("出场成功"); |
| 447 | 550 | if (res.data) { |
| 448 | - var tmpObj = res.data; | |
| 551 | + var tmpObj =JSON.parse(res.data.jsPayRequest) | |
| 552 | + | |
| 553 | + console.log(tmpObj); | |
| 449 | 554 | webAppClass.weixinJSBridge(tmpObj); |
| 450 | - console.log(JSON.stringify(tmpObj)); | |
| 555 | + | |
| 451 | 556 | //alert(JSON.stringify(tmpObj)); |
| 452 | 557 | } else { |
| 453 | 558 | alertMsg("没有找到返回值"); |
| ... | ... | @@ -467,26 +572,25 @@ var webAppClass = { |
| 467 | 572 | }, |
| 468 | 573 | |
| 469 | 574 | //调用微信内置WeixinJSBridge对象发起支付 |
| 470 | - weixinJSBridge: function (data) { | |
| 471 | - var datas = JSON.parse(data.jsPayRequest); | |
| 472 | - //datas = JSON.parse(datas); | |
| 473 | - var timeStamp = datas.timeStamp; | |
| 474 | - var appId = datas.appId; | |
| 475 | - var nonceStr = datas.nonceStr; | |
| 476 | - var package = datas.package; | |
| 477 | - var paySign = datas.paySign; | |
| 478 | - var type = datas.signType; | |
| 479 | - | |
| 575 | + weixinJSBridge: function (params) { | |
| 480 | 576 | function onBridgeReady() { |
| 481 | 577 | WeixinJSBridge.invoke( |
| 482 | 578 | 'getBrandWCPayRequest', { |
| 483 | - "appId": appId, //公众号名称,由商户传入 | |
| 484 | - "timeStamp": timeStamp, //时间戳,自1970年以来的秒数 | |
| 485 | - "nonceStr": nonceStr, //随机串 | |
| 486 | - "package": package, | |
| 487 | - "signType": type, //微信签名方式: | |
| 488 | - "paySign": paySign //微信签名 | |
| 579 | + "appId": params.appId, //公众号名称,由商户传入 | |
| 580 | + "timeStamp": params.timeStamp, //时间戳,自1970年以来的秒数 | |
| 581 | + "nonceStr": params.nonceStr, //随机串 | |
| 582 | + "package": params.package, | |
| 583 | + "signType": params.signType, //微信签名方式: | |
| 584 | + "paySign": params.paySign //微信签名 | |
| 489 | 585 | }, |
| 586 | + //'getBrandWCPayRequest', { | |
| 587 | + // "appId": appWxID, //公众号名称,由商户传入 | |
| 588 | + // "timeStamp": "1395712654", //时间戳,自1970年以来的秒数 | |
| 589 | + // "nonceStr": "e61463f8efa94090b1f366cccfbbb444", //随机串 | |
| 590 | + // "package": "prepay_id=u802345jgfjsdfgsdg888", | |
| 591 | + // "signType": "MD5", //微信签名方式: | |
| 592 | + // "paySign": "70EA570631E4BB79628FBCA90534C63FF7FADD89" //微信签名 | |
| 593 | + //}, | |
| 490 | 594 | function (res) { |
| 491 | 595 | //alert(res.err_msg); |
| 492 | 596 | if (res.err_msg == "get_brand_wcpay_request:ok") { |
| ... | ... | @@ -524,14 +628,16 @@ var webAppClass = { |
| 524 | 628 | |
| 525 | 629 | //异步请求-支付宝 |
| 526 | 630 | payAliAjax: function (url, params) { |
| 527 | - | |
| 528 | 631 | var btnOBj = $btnObj; |
| 529 | 632 | postRequest(url, params, function (res) { |
| 530 | 633 | btnOBj.style.display = "block"; |
| 531 | 634 | $btnLoad.style.display = "none"; |
| 532 | 635 | if (res.code == 0) {//进场 |
| 636 | + // alert(res.data) | |
| 637 | + // alert(JSON.stringify(res.data)) | |
| 638 | + | |
| 639 | + // document.write(res.data);//打开支付表单 | |
| 533 | 640 | window.location.href = res.data.h5PayRequest |
| 534 | - //document.write(res.data.h5PayRequest);//打开支付表单 | |
| 535 | 641 | } else {//其他情况如【该卡号场内已存在】 |
| 536 | 642 | console.log(res.message); |
| 537 | 643 | alertMsg(res.message); |
| ... | ... | @@ -561,17 +667,8 @@ var webAppClass = { |
| 561 | 667 | $paid = getObjectByID("paid"),//已支付金额 |
| 562 | 668 | $discountDesc = getObjectByID("discountDesc"),//8折优惠折扣费用 |
| 563 | 669 | $discountFee = getObjectByID("discountFee");//优惠金额 |
| 564 | - $businessFeeWrap = getObjectByID("businessFeeWrap") | |
| 565 | - $businessFee = getObjectByID("businessFee") | |
| 566 | - // var businessUsedType = dataselectt[12].split('=')[1]; //商户信息-是否使用商户券,1-使用,0-未使用 | |
| 567 | - // var businessFee = dataselectt[13].split('=')[1]; //商户减扣金额 | |
| 568 | - // | |
| 569 | - // if (businessUsedType == 0) { | |
| 570 | - // $('.businessFee-wrap').css('display', 'none') | |
| 571 | - // } else { | |
| 572 | - // $('.businessFee-wrap').css('display', 'block') | |
| 573 | - // $('#businessFee').text((businessFee/100).toFixed(2)) | |
| 574 | - // } | |
| 670 | + // $businessFeeWrap = getObjectByID("businessFeeWrap") | |
| 671 | + // $businessFee = getObjectByID("businessFee") | |
| 575 | 672 | |
| 576 | 673 | if (params != null && params != "") { |
| 577 | 674 | var price = keepTwoDecimalFull((params.orderFee / 100));//(params.orderFee / 100); |
| ... | ... | @@ -585,17 +682,18 @@ var webAppClass = { |
| 585 | 682 | $parkName.innerHTML = params.parkName; |
| 586 | 683 | $inparktime.innerHTML = params.inparktime; |
| 587 | 684 | $staytime.innerHTML = formatSeconds(params.staytime); |
| 588 | - | |
| 589 | - if (params.businessUsedType == 0) { | |
| 590 | - $('#businessFeeWrap').css('display', 'none') | |
| 591 | - } else { | |
| 592 | - $businessFee.innerHTML = '¥' + (params.businessFee / 100).toFixed(2); | |
| 593 | - } | |
| 685 | + // alert(params.parkName) | |
| 686 | + // // alert(params.businessFee) | |
| 687 | + // if (params.businessUsedType == 0) { | |
| 688 | + // $('#businessFeeWrap').css('display', 'none') | |
| 689 | + // } else { | |
| 690 | + // var _mon = Number(params.businessFee) | |
| 691 | + // $businessFee.innerHTML = '¥' + (_mon / 100).toFixed(2); | |
| 692 | + // } | |
| 594 | 693 | |
| 595 | 694 | $due.innerHTML = keepTwoDecimalFull((params.due / 100));//停车总费用 |
| 596 | 695 | $paid.innerHTML = keepTwoDecimalFull(params.paid / 100); |
| 597 | 696 | $discountFee.innerHTML = params.discountFee;//优惠金额 |
| 598 | - | |
| 599 | 697 | // $discountDesc.innerHTML = params.discountDesc; |
| 600 | 698 | } else { |
| 601 | 699 | console.log("没有接受到参数"); |
| ... | ... | @@ -604,3 +702,54 @@ var webAppClass = { |
| 604 | 702 | |
| 605 | 703 | } |
| 606 | 704 | |
| 705 | + | |
| 706 | +function utilParams(val,orderID,openId) { | |
| 707 | + var _orderTotalFee = Number($('#due').text())*100 //总金额 | |
| 708 | + | |
| 709 | + var _dis = $('#discountFee').text() | |
| 710 | + // alert('discountFee内容'+_dis) | |
| 711 | + var _disMon = _dis.substring(0,_dis.length-1) | |
| 712 | + var _orderDicountFee = Number(_disMon)*100 //优惠了多少钱 | |
| 713 | + | |
| 714 | + // alert('优惠了'+_orderDicountFee) | |
| 715 | + | |
| 716 | + | |
| 717 | + var _orderActFee = _orderTotalFee + _orderDicountFee //实收多少钱 | |
| 718 | + | |
| 719 | + | |
| 720 | + // var _orderActFee = Number($('#sumMoney').text())*100 //实收多少钱 | |
| 721 | + | |
| 722 | + | |
| 723 | + var jsondata; | |
| 724 | + if(_orderDicountFee > 0){ | |
| 725 | + jsondata = { | |
| 726 | + orderBigType:100, | |
| 727 | + payOrderType:101, | |
| 728 | + rltOrderId:orderID, | |
| 729 | + payType:val, | |
| 730 | + terminalSource:7, | |
| 731 | + orderActFee:_orderActFee, | |
| 732 | + orderTotalFee:_orderTotalFee, | |
| 733 | + orderDicountFee:_orderDicountFee, | |
| 734 | + payUserId:openId, | |
| 735 | + terminalOS:isAndroid?'AND':'IOS', | |
| 736 | + couponType:1, //优惠类型 | |
| 737 | + couponCode:$('#discountBox').val(), | |
| 738 | + }; | |
| 739 | + }else{ | |
| 740 | + jsondata = { | |
| 741 | + orderBigType:100, | |
| 742 | + payOrderType:101, | |
| 743 | + rltOrderId:orderID, | |
| 744 | + payType:val, | |
| 745 | + terminalSource:7, | |
| 746 | + orderActFee:_orderActFee, | |
| 747 | + orderTotalFee:_orderTotalFee, | |
| 748 | + payUserId:openId, | |
| 749 | + terminalOS:isAndroid?'AND':'IOS', | |
| 750 | + }; | |
| 751 | + } | |
| 752 | + return jsondata | |
| 753 | +} | |
| 754 | + | |
| 755 | + | ... | ... |
js/url.js
| ... | ... | @@ -87,9 +87,9 @@ mUrl.getJx = function () { |
| 87 | 87 | |
| 88 | 88 | // var cepath = 'http://39.98.54.240:8090'; |
| 89 | 89 | |
| 90 | -// var cepath = 'http://pay.service.huangshiparking.com'; | |
| 90 | +var cepath = 'http://pay.service.huangshiparking.com'; | |
| 91 | 91 | // http://pay.service.renniting.cn |
| 92 | -var cepath = 'http://39.98.54.240:8090' | |
| 92 | +// var cepath = 'http://39.98.54.240:8090' | |
| 93 | 93 | // http://app.api.dyszt.com:8090 |
| 94 | 94 | // var cepath = 'http://app.api.dyszt.com:8090'; |
| 95 | 95 | // https://pay.service.rnting.com//'http://47.96.41.38:8090'; | ... | ... |
list.html