Browse Source

修改支付功能

lulihong 6 years ago
parent
commit
ca542587e3
1 changed files with 4 additions and 19 deletions
  1. 4 19
      html/payment/js/payment.js

+ 4 - 19
html/payment/js/payment.js

@ -57,7 +57,6 @@ var loading = dialog({
					if(judgeWxVersion()){
						vm.getWeixinSign()
					}
//					vm.getWeixinSign()
				}else{
				 	 loading.close();
					 dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请输入充值金额'}).show();
@ -72,7 +71,7 @@ var loading = dialog({
				 	loading.close();
			    	dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
			      }, function(res){
			        if(res.status == 200) {	
			        if(res.status == 200) {
						var timestamp = res.data.timestamp;
						var noncestr = res.data.noncestr;
						var signature = res.data.signature;
@ -84,6 +83,7 @@ var loading = dialog({
							signature: signature, // 必填,签名,见附录1
							jsApiList: [
								'chooseWXPay',
								'checkJsApi'
							] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
						});
						wx.ready(function(){					
@ -181,7 +181,6 @@ function queryInit(){
function getUrlParam(name){
    //构造一个含有目标参数的正则表达式对象
    var reg = new RegExp("(^|&)"+name+"=([^&]*)(&|$)");
    alert(window.location.search)
    //匹配目标参数
    var r = window.location.search.substr(1).match(reg);
    //返回参数值
@ -198,26 +197,12 @@ function judgeWxVersion(name){
	}				 
	else
	 {  
	 	wx.checkJsApi({
		    jsApiList: ['chooseWXPay'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
		    success: function(res) {
		    	if("errMsg"=="checkJsApi:ok"){					    		
			    	if(res.checkResult.chooseWXPay){
			    		ispass=true
			    	}else{
				 	    loading.close();
			    		dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'当前微信低于5.0,不支持微信支付,请升级后支付'}).show();
			    	}
		    	}else{
		    		if ( wechatInfo[1] < "5.0" ) { 
	 	if ( wechatInfo[1] < "5.0" ) { 
				 	    loading.close();
		    			dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'当前微信低于5.0,不支持微信支付,请升级后支付'}).show(); 
		    		}else{
		    			ispass=true
		    		}
		    	}
		    }
		});				 	
		    		} 	
	 }
	 return ispass
}