|
|
@@ -1,6 +1,6 @@
|
|
|
define([ 'app/app' ], function(app) {
|
|
|
//品牌审批
|
|
|
- app.register.controller('WinningHistoriesCtrl', ['$scope', 'ngTableParams', 'Lottery', 'BaseService', function($scope, ngTableParams, Lottery, BaseService) {
|
|
|
+ app.register.controller('WinningHistoriesCtrl', ['$scope', 'ngTableParams', 'Lottery', 'BaseService', '$modal', function($scope, ngTableParams, Lottery, BaseService, $modal) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
|
|
|
$scope.active = 'all';
|
|
|
@@ -69,6 +69,47 @@ define([ 'app/app' ], function(app) {
|
|
|
//根据订单号搜索
|
|
|
$scope.onSearch = function() {
|
|
|
$scope.winningTableParams.reload();
|
|
|
- }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 填写兑奖信息
|
|
|
+ $scope.openRedempte = function(id) {
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ templateUrl : 'static/view/admin/ads/redempte_modal.html',
|
|
|
+ controller : 'RedempteModalCtrl',
|
|
|
+ size : 'md',
|
|
|
+ resolve: {
|
|
|
+ winningHistoryId: function() {
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ modalInstance.opened.then(function(){
|
|
|
+
|
|
|
+ });
|
|
|
+ modalInstance.result.then(function(brand){
|
|
|
+ $scope.winningTableParams.reload();
|
|
|
+ }, function(reason){
|
|
|
+
|
|
|
+ });
|
|
|
+ };
|
|
|
}]);
|
|
|
+
|
|
|
+ //兑奖信息模态框的controller
|
|
|
+ app.register.controller('RedempteModalCtrl', ['$scope', '$modalInstance', 'Lottery', 'toaster', 'winningHistoryId', function($scope, $modalInstance, Lottery, toaster, winningHistoryId) {
|
|
|
+
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.confirm = function() {
|
|
|
+ Lottery.redempte({id: winningHistoryId, userTel: $scope.userTel, code: $scope.code}, {}, function (data) {
|
|
|
+ if (data.code == 200) {
|
|
|
+ toaster.pop('info', '兑奖成功!');
|
|
|
+ $modalInstance.close();
|
|
|
+ } else {
|
|
|
+ toaster.pop('error', '兑奖失败:' + data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+ }]);
|
|
|
});
|