Mike 9 роки тому
батько
коміт
0942e383f6

BIN
wl/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock


BIN
wl/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin


BIN
wl/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin


+ 1 - 1
wl/platforms/android/assets/www/js/controllers/car.js

xqd
@@ -48,7 +48,7 @@
         $scope.goGoods = function () {
             $state.go('wl.goods');
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
             $scope.load(true);
         });
         

+ 1 - 1
wl/platforms/android/assets/www/js/controllers/goods.js

xqd
@@ -50,7 +50,7 @@
         $scope.goCar = function () {
             $state.go('wl.car');
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
             $scope.load(true);
         });
     }]);

+ 17 - 10
wl/platforms/android/assets/www/js/controllers/my.js

xqd xqd xqd xqd
@@ -1,14 +1,21 @@
 (function (app) {
-    app.controller('myCtrl', ["$scope", "$state", 'userService', 'msg','config', function ($scope, $state, userService,msg,config) {
+    app.controller('myCtrl', ["$scope", "$state", 'userService', 'msg','config','$timeout', function ($scope, $state, userService,msg,config,$timeout) {
         $scope.user = {};
         $scope.host = config.server +'/upload/avatar/';
-        userService.getUser().then(function (result) {
-            $scope.user = result.data.data; 
-        }, function (erro) {
-            msg.error(erro.data.message);
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
+            $scope.load(true);
         });
-        $scope.toProfile = function () {
-            $state.go('wl.my_profile');
+        $scope.load = function (init) {
+            userService.getUser().then(function (result) {
+                $timeout(function () {
+                    $scope.user = result.data.data; 
+                });
+            }, function (erro) {
+                msg.error(erro.data.message);
+            });
+            $scope.toProfile = function () {
+                $state.go('wl.my_profile');
+            }
         }
     }]);
     app.controller('mySettingCtrl', ['$scope', 'data', '$state', '$http','$ionicModal','myService', function ($scope, data, $state, $http,$ionicModal,myService) {
@@ -172,7 +179,7 @@
                 }
             });
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforEnter', function (viewResult) {
             $scope.load(true);
         });
     }]);
@@ -315,7 +322,7 @@
                 msg.error(erro.data.message);
             });
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
             $scope.load(true);
         });
     }]);
@@ -383,7 +390,7 @@
         $scope.detail = function (item) {
             $state.go('wl.my_order_detail', { item: item });
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
             $scope.load(true);
         });
     }]);

+ 1 - 1
wl/www/js/controllers/car.js

xqd
@@ -48,7 +48,7 @@
         $scope.goGoods = function () {
             $state.go('wl.goods');
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
             $scope.load(true);
         });
         

+ 1 - 1
wl/www/js/controllers/goods.js

xqd
@@ -50,7 +50,7 @@
         $scope.goCar = function () {
             $state.go('wl.car');
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
             $scope.load(true);
         });
     }]);

+ 24 - 12
wl/www/js/controllers/my.js

xqd xqd xqd xqd xqd
@@ -1,14 +1,21 @@
 (function (app) {
-    app.controller('myCtrl', ["$scope", "$state", 'userService', 'msg','config', function ($scope, $state, userService,msg,config) {
+    app.controller('myCtrl', ["$scope", "$state", 'userService', 'msg','config','$timeout', function ($scope, $state, userService,msg,config,$timeout) {
         $scope.user = {};
         $scope.host = config.server +'/upload/avatar/';
-        userService.getUser().then(function (result) {
-            $scope.user = result.data.data; 
-        }, function (erro) {
-            msg.error(erro.data.message);
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
+            $scope.load(true);
         });
-        $scope.toProfile = function () {
-            $state.go('wl.my_profile');
+        $scope.load = function (init) {
+            userService.getUser().then(function (result) {
+                $timeout(function () {
+                    $scope.user = result.data.data; 
+                });
+            }, function (erro) {
+                msg.error(erro.data.message);
+            });
+            $scope.toProfile = function () {
+                $state.go('wl.my_profile');
+            }
         }
     }]);
     app.controller('mySettingCtrl', ['$scope', 'data', '$state', '$http','$ionicModal','myService', function ($scope, data, $state, $http,$ionicModal,myService) {
@@ -61,11 +68,16 @@
             isloading: false,
 
         };
-        $scope.submit = function () {
+        $scope.submit = function (vm) {
             msg.loading('保存中...');
-            var model = { old_password: $scope.vm.oldpassword, password: $scope.vm.password, password_confirmation: $scope.vm.password1 };
+            var model = { old_password: vm.oldpassword, password: vm.password, password_confirmation: vm.password1 };
             myService.resetPassword(model).then(function () {
                 msg.hide();
+                $scope.vm = {
+                    oldpassword:'',
+                    password: '',
+                    password1: '',
+                };
                 msg.success('密码修改成功');
             }, function (erro) {
                 msg.hide();
@@ -172,7 +184,7 @@
                 }
             });
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforEnter', function (viewResult) {
             $scope.load(true);
         });
     }]);
@@ -315,7 +327,7 @@
                 msg.error(erro.data.message);
             });
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
             $scope.load(true);
         });
     }]);
@@ -383,7 +395,7 @@
         $scope.detail = function (item) {
             $state.go('wl.my_order_detail', { item: item });
         }
-        $scope.$on('$ionicView.enter', function (viewResult) {
+        $scope.$on('$ionicView.beforeEnter', function (viewResult) {
             $scope.load(true);
         });
     }]);

+ 1 - 1
wl/www/templates/my/setPassword.html

xqd
@@ -18,7 +18,7 @@
                 </label>
             </div>
            
-            <button class="button button-block    button-assertive  button-radius-full" ng-click="submit()" ng-disabled="data.isloading" type="submit">更新密码</button>
+            <button class="button button-block    button-assertive  button-radius-full" ng-click="submit(data)" ng-disabled="data.isloading" type="submit">更新密码</button>
         </div>
     </ion-content>
 </ion-view>