123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- /**
- * 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 });
- }
- }]);
|