activitySurveyCtrl.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. angular.module('push')
  2. .controller('activitySurveyCtrl', function ($scope, CommentService, UtilService, $timeout) {
  3. // var url = "http://blog.sina.com.cn/s/blog_537517170102w5vj.html";
  4. // $scope.myUrl = $sce.trustAsResourceUrl(url);
  5. $scope.actinfo = {
  6. orgname: "",
  7. kind: 1,//问卷编号
  8. duties: 1,
  9. ishastec: 1,
  10. overallview: 1,
  11. choice: 1,
  12. suggestion: ""
  13. };
  14. $scope.checkPositon = function (type) {
  15. $scope.actinfo.duties = type;
  16. };
  17. $scope.checkTec = function (type) {
  18. $scope.actinfo.ishastec = type;
  19. };
  20. $scope.checkOverallView = function (type) {
  21. $scope.actinfo.overallview = type;
  22. };
  23. $scope.checkChoice = function (type) {
  24. $scope.actinfo.choice = type;
  25. };
  26. // 提交活动问卷调查表
  27. $scope.submitActivityInfo = function () {
  28. if (!UtilService.isDefined($scope.actinfo.orgname)) {
  29. UtilService.showMess("请填写您所在的单位");
  30. return;
  31. }
  32. $scope.showLoadingToast();
  33. CommentService.submitQuestionnaire($scope.actinfo).then(function (response) {
  34. if (response.status == 0) {
  35. UtilService.showMess("提交失败");
  36. } else if (response.status == 1) {
  37. UtilService.showMess("提交成功");
  38. $timeout(function () {
  39. $scope.goback();
  40. }, 1500)
  41. } else if (response.status == 2) {
  42. UtilService.showMess("已成功提交,无需重复提交");
  43. }
  44. $scope.hideLoadingToast();
  45. }, function () {
  46. UtilService.showMess("网络不给力,请重试");
  47. $scope.hideLoadingToast();
  48. })
  49. };
  50. });