add
Showing
1 changed file
with
8 additions
and
5 deletions
| 1 | angular.module('myApp.services') | 1 | angular.module('myApp.services') |
| 2 | .service('wechatPayment',['$http', '$q', '$rootScope',function($http, $q, $rootScope) { | 2 | .service('wechatPayment',['$http', '$q', '$rootScope','$location',function($http, $q, $rootScope,$location) { |
| 3 | 3 | ||
| 4 | //var host = 'http://finance.api.dingdachuxing.com/service'; | 4 | //var host = 'http://finance.api.dingdachuxing.com/service'; |
| 5 | var host = 'http://finance.dy.dingdatech.com/service'; | 5 | var host = 'http://finance.dy.dingdatech.com/service'; |
| ... | @@ -8,7 +8,7 @@ angular.module('myApp.services') | ... | @@ -8,7 +8,7 @@ angular.module('myApp.services') |
| 8 | 8 | ||
| 9 | var h5alipayhost = 'http://lsz1.28ms.com/service/balance/'; | 9 | var h5alipayhost = 'http://lsz1.28ms.com/service/balance/'; |
| 10 | 10 | ||
| 11 | 11 | console.log('search:',$location.search()); | |
| 12 | 12 | ||
| 13 | //调用微信JS api 支付 | 13 | //调用微信JS api 支付 |
| 14 | var jsApiCall = function (sign, q) { | 14 | var jsApiCall = function (sign, q) { |
| ... | @@ -83,22 +83,24 @@ angular.module('myApp.services') | ... | @@ -83,22 +83,24 @@ angular.module('myApp.services') |
| 83 | * 租车付款 | 83 | * 租车付款 |
| 84 | */ | 84 | */ |
| 85 | callRentPay: function (orderId, amount) { | 85 | callRentPay: function (orderId, amount) { |
| 86 | return callUnifiedOrderApi(host + '/bill/wx/' + orderId, { | 86 | var param = Object.assign($location.search(),{ |
| 87 | amount : amount, | 87 | amount : amount, |
| 88 | body : "租车租金", | 88 | body : "租车租金", |
| 89 | type : 101 | 89 | type : 101 |
| 90 | }); | 90 | }); |
| 91 | return callUnifiedOrderApi(host + '/bill/wx/' + orderId, param); | ||
| 91 | }, | 92 | }, |
| 92 | /** | 93 | /** |
| 93 | * 保证金充值 | 94 | * 保证金充值 |
| 94 | * @param amount | 95 | * @param amount |
| 95 | */ | 96 | */ |
| 96 | callDepositPay : function(amount){ | 97 | callDepositPay : function(amount){ |
| 97 | return callUnifiedOrderApi(host + "/bail/wx", { | 98 | var param = Object.assign($location.search(),{ |
| 98 | amount : amount, | 99 | amount : amount, |
| 99 | body : "保证金充值", | 100 | body : "保证金充值", |
| 100 | type : 101 | 101 | type : 101 |
| 101 | }); | 102 | }); |
| 103 | return callUnifiedOrderApi(host + "/bail/wx", param); | ||
| 102 | }, | 104 | }, |
| 103 | /** | 105 | /** |
| 104 | * 钱包充值 | 106 | * 钱包充值 |
| ... | @@ -106,11 +108,12 @@ angular.module('myApp.services') | ... | @@ -106,11 +108,12 @@ angular.module('myApp.services') |
| 106 | */ | 108 | */ |
| 107 | callBalanceRecharge : function(amount,way){ | 109 | callBalanceRecharge : function(amount,way){ |
| 108 | var host = (way == 100 ? h5alipayhost+ "alipay/h5" : h5wxhost+ "wx/h5"); | 110 | var host = (way == 100 ? h5alipayhost+ "alipay/h5" : h5wxhost+ "wx/h5"); |
| 109 | return callUnifiedOrderApi(host, { | 111 | var param = Object.assign($location.search(),{ |
| 110 | amount : amount, | 112 | amount : amount, |
| 111 | body : "钱包充值", | 113 | body : "钱包充值", |
| 112 | type : parseInt(way) | 114 | type : parseInt(way) |
| 113 | }); | 115 | }); |
| 116 | return callUnifiedOrderApi(host, param); | ||
| 114 | } | 117 | } |
| 115 | } | 118 | } |
| 116 | }]); | 119 | }]); | ... | ... |
-
Please register or sign in to post a comment