123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- angular.module('push')
- .controller('DockingThemeCtrl', function ($scope, $ionicActionSheet, ModelService, $stateParams, UtilService) {
- //主题类型:1:需求 2:成果 3:服务 4:其他
- $scope.typename = ["需求", "成果", "服务", "其他"];
- var listindex;
- if (UtilService.isDefined($stateParams.theme)) {
- $scope.temptheme = $stateParams.theme;
- $scope.index = $stateParams.theme.type - 1;
- listindex = $stateParams.index;
- } else {
- $scope.temptheme = {title: "", type: 1, content: ""};
- $scope.index = 0;
- }
- $scope.show = function () {
- $ionicActionSheet.show({
- buttons: [
- {text: '<a class="action-sheet-push">需求</a>'},
- {text: '<a class="action-sheet-push">成果</a>'},
- {text: '<a class="action-sheet-push">服务</a>'},
- {text: '<a class="action-sheet-push">其他</a>'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.index = index;
- $scope.temptheme.type = index + 1;
- return true;
- }
- });
- };
- $scope.saveTempTheme = function () {
- if (!UtilService.isDefined($scope.temptheme.title)) {
- UtilService.showMess("主题名称不能为空");
- return;
- }
- if (UtilService.isDefined($stateParams.theme)) {
- var tempThemeList = ModelService.getTempThemes();
- tempThemeList[listindex] = $scope.temptheme;
- ModelService.setTempThemes2(tempThemeList);
- } else {
- $scope.temptheme.localid = UtilService.formatDate().timestamp + "";
- ModelService.setTempThemes($scope.temptheme);
- }
- $scope.goback();
- }
- });
|