var func ={ openid:'', token:'', unpaid:'', countType:'' }; /** * @param {} second * @return {} * @desc 秒转化成dd hh:mm:ss */ var jsondata = { app_id: "0eca8f5373ca4866aec2f8e9d9367104", deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E", // salt: salt, // sign: getMd5sign(), // sign_type: "md5", "pageNum": 0, "pageSize": 10, "parkState":10, terminalSource: '1', //parkCode:parkCode, carNumber:'京A76543', } jsajax.defaultReq( mUrl.listServer, JSON.stringify(jsondata), function (data) { console.log(data) // alert(data.message) }) var dateFormat = function(msd){ var time =msd if (null != time && "" != time) { if (time > 60 && time < 60 * 60) { time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) - parseInt(time / 60.0)) * 60) + "秒"; } else if (time >= 60 * 60 && time < 60 * 60 * 24) { time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) + "分钟" + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; } else if (time >= 60 * 60 * 24) { time = parseInt(time / 3600.0/24) + "天" +parseInt((parseFloat(time / 3600.0/24)- parseInt(time / 3600.0/24))*24) + "小时" + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) + "分钟" + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; } else { time = parseInt(time) + "秒"; } } return time; }; $(function(){ var data = JSON.parse(localStorage.getItem('paybacklist')); var htmls=''; console.log(data); console.log(data.length); for (var i=0;i parkDuration) { htmls += '
' + '
' + '
' + '

' + data[i].carNumber + '

' + ' ' + // ' ' + '
' + '
' + '
' + '
' + '
' + '

停车场名称:' + data[i].parkName + '

' + '

进场时间:' + data[i].parkInTime + '

' + '

出场时间:' + data[i].parkOutTime + '

' + '

停车时长:' + dateFormat(data[i].parkDuration) + '

' + '
' + '
' + '

' + num + '

' + '

申请离场' + ' ' + '

' + '
' + '
' + '
'; } else { htmls += '
' + '
' + '
' + '

' + data[i].carNumber + '

' + ' ' + // ' ' + '
' + '
' + '
' + '
' + '
' + '

停车场名称:' + data[i].parkName + '

' + '

进场时间:' + data[i].parkInTime + '

' + '

出场时间:' + data[i].parkOutTime + '

' + '

停车时长:' + dateFormat(data[i].parkDuration) + '

' + '
' + '

' + num + '

' + '

出场缴费' + ' ' + '

' + '
' + '
' + '
'; } } else { htmls += '
' + '
' + '
' + '

' + data[i].carNumber + '

' + ' ' + // ' ' + '
' + '
' + outflag + '
' + '
' + '
' + '
' + '

停车场名称:' + data[i].parkName + '

' + '

进场时间:' + data[i].parkInTime + '

' + '

出场时间:' + data[i].parkOutTime + '

' + '

停车时长:' + dateFormat(data[i].parkDuration) + '

' + '
' + '

' + num + '

' + '

清缴欠费' + ' ' + '

' + '
' + '
' + '
'; } // if(outflag=='出场缴费'){ // outflag = '' // } } $('#pay_listcont').append(htmls); }); $(document).on('click','.weui-cells',function () { console.log($(this).attr('data-flag')) var flag = $(this).attr('data-flag') if(flag == 0){ }else{ var money = $(this).find('.paymoney').text() var carNumber = $(this).find('.carNumber').text() //var parkCode = $(this).find('.parkCode').text() var orderId = $(this).find('.orderId').text() var parkCode= $(this).find('.parkCode').text() // var carNumber = $(this).find('.carNumber').text() var paySrcType = $(this).find('.paySrcType').text() if(paySrcType == '欠费'){ paySrcType = 103 }else{ paySrcType = 101 } localStorage.setItem('paySrcType',paySrcType) localStorage.setItem('parkCode',parkCode) getOneorder(carNumber,parkCode,orderId) } }) $(document).on('click','.out-btn',function () { var _this = $(this).parent().parent().parent(); var money = _this.find('.paymoney').text() console.log(money) var _orderId = _this.find('.orderId').text() var carNumber = _this.find('.carNumber').text() //var parkCode = $(this).find('.parkCode').text() // var orderId = _this.find('.orderId').text() var parkCode= _this.find('.parkCode').text() // var carNumber = $(this).find('.carNumber').text() var paySrcType = _this.find('.paySrcType').text() var paySrcType = '101' // if(paySrcType == ''){ // paySrcType = 103 // }else{ // paySrcType = 101 // } // alert(paySrcType) console.log(paySrcType) localStorage.setItem('paySrcType',paySrcType) localStorage.setItem('parkCode',parkCode) var salt = jsajax.salt(32); var token = mUrl.GetToken(); if (token == null) { token = ''; } var jsondata = { app_id: "0eca8f5373ca4866aec2f8e9d9367104", deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E", salt: salt, sign: getMd5sign(), sign_type: "md5", //token : token, //appId:jsajax.appID, orderId: _orderId, payOrderType: '101', terminalSource: '1', //parkCode:parkCode, // carNumber:carNumber, } jsajax.defaultReq( cepath + '/appAccountPay/appApplyParkOut', JSON.stringify(jsondata), function (data) { console.log(data) if(data.code=='5005'){ getOneorder(carNumber,parkCode,_orderId) }else{ //$('.dialog-out').show() window.location.href='zeroout.html' } // alert(data.message) }) }) $('.close-btn').on('click',function () { $('.dialog-out').hide() }) //查询单个待支付单费用 function getOneorder(carNumber,parkCode,orderId){ // var salt = jsajax.salt(32); // var token = mUrl.GetToken(); var salt = jsajax.salt(32); var token = mUrl.GetToken(); if (token == null) { token = ''; } var jsondata = { app_id: "0eca8f5373ca4866aec2f8e9d9367104", deviceInfo : "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E", salt : salt, sign : getMd5sign(), sign_type : "md5", token : token, appId:jsajax.appID, orderId:orderId, terminalSource:'3', parkCode:parkCode, carNumber:carNumber, } console.log('查询单个的入参 '+JSON.stringify(jsondata)+" 请求的接口"+mUrl.oneCardorder); jsajax.defaultReq( mUrl.oneCardorder, JSON.stringify(jsondata), function(data){ console.log(data) console.log('获取单个待支付订单 '+JSON.stringify(data)); if(data.code=='0'){ //setdiv(); setTimeout(function(){ var datas = data.data console.log(datas) var discountFee = datas.discountFee;//已优惠 var discountDesc = datas.discountDesc;//已优惠 var parkCode = datas.parkCode; var no = datas.orderId;//.no;//订单id var inparktime = datas.inparktime;//.inparktime;//进场时间 var plateno = datas.plateno;//车牌号 var parkName = datas.parkName;//停车场名称 var staytime = datas.staytime;//停车时长 var due = datas.due;//总计费用 var unpaid = datas.unpaid;//待支付 var paid = datas.paid;//实付 var discountType = datas.discountType; if(datas.discountFee&&datas.discountFee!=''&&datas.discountFee!=undefined){ discountFee = datas.discountFee;//已优惠 if(datas.discountDesc&&datas.discountDesc!=''&&datas.discountDesc!=undefined){ discountDesc = datas.discountDesc;//已优惠 } } //console.log('-------------------------------'+discountType); //查询到车牌号订单信息 var src = 'home.html?carnum='+plateno +"&inparktime="+inparktime +"&parkName="+parkName +"&staytime="+staytime +"&due="+due +"&unpaid="+unpaid +"&paid="+paid +"&no="+no +"&disfee="+discountFee +"&disdesc="+discountDesc +'&discountType='+discountType +'&parkCode='+parkCode +"&"; console.log(src) window.location.assign(encodeURI(src)) },100); } } ) } function getMd5sign() { var salt = jsajax.salt(32); var token = mUrl.GetToken(); if (token == null) { token = ''; } var sortd = [ {keyname:'app_id',value:'0eca8f5373ca4866aec2f8e9d9367104'}, {keyname:'deviceInfo',value:'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E'}, {keyname:'salt',value:salt}, {keyname:'sign_type',value:'md5'}, {keyname:'token',value:token} ]; var md5sign = jsajax.getsign(sortd); return md5sign; }