accountCtrl.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. angular.module('push')
  2. .controller('AccountCtrl', function ($scope, $ionicPopup, ResourceLibraryService, AccountService, UserService, ConfigService,
  3. accountModel, homepageOfNodeService, LoginService, CommentService, UtilService, ConstantService, CommonService, $ionicModal, $ionicLoading) {
  4. document.title = '个人中心';
  5. if (UserService.defaultLan == 'English') {
  6. document.title = 'My Center';
  7. }
  8. $scope.defaultLan = UserService.defaultLan;
  9. //TODO
  10. if ($scope.app) {
  11. $scope.setStatusBar(1);
  12. }
  13. $scope.node = UserService.node;
  14. homepageOfNodeService.getNodeAuth($scope.node).then(function (res) {
  15. $scope.isUserManager = res.data;
  16. })
  17. $scope.comfromWeb = sessionStorage.comfrom == 'web';
  18. //季报分析
  19. $scope.quarterlyAnalysis = function () {
  20. $scope.go("quarterlyAnalysis");
  21. }
  22. //取用户id,判断是否登录
  23. var userId = UserService.id;
  24. $scope.islogin = ConfigService.islogin;
  25. // console.log(ConfigService.islogin);
  26. var authenstatus = 0;//认证状态:0未认证 1认证中 2已认证
  27. /*
  28. // 获取是否有新的系统消息
  29. var getMyMessageFlg = function () {
  30. LoginService.getMyMessageFlg().then(function (response) {
  31. }, function () {
  32. })
  33. };
  34. getMyMessageFlg();
  35. */
  36. var sellevcol = function () {
  37. if ($scope.viplevel == 3) {
  38. $scope.levcol = "starRating_G";
  39. return;
  40. }
  41. if ($scope.pushvalue >= 200 && $scope.pushvalue < 500) {
  42. $scope.levcol = "starRating_A";
  43. return;
  44. }
  45. if ($scope.pushvalue >= 500 && $scope.pushvalue < 1000) {
  46. $scope.levcol = "starRating_B";
  47. return;
  48. }
  49. if ($scope.pushvalue >= 1000 && $scope.pushvalue < 1500) {
  50. $scope.levcol = "starRating_C";
  51. return;
  52. }
  53. if ($scope.pushvalue >= 1500 && $scope.pushvalue < 3500) {
  54. $scope.levcol = "starRating_D";
  55. return;
  56. }
  57. if ($scope.pushvalue >= 3500 && $scope.pushvalue < 8000) {
  58. $scope.levcol = "starRating_E";
  59. return;
  60. }
  61. if ($scope.pushvalue >= 8000) {
  62. $scope.levcol = "starRating_F";
  63. }
  64. };
  65. // 获取登录用户信息
  66. $scope.getUserInfo = function () {
  67. AccountService.getUserInfo().then(function (response) {
  68. console.log('response', response)
  69. if (response.code == ConstantService.INTERFACE_STATUS_CODE_3350 && response.data.userid != 0) {
  70. // console.log(response);
  71. UserService.user = response.data;
  72. $scope.user = response.data;
  73. UserService.id = response.data.userid;
  74. UserService.role = response.data.userRoleList;
  75. // 普适积分
  76. $scope.pushintegral = response.data.pushIntegralModel ? response.data.pushIntegralModel.sysUsersPushvalue.pushintegral : null;
  77. // 普适值
  78. $scope.pushvalue = response.data.pushIntegralModel ? response.data.pushIntegralModel.sysUsersPushvalue.pushvalue : null;
  79. /*
  80. 会员信息,暂时隐藏
  81. $scope.viplevel = UserService.viplevel = response.member.memberid;
  82. sellevcol();
  83. // 签到
  84. // $scope.issign = response.member.issign;
  85. authenstatus = response.member.authenstatus;
  86. UserService.ishaspaypassword = response.member.ishaspaypassword;//是否设置过付款密码
  87. ConfigService.mychannellist = response.channelList;
  88. */
  89. ConfigService.comefrom = response.data.comefrom;
  90. //UserService.node = response.data.comefrom;
  91. if (response.data.node && UtilService.isDefined(response.data.node.nodename)) {
  92. //UserService.nodename = response.data.node.nodename;
  93. }
  94. $scope.personalLabels = [];
  95. if (response.otherObj && response.otherObj.length > 0) {
  96. angular.forEach(response.otherObj, function (val) {
  97. switch (val.labelKey) {
  98. case '4800':
  99. $scope.personalLabels.push({ class: 'iconfont-individual', title: val.labelName });
  100. break;
  101. case '4801':
  102. $scope.personalLabels.push({ class: 'iconfont-talents', title: val.labelName });
  103. break;
  104. case '4803':
  105. $scope.personalLabels.push({ class: 'iconfont-enterprise', title: val.labelName });
  106. break;
  107. case '4804':
  108. $scope.personalLabels.push({ class: 'iconfont-colleges', title: val.labelName });
  109. break;
  110. case '4805':
  111. $scope.personalLabels.push({ class: 'iconfont-government', title: val.labelName });
  112. break;
  113. case '4806':
  114. $scope.personalLabels.push({ class: 'iconfont-service', title: val.labelName });
  115. break;
  116. case 'scoreTotal':
  117. $scope.stars = Math.round(val.labelName);
  118. break;
  119. }
  120. })
  121. }
  122. // console.log($scope.stars);
  123. }
  124. //用户没有登陆
  125. if (response.data.userid == 0) {
  126. $scope.islogin = false;
  127. }
  128. }, function () {
  129. //$scope.user = UserService.user;
  130. });
  131. };
  132. $scope.getUserInfo();
  133. $scope.range = function (n) {
  134. return new Array(n);
  135. }
  136. //日志权限
  137. var logdata = { node: UserService.node, uid: localStorage.uid }
  138. AccountService.getLogAuthority(logdata).then(function (res) {
  139. console.log(res)
  140. if (res.code == 3350) {
  141. $scope.logAuth = res.data.isHighestAuth
  142. }
  143. })
  144. // 获取登录用户是否签到
  145. $scope.isSignInfo = function () {
  146. AccountService.getSignInfo().then(function (response) {
  147. if (response.data.length > 0) {
  148. $scope.issign = 1;
  149. } else {
  150. $scope.issign = 0;
  151. }
  152. }, function () {
  153. });
  154. };
  155. $scope.isSignInfo();
  156. //签到
  157. $scope.signIn = function () {
  158. $scope.showLoadingToast();
  159. CommentService.signIn().then(function () {
  160. $scope.issign = 1;
  161. $scope.pushvalue = UtilService.isDefined($scope.pushvalue) ? $scope.pushvalue + 1 : 1;
  162. sellevcol();
  163. $scope.hideLoadingToast();
  164. }, function () {
  165. if ($scope.app) {
  166. UtilService.showMess("网络不给力,请重试");
  167. } else {
  168. CommonService.showMessage('网络不给力,请重试', $scope);
  169. }
  170. $scope.hideLoadingToast();
  171. });
  172. };
  173. $scope.goPublisher = function () {
  174. $scope.go('publisher', { Id: userId });
  175. };
  176. $scope.goMyFav = function () {
  177. $scope.go('myfav');
  178. };
  179. $scope.goMyCollection = function () {
  180. //TODO
  181. $scope.islogin = ConfigService.islogin;
  182. if (!$scope.islogin) {
  183. if (localStorage.wxFlag == "true") {
  184. if (localStorage.isUserFocusXW == 0) {
  185. var title = localStorage.appidStr;
  186. $ionicPopup.alert({
  187. title: '提示',
  188. template: '请先关注微信公众号"' + title + '"!'
  189. });
  190. return;
  191. } else {
  192. if (localStorage.isUserBindWx == 0) {
  193. var wxFlag = JSON.parse(localStorage.params);
  194. if (wxFlag.weChatModel) {
  195. $scope.go('bindPhone', {
  196. params: localStorage.params,
  197. comfrom: 'maincontroller',
  198. url: window.location.href.split('#/')[1]
  199. });
  200. } else {
  201. $scope.go('login');
  202. return;
  203. }
  204. } else {
  205. $scope.go('login');
  206. return;
  207. }
  208. }
  209. } else {
  210. $scope.go('login');
  211. return;
  212. }
  213. } else {
  214. $scope.go('mycollection');
  215. }
  216. };
  217. $scope.goMyMessage = function () {
  218. accountModel.setMyMessageTabIndex(0);
  219. $scope.islogin = ConfigService.islogin;
  220. if (!$scope.islogin) {
  221. if (localStorage.wxFlag == "true") {
  222. if (localStorage.isUserFocusXW == 0) {
  223. var title = localStorage.appidStr;
  224. $ionicPopup.alert({
  225. title: '提示',
  226. template: '请先关注微信公众号"' + title + '"!'
  227. });
  228. return;
  229. } else {
  230. if (localStorage.isUserBindWx == 0) {
  231. var wxFlag = JSON.parse(localStorage.params);
  232. if (wxFlag.weChatModel) {
  233. $scope.go('bindPhone', {
  234. params: localStorage.params,
  235. comfrom: 'maincontroller',
  236. url: window.location.href.split('#/')[1]
  237. });
  238. } else {
  239. $scope.go('login');
  240. return;
  241. }
  242. } else {
  243. $scope.go('login');
  244. return;
  245. }
  246. }
  247. } else {
  248. $scope.go('login');
  249. return;
  250. }
  251. } else {
  252. $scope.go('mymessage');
  253. }
  254. };
  255. $scope.goSet = function () {
  256. $scope.go('set');
  257. };
  258. $scope.golog = function () {
  259. $scope.go('log');
  260. };
  261. $scope.goImport = function () {
  262. $scope.go('Import');
  263. }
  264. $scope.goBusinessdata = function () {
  265. $scope.go('Businessdata');
  266. }
  267. $scope.goTeclcontract = function () {
  268. $scope.go('Teclcontract');
  269. }
  270. $scope.goMyPublish = function () {
  271. accountModel.setPublishTabIndex(0);
  272. $scope.go('myPublish');
  273. };
  274. $scope.goQualify = function () {
  275. $scope.islogin = ConfigService.islogin;
  276. if (!$scope.islogin) {
  277. if (localStorage.wxFlag == "true") {
  278. if (localStorage.isUserFocusXW == 0) {
  279. var title = localStorage.appidStr;
  280. $ionicPopup.alert({
  281. title: '提示',
  282. template: '请先关注微信公众号"' + title + '"!'
  283. });
  284. return;
  285. } else {
  286. if (localStorage.isUserBindWx == 0) {
  287. var wxFlag = JSON.parse(localStorage.params);
  288. if (wxFlag.weChatModel) {
  289. $scope.go('bindPhone', {
  290. params: localStorage.params,
  291. comfrom: 'maincontroller',
  292. url: window.location.href.split('#/')[1]
  293. });
  294. } else {
  295. $scope.go('login');
  296. return;
  297. }
  298. } else {
  299. $scope.go('login');
  300. return;
  301. }
  302. }
  303. } else {
  304. $scope.go('login');
  305. return;
  306. }
  307. } else {
  308. // $scope.showAnthorBtnWrap=true;
  309. // getRolePageList();
  310. // $("ion-nav-view[name='tab-activityIndex']").css("z-index","8");
  311. if (authenstatus == 0 || authenstatus == 3) {
  312. // $scope.go('personIdentify');
  313. $scope.go('identifySystem');
  314. accountModel.setInfoImageList([]);
  315. accountModel.setUserAuthInfo({});
  316. } else {
  317. $scope.go('successIdentify');
  318. }
  319. }
  320. };
  321. $scope.hasAuth = false;
  322. ResourceLibraryService.judgeManager(UserService.id, 10501).then(function (res) {
  323. // console.log(res);
  324. $scope.hasAuth = res.data;
  325. })
  326. //进入我的审核页面
  327. $scope.goMyCheckView = function () {
  328. if (!$scope.islogin) {
  329. if (localStorage.wxFlag == "true") {
  330. if (localStorage.isUserFocusXW == 0) {
  331. var title = localStorage.appidStr;
  332. $ionicPopup.alert({
  333. title: '提示',
  334. template: '请先关注微信公众号"' + title + '"!'
  335. });
  336. return;
  337. } else {
  338. if (localStorage.isUserBindWx == 0) {
  339. var wxFlag = JSON.parse(localStorage.params);
  340. if (wxFlag.weChatModel) {
  341. $scope.go('bindPhone', {
  342. params: localStorage.params,
  343. comfrom: 'maincontroller',
  344. url: window.location.href.split('#/')[1]
  345. });
  346. } else {
  347. $scope.go('login');
  348. return;
  349. }
  350. } else {
  351. $scope.go('login');
  352. return;
  353. }
  354. }
  355. } else {
  356. $scope.go('login');
  357. return;
  358. }
  359. } else {
  360. $scope.go('myCheck');
  361. }
  362. }
  363. $scope.goCenter = function () {
  364. if ($scope.app) {
  365. UtilService.showMess("功能正在完善中,敬请期待!");
  366. } else {
  367. CommonService.showMessage("功能正在完善中,敬请期待!", $scope)
  368. }
  369. /* if (authenstatus == 0) {
  370. $ionicPopup.show({
  371. title: '提示',
  372. template: '请先去认证中心认证才可以成为会员',
  373. buttons: [
  374. {
  375. text: '<span class="ionicAction_span">去认证</span>',
  376. type: "button-positive",
  377. onTap: function (e) {
  378. $scope.go('personIdentify');
  379. accountModel.setUserAuthInfo({});
  380. accountModel.setInfoImageList([]);
  381. }
  382. }
  383. ]
  384. });
  385. }
  386. if (authenstatus == 1) {
  387. $ionicPopup.show({
  388. title: '提示',
  389. template: '<span style="display:inline-block;height: 40px;line-height: 20px;width: 100%;text-align: center;">您的信息已在认证中</span>',
  390. buttons: [
  391. {
  392. text: '<span class="ionicAction_span">知道了</span>',
  393. type: "button-positive",
  394. onTap: function (e) {
  395. }
  396. }
  397. ]
  398. });
  399. }
  400. if (authenstatus == 2) {
  401. $scope.go("memberHome");
  402. }
  403. if (authenstatus == 3) {
  404. $ionicPopup.show({
  405. title: '提示',
  406. template: '您的信息认证失败',
  407. buttons: [
  408. {
  409. text: '<span class="ionicAction_span">去查看</span>',
  410. type: "button-positive",
  411. onTap: function (e) {
  412. $scope.go('personIdentify');
  413. accountModel.setUserAuthInfo({});
  414. accountModel.setInfoImageList([]);
  415. }
  416. }
  417. ]
  418. });
  419. }*/
  420. };
  421. $scope.goPushCurrency = function () {
  422. $scope.islogin = ConfigService.islogin;
  423. if (!$scope.islogin) {
  424. if (localStorage.wxFlag == "true") {
  425. if (localStorage.isUserFocusXW == 0) {
  426. var title = localStorage.appidStr;
  427. $ionicPopup.alert({
  428. title: '提示',
  429. template: '请先关注微信公众号"' + title + '"!'
  430. });
  431. return;
  432. } else {
  433. if (localStorage.isUserBindWx == 0) {
  434. var wxFlag = JSON.parse(localStorage.params);
  435. if (wxFlag.weChatModel) {
  436. $scope.go('bindPhone', {
  437. params: localStorage.params,
  438. comfrom: 'maincontroller',
  439. url: window.location.href.split('#/')[1]
  440. });
  441. } else {
  442. $scope.go('login');
  443. return;
  444. }
  445. } else {
  446. $scope.go('login');
  447. return;
  448. }
  449. }
  450. } else {
  451. $scope.go('login');
  452. return;
  453. }
  454. } else {
  455. $scope.go("psMoneyHome");
  456. }
  457. };
  458. $scope.updateUserPassword = function () {
  459. $scope.islogin = ConfigService.islogin;
  460. if (!$scope.islogin) {
  461. if (localStorage.wxFlag == "true") {
  462. if (localStorage.isUserFocusXW == 0) {
  463. var title = localStorage.appidStr;
  464. $ionicPopup.alert({
  465. title: '提示',
  466. template: '请先关注微信公众号"' + title + '"!'
  467. });
  468. return;
  469. } else {
  470. if (localStorage.isUserBindWx == 0) {
  471. var wxFlag = JSON.parse(localStorage.params);
  472. if (wxFlag.weChatModel) {
  473. $scope.go('bindPhone', {
  474. params: localStorage.params,
  475. comfrom: 'maincontroller',
  476. url: window.location.href.split('#/')[1]
  477. });
  478. } else {
  479. $scope.go('login');
  480. return;
  481. }
  482. } else {
  483. $scope.go('login');
  484. return;
  485. }
  486. }
  487. } else {
  488. $scope.go('login');
  489. return;
  490. }
  491. } else {
  492. $scope.go("updatePsd", { password: UserService.user.password });
  493. }
  494. }
  495. //加载动画
  496. $scope.showLoadingToast = function () {
  497. $ionicLoading.show({
  498. template: '<p><ion-spinner icon="bubbles" class="spinner-calm"></ion-spinner><br><span style="color: #3B8BD0;font-size: 18px;font-weight: bold">努力加载中···</span></p>',
  499. content: '努力加载中',
  500. animation: 'fade-in',
  501. showBackdrop: true,//是否显示蒙层
  502. maxWidth: 150,
  503. showDelay: 0
  504. });
  505. // $timeout(function () {
  506. // $ionicLoading.hide();
  507. // }, 15000);
  508. };
  509. //通知助手
  510. $scope.informAssitant = function () {
  511. $scope.showLoadingToast();
  512. ResourceLibraryService.getSmsList().then(function (res) {
  513. if (res.code == 3350) {
  514. if (res.data.length > 0) {
  515. $scope.go("noticeHelper", { list: res.data });
  516. } else {
  517. $scope.hideLoadingToast();
  518. $scope.go("newMessagePage");
  519. }
  520. }
  521. })
  522. }
  523. $scope.goWhere = function (index) {
  524. if (!$scope.islogin) {
  525. if (localStorage.wxFlag == "true") {
  526. if (localStorage.isUserFocusXW == 0) {
  527. var title = localStorage.appidStr;
  528. $ionicPopup.alert({
  529. title: '提示',
  530. template: '请先关注微信公众号"' + title + '"!'
  531. });
  532. return;
  533. } else {
  534. if (localStorage.isUserBindWx == 0) {
  535. var wxFlag = JSON.parse(localStorage.params);
  536. if (wxFlag.weChatModel) {
  537. $scope.go('bindPhone', {
  538. params: localStorage.params,
  539. comfrom: 'maincontroller',
  540. url: window.location.href.split('#/')[1]
  541. });
  542. } else {
  543. $scope.go('login');
  544. return;
  545. }
  546. } else {
  547. $scope.go('login');
  548. return;
  549. }
  550. }
  551. } else {
  552. $scope.go('login');
  553. return;
  554. }
  555. } else {
  556. switch (index) {
  557. case 1:
  558. $scope.go('technicalBrokerEnterCompanyInfo', { comfrom: 'tab.account' });
  559. break;
  560. case 2:
  561. $scope.go('taskHoll', { comfrom: 'tab.account' });
  562. break;
  563. case 3:
  564. $scope.go('activitiesHoll', { comfrom: 'tab.account' });
  565. break;
  566. }
  567. }
  568. };
  569. //$scope.loginModelPublic();
  570. $scope.loginModelShow = function () {
  571. if (localStorage.wxFlag == "true") {
  572. if (localStorage.isUserFocusXW == 0) {
  573. var title = localStorage.appidStr;
  574. $ionicPopup.alert({
  575. title: '提示',
  576. template: '请先关注微信公众号"' + title + '"!'
  577. });
  578. return;
  579. } else {
  580. if (localStorage.isUserBindWx == 0) {
  581. var wxFlag = JSON.parse(localStorage.params);
  582. if (wxFlag.weChatModel) {
  583. $scope.go('bindPhone', {
  584. params: localStorage.params,
  585. comfrom: 'maincontroller',
  586. url: window.location.href.split('#/')[1]
  587. });
  588. } else {
  589. $scope.go('login');
  590. return;
  591. }
  592. } else {
  593. $scope.go('login');
  594. return;
  595. }
  596. }
  597. } else {
  598. $scope.go('login');
  599. return;
  600. }
  601. };
  602. $scope.hideModel = function () {
  603. $scope.selCom.hide();
  604. };
  605. $scope.registerHideModel = function () {
  606. //$scope.selCom.hide();
  607. $scope.go('register');
  608. };
  609. //跳转到关注用户
  610. $scope.jumpToFancenter = function (act) {
  611. if (!$scope.islogin) {
  612. if (localStorage.wxFlag == "true") {
  613. if (localStorage.isUserFocusXW == 0) {
  614. var title = localStorage.appidStr;
  615. $ionicPopup.alert({
  616. title: '提示',
  617. template: '请先关注微信公众号"' + title + '"!'
  618. });
  619. return;
  620. } else {
  621. if (localStorage.isUserBindWx == 0) {
  622. var wxFlag = JSON.parse(localStorage.params);
  623. if (wxFlag.weChatModel) {
  624. $scope.go('bindPhone', {
  625. params: localStorage.params,
  626. comfrom: 'maincontroller',
  627. url: window.location.href.split('#/')[1]
  628. });
  629. } else {
  630. $scope.go('login');
  631. return;
  632. }
  633. } else {
  634. $scope.go('login');
  635. return;
  636. }
  637. }
  638. } else {
  639. $scope.go('login');
  640. return;
  641. }
  642. } else {
  643. $scope.go("fancenter", { act: act, userid: $scope.user.userid });
  644. }
  645. };
  646. $ionicModal.fromTemplateUrl('./modules/common/views/myReleaseModal.html', {
  647. scope: $scope,
  648. animation: 'slide-in-left'
  649. }).then(function (modal) {
  650. $scope.myRelease = modal;
  651. });
  652. $scope.getMyRelease = function () {
  653. $scope.islogin = ConfigService.islogin;
  654. if (!$scope.islogin) {
  655. if (localStorage.wxFlag == "true") {
  656. if (localStorage.isUserFocusXW == 0) {
  657. var title = localStorage.appidStr;
  658. $ionicPopup.alert({
  659. title: '提示',
  660. template: '请先关注微信公众号"' + title + '"!'
  661. });
  662. return;
  663. } else {
  664. if (localStorage.isUserBindWx == 0) {
  665. var wxFlag = JSON.parse(localStorage.params);
  666. if (wxFlag.weChatModel) {
  667. $scope.go('bindPhone', {
  668. params: localStorage.params,
  669. comfrom: 'maincontroller',
  670. url: window.location.href.split('#/')[1]
  671. });
  672. } else {
  673. $scope.go('login');
  674. return;
  675. }
  676. } else {
  677. $scope.go('login');
  678. return;
  679. }
  680. }
  681. } else {
  682. $scope.go('login');
  683. return;
  684. }
  685. } else {
  686. $scope.myRelease.show();
  687. $scope.allMyRelease = [];
  688. AccountService.releaseResource(UserService.id).then(function (res) {
  689. // console.log(res);
  690. if (res.code == 3350) {
  691. angular.forEach(res.data, function (val, index) {
  692. if (val.list.length > 0) {
  693. val.active = index == 0;
  694. $scope.allMyRelease.push(val);
  695. }
  696. })
  697. }
  698. $scope.allList = $scope.allMyRelease[0];
  699. })
  700. }
  701. };
  702. var currentIndex = 0;
  703. $scope.changeActiveTitle = function (index) {
  704. currentIndex = index;
  705. angular.forEach($scope.allMyRelease, function (val) {
  706. val.active = false;
  707. });
  708. $scope.allMyRelease[index].active = true;
  709. $scope.allList = $scope.allMyRelease[index];
  710. };
  711. $scope.goResourceDetail = function (resource) {
  712. // console.log(resource);
  713. $scope.go($scope.allMyRelease[currentIndex].type, {
  714. node: resource.node || resource.source,
  715. orgtype: resource.orgtype,
  716. pagecode: resource.pagecode,
  717. resid: resource.resid || resource.unique || resource.connid,
  718. templettype: resource.templettype,
  719. comfrom: 'publisher',
  720. actions: resource.otherObj.actions,
  721. title: resource.title,
  722. restype: resource.type,
  723. ifjoin: resource.otherObj.ifjoin,
  724. taskstatus: resource.otherObj.taskstatus,
  725. taskid: resource.otherObj.id,
  726. opentowho: resource.otherObj.opentowho,
  727. activityid: resource.id,
  728. recourceid: resource.unique,
  729. recourcetype: resource.type,
  730. recourcecomefrom: resource.source,
  731. creator: resource.clickthrough,
  732. })
  733. }
  734. });