unserver-unify
Version:
33 lines • 1.03 kB
JavaScript
angular.module('bamboo').component('memberRenewComponent', {
templateUrl: 'app/directive/notice/renewmember.component.html',
bindings: {
dismiss: '&',
},
controller: function(ApiService, CommonService, $location, $window, loginService) {
var self = this;
self.$onInit = function() {};
self.submit = function() {
var info = {
action: 'paypalbuymember',
url: $location.absUrl(),
}
ApiService.post('/payment', info).then(function(result) {
console.log(result);
if (result.data.success) {
console.log(result.data.data);
if (result.data.data.redirectUrl) {
CommonService.showInfo('Redirect to Payment Page , Please wait ...');
$window.location.href = result.data.data.redirectUrl;
}
}
});
};
self.school=loginService.school;
self.cancel = function() {
self.dismiss({
$value: 'cancel'
});
// loginService.logout();
};
}
});