/** * Created by pushkeji on 2018/12/27. */ angular.module('push') .controller('participantListCtrl', ['$scope', 'activitiesModuleService', '$timeout', '$q', 'UserService', '$stateParams', 'ResourceLibraryService', '$ionicSlideBoxDelegate', 'CommentService', 'ConfigService', 'ScienceCircleService', 'CommonService', '$ionicScrollDelegate', 'ConstantService', '$ionicActionSheet', 'UtilService', 'ShareService', 'dataToolsService', '$sce', '$ionicPopup', function ($scope, activitiesModuleService, $timeout, $q, UserService, $stateParams, ResourceLibraryService, $ionicSlideBoxDelegate, CommentService, ConfigService, ScienceCircleService, CommonService, $ionicScrollDelegate, ConstantService, $ionicActionSheet, UtilService, ShareService, dataToolsService, $sce, $ionicPopup) { console.log($stateParams); $scope.isShowApplayStatusList = ["5302"]; $scope.isShowApplay = true; // 显示【添加报名】按钮 // 判断是否显示【添加报名】按钮 if ($scope.isShowApplayStatusList.includes($stateParams.status)) { $scope.isShowApplay = false; } $scope.showModal = false; if (localStorage.applyShowModal == 'true') { $scope.showModal = true; $scope.applyerDetail = JSON.parse(localStorage.applyerDetail); } var activityid = $stateParams.activityid; var pagenum = 1, pagesize = 15; var getAllData = function () { activitiesModuleService.participantList(activityid, pagenum, pagesize).then(function (res) { if (res.code == 3350) { $scope.allList = res.data; } }) } getAllData(); $scope.addApplyPerson = function () { $scope.go('activityApply', { settingItems: $stateParams.settingItems, activityid: activityid, comfrom: 'participantList' }); } // 删除报名 $scope.deleteActivityUsers = function (targetid, name) { // var alertPopup = $ionicPopup.alert({ // title: '警告', // template: '确定要删除该报名人员吗?' // }); // alertPopup.then(function() { // activitiesModuleService.deleteActivityUsers(activityid,targetid).then(function(res){ // console.log(res); // if(res.code==3350){ // getAllData(); // if($scope.app){ // UtilService.showMess("报名人员移除成功"); // }else{ // CommonService.showMessage("报名人员移除成功",$scope); // } // } // }) // }); var confirmPopup = $ionicPopup.confirm({ title: '警告', template: '确定要删除 ' + name + ' 吗?' }); confirmPopup.then(function (res) { if (res) { activitiesModuleService.deleteActivityUsers(activityid, targetid).then(function (res) { if (res.code == 3350) { getAllData(); if ($scope.app) { UtilService.showMess("报名人员移除成功"); } else { CommonService.showMessage("报名人员移除成功", $scope); } } }) } else { // console.log('You are not sure'); } }); }; $scope.gobackToWhere = function () { localStorage.applyShowModal = false; $scope.applyerDetail = {}; $scope.go('activityDetail', { activityid: activityid }); } // 获取报名人员详情 $scope.getApplyDetail = function (userid) { $scope.showModal = true; activitiesModuleService.getApplyDetail(activityid, userid).then(function (res) { if (res.code == 3350) { $scope.applyerDetail = res.data; localStorage.applyerDetail = JSON.stringify(res.data); } }) } $scope.goPublisher = function (id) { // console.log(id); if (id != 0) { $scope.go('publisher', { Id: id }); } } $scope.goToResourceDetail = function (list) { localStorage.applyShowModal = true; $scope.go('resourceCommonInfoDetailsPage', { resid: list.itemvalue, isAllVisitor: 0, pagecode: list.item.pagecode, node: list.item.node, comfrom: 'participantList',//录入信息 orgtype: list.item.orgtype, templettype: list.item.pageid, // label:JSON.stringify(resource.otherObj), }); } //添加报名人员 $scope.addApplyPeople = function () { $scope.go('activityApply', { settingItems: $stateParams.settingItems, activityid: activityid }); } }]);