123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- 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();
- };
- })
- ;
|