|
@@ -12,55 +12,71 @@
|
|
formData.append('file', files[0]);
|
|
formData.append('file', files[0]);
|
|
formData.append('tag', 'avatar');
|
|
formData.append('tag', 'avatar');
|
|
|
|
|
|
- $http({
|
|
|
|
- method: 'POST',
|
|
|
|
- url: config.server + 'api/attachment/upload',
|
|
|
|
- transformRequest: angular.identity,
|
|
|
|
- data: formData,
|
|
|
|
- // headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' }
|
|
|
|
- headers: {'Content-Type': undefined}
|
|
|
|
- }).then(function (result) {
|
|
|
|
- // alert(JSON.stringify(result));
|
|
|
|
- console.log("attachment upload result:"+JSON.stringify(result));
|
|
|
|
- }, function (erro) {
|
|
|
|
- console.log("attachment upload erro:"+JSON.stringify(erro));
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
|
|
+ $http({
|
|
|
|
+ method: 'POST',
|
|
|
|
+ url: config.server + 'api/attachment/upload',
|
|
|
|
+ transformRequest: angular.identity,
|
|
|
|
+ data: formData,
|
|
|
|
+ // headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' }
|
|
|
|
+ headers: {'Content-Type': undefined}
|
|
|
|
+ }).then(function (result) {
|
|
|
|
+ // alert(JSON.stringify(result));
|
|
|
|
+ console.log("attachment upload result:"+JSON.stringify(result));
|
|
|
|
+ }, function (error) {
|
|
|
|
+ console.log("attachment upload error:"+JSON.stringify(error));
|
|
|
|
+
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- $scope.toprofile = function () {
|
|
|
|
- $state.go('app.my_profile');
|
|
|
|
- };
|
|
|
|
|
|
+ $scope.toprofile = function () {
|
|
|
|
+ $state.go('app.my_profile');
|
|
|
|
+ };
|
|
$scope.setting = function(){
|
|
$scope.setting = function(){
|
|
myService.setting().then(function(result){
|
|
myService.setting().then(function(result){
|
|
|
|
|
|
- },function(erro){
|
|
|
|
|
|
+ },function(error){
|
|
|
|
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
+ $scope.collect = function(){
|
|
|
|
+ myService.collect().then(function(result){
|
|
|
|
+
|
|
|
|
+ },function(erro){
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ $scope.myDream = function(){
|
|
|
|
+ myService.myDream().then(function(result){
|
|
|
|
+
|
|
|
|
+ },function(erro){
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
}]);
|
|
}]);
|
|
|
|
+
|
|
app.controller('profileCtrl', ["$scope", "$state", "storage", "myService", "msg", "common"
|
|
app.controller('profileCtrl', ["$scope", "$state", "storage", "myService", "msg", "common"
|
|
, function ($scope, $state, storage, myService, msg, common) {
|
|
, function ($scope, $state, storage, myService, msg, common) {
|
|
- $scope.setAvator = function () {
|
|
|
|
- common.setAvator().then(function (result) {
|
|
|
|
- debugger;
|
|
|
|
- var response = JSON.parse(result.response);
|
|
|
|
- $timeout(function () {
|
|
|
|
- $scope.vm.user.avatar = response.data.md5;
|
|
|
|
- });
|
|
|
|
- }, function (erro) {
|
|
|
|
- msg.erro(JSON.stringify(erro));
|
|
|
|
- });
|
|
|
|
- };
|
|
|
|
- $scope.$on('$ionicView.beforeEnter', function () {
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
|
|
+ $scope.setAvator = function () {
|
|
|
|
+ common.setAvator().then(function (result) {
|
|
|
|
+ debugger;
|
|
|
|
+ var response = JSON.parse(result.response);
|
|
|
|
+ $timeout(function () {
|
|
|
|
+ $scope.vm.user.avatar = response.data.md5;
|
|
|
|
+ });
|
|
|
|
+ }, function (error) {
|
|
|
|
+ msg.error(JSON.stringify(error));
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ $scope.$on('$ionicView.beforeEnter', function () {
|
|
|
|
+
|
|
|
|
+ });
|
|
$scope.reset = function(){
|
|
$scope.reset = function(){
|
|
var data = {
|
|
var data = {
|
|
pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
|
|
pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
|
|
};
|
|
};
|
|
myService.reset(data).then(function(result){
|
|
myService.reset(data).then(function(result){
|
|
|
|
|
|
- },function(erro){
|
|
|
|
|
|
+ },function(error){
|
|
|
|
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -86,7 +102,7 @@
|
|
$scope.recharge = function(){
|
|
$scope.recharge = function(){
|
|
myService.recharge().then(function(result){
|
|
myService.recharge().then(function(result){
|
|
|
|
|
|
- },function(erro){
|
|
|
|
|
|
+ },function(error){
|
|
|
|
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -100,17 +116,17 @@
|
|
$scope.systemInfo = function(){
|
|
$scope.systemInfo = function(){
|
|
myService.systemInfo().then(function(result){
|
|
myService.systemInfo().then(function(result){
|
|
|
|
|
|
- },function(erro){
|
|
|
|
|
|
+ },function(error){
|
|
|
|
|
|
});
|
|
});
|
|
};
|
|
};
|
|
$scope.replyMy = function(){
|
|
$scope.replyMy = function(){
|
|
myService.replyMy().then(function(result){
|
|
myService.replyMy().then(function(result){
|
|
|
|
|
|
- },function(erro){
|
|
|
|
|
|
+ },function(error){
|
|
|
|
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
}]);
|
|
}]);
|
|
app.controller('dreamCtrl', ["$scope", "$state", "myService", "msg"
|
|
app.controller('dreamCtrl', ["$scope", "$state", "myService", "msg"
|
|
@@ -144,12 +160,30 @@
|
|
$scope.openModal = function () {
|
|
$scope.openModal = function () {
|
|
$scope.modal.show();
|
|
$scope.modal.show();
|
|
};
|
|
};
|
|
|
|
+
|
|
$scope.closeModal = function () {
|
|
$scope.closeModal = function () {
|
|
$scope.modal.hide();
|
|
$scope.modal.hide();
|
|
|
|
+
|
|
};
|
|
};
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
|
|
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ $scope.vm={
|
|
|
|
+ content:""
|
|
|
|
+ };
|
|
|
|
+ $scope.myReplay = function(){
|
|
|
|
+ var data = {
|
|
|
|
+ content:$scope.vm.content,
|
|
|
|
+ comment_id:'11'
|
|
|
|
+ };
|
|
|
|
+ myService.myReplay(data).then(function(result){
|
|
|
|
+
|
|
|
|
+ },function(erro){
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ $scope.modal.hide();
|
|
|
|
+ }
|
|
}]);
|
|
}]);
|
|
|
|
|
|
})(angular.module('app.controllers'));
|
|
})(angular.module('app.controllers'));
|