|
@@ -100,13 +100,57 @@
|
|
}
|
|
}
|
|
|
|
|
|
}]);
|
|
}]);
|
|
- app.controller('aboutMiaoCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
|
|
- , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
|
|
-
|
|
|
|
|
|
+ app.controller('aboutMiaoCtrl', ["$scope","$ionicTabsDelegate","$timeout", "$state", "myService", "msg","storage"
|
|
|
|
+ , function ($scope,$ionicTabsDelegate,$timeout, $state,myService, msg, storage) {
|
|
|
|
+ /* $scope.$on('$ionicView.beforeEnter', function () {
|
|
|
|
+ $scope.payExplain();
|
|
|
|
+ });
|
|
|
|
+ $scope.payExplain = function(){
|
|
|
|
+ myService.payExplain().then(function(result){
|
|
|
|
+ $scope.items = result.data.data;
|
|
|
|
+ },function(error){
|
|
|
|
+ msg.error(error.data.message)
|
|
|
|
+ })
|
|
|
|
+ };*/
|
|
}]);
|
|
}]);
|
|
- app.controller('withdrawCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
|
|
- , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
|
|
|
|
+ app.controller('withdrawCtrl', ["$scope","$ionicTabsDelegate","$timeout", "$state", "myService", "msg","storage"
|
|
|
|
+ , function ($scope,$ionicTabsDelegate, $timeout,$state,myService, msg, storage) {
|
|
|
|
+ $scope.vm={
|
|
|
|
+ pay:"",
|
|
|
|
+ cash:""
|
|
|
|
+ };
|
|
|
|
+ $scope.$on("$ionicView.enter",function(){
|
|
|
|
+ myService.showAccount().then(function(result){
|
|
|
|
+ var items = result.data.data;
|
|
|
|
+ $scope.pays=[];
|
|
|
|
+ angular.forEach(items,function(item){
|
|
|
|
+ var value=item.bank_name+"(";
|
|
|
|
+ var len=item.bank_number.length;
|
|
|
|
+ var txt1=item.bank_number.substr(0,len-4).replace(/\d+/g,'**');
|
|
|
|
+ var txt2=item.bank_number.substr(len-4,4);
|
|
|
|
+ value=value+txt1+txt2+")";
|
|
|
|
+ $scope.pays.push({id:item.id,value:value});
|
|
|
|
+ })
|
|
|
|
+ },function(error){
|
|
|
|
+ msg.error(error.data.message)
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ $scope.withdraw = function(){
|
|
|
|
+ var data = {
|
|
|
|
+ data:{
|
|
|
|
+ bank_id:$scope.vm.pay.id,
|
|
|
|
+ cash:$scope.vm.cash
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ myService.withdraw(data).then(function(result){
|
|
|
|
+ msg.text("提现申请已提交");
|
|
|
|
+ $timeout(function () {
|
|
|
|
+ $state.go("app.my");
|
|
|
|
+ },1000);
|
|
|
|
+ },function(error){
|
|
|
|
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}]);
|
|
}]);
|
|
app.controller('payoutCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
app.controller('payoutCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
@@ -114,15 +158,43 @@
|
|
}]);
|
|
}]);
|
|
app.controller('payExplainCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
app.controller('payExplainCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
-
|
|
|
|
|
|
+ $scope.$on('$ionicView.beforeEnter', function () {
|
|
|
|
+ $scope.payExplain();
|
|
|
|
+ });
|
|
|
|
+ $scope.payExplain = function(){
|
|
|
|
+ myService.payExplain().then(function(result){
|
|
|
|
+ $scope.items = result.data.data;
|
|
|
|
+ },function(error){
|
|
|
|
+ msg.error(error.data.message)
|
|
|
|
+ })
|
|
|
|
+ };
|
|
}]);
|
|
}]);
|
|
app.controller('explainCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
app.controller('explainCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
|
|
|
|
}]);
|
|
}]);
|
|
- app.controller('contactCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
|
|
- , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
|
|
-
|
|
|
|
|
|
+ app.controller('contactCtrl', ["$scope","$ionicTabsDelegate", "$timeout","$state", "myService", "msg","storage"
|
|
|
|
+ , function ($scope,$ionicTabsDelegate, $timeout,$state,myService, msg, storage) {
|
|
|
|
+ $scope.vm={
|
|
|
|
+ content:"",
|
|
|
|
+ email:""
|
|
|
|
+ };
|
|
|
|
+ $scope.contact = function(){
|
|
|
|
+ var data={
|
|
|
|
+ data:{
|
|
|
|
+ content:$scope.vm.content,
|
|
|
|
+ email:$scope.vm.email
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ myService.contact(data).then(function(result){
|
|
|
|
+ msg.text("发送成功");
|
|
|
|
+ $timeout(function(){
|
|
|
|
+ $state.go("app.my");
|
|
|
|
+ },1000);
|
|
|
|
+ },function(error){
|
|
|
|
+ msg.error(error.data.message);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}]);
|
|
}]);
|
|
app.controller('attentionCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
app.controller('attentionCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
@@ -168,17 +240,30 @@
|
|
$event.stopPropagation();
|
|
$event.stopPropagation();
|
|
$scope.toshare = true;
|
|
$scope.toshare = true;
|
|
};
|
|
};
|
|
- $scope.shareDream = function(){
|
|
|
|
- $state.go("app.my_shareDream",{item:$scope.user});
|
|
|
|
- };
|
|
|
|
$scope.toDetail = function (dream_id) {
|
|
$scope.toDetail = function (dream_id) {
|
|
- $state.go('app.my_dreamdetail',{id:dream_id});
|
|
|
|
|
|
+ if($scope.items.near_dream==null){
|
|
|
|
+ msg.alert("当前梦想","该用户没有当前梦想");
|
|
|
|
+ }
|
|
|
|
+ if($scope.items.near_dream!=null){
|
|
|
|
+ var dream_id = $scope.items.near_dream.id;
|
|
|
|
+ $state.go('app.home_dreamdetail',{id:dream_id});
|
|
|
|
+ }
|
|
};
|
|
};
|
|
$scope.toOldDream = function(){
|
|
$scope.toOldDream = function(){
|
|
- $state.go("app.myOldDream");
|
|
|
|
|
|
+ if($scope.items.dreams.length==0){
|
|
|
|
+ msg.alert("曾经的梦想","该用户没有曾经的梦想");
|
|
|
|
+ }
|
|
|
|
+ if($scope.items.dreams.length!=0){
|
|
|
|
+ $state.go("app.oldDream",{user_id:$scope.items.user.id});
|
|
|
|
+ }
|
|
};
|
|
};
|
|
$scope.toSupportDream = function(){
|
|
$scope.toSupportDream = function(){
|
|
- $state.go("app.mySupportDream",{user_id:$scope.items.user.id});
|
|
|
|
|
|
+ if($scope.items.sup_dreams.length==0){
|
|
|
|
+ msg.alert("支持的梦想","该用户没有支持的梦想");
|
|
|
|
+ }
|
|
|
|
+ if($scope.items.sup_dreams.length!=0){
|
|
|
|
+ $state.go("app.supportDream",{user_id:$scope.items.user.id});
|
|
|
|
+ }
|
|
};
|
|
};
|
|
$scope.collectionDream = function(is_collection){
|
|
$scope.collectionDream = function(is_collection){
|
|
homeService.collectionDream(id,is_collection).then(function(result){
|
|
homeService.collectionDream(id,is_collection).then(function(result){
|
|
@@ -336,8 +421,23 @@
|
|
, function ($scope,$ionicTabsDelegate, $state, myService, msg) {
|
|
, function ($scope,$ionicTabsDelegate, $state, myService, msg) {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$ionicTabsDelegate.showBar(false);
|
|
$ionicTabsDelegate.showBar(false);
|
|
|
|
+ $scope.showAccount();
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ $scope.showAccount = function(){
|
|
|
|
+ myService.showAccount().then(function(result){
|
|
|
|
+ $scope.items = result.data.data;
|
|
|
|
+ },function(error){
|
|
|
|
+ msg.error(error.data.message);
|
|
|
|
+ })
|
|
|
|
+ };
|
|
|
|
+ $scope.destroyAccount = function(id){
|
|
|
|
+ myService.destroyAccount(id).then(function(result){
|
|
|
|
+ msg.text("删除成功");
|
|
|
|
+ $scope.showAccount();
|
|
|
|
+ },function(error){
|
|
|
|
+ msg.error(error.data.message);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}]);
|
|
}]);
|
|
app.controller('my_account_addCtrl', ["$scope","common","$ionicTabsDelegate", "$state", "myService", "msg"
|
|
app.controller('my_account_addCtrl', ["$scope","common","$ionicTabsDelegate", "$state", "myService", "msg"
|
|
, function ($scope,common,$ionicTabsDelegate, $state, myService, msg) {
|
|
, function ($scope,common,$ionicTabsDelegate, $state, myService, msg) {
|
|
@@ -354,6 +454,7 @@
|
|
console.log('图片选择失败');
|
|
console.log('图片选择失败');
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+ $scope.imgs=[];
|
|
$scope.deletefile = function (file) {
|
|
$scope.deletefile = function (file) {
|
|
var index = $scope.imgs.indexOf(file);
|
|
var index = $scope.imgs.indexOf(file);
|
|
$scope.imgs.splice(index, 1);
|
|
$scope.imgs.splice(index, 1);
|
|
@@ -361,28 +462,46 @@
|
|
})
|
|
})
|
|
};
|
|
};
|
|
$scope.vm={
|
|
$scope.vm={
|
|
- name:'',
|
|
|
|
- about:'',
|
|
|
|
- coin:''
|
|
|
|
|
|
+ bank_name:'',
|
|
|
|
+ bank_number:'',
|
|
|
|
+ bank_phone:'',
|
|
|
|
+ bank_user:''
|
|
};
|
|
};
|
|
- $scope.add = function () {
|
|
|
|
|
|
+ $scope.addAccount = function () {
|
|
var data = {
|
|
var data = {
|
|
- pics: $scope.imgs,
|
|
|
|
- video:$scope.video.server,
|
|
|
|
- name: $scope.vm.name,
|
|
|
|
- about: $scope.vm.about,
|
|
|
|
- days: 21, //默认21
|
|
|
|
- coin: $scope.vm.coin
|
|
|
|
|
|
+ data:{
|
|
|
|
+ bank_name:$scope.vm.bank_name,
|
|
|
|
+ bank_number:$scope.vm.bank_number,
|
|
|
|
+ bank_phone:$scope.vm.bank_phone,
|
|
|
|
+ bank_user:$scope.vm.bank_user
|
|
|
|
+ }
|
|
};
|
|
};
|
|
msg.loading('保存中...');
|
|
msg.loading('保存中...');
|
|
- dreamService.addDream(data).then(function (result) {
|
|
|
|
|
|
+ myService.addAccount(data).then(function (result) {
|
|
msg.hide();
|
|
msg.hide();
|
|
- $state.go('app.home');
|
|
|
|
|
|
+ $state.go('app.my_account');
|
|
}, function (error) {
|
|
}, function (error) {
|
|
msg.hide();
|
|
msg.hide();
|
|
msg.error(error.data.message);
|
|
msg.error(error.data.message);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+ $scope.addQrcode = function(){
|
|
|
|
+ var data = {
|
|
|
|
+ data:{
|
|
|
|
+ bank_name:$scope.vm.bank_name,
|
|
|
|
+ //bank_number:$scope.imgs
|
|
|
|
+ bank_number:"https://www.baidu.com/img/bd_logo1.png"
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ myService.addQrcode(data).then(function(result){
|
|
|
|
+ msg.text("添加成功",true);
|
|
|
|
+ $timeout(function () {
|
|
|
|
+ $state.go("app.my_account");
|
|
|
|
+ }, 1000);
|
|
|
|
+ },function(error){
|
|
|
|
+ msg.error(error.data.message);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
}]);
|
|
}]);
|
|
app.controller('messageCtrl', ["$scope", "$ionicTabsDelegate","$state", "myService", "msg"
|
|
app.controller('messageCtrl', ["$scope", "$ionicTabsDelegate","$state", "myService", "msg"
|