angular.module('push') .controller('activitySurveyCtrl', function ($scope, CommentService, UtilService, $timeout) { // var url = "http://blog.sina.com.cn/s/blog_537517170102w5vj.html"; // $scope.myUrl = $sce.trustAsResourceUrl(url); $scope.actinfo = { orgname: "", kind: 1,//问卷编号 duties: 1, ishastec: 1, overallview: 1, choice: 1, suggestion: "" }; $scope.checkPositon = function (type) { $scope.actinfo.duties = type; }; $scope.checkTec = function (type) { $scope.actinfo.ishastec = type; }; $scope.checkOverallView = function (type) { $scope.actinfo.overallview = type; }; $scope.checkChoice = function (type) { $scope.actinfo.choice = type; }; // 提交活动问卷调查表 $scope.submitActivityInfo = function () { if (!UtilService.isDefined($scope.actinfo.orgname)) { UtilService.showMess("请填写您所在的单位"); return; } $scope.showLoadingToast(); CommentService.submitQuestionnaire($scope.actinfo).then(function (response) { if (response.status == 0) { UtilService.showMess("提交失败"); } else if (response.status == 1) { UtilService.showMess("提交成功"); $timeout(function () { $scope.goback(); }, 1500) } else if (response.status == 2) { UtilService.showMess("已成功提交,无需重复提交"); } $scope.hideLoadingToast(); }, function () { UtilService.showMess("网络不给力,请重试"); $scope.hideLoadingToast(); }) }; });