1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- angular.module('push')
- .controller('resourceLibraryLocalTypeCtrl', function ($scope, $stateParams, $timeout, $ionicActionSheet, SqliteStorageService) {
- if($scope.app){
- $scope.setStatusBar(0);
- }
- $scope.reclib = angular.fromJson($stateParams.reclib);
- // console.log($scope.reclib);
- var getResourceLibrary = function () {
- var sql = "select * from conninfofolder where localparentid = " + $scope.reclib.localid;// + " and infocount > 0 "
- SqliteStorageService.queryData(sql).then(function (response) {
- // console.log(response);
- $scope.resourcelibraryclass = response;
- }, function () {
- });
- };
- getResourceLibrary();
- //私人库资源库搜索
- $scope.goResourceSearch = function () {
- $timeout(function () {
- $scope.go('resourceSearch', {tabindex: 3});
- }, 350);
- };
- //网络异常时点击屏幕重新加载
- $scope.repeatLoad = function () {
- // console.log("重新加载");
- getResourceLibrary();
- };
- //进入私人资源库详情
- $scope.goResorceLibaryDetail = function (reclibc) {
- $scope.go('resourceList', {
- libtype: reclibc.moduleid,
- privateName: $scope.reclib.name,
- name: reclibc.name,
- reclibid: $scope.reclib.localid,
- modlibid: reclibc.localid,
- isCloud: $scope.reclib.isCloud
- });
- };
- //打开操作表
- $scope.openActionSheet = function () {
- $ionicActionSheet.show({
- buttons: [
- {text: '设置'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- if (index == 0) {
- $scope.go("authorityLocalSet", {authoritydata: angular.toJson($scope.reclib), type: 1, goflg: 1});
- }
- return true;
- }
- });
- };
- //下拉刷新数据
- $scope.refreshData = function () {
- $scope.repeatLoad();
- $scope.$broadcast('scroll.refreshComplete');
- var trHtml = "<div class='refresh_tip_div'>更新了" + $scope.resourcelibraryclass.length + "条内容</div>";
- $timeout(function () {
- $(".calendarList-content-ul .list").prepend(trHtml);
- $(".refresh_tip_div").animate({width: 100 + "%"}, 150);
- }, 800);
- $timeout(function () {
- $(".refresh_tip_div").slideUp();
- }, 1200);
- };
- });
|