|
@@ -107,34 +107,40 @@
|
|
$scope.aboutMiao = function(){
|
|
$scope.aboutMiao = function(){
|
|
myService.aboutMiao().then(function(result){
|
|
myService.aboutMiao().then(function(result){
|
|
$scope.items = result.data.data;
|
|
$scope.items = result.data.data;
|
|
- debugger;
|
|
|
|
},function(error){
|
|
},function(error){
|
|
msg.error(error.data.message)
|
|
msg.error(error.data.message)
|
|
})
|
|
})
|
|
};
|
|
};
|
|
}]);
|
|
}]);
|
|
- app.controller('withdrawCtrl', ["$scope","$ionicTabsDelegate","$timeout", "$state", "myService", "msg","storage"
|
|
|
|
- , function ($scope,$ionicTabsDelegate, $timeout,$state,myService, msg, storage) {
|
|
|
|
|
|
+ app.controller('withdrawCtrl', ["$scope","$ionicTabsDelegate","$ionicHistory","$timeout", "$state", "myService", "msg","storage"
|
|
|
|
+ , function ($scope,$ionicTabsDelegate, $ionicHistory,$timeout,$state,myService, msg, storage) {
|
|
$scope.vm={
|
|
$scope.vm={
|
|
pay:"",
|
|
pay:"",
|
|
cash:""
|
|
cash:""
|
|
};
|
|
};
|
|
$scope.$on("$ionicView.enter",function(){
|
|
$scope.$on("$ionicView.enter",function(){
|
|
myService.showAccount().then(function(result){
|
|
myService.showAccount().then(function(result){
|
|
|
|
+ $scope.accountId = result.data.data;
|
|
var items = result.data.data;
|
|
var items = result.data.data;
|
|
$scope.pays=[];
|
|
$scope.pays=[];
|
|
angular.forEach(items,function(item){
|
|
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+")";
|
|
|
|
|
|
+ if(item.bank_name!=null) {
|
|
|
|
+ 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+")";
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ value=item.type;
|
|
|
|
+ }
|
|
$scope.pays.push({id:item.id,value:value});
|
|
$scope.pays.push({id:item.id,value:value});
|
|
})
|
|
})
|
|
},function(error){
|
|
},function(error){
|
|
msg.error(error.data.message)
|
|
msg.error(error.data.message)
|
|
})
|
|
})
|
|
});
|
|
});
|
|
|
|
+
|
|
$scope.withdraw = function(){
|
|
$scope.withdraw = function(){
|
|
var data = {
|
|
var data = {
|
|
data:{
|
|
data:{
|
|
@@ -145,16 +151,58 @@
|
|
myService.withdraw(data).then(function(result){
|
|
myService.withdraw(data).then(function(result){
|
|
msg.text("提现申请已提交");
|
|
msg.text("提现申请已提交");
|
|
$timeout(function () {
|
|
$timeout(function () {
|
|
- $state.go("app.my");
|
|
|
|
|
|
+ $ionicHistory.goBack();
|
|
},1000);
|
|
},1000);
|
|
},function(error){
|
|
},function(error){
|
|
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}]);
|
|
}]);
|
|
- app.controller('payoutCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
|
|
- , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
|
|
|
|
+ app.controller('payoutCtrl', ["$scope","$ionicTabsDelegate","$timeout","$ionicHistory", "$state", "myService", "msg","storage"
|
|
|
|
+ , function ($scope,$ionicTabsDelegate, $timeout, $ionicHistory,$state,myService, msg, storage) {
|
|
|
|
+ $scope.vm={
|
|
|
|
+ pay:"",
|
|
|
|
+ cash:""
|
|
|
|
+ };
|
|
|
|
+ $scope.$on("$ionicView.enter",function(){
|
|
|
|
+ myService.showAccount().then(function(result){
|
|
|
|
+ $scope.accountId = result.data.data;
|
|
|
|
+ var items = result.data.data;
|
|
|
|
+ $scope.pays=[];
|
|
|
|
+ angular.forEach(items,function(item){
|
|
|
|
+ if(item.bank_name!=null) {
|
|
|
|
+ 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+")";
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ value=item.type;
|
|
|
|
+ }
|
|
|
|
+ $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 () {
|
|
|
|
+ $ionicHistory.goBack();
|
|
|
|
+ },1000);
|
|
|
|
+ },function(error){
|
|
|
|
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}]);
|
|
}]);
|
|
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) {
|
|
@@ -399,8 +447,8 @@
|
|
}
|
|
}
|
|
|
|
|
|
}]);
|
|
}]);
|
|
- app.controller('payCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg"
|
|
|
|
- , function ($scope,$ionicTabsDelegate, $state, myService, msg) {
|
|
|
|
|
|
+ app.controller('payCtrl', ["$scope","$ionicTabsDelegate", "$timeout","$ionicHistory","$state", "myService", "msg"
|
|
|
|
+ , function ($scope,$ionicTabsDelegate, $timeout,$ionicHistory,$state, myService, msg) {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
myService.myInfo().then(function(result){
|
|
myService.myInfo().then(function(result){
|
|
$scope.vm = result.data.data;
|
|
$scope.vm = result.data.data;
|
|
@@ -417,7 +465,9 @@
|
|
$scope.recharge = function(money){
|
|
$scope.recharge = function(money){
|
|
myService.recharge(money).then(function(result){
|
|
myService.recharge(money).then(function(result){
|
|
msg.text("充值成功");
|
|
msg.text("充值成功");
|
|
- $state.go('app.my');
|
|
|
|
|
|
+ $timeout(function(){
|
|
|
|
+ $ionicHistory.goBack();
|
|
|
|
+ },1000)
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|