| xqd
@@ -1,5 +1,11 @@
|
|
|
(function (app) {
|
|
|
- app.controller('myCtrl', ["$scope","$state", function ($scope,$state) {
|
|
|
+ app.controller('myCtrl', ["$scope", "$state", 'userService', 'msg', function ($scope, $state, userService,msg) {
|
|
|
+ $scope.user = {};
|
|
|
+ userService.getUser().then(function (result) {
|
|
|
+ $scope.user = result.data.data;
|
|
|
+ }, function (erro) {
|
|
|
+ msg.error(erro.data.message);
|
|
|
+ });
|
|
|
$scope.toProfile = function () {
|
|
|
$state.go('wl.my_profile');
|
|
|
}
|
| xqd
@@ -40,6 +46,10 @@
|
|
|
$scope.modal1.remove();
|
|
|
$scope.modal2.remove();
|
|
|
});
|
|
|
+ $scope.appversion = '1.0.0';
|
|
|
+ if (!!window.AppVersion) {
|
|
|
+ $scope.appversion = AppVersion.version;
|
|
|
+ }
|
|
|
}]);
|
|
|
app.controller('mySetPasswordCtrl', ['$scope', '$state', function ($scope,$state) {
|
|
|
$scope.vm = {
|
| xqd
@@ -180,6 +190,22 @@
|
|
|
$scope.detail = function (item) {
|
|
|
$state.go('wl.my_truck_add', {item:item});
|
|
|
}
|
|
|
+ $scope.delete = function (item, $event) {
|
|
|
+ $event.stopPropagation();
|
|
|
+ msg.confirm('删除提示', '确定删除?').then(function (res) {
|
|
|
+ if (res) {
|
|
|
+ msg.loading('删除中...');
|
|
|
+ myService.deleteTruck(item.id).then(function (result) {
|
|
|
+ msg.hide();
|
|
|
+ }, function (erro) {
|
|
|
+ msg.hide();
|
|
|
+ msg.error(erro.data.message);
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
$scope.load(true);
|
|
|
}]);
|
|
|
app.controller('myTruckAddCtrl', ['$scope', 'myService', 'msg', '$state', '$stateParams', function ($scope, myService, msg, $state, $stateParams) {
|
| xqd
@@ -218,6 +244,10 @@
|
|
|
msg.error(erro.data.message);
|
|
|
});
|
|
|
}
|
|
|
+ //上传图片
|
|
|
+ $scope.setPhoto = function () {
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}]);
|
|
|
app.controller('myTruckDetailCtrl', ['$scope', function ($scope) {
|