dfa54f2b by ex

登录修改

1 parent b33eccea
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: block;" 3 <div id="sliderMenu" class="sliderMenu" style="display: none;"
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"/>
......
...@@ -25,6 +25,14 @@ function isJson(str) { ...@@ -25,6 +25,14 @@ function isJson(str) {
25 } 25 }
26 return true; 26 return true;
27 } 27 }
28 function toJson(str) {
29 try {
30 var arr = str.split(2,str.length - 4)
31 console.log(arr)
32 } catch (e) {
33 return ''
34 }
35 }
28 // window.invokeJsPassCompanyCodeAndName = function(_params) { 36 // window.invokeJsPassCompanyCodeAndName = function(_params) {
29 // companyCode = _params.companyCode; 37 // companyCode = _params.companyCode;
30 // companyName = _params.companyName; 38 // companyName = _params.companyName;
...@@ -45,16 +53,7 @@ AppClient.prototype.getERCode = function (callbackName, callback, jsonStr) { ...@@ -45,16 +53,7 @@ AppClient.prototype.getERCode = function (callbackName, callback, jsonStr) {
45 this.appObj.getERCode('H5', jsonStr); 53 this.appObj.getERCode('H5', jsonStr);
46 } else { 54 } else {
47 this.appObj.callHandler("getERCode", iOSData, callback); 55 this.appObj.callHandler("getERCode", iOSData, callback);
48 this.appObj.registerHandler('postERCode', function(data, responseCallback) { 56
49 layer.open({
50 content: JSON.stringify(data),
51 time: 10
52 });
53 // log('ObjC called testJavascriptHandler with', data)
54 // var responseData = { 'Javascript Says':'Right back atcha!' }
55 // log('JS responding with', responseData)
56 // responseCallback(responseData)
57 })
58 } 57 }
59 }; 58 };
60 AppClient.prototype.getGPS = function (callbackName, callback, jsonStr) { 59 AppClient.prototype.getGPS = function (callbackName, callback, jsonStr) {
...@@ -70,27 +69,7 @@ AppClient.prototype.getGPS = function (callbackName, callback, jsonStr) { ...@@ -70,27 +69,7 @@ AppClient.prototype.getGPS = function (callbackName, callback, jsonStr) {
70 this.appObj.getGPS('H5', jsonStr); 69 this.appObj.getGPS('H5', jsonStr);
71 } else { 70 } else {
72 this.appObj.callHandler("getGPS", iOSData, callback); 71 this.appObj.callHandler("getGPS", iOSData, callback);
73 this.appObj.registerHandler('postGPS', function(data, responseCallback) {
74 72
75 var res = JSON.parse(data)
76 layer.open({
77 content: data,
78 time: 2
79 });
80 layer.open({
81 content: JSON.stringify(key),
82 time: 2
83 });
84 var key = res['testKey']
85 layer.open({
86 content: JSON.stringify(key),
87 time: 2
88 });
89 // log('ObjC called testJavascriptHandler with', data)
90 // var responseData = { 'Javascript Says':'Right back atcha!' }
91 // log('JS responding with', responseData)
92 // responseCallback(responseData)
93 })
94 } 73 }
95 }; 74 };
96 // 75 //
...@@ -108,10 +87,6 @@ if(window.android) { ...@@ -108,10 +87,6 @@ if(window.android) {
108 appClient = new AppClient(window.android, true); 87 appClient = new AppClient(window.android, true);
109 // 此处可以调用一些init的方法 88 // 此处可以调用一些init的方法
110 } else { 89 } else {
111 layer.open({
112 content: '初始化',
113 time: 2
114 })
115 function setupWebViewJavascriptBridge(callback) { 90 function setupWebViewJavascriptBridge(callback) {
116 if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); } 91 if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
117 if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); } 92 if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
...@@ -126,6 +101,6 @@ if(window.android) { ...@@ -126,6 +101,6 @@ if(window.android) {
126 appClient = new AppClient(bridge, false); 101 appClient = new AppClient(bridge, false);
127 // 此处可以调用一些init的方法 102 // 此处可以调用一些init的方法
128 }); 103 });
129
130 } 104 }
131 105
106
......
1 ///<jscompress sourcefile="app.js" /> 1 ///<jscompress sourcefile="app.js" />
2 angular.module('myApp.services', ['LocalStorageModule']); 2 angular.module('myApp.services', ['LocalStorageModule']);
3 angular.module('myApp.directives', []); 3 angular.module('myApp.directives', []);
4 var app = angular.module('myApp', [ "ui.router",'myApp.services', 'myApp.directives']); 4 var app = angular.module('myApp', [ "ui.router",'myApp.services', 'myApp.directives']);
...@@ -79,8 +79,8 @@ app.run(['globalService', function(globalService) { ...@@ -79,8 +79,8 @@ app.run(['globalService', function(globalService) {
79 }]) 79 }])
80 //$(window).bind("load resize",function(){ 80 //$(window).bind("load resize",function(){
81 // $("body").css({zoom:$(window).width()/320,visibility:"visible"}); 81 // $("body").css({zoom:$(window).width()/320,visibility:"visible"});
82 //});; 82 //});;
83 ///<jscompress sourcefile="wechatPaymentService.js" /> 83 ///<jscompress sourcefile="wechatPaymentService.js" />
84 angular.module('myApp.services') 84 angular.module('myApp.services')
85 .service('wechatPayment',['$http', '$q', '$rootScope',function($http, $q, $rootScope) { 85 .service('wechatPayment',['$http', '$q', '$rootScope',function($http, $q, $rootScope) {
86 86
...@@ -186,8 +186,8 @@ angular.module('myApp.services') ...@@ -186,8 +186,8 @@ angular.module('myApp.services')
186 } 186 }
187 } 187 }
188 }]); 188 }]);
189 ; 189 ;
190 ///<jscompress sourcefile="weixinConfig.js" /> 190 ///<jscompress sourcefile="weixinConfig.js" />
191 /** 191 /**
192 * Created by zhanghong on 15/3/8. 192 * Created by zhanghong on 15/3/8.
193 */ 193 */
...@@ -271,8 +271,8 @@ function initWeixinMenu($http){ ...@@ -271,8 +271,8 @@ function initWeixinMenu($http){
271 // alert(arg1); 271 // alert(arg1);
272 }); 272 });
273 } 273 }
274 ; 274 ;
275 ///<jscompress sourcefile="dingdaService.js" /> 275 ///<jscompress sourcefile="dingdaService.js" />
276 angular.module('myApp.services') 276 angular.module('myApp.services')
277 .service( 'dingdaService', [ '$http','globalService', 277 .service( 'dingdaService', [ '$http','globalService',
278 function($http,globalService) { 278 function($http,globalService) {
...@@ -437,8 +437,8 @@ angular.module('myApp.services') ...@@ -437,8 +437,8 @@ angular.module('myApp.services')
437 return res; 437 return res;
438 } 438 }
439 } 439 }
440 }]); 440 }]);
441 ///<jscompress sourcefile="globalService.js" /> 441 ///<jscompress sourcefile="globalService.js" />
442 442
443 angular.module('myApp.services') 443 angular.module('myApp.services')
444 .service('globalService', 444 .service('globalService',
...@@ -573,8 +573,8 @@ angular.module('myApp.services') ...@@ -573,8 +573,8 @@ angular.module('myApp.services')
573 return globalConfig; 573 return globalConfig;
574 } 574 }
575 ] 575 ]
576 );; 576 );;
577 ///<jscompress sourcefile="tripController.js" /> 577 ///<jscompress sourcefile="tripController.js" />
578 angular.module('myApp') 578 angular.module('myApp')
579 .controller('tripController',['$scope','$rootScope','$state','dingdaService' ,function($scope,$rootScope,$state,dingdaService){ 579 .controller('tripController',['$scope','$rootScope','$state','dingdaService' ,function($scope,$rootScope,$state,dingdaService){
580 580
...@@ -617,8 +617,8 @@ angular.module('myApp') ...@@ -617,8 +617,8 @@ angular.module('myApp')
617 $scope.viewTripDetail = function(index){ 617 $scope.viewTripDetail = function(index){
618 $state.go('tripDetail' , { orderId : $scope.tripList[index].id }); 618 $state.go('tripDetail' , { orderId : $scope.tripList[index].id });
619 } 619 }
620 }]); 620 }]);
621 ///<jscompress sourcefile="tripDetailController.js" /> 621 ///<jscompress sourcefile="tripDetailController.js" />
622 angular.module('myApp') 622 angular.module('myApp')
623 .controller('tripDetailController', ['$scope', '$rootScope', '$state', 'dingdaService', '$stateParams', 'wechatPayment', 623 .controller('tripDetailController', ['$scope', '$rootScope', '$state', 'dingdaService', '$stateParams', 'wechatPayment',
624 function ($scope, $rootScope, $state, dingdaService, $stateParams, wechatPayment) { 624 function ($scope, $rootScope, $state, dingdaService, $stateParams, wechatPayment) {
...@@ -742,8 +742,8 @@ angular.module('myApp') ...@@ -742,8 +742,8 @@ angular.module('myApp')
742 } 742 }
743 init(); 743 init();
744 744
745 }]); 745 }]);
746 ///<jscompress sourcefile="unusualController.js" /> 746 ///<jscompress sourcefile="unusualController.js" />
747 angular.module('myApp') 747 angular.module('myApp')
748 .controller('unusualController',['$scope','dingdaService','$state','$stateParams',function($scope,dingdaService,$state,$stateParams){ 748 .controller('unusualController',['$scope','dingdaService','$state','$stateParams',function($scope,dingdaService,$state,$stateParams){
749 749
...@@ -777,8 +777,8 @@ angular.module('myApp') ...@@ -777,8 +777,8 @@ angular.module('myApp')
777 }); 777 });
778 } 778 }
779 779
780 }]); 780 }]);
781 ///<jscompress sourcefile="walletController.js" /> 781 ///<jscompress sourcefile="walletController.js" />
782 angular.module('myApp') 782 angular.module('myApp')
783 .controller('walletController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){ 783 .controller('walletController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){
784 784
...@@ -797,8 +797,8 @@ angular.module('myApp') ...@@ -797,8 +797,8 @@ angular.module('myApp')
797 $scope.prepay = function() { 797 $scope.prepay = function() {
798 $state.go('prepay', { }, { reload: false }); 798 $state.go('prepay', { }, { reload: false });
799 } 799 }
800 }]);; 800 }]);;
801 ///<jscompress sourcefile="bondController.js" /> 801 ///<jscompress sourcefile="bondController.js" />
802 angular.module('myApp') 802 angular.module('myApp')
803 .controller('bondController',['$scope' , '$rootScope', '$state' , 'dingdaService' , '$stateParams' , 803 .controller('bondController',['$scope' , '$rootScope', '$state' , 'dingdaService' , '$stateParams' ,
804 function($scope,$rootScope,$state,dingdaService,$stateParams){ 804 function($scope,$rootScope,$state,dingdaService,$stateParams){
...@@ -872,8 +872,8 @@ angular.module('myApp') ...@@ -872,8 +872,8 @@ angular.module('myApp')
872 }) 872 })
873 } 873 }
874 874
875 }]); 875 }]);
876 ///<jscompress sourcefile="bondPayController.js" /> 876 ///<jscompress sourcefile="bondPayController.js" />
877 angular.module('myApp') 877 angular.module('myApp')
878 .controller('bondPayController',['$scope', '$rootScope', '$state', 'wechatPayment', 878 .controller('bondPayController',['$scope', '$rootScope', '$state', 'wechatPayment',
879 function($scope,$rootScope,$state, wechatPayment){ 879 function($scope,$rootScope,$state, wechatPayment){
...@@ -907,8 +907,8 @@ angular.module('myApp') ...@@ -907,8 +907,8 @@ angular.module('myApp')
907 907
908 908
909 909
910 }]); 910 }]);
911 ///<jscompress sourcefile="bondSuccessController.js" /> 911 ///<jscompress sourcefile="bondSuccessController.js" />
912 angular.module('myApp') 912 angular.module('myApp')
913 .controller('bondSuccessController',[ '$scope' , '$rootScope' , '$state' , function($scope,$rootScope,$state){ 913 .controller('bondSuccessController',[ '$scope' , '$rootScope' , '$state' , function($scope,$rootScope,$state){
914 914
...@@ -918,8 +918,8 @@ angular.module('myApp') ...@@ -918,8 +918,8 @@ angular.module('myApp')
918 $state.go('main'); 918 $state.go('main');
919 } 919 }
920 920
921 }]); 921 }]);
922 ///<jscompress sourcefile="contactController.js" /> 922 ///<jscompress sourcefile="contactController.js" />
923 angular.module('myApp') 923 angular.module('myApp')
924 .controller('contactController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){ 924 .controller('contactController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){
925 925
...@@ -975,8 +975,8 @@ angular.module('myApp') ...@@ -975,8 +975,8 @@ angular.module('myApp')
975 975
976 // mui.init(); 976 // mui.init();
977 init(); 977 init();
978 }]);; 978 }]);;
979 ///<jscompress sourcefile="loginController.js" /> 979 ///<jscompress sourcefile="loginController.js" />
980 angular.module('myApp') 980 angular.module('myApp')
981 .controller('loginController',[ '$scope','$rootScope','dingdaService','globalService' ,function($scope,$rootScope,dingdaService,globalService){ 981 .controller('loginController',[ '$scope','$rootScope','dingdaService','globalService' ,function($scope,$rootScope,dingdaService,globalService){
982 var init = function(){ 982 var init = function(){
...@@ -1176,8 +1176,8 @@ angular.module('myApp') ...@@ -1176,8 +1176,8 @@ angular.module('myApp')
1176 1176
1177 1177
1178 1178
1179 ; 1179 ;
1180 ///<jscompress sourcefile="mainController.js" /> 1180 ///<jscompress sourcefile="mainController.js" />
1181 angular.module('myApp') 1181 angular.module('myApp')
1182 .controller('mainController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){ 1182 .controller('mainController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){
1183 1183
...@@ -1384,8 +1384,8 @@ angular.module('myApp') ...@@ -1384,8 +1384,8 @@ angular.module('myApp')
1384 1384
1385 1385
1386 }]); 1386 }]);
1387 ; 1387 ;
1388 ///<jscompress sourcefile="mapController.js" /> 1388 ///<jscompress sourcefile="mapController.js" />
1389 angular.module('myApp') 1389 angular.module('myApp')
1390 .controller('mapController',['$scope','$rootScope','dingdaService','globalService','$state',function($scope,$rootScope,dingdaService,globalService,$state){ 1390 .controller('mapController',['$scope','$rootScope','dingdaService','globalService','$state',function($scope,$rootScope,dingdaService,globalService,$state){
1391 var myMarker; 1391 var myMarker;
...@@ -1968,8 +1968,8 @@ angular.module('myApp') ...@@ -1968,8 +1968,8 @@ angular.module('myApp')
1968 initLocation(); 1968 initLocation();
1969 }) 1969 })
1970 1970
1971 }]);; 1971 }]);;
1972 ///<jscompress sourcefile="opinionController.js" /> 1972 ///<jscompress sourcefile="opinionController.js" />
1973 angular.module('myApp') 1973 angular.module('myApp')
1974 .controller('opinionController',['$scope','$rootScope','dingdaService','$state','globalService','$stateParams', 1974 .controller('opinionController',['$scope','$rootScope','dingdaService','$state','globalService','$stateParams',
1975 function($scope,$rootScope,dingdaService,$state,globalService,$stateParams){ 1975 function($scope,$rootScope,dingdaService,$state,globalService,$stateParams){
...@@ -2022,8 +2022,8 @@ angular.module('myApp') ...@@ -2022,8 +2022,8 @@ angular.module('myApp')
2022 } 2022 }
2023 } 2023 }
2024 2024
2025 }]);; 2025 }]);;
2026 ///<jscompress sourcefile="payController.js" /> 2026 ///<jscompress sourcefile="payController.js" />
2027 angular.module('myApp') 2027 angular.module('myApp')
2028 .controller('payController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){ 2028 .controller('payController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){
2029 2029
...@@ -2037,8 +2037,8 @@ angular.module('myApp') ...@@ -2037,8 +2037,8 @@ angular.module('myApp')
2037 $scope.pay = function() { 2037 $scope.pay = function() {
2038 alert("充值") 2038 alert("充值")
2039 } 2039 }
2040 }]);; 2040 }]);;
2041 ///<jscompress sourcefile="prepayController.js" /> 2041 ///<jscompress sourcefile="prepayController.js" />
2042 angular.module('myApp') 2042 angular.module('myApp')
2043 .controller('prepayController',['$scope','$rootScope','dingdaService','$state','globalService','wechatPayment',function($scope,$rootScope,dingdaService,$state,globalService,wechatPayment){ 2043 .controller('prepayController',['$scope','$rootScope','dingdaService','$state','globalService','wechatPayment',function($scope,$rootScope,dingdaService,$state,globalService,wechatPayment){
2044 2044
...@@ -2084,8 +2084,8 @@ angular.module('myApp') ...@@ -2084,8 +2084,8 @@ angular.module('myApp')
2084 2084
2085 // alert("充值 : " + $scope.account + "元") 2085 // alert("充值 : " + $scope.account + "元")
2086 } 2086 }
2087 }]);; 2087 }]);;
2088 ///<jscompress sourcefile="rechargeListController.js" /> 2088 ///<jscompress sourcefile="rechargeListController.js" />
2089 angular.module('myApp') 2089 angular.module('myApp')
2090 .controller('rechargeListController',function($scope,$rootScope,$state){ 2090 .controller('rechargeListController',function($scope,$rootScope,$state){
2091 $scope.rechargeList = [ 2091 $scope.rechargeList = [
...@@ -2100,8 +2100,8 @@ angular.module('myApp') ...@@ -2100,8 +2100,8 @@ angular.module('myApp')
2100 rechargeMoney:200 2100 rechargeMoney:200
2101 } 2101 }
2102 ] 2102 ]
2103 }); 2103 });
2104 ///<jscompress sourcefile="rentDetailController.js" /> 2104 ///<jscompress sourcefile="rentDetailController.js" />
2105 angular.module('myApp') 2105 angular.module('myApp')
2106 .controller('rentDetailController',['$scope','$rootScope','$state','dingdaService' ,function($scope,$rootScope,$state,dingdaService){ 2106 .controller('rentDetailController',['$scope','$rootScope','$state','dingdaService' ,function($scope,$rootScope,$state,dingdaService){
2107 2107
...@@ -2189,4 +2189,4 @@ angular.module('myApp') ...@@ -2189,4 +2189,4 @@ angular.module('myApp')
2189 $state.go('unusual' , { id : $scope.datail.id}); 2189 $state.go('unusual' , { id : $scope.datail.id});
2190 } 2190 }
2191 2191
2192 }]); 2192 }]);
......
...@@ -2,20 +2,65 @@ angular.module('myApp') ...@@ -2,20 +2,65 @@ angular.module('myApp')
2 .controller('mainController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){ 2 .controller('mainController',['$scope','$rootScope','dingdaService','$state','globalService',function($scope,$rootScope,dingdaService,$state,globalService){
3 3
4 $rootScope.isRendBike = false; 4 $rootScope.isRendBike = false;
5 $rootScope.isLoadFinish = true; 5 $rootScope.isLoadFinish = false;
6 $scope.unfinishOrder = {}; 6 $scope.unfinishOrder = {};
7 var init = function() { 7 var init = function() {
8 // globalService.init(); 8 // globalService.init();
9 function getUrl(name){
10 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
11 var r = window.location.search.substr(1).match(reg);
12 if(r!=null)return unescape(r[2]); return null;
13 }
9 $scope.userinfo = globalService.getData("user"); 14 $scope.userinfo = globalService.getData("user");
10 if(!$scope.userinfo) { 15 if(!$scope.userinfo) {
11 $scope.userinfo = {}; 16 var code = getUrl('code')
12 $scope.userinfo.userName = "未登录"; 17 if(code){
13 $scope.userinfo.loginState = false; 18 dingdaService.verifyThirdCode(code).success(function (res) {
19 if(res.mate.code == 200) {
20 dingdaService.verifyPhoneCode(res.data.mobile, res.data.code).success(function (data) {
21 if (data.meta.code == 200) {
22 data.data.userName = $scope.phoneNumberVal;
23 globalService.saveData('user',data.data);
24 // layer.open({
25 // content: '登录成功',
26 // time:1
27 // });
28 setTimeout(function() {
29 location.reload();
30 } , 300);
31 } else if (data.meta.code == 401) {
32 layer.open({
33 content: data.meta.message,
34 time:1
35 });
36 // alert(data.meta.message);
37 // layer.msg(data.data.error);
38 return;
39 }
40 })
41 }
42 if(res.mate.code == 500){
43 $state.go('login', {}, {reload: true});
44 }
45 })
46 } else {
47 $scope.userinfo = {};
48 $scope.userinfo.userName = "未登录";
49 $scope.userinfo.loginState = false;
50 }
51
14 } else { 52 } else {
15 $scope.userinfo.loginState = true; 53 $scope.userinfo.loginState = true;
16 // alert("getUnfinishedOrder") 54 // alert("getUnfinishedOrder")
17 dingdaService.getUnfinishedOrder().success(function(data , status){ 55 dingdaService.getUnfinishedOrder().success(function(data , status){
18 // alert(JSON.stringify(data)) 56 // alert(JSON.stringify(data))
57 if(data.meta.code === 401) {
58 layer.open({
59 content:'登录token失效,请重新登录',
60 time:2
61 })
62 return
63 }
19 if(data.data.unfinishedOrder.id) { 64 if(data.data.unfinishedOrder.id) {
20 $rootScope.isRendBike = true; 65 $rootScope.isRendBike = true;
21 $scope.unfinishOrder = data.data.unfinishedOrder; 66 $scope.unfinishOrder = data.data.unfinishedOrder;
...@@ -104,9 +149,9 @@ angular.module('myApp') ...@@ -104,9 +149,9 @@ angular.module('myApp')
104 $rootScope.openRing = false; 149 $rootScope.openRing = false;
105 $rootScope.$watch("openScan",function(newVal, oldVal){ 150 $rootScope.$watch("openScan",function(newVal, oldVal){
106 if(newVal !== oldVal && newVal) { 151 if(newVal !== oldVal && newVal) {
107 // if(!$scope.checkLogin()) { 152 if(!$scope.checkLogin()) {
108 // return; 153 return;
109 // } 154 }
110 155
111 // if($scope.unfinishOrder.status == 200) { 156 // if($scope.unfinishOrder.status == 200) {
112 // $state.go('tripDetail' , { orderId : $scope.unfinishOrder.id}); 157 // $state.go('tripDetail' , { orderId : $scope.unfinishOrder.id});
...@@ -114,15 +159,26 @@ angular.module('myApp') ...@@ -114,15 +159,26 @@ angular.module('myApp')
114 // } 159 // }
115 $rootScope.openScan = false; 160 $rootScope.openScan = false;
116 if(appClient){ 161 if(appClient){
117 appClient.getERCode('postERCode', function (res) { 162 appClient.appObj.registerHandler('postERCode', function(data, responseCallback) {
118 layer.open({ 163 layer.open({
119 content: JSON.stringify(res) + 'cb', 164 content: JSON.stringify(data),
120 time: 10 165 time: 10
121 }); 166 });
167 // log('ObjC called testJavascriptHandler with', data)
168 // var responseData = { 'Javascript Says':'Right back atcha!' }
169 // log('JS responding with', responseData)
170 // responseCallback(responseData)
171 })
172 appClient.getERCode('postERCode', function (res) {
173 // layer.open({
174 // content: JSON.stringify(res) + 'cb',
175 // time: 10
176 // });
122 }, '') 177 }, '')
178
123 } else { 179 } else {
124 layer.open({ 180 layer.open({
125 content: 'JSBridge 初始化失败', 181 content: '调起摄像头失败',
126 time:2 182 time:2
127 }); 183 });
128 } 184 }
......
...@@ -297,7 +297,15 @@ angular.module('myApp') ...@@ -297,7 +297,15 @@ angular.module('myApp')
297 // onSuccess(res) 297 // onSuccess(res)
298 // } 298 // }
299 // }); 299 // });
300
300 if(appClient){ 301 if(appClient){
302 appClient.appObj.registerHandler('postGPS', function(data, responseCallback) {
303 var res = JSON.parse(data)
304 layer.open({
305 content: data,
306 time: 2
307 });
308 })
301 appClient.getGPS('getGPS', function (res) { 309 appClient.getGPS('getGPS', function (res) {
302 // layer.open({ 310 // layer.open({
303 // content: JSON.stringify(res) + 'cb', 311 // content: JSON.stringify(res) + 'cb',
...@@ -309,9 +317,15 @@ angular.module('myApp') ...@@ -309,9 +317,15 @@ angular.module('myApp')
309 }) 317 })
310 318
311 }, '') 319 }, '')
312 }
313 320
314 // onSuccess({latitude:30.2741500000,longitude:120.1551500000}) 321 } else {
322 onSuccess({latitude:30.2741500000,longitude:120.1551500000})
323 setTimeout(function () {
324 $rootScope.isLoadFinish = true
325
326 },1000)
327
328 }
315 } 329 }
316 330
317 331
......
...@@ -3,7 +3,7 @@ angular.module('myApp.services') ...@@ -3,7 +3,7 @@ angular.module('myApp.services')
3 function($http,globalService) { 3 function($http,globalService) {
4 return { 4 return {
5 sendPhoneCode: function(phone , openId){ 5 sendPhoneCode: function(phone , openId){
6 var url = globalService.getParam('dingdaLoginAPI') + '/login/sms?mobile=' + phone + '&openId=' + openId; 6 var url = globalService.getParam('dingdaLoginAPI') + '/login/sms?mobile=' + phone + (openId?('&openId=' + (openId || '')):'');
7 var res = $http.get(url).success(function(data, status) { 7 var res = $http.get(url).success(function(data, status) {
8 }).error(function(data, status) { 8 }).error(function(data, status) {
9 alert(data.meta.message) 9 alert(data.meta.message)
...@@ -12,15 +12,21 @@ angular.module('myApp.services') ...@@ -12,15 +12,21 @@ angular.module('myApp.services')
12 }, 12 },
13 verifyPhoneCode : function(phone , code){ 13 verifyPhoneCode : function(phone , code){
14 var url = globalService.getParam('dingdaLoginAPI') + '/login/sms?mobile=' + phone + '&code=' + code; 14 var url = globalService.getParam('dingdaLoginAPI') + '/login/sms?mobile=' + phone + '&code=' + code;
15 var res = $http.post(url , { 15 var res = $http.post(url, {}, {}).success(function(data, status) {
16 } , {
17 }).success(function(data, status) {
18 16
19 }).error(function(data, status) { 17 }).error(function(data, status) {
20 alert(data.meta.message) 18 alert(data.meta.message)
21 }); 19 });
22 return res; 20 return res;
23 }, 21 },
22 verifyThirdCode : function(code){ // 通过第三方登录
23 var url = globalService.getParam('dingdaLoginAPI') + '/login/sms?code=' + code;
24 var res = $http.get(url).success(function(data, status) {
25 }).error(function(data, status) {
26 // alert(data.meta.message)
27 });
28 return res;
29 },
24 getStationList : function(longitude , latitude){ 30 getStationList : function(longitude , latitude){
25 var url = globalService.getParam('dingdaAPI') + '/service/bicycle/stations?longitude=' + longitude 31 var url = globalService.getParam('dingdaAPI') + '/service/bicycle/stations?longitude=' + longitude
26 + '&latitude=' + latitude; 32 + '&latitude=' + latitude;
......
...@@ -18,7 +18,8 @@ angular.module('myApp.services') ...@@ -18,7 +18,8 @@ angular.module('myApp.services')
18 $rootScope.inited = true; 18 $rootScope.inited = true;
19 //--------------------自行车服务-------------- 19 //--------------------自行车服务--------------
20 // 生产环境 20 // 生产环境
21 var dingdaAPI = "http://bike.dy.dingdatech.com:880"; 21 // var dingdaAPI = "http://bike.dy.dingdatech.com:880";
22 var dingdaAPI = "http://47.99.81.49:60612";
22 // 测试环境 23 // 测试环境
23 //var dingdaAPI = "http://bike.api.dingdachuxing.com"; 24 //var dingdaAPI = "http://bike.api.dingdachuxing.com";
24 globalConfig.setParam("dingdaAPI", dingdaAPI); 25 globalConfig.setParam("dingdaAPI", dingdaAPI);
...@@ -36,7 +37,8 @@ angular.module('myApp.services') ...@@ -36,7 +37,8 @@ angular.module('myApp.services')
36 globalConfig.setParam("feedbackAPI", feedbackAPI); 37 globalConfig.setParam("feedbackAPI", feedbackAPI);
37 //--------------------认证服务-------------- 38 //--------------------认证服务--------------
38 // 生产环境 39 // 生产环境
39 var dingdaLoginAPI = "http://auth.dy.dingdatech.com:880"; 40 // var dingdaLoginAPI = "http://auth.dy.dingdatech.com:880";
41 var dingdaLoginAPI = "http://47.99.81.49:40411";
40 // 测试环境 42 // 测试环境
41 //var dingdaLoginAPI = "http://auth.api.dingdachuxing.com"; 43 //var dingdaLoginAPI = "http://auth.api.dingdachuxing.com";
42 globalConfig.setParam("dingdaLoginAPI", dingdaLoginAPI); 44 globalConfig.setParam("dingdaLoginAPI", dingdaLoginAPI);
...@@ -53,7 +55,8 @@ angular.module('myApp.services') ...@@ -53,7 +55,8 @@ angular.module('myApp.services')
53 loadPersistData(); 55 loadPersistData();
54 loadCityConfig(); 56 loadCityConfig();
55 loadPathParams(); 57 loadPathParams();
56 initWeixinMenu($http); 58
59 // initWeixinMenu($http);
57 } 60 }
58 61
59 var loadPersistData = function() { 62 var loadPersistData = function() {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!