c4caec3a by unknown

pay update

1 parent 4ebea400
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="Encoding">
4 <file url="PROJECT" charset="UTF-8" />
5 </component>
6 </project>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <module type="WEB_MODULE" version="4">
3 <component name="NewModuleRootManager">
4 <content url="file://$MODULE_DIR$">
5 <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6 <excludeFolder url="file://$MODULE_DIR$/temp" />
7 <excludeFolder url="file://$MODULE_DIR$/tmp" />
8 </content>
9 <orderEntry type="inheritedJdk" />
10 <orderEntry type="sourceFolder" forTests="false" />
11 </component>
12 </module>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="ProjectModuleManager">
4 <modules>
5 <module fileurl="file://$PROJECT_DIR$/.idea/h5wx.iml" filepath="$PROJECT_DIR$/.idea/h5wx.iml" />
6 </modules>
7 </component>
8 </project>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="VcsDirectoryMappings">
4 <mapping directory="$PROJECT_DIR$" vcs="Git" />
5 </component>
6 </project>
...\ No newline at end of file ...\ No newline at end of file
...@@ -1017,7 +1017,9 @@ body, button, input, select, textarea { ...@@ -1017,7 +1017,9 @@ body, button, input, select, textarea {
1017 font-size: 10px; 1017 font-size: 10px;
1018 } 1018 }
1019 1019
1020 1020 .pay-active{
1021 background: #acacac;
1022 }
1021 1023
1022 1024
1023 1025
......
1 <div ng-controller="bondPayController" class="payPanel"> 1 <div ng-controller="bondPayController" class="payPanel">
2 <div class="paywayMenu"> 2 <div class="paywayMenu">
3 <div class="paywayMenuItem"> 3 <div ng-click="payType = 100" class="paywayMenuItem" ng-class="{'pay-active': payType === 100}">
4 <img src="images/alipay.png" /> 支付宝
5 </div>
6 <div ng-click="payType = 101" class="paywayMenuItem" ng-class="{'pay-active': payType === 101}">
4 <img src="images/wechat.png" /> 微信支付 7 <img src="images/wechat.png" /> 微信支付
5 </div> 8 </div>
6 </div> 9 </div>
......
1 <div ng-controller="mainController"> 1 <div ng-controller="mainController">
2 <div id="mapContainer" class="mapContainer" ng-controller="mapController"></div> 2 <div id="mapContainer" class="mapContainer" ng-controller="mapController"></div>
3 <div id="sliderMenu" class="sliderMenu" style="display: none;" 3 <div id="sliderMenu" class="sliderMenu" style="display: block;"
4 ng-class="{true: 'menuOpen', false: 'menuClose'}[$root.openMenu]"> 4 ng-class="{true: 'menuOpen', false: 'menuClose'}[$root.openMenu]">
5 5
6 <img src="images/slideMenuBackground.png"/> 6 <img src="images/slideMenuBackground.png"/>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
35 </div> 35 </div>
36 36
37 <div id="alipayform" style="display: none"> 37 <div id="alipayform" style="display: none">
38 <form action="http://lsz1.28ms.com/service/balance/alipay/h5" method="post"> 38 <form action="http://h5api.dy.dingdachuxing.com/service/balance/alipay/h5" method="post">
39 <input type="hidden" name="type" value="100"> 39 <input type="hidden" name="type" value="100">
40 <input type="hidden" name="body" value="钱包充值"> 40 <input type="hidden" name="body" value="钱包充值">
41 <div class="paywayMenu"> 41 <div class="paywayMenu">
......
...@@ -15,8 +15,8 @@ angular.module('myApp') ...@@ -15,8 +15,8 @@ angular.module('myApp')
15 // } 15 // }
16 16
17 $scope.init = function(){ 17 $scope.init = function(){
18 var latitude = $stateParams.latitude; 18 var latitude = $stateParams.latitude || '120.15515';
19 var longitude = $stateParams.longitude; 19 var longitude = $stateParams.longitude || '30.27415';
20 dingdaService.getBond(longitude,latitude) 20 dingdaService.getBond(longitude,latitude)
21 .success(function(data){ 21 .success(function(data){
22 // alert(JSON.stringify(data)) 22 // alert(JSON.stringify(data))
......
1 angular.module('myApp') 1 angular.module('myApp')
2 .controller('bondPayController',['$scope', '$rootScope', '$state', 'wechatPayment', 2 .controller('bondPayController',['$scope', '$rootScope', '$state', 'wechatPayment', 'dingdaService',
3 function($scope,$rootScope,$state, wechatPayment){ 3 function($scope,$rootScope,$state, wechatPayment, dingdaService){
4 4 $scope.payType = 100
5 if(!$rootScope.toPaid){ 5 if(!$rootScope.toPaid){
6 $state.go('bond'); 6 $state.go('bond');
7 } 7 }
8 // 支付保证金 8 // 支付保证金
9 var ispay = false; 9 var ispay = false;
10 $scope.goPay = function(){ 10 $scope.goPay = function(){
11 if(ispay) return; 11 if(ispay) return;
12 ispay = true; 12 ispay = true;
13 var IswechatPayment= window.localStorage.getItem("IswechatPayment"); 13 var IswechatPayment= window.localStorage.getItem("IswechatPayment");
14
15 if (IswechatPayment== undefined || IswechatPayment == "no") { 14 if (IswechatPayment== undefined || IswechatPayment == "no") {
16 15
17 wechatPayment.callDepositPay($rootScope.toPaid) 16 wechatPayment.callDepositTypePay($rootScope.toPaid, $scope.payType)
18 .then(function (result) { 17 .then(function (result) {
19 ispay = false; 18 ispay = false;
20 //支付成功 19 //支付成功
21 // alert(window.localStorage.getItem("IswechatPayment")); 20 // alert(window.localStorage.getItem("IswechatPayment"));
22 window.localStorage.setItem("IswechatPayment", "yes") 21 window.localStorage.setItem("IswechatPayment", "yes")
23 $state.go('bondSuccess'); 22 $state.go('bondSuccess');
24 }, function (errMsg) { 23 }, function (errMsg) {
25 ispay = false; 24 ispay = false;
26 window.localStorage.setItem("IswechatPayment", "no") 25 window.localStorage.setItem("IswechatPayment", "no")
27 //支付失败 26 //支付失败
28 }) 27 })
29 } 28 }
30 } 29 // wechatPayment.callDepositPay($rootScope.toPaid, $scope.payType)
31 30 // .then(function (result) {
31 // ispay = false;
32 // //支付成功
33 // // alert(window.localStorage.getItem("IswechatPayment"));
34 // window.localStorage.setItem("IswechatPayment", "yes")
35 // $state.go('bondSuccess');
36 // }, function (errMsg) {
37 // ispay = false;
38 // window.localStorage.setItem("IswechatPayment", "no")
39 // //支付失败
40 // })
41 // }
32 42
43 }
33 44
34 }]) 45 }])
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -39,6 +39,7 @@ angular.module('myApp') ...@@ -39,6 +39,7 @@ angular.module('myApp')
39 console.log(JSON.stringify(data)) 39 console.log(JSON.stringify(data))
40 }) 40 })
41 } 41 }
42
42 $scope.moduleList = []; 43 $scope.moduleList = [];
43 $scope.moduleList.push({ 44 $scope.moduleList.push({
44 name : "行程记录", 45 name : "行程记录",
......
...@@ -235,15 +235,17 @@ angular.module('myApp') ...@@ -235,15 +235,17 @@ angular.module('myApp')
235 menuControlContent.src = "images/me.png"; 235 menuControlContent.src = "images/me.png";
236 236
237 menuControl.appendChild(menuControlContent); 237 menuControl.appendChild(menuControlContent);
238 238
239 menuControl.onclick = function() { 239 menuControl.onclick = function() {
240 $scope.$apply(function() { 240 $scope.$apply(function() {
241 // alert(!globalService.getData("user")) 241 // alert(!globalService.getData("user"))
242 //alert($rootScope.openMenu);
242 if(!globalService.getData("user")) { 243 if(!globalService.getData("user")) {
243 $state.go('login'); 244 $state.go('login');
244 return; 245 return;
245 } 246 }
246 $rootScope.openMenu = !$rootScope.openMenu; 247 $rootScope.openMenu = !$rootScope.openMenu;
248 //alert($rootScope.openMenu);
247 }) 249 })
248 } 250 }
249 map.getContainer().appendChild(menuControl); 251 map.getContainer().appendChild(menuControl);
...@@ -289,12 +291,14 @@ angular.module('myApp') ...@@ -289,12 +291,14 @@ angular.module('myApp')
289 291
290 getlocation(); 292 getlocation();
291 function getlocation() { 293 function getlocation() {
292 wx.getLocation({ 294 // wx.getLocation({
293 type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' 295 // type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
294 success: function (res) { 296 // success: function (res) {
295 onSuccess(res) 297 // onSuccess(res)
296 } 298 // }
297 }); 299 // });
300
301 onSuccess({latitude:30.2741500000,longitude:120.1551500000})
298 } 302 }
299 303
300 304
...@@ -307,6 +311,7 @@ angular.module('myApp') ...@@ -307,6 +311,7 @@ angular.module('myApp')
307 } 311 }
308 var convertor = new BMap.Convertor(); 312 var convertor = new BMap.Convertor();
309 var pointArr = []; 313 var pointArr = [];
314 // alert(longitude, latitude);
310 pointArr.push(new BMap.Point(longitude, latitude)); 315 pointArr.push(new BMap.Point(longitude, latitude));
311 convertor.translate(pointArr, 3, 5, function(data){ 316 convertor.translate(pointArr, 3, 5, function(data){
312 var point = data.points[0]; 317 var point = data.points[0];
...@@ -576,8 +581,8 @@ angular.module('myApp') ...@@ -576,8 +581,8 @@ angular.module('myApp')
576 581
577 initCustomOverlay(); 582 initCustomOverlay();
578 initMap(); 583 initMap();
579 wx.ready(function() { 584 // wx.ready(function() {
580 initLocation(); 585 initLocation();
581 }) 586 // })
582 587
583 }]); 588 }]);
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -54,7 +54,6 @@ angular.module('myApp.services') ...@@ -54,7 +54,6 @@ angular.module('myApp.services')
54 loadCityConfig(); 54 loadCityConfig();
55 loadPathParams(); 55 loadPathParams();
56 initWeixinMenu($http); 56 initWeixinMenu($http);
57
58 } 57 }
59 58
60 var loadPersistData = function() { 59 var loadPersistData = function() {
......
1 angular.module('myApp.services') 1 angular.module('myApp.services')
2 .service('wechatPayment',['$http', '$q', '$rootScope','$location',function($http, $q, $rootScope,$location) { 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';
6 6
7 var h5wxhost = 'http://lsz1.28ms.com/service/balance/'; 7 var payhost = 'http://lsz1.28ms.com/service'
8 8
9 var h5alipayhost = 'http://lsz1.28ms.com/service/balance/'; 9 var h5wxhost = 'http://h5api.dy.dingdachuxing.com/service/balance/';
10
11 var h5alipayhost = 'http://h5api.dy.dingdachuxing.com/service/balance/';
10 12
11 console.log('search:',$location.search()); 13 console.log('search:',$location.search());
12 14
...@@ -101,6 +103,17 @@ angular.module('myApp.services') ...@@ -101,6 +103,17 @@ angular.module('myApp.services')
101 type : 101 103 type : 101
102 }); 104 });
103 return callUnifiedOrderApi(host + "/bail/wx", param); 105 return callUnifiedOrderApi(host + "/bail/wx", param);
106 }, /**
107 * 保证金充值
108 * @param amount
109 */
110 callDepositTypePay : function(amount, type){
111 var param = Object.assign($location.search(),{
112 amount : amount,
113 body : "保证金充值",
114 type : type
115 });
116 return callUnifiedOrderApi(payhost + "/balance/" + (type === 100?'alipay': 'wx') +"/h5", param);
104 }, 117 },
105 /** 118 /**
106 * 钱包充值 119 * 钱包充值
......
...@@ -63,7 +63,7 @@ function initWeixinMenu($http){ ...@@ -63,7 +63,7 @@ function initWeixinMenu($http){
63 .success(function(data){ 63 .success(function(data){
64 // alert(JSON.stringify(data) + ", with url : " + location.href.split('#')[0]) 64 // alert(JSON.stringify(data) + ", with url : " + location.href.split('#')[0])
65 if(data){ 65 if(data){
66 weixinOptionMenuInit(data.appid, data.timestamp, data.noncestr, data.signature); 66 // weixinOptionMenuInit(data.appid, data.timestamp, data.noncestr, data.signature);
67 } 67 }
68 }) 68 })
69 .error(function(arg1){ 69 .error(function(arg1){
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!