app.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. // Ionic Starter App
  2. // angular.module is a global place for creating, registering and retrieving Angular modules
  3. // 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
  4. // the 2nd parameter is an array of 'requires'
  5. // TODO
  6. var app = angular.module('push', ['ionic', 'ngCordova', 'oc.lazyLoad', 'ionic.service.core', 'ionic.service.deploy','ionic-datepicker'])
  7. // var app = angular.module('push', ['ionic', 'oc.lazyLoad', 'ionic.service.core', 'ionic.service.deploy','ionic-datepicker'])
  8. .run(function ($ionicPlatform) {
  9. $ionicPlatform.ready(function () {
  10. // ionic.Platform.fullScreen();
  11. if (window.cordova && window.cordova.plugins.Keyboard) {
  12. cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  13. cordova.plugins.Keyboard.disableScroll(true);
  14. }
  15. if (window.StatusBar) {
  16. StatusBar.styleLightContent();
  17. }
  18. });
  19. })
  20. .config(['$stateProvider', '$urlRouterProvider', '$ionicConfigProvider','ionicDatePickerProvider', function ($stateProvider, $urlRouterProvider, $ionicConfigProvider,ionicDatePickerProvider) {
  21. $ionicConfigProvider.views.swipeBackEnabled(false);
  22. $ionicConfigProvider.views.transition('none');
  23. $ionicConfigProvider.scrolling.jsScrolling(true);
  24. $ionicConfigProvider.platform.ios.tabs.style('standard');
  25. $ionicConfigProvider.platform.ios.tabs.position('bottom');
  26. $ionicConfigProvider.platform.android.tabs.style('standard');
  27. $ionicConfigProvider.platform.android.tabs.position('standard');
  28. $ionicConfigProvider.platform.ios.navBar.alignTitle('center');
  29. $ionicConfigProvider.platform.android.navBar.alignTitle('center');
  30. $ionicConfigProvider.platform.ios.views.transition('ios');
  31. $ionicConfigProvider.platform.android.views.transition('android');
  32. $stateProvider
  33. /*TAB*/
  34. .state('tab', {
  35. url: '/tab', abstract: true,
  36. templateUrl: 'modules/common/views/tabs.html'
  37. })
  38. /*资讯首页*/
  39. .state('tab.home', {
  40. cache: true,
  41. url: '/home',
  42. views: {
  43. 'tab-home': {
  44. templateUrl: 'modules/home/views/home.html',
  45. controller: 'HomeCtrl',
  46. resolve: {
  47. home: function (LoadJsService) {
  48. return LoadJsService.loadSequence("HomeArgs");
  49. }
  50. }
  51. }
  52. }
  53. })
  54. /*资源库*/
  55. .state('tab.resourceLibrary', {
  56. cache: false,
  57. url: '/resourceLibrary',
  58. views: {
  59. 'tab-resourceLibrary': {
  60. templateUrl: 'modules/resourceLibrary/views/resourceLibraryHome.html',
  61. controller: 'resourceLibraryHomeCtrl',
  62. resolve: {
  63. resourceLibrary: function (LoadJsService) {
  64. return LoadJsService.loadSequence("ResourceLibraryArgs");
  65. }
  66. }
  67. }
  68. }
  69. })
  70. /*科技圈*/
  71. .state('tab.scienceCircle', {
  72. cache: false,
  73. url: '/scienceCircle',
  74. views: {
  75. 'tab-scienceCircle': {
  76. templateUrl: 'modules/scienceCircle/views/scienceCircleHome.html',
  77. controller: 'scienceCircleHomeCtrl',
  78. resolve: {
  79. scienceCircleHomeCtrl: function (LoadJsService) {
  80. return LoadJsService.loadSequence("scienceCircleHomeArgs");
  81. }
  82. }
  83. }
  84. }
  85. })
  86. /*活动首页*/
  87. .state('tab.activityIndex', {
  88. cache: false,
  89. url: '/activityIndex',
  90. views: {
  91. 'tab-activityIndex': {
  92. templateUrl: 'modules/activityEntrance/views/activityIndex.html',
  93. controller: 'activityIndexCtrl',
  94. resolve: {
  95. activityIndex: function (LoadJsService) {
  96. return LoadJsService.loadSequence("activityIndexArgs");
  97. }
  98. },
  99. }
  100. }
  101. })
  102. /*我的*/
  103. .state('tab.account', {
  104. cache: false,
  105. url: '/account',
  106. views: {
  107. 'tab-account': {
  108. templateUrl: 'modules/account/views/account.html',
  109. controller: 'AccountCtrl',
  110. resolve: {
  111. account: function (LoadJsService) {
  112. return LoadJsService.loadSequence("AccountArgs");
  113. }
  114. }
  115. }
  116. }
  117. })
  118. /*详情*/
  119. .state('detail', {
  120. cache: false,
  121. url: '/detail',
  122. templateUrl: 'modules/home/views/details.html',
  123. controller: 'DetailsCtrl',
  124. resolve: {
  125. detail: function (LoadJsService) {
  126. return LoadJsService.loadSequence("DetailsArgs");
  127. }
  128. },
  129. params: {
  130. url: "",
  131. creatorId: "",
  132. id: "",
  133. type: "",
  134. title: "",
  135. siteName: "",
  136. time: "",
  137. content: "",
  138. moduleId: "",
  139. favourCount: ""
  140. }
  141. })
  142. /*引导页*/
  143. .state('guide', {
  144. cache: false,
  145. url: '/guide',
  146. templateUrl: 'modules/guidepage/views/guide.html',
  147. controller: 'GuideCtrl',
  148. resolve: {
  149. guide: function (LoadJsService) {
  150. return LoadJsService.loadSequence("GuideCtrl");
  151. }
  152. }
  153. })
  154. /*登录*/
  155. .state('login', {
  156. cache: false,
  157. url: '/login',
  158. templateUrl: 'modules/login/views/login.html',
  159. controller: 'LoginCtrl',
  160. resolve: {
  161. login: function (LoadJsService) {
  162. return LoadJsService.loadSequence("LoginCtrl");
  163. }
  164. }
  165. })
  166. /*注冊*/
  167. .state('register', {
  168. cache: false,
  169. url: '/register',
  170. templateUrl: 'modules/register/views/register.html',
  171. controller: 'RegisterCtrl',
  172. resolve: {
  173. register: function (LoadJsService) {
  174. return LoadJsService.loadSequence("RegisterArgs");
  175. }
  176. }
  177. })
  178. //忘记密码
  179. .state('FortPasd', {
  180. cache: false,
  181. url: '/FortPasd',
  182. templateUrl: 'modules/register/views/FortPasd.html',
  183. controller: 'FortPasdCtrl',
  184. resolve: {
  185. FortPasd: function (LoadJsService) {
  186. return LoadJsService.loadSequence("FortPasdArgs");
  187. }
  188. }
  189. })
  190. /*用户协议*/
  191. .state('userAgreement', {
  192. cache: false,
  193. url: '/userAgreement',
  194. templateUrl: 'modules/register/views/userAgreement.html',
  195. controller: 'userAgreementCtrl',
  196. resolve: {
  197. userAgreement: function (LoadJsService) {
  198. return LoadJsService.loadSequence("userAgreementArgs");
  199. }
  200. }
  201. })
  202. /*搜索*/
  203. .state('mysearch', {
  204. cache: false,
  205. url: '/mysearch',
  206. templateUrl: 'modules/home/views/mySearch.html',
  207. controller: 'MySearchCtrl',
  208. resolve: {
  209. mysearch: function (LoadJsService) {
  210. return LoadJsService.loadSequence("MySearchCtrl");
  211. }
  212. }
  213. })
  214. /*找回密码*/
  215. .state('findpsw', {
  216. cache: false,
  217. url: '/findpsw',
  218. templateUrl: 'modules/login/views/findpsw.html',
  219. controller: 'FindPswCtrl',
  220. resolve: {
  221. findpsw: function (LoadJsService) {
  222. return LoadJsService.loadSequence("FindPswCtrl");
  223. }
  224. }
  225. })
  226. .state('guidePage', {
  227. cache: false,abstract: true,
  228. url: '/guidePage',
  229. templateUrl: 'modules/login/views/guidePage.html',
  230. controller: 'guidePageCtrl',
  231. resolve: {
  232. guidePage: function (LoadJsService) {
  233. return LoadJsService.loadSequence("guidePageCtrl");
  234. }
  235. }
  236. })
  237. /*搜索结果页面*/
  238. .state('SearchResult', {
  239. cache: false,
  240. url: '/SearchResult',
  241. templateUrl: 'modules/home/views/SearchResult.html',
  242. controller: 'SearchResultCtrl',
  243. resolve: {
  244. SearchResult: function (LoadJsService) {
  245. return LoadJsService.loadSequence("SearchResultArgs");
  246. }
  247. },
  248. params: {key: "", actype: true}
  249. })
  250. /*评论回复详情页*/
  251. .state('Reply', {
  252. cache: false,
  253. url: '/Reply',
  254. params: {"comment": null, "infotype": null, "infoid": null, "siteName": "",comfrom:''},
  255. templateUrl: 'modules/home/views/Reply.html',
  256. controller: 'ReplyCtrl',
  257. resolve: {
  258. Reply: function (LoadJsService) {
  259. return LoadJsService.loadSequence("ReplyArgs");
  260. }
  261. }
  262. })
  263. /*云权限主页页面*/
  264. .state('cloudHome', {
  265. cache: false,
  266. url: '/cloudHome',
  267. templateUrl: 'modules/cloudAuthority/views/cloudHome.html',
  268. controller: 'cloudHomeCtrl',
  269. resolve: {
  270. cloudHome: function (LoadJsService) {
  271. return LoadJsService.loadSequence("cloudHomeArgs");
  272. }
  273. }
  274. })
  275. /*创建组页面*/
  276. .state('groupCreate', {
  277. cache: false,
  278. url: '/groupCreate',
  279. templateUrl: 'modules/cloudAuthority/views/groupCreate.html',
  280. controller: 'groupCreateCtrl',
  281. resolve: {
  282. groupCreate: function (LoadJsService) {
  283. return LoadJsService.loadSequence("groupCreateArgs");
  284. }
  285. }
  286. })
  287. /*添加组成员页面*/
  288. .state('groupAddMember', {
  289. cache: false,
  290. url: '/groupAddMember',
  291. templateUrl: 'modules/cloudAuthority/views/groupAddMember.html',
  292. controller: 'groupAddMemberCtrl',
  293. resolve: {
  294. groupAddMember: function (LoadJsService) {
  295. return LoadJsService.loadSequence("groupAddMemberCtrl");
  296. }
  297. },
  298. params: {type: 0}
  299. })
  300. /*显示组成员页面*/
  301. .state('groupMember', {
  302. cache: false,
  303. url: '/groupMember',
  304. templateUrl: 'modules/cloudAuthority/views/groupMember.html',
  305. controller: 'groupMemberCtrl',
  306. resolve: {
  307. groupMember: function (LoadJsService) {
  308. return LoadJsService.loadSequence("groupMemberCtrl");
  309. }
  310. }
  311. })
  312. /*编辑权限页面*/
  313. .state('editAuthority', {
  314. cache: false,
  315. url: '/editAuthority',
  316. templateUrl: 'modules/cloudAuthority/views/editAuthority.html',
  317. controller: 'editAuthorityCtrl',
  318. resolve: {
  319. editAuthority: function (LoadJsService) {
  320. return LoadJsService.loadSequence("editAuthorityArgs");
  321. }
  322. }
  323. })
  324. /*添加成员页面*/
  325. .state('addMember', {
  326. cache: false,
  327. url: '/addMember',
  328. templateUrl: 'modules/cloudAuthority/views/addMember.html',
  329. controller: 'addMemberCtrl',
  330. resolve: {
  331. addMember: function (LoadJsService) {
  332. return LoadJsService.loadSequence("addMemberArgs");
  333. }
  334. },
  335. params: {type: null}
  336. })
  337. /*权限成员介绍页面*/
  338. .state('authorityName', {
  339. cache: false,
  340. url: '/authorityName',
  341. templateUrl: 'modules/cloudAuthority/views/authorityName.html',
  342. controller: 'authorityNameCtrl',
  343. resolve: {
  344. authorityName: function (LoadJsService) {
  345. return LoadJsService.loadSequence("authorityNameArgs");
  346. }
  347. },
  348. params: {authorityid: null, ccomefrom: null, invite_url: null}
  349. })
  350. /*绑定手机号码*/
  351. .state('bindPhone', {
  352. cache: false,
  353. url: '/bindPhone',
  354. templateUrl: 'modules/login/views/bindPhone.html',
  355. controller: 'bindPhoneCtrl',
  356. resolve: {
  357. bindPhone: function (LoadJsService) {
  358. return LoadJsService.loadSequence("bindPhoneCtrl");
  359. }
  360. },
  361. params: {tokeninfo: null, type: 1,comfrom:'',params:'',url:''}
  362. })
  363. .state('privacyPolicy', {
  364. cache: false,
  365. url: '/privacyPolicy',
  366. templateUrl: 'modules/login/views/privacyPolicy.html',
  367. controller: 'privacyPolicyCtrl',
  368. resolve: {
  369. privacyPolicy: function (LoadJsService) {
  370. return LoadJsService.loadSequence("privacyPolicyCtrl");
  371. }
  372. }
  373. })
  374. .state('registePolicy', {
  375. cache: false,
  376. url: '/registePolicy',
  377. templateUrl: 'modules/login/views/registePolicy.html',
  378. controller: 'registePolicyCtrl',
  379. resolve: {
  380. registePolicy: function (LoadJsService) {
  381. return LoadJsService.loadSequence("registePolicyCtrl");
  382. }
  383. }
  384. })
  385. /*创建标准权限(文件夹)*/
  386. .state('authorityCreate', {
  387. cache: false,
  388. url: '/authorityCreate',
  389. templateUrl: 'modules/cloudAuthority/views/authorityCreate.html',
  390. controller: 'authorityCreateCtrl',
  391. resolve: {
  392. authorityCreate: function (LoadJsService) {
  393. return LoadJsService.loadSequence("authorityCreateCtrl");
  394. }
  395. },
  396. params: {localparentid: "0", authorityid: 0, authoritycomefrom: "", parentid: 0, level: -1, templettype:1}
  397. })
  398. /*创建标准权限(文件夹)*/
  399. .state('authorityResourceCreate', {
  400. cache: false,
  401. url: '/authorityResourceCreate',
  402. templateUrl: 'modules/cloudAuthority/views/authorityResourceCreate.html',
  403. controller: 'authorityResourceCreateCtrl',
  404. resolve: {
  405. authorityResourceCreate: function (LoadJsService) {
  406. return LoadJsService.loadSequence("authorityResourceCreateCtrl");
  407. }
  408. },
  409. params: {authoritydata: {}}
  410. })
  411. /*设置标准权限(记录/资源)*/
  412. .state('authorityRecordSet', {
  413. cache: false,
  414. url: '/authorityRecordSet',
  415. templateUrl: 'modules/cloudAuthority/views/authorityRecordSet.html',
  416. controller: 'authorityRecordSetCtrl',
  417. resolve: {
  418. authorityRecordSet: function (LoadJsService) {
  419. return LoadJsService.loadSequence("authorityRecordSetCtrl");
  420. }
  421. },
  422. params: {authoritydata: {}}
  423. })
  424. /*设置标准权限(文件夹/资源库)*/
  425. .state('authoritySet', {
  426. cache: false,
  427. url: '/authoritySet',
  428. templateUrl: 'modules/cloudAuthority/views/authoritySet.html',
  429. controller: 'authoritySetCtrl',
  430. resolve: {
  431. authoritySet: function (LoadJsService) {
  432. return LoadJsService.loadSequence("authoritySetCtrl");
  433. }
  434. },
  435. params: {
  436. reclibid: 0,
  437. authorityid: 0,
  438. authoritycomefrom: "",
  439. name: "",
  440. content: "",
  441. sort: 0,
  442. goflg: 0,
  443. type: 1,
  444. parentid: 0
  445. }
  446. })
  447. /*设置文件夹/资源库(有可能涉及权限)*/
  448. .state('authorityLocalSet', {
  449. cache: false,
  450. url: '/authorityLocalSet',
  451. templateUrl: 'modules/cloudAuthority/views/authorityLocalSet.html',
  452. controller: 'authorityLocalSetCtrl',
  453. resolve: {
  454. authorityLocalSet: function (LoadJsService) {
  455. return LoadJsService.loadSequence("authorityLocalSetCtrl");
  456. }
  457. },
  458. params: {authoritydata: {}, type: 0, goflg: 0}
  459. })
  460. /*标准权限组成员列表(文件夹)*/
  461. .state('authorityFolderMember', {
  462. cache: true,
  463. url: '/authorityFolderMember',
  464. templateUrl: 'modules/cloudAuthority/views/authorityFolderMember.html',
  465. controller: 'authorityFolderMemberCtrl',
  466. resolve: {
  467. authorityFolderMember: function (LoadJsService) {
  468. return LoadJsService.loadSequence("authorityFolderMemberCtrl");
  469. }
  470. },
  471. params: {identity: 0, authid: 0, authcomefrom: 0}
  472. })
  473. /*标准权限组成员列表*/
  474. .state('authorityMember', {
  475. cache: true,
  476. url: '/authorityMember',
  477. templateUrl: 'modules/cloudAuthority/views/authorityMember.html',
  478. controller: 'authorityMemberCtrl',
  479. resolve: {
  480. authorityMember: function (LoadJsService) {
  481. return LoadJsService.loadSequence("authorityMemberCtrl");
  482. }
  483. },
  484. params: {identity: 0, authid: 0, authcomefrom: 0}
  485. })
  486. /*标准权限组添加成员页面*/
  487. .state('authorityAddMember', {
  488. cache: false,
  489. url: '/authorityAddMember',
  490. templateUrl: 'modules/cloudAuthority/views/authorityAddMember.html',
  491. controller: 'authorityAddMemberCtrl',
  492. resolve: {
  493. authorityAddMember: function (LoadJsService) {
  494. return LoadJsService.loadSequence("authorityAddMemberArgs");
  495. }
  496. },
  497. params: {authid: 0, authcomefrom: 0}
  498. })
  499. /*标准权限组设置管理员*/
  500. .state('authoritySetManger', {
  501. cache: false,
  502. url: '/authoritySetManger',
  503. templateUrl: 'modules/cloudAuthority/views/authoritySetManger.html',
  504. controller: 'authoritySetMangerCtrl',
  505. resolve: {
  506. authoritySetManger: function (LoadJsService) {
  507. return LoadJsService.loadSequence("authoritySetMangerCtrl");
  508. }
  509. },
  510. params: {identity: 0, adminlist: [], memberlist: []}
  511. })
  512. /*标准权限组转让所有权*/
  513. .state('authoritySetOwner', {
  514. cache: false,
  515. url: '/authoritySetOwner',
  516. templateUrl: 'modules/cloudAuthority/views/authoritySetOwner.html',
  517. controller: 'authoritySetOwnerCtrl',
  518. resolve: {
  519. authoritySetOwner: function (LoadJsService) {
  520. return LoadJsService.loadSequence("authoritySetOwnerCtrl");
  521. }
  522. },
  523. params: {identity: 0}
  524. })
  525. /*用户搜索*/
  526. .state('userSearch', {
  527. cache: false,
  528. url: '/userSearch',
  529. templateUrl: 'modules/cloudAuthority/views/userSearch.html',
  530. controller: 'userSearchCtrl',
  531. resolve: {
  532. userSearch: function (LoadJsService) {
  533. return LoadJsService.loadSequence("userSearchArgs");
  534. }
  535. },
  536. params: {searchtype: 0, isset: 0, authorityid: 0, authoritycomefrom: 0, modeltype: 0}
  537. })
  538. /*标准权限组成员列表*/
  539. .state('authorityAddSuperAdmin', {
  540. cache: false,
  541. url: '/authorityAddSuperAdmin',
  542. templateUrl: 'modules/cloudAuthority/views/authorityAddSuperAdmin.html',
  543. controller: 'authorityAddSuperAdminCtrl',
  544. resolve: {
  545. authorityAddSuperAdmin: function (LoadJsService) {
  546. return LoadJsService.loadSequence("authorityAddSuperAdminCtrl");
  547. }
  548. }
  549. })
  550. // 其他首页入口
  551. $urlRouterProvider.otherwise('/tab/activityIndex');
  552. //溧水网站
  553. // $urlRouterProvider.otherwise('/homepageOfNode');
  554. var datePickerObj = {
  555. inputDate: new Date(),
  556. titleLabel: '选择日期',
  557. setLabel: '确定',
  558. todayLabel: '今天',
  559. closeLabel: '关闭',
  560. mondayFirst: false,
  561. weeksList: ["日", "一", "二", "三", "四", "五", "六"],
  562. monthsList: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
  563. templateType: 'popup',
  564. from: new Date(1970, 1, 1),
  565. to: new Date(2050, 8, 1),
  566. showTodayButton: true,
  567. dateFormat: 'yyyy-MM-dd',
  568. closeOnSelect: false,
  569. disableWeekdays: []
  570. };
  571. ionicDatePickerProvider.configDatePicker(datePickerObj);
  572. }])
  573. .run(function($rootScope, $templateCache) {
  574. $rootScope.$on('$routeChangeStart', function(event, next, current) {
  575. if (typeof(current) !== 'undefined'){
  576. $templateCache.remove(current.templateUrl);
  577. }
  578. });
  579. });