angular.module('push') .controller('wujingTechnicalCtrl', function ($q, $scope, $ionicActionSheet, $ionicSlideBoxDelegate, ResourceLibraryService, $stateParams, $timeout, $ionicScrollDelegate, UtilService, $ionicPopup, $ionicListDelegate, AuthorityService, UserService, taskModuleService, ConfigService, ActivityService, ConstantService, dataToolsService, CommonService, $ionicModal) { $scope.moduleid = 43; $scope.isShowSearchButton = true; $scope.keyfilter = {key: ""};//搜索关键词 $scope.reclibc = $stateParams.reclibc; $scope.showLoadMore = false; taskModuleService.thisUserIsAdmin().then(function (res) { if (res.code == 3350) { $scope.isAdmin = res.data; } }) var getClaid = function () { ResourceLibraryService.getClaid($scope.moduleid).then(function (res) { if (res.code == 3350) { $scope.data = res.data; } }) } getClaid(); var getAllResourceList = function () { ResourceLibraryService.getFirstResourceList(43, 231, 0, $scope.keyfilter.key, "enterprisescale,desc", 0, 0, "", "").then(function (res) { if (res.code == 3350) { $scope.length = res.data.length; if($scope.length > res.data.length){ $scope.showLoadMore = true; } $scope.allData = res.data; } }) } getAllResourceList(); $scope.goback2 = function () { $scope.go('tab.resourceLibrary',{},{reload:true}); } $scope.goEnterCompanyInfo = function (moduleid) { ResourceLibraryService.getPageId(moduleid).then(function (res) { if (res.code == 3350) { $scope.go('visitModularForm', { companyid: 0, pageid: res.data, orgtype: moduleid == 6 || moduleid == 43 ? ConstantService.UNITTYPE_10104 : moduleid == 7 ? ConstantService.UNITTYPE_10105 : 0, isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建 connid: 0, pagecode: 1000030, pageTitle: '新建创新创业联盟库', node: UserService.node, resourcetype: moduleid, comfrom: 'privateResource' }); } }) } $scope.deletItem = function (id, node, idx) { console.log(2); var data = { data: { id: id, isenabled: 2, comfrom: node }, node: node } // confirm 对话框 var confirmPopup = $ionicPopup.confirm({ title: '删除确认', template: '请确认是否要删除此项!', cancelText: '取消', okText: '确认', }); confirmPopup.then(function (res) { console.log(res); if (res) { dataToolsService.saveWebInfo(data).then(function (res) { if (res.code == 3350) { if ($scope.app) { UtilService.showMess('删除成功'); } else { CommonService.showMessage('删除成功', $scope); } getAllResourceList(); } else { if ($scope.app) { UtilService.showMess('删除失败'); } else { CommonService.showMessage('删除失败', $scope); } } }) } else { // console.log('You are not sure'); } }); } $scope.goToUnionDetail = function (resource) { $scope.islogin = ConfigService.islogin; if (!$scope.islogin) { if (localStorage.wxFlag == "true") { if (localStorage.isUserFocusXW == 0) { var title = localStorage.appidStr; $ionicPopup.alert({ title: '提示', template: '请先关注微信公众号"' + title + '"!' }); return; } else { if (localStorage.isUserBindWx == 0) { var wxFlag = JSON.parse(localStorage.params); if (wxFlag.weChatModel) { $scope.go('bindPhone', { params: localStorage.params, comfrom: 'maincontroller', url: window.location.href.split('#/')[1] }); } else { $scope.go('login'); return; } } else { $scope.go('login'); return; } } } else { $scope.go('login'); return; } } else { $scope.go('wujingTechnicalDetail', {resource: resource}); } } //虚拟搜索框 $scope.showSearchButtonLeft = function () { $scope.isShowSearchButton = false; $(".showSearchInput").focus(); }; //清空搜索内容 $scope.clearSearch = function () { $scope.isShowSearchButton = true; $scope.keyfilter.key = ""; }; // 搜索各种资源信息 $scope.searchResourceList = function () { $scope.showLoadingToast(); getAllResourceList(); }, function () { $scope.hideLoadingToast(); }; }) ;