angular.module('push') .controller('noticeCtrl', ['$scope', 'AccountService', '$ionicPopup', function ($scope, AccountService, $ionicPopup) { $scope.epidemicService = {}; //便民服务需求征集 $scope.demandCollectList = [{ itemvalue: 0, itemkey: '应急快递', isSelected: false }, { itemvalue: 1, itemkey: '配药', isSelected: false }, { itemvalue: 2, itemkey: '其他(特别急、险的事项)', isSelected: false }]; //政务服务需求 $scope.govServiceDemandList = [{ itemvalue: 0, itemkey: '公积金业务', isSelected: false }, { itemvalue: 1, itemkey: '车驾管、违章业务', isSelected: false }, { itemvalue: 2, itemkey: '市民卡业务', isSelected: false }, { itemvalue: 3, itemkey: '社保医保业务(咨询解答)', isSelected: false }, { itemvalue: 4, itemkey: '企业复工申报', isSelected: false }, { itemvalue: 5, itemkey: '商事登记业务', isSelected: false }, { itemvalue: 6, itemkey: '税务业务', isSelected: false }, { itemvalue: 7, itemkey: '水电气电视业务', isSelected: false }, { itemvalue: 8, itemkey: '其他业务', isSelected: false }]; $scope.selectDemandCollect = function (index) { $scope.demandCollectList[index].isSelected = !$scope.demandCollectList[index].isSelected; if ($scope.demandCollectList[index].isSelected) { if (index == 0) { $scope.showIndex0 = true; $scope.epidemicService.demandcollect0 = true; } if (index == 1) { $scope.showIndex1 = true; $scope.epidemicService.demandcollect1 = true; } if (index == 2) { $scope.showIndex2 = true; $scope.epidemicService.demandcollect2 = true; } } else { if (index == 0) { $scope.showIndex0 = false; $scope.epidemicService.demandcollect0 = false; $scope.epidemicService.indexinfo0 = ""; } if (index == 1) { $scope.showIndex1 = false; $scope.epidemicService.demandCollect1 = false; $scope.epidemicService.indexinfo1 = ""; } if (index == 2) { $scope.showIndex2 = false; $scope.epidemicService.demandCollect2 = false; $scope.epidemicService.indexinfo2 = ""; } } } $scope.selectGovServiceDemand = function (index) { $scope.govServiceDemandList[index].isSelected = !$scope.govServiceDemandList[index].isSelected; if ($scope.govServiceDemandList[index].isSelected) { if (index == 0) { $scope.epidemicService.govservicedemand0 = true; } if (index == 1) { $scope.epidemicService.govservicedemand1 = true; } if (index == 2) { $scope.epidemicService.govservicedemand2 = true; } if (index == 3) { $scope.epidemicService.govservicedemand3 = true; } if (index == 4) { $scope.epidemicService.govservicedemand4 = true; } if (index == 5) { $scope.epidemicService.govservicedemand5 = true; } if (index == 6) { $scope.epidemicService.govservicedemand6 = true; } if (index == 7) { $scope.epidemicService.govservicedemand7 = true; } if (index == 8) { $scope.epidemicService.govservicedemand8 = true; } } else { if (index == 0) { $scope.epidemicService.govservicedemand0 = false; } if (index == 1) { $scope.epidemicService.govservicedemand1 = false; } if (index == 2) { $scope.epidemicService.govservicedemand2 = false; } if (index == 3) { $scope.epidemicService.govservicedemand3 = false; } if (index == 4) { $scope.epidemicService.govservicedemand4 = false; } if (index == 5) { $scope.epidemicService.govservicedemand5 = false; } if (index == 6) { $scope.epidemicService.govservicedemand6 = false; } if (index == 7) { $scope.epidemicService.govservicedemand7 = false; } if (index == 8) { $scope.epidemicService.govservicedemand8 = false; $scope.epidemicService.govservicedemandinfo8 = ""; } } } //提交疫情服务 $scope.submitEpidemicService = function () { if (!$scope.epidemicService.name) { $ionicPopup.alert({ title: '提示', template:'

请输入姓名

', buttons:[{text:"确定"}] }) return; } if (!$scope.epidemicService.phone) { $ionicPopup.alert({ title: '提示', template:'

请输入手机号

', buttons:[{text:"确定"}] }) return; } if ($scope.epidemicService.demandcollect0) { if (!$scope.epidemicService.indexinfo0) { $ionicPopup.alert({ title: '提示', template:'

请输入应急快递具体信息

', buttons:[{text:"确定"}] }) return; } } if ($scope.epidemicService.demandcollect1) { if (!$scope.epidemicService.indexinfo1) { $ionicPopup.alert({ title: '提示', template:'

请输入配药具体信息

', buttons:[{text:"确定"}] }) return; } } if ($scope.epidemicService.demandcollect2) { if (!$scope.epidemicService.indexinfo2) { $ionicPopup.alert({ title: '提示', template:'

请输入其他需求具体信息

', buttons:[{text:"确定"}] }) return; } } if ($scope.epidemicService.govservicedemand8) { if (!$scope.epidemicService.govservicedemandinfo8) { $ionicPopup.alert({ title: '提示', template:'

请输入其他业务具体信息

', buttons:[{text:"确定"}] }) return; } } var netStatue = navigator.onLine; if(netStatue){ AccountService.submitEpidemicService($scope.epidemicService).then(function (res) { if (res.code == 3350) { $scope.go('noticeDetail', { list: $scope.govServiceDemandList, otherinfo: $scope.epidemicService.govservicedemandinfo8 }); } }) }else{ $ionicPopup.alert({ title: '提示', template:'

网络未连接,请检查您的网络!

', buttons:[{text:"确定"}] }) return; } } }]) ;