From a0c3e5ba00c597a89ba620c61626d2970fd3084a Mon Sep 17 00:00:00 2001
From: liuqimichale <123456lq>
Date: Wed, 16 Dec 2020 14:18:01 +0800
Subject: [PATCH] 赤峰 扫码支付 签名
---
js/ajax.js | 298 +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
js/ajax_min.js | 323 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
js/common.js | 47 ++++++++++++++++++++++++++++++++++++-----------
js/config.js | 68 +++-----------------------------------------------------------------
js/list.js | 10 +++++-----
js/listnew.js | 10 +++++-----
js/out.js | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
js/pay.js | 64 +++++++---------------------------------------------------------
js/paybacknew.js | 83 +++++++++++++++++++++++++----------------------------------------------------------
js/url.js | 6 ++++--
list.html | 2 +-
monPay.html | 2 +-
out.html | 231 ++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
paybacknew.html | 6 +++---
14 files changed, 577 insertions(+), 696 deletions(-)
create mode 100644 js/ajax_min.js
create mode 100644 js/out.js
diff --git a/js/ajax.js b/js/ajax.js
index 5644736..e4ead36 100644
--- a/js/ajax.js
+++ b/js/ajax.js
@@ -1,297 +1 @@
-var jsajax = jsajax || {};
-//任你停赤峰
-jsajax.appID = 'wx2af2bab90d433c86';
-//获取openid
-jsajax.getopenid = function (code,fn) {
- var openid = '';
- var jsondata = {
- appId:jsajax.appID,
- code:code
- };
- jsajax.defaultReq(
- mUrl.tcgetopenid,
- JSON.stringify(jsondata),
- function(data){
- console.log("根据code获取openid"+JSON.stringify(data));
- if(data.code=='0'){
- openid = data.data;
- mUrl.SetOpenid(openid);
- mUrl.setApporWX('wx');
- console.log("用户 openid "+openid);
- fn(openid);
- }
- }
- );
-}
-//获取token
-jsajax.gett = function (openid,fn) {
- var jsondata = {
- openid:openid,
- deviceInfo:"BC0703A4-AFB0-4B51-9089-9B7487C0CC6E"
- }
- jsajax.defaultReq(
- mUrl.tcgettoken,
- JSON.stringify(jsondata),
- function (data) {
- console.log('执行获取token的接口 '+JSON.stringify(data));
- if(data.code==0){
- console.log("用户 token "+data.data.token);
- mUrl.SetToken(data.data.token);
- mUrl.SetPhone(data.data.phoneNum);
- fn(1);
- }else{
- fn(0);
- //location.href = mUrl.Uri+'/WEB-INF/pages/elsepages/common_pages/paybind.html;
- }
- }
- );
-}
-/*获取设备 start*/
-
-jsajax.setstyle = function(){
-
- var pt = '';
- if(mUrl.getApporWX()&&mUrl.getApporWX()!=''){
- pt = mUrl.getApporWX();
- }
-// alert('clapntemp_获取到用户openid'+mUrl.getApporWX());
-
- if(pt!=''){
- if(pt=='iosapp'||pt=='andriodapp'){
- if($('.qihuan')){
- $('.qihuan').addClass('iosapp');
- }
-
- }
- }
- console.log('执行米 '+pt);
-}
-jsajax.setstyle();
-
-
-
-/*根据不同的类型加载不同的文件 start*/
-jsajax.dynamicLoading = {
- css: function(path){
- if(!path || path.length === 0){
- throw new Error('argument "path" is required !');
- }
- var head = document.getElementsByTagName('head')[0];
- var link = document.createElement('link');
- link.href = path;
- link.rel = 'stylesheet';
- link.type = 'text/css';
- head.appendChild(link);
- },
- js: function(path){
- if(!path || path.length === 0){
- throw new Error('argument "path" is required !');
- }
- var head = document.getElementsByTagName('head')[0];
- var script = document.createElement('script');
- script.src = path;
- script.type = 'text/javascript';
- head.appendChild(script);
- }
-}
-
-jsajax.setcss = function(strpath){
- var wxorapp = mUrl.getApporWX();
- console.log('这里先获取 '+wxorapp);
- if(wxorapp){
- if(wxorapp!='wx'){
- console.log('不是微信微信');
- if(strpath){
- jsajax.dynamicLoading.css(strpath);
- }
-
- }else{
- //jsajax.dynamicLoading.css("n1.css");
- //console.log('dengyu微信');
- }
- }else{
- jsajax.dynamicLoading.css(strpath);
- }
-};
-
-/* 默认请求*/
-jsajax.defaultReq=function(url, data, successfn,errorfn) {
- data = (data==null || data=="" || typeof(data)=="undefined")? {"date": new Date().getTime()} : data;
- $.ajax({
- type: "post",
- data: data,
- url: url,
- dataType: "json",
- contentType:'application/json;charset=utf-8',
- beforeSend:function(xhr){},
- success: function(d){
- successfn(d);
- },
- error: function(e){
- //alert(JSON.stringify(e));
- console.log(JSON.stringify(e));
- if (typeof (errorfn) != "undefined") {
- errorfn(JSON.stringify(e));
- }
- },
- complete:function (e) {}
- });
-}
-/* 车牌号校验.
*/
-jsajax.isVehicleNumber=function(vehicleNumber){
- var result = false;
- if (vehicleNumber.length == 7){
- var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
- result = express.test(vehicleNumber);
- }
- return result;
-}
-
-//获取签名
-jsajax.getsign = function(objb){
- var compare = function (obj1, obj2) {
- var val1 = obj1.keyname;
- var val2 = obj2.keyname;
- if (val1 < val2) {
- return -1;
- } else if (val1 > val2) {
- return 1;
- } else {
- return 0;
- }
- }
- objb.sort(compare);
- var strmd5 = '14318527b13840c2a4af63fef52c2d6e';
- for(var i=0;i'+strmd5);
- strmd5 = md5(strmd5);
- strmd5=strmd5.toUpperCase();
- return strmd5;
-}
-//获取盐值
-jsajax.salt=function(a){
- var len = parseInt(a);
- var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
- var maxPos = $chars.length;
- var pwd = '';
- for (var i = 0; i < len; i++) {
- pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
- }
- console.log(pwd);
- return pwd;
-}
-
-//金额转换(分转化成元)
-jsajax.fenToYuan=function(fen){
- if( fen == null || fen.length<=0 || isNaN(fen) == true){
- return "";
- }
- var yuan = Math.round(fen);
- yuan = yuan.toString();
- var before = yuan.substr(0, yuan.length - 2);
-
- var end = yuan.substr(yuan.length - 2, 2);
- before = before.toString();
- end = end.toString();
- if(before==''){
- before = '0';
- }
- if(fen<10){
- end = '0'+end;
- }
- yuan = before + "." + end;
- var re = /(-?\d+)(\d{3})/;
- while (re.test(yuan)) {
- yuan = yuan.replace(re, "$1,$2")
- }
- return yuan;
-}
-function isAndroidorios(fn){
- var u = navigator.userAgent, app = navigator.appVersion;
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
- var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
- isAndroid==true?true:false;
- var jixing = '';
- if(isAndroid){jixing = 'android';}else if(isiOS){
- jixing = 'ios';
- }
- fn(jixing);
-}
-//时间转化 秒转分
-jsajax.formatSeconds = function (value) {
- var theTime = parseInt(value);// 秒
- var theTime1 = 0;// 分
- var theTime2 = 0;// 小时
- var result = '';
- var day = parseInt(theTime/(60*60*24));
- var hours = parseInt(theTime/(60*60) - day*24);
- var fen = parseInt(theTime/60 -hours*60 - day*24*60);
- var senc = parseInt(theTime -fen*60 -hours*60*60 - day*24*60*60);
- if(day>0){result +=day+'天';}
- if(hours>0){result +=hours+'小时';}
- if(fen>0){result +=fen+'分';}
- if(senc>0){result +=senc+'秒';}
- return result;
-}
-
-jsajax.fStohours = function (value) {
- var theTime = parseInt(value);// 秒
- var theTime1 = 0;// 分
- var theTime2 = 0;// 小时
- if(theTime > 60) {
- theTime1 = parseInt(theTime/60);
- theTime = parseInt(theTime%60);
- if(theTime1 > 60) {
- theTime2 = parseInt(theTime1/60);
- theTime1 = parseInt(theTime1%60);
- }
- }
- var result = "";//+parseInt(theTime)+"秒";
- if(theTime1 > 0) {
- result = ""+parseInt(theTime1)+"分"+result;
- }
- if(theTime2 > 0) {
- result = ""+parseInt(theTime2)+"小时"+result;
- }
- return result;
-}
-//为Date类型拓展一个format方法,用于格式化日期
-Date.prototype.format = function (format) //author: meizz
-{
- var o = {
- "M+": this.getMonth() + 1, //month
- "d+": this.getDate(), //day
- "h+": this.getHours(), //hour
- "m+": this.getMinutes(), //minute
- "s+": this.getSeconds(), //second
- "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
- "S": this.getMilliseconds() //millisecond
- };
- if (/(y+)/.test(format))
- format = format.replace(RegExp.$1,
- (this.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(format))
- format = format.replace(RegExp.$1,
- RegExp.$1.length == 1 ? o[k] :
- ("00" + o[k]).substr(("" + o[k]).length));
- return format;
-};
-
-//时间格式的返回
-Date.prototype.toLocaleString = function() {
- var se = this.getSeconds();
- var fz = this.getMinutes();
- if(se>=0&&se<=9){
- se = '0'+se;
- }
- if(fz>=0&&fz<=9){
- fz = '0'+fz;
- }
- return this.getFullYear() + "/" + (this.getMonth() + 1) + "/" + this.getDate() + " " + this.getHours() + ":" + fz + ":" + se;
-};
+eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1i.26=j(){z.27=j(){5 a=1i.28||29[0];6(a.P==25){n C}w{6((a.23)&&(a.1j)&&(a.P==1Z)){n C}w{6((a.1j)&&(a.P==1Y)){n C}}}};z.20=j(){n C}};5 21="22";5 k=k||{};k.1k="2a";k.2b=j(c,a){5 b="";5 d={2i:k.1k,J:c};k.Q(t.2j,x.B(d),j(e){u.v("根据J获取W"+x.B(e));6(e.J=="0"){b=e.E;t.2k(b);t.2l("1u");u.v("用户 W "+b);a(b)}})};k.2h=j(b,a){5 c={W:b,2g:"2c-2d-1X-2f-2m"};k.Q(t.1T,x.B(c),j(d){u.v("执行获取F的接口 "+x.B(d));6(d.J==0){u.v("用户 F "+d.E.F);t.1D(d.E.F);t.1G(d.E.1K);a(1)}w{a(0)}})};k.1d=j(){5 a="";6(t.I()&&t.I()!=""){a=t.I()}6(a!=""){6(a=="1g"||a=="1J"){6($(".1h")){$(".1h").1H("1g")}}}u.v("执行米 "+a)};k.1d();k.T={L:j(c){6(!c||c.r===0){1e H 1f(\'1l "1m" 1s 1t !\')}5 a=z.1r("1c")[0];5 b=z.1n("1F");b.1I=c;b.1W="1S";b.Y="1o/L";a.1p(b)},1L:j(c){6(!c||c.r===0){1e H 1f(\'1l "1m" 1s 1t !\')}5 b=z.1r("1c")[0];5 a=z.1n("1Q");a.1M=c;a.Y="1o/1N";b.1p(a)}};k.2n=j(b){5 a=t.I();u.v("这里先获取 "+a);6(a){6(a!="1u"){u.v("不是微信微信");6(b){k.T.L(b)}}w{}}w{k.T.L(b)}};k.Q=j(a,b,d,c){b=(b==O||b==""||1a(b)=="17")?{2e:H 12().2y()}:b;$.2U({Y:"2T",E:b,2S:a,2Q:"19",2X:"2R/19;2W=30-8",2Z:j(e){},2Y:j(e){d(e)},2O:j(f){u.v(x.B(f));6(1a(c)!="17"){c(x.B(f))}},2x:j(f){}})};k.2P=j(b){5 a=C;6(b.r==7){5 c=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-1v-9]{4}[A-1v-9挂学警港澳]{1}$/;a=c.G(b)}n a};k.2z=j(b){5 d=j(h,g){5 f=h.14;5 e=g.14;6(fe){n 1}w{n 0}}};b.2u(d);5 c="1b";16(5 a=0;a"+c);c=2q(c);c=c.2r();n c};k.2s=j(d){5 c=p(d);5 e="2A";5 b=e.r;5 g="";16(5 f=0;f-1||a.1q("2F")>-1;5 c=!!a.2H(/\\(i[^;]+;( U;)? 2L.+2J 2p X/);d==11?11:C;5 b="";6(d){b="2t"}w{6(c){b="2v"}}e(b)}k.2w=j(h){5 e=p(h);5 c=0;5 b=0;5 i="";5 f=p(e/(l*l*24));5 g=p(e/(l*l)-f*24);5 a=p(e/l-g*l-f*24*l);5 d=p(e-a*l-g*l*l-f*24*l*l);6(f>0){i+=f+"天"}6(g>0){i+=g+"小时"}6(a>0){i+=a+"分"}6(d>0){i+=d+"秒"}n i};k.2V=j(e){5 d=p(e);5 c=0;5 b=0;6(d>l){c=p(d/l);d=p(d%l);6(c>l){b=p(c/l);c=p(c%l)}}5 a="";6(c>0){a=""+p(c)+"分"+a}6(b>0){a=""+p(b)+"小时"+a}n a};12.1z.1P=j(b){5 c={"M+":o.V()+1,"d+":o.1x(),"h+":o.1w(),"m+":o.1C(),"s+":o.1y(),"q+":K.1A((o.V()+3)/3),S:o.1R()};6(/(y+)/.G(b)){b=b.13(D.$1,(o.1B()+"").N(4-D.$1.r))}16(5 a 1V c){6(H D("("+a+")").G(b)){b=b.13(D.$1,D.$1.r==1?c[a]:("1U"+c[a]).N((""+c[a]).r))}}n b};12.1z.1E=j(){5 b=o.1y();5 a=o.1C();6(b>=0&&b<=9){b="0"+b}6(a>=0&&a<=9){a="0"+a}n o.1B()+"/"+(o.V()+1)+"/"+o.1x()+" "+o.1w()+":"+a+":"+b};',62,187,'|||||var|if|||||||||||||function|jsajax|60||return|this|parseInt||length||mUrl|console|log|else|JSON||document||stringify|false|RegExp|data|token|test|new|getApporWX|code|Math|css||substr|null|keyCode|defaultReq|toString||dynamicLoading||getMonth|openid||type|||true|Date|replace|keyname|value|for|undefined|navigator|json|typeof|ny1u72b6k374sg379z0kqjgfxe2ycnpw|head|setstyle|throw|Error|iosapp|qihuan|window|shiftKey|appID|argument|path|createElement|text|appendChild|indexOf|getElementsByTagName|is|required|wx|Z0|getHours|getDate|getSeconds|prototype|floor|getFullYear|getMinutes|SetToken|toLocaleString|link|SetPhone|addClass|href|andriodapp|phoneNum|js|src|javascript|Android|format|script|getMilliseconds|stylesheet|tcgettoken|00|in|rel|4B51|121|73|oncontextmenu|_app_id|ud8yq5tv0inxupc05xfeau39jywlqoj2|ctrlKey||123|onload|onkeydown|event|arguments|wx2af2bab90d433c86|getopenid|BC0703A4|AFB0|date|9089|deviceInfo|gett|appId|tcgetopenid|SetOpenid|setApporWX|9B7487C0CC6E|setcss|strmd5|OS|md5|toUpperCase|salt|android|sort|ios|formatSeconds|complete|getTime|getsign|ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678|charAt|isAndroidorios|while|userAgent|Linux|appVersion|match|round|Mac|random|CPU|fenToYuan|isNaN|error|isVehicleNumber|dataType|application|url|post|ajax|fStohours|charset|contentType|success|beforeSend|utf'.split('|'),0,{}))
diff --git a/js/ajax_min.js b/js/ajax_min.js
new file mode 100644
index 0000000..73aff4a
--- /dev/null
+++ b/js/ajax_min.js
@@ -0,0 +1,323 @@
+window.onload = function () {
+ document.onkeydown = function () {
+ var e = window.event || arguments[0];
+ //屏蔽F12
+ if (e.keyCode == 123) {
+
+ return false;
+ //屏蔽Ctrl+Shift+I
+ } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode == 73)) {
+
+ return false;
+ //屏蔽Shift+F10
+ } else if ((e.shiftKey) && (e.keyCode == 121)) {
+ return false;
+ }
+ };
+ //屏蔽右键单击
+ document.oncontextmenu = function () {
+ return false;
+ }
+}
+
+var _app_id = 'ud8yq5tv0inxupc05xfeau39jywlqoj2'
+
+var jsajax = jsajax || {};
+//任你停赤峰
+
+
+jsajax.appID = 'wx2af2bab90d433c86';
+//获取openid
+jsajax.getopenid = function (code,fn) {
+ var openid = '';
+ var jsondata = {
+ appId:jsajax.appID,
+ code:code
+ };
+ jsajax.defaultReq(
+ mUrl.tcgetopenid,
+ JSON.stringify(jsondata),
+ function(data){
+ console.log("根据code获取openid"+JSON.stringify(data));
+ if(data.code=='0'){
+ openid = data.data;
+ mUrl.SetOpenid(openid);
+ mUrl.setApporWX('wx');
+ console.log("用户 openid "+openid);
+ fn(openid);
+ }
+ }
+ );
+}
+//获取token
+jsajax.gett = function (openid,fn) {
+ var jsondata = {
+ openid:openid,
+ deviceInfo:"BC0703A4-AFB0-4B51-9089-9B7487C0CC6E"
+ }
+ jsajax.defaultReq(
+ mUrl.tcgettoken,
+ JSON.stringify(jsondata),
+ function (data) {
+ console.log('执行获取token的接口 '+JSON.stringify(data));
+ if(data.code==0){
+ console.log("用户 token "+data.data.token);
+ mUrl.SetToken(data.data.token);
+ mUrl.SetPhone(data.data.phoneNum);
+ fn(1);
+ }else{
+ fn(0);
+ //location.href = mUrl.Uri+'/WEB-INF/pages/elsepages/common_pages/paybind.html;
+ }
+ }
+ );
+}
+/*获取设备 start*/
+
+jsajax.setstyle = function(){
+
+ var pt = '';
+ if(mUrl.getApporWX()&&mUrl.getApporWX()!=''){
+ pt = mUrl.getApporWX();
+ }
+ // alert('clapntemp_获取到用户openid'+mUrl.getApporWX());
+
+ if(pt!=''){
+ if(pt=='iosapp'||pt=='andriodapp'){
+ if($('.qihuan')){
+ $('.qihuan').addClass('iosapp');
+ }
+
+ }
+ }
+ console.log('执行米 '+pt);
+}
+jsajax.setstyle();
+
+
+
+/*根据不同的类型加载不同的文件 start*/
+jsajax.dynamicLoading = {
+ css: function(path){
+ if(!path || path.length === 0){
+ throw new Error('argument "path" is required !');
+ }
+ var head = document.getElementsByTagName('head')[0];
+ var link = document.createElement('link');
+ link.href = path;
+ link.rel = 'stylesheet';
+ link.type = 'text/css';
+ head.appendChild(link);
+ },
+ js: function(path){
+ if(!path || path.length === 0){
+ throw new Error('argument "path" is required !');
+ }
+ var head = document.getElementsByTagName('head')[0];
+ var script = document.createElement('script');
+ script.src = path;
+ script.type = 'text/javascript';
+ head.appendChild(script);
+ }
+}
+
+jsajax.setcss = function(strpath){
+ var wxorapp = mUrl.getApporWX();
+ console.log('这里先获取 '+wxorapp);
+ if(wxorapp){
+ if(wxorapp!='wx'){
+ console.log('不是微信微信');
+ if(strpath){
+ jsajax.dynamicLoading.css(strpath);
+ }
+
+ }else{
+ //jsajax.dynamicLoading.css("n1.css");
+ //console.log('dengyu微信');
+ }
+ }else{
+ jsajax.dynamicLoading.css(strpath);
+ }
+};
+
+/* 默认请求*/
+jsajax.defaultReq=function(url, data, successfn,errorfn) {
+ data = (data==null || data=="" || typeof(data)=="undefined")? {"date": new Date().getTime()} : data;
+ $.ajax({
+ type: "post",
+ data: data,
+ url: url,
+ dataType: "json",
+ contentType:'application/json;charset=utf-8',
+ beforeSend:function(xhr){},
+ success: function(d){
+ successfn(d);
+ },
+ error: function(e){
+ //alert(JSON.stringify(e));
+ console.log(JSON.stringify(e));
+ if (typeof (errorfn) != "undefined") {
+ errorfn(JSON.stringify(e));
+ }
+ },
+ complete:function (e) {}
+ });
+}
+/* 车牌号校验.
*/
+jsajax.isVehicleNumber=function(vehicleNumber){
+ var result = false;
+ if (vehicleNumber.length == 7){
+ var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
+ result = express.test(vehicleNumber);
+ }
+ return result;
+}
+
+//获取签名
+jsajax.getsign = function(objb){
+ var compare = function (obj1, obj2) {
+ var val1 = obj1.keyname;
+ var val2 = obj2.keyname;
+ if (val1 < val2) {
+ return -1;
+ } else if (val1 > val2) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ objb.sort(compare);
+ var strmd5 = 'ny1u72b6k374sg379z0kqjgfxe2ycnpw';
+ for(var i=0;i'+strmd5);
+ strmd5 = md5(strmd5);
+ strmd5=strmd5.toUpperCase();
+ return strmd5;
+}
+//获取盐值
+jsajax.salt=function(a){
+ var len = parseInt(a);
+ var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
+ var maxPos = $chars.length;
+ var pwd = '';
+ for (var i = 0; i < len; i++) {
+ pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
+ }
+ console.log(pwd);
+ return pwd;
+}
+
+//金额转换(分转化成元)
+jsajax.fenToYuan=function(fen){
+ if( fen == null || fen.length<=0 || isNaN(fen) == true){
+ return "";
+ }
+ var yuan = Math.round(fen);
+ yuan = yuan.toString();
+ var before = yuan.substr(0, yuan.length - 2);
+
+ var end = yuan.substr(yuan.length - 2, 2);
+ before = before.toString();
+ end = end.toString();
+ if(before==''){
+ before = '0';
+ }
+ if(fen<10){
+ end = '0'+end;
+ }
+ yuan = before + "." + end;
+ var re = /(-?\d+)(\d{3})/;
+ while (re.test(yuan)) {
+ yuan = yuan.replace(re, "$1,$2")
+ }
+ return yuan;
+}
+function isAndroidorios(fn){
+ var u = navigator.userAgent, app = navigator.appVersion;
+ var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
+ var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
+ isAndroid==true?true:false;
+ var jixing = '';
+ if(isAndroid){jixing = 'android';}else if(isiOS){
+ jixing = 'ios';
+ }
+ fn(jixing);
+}
+//时间转化 秒转分
+jsajax.formatSeconds = function (value) {
+ var theTime = parseInt(value);// 秒
+ var theTime1 = 0;// 分
+ var theTime2 = 0;// 小时
+ var result = '';
+ var day = parseInt(theTime/(60*60*24));
+ var hours = parseInt(theTime/(60*60) - day*24);
+ var fen = parseInt(theTime/60 -hours*60 - day*24*60);
+ var senc = parseInt(theTime -fen*60 -hours*60*60 - day*24*60*60);
+ if(day>0){result +=day+'天';}
+ if(hours>0){result +=hours+'小时';}
+ if(fen>0){result +=fen+'分';}
+ if(senc>0){result +=senc+'秒';}
+ return result;
+}
+
+jsajax.fStohours = function (value) {
+ var theTime = parseInt(value);// 秒
+ var theTime1 = 0;// 分
+ var theTime2 = 0;// 小时
+ if(theTime > 60) {
+ theTime1 = parseInt(theTime/60);
+ theTime = parseInt(theTime%60);
+ if(theTime1 > 60) {
+ theTime2 = parseInt(theTime1/60);
+ theTime1 = parseInt(theTime1%60);
+ }
+ }
+ var result = "";//+parseInt(theTime)+"秒";
+ if(theTime1 > 0) {
+ result = ""+parseInt(theTime1)+"分"+result;
+ }
+ if(theTime2 > 0) {
+ result = ""+parseInt(theTime2)+"小时"+result;
+ }
+ return result;
+}
+//为Date类型拓展一个format方法,用于格式化日期
+Date.prototype.format = function (format) //author: meizz
+{
+ var o = {
+ "M+": this.getMonth() + 1, //month
+ "d+": this.getDate(), //day
+ "h+": this.getHours(), //hour
+ "m+": this.getMinutes(), //minute
+ "s+": this.getSeconds(), //second
+ "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
+ "S": this.getMilliseconds() //millisecond
+ };
+ if (/(y+)/.test(format))
+ format = format.replace(RegExp.$1,
+ (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+ for (var k in o)
+ if (new RegExp("(" + k + ")").test(format))
+ format = format.replace(RegExp.$1,
+ RegExp.$1.length == 1 ? o[k] :
+ ("00" + o[k]).substr(("" + o[k]).length));
+ return format;
+};
+
+//时间格式的返回
+Date.prototype.toLocaleString = function() {
+ var se = this.getSeconds();
+ var fz = this.getMinutes();
+ if(se>=0&&se<=9){
+ se = '0'+se;
+ }
+ if(fz>=0&&fz<=9){
+ fz = '0'+fz;
+ }
+ return this.getFullYear() + "/" + (this.getMonth() + 1) + "/" + this.getDate() + " " + this.getHours() + ":" + fz + ":" + se;
+};
diff --git a/js/common.js b/js/common.js
index d9db3e2..bb8519d 100644
--- a/js/common.js
+++ b/js/common.js
@@ -1,4 +1,29 @@
-/*
+window.onload = function () {
+ document.onkeydown = function () {
+ var e = window.event || arguments[0];
+ //屏蔽F12
+ if (e.keyCode == 123) {
+
+ return false;
+ //屏蔽Ctrl+Shift+I
+ } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode == 73)) {
+
+ return false;
+ //屏蔽Shift+F10
+ } else if ((e.shiftKey) && (e.keyCode == 121)) {
+ return false;
+ }
+ };
+ //屏蔽右键单击
+ document.oncontextmenu = function () {
+ return false;
+ }
+}
+
+
+
+
+/*
state
*/
var appState = {
@@ -73,7 +98,7 @@ function convertData(data) {
// "id": "456"
// },
// beforeSend: function () {
-// //some js code
+// //some js code
// },
// success: function (msg) {
// console.log(msg)
@@ -91,7 +116,7 @@ function postRequest(url,params,successCallback, errorCallback) {
dataType: "json",
data: JSON.stringify(params),
beforeSend: function () {
- //some js code
+ //some js code
},
success: function (msg) {
successCallback(msg);
@@ -111,7 +136,7 @@ function postRequest(url,params,successCallback, errorCallback) {
/*获取URL?参数*/
function getQueryString(location) {
- //var url = location.search; //获取url中"?"符后的字串
+ //var url = location.search; //获取url中"?"符后的字串
var url = location.search;
var theRequest = new Object();
if (url.indexOf("?") != -1) {
@@ -163,19 +188,19 @@ function keepTwoDecimalFull(num) {
return s_x;
}
-/**
- * param 将要转为URL参数字符串的对象
- * key URL参数字符串的前缀
- * encode true/false 是否进行URL编码,默认为true
- *
- * return URL参数字符串
+/**
+ * param 将要转为URL参数字符串的对象
+ * key URL参数字符串的前缀
+ * encode true/false 是否进行URL编码,默认为true
+ *
+ * return URL参数字符串
*/
var parseParams = function (data) {
try {
var tempArr = [];
for (var i in data) {
var key = (i);
- var value = encodeURIComponent(data[i]);//decodeURIComponent
+ var value = encodeURIComponent(data[i]);//decodeURIComponent
tempArr.push(key + '=' + value);
}
var urlParamsStr = tempArr.join('&');
diff --git a/js/config.js b/js/config.js
index 866909c..123b9b2 100644
--- a/js/config.js
+++ b/js/config.js
@@ -9,9 +9,9 @@ window.webAppH5 = {};
/*服务器地址*/
// var webAppRoot = "http://pay.service.huangshiparking.com";
-var webAppRoot = 'http://pay.service.renniting.cn/'; //赤峰
+// var webAppRoot = 'http://pay.service.renniting.cn/'; //赤峰
//test 测试环境
-// var webAppRoot = "http://39.98.58.92:8090";
+var webAppRoot = "http://39.98.58.92:8090";
//微信支付结果回调地址
var webAppPayResult = "http://wxgzh.renniting.cn/wechatwuxi/DEV/Threewf/codepay/page/wxpayResult.html";
@@ -53,70 +53,8 @@ webAppH5.zeroPayServer = "/appAccountPay/zeroPay";
-
-
-
-
-
-
-
-/*入场参数*/
-//测试地址
-//http://localhost:18879/page/in.html?plNo=P11011700C&parkingId=1&channelId=172198242&direction=0&codeType=0&expireDate=expireDate&extendData=extendData
-//channelId=172198242 [入场设备号]
-//webAppH5.appIn = {
-// /*入场设备号*/
-// channelId: '172198242',
-// /*入:0,1:出*/
-// direction: 0
-//}
-
-/*出场参数*/
-//测试地址
-//http://localhost:18879/page/out.html?plNo=P11011700C&parkingId=1&channelId=172198243&direction=1&codeType=0&expireDate=expireDate&extendData=extendData
-//channelId=172198243 [出场设备号]
-//direction=0 [通行方向 入:0,1:出 必填]
-//webAppH5.appOut = {
-// /*出场设备号*/
-// channelId: '172198243',
-// /*入:0,1:出*/
-// direction:1
-//}
-
-//小票二维码出场
-//http://39.98.54.240/codepay/index.html?appid=0&lotId=1&payConfigId=2&receiptNo=3
-//http://localhost:1260/codepay/index.html?appid=0&lotId=1&payConfigId=2&receiptNo=3
-
-
-//首页
-//进出场标识>>>>>>>>>>direction=0 [通行方向 入:0,1:出 必填]
-//测试服务器进场首页
-//http://39.98.54.240/codepay/index.html?plNo=P11011700C&parkingId=1&channelId=172198242&direction=0&codeType=0&expireDate=expireDate&extendData=extendData
-
-//测试服务器出场首页
-//http://39.98.54.240/codepay/index.html?plNo=P11011700C&parkingId=1&channelId=172198243&direction=1&codeType=0&expireDate=expireDate&extendData=extendData
-
-
-
-//测试支付[任你停测试-首页-停车记录(停车列表车牌号,再找到对应停车场编号)]
-//http://test.renniting.cn/parking/admin/SubMenus/allparkrecords.html
-
-//http://localhost:1260/pay.html?orderId=101526715300086198272&parkName=%E9%9D%99%E9%9B%85%E5%9C%B0%E4%B8%8A&parkCode=B1504020C7&inparktime=2018-12-24%2010%3A58%3A24&outtime=2018-12-24%2011%3A05%3A10&staytime=420&due=70&paid=0&orderTotalFee=70&orderFee=7&discountFee=63&plateno=%E8%92%99DTK366&outPayOrderNo=B1504020C720181224110510813DTK366-172192102&appOrderTimeout=%E8%AF%B7%E5%9C%A8%E6%94%AF%E4%BB%98%E5%AE%8C%E6%88%9010%E5%88%86%E9%92%9F%E5%86%85%E5%87%BA%E5%9C%BA%EF%BC%8C%E5%A6%82%E8%B6%85%E6%97%B6%E6%9C%AA%E5%87%BA%E5%9C%BA%EF%BC%8C%E4%BC%9A%E7%BB%A7%E7%BB%AD%E8%AE%A1%E8%B4%B9%E3%80%82&discountDesc=1%E6%8A%98%E4%BC%98%E6%83%A0&queryOrderInfo=%7B%22app_id%22%3A%221%22%2C%22carNumber%22%3A%22%E8%92%99DTK366%22%2C%22channelId%22%3A%22172192102%22%2C%22codeType%22%3A0%2C%22deviceInfo%22%3A%223%22%2C%22direction%22%3A1%2C%22parkingId%22%3A%22B1504020C7%22%2C%22plNo%22%3A%22B1504020C7%22%2C%22salt%22%3A%222%22%2C%22sign%22%3A%224%22%2C%22sign_type%22%3A%22md5%22%2C%22terminalSource%22%3A%227%22%2C%22token%22%3A%22666%22%7D&needPay=true
-
-
function IsWeixinOrAlipay(){
- //
- // var ua = window.navigator.userAgent;
- // //判断是不是微信
- // if ( ua.indexOf("MicroMessenger") > 0 ) {
- // return 4;
- // }
- // //判断是不是支付宝
- // if (ua.indexOf("Alipayclient") > 0) {
- // return 1;
- // }
- // //哪个都不
- // return "false";
+
var clientType = clientBrowserEx();
if(clientType=='wxPay'){
return 4
diff --git a/js/list.js b/js/list.js
index 7586a44..fccc050 100644
--- a/js/list.js
+++ b/js/list.js
@@ -41,7 +41,7 @@ $('.carNum').text(_carNumber)
*/
var salt = jsajax.salt(32);
var sortd = [
- { keyname: 'app_id', value: '0eca8f5373ca4866aec2f8e9d9367104' },
+ { keyname: 'app_id', value: _app_id },
{ keyname: 'deviceInfo', value: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E' },
{ keyname: 'salt', value: salt },
{ keyname: 'sign_type', value: 'md5' },
@@ -54,7 +54,7 @@ var sortd = [
];
var md5sign = jsajax.getsign(sortd);
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign_type: "md5",
@@ -145,7 +145,7 @@ $(document).on('click', '.out-btn', function () {
token = '';
}
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign: getMd5sign(),
@@ -202,7 +202,7 @@ function getOneorder(carNumber, parkCode, orderId, _paySrcType) {
_payType = 1
}
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign: getMd5sign(),
@@ -290,7 +290,7 @@ function getMd5sign() {
token = '';
}
var sortd = [
- { keyname: 'app_id', value: '0eca8f5373ca4866aec2f8e9d9367104' },
+ { keyname: 'app_id', value: _app_id },
{ keyname: 'deviceInfo', value: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E' },
{ keyname: 'salt', value: salt },
{ keyname: 'sign_type', value: 'md5' },
diff --git a/js/listnew.js b/js/listnew.js
index 18d8aed..408227b 100644
--- a/js/listnew.js
+++ b/js/listnew.js
@@ -33,7 +33,7 @@ $('#payCarNum').text(_carNumber)
*/
var salt = jsajax.salt(32);
var sortd = [
- { keyname: 'app_id', value: '0eca8f5373ca4866aec2f8e9d9367104' },
+ { keyname: 'app_id', value: _app_id },
{ keyname: 'deviceInfo', value: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E' },
{ keyname: 'salt', value: salt },
{ keyname: 'sign_type', value: 'md5' },
@@ -46,7 +46,7 @@ var sortd = [
];
var md5sign = jsajax.getsign(sortd);
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign_type: "md5",
@@ -275,7 +275,7 @@ $(document).on('click', '.out-btn', function () {
token = '';
}
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign: getMd5sign(),
@@ -332,7 +332,7 @@ function getOneorder(carNumber, parkCode, orderId, _paySrcType) {
_payType = 1
}
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign: getMd5sign(),
@@ -420,7 +420,7 @@ function getMd5sign() {
token = '';
}
var sortd = [
- { keyname: 'app_id', value: '0eca8f5373ca4866aec2f8e9d9367104' },
+ { keyname: 'app_id', value: _app_id },
{ keyname: 'deviceInfo', value: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E' },
{ keyname: 'salt', value: salt },
{ keyname: 'sign_type', value: 'md5' },
diff --git a/js/out.js b/js/out.js
new file mode 100644
index 0000000..debc880
--- /dev/null
+++ b/js/out.js
@@ -0,0 +1,123 @@
+var queryParams = null;//?参数名称
+var $btnObj = null, $btnLoad = null;
+
+function inputDown() {
+ var numObj = getObjectByID("inputPhoneNum");
+ numObj.value = numObj.value.replace(/\D/g, '').replace(/^/, '$& ').replace(/....(?!$)/g, '$& ');
+}
+
+window.onload = function () {
+ $btnObj = getObjectByID("btnPayOK");
+ $btnLoad = getObjectByID("loading");
+ $exChangeNum = getObjectByID("exChangeNum");
+ // $exChangeNum.onclick = exChangeNumClick;
+ queryParams = getQueryString(window.location);//获取url参数?sign=4&token=6&codeType=888
+ var ok = $btnObj;
+ ok.onclick = btnOkClick;
+ //初始化请求订单,有跳转选择支付,没有填入手机号
+ $inputCarNum = getObjectByID("inputCarNum");
+ $inputCarNum.onkeyup = checkCharAndNumber
+ //init();//初始化init
+}
+
+function init() {
+ if (queryParams == null) {
+ var str = "没有接收到请求参数";
+ alertMsg(str);
+ console.log(str);
+ return;
+ }
+ var params = queryParams || {};
+ $btnObj.style.display = "none";
+ $btnLoad.style.display = "block";
+ params.payType = IsWeixinOrAlipay()//4:微信 1:支付宝
+ params.terminalSource = "7";//1:任你听 3:微信公共号 4:云平台 7:H5
+ //var tmpParams = Object.assign(params, window.webAppH5.comParams, window.webAppH5.appOut);
+ var tmpParams = Object.assign(params, window.webAppH5.comParams);
+ getRequest(webAppRoot + window.webAppH5.comServer, tmpParams, "init");
+}
+
+//点击查询订单
+function btnOkClick() {
+ window.location.href = "paybacknew.html?carNumber=" + getCarNumber();
+
+}
+
+//读取订单数据
+function getRequest(url, params, init) {
+ var btnObj = $btnObj;
+ postRequest(url, params, function (res) {
+ btnObj.style.display = "block";
+ $btnLoad.style.display = "none";
+ if (res.code == 0) {//进场
+ //alertMsg("出场成功");
+ if (res.data) {
+ var tmpObj = res.data;
+ //判断是否需要支付
+ if (tmpObj.needPay) {
+ var queryParams = parseParams(tmpObj);
+ console.log(tmpObj)
+ window.location.href = "paybacknew.html?carNumber" + queryParams;
+ } else {
+ var tipStr = "无需缴费,欢迎下次光临";
+ sucessTip(tipStr);
+ alertMsg(tipStr);
+ }
+ //var tel = document.getElementById("inputPhoneNum").value.replace(/\s/g, "");//去除空格
+ //var orderFee = keepTwoDecimalFull((tmpObj.orderFee / 100));//本次出场实际应付金额(减去折扣,优惠券等之后的应付金额)
+ //var tmpUrl = "orderId=" + tmpObj.orderId + "&outtime=" + tmpObj.outtime + "&tel=" + tel + "&orderFee=" + orderFee;
+
+ } else {
+ alertMsg("没有找到订单");
+ }
+ } else {//其他情况如【该卡号场内已存在】
+ console.log(res.message);
+ alertMsg(res.message);
+ if ((init) != "init") {
+ alertMsg(res.message);
+ }
+ document.getElementById("inputPhoneNum").focus();
+ }
+ }, function (err) {
+ console.log("网络服务超时..." + url);
+ alertMsg("网络服务超时");
+ btnObj.style.display = "block";
+ $btnLoad.style.display = "none";
+ });
+}
+
+//直接无需缴费出场
+function sucessTip(content) {
+ var obj = ["header", "footer"];
+ for (var i = 0; i < obj.length; i++) {
+ var tmpObj = document.getElementById("" + obj[i] + "");
+ tmpObj.style.display = "none";
+ }
+ document.getElementById("tipResult").style.display = "block";
+ document.getElementById("outTipContent").innerHTML = content;
+}
+
+//获取查询条件值
+function getCarNumber() {
+
+ var tmpValue = "";
+ var tmpPhone = getObjectByID("inputPhoneNum");
+ var phoneNumBox = getObjectByID("phoneNumBox");//手机号
+ if (phoneNumBox.style.display === "block") {
+ tmpValue = tmpPhone.value.replace(/\s*/g, "") + '111';//去除空格
+ if (tmpValue == "" || tmpValue.length < 11) {
+ alertMsg("请输入正确的手机号码!");
+ tmpValue = "";
+ }
+ } else {
+ var tmpNum = getObjectByID("inputCarNum").value;
+ tmpValue = getObjectByID("selProvince").value + tmpNum;
+ if (tmpNum == "" || tmpNum == " ") {
+ alertMsg("车牌号不能为空!");
+ tmpValue = "";
+ }
+ }
+ console.log("查询值:" + tmpValue);
+ return tmpValue;
+
+}
diff --git a/js/pay.js b/js/pay.js
index 0dc7ba6..8e4b202 100644
--- a/js/pay.js
+++ b/js/pay.js
@@ -35,7 +35,6 @@ window.onload = function () {
if (webAppParams != null) {
console.log(webAppParams.carNumber)
-
//设置UI参数
webAppClass.setUI(webAppParams);
} else {
@@ -64,7 +63,7 @@ var webAppClass = {
console.log(webAppParams.orderId)
var url = webAppRoot + window.webAppH5.discountServer;
var discountParams = {
- app_id: '1',
+ app_id: _app_id,
salt: '1',
deviceInfo: '1',
sign_type: '1',
@@ -78,7 +77,6 @@ var webAppClass = {
postRequest(url, discountParams, function (res) {
console.log(res)
if (res.code == 0) {
-
document.getElementById("sumMoney").innerHTML = (res.data.orderFee / 100)
document.getElementById("discountTip").innerHTML = res.data.couponDescribe
document.getElementById("discountFee").innerHTML = (res.data.discountFee / 100)
@@ -130,7 +128,6 @@ var webAppClass = {
postRequest(url, discountParams, function (res) {
console.log(res)
if (res.code == 0) {
-
document.getElementById("sumMoney").innerHTML = (res.data.orderFee / 100)
document.getElementById("discountTip").innerHTML = res.data.couponDescribe
document.getElementById("discountFee").innerHTML = (res.data.discountFee / 100)
@@ -185,7 +182,6 @@ var webAppClass = {
webAppParams = tmpObj;//重新赋值
webAppClass.okPay(tmpObj);//唤醒支付
}
-
console.log(tmpObj)
// webAppClass.okPay(tmpObj);//唤醒支付
} else {
@@ -238,19 +234,10 @@ var webAppClass = {
console.log(res)
if (res.code == 0) {
document.getElementById("paySuccess").style.display = 'block'
- //
- // document.getElementById("sumMoney").innerHTML = (res.data.orderFee/100)
- // document.getElementById("discountTip").innerHTML = res.data.couponDescribe
- // document.getElementById("discountFee").innerHTML = (res.data.discountFee/100)
- // document.getElementById("discountDesc").style.display="none"
- // $btnLoad.style.display = "none";
- // $btnObj.style.display = "block";
- // document.getElementById("discountBox").setAttribute('readonly','readonly');
- // flag = 1
+
} else {
alert(res.message)
- // $discountBtn.disabled = false
- // document.getElementById("discountTip").innerHTML = res.message
+
}
})
} else {
@@ -260,37 +247,7 @@ var webAppClass = {
//alert(clientType);
switch (clientType) {
case "wxPay"://微信[内置浏览器]
- //var wxPay = webAppH5.wxPayServer;
- //var wxParams = webAppH5.comParams;
- //wxParams.orderId = orderID;
- //wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号
- //wxParams.terminalSource = 3;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付
- //debugger;
-
-
- // //新增start
- //
- // var url = " https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx20161110163838f231619da20804912345&package=1037687096";
- // //window.location.href = url;
- // var wxPay = webAppH5.wxPayServer;
- // var wxParams = webAppH5.comParams;
- // wxParams.carNumber = getQueryString(window.location).carnum;
- // wxParams.orderId = orderID;
- // wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号
- // wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付
- //
- // wxParams.paySrcType = getQueryString(window.location)._paySrcType;//101停车支付
- //
- // wxParams.recordArreaInfos= JSON.stringify([{"orderId":webAppParams.orderId,"orderNotPayFee":_mon*100,"parkId":getQueryString(window.location).parkCode}]);
- //
- // //新增end
-
- // if (webAppCode == null || webAppCode == "") {//code检测
- // alertMsg(appState.codeNullTip);
- // $btnObj.style.display = "block";
- // $btnLoad.style.display = "none";
- // return;
- // }
+
webAppClass.payAjaxJDK(orderID);
console.log("wxPay");//微信支付
break;
@@ -471,7 +428,7 @@ var webAppClass = {
payAjaxJDK: function (orderID) {
var btnOBj = $btnObj;
//0:页面初始化获取code[webAppCode]
- var codeParams = {code: webAppCode, appId: appWxID};
+ var codeParams = { code: webAppCode, appId: appWxID };
var openIdUrl = webAppRoot + window.webAppH5.wxGetOpenIdServer;
//1:有code获取OpenId
@@ -510,10 +467,8 @@ var webAppClass = {
wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付
//webAppClass.payAjax(root + wxPay, wxParams);
-
//新增start
-
wxParams.carNumber = getQueryString(window.location).carnum;
wxParams.paySrcType = getQueryString(window.location)._paySrcType;//101停车支付
@@ -526,7 +481,6 @@ var webAppClass = {
//新增end
-
wxParams.openId = openId;
wxParams.appId = appWxID;
var payParamsUrl = webAppRoot + window.webAppH5.wxPayServer;
@@ -578,16 +532,13 @@ var webAppClass = {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
-
-
//window.location.href = webAppPayResult + "?trade_no=" + "success";
window.history.go(-2);
- setTimeout(function(){
+ setTimeout(function () {
window.history.go(-2);
//var src = mUrl.Uri+'/WEB-INF/pages/select.html?openid='+func.openid+'&token='+func.token+"&";//mUrl.myParkCardView;
//window.location.href = src;
- },3000);
-
+ }, 3000);
} else if (res.err_msg == 'get_brand_wcpay_request:cancel') {
window.location.href = webAppPayResult + "?trade_no=" + "fail";
@@ -670,6 +621,5 @@ var webAppClass = {
}
},
-
}
diff --git a/js/paybacknew.js b/js/paybacknew.js
index 4bcd1a0..bcd2c90 100644
--- a/js/paybacknew.js
+++ b/js/paybacknew.js
@@ -1,3 +1,4 @@
+
var fun = {
dateFormat: function (msd) {
var time = msd
@@ -63,7 +64,7 @@ var fun = {
token = '';
}
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign: fun.getMd5sign(),
@@ -77,6 +78,7 @@ var fun = {
carNumber: carNumber,
}
+
// console.log('查询单个的入参 ' + JSON.stringify(jsondata) + " 请求的接口" + mUrl.oneCardorder);
jsajax.defaultReq(
mUrl.oneCardorder,
@@ -88,19 +90,10 @@ var fun = {
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;
- //
+
var discountFee;
var discountDesc;
if (datas.discountFee && datas.discountFee != '' && datas.discountFee != undefined) {
@@ -128,9 +121,7 @@ var fun = {
+ "&parkCode=" + parkCode
+ "&paySrcType=" + _paySrcType
- // + '&discountType=' + discountType
- // + '&parkCode=' + parkCode
- // + "&";
+
console.log(src)
window.location.assign(encodeURI(src))
}, 100);
@@ -151,7 +142,7 @@ var fun = {
var orderlist = fun.orderIds
var codes = "[" + fun.parkCodes + "]"
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign: fun.getMd5sign(),
@@ -177,11 +168,7 @@ var fun = {
var discountFee = datas.arrearageDiscFee;//已优惠
var discountDesc = datas.discDesc;//已优惠
var carNumber = datas.carNumber;
- // var no = datas.orderId;//.no;//订单id
- // var inparktime = datas.inparktime;//.inparktime;//进场时间
- // var plateno = datas.carNumber;//车牌号
- // var parkName = datas.parkName;//停车场名称
- // var staytime = datas.staytime;//停车时长
+
var due = datas.arrearageTotalFee;//总计费用
var unpaid = datas.arrearageActFee;//待支付
var paid = datas.arrearageActFee;//实付
@@ -193,17 +180,12 @@ var fun = {
discountDesc = datas.discountDesc;//已优惠
}
}
-
- //console.log('-------------------------------'+discountType);
-
var _num = datas.arrearageNum
var _paySrcType = 103
//查询到车牌号订单信息
var src = 'monPay.html?carnum=' + carNumber
- // + "&inparktime=" + inparktime
- // + "&parkName=" + parkName
- // + "&staytime=" + staytime
+
+ "&due=" + due
+ "&unpaid=" + unpaid
+ "&paid=" + paid
@@ -229,7 +211,7 @@ var fun = {
token = '';
}
var sortd = [
- { keyname: 'app_id', value: '0eca8f5373ca4866aec2f8e9d9367104' },
+ { keyname: 'app_id', value: _app_id },
{ keyname: 'deviceInfo', value: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E' },
{ keyname: 'salt', value: salt },
{ keyname: 'sign_type', value: 'md5' },
@@ -249,7 +231,7 @@ var fun = {
parkCodes: [],
parkCodeArr: [],
selectedMon: 0,//选中了总金额
- flag:false,
+ flag: false,
getQueryVariable: function (variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
@@ -290,7 +272,7 @@ var fun = {
' 出场时间:' + fun.inData[0].parkOutTime + '
\n' +
' 停车时长:' + fun.dateFormat(fun.inData[0].parkDuration) + '
\n' +
' ' + ((fun.inData[0].unPayFee) / 100).toFixed(2) + '元\n' +
- '申请离场' +
+ '
申请离场' +
' ' + fun.inData[0].orderId + '' +
'
' +
@@ -346,7 +328,6 @@ var fun = {
}
},
_initData: function () {
-
var _carNumber = fun.getQueryVariable('carNumber')
console.log(_carNumber)
@@ -357,7 +338,7 @@ var fun = {
*/
var salt = jsajax.salt(32);
var sortd = [
- { keyname: 'app_id', value: '0eca8f5373ca4866aec2f8e9d9367104' },
+ { keyname: 'app_id', value: _app_id },
{ keyname: 'deviceInfo', value: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E' },
{ keyname: 'salt', value: salt },
{ keyname: 'sign_type', value: 'md5' },
@@ -370,7 +351,7 @@ var fun = {
];
var md5sign = jsajax.getsign(sortd);
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign_type: "md5",
@@ -434,7 +415,7 @@ $('#check-btn').on('click', function () {
})
//......................... 单个选择操作
-$('#arrears-list').delegate('li','click', function () {
+$('#arrears-list').delegate('li', 'click', function () {
var mon = $(this).attr('data-unpayfee')
var orderid = $(this).attr('data-orderid')
var parkcode = $(this).attr('data-parkcode')
@@ -472,7 +453,7 @@ $('#arrears-list').delegate('li','click', function () {
//......................... 本次费用
$('#pay-wrap').on('click', function () {
- if(fun.flag){
+ if (fun.flag) {
return
}
var carNumber = $(this).attr('carNumber')
@@ -496,26 +477,16 @@ $('#opr-btn').on('click', function () {
//......................... 免费离场
$(document).on('click', '.out-btn', function () {
- // var _this = $(this).parent().parent().parent();
-
var money = $(this).attr('data-money')
console.log(money)
var _orderId = $(this).attr('data-orderId')
var carNumber = $(this).attr('data-carnumber')
- //var parkCode = $(this).find('.parkCode').text()
- // var orderId = _this.find('.orderId').text()
+
var parkCode = $(this).attr('data-parkcode')
- // var carNumber = $(this).find('.carNumber').text()
var paySrcType = '101'
- // if(paySrcType == ''){
- // paySrcType = 103
- // }else{
- // paySrcType = 101
- // }
- // alert(paySrcType)
console.log(paySrcType)
localStorage.setItem('paySrcType', paySrcType)
localStorage.setItem('parkCode', parkCode)
@@ -526,7 +497,7 @@ $(document).on('click', '.out-btn', function () {
token = '';
}
var jsondata = {
- app_id: "0eca8f5373ca4866aec2f8e9d9367104",
+ app_id: _app_id,
deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E",
salt: salt,
sign: getMd5sign(),
@@ -546,7 +517,6 @@ $(document).on('click', '.out-btn', function () {
JSON.stringify(jsondata),
function (data) {
console.log(data)
-
if (data.code == '5005') {
getOneorder(carNumber, parkCode, _orderId)
@@ -555,28 +525,25 @@ $(document).on('click', '.out-btn', function () {
// window.location.href = 'zeroout.html'
}
// alert(data.message)
-
})
-
})
-$('.close-btn').on('click',function () {
+$('.close-btn').on('click', function () {
$('.dialog-out').hide()
})
-function getMd5sign()
-{
+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}
+ { keyname: 'app_id', value: _app_id },
+ { 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;
diff --git a/js/url.js b/js/url.js
index 1bbdfd1..050a5be 100644
--- a/js/url.js
+++ b/js/url.js
@@ -1,3 +1,5 @@
+
+
var mUrl = mUrl || {};
@@ -87,9 +89,9 @@ mUrl.getJx = function(){
/*end*/
-// var cepath = 'http://39.98.58.92:8090';
+var cepath = 'http://39.98.58.92:8090';
-var cepath = 'http://pay.service.renniting.cn/';
+// var cepath = 'http://pay.service.renniting.cn/';
// http://pay.service.huangshiparking.com
/*----------------------------------------------登录登出绑定手机号 start*/
diff --git a/list.html b/list.html
index a579a67..8f4b2d3 100644
--- a/list.html
+++ b/list.html
@@ -126,7 +126,7 @@ function activityQuery() {
// mUrl.activity = cepath + '/activity/queryActivityListByOrgId'
var salt = jsajax.salt(32);
var jsondata = {
- app_id: '0eca8f5373ca4866aec2f8e9d9367104',
+ app_id: _app_id,
deviceInfo: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E',
salt: salt,
sign_type: 'md5',
diff --git a/monPay.html b/monPay.html
index 631933c..b8327af 100644
--- a/monPay.html
+++ b/monPay.html
@@ -113,7 +113,7 @@
-
+
-
-
-
-