activityIndexCtrl.js 97 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534
  1. angular.module('push')
  2. .controller('activityIndexCtrl', function ($scope, $state, $compile, $rootScope, $timeout, HomeService, ActivityService, $ionicScrollDelegate, $ionicSlideBoxDelegate,
  3. UtilService, HandleService, homepageOfNodeService, UserService, ConfigService, resourceLibraryTempData, roleService, $ionicModal, dataToolsService, taskModuleService, CommonService, $ionicPopup, ResourceLibraryService, $stateParams, AccountService) {
  4. $scope.node = UserService.node;
  5. //加载等待页
  6. $scope.isloadingPageFloor = true;
  7. if ($scope.app) {
  8. if (localStorage.getItem("firstInitApp") == 0) {
  9. $scope.guidePageCom.show();
  10. }
  11. }
  12. var scrollFunc = function () {
  13. if (ionic.scroll.lastTop > 440) {
  14. $scope.addtransparent = true
  15. } else {
  16. $scope.addtransparent = false
  17. }
  18. }
  19. console.log("----------", $scope.ddd)
  20. //给页面绑定滑轮滚动事件
  21. if (document.addEventListener) { //firefox
  22. document.addEventListener('DOMMouseScroll', scrollFunc, false);
  23. }
  24. //滚动滑轮触发scrollFunc方法 //ie 谷歌
  25. var move = 'ontouchmove' in document ? 'touchmove' : 'onmousewheel'
  26. if ('ontouchmove' in document) {
  27. window.ontouchmove = document.ontouchmove = scrollFunc;
  28. } else {
  29. window.onmousewheel = document.onmousewheel = scrollFunc;
  30. }
  31. //跳转引导页(如果用户第一次登陆app就显示),
  32. // if ($scope.app) {
  33. // $rootScope.db.transaction(function (tx) {
  34. // tx.executeSql('SELECT count(*) AS mycount FROM guidepage', [], function (tx, rs) {
  35. // if (rs.rows.item(0).mycount == 0) {
  36. // //如果为0的话就意味着是第一次登陆
  37. // $scope.guidePageCom.show();
  38. // }
  39. // }, function (tx, error) {
  40. // console.log('SELECT error: ' + error.message);
  41. // });
  42. // });
  43. // }
  44. $scope.platformname = UserService.nodename;
  45. $scope.defaultLan = UserService.defaultLan;
  46. // 获取溧阳token
  47. var arr1 = window.location.href.split('token=');
  48. if (arr1[1]) {
  49. var arr2 = arr1[1].split('#/');
  50. var token = arr2[0];
  51. ActivityService.liyangLogin(token).then(function (res) {
  52. // console.log(res);
  53. if (res.code == 3350) {
  54. ConfigService.islogin = true;
  55. $scope.islogin = true;
  56. localStorage.setItem("mobile", res.data.mobile);
  57. //存储密码用作自动登录
  58. localStorage.setItem("password", res.data.password);
  59. UserService.id = res.data.userid;
  60. AccountService.getUserInfo().then(function (response) {
  61. UserService.user = response.data;
  62. UserService.role = response.data.userRoleList;
  63. })
  64. }
  65. })
  66. }
  67. // console.log($stateParams);
  68. document.title = UserService.nodename;
  69. $scope.showtask = UserService.node != '320481000';
  70. if ($scope.isLiyangApp) {
  71. // $(".tab_hide").hide();
  72. localStorage.showNoticeMask = true;
  73. }
  74. //TODO
  75. if ($scope.app) {
  76. $scope.setStatusBar(1);
  77. }
  78. $scope.$on("$ionicView.beforeEnter", function () {
  79. //TODO
  80. if ($scope.app) {
  81. $scope.setStatusBar(1);
  82. }
  83. });
  84. var sysUsersInfo = {};
  85. $scope.islogin = ConfigService.islogin;
  86. // if (device.platform != "Android") {
  87. // if (flg == 0) {
  88. // StatusBar.styleDefault();//黑色
  89. // } else {
  90. // StatusBar.styleLightContent();//白色
  91. // }
  92. // }
  93. // 保存节点信息
  94. if (localStorage.node) {
  95. UserService.node = localStorage.node;
  96. UserService.nodename = localStorage.nodename;
  97. } else {
  98. if (!$scope.isLiyangApp && !$scope.isWujingApp) {
  99. $scope.go('chooseNodeIndex');
  100. }
  101. }
  102. // 轮播
  103. var hasSwipe = true;
  104. var mySwiper;
  105. var startSwipe = function () {
  106. mySwiper = new Swiper('.swiper-container', {
  107. slidesPerView: 'auto',
  108. grabCursor: true,
  109. centeredSlides: true,
  110. loop: true,
  111. autoplay: {
  112. delay: 10000,
  113. disableOnInteraction: false,
  114. },
  115. on: {
  116. tap: function (e) {
  117. if (this.clickedIndex % 4 == 0 || this.clickedIndex == 0) {
  118. if (UserService.node == "320412000") {
  119. $scope.go("academician");
  120. }
  121. if (UserService.node == "320481000") {
  122. $scope.go("suzheng");
  123. }
  124. } else if ((this.clickedIndex % 5 == 0 || this.clickedIndex == 1) && (localStorage.node == '320412000')) {
  125. if (!ConfigService.islogin) {
  126. if (localStorage.wxFlag == "true") {
  127. if (localStorage.isUserFocusXW == 0) {
  128. var title = localStorage.appidStr;
  129. $ionicPopup.alert({
  130. title: '提示',
  131. template: '请先关注微信公众号"' + title + '"!'
  132. });
  133. return;
  134. } else {
  135. if (localStorage.isUserBindWx == 0) {
  136. var wxFlag = JSON.parse(localStorage.params);
  137. if (wxFlag.weChatModel) {
  138. $scope.go('bindPhone', {
  139. params: localStorage.params,
  140. comfrom: 'maincontroller',
  141. url: window.location.href.split('#/')[1]
  142. });
  143. } else {
  144. $scope.go('login');
  145. return;
  146. }
  147. } else {
  148. $scope.go('login');
  149. return;
  150. }
  151. }
  152. } else {
  153. $scope.go('login');
  154. return;
  155. }
  156. return;
  157. }
  158. if (sysUsersInfo.authenstatus == 5100) {
  159. $scope.go('identifyForm', {
  160. pageTitle: '技术经纪人',
  161. code: 4801,
  162. type: sysUsersInfo.authenstatus,
  163. id: sysUsersInfo.id,
  164. action: 'submit',
  165. comfrom: 'tab.activityIndex'
  166. });
  167. } else {
  168. $scope.go('identifyStatus', {
  169. pageTitle: '技术经纪人',
  170. code: 4801,
  171. type: sysUsersInfo.authenstatus,
  172. id: sysUsersInfo.id,
  173. action: 'submit',
  174. comfrom: 'tab.activityIndex'
  175. });
  176. }
  177. } else {
  178. $scope.go('bannerContent')
  179. }
  180. }
  181. }
  182. })
  183. // mySwiper.updateProgress();
  184. }
  185. // $scope.showLoadingToast();
  186. $scope.comfromWeb = sessionStorage.comfrom == 'web';
  187. $scope.updataversion = "none";//有版本更新时显示;
  188. $('.tab_hide').css("display", "none");//背景遮层
  189. $scope.showloadBar = false;//进度条
  190. // $scope.hideupdate = true;
  191. $scope.hideupdate = false;
  192. $rootScope.homeBadge = 10;
  193. $scope.showtoast = false;//签到弹窗
  194. $scope.reclib = {
  195. id: 0,// 资源库文件夹id-武进库
  196. reclibid: 0,// 资源库细分文件夹id-需求库
  197. name: "",
  198. moduleid: 0
  199. };
  200. $scope.getNodeInfo = function () {
  201. $scope.node = UserService.node;//节点号
  202. $scope.nodename = UserService.nodename;//节点号名称
  203. };
  204. $scope.getNodeInfo();
  205. setInterval(function () {
  206. $scope.$watch(UserService.node, function () {
  207. $scope.nodename = UserService.nodename;
  208. });
  209. }, 100);
  210. /*检测更新*/
  211. var checkUpdate = function () {
  212. var devicetype = device.platform == "Android" ? 0 : 1;
  213. HomeService.checkUpdate(devicetype).then(function (response) {
  214. // HomeService.checkUpdate(1).then(function (response) {
  215. $scope.checkUpdateInfo = response.data;
  216. if ($scope.checkUpdateInfo.status != 0) {
  217. $scope.updatestatus = $scope.checkUpdateInfo.status;
  218. $scope.version = $scope.checkUpdateInfo.version;
  219. $rootScope.verno = $scope.checkUpdateInfo.version;
  220. $scope.isexitapp = $scope.checkUpdateInfo.isexitapp;
  221. }
  222. //APK更新
  223. if ($scope.checkUpdateInfo.status == 1) {
  224. if ((devicetype == 0 && $scope.checkUpdateInfo.andriodstatus == 0) || (devicetype == 1 && $scope.checkUpdateInfo.iosstatus == 0)) {
  225. $scope.updataversion = "block";
  226. $scope.hideupdate = true;
  227. $scope.showloadBar = false;
  228. $('.tab_hide').css("display", "block");
  229. }
  230. }
  231. //www更新
  232. // if ( $scope.checkUpdateInfo.status == 2) {
  233. // $scope.updataversion = "block";
  234. // $scope.hideupdate = true;
  235. // $('.tab_hide').css("display", "block");
  236. // }
  237. }, function () {
  238. });
  239. };
  240. //TODO --注释放开
  241. if ($scope.app) {
  242. checkUpdate();
  243. }
  244. //android更新
  245. $scope.updateversion = function () {
  246. if ($scope.updatestatus == 1) {
  247. if (device.platform == "Android") {
  248. if ($scope.isLiyangApp) {
  249. cordova.InAppBrowser.open("http://sj.qq.com/myapp/detail.htm?apkName=com.liyang.liyangapp", '_system', 'location=yes');
  250. } else {
  251. //app在线下载(自动更新)
  252. $scope.updateAuto();
  253. //app打开应用宝开始下载
  254. //cordova.InAppBrowser.open("http://sj.qq.com/myapp/detail.htm?apkName=com.push.pushapp", '_system', 'location=yes');
  255. }
  256. } else {
  257. cordova.InAppBrowser.open("https://itunes.apple.com/us/app/push科技/id1218178687?mt=8", '_system', 'location=yes');
  258. }
  259. }
  260. if ($scope.updatestatus == 2) {
  261. $scope.showloadBar = true;
  262. $scope.checkForUpdates();
  263. }
  264. $scope.updataversion = "none";
  265. $scope.hideupdate = false;
  266. $('.tab_hide').css("display", "none");
  267. };
  268. //取消更新版本
  269. $scope.cancleupdateversion = function () {
  270. $scope.hideupdate = false;
  271. if ($scope.isexitapp == 1) {
  272. //直接关闭app
  273. ionic.Platform.exitApp();
  274. }
  275. $scope.updataversion = "none";
  276. $('.tab_hide').css("display", "none");
  277. };
  278. $scope.doUpdate = function () {
  279. $ionicDeploy.update().then(function (res) {
  280. // console.log(res);
  281. }, function () {
  282. }, function (prog) {
  283. var loadPercent = parseInt(prog) + "%";
  284. $("#loadpercent").html(loadPercent);
  285. $('.progress-bar').css({ 'width': loadPercent });
  286. });
  287. };
  288. // 当前版本号
  289. $rootScope.verno = angular.copy(ConfigService.versionno);
  290. //web端检测更新
  291. var checkUpdatesForWeb = function () {
  292. ActivityService.checkUpdatesForWeb($rootScope.verno).then(function (res) {
  293. if (res.code == 3350 && res.data == true) {
  294. //$scope.clearNavigatorCokkier();
  295. }
  296. })
  297. }
  298. //代码有Bug,该功能暂时不使用
  299. //checkUpdatesForWeb();
  300. //检测更新
  301. $scope.checkForUpdates = function () {
  302. $ionicDeploy.check($rootScope.verno).then(function (hasUpdate) {
  303. $scope.hasUpdate = hasUpdate;
  304. if (hasUpdate) {
  305. $scope.doUpdate();
  306. }
  307. }, function (err) {
  308. })
  309. };
  310. //版本更新,清除浏览器记录
  311. $scope.clearNavigatorCokkier = function () {
  312. var keys = document.cookie.match(/[^ =;]+(?==)/g)
  313. if (keys) {
  314. for (var i = keys.length; i--;) {
  315. document.cookie = keys[i] + '=0;path=/;expires=' + new Date(0).toUTCString() // 清除当前域名下的,例如:m.ratingdog.cn
  316. document.cookie = keys[i] + '=0;path=/;domain=' + document.domain + ';expires=' + new Date(0).toUTCString() // 清除当前域名下的,例如 .m.ratingdog.cn
  317. document.cookie = keys[i] + '=0;path=/;domain=ratingdog.cn;expires=' + new Date(0).toUTCString() // 清除一级域名下的或指定的,例如 .ratingdog.cn
  318. }
  319. }
  320. }
  321. //app在线下载(自动更新)
  322. $scope.updateAuto = function () {
  323. //var textStr = "测试代码";测试服务器svn时间
  324. var source = 'http://pic.ubittc.com/group3/M00/0B/14/wKgBd10etCiAH7eRAAB6AIZYBWw073.apk';
  325. var target = "/Download/pushkeji.apk";
  326. var trustAllHosts = true;
  327. var options = {};
  328. var fileTransfer = new FileTransfer();
  329. function successCallback(entry) {
  330. cordova.plugins.fileOpener2.open(
  331. target,
  332. 'application/vnd.android.package-archive'
  333. );
  334. $ionicLoading.hide();
  335. }
  336. function errorCallback(error) {
  337. $ionicLoading.show({
  338. template: "下载失败"
  339. });
  340. $timeout(function () {
  341. $ionicLoading.hide()
  342. }, 2000);
  343. }
  344. fileTransfer.download(source, target, successCallback, errorCallback, trustAllHosts, options);
  345. fileTransfer.onprogress = function (progressEvent) {
  346. if (progressEvent.lengthComputable) {
  347. $ionicLoading.show({
  348. template: "已经下载:" + Math.floor((progressEvent.loaded / progressEvent.total) * 100) + "%"
  349. });
  350. }
  351. }
  352. };
  353. $scope.ButtonShow = ['走访记录', '企业库', '数据看板', '培育库']
  354. homepageOfNodeService.getNodeAuth(UserService.node).then(function (res) {
  355. $scope.isUserManager = res.data;
  356. })
  357. // 获取活动首页所有信息(宣传图、我的消息、最近的活动、最近的需求反馈)
  358. var getActivityInfo = function () {
  359. // $scope.showLoadingToast();
  360. var clienttype = 0;
  361. if ($scope.app) {
  362. clienttype = 1;
  363. } else {
  364. clienttype = 2;
  365. }
  366. ActivityService.getActivityInfo(clienttype, 0).then(function (response) {
  367. console.log('index/all', response)
  368. //关闭启动动画
  369. //TODO
  370. if ($scope.app) {
  371. $timeout(function () {
  372. navigator.splashscreen.hide();
  373. }, 1000);
  374. }
  375. // $scope.hideLoadingToast();
  376. $scope.menulist = response.data && response.data.menulist ? response.data.menulist : [];
  377. // $scope.menulist.push({
  378. // title:'技术经纪人',
  379. // url:'identifyForm',
  380. // icon:'./img/2018/technical_broker.png'
  381. // });
  382. // $scope.menulist.push({
  383. // title:'任务',
  384. // url:'taskHoll',
  385. // icon:'./img/2018/task-org.png'
  386. // });
  387. // $scope.menulist.push({
  388. // title:'活动',
  389. // url:'activitiesHoll',
  390. // icon:'./img/2018/activities.png'
  391. // });
  392. angular.forEach($scope.menulist, function (val) {
  393. // val.icon=val.title=='走访'?'./img/2018/interview-org.png':val.title=='我的录入'?'./img/2018/typein-org.png':val.title=='报表统计'?'./img/2018/statistic_report.png':val.icon;
  394. // val.noticeContent=val.title=='技术经纪人'?'快速认证经纪经纪人,领取普适币':val.title=='任务'?'快速进入任务大厅,赚取普适币':'';
  395. val.hasNotice = (val.noticeContent != null && val.noticeContent != '' && val.noticeContent != "");
  396. if (val.title == "报表管理") {
  397. val.hasNotice = false;
  398. }
  399. var title = val.title;
  400. val.wholePicUrl = ConfigService.imgurl + val.icon;
  401. val.picflag = (title == "技术经纪人" || title == "活动" || title == "需求") ? "1" : "2";
  402. })
  403. if (!localStorage.showNoticeMask) {
  404. $scope.showNoticeMask = true;
  405. $(".notice-mask").show();
  406. $(".tab_hide").show();
  407. $scope.changeNotice();
  408. }
  409. //
  410. // if(mySwiper){
  411. // mySwiper.slideTo (0);
  412. // mySwiper.destroy(true)
  413. // }
  414. startSwipe();
  415. $scope.bannerlist = response.data && response.data.adlist ? response.data.adlist : [];//首页宣传图
  416. console.log("response.data:", response.data);
  417. sysUsersInfo = response.data && response.data.sysUsersInfo ? response.data.sysUsersInfo : {
  418. authenstatus: 5100,
  419. id: 0
  420. };
  421. $scope.myMessageList = response.data && response.data.messagelist ? response.data.messagelist : [];
  422. angular.forEach($scope.myMessageList, function (val) {
  423. // if(val.msgTypeModel){
  424. // switch (val.msgTypeModel.mtype){
  425. // case 2647 :val.title='有人对 '+val.infoname+' 录入了信息';break;
  426. // case 2645 :val.title=val.applytypename+" "+val.authenstatusname;val.params=val.params?JSON.parse(val.postscript):{};break;
  427. // case 2614 :val.params=val.postscript?JSON.parse(val.postscript):{};val.title='有人评论了 '+val.params.title;break;
  428. // case 2646 :val.title='有人走访了 '+val.infoname;break;
  429. // case 2615 :val.params=val.postscript?JSON.parse(val.postscript):{};val.title='有人点赞了 '+val.params.title;break;
  430. // case 2640 :val.title='有人申请权限,请审核!';break;
  431. // case 2641 :val.title='您申请的权限已被处理,请查看!';break;
  432. // case 2617 :val.params=val.postscript?JSON.parse(val.postscript):{};val.title=val.msgTypeModel.content;break;
  433. // case 2662 :val.params=val.postscript?JSON.parse(val.postscript):{};val.params.comefrom='tab.activityIndex';val.params.opentowho=JSON.stringify(val.params.opentowho);val.title=val.resultmark;break;
  434. // default:val.params=val.postscript?JSON.parse(val.postscript):{};val.title=val.resultmark;
  435. // }
  436. // }
  437. val.params == val.postscript ? JSON.parse(val.postscript) : {};
  438. })
  439. angular.forEach($scope.myMessageList, function (val) {
  440. // console.log("resultmark=" + val.resultmark + "===标志===:" + val.by2);
  441. })
  442. $scope.myMessageList != '' && $scope.myMessageList != [] ? $scope.myMessageList.push($scope.myMessageList.slice(0, 1)[0]) : '';
  443. // $scope.myMessageList =[
  444. // {msgTypeModel:{content:'第一條消息'},createtime:'2018-10-10'},
  445. // {msgTypeModel:{content:'第二條消息'},createtime:'2018-10-10'},
  446. // {msgTypeModel:{content:'第三條消息'},createtime:'2018-10-10'},
  447. // {msgTypeModel:{content:'第四條消息'},createtime:'2018-10-10'},
  448. // {msgTypeModel:{content:'第五條消息'},createtime:'2018-10-10'},
  449. // {msgTypeModel:{content:'第六條消息'},createtime:'2018-10-10'},
  450. // ]
  451. /*5.0版本未调整此部分功能,暂时未取值,注释*/
  452. /*$scope.myMessageList = response.message;//最新6条消息
  453. if (angular.isDefined(response.activity)) {
  454. $scope.newactivity = response.activity[0];//我的最近活动
  455. }
  456. if (response.followup.list.length > 0) {
  457. $scope.folupcount = response.followup.count;
  458. $scope.actfolup = response.followup.list[0];//我的需求反馈
  459. }*/
  460. // 宣传图渲染
  461. // $timeout(function () {
  462. // $ionicSlideBoxDelegate.$getByHandle("adBanner").update();
  463. // }, 50);
  464. // console.log(mySwiper);
  465. //
  466. // if(mySwiper) {
  467. // console.log(mySwiper);
  468. // //销毁swiper
  469. // mySwiper.removeAllSlides();
  470. // }
  471. $scope.isloadingPageFloor = false;
  472. }, function () {
  473. })
  474. };
  475. getActivityInfo();
  476. // 首页搜索入口
  477. $scope.goIndexSearch = function () {
  478. $scope.go("indexSearchReasult");
  479. };
  480. // 各模块快捷入口页面跳转
  481. $scope.jumpPage = function (pageindex) {
  482. $scope.islogin = ConfigService.islogin;
  483. switch (pageindex) {
  484. case 0:
  485. // 对接宝
  486. $scope.go("abutmentHome");
  487. break;
  488. case 1:
  489. // 活动中心
  490. //$scope.go("activityCenter");
  491. UtilService.showMess("功能正在完善中,敬请期待!");
  492. break;
  493. case 2:
  494. // 普适币
  495. $scope.go("psMoneyHome");
  496. break;
  497. case 3:
  498. // 我的群组
  499. break;
  500. case 4:
  501. //关注用户
  502. $scope.go("fancenter", { act: 'activity' });
  503. break;
  504. case 5:
  505. break;
  506. case 6:
  507. //技术经纪人
  508. $scope.go("technicalBrokerButtonSummary");
  509. break;
  510. case 7:
  511. //走企业
  512. $scope.go("technicalBrokerEnterCompanyInfo");
  513. break;
  514. case 8:
  515. //录入
  516. if (!$scope.islogin) {
  517. if (localStorage.wxFlag == "true") {
  518. if (localStorage.isUserFocusXW == 0) {
  519. var title = localStorage.appidStr;
  520. $ionicPopup.alert({
  521. title: '提示',
  522. template: '请先关注微信公众号"' + title + '"!'
  523. });
  524. return;
  525. } else {
  526. if (localStorage.isUserBindWx == 0) {
  527. var wxFlag = JSON.parse(localStorage.params);
  528. if (wxFlag.weChatModel) {
  529. $scope.go('bindPhone', {
  530. params: localStorage.params,
  531. comfrom: 'maincontroller',
  532. url: window.location.href.split('#/')[1]
  533. });
  534. } else {
  535. $scope.go('login');
  536. return;
  537. }
  538. } else {
  539. $scope.go('login');
  540. return;
  541. }
  542. }
  543. } else {
  544. $scope.go('login');
  545. return;
  546. }
  547. } else {
  548. $scope.go("recordInfoAccount");
  549. }
  550. break;
  551. case 9:
  552. //录入
  553. $scope.go("reportTypeList");
  554. break;
  555. default:
  556. break;
  557. }
  558. };
  559. // 活动页面快捷入口路由跳转
  560. $scope.goNextPage = function (index, act) {
  561. switch (index) {
  562. case 1:
  563. // 通知
  564. $scope.go("activityNotice", { activityid: act.id, title: act.title });
  565. break;
  566. case 2:
  567. // 通知管理
  568. $scope.go("activityNoticeManger", {
  569. activityid: act.id,
  570. title: act.title,
  571. status: act.status,
  572. days: act.activityLeaveDays
  573. });
  574. break;
  575. case 3:
  576. // 报名
  577. $scope.go("activitySignUpConfirm", { activityid: act.id });
  578. break;
  579. case 4:
  580. // 高校报名管理
  581. $scope.go("activitySchoolSignUpManger", {
  582. activityid: act.id,
  583. title: act.title,
  584. visittime: act.visitclosingdate
  585. });
  586. break;
  587. case 5:
  588. // 企业报名管理
  589. $scope.go("activityCompanySignUpManger", {
  590. activityid: act.id,
  591. title: act.title,
  592. visittime: act.visitclosingdate
  593. });
  594. break;
  595. case 6:
  596. // 参与企业
  597. $scope.go("activityCompanyList", { activityid: act.id });
  598. break;
  599. case 7:
  600. // 活动统计
  601. $scope.go("activityStatistics", { activityid: act.id });
  602. break;
  603. case 8:
  604. // 活动安排管理
  605. $scope.go("activityArrangeManger", { activityid: act.id });
  606. break;
  607. case 9:
  608. // 签到
  609. checkIn(act.id);
  610. break;
  611. case 10:
  612. // 反馈(1、非企业用户:1.1 未填写过进入填写页面,1.2 已填写过进入列表 2、企业用户:填写本企业的走访反馈列表)
  613. if (UserService.role[0] <= 8 && UserService.role[0] != 1) {
  614. ActivityService.checkFollowupInfo(act.id).then(function (response) {
  615. if (response.result == 0) {
  616. $scope.go("activityFeedBack", { activityid: act.id, title: act.title });
  617. } else {
  618. $scope.go("activityFeedBackList", { activityid: act.id, title: act.title });
  619. }
  620. }, function () {
  621. });
  622. } else {
  623. $scope.go("activityCompanyViewFeedList", { activityid: act.id });
  624. }
  625. break;
  626. case 11:
  627. // 活动安排
  628. if (UserService.role[0] <= 8 && UserService.role[0] != 1) {
  629. $scope.go("activityArrange", { activityid: act.id });
  630. } else {
  631. $scope.go("activityCompanyArrange", { activityid: act.id });
  632. }
  633. break;
  634. case 12:
  635. // 反馈管理
  636. $scope.go("activityBackManger", { activityid: act.id });
  637. break;
  638. case 13:
  639. // 签到管理
  640. $scope.go("activitySignManger", { activityid: act.id });
  641. break;
  642. case 14:
  643. // 备案
  644. $scope.go("activityRecord");
  645. break;
  646. case 15:
  647. // 备案管理
  648. $scope.go("activityReacordManger");
  649. break;
  650. case 16:
  651. // 选择企业
  652. $scope.go("activityChooseCompany", { activityid: act.id });
  653. break;
  654. case 17:
  655. // 报名信息
  656. $scope.go("activitySignUpInfo", { activityid: act.id });
  657. break;
  658. case 18:
  659. // 选择专家
  660. $scope.go("activityChooseTeacher", { activityid: act.id });
  661. break;
  662. default:
  663. break;
  664. }
  665. };
  666. // 获取模版列表的传参
  667. $scope.roleModel =
  668. {
  669. //TODO
  670. funid: 2,//所属功能:1走访、2录入等
  671. roleidList: []// 角色数组
  672. };
  673. //根据角色获取所有模版
  674. $scope.rolePageList = [];
  675. $scope.roleModel.roleidList.push(0);// 角色默认一笔0,否则后台 in查询会报错
  676. var getRolePageList = function () {
  677. if (UtilService.isDefined(UserService.role)) {
  678. angular.forEach(UserService.role, function (value, index) {
  679. $scope.roleModel.roleidList.push(value.roleid);
  680. });
  681. }
  682. $scope.roleModel.node = UserService.node;
  683. //==============根据角色获取所有模版================
  684. console.log('角色传参', $scope.roleModel, UserService);
  685. roleService.getRolePageList($scope.roleModel).then(function (response) {
  686. console.log('来自于大家觉得', response);
  687. // 模版列表
  688. $scope.rolePageList = response.data;
  689. angular.forEach($scope.rolePageList, function (val) {
  690. val.logo = val.pagename == '基本信息' ? 'iconfont-basic-info'
  691. : val.pagename == '需求信息' ? 'iconfont-demand'
  692. : val.pagename == '成果信息' ? 'iconfont-achievement'
  693. : val.pagename == '产品信息' ? 'iconfont-product'
  694. : val.pagename == '专利信息' ? 'iconfont-patents'
  695. : val.pagename == '人才信息' ? 'iconfont-talents'
  696. : val.pagename == '月报表' ? 'iconfont-report-form'
  697. : val.pagename == '项目转化' ? 'iconfont-transform'
  698. : val.pagename == '对接录入' ? 'iconfont-butt-joint'
  699. : 'ion-compose';
  700. })
  701. // console.log($scope.rolePageList);
  702. }, function () {
  703. })
  704. };
  705. /*
  706. app5.0开发,功能未调整,不展示,注释
  707. // 活动是否弹出签到弹窗(否临时人员:弹窗,已报名:直接签到)
  708. var activityid = 0;
  709. var checkIntime = function (actid) {
  710. activityid = actid;
  711. $scope.showLoadingToast();
  712. ActivityService.checkIntime(activityid).then(function (response) {
  713. // console.log(response);
  714. if (response.result == 1) {
  715. $scope.userinfo = response.userinfo;
  716. $scope.showtoast = true;
  717. $scope.hideLoadingToast();
  718. } else {
  719. }
  720. }, function () {
  721. $scope.hideLoadingToast();
  722. })
  723. };
  724. // 签到
  725. var checkIn = function (actid) {
  726. ActivityService.getCheckInStatus(actid).then(function (response) {
  727. // 0未签到,1已签到
  728. if (response.result == 0) {
  729. ActivityService.checkIn(actid, ConfigService.location.lat, ConfigService.location.lng).then(function (response) {
  730. // console.log(response);
  731. if (response.result == 1) {
  732. UtilService.showMess("签到成功");
  733. getActivityInfo();
  734. } else {
  735. UtilService.showMess("网络不给力,请重试");
  736. }
  737. $scope.hideLoadingToast();
  738. }, function () {
  739. $scope.hideLoadingToast();
  740. UtilService.showMess("网络不给力,请重试");
  741. });
  742. } else {
  743. UtilService.showMess("您已成功签到");
  744. $scope.hideLoadingToast();
  745. }
  746. }, function () {
  747. UtilService.showMess("网络不给力,请重试");
  748. $scope.hideLoadingToast();
  749. });
  750. };
  751. // 临时人员签到
  752. $scope.tempCheckin = function () {
  753. $scope.showLoadingToast();
  754. ActivityService.tempCheckIn(activityid, ConfigService.location.lat, ConfigService.location.lng, $scope.userinfo).then(function (response) {
  755. // console.log(response);
  756. if (response.result == 1) {
  757. UtilService.showMess("签到成功");
  758. getActivityInfo();
  759. $timeout(function () {
  760. $scope.showtoast = false;
  761. }, 300);
  762. } else {
  763. UtilService.showMess("网络不给力,请重试");
  764. }
  765. $scope.hideLoadingToast();
  766. }, function () {
  767. UtilService.showMess("网络不给力,请重试");
  768. $scope.hideLoadingToast();
  769. });
  770. };
  771. // 检查活动当天是否有弹框
  772. $scope.ifshowResourceWrapFloor = false;
  773. var checkIspopup = function (moduletype) {
  774. $scope.showLoadingToast();
  775. ActivityService.checkIspopup(moduletype).then(function (response) {
  776. if (response.result == 1) {
  777. // 获取弹框内容
  778. getPopupDetail(moduletype);
  779. $scope.ifshowResourceWrapFloor = true;
  780. $scope.showResourceWrapFloor = true;
  781. $("ion-nav-view[name='tab-activityIndex']").css("z-index","8");
  782. $scope.hideLoadingToast();
  783. } else {
  784. $scope.ifshowResourceWrapFloor = false;
  785. }
  786. }, function () {
  787. $scope.hideLoadingToast();
  788. })
  789. };
  790. checkIspopup(0);
  791. // 获取弹框详情
  792. var getPopupDetail = function (moduletype) {
  793. $scope.showLoadingToast();
  794. ActivityService.getPopupDetail(moduletype).then(function (response) {
  795. $scope.popupinfo = response;
  796. $scope.hideLoadingToast();
  797. }, function () {
  798. $scope.hideLoadingToast();
  799. })
  800. };
  801. getPopupDetail(0);
  802. // 查询用户是否输入正确过口令
  803. $scope.keywordid = 0;
  804. $scope.ifpostuserkeyword = 0;
  805. var checkUserKeyword = function (keywordid) {
  806. ActivityService.checkUserKeyword(keywordid).then(function (response) {
  807. // 口令id
  808. $scope.ifpostuserkeyword = response.result;
  809. }, function () {
  810. })
  811. };
  812. // 判断用户是否有文件夹权限
  813. $scope.ifhasvisitauth = 2;
  814. var checkUserAuthority = function () {
  815. ActivityService.getAuthority().then(function (response) {
  816. // 有权限1,没有权限2
  817. $scope.ifhasvisitauth = response.result;
  818. }, function () {
  819. })
  820. };
  821. // 查询口令的id
  822. var getkeywordid = function (moduletype) {
  823. ActivityService.getkeywordid(moduletype).then(function (response) {
  824. // 口令id
  825. $scope.keywordid = response.keywordid;
  826. console.log($scope.keywordid);
  827. checkUserKeyword($scope.keywordid);
  828. checkUserAuthority();
  829. }, function () {
  830. })
  831. };
  832. getkeywordid(0);
  833. // 输入口令正确,用户获取文件夹权限
  834. var setAuthority = function (claid) {
  835. ActivityService.setAuthority(claid).then(function (response) {
  836. // console.log("设置文件夹权限成功" + response.result);
  837. }, function () {
  838. })
  839. };
  840. //进入资源库文件夹列表方法
  841. var goResourceLib = function (id, reclibid, name, linktype) {
  842. $scope.reclib.id = id;// 资源库文件夹id-武进库
  843. $scope.reclib.reclibid = reclibid;// 资源库细分文件夹id-需求库
  844. $scope.reclib.name = name;
  845. $scope.reclib.moduleid = linktype;// 模块对应的moduleid:6,7,8
  846. console.log($scope.reclib);
  847. $scope.go('resourceLibraryPrivate', {reclib: angular.toJson($scope.reclib)});
  848. };
  849. // 查询用户输入口令是否正确
  850. $scope.submitActPas = function (actPassword) {
  851. ActivityService.postKeyword($scope.keywordid, actPassword).then(function (response) {
  852. // console.log("aa1:"+response);
  853. if (response.result == 1) {
  854. // 输入正确,继续
  855. $("#consoleHtm").html("口令输入正确");
  856. // 设置为0,则后台取配置信息
  857. setAuthority(0);
  858. $scope.ifpostuserkeyword = 1;
  859. $scope.ifhasvisitauth = 1;
  860. // 口令正确,自动进入资源库
  861. // console.log($scope.popupinfo.popupdetaillist.length);
  862. // console.log("aa:"+$scope.popupinfo.popupdetaillist[0].detailtitle);
  863. if ($scope.popupinfo.popupdetaillist.length > 0) {
  864. goResourceLib($scope.popupinfo.popupdetaillist[0].url,
  865. $scope.popupinfo.popupdetaillist[0].claid,
  866. $scope.popupinfo.popupdetaillist[0].detailtitle,
  867. $scope.popupinfo.popupdetaillist[0].linktype);
  868. }
  869. } else if (response.result == 2) {
  870. // 输入错误
  871. $("#consoleHtm").html("口令输入错误");
  872. }
  873. }, function () {
  874. })
  875. };
  876. //进入资源库文件夹列表
  877. $scope.goSomeWhere = function (id, reclibid, name, linktype) {
  878. console.log(name);
  879. goResourceLib(id, reclibid, name, linktype);
  880. };
  881. // 关闭签到弹窗
  882. $scope.btnHide = function () {
  883. $timeout(function () {
  884. $scope.showtoast = false;
  885. }, 300);
  886. };*/
  887. // 进入需求反馈详情页
  888. $scope.goFolUpDetail = function () {
  889. $scope.go("activityFeedBackListContent", { folupid: $scope.actfolup.id });
  890. };
  891. // 进入需求反馈列表
  892. $scope.goFeedBackList = function () {
  893. $scope.go("activityFeedBackList", { activityid: $scope.actfolup.aid, title: $scope.actfolup.activityname });
  894. };
  895. //关闭启动动画
  896. if ($scope.app) {
  897. $timeout(function () {
  898. //TODO
  899. navigator.splashscreen.hide();
  900. }, 1000);
  901. }
  902. if ($scope.app && device.platform != "Android") {
  903. $scope.isIosPlatform = true;
  904. }
  905. $scope.hastask = true;//控制标题栏内容是否显示
  906. $scope.isScrollEnough = false;
  907. $scope.showInBody = true;
  908. // var scrollheight=document.getElementById('click-button').offsetTop;
  909. var scrollheight;
  910. /*$timeout(function () {
  911. scrollheight = document.getElementById('click-position').offsetTop;
  912. }, 1000)*/
  913. $scope.getScrollPosition = function () {
  914. var position = $ionicScrollDelegate.getScrollPosition().top;//取这个ion-content滑动TOP值
  915. // console.log(position);
  916. if (position > scrollheight) { //当滚动距离大于250px时执行下面的东西
  917. $scope.showInBody = false;
  918. $timeout(function () {
  919. var scrollWidth = document.querySelector('#click-button-top>li.resource-active').offsetLeft;
  920. var width = document.querySelector('#click-button-top>li.resource-active').offsetWidth;
  921. if (scrollWidth > window.innerWidth / 2) {
  922. // $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(scrollWidth-window.innerWidth/2+allLis[index].offsetWidth/2,0);
  923. $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(scrollWidth - window.innerWidth / 2 + width / 2, 0);
  924. } else {
  925. // $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(0,0);
  926. $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(0, 0);
  927. }
  928. }, 0);
  929. } else {//当滚动距离小于250的时候执行下面的内容,也就是让导航栏恢复原状
  930. $scope.showInBody = true;
  931. $timeout(function () {
  932. /*var scrollWidth = document.querySelector('#click-button>li.resource-active').offsetLeft;
  933. var width = document.querySelector('#click-button>li.resource-active').offsetWidth;
  934. if (scrollWidth > window.innerWidth / 2) {
  935. $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(scrollWidth - window.innerWidth / 2 + width / 2, 0);
  936. // $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(scrollWidth-window.innerWidth/2+allLis[index].offsetWidth/2,0);
  937. } else {
  938. $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(0, 0);
  939. // $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(0,0);
  940. }*/
  941. }, 0);
  942. }
  943. $scope.$apply();//触发用以更新view
  944. };
  945. //弹出各类按钮
  946. $scope.showAnthorBtnWrap = false;
  947. $scope.showAnthorBtn = function () {
  948. $scope.islogin = ConfigService.islogin;
  949. if (!$scope.islogin) {
  950. if (localStorage.wxFlag == "true") {
  951. if (localStorage.isUserFocusXW == 0) {
  952. var title = localStorage.appidStr;
  953. $ionicPopup.alert({
  954. title: '提示',
  955. template: '请先关注微信公众号"' + title + '"!'
  956. });
  957. return;
  958. } else {
  959. if (localStorage.isUserBindWx == 0) {
  960. var wxFlag = JSON.parse(localStorage.params);
  961. if (wxFlag.weChatModel) {
  962. $scope.go('bindPhone', {
  963. params: localStorage.params,
  964. comfrom: 'maincontroller',
  965. url: window.location.href.split('#/')[1]
  966. });
  967. } else {
  968. $scope.go('login');
  969. return;
  970. }
  971. } else {
  972. $scope.go('login');
  973. return;
  974. }
  975. }
  976. } else {
  977. $scope.go('login');
  978. return;
  979. }
  980. } else {
  981. $scope.showAnthorBtnWrap = true;
  982. getRolePageList();
  983. $("ion-nav-view[name='tab-activityIndex']").css("z-index", "8");
  984. }
  985. };
  986. var hideAnthorBtnf = function () {
  987. $scope.showAnthorBtnWrap = false;
  988. $("ion-nav-view[name='tab-activityIndex']").css("z-index", "1");
  989. };
  990. $scope.hideAnthorBtnWrap = function () {
  991. $scope.showAnthorBtnWrap = false;
  992. $("ion-nav-view[name='tab-activityIndex']").css("z-index", "1");
  993. };
  994. $scope.goTaskReceive = function () {
  995. //$scope.go("technicalBrokerSelfReceiveTask");
  996. UtilService.showMess("功能正在完善中,敬请期待!");
  997. };
  998. $scope.jumpQuick = function (orgtype, pagecode, pagename, id, isedit) {
  999. if (id == 10) {
  1000. $scope.go('reportEditModal', { pageTitle: '报表录入', pageid: id })
  1001. }
  1002. if (id == 16) {
  1003. $scope.go('dockingInput', {
  1004. comfrom: "dockingInput",
  1005. companyName: "",
  1006. companyid: 0,
  1007. taskId: "",
  1008. taskTitle: ""
  1009. })
  1010. } else {
  1011. if (UserService.node == '330122000' && id == 4) {
  1012. console.log(9999)
  1013. $scope.go('visitModularFormDemand', {
  1014. companyid: 0,
  1015. pageid: id,
  1016. orgtype: orgtype,
  1017. pagecode: pagecode,
  1018. isedit: isedit,
  1019. node: UserService.node,
  1020. pageTitle: '新建录入',
  1021. techtype: 5350
  1022. });
  1023. } else {
  1024. $scope.go('visitModularForm', {
  1025. companyid: 0,
  1026. pageid: id,
  1027. orgtype: orgtype,
  1028. pagecode: pagecode,
  1029. isedit: isedit,
  1030. node: UserService.node,
  1031. pageTitle: '新建录入'
  1032. });
  1033. }
  1034. // if(UserService.node=='320117005'||UserService.node=='320117003'||UserService.node=='320117002'||UserService.node=='320117001'||UserService.node=='320117004'){
  1035. // // $scope.go('typeinAllModal', {companyid: 0, pageid: id, orgtype: orgtype,pagecode:pagecode, isedit: isedit,node:UserService.node});
  1036. // $scope.go('visitModularForm', {companyid: 0, pageid: id, orgtype: orgtype,pagecode:pagecode, isedit: isedit,node:UserService.node,pageTitle:'新建录入'});
  1037. // }else{
  1038. // $scope.go('typeinInformation',{orgtype:orgtype,pagecode:pagecode,pagename:pagename,id:id,isedit:isedit})
  1039. // }
  1040. }
  1041. hideAnthorBtnf();
  1042. };
  1043. //资源库跳转弹窗
  1044. $scope.showResourceWrapFloor = true;
  1045. $scope.showResourceBtn = function () {
  1046. $("ion-nav-view[name='tab-activityIndex']").css("z-index", "8");
  1047. $scope.showResourceWrapFloor = true;
  1048. };
  1049. $scope.resourceBtnHide = function () {
  1050. $("ion-nav-view[name='tab-activityIndex']").css("z-index", "1");
  1051. $scope.showResourceWrapFloor = false;
  1052. };
  1053. //跳转轮播详情页
  1054. $scope.goBannerContent = function () {
  1055. $scope.go('bannerContent')
  1056. };
  1057. // 跳转到选择节点
  1058. $scope.goSelectNode = function () {
  1059. $scope.go('chooseNodeIndex');
  1060. };
  1061. $scope.jumpToPage = function (url, title) {
  1062. $scope.islogin = ConfigService.islogin;
  1063. if (url == 'reward') {
  1064. $scope.go(url);
  1065. } else {
  1066. if (!$scope.islogin) {
  1067. if (url == "technicalBrokerEnterCompanyInfo" || url == "taskHoll" || url == "activitiesHoll" || url == "notification" || url == "linkus") {
  1068. $scope.go(url);
  1069. return;
  1070. } else {
  1071. if (localStorage.wxFlag == "true") {
  1072. if (localStorage.isUserFocusXW == 0) {
  1073. var title = localStorage.appidStr;
  1074. $ionicPopup.alert({
  1075. title: '提示',
  1076. template: '请先关注微信公众号"' + title + '"!'
  1077. });
  1078. return;
  1079. } else {
  1080. if (localStorage.isUserBindWx == 0) {
  1081. var wxFlag = JSON.parse(localStorage.params);
  1082. if (wxFlag.weChatModel) {
  1083. $scope.go('bindPhone', {
  1084. params: localStorage.params,
  1085. comfrom: 'maincontroller',
  1086. url: window.location.href.split('#/')[1]
  1087. });
  1088. } else {
  1089. $scope.go('login');
  1090. return;
  1091. }
  1092. } else {
  1093. $scope.go('login');
  1094. return;
  1095. }
  1096. }
  1097. } else {
  1098. $scope.go('login');
  1099. return;
  1100. }
  1101. }
  1102. }
  1103. if (/技术经纪/g.test(title) || "Technical Broker" == title) {
  1104. console.log(sysUsersInfo.authenstatus, url)
  1105. // return;
  1106. var jumpUrl = '';
  1107. if (sysUsersInfo.authenstatus == 5100) {
  1108. jumpUrl = url;
  1109. } else {
  1110. jumpUrl = 'identifyStatus';
  1111. }
  1112. $scope.go(jumpUrl, {
  1113. pageTitle: title,
  1114. code: 4801,
  1115. type: sysUsersInfo.authenstatus,
  1116. id: sysUsersInfo.id,
  1117. action: 'submit',
  1118. comfrom: 'tab.activityIndex'
  1119. });
  1120. } else {
  1121. if (url == "orgInspect") {
  1122. //判断当前用户是不是节点下的管理机构的管理员
  1123. taskModuleService.judgeUserInOrgForTL().then(function (res) {
  1124. console.log(res)
  1125. if (res.code == 3350) {
  1126. $scope.isAdmin = res.data;
  1127. if ($scope.isAdmin) {
  1128. $scope.go('orgInspectList', { isuserlist: false });
  1129. } else {
  1130. taskModuleService.getInspectList(0, '0', '', true).then(function (res) {
  1131. if (res.code == 3350) {
  1132. if (res.data.length > 0) {
  1133. $scope.go('orgInspectList', { isuserlist: true });
  1134. } else {
  1135. $scope.go('orgInspect');
  1136. }
  1137. }
  1138. })
  1139. }
  1140. }
  1141. })
  1142. } else if (title == "企业库") {
  1143. $scope.go('privateResource', {
  1144. res: angular.toJson(url),
  1145. privateName: url.name,
  1146. groupid: url.parentid,
  1147. restype: url.moduleid,
  1148. privateContent: url.content,
  1149. authority: url.by5
  1150. });
  1151. } else if (url == 'Selfcheckentrance') {
  1152. $scope.go(url, { id: title });
  1153. }else if(title=='科技工具'){
  1154. window.open( 'https://cae365.yuansuan.com/')
  1155. }
  1156. else {
  1157. $scope.go(url);
  1158. }
  1159. }
  1160. }
  1161. }
  1162. $scope.changeNotice = function () {
  1163. angular.forEach($scope.menulist, function (value) {
  1164. value.showNotice = false;
  1165. })
  1166. var i = 0;
  1167. for (; i < $scope.menulist.length; i++) {
  1168. if ($scope.menulist[i].hasNotice) {
  1169. $scope.menulist[i].hasNotice = false;
  1170. $scope.menulist[i].showNotice = true;
  1171. $scope.noticeContent = $scope.menulist[i].noticeContent;
  1172. return;
  1173. }
  1174. }
  1175. if (i == $scope.menulist.length) {
  1176. $scope.showNoticeMask = false;
  1177. $(".tab_hide").hide();
  1178. localStorage.showNoticeMask = true;
  1179. }
  1180. }
  1181. $scope.allTaskData = []
  1182. var taskSwiper;
  1183. var taskSwiperFn = function () {
  1184. var num = $scope.isapp ? 2 : 5;
  1185. taskSwiper = new Swiper('.swiper-container-newest-task', {
  1186. // loop: true, // 循环模式选项
  1187. slidesPerView: num,
  1188. spaceBetween: 10,
  1189. initialSlide: 0,
  1190. // hashNavigation: true,
  1191. // 如果需要分页器
  1192. pagination: {
  1193. el: '.swiper-pagination',
  1194. },
  1195. // 如果需要前进后退按钮
  1196. navigation: {
  1197. nextEl: '.swiper-button-next',
  1198. prevEl: '.swiper-button-prev',
  1199. },
  1200. on: {
  1201. tap: function (e) {
  1202. e.stopPropagation();
  1203. if (e.target.className == 'swiper-button-next') {
  1204. this.slideNext();
  1205. } else if (e.target.className == 'swiper-button-prev') {
  1206. this.slidePrev();
  1207. } else if (this.clickedIndex || this.clickedIndex == 0) {
  1208. if (!ConfigService.islogin) {
  1209. if (localStorage.wxFlag == "true") {
  1210. if (localStorage.isUserFocusXW == 0) {
  1211. var title = localStorage.appidStr;
  1212. $ionicPopup.alert({
  1213. title: '提示',
  1214. template: '请先关注微信公众号"' + title + '"!'
  1215. });
  1216. return;
  1217. } else {
  1218. if (localStorage.isUserBindWx == 0) {
  1219. var wxFlag = JSON.parse(localStorage.params);
  1220. if (wxFlag.weChatModel) {
  1221. $scope.go('bindPhone', {
  1222. params: localStorage.params,
  1223. comfrom: 'maincontroller',
  1224. url: window.location.href.split('#/')[1]
  1225. });
  1226. } else {
  1227. $scope.go('login');
  1228. return;
  1229. }
  1230. } else {
  1231. $scope.go('login');
  1232. return;
  1233. }
  1234. }
  1235. } else {
  1236. $scope.go('login');
  1237. return;
  1238. }
  1239. } else {
  1240. var list = $scope.allTaskData[this.clickedIndex];
  1241. if (list.noSuthority) {
  1242. var alertPopup = $ionicPopup.alert({
  1243. title: '提示',
  1244. template: '自任务发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
  1245. });
  1246. return;
  1247. }
  1248. /*$scope.go('taskDetail', {
  1249. resid: list.unique,
  1250. node: list.source,
  1251. title: list.title,
  1252. restype: list.type,
  1253. comefrom: 'tab.activityIndex',
  1254. ifjoin: list.otherObj.ifjoin,
  1255. actions: list.otherObj.actions,
  1256. taskstatus: list.otherObj.taskstatus,
  1257. taskid: list.otherObj.id,
  1258. opentowho: list.otherObj.opentowho,
  1259. });*/
  1260. }
  1261. }
  1262. }
  1263. },
  1264. // 如果需要滚动条
  1265. // scrollbar: {
  1266. // el: '.swiper-scrollbar',
  1267. // },
  1268. })
  1269. }
  1270. // $scope.showLoadingToast();
  1271. // 获取任务分类标签
  1272. // dataToolsService.getTypeEntryListByTypeName('usertask_type').then(function(res){
  1273. taskModuleService.getAllTaskLable(UserService.node).then(function (res) {
  1274. $scope.labelList = [{
  1275. itemvalue: 0,
  1276. itemkey: '全部',
  1277. isSelected: true
  1278. }];
  1279. if (res.code == 3350) {
  1280. angular.forEach(res.data, function (val) {
  1281. val.isSelected = false;
  1282. })
  1283. $scope.labelList = $scope.labelList.concat(res.data);
  1284. }
  1285. });
  1286. // 获取任务列表
  1287. $scope.getTaskList = function (tasktype, index) {
  1288. if ($scope.labelList) {
  1289. angular.forEach($scope.labelList, function (val) {
  1290. val.isSelected = false;
  1291. })
  1292. $scope.labelList[index].isSelected = true;
  1293. }
  1294. $scope.allTaskData = [];
  1295. $scope.showNoData = false;
  1296. $scope.showLoading = true;
  1297. taskModuleService.getAllTaskList(UserService.node, 0, tasktype, '', 1, 10).then(function (res) {
  1298. $scope.showLoading = false;
  1299. if (res.code == 3350) {
  1300. $scope.allTaskData = res.data;
  1301. angular.forEach($scope.allTaskData, function (val) {
  1302. val.noSuthority = false;
  1303. if (val.otherObj && val.otherObj.creator != UserService.id && val.otherObj.taskstatus == 5300 && !val.otherObj.actions) {
  1304. val.noSuthority = true;
  1305. }
  1306. })
  1307. $scope.showNoData = (res.data && res.data.length == 0);
  1308. //溧阳节点隐藏掉
  1309. $timeout(function () {
  1310. if (taskSwiper && $scope.showtask) {
  1311. taskSwiper.slideTo(0);
  1312. taskSwiper.destroy(true)
  1313. }
  1314. taskSwiperFn();
  1315. }, 200)
  1316. }
  1317. })
  1318. }
  1319. $scope.goTongLuCheckDetail = function (list) {
  1320. if (list.source == '330122000') {
  1321. if (!ConfigService.islogin) {
  1322. if (localStorage.wxFlag == "true") {
  1323. if (localStorage.isUserFocusXW == 0) {
  1324. var title = localStorage.appidStr;
  1325. $ionicPopup.alert({
  1326. title: '提示',
  1327. template: '请先关注微信公众号"' + title + '"!'
  1328. });
  1329. return;
  1330. } else {
  1331. if (localStorage.isUserBindWx == 0) {
  1332. var wxFlag = JSON.parse(localStorage.params);
  1333. if (wxFlag.weChatModel) {
  1334. $scope.go('bindPhone', {
  1335. params: localStorage.params,
  1336. comfrom: 'maincontroller',
  1337. url: window.location.href.split('#/')[1]
  1338. });
  1339. } else {
  1340. $scope.go('login');
  1341. return;
  1342. }
  1343. } else {
  1344. $scope.go('login');
  1345. return;
  1346. }
  1347. }
  1348. } else {
  1349. $scope.go('login');
  1350. return;
  1351. }
  1352. } else {
  1353. var permissionvalue = list.by6;
  1354. var splitArr = [];
  1355. if (permissionvalue == 1 || permissionvalue == 2 || permissionvalue == 3 ||
  1356. permissionvalue == 4 || permissionvalue == 5) {
  1357. splitArr.push(permissionvalue);
  1358. } else if (permissionvalue != null) {
  1359. splitArr = permissionvalue.split(',');
  1360. } else {
  1361. splitArr.push(1);
  1362. }
  1363. for (var i = 0; i < splitArr.length; i++) {
  1364. if (splitArr[i] == 2) {
  1365. taskModuleService.checkTaskDetailPermission(2, UserService.id).then(function (res) {
  1366. if (res.code == 3350) {
  1367. $scope.isVisiableFlag = res.data;
  1368. if (!$scope.isVisiableFlag) {
  1369. taskModuleService.getUserPermissionCheck(list.unique, list.creator, UserService.id).then(function (res) {
  1370. if (res.code == 3350) {
  1371. $scope.isVisiableFlag = res.data;
  1372. if (!$scope.isVisiableFlag) {//true可见,false不可见
  1373. $ionicPopup.confirm({
  1374. title: '确认',
  1375. template: '仅技术经纪人可见,请先认证技术经纪人',
  1376. okText: '去认证',
  1377. cancelText: '取消'
  1378. }).then(function (result) {
  1379. if (result) {
  1380. if ($scope.node == '330122000') {
  1381. $scope.go('identifyFormForTongLu', {
  1382. pageTitle: '技术经纪人认证',
  1383. code: 4801,
  1384. type: 5100,
  1385. id: UserService.userid
  1386. });
  1387. }
  1388. if ($scope.node == '320412000') {
  1389. $scope.go('identifyForm', {
  1390. pageTitle: '技术经纪人认证',
  1391. code: 4801,
  1392. type: 5100,
  1393. id: UserService.userid
  1394. });
  1395. }
  1396. } else {
  1397. $scope.go('tab.activityIndex');
  1398. }
  1399. })
  1400. } else {
  1401. if (!ConfigService.islogin) {
  1402. if (localStorage.wxFlag == "true") {
  1403. if (localStorage.isUserFocusXW == 0) {
  1404. var title = localStorage.appidStr;
  1405. $ionicPopup.alert({
  1406. title: '提示',
  1407. template: '请先关注微信公众号"' + title + '"!'
  1408. });
  1409. return;
  1410. } else {
  1411. if (localStorage.isUserBindWx == 0) {
  1412. var wxFlag = JSON.parse(localStorage.params);
  1413. if (wxFlag.weChatModel) {
  1414. $scope.go('bindPhone', {
  1415. params: localStorage.params,
  1416. comfrom: 'maincontroller',
  1417. url: window.location.href.split('#/')[1]
  1418. });
  1419. } else {
  1420. $scope.go('login');
  1421. return;
  1422. }
  1423. } else {
  1424. $scope.go('login');
  1425. return;
  1426. }
  1427. }
  1428. } else {
  1429. $scope.go('login');
  1430. return;
  1431. }
  1432. } else {
  1433. if (list.noSuthority) {
  1434. var alertPopup = $ionicPopup.alert({
  1435. title: '提示',
  1436. template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
  1437. });
  1438. return;
  1439. }
  1440. // console.log(list);
  1441. if (list.otherObj.taskstatus == 5302) {
  1442. taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
  1443. for (var i = 0; i < res.data.length; i++) {
  1444. if (res.data[i] == UserService.id) {
  1445. list.otherObj.actions = list.otherObj.actions + "," + 5324;
  1446. break;
  1447. }
  1448. }
  1449. })
  1450. }
  1451. $scope.go('taskDetail', {
  1452. resid: list.unique,
  1453. node: list.source,
  1454. title: list.title,
  1455. restype: list.type,
  1456. comefrom: 'taskHoll',
  1457. ifjoin: list.otherObj.ifjoin,
  1458. actions: list.otherObj.actions,
  1459. taskstatus: list.otherObj.taskstatus,
  1460. taskid: list.otherObj.id,
  1461. opentowho: list.otherObj.opentowho
  1462. });
  1463. }
  1464. }
  1465. }
  1466. });
  1467. } else {
  1468. if (!ConfigService.islogin) {
  1469. if (localStorage.wxFlag == "true") {
  1470. if (localStorage.isUserFocusXW == 0) {
  1471. var title = localStorage.appidStr;
  1472. $ionicPopup.alert({
  1473. title: '提示',
  1474. template: '请先关注微信公众号"' + title + '"!'
  1475. });
  1476. return;
  1477. } else {
  1478. if (localStorage.isUserBindWx == 0) {
  1479. var wxFlag = JSON.parse(localStorage.params);
  1480. if (wxFlag.weChatModel) {
  1481. $scope.go('bindPhone', {
  1482. params: localStorage.params,
  1483. comfrom: 'maincontroller',
  1484. url: window.location.href.split('#/')[1]
  1485. });
  1486. } else {
  1487. $scope.go('login');
  1488. return;
  1489. }
  1490. } else {
  1491. $scope.go('login');
  1492. return;
  1493. }
  1494. }
  1495. } else {
  1496. $scope.go('login');
  1497. return;
  1498. }
  1499. } else {
  1500. if (list.noSuthority) {
  1501. var alertPopup = $ionicPopup.alert({
  1502. title: '提示',
  1503. template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
  1504. });
  1505. return;
  1506. }
  1507. // console.log(list);
  1508. if (list.otherObj.taskstatus == 5302) {
  1509. taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
  1510. for (var i = 0; i < res.data.length; i++) {
  1511. if (res.data[i] == UserService.id) {
  1512. list.otherObj.actions = list.otherObj.actions + "," + 5324;
  1513. break;
  1514. }
  1515. }
  1516. })
  1517. }
  1518. $scope.go('taskDetail', {
  1519. resid: list.unique,
  1520. node: list.source,
  1521. title: list.title,
  1522. restype: list.type,
  1523. comefrom: 'taskHoll',
  1524. ifjoin: list.otherObj.ifjoin,
  1525. actions: list.otherObj.actions,
  1526. taskstatus: list.otherObj.taskstatus,
  1527. taskid: list.otherObj.id,
  1528. opentowho: list.otherObj.opentowho
  1529. });
  1530. }
  1531. }
  1532. }
  1533. });
  1534. }
  1535. else if (splitArr[i] == 3) {
  1536. taskModuleService.checkTaskDetailPermission(3, UserService.id).then(function (res) {
  1537. if (res.code == 3350) {
  1538. $scope.isVisiableFlag = res.data;
  1539. if (!$scope.isVisiableFlag) {
  1540. taskModuleService.getUserPermissionCheck(list.unique, list.creator, UserService.id).then(function (res) {
  1541. if (res.code == 3350) {
  1542. $scope.isVisiableFlag = res.data;
  1543. if (!$scope.isVisiableFlag) {//true可见,false不可见
  1544. $ionicPopup.confirm({
  1545. title: '确认',
  1546. template: '仅高校院所专家可见,请先认证高校院所专家',
  1547. okText: '去认证',
  1548. cancelText: '取消'
  1549. }).then(function (result) {
  1550. if (result) {
  1551. $scope.go('identifyForm', {
  1552. pageTitle: '高校认证',
  1553. code: 4804,
  1554. action: 'submit'
  1555. });
  1556. } else {
  1557. $scope.go('tab.activityIndex');
  1558. }
  1559. })
  1560. } else {
  1561. if (!ConfigService.islogin) {
  1562. if (localStorage.wxFlag == "true") {
  1563. if (localStorage.isUserFocusXW == 0) {
  1564. var title = localStorage.appidStr;
  1565. $ionicPopup.alert({
  1566. title: '提示',
  1567. template: '请先关注微信公众号"' + title + '"!'
  1568. });
  1569. return;
  1570. } else {
  1571. if (localStorage.isUserBindWx == 0) {
  1572. var wxFlag = JSON.parse(localStorage.params);
  1573. if (wxFlag.weChatModel) {
  1574. $scope.go('bindPhone', {
  1575. params: localStorage.params,
  1576. comfrom: 'maincontroller',
  1577. url: window.location.href.split('#/')[1]
  1578. });
  1579. } else {
  1580. $scope.go('login');
  1581. return;
  1582. }
  1583. } else {
  1584. $scope.go('login');
  1585. return;
  1586. }
  1587. }
  1588. } else {
  1589. $scope.go('login');
  1590. return;
  1591. }
  1592. } else {
  1593. if (list.noSuthority) {
  1594. var alertPopup = $ionicPopup.alert({
  1595. title: '提示',
  1596. template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
  1597. });
  1598. return;
  1599. }
  1600. // console.log(list);
  1601. if (list.otherObj.taskstatus == 5302) {
  1602. taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
  1603. for (var i = 0; i < res.data.length; i++) {
  1604. if (res.data[i] == UserService.id) {
  1605. list.otherObj.actions = list.otherObj.actions + "," + 5324;
  1606. break;
  1607. }
  1608. }
  1609. })
  1610. }
  1611. $scope.go('taskDetail', {
  1612. resid: list.unique,
  1613. node: list.source,
  1614. title: list.title,
  1615. restype: list.type,
  1616. comefrom: 'taskHoll',
  1617. ifjoin: list.otherObj.ifjoin,
  1618. actions: list.otherObj.actions,
  1619. taskstatus: list.otherObj.taskstatus,
  1620. taskid: list.otherObj.id,
  1621. opentowho: list.otherObj.opentowho
  1622. });
  1623. }
  1624. }
  1625. }
  1626. });
  1627. } else {
  1628. if (!ConfigService.islogin) {
  1629. if (localStorage.wxFlag == "true") {
  1630. if (localStorage.isUserFocusXW == 0) {
  1631. var title = localStorage.appidStr;
  1632. $ionicPopup.alert({
  1633. title: '提示',
  1634. template: '请先关注微信公众号"' + title + '"!'
  1635. });
  1636. return;
  1637. } else {
  1638. if (localStorage.isUserBindWx == 0) {
  1639. var wxFlag = JSON.parse(localStorage.params);
  1640. if (wxFlag.weChatModel) {
  1641. $scope.go('bindPhone', {
  1642. params: localStorage.params,
  1643. comfrom: 'maincontroller',
  1644. url: window.location.href.split('#/')[1]
  1645. });
  1646. } else {
  1647. $scope.go('login');
  1648. return;
  1649. }
  1650. } else {
  1651. $scope.go('login');
  1652. return;
  1653. }
  1654. }
  1655. } else {
  1656. $scope.go('login');
  1657. return;
  1658. }
  1659. } else {
  1660. if (list.noSuthority) {
  1661. var alertPopup = $ionicPopup.alert({
  1662. title: '提示',
  1663. template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
  1664. });
  1665. return;
  1666. }
  1667. // console.log(list);
  1668. if (list.otherObj.taskstatus == 5302) {
  1669. taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
  1670. for (var i = 0; i < res.data.length; i++) {
  1671. if (res.data[i] == UserService.id) {
  1672. list.otherObj.actions = list.otherObj.actions + "," + 5324;
  1673. break;
  1674. }
  1675. }
  1676. })
  1677. }
  1678. $scope.go('taskDetail', {
  1679. resid: list.unique,
  1680. node: list.source,
  1681. title: list.title,
  1682. restype: list.type,
  1683. comefrom: 'taskHoll',
  1684. ifjoin: list.otherObj.ifjoin,
  1685. actions: list.otherObj.actions,
  1686. taskstatus: list.otherObj.taskstatus,
  1687. taskid: list.otherObj.id,
  1688. opentowho: list.otherObj.opentowho
  1689. });
  1690. }
  1691. }
  1692. }
  1693. });
  1694. }
  1695. else if (splitArr[i] == 4) {
  1696. taskModuleService.getUserPermissionCheck(list.unique, list.creator, UserService.id).then(function (res) {
  1697. if (res.code == 3350) {
  1698. $scope.isVisiableFlag = res.data;
  1699. if (list.creator != UserService.id && !$scope.isVisiableFlag) {
  1700. $ionicPopup.confirm({
  1701. title: '提示',
  1702. template: '此需求已设置权限,若需了解需求详情,去向发布者申请权限',
  1703. okText: '去申请权限',
  1704. cancelText: '取消'
  1705. }).then(function (result) {
  1706. if (result) {
  1707. $scope.go("tongluPermissionApply", { resource: list });
  1708. } else {
  1709. $scope.go('tab.activityIndex');
  1710. }
  1711. })
  1712. } else {
  1713. if (!ConfigService.islogin) {
  1714. if (localStorage.wxFlag == "true") {
  1715. if (localStorage.isUserFocusXW == 0) {
  1716. var title = localStorage.appidStr;
  1717. $ionicPopup.alert({
  1718. title: '提示',
  1719. template: '请先关注微信公众号"' + title + '"!'
  1720. });
  1721. return;
  1722. } else {
  1723. if (localStorage.isUserBindWx == 0) {
  1724. var wxFlag = JSON.parse(localStorage.params);
  1725. if (wxFlag.weChatModel) {
  1726. $scope.go('bindPhone', {
  1727. params: localStorage.params,
  1728. comfrom: 'maincontroller',
  1729. url: window.location.href.split('#/')[1]
  1730. });
  1731. } else {
  1732. $scope.go('login');
  1733. return;
  1734. }
  1735. } else {
  1736. $scope.go('login');
  1737. return;
  1738. }
  1739. }
  1740. } else {
  1741. $scope.go('login');
  1742. return;
  1743. }
  1744. } else {
  1745. if (list.noSuthority) {
  1746. var alertPopup = $ionicPopup.alert({
  1747. title: '提示',
  1748. template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
  1749. });
  1750. return;
  1751. }
  1752. // console.log(list);
  1753. if (list.otherObj.taskstatus == 5302) {
  1754. taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
  1755. for (var i = 0; i < res.data.length; i++) {
  1756. if (res.data[i] == UserService.id) {
  1757. list.otherObj.actions = list.otherObj.actions + "," + 5324;
  1758. break;
  1759. }
  1760. }
  1761. })
  1762. }
  1763. $scope.go('taskDetail', {
  1764. resid: list.unique,
  1765. node: list.source,
  1766. title: list.title,
  1767. restype: list.type,
  1768. comefrom: 'taskHoll',
  1769. ifjoin: list.otherObj.ifjoin,
  1770. actions: list.otherObj.actions,
  1771. taskstatus: list.otherObj.taskstatus,
  1772. taskid: list.otherObj.id,
  1773. opentowho: list.otherObj.opentowho
  1774. });
  1775. }
  1776. }
  1777. }
  1778. });
  1779. } else {
  1780. if (!ConfigService.islogin) {
  1781. if (localStorage.wxFlag == "true") {
  1782. if (localStorage.isUserFocusXW == 0) {
  1783. var title = localStorage.appidStr;
  1784. $ionicPopup.alert({
  1785. title: '提示',
  1786. template: '请先关注微信公众号"' + title + '"!'
  1787. });
  1788. return;
  1789. } else {
  1790. if (localStorage.isUserBindWx == 0) {
  1791. var wxFlag = JSON.parse(localStorage.params);
  1792. if (wxFlag.weChatModel) {
  1793. $scope.go('bindPhone', {
  1794. params: localStorage.params,
  1795. comfrom: 'maincontroller',
  1796. url: window.location.href.split('#/')[1]
  1797. });
  1798. } else {
  1799. $scope.go('login');
  1800. return;
  1801. }
  1802. } else {
  1803. $scope.go('login');
  1804. return;
  1805. }
  1806. }
  1807. } else {
  1808. $scope.go('login');
  1809. return;
  1810. }
  1811. } else {
  1812. if (list.noSuthority) {
  1813. var alertPopup = $ionicPopup.alert({
  1814. title: '提示',
  1815. template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
  1816. });
  1817. return;
  1818. }
  1819. // console.log(list);
  1820. if (list.otherObj.taskstatus == 5302) {
  1821. taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
  1822. for (var i = 0; i < res.data.length; i++) {
  1823. if (res.data[i] == UserService.id) {
  1824. list.otherObj.actions = list.otherObj.actions + "," + 5324;
  1825. break;
  1826. }
  1827. }
  1828. })
  1829. }
  1830. $scope.go('taskDetail', {
  1831. resid: list.unique,
  1832. node: list.source,
  1833. title: list.title,
  1834. restype: list.type,
  1835. comefrom: 'taskHoll',
  1836. ifjoin: list.otherObj.ifjoin,
  1837. actions: list.otherObj.actions,
  1838. taskstatus: list.otherObj.taskstatus,
  1839. taskid: list.otherObj.id,
  1840. opentowho: list.otherObj.opentowho
  1841. });
  1842. }
  1843. }
  1844. }
  1845. }
  1846. $scope.getTaskList(0);
  1847. // 标签点击事件
  1848. $scope.goToTaskDetail = function (list) {
  1849. // console.log(list);
  1850. if (list.noSuthority) {
  1851. if ($scope.app) {
  1852. UtilService.showMess('未开放查看权限!');
  1853. } else {
  1854. CommonService.showMessage('未开放查看权限!', $scope);
  1855. }
  1856. return;
  1857. }
  1858. if (!ConfigService.islogin) {
  1859. if (localStorage.wxFlag == "true") {
  1860. if (localStorage.isUserFocusXW == 0) {
  1861. var title = localStorage.appidStr;
  1862. $ionicPopup.alert({
  1863. title: '提示',
  1864. template: '请先关注微信公众号"' + title + '"!'
  1865. });
  1866. return;
  1867. } else {
  1868. if (localStorage.isUserBindWx == 0) {
  1869. var wxFlag = JSON.parse(localStorage.params);
  1870. if (wxFlag.weChatModel) {
  1871. $scope.go('bindPhone', {
  1872. params: localStorage.params,
  1873. comfrom: 'maincontroller',
  1874. url: window.location.href.split('#/')[1]
  1875. });
  1876. } else {
  1877. $scope.go('login');
  1878. return;
  1879. }
  1880. } else {
  1881. $scope.go('login');
  1882. return;
  1883. }
  1884. }
  1885. } else {
  1886. $scope.go('login');
  1887. return;
  1888. }
  1889. } else {
  1890. // console.log(list);
  1891. $scope.go('taskDetail', {
  1892. resid: list.unique,
  1893. node: list.source,
  1894. title: list.title,
  1895. restype: list.type,
  1896. comefrom: 'tab.activityIndex',
  1897. ifjoin: list.otherObj.ifjoin,
  1898. actions: list.otherObj.actions,
  1899. taskstatus: list.otherObj.taskstatus
  1900. });
  1901. }
  1902. }
  1903. }
  1904. }
  1905. //点击图片,跳转到武进专家页面
  1906. $scope.jumpToWujingTalents = function (banner) {
  1907. if (banner.title == "wjtest.gif") {
  1908. if (UserService.node == "320412000") {
  1909. $scope.go("academician");
  1910. }
  1911. }
  1912. }
  1913. // 刷新页面
  1914. $scope.doRefresh = function () {
  1915. getActivityInfo();
  1916. $scope.getTaskList(0, 0);
  1917. // $scope.go('tab.activityIndex');
  1918. $scope.lishuiNode = false;
  1919. // console.log(UserService.node);
  1920. if (UserService.node == '320117005' || UserService.node == '320117003' || UserService.node == '320117002' || UserService.node == '320117001' || UserService.node == '320117004') {
  1921. $scope.lishuiNode = true;
  1922. }
  1923. $scope.$broadcast('scroll.refreshComplete');
  1924. };
  1925. $scope.doRefresh()
  1926. // 进入消息详情
  1927. $scope.goMessageDetail = function (index) {
  1928. var message = $scope.myMessageList[index];
  1929. switch ($scope.myMessageList[index].msgTypeModel.mtype) {
  1930. case 2647:
  1931. break;
  1932. case 2645:
  1933. var myMessage = $scope.myMessageList[index];
  1934. if (myMessage.params == null || myMessage.params == undefined) {
  1935. var postscript = myMessage.postscript ? JSON.parse(myMessage.postscript) : {};
  1936. var code = postscript.code;
  1937. myMessage.params = {};
  1938. myMessage.params.code = code;
  1939. }
  1940. $scope.go('identifyStatus', {
  1941. code: $scope.myMessageList[index].params.code,
  1942. id: $scope.myMessageList[index].targetid,
  1943. pageTitle: $scope.myMessageList[index].applytypename,
  1944. type: $scope.myMessageList[index].result,
  1945. });
  1946. break;
  1947. case 2614:
  1948. $scope.go($scope.myMessageList[index].msgTypeModel.url, {
  1949. comfrom: $scope.myMessageList[index].params.comfrom,
  1950. node: $scope.myMessageList[index].params.node,
  1951. orgtype: $scope.myMessageList[index].params.orgtype,
  1952. pagecode: $scope.myMessageList[index].params.pagecode,
  1953. // resid: $scope.myMessageList[index].params.recourceid,
  1954. templettype: $scope.myMessageList[index].params.templettype,
  1955. recourcecomefrom: $scope.myMessageList[index].params.node,
  1956. recourcetype: $scope.myMessageList[index].params.recourcetype,
  1957. title: $scope.myMessageList[index].params.title,
  1958. recourceid: $scope.myMessageList[index].params.recourceid,
  1959. actions: $scope.myMessageList[index].params.actions,
  1960. comefrom: 'tab.activityIndex',
  1961. label: $scope.myMessageList[index].params.label,
  1962. // node: $scope.myMessageList[index].params.node,
  1963. opentype: $scope.myMessageList[index].params.opentype,
  1964. resid: $scope.myMessageList[index].params.resid,
  1965. restype: $scope.myMessageList[index].params.restype,
  1966. taskid: $scope.myMessageList[index].params.taskid,
  1967. taskstatus: $scope.myMessageList[index].params.taskstatus,
  1968. activityid: $scope.myMessageList[index].params.activityid
  1969. });
  1970. // if($scope.myMessageList[index].msgTypeModel.url=='taskDetail'){
  1971. // $scope.go('taskDetail',{
  1972. //
  1973. // })
  1974. // }
  1975. break;
  1976. case 2615:
  1977. $scope.go($scope.myMessageList[index].msgTypeModel.url, {
  1978. comfrom: $scope.myMessageList[index].params.comfrom,
  1979. node: $scope.myMessageList[index].params.node,
  1980. orgtype: $scope.myMessageList[index].params.orgtype,
  1981. pagecode: $scope.myMessageList[index].params.pagecode,
  1982. resid: $scope.myMessageList[index].params.recourceid,
  1983. templettype: $scope.myMessageList[index].params.templettype,
  1984. recourcecomefrom: $scope.myMessageList[index].params.node,
  1985. recourcetype: $scope.myMessageList[index].params.recourcetype,
  1986. title: $scope.myMessageList[index].params.title,
  1987. recourceid: $scope.myMessageList[index].params.recourceid,
  1988. actions: $scope.myMessageList[index].params.actions,
  1989. comefrom: 'tab.activityIndex',
  1990. label: $scope.myMessageList[index].params.label,
  1991. // node: $scope.myMessageList[index].params.node,
  1992. opentype: $scope.myMessageList[index].params.opentype,
  1993. // resid: $scope.myMessageList[index].params.resid,
  1994. restype: $scope.myMessageList[index].params.restype,
  1995. taskid: $scope.myMessageList[index].params.taskid,
  1996. taskstatus: $scope.myMessageList[index].params.taskstatus,
  1997. activityid: $scope.myMessageList[index].params.activityid
  1998. });
  1999. break;
  2000. case 2640:
  2001. $scope.go('authorityApply', {
  2002. content: $scope.myMessageList[index].applyinfo,
  2003. messageId: $scope.myMessageList[index].id,
  2004. type: $scope.myMessageList[index].type
  2005. });
  2006. break;
  2007. case 2641:
  2008. $scope.go('authorityApply', {
  2009. content: $scope.myMessageList[index].applyinfo,
  2010. messageId: $scope.myMessageList[index].id,
  2011. type: $scope.myMessageList[index].type
  2012. });
  2013. break;
  2014. case 2662:
  2015. UserService.isMessage = 1;
  2016. var messageParams = message.postscript ? JSON.parse(message.postscript) : {};
  2017. $scope.go('taskDetail', {
  2018. resid: messageParams.resid,
  2019. node: messageParams.node,
  2020. title: messageParams.title,
  2021. restype: messageParams.restype,
  2022. comefrom: 'tab.activityIndex',
  2023. //ifjoin: params.otherObj.ifjoin,
  2024. actions: messageParams.actions,
  2025. taskstatus: messageParams.taskstatus,
  2026. taskid: messageParams.taskid,
  2027. //opentowho: params.otherObj.opentowho,
  2028. });
  2029. break;
  2030. case 2617:
  2031. $scope.go($scope.myMessageList[index].msgTypeModel.url, {
  2032. Id: $scope.myMessageList[index].creator
  2033. });
  2034. break;
  2035. case 5900:
  2036. $scope.go($scope.myMessageList[index].msgTypeModel.url, {
  2037. activityid: $scope.myMessageList[index].targetid
  2038. });
  2039. break;
  2040. case 2681:
  2041. break;
  2042. case 2682:
  2043. break;
  2044. case 2683:
  2045. break;
  2046. case 2684:
  2047. break;
  2048. case 2685:
  2049. break;
  2050. case 2686:
  2051. break;
  2052. default:
  2053. $scope.go($scope.myMessageList[index].msgTypeModel.url, $scope.myMessageList[index].params);
  2054. }
  2055. }
  2056. $scope.subBannerList = [
  2057. { src: './img/2018/subSliderImg1.jpeg' },
  2058. { src: './img/2018/subSliderImg2.jpeg' },
  2059. ]
  2060. // 获取资源列表
  2061. var length = 10;
  2062. ResourceLibraryService.getResourceLibrary('', UserService.node).then(function (res) {
  2063. // console.log(res);
  2064. if (res.code == 3350) {
  2065. $scope.resourceTitle = res.data;
  2066. angular.forEach($scope.resourceTitle, function (val, index) {
  2067. getAllResList(index, val);
  2068. val.active = false;
  2069. val.itemList = [];
  2070. val.isload = true;
  2071. val.pagenum = 0;
  2072. switch (val.content.length) {
  2073. case 1:
  2074. length += 62;
  2075. break;
  2076. case 2:
  2077. length += 62;
  2078. break;
  2079. case 3:
  2080. length += 78;
  2081. break;
  2082. case 4:
  2083. length += 95;
  2084. break;
  2085. case 5:
  2086. length += 110;
  2087. break;
  2088. case 6:
  2089. length += 126;
  2090. break;
  2091. case 7:
  2092. length += 142;
  2093. break;
  2094. case 8:
  2095. length += 158;
  2096. break;
  2097. case 9:
  2098. length += 174;
  2099. break;
  2100. case 10:
  2101. length += 190;
  2102. break;
  2103. default:
  2104. length += 100;
  2105. }
  2106. })
  2107. //document.getElementById('click-button').style.width = length + 'px';
  2108. $('#click-button-top').css("width", length + 'px');
  2109. // document.getElementById('click-button-top').style.width = length + 'px';
  2110. $scope.changeActiveTitle(0);
  2111. }
  2112. })
  2113. $scope.activeIndex = 0;
  2114. $scope.noData = false;
  2115. var clickFirst = false;
  2116. $scope.allResList = [];
  2117. $scope.changeActiveTitle = function (index) {
  2118. $scope.noData = false;
  2119. if (clickFirst) {
  2120. $ionicScrollDelegate.$getByHandle('calenderContent').scrollTo(top, scrollheight);
  2121. }
  2122. clickFirst = true;
  2123. $scope.activeIndex = index;
  2124. $scope.resourceItemList = [];
  2125. angular.forEach($scope.resourceTitle, function (val) {
  2126. val.active = false;
  2127. })
  2128. $scope.resourceTitle[index].active = true;
  2129. if ($scope.resourceTitle[index].itemList.length == 0) {
  2130. ResourceLibraryService.getDefaultSort($scope.resourceTitle[index].moduleid).then(function (getDefaultSortRes) {
  2131. var sort = getDefaultSortRes.data;
  2132. ResourceLibraryService.getFirstResourceList($scope.resourceTitle[index].moduleid, $scope.resourceTitle[index].parentid, $scope.resourceTitle[index].pagenum, '', sort, 0, 0, '').then(function (res) {
  2133. // console.log(res);
  2134. $scope.resourceItemList = res.data || [];
  2135. $scope.resourceTitle[index].itemList = Object.assign([], res.data);
  2136. $scope.resourceTitle[index].pagenum++;
  2137. if (res.page && $scope.resourceTitle[index].pagenum >= res.page.totalPage) {
  2138. $scope.resourceTitle[index].isload = false;
  2139. // $scope.showNoData=true;
  2140. }
  2141. $scope.noData = $scope.resourceItemList.length == 0;
  2142. })
  2143. })
  2144. } else {
  2145. $scope.resourceItemList = $scope.resourceTitle[index].itemList;
  2146. $scope.noData = $scope.resourceItemList.length == 0;
  2147. }
  2148. // 滚动标题栏
  2149. var allLis = document.querySelectorAll(".click-button-item");
  2150. if (allLis.length > 0) {
  2151. var scrollWidth = allLis[index].offsetLeft;
  2152. // console.log(scrollWidth);
  2153. // console.log(window.innerWidth);
  2154. // console.log(allLis[index].offsetWidth);
  2155. if (scrollWidth > window.innerWidth / 2) {
  2156. $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(scrollWidth - window.innerWidth / 2 + allLis[index].offsetWidth / 2, 0);
  2157. // $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(scrollWidth-window.innerWidth/2+allLis[index].offsetWidth/2,0);
  2158. } else {
  2159. $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(0, 0);
  2160. // $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(0,0);
  2161. }
  2162. }
  2163. }
  2164. $scope.loadMoreData = function () {
  2165. ResourceLibraryService.getDefaultSort($scope.resourceTitle[$scope.activeIndex].moduleid).then(function (getDefaultSortRes) {
  2166. var sort = getDefaultSortRes.data;
  2167. ResourceLibraryService.getFirstResourceList($scope.resourceTitle[$scope.activeIndex].moduleid, $scope.resourceTitle[$scope.activeIndex].parentid, $scope.resourceTitle[$scope.activeIndex].pagenum, '', sort, 0, 0, '').then(function (res) {
  2168. // console.log(res);
  2169. $scope.resourceTitle[$scope.activeIndex].pagenum++;
  2170. $scope.resourceTitle[$scope.activeIndex].itemList = $scope.resourceTitle[$scope.activeIndex].itemList.concat(res.data);
  2171. $scope.resourceItemList = $scope.resourceTitle[$scope.activeIndex].itemList;
  2172. if ($scope.resourceTitle[$scope.activeIndex].pagenum >= res.page.totalPage) {
  2173. $scope.resourceTitle[$scope.activeIndex].isload = false;
  2174. // $scope.showNoData=true;
  2175. }
  2176. $scope.noData = $scope.resourceItemList.length == 0;
  2177. }).finally(function () {
  2178. $scope.$broadcast('scroll.infiniteScrollComplete');
  2179. });
  2180. })
  2181. }
  2182. // web端布局
  2183. var getAllResList = function (index, val) {
  2184. // console.log($scope.resourceTitle[index]);
  2185. ResourceLibraryService.getDefaultSort($scope.resourceTitle[index].moduleid).then(function (getDefaultSortRes) {
  2186. var sort = getDefaultSortRes.data;
  2187. ResourceLibraryService.getFirstResourceList($scope.resourceTitle[index].moduleid, $scope.resourceTitle[index].parentid, 0, '', sort, 0, 0, '').then(function (res) {
  2188. // console.log(res);
  2189. $scope.allResList[index] = {
  2190. name: $scope.resourceTitle[index].name,
  2191. list: res.data,
  2192. val: val
  2193. };
  2194. // console.log($scope.allResList);
  2195. })
  2196. })
  2197. }
  2198. // 进入资源详情
  2199. $scope.goResourceDetail = function (resource, ind) {
  2200. // console.log(resource);
  2201. // console.log($stateParams.libtype);
  2202. if (!$scope.islogin) {
  2203. if (localStorage.wxFlag == "true") {
  2204. if (localStorage.isUserFocusXW == 0) {
  2205. var title = localStorage.appidStr;
  2206. $ionicPopup.alert({
  2207. title: '提示',
  2208. template: '请先关注微信公众号"' + title + '"!'
  2209. });
  2210. return;
  2211. } else {
  2212. if (localStorage.isUserBindWx == 0) {
  2213. var wxFlag = JSON.parse(localStorage.params);
  2214. if (wxFlag.weChatModel) {
  2215. $scope.go('bindPhone', {
  2216. params: localStorage.params,
  2217. comfrom: 'maincontroller',
  2218. url: window.location.href.split('#/')[1]
  2219. });
  2220. } else {
  2221. $scope.go('login');
  2222. return;
  2223. }
  2224. } else {
  2225. $scope.go('login');
  2226. return;
  2227. }
  2228. }
  2229. } else {
  2230. $scope.go('login');
  2231. return;
  2232. }
  2233. } else {
  2234. $scope.go('resourceCommonDetailsPage', {
  2235. recourceid: resource.unique,
  2236. recourcetype: resource.type,
  2237. recourcecomefrom: resource.source,
  2238. creator: resource.clickthrough,
  2239. title: resource.title,
  2240. orgtype: 0,
  2241. // comfrom:$scope.comfrom,
  2242. pagecode: 0,
  2243. label: JSON.stringify(resource.otherObj)
  2244. });
  2245. }
  2246. };
  2247. $scope.goToResList = function (rec) {
  2248. // console.log(rec);
  2249. var reclibc = rec || $scope.resourceTitle[$scope.activeIndex];
  2250. $scope.go('privateResource', {
  2251. reclib: angular.toJson(reclibc),
  2252. privateName: reclibc.name,
  2253. restype: reclibc.moduleid,
  2254. groupid: reclibc.parentid,
  2255. privateContent: reclibc.content,
  2256. authority: reclibc.by5
  2257. })
  2258. }
  2259. $scope.goToTaskList = function () {
  2260. $scope.go('taskHoll');
  2261. }
  2262. //首页显示资源库数据专用
  2263. //初始化资源库列表
  2264. $scope.rescontactflg = 0;//0:本地/云资源库开始查询 2:查询结束
  2265. var tempLocalResourceLibrarylist = [];
  2266. var tempCloudResourceLibrarylist = [];
  2267. var initResourceLibraryList = function () {
  2268. ResourceLibraryService.getResourceLibrary("", UserService.node).then(function (response) {
  2269. console.log('初始化资源', response);
  2270. if (UtilService.isDefined(response.data)) {
  2271. // console.log(response.data);
  2272. // 配置图片
  2273. tempCloudResourceLibrarylist = response.data;
  2274. angular.forEach(tempCloudResourceLibrarylist, function (val) {
  2275. val.logo = [];
  2276. val.logo = val.name == '企业库' ? ['./img/2018/company1.png', './img/2018/company2.jpeg', './img/2018/company3.png']
  2277. : val.name == '高校库' ? ['./img/2018/university1.png', './img/2018/university2.png', './img/2018/university3.png']
  2278. : val.name == '人才库' || val.name == '技术经纪人库' ? ['./img/2018/person1.png', './img/2018/person2.png', './img/2018/person3.png']
  2279. : val.name == '需求库' ? ['./img/2018/demand1.jpg', './img/2018/demand2.jpg']
  2280. : val.name == '成果库' ? ['./img/2018/product1.jpg', './img/2018/product2.jpg', './img/2018/product3.jpg']
  2281. : ['./img/2018/other1-1.jpg', './img/2018/other1-2.jpg', './img/2018/other1-3.jpg'];
  2282. if ($scope.isLiyangApp && val.name == '企业库') {
  2283. val.logo = ['./img/2018/liyang1.jpg', './img/2018/liyang2.jpg', './img/2018/liyang3.jpg'];
  2284. }
  2285. })
  2286. } else {
  2287. tempCloudResourceLibrarylist = [];
  2288. }
  2289. $scope.rescontactflg++;
  2290. $scope.rescontactflg++;
  2291. }, function () {
  2292. tempCloudResourceLibrarylist = [];
  2293. $scope.rescontactflg++;
  2294. $scope.rescontactflg++;
  2295. })
  2296. };
  2297. initResourceLibraryList();
  2298. //节点背景图切换
  2299. var initResourceLibraryNodeBg = function () {
  2300. // $scope.showLoadingToast();
  2301. var clienttype = 0;
  2302. if ($scope.app) {
  2303. clienttype = 1;
  2304. } else {
  2305. clienttype = 2;
  2306. }
  2307. ResourceLibraryService.getResourceLibraryNodeBg(clienttype).then(function (response) {
  2308. $scope.urlBackGImage = response.data;
  2309. if (($scope.urlBackGImage && $scope.urlBackGImage.adlist.length > 0 && $scope.urlBackGImage.adlist[0].sourceName != undefined) || ($scope.urlBackGImage.adlist.length > 0 && $scope.urlBackGImage.adlist[0].sourceName.length > 0)) {
  2310. $scope.sourceBgName = $scope.urlBackGImage.adlist[0].sourceName
  2311. } else {
  2312. $scope.sourceBgName = 'group3/M00/0B/01/wKjILFuI0w2AcHjkAAAaToWtucA883.jpg';
  2313. }
  2314. }, function () {
  2315. })
  2316. }; +
  2317. initResourceLibraryNodeBg();
  2318. //拼接本地与云文件夹(按sort、updatetime排序)
  2319. var connectLocalAndCloud = function () {
  2320. HandleService.connectLocalAndCloud(tempLocalResourceLibrarylist, tempCloudResourceLibrarylist).then(function (response) {
  2321. $scope.resourcelibrarylist = response;
  2322. // console.log(response);
  2323. if ($scope.resourcelibrarylist.length == 0) {
  2324. $scope.shownone = true;
  2325. } else {
  2326. $scope.shownone = false;
  2327. $scope.resinfocount = 0;//资源总数
  2328. // 节点资源总数
  2329. angular.forEach($scope.resourcelibrarylist, function (value) {
  2330. $scope.resinfocount += value.infocount;//资源总数
  2331. if (value.moduleid == ConstantService.CATEGORY_MODULE_8) {
  2332. $scope.resexpertcount = value.infocount;//专家总数
  2333. }
  2334. if (value.moduleid == ConstantService.CATEGORY_MODULE_6) {
  2335. $scope.resorgcount = value.infocount;//企业总数
  2336. }
  2337. if (value.moduleid == ConstantService.CATEGORY_MODULE_2) {
  2338. $scope.resresearchfindingcount = value.infocount;//成果总数
  2339. }
  2340. if (value.moduleid == ConstantService.CATEGORY_MODULE_1) {
  2341. $scope.techrequirementcount = value.infocount;//需求总数
  2342. }
  2343. });
  2344. }
  2345. resourceLibraryTempData.setResourceLibraryList($scope.resourcelibrarylist);
  2346. $scope.hideLoadingToast();
  2347. console.log('resourcelibrarylist', $scope.resourcelibrarylist)
  2348. }, function () {
  2349. $scope.hideLoadingToast();
  2350. })
  2351. };
  2352. connectLocalAndCloud();
  2353. //--监听本地与云文件夹查询是否结束
  2354. $scope.$watch("rescontactflg", function (newValue) {
  2355. if (newValue == 2) {
  2356. //本地与云均无,显示缺省页
  2357. if (tempCloudResourceLibrarylist.length == 0 && tempLocalResourceLibrarylist.length == 0) {
  2358. $scope.shownone = true;
  2359. $scope.resourcelibrarylist = [];
  2360. $scope.hideLoadingToast();
  2361. } else {
  2362. //无云文件夹显示本地
  2363. if (tempCloudResourceLibrarylist.length < 1) {
  2364. $scope.resourcelibrarylist = tempLocalResourceLibrarylist;
  2365. // console.log('来自于父亲的爱', $scope.resourcelibrarylist);
  2366. $scope.hideLoadingToast();
  2367. }
  2368. //无本地文件夹显示云
  2369. if (tempLocalResourceLibrarylist.length < 1) {
  2370. $scope.resourcelibrarylist = tempCloudResourceLibrarylist;
  2371. $scope.hideLoadingToast();
  2372. }
  2373. //本地与云均有去拼接
  2374. if (tempCloudResourceLibrarylist.length > 0 && tempLocalResourceLibrarylist.length > 0) {
  2375. connectLocalAndCloud();
  2376. }
  2377. $scope.shownone = false;
  2378. }
  2379. console.log('最终处理', $scope.resourcelibrarylist)
  2380. $scope.rescontactflg = 0;
  2381. resourceLibraryTempData.setResourceLibraryList($scope.resourcelibrarylist);
  2382. // console.log($scope.resourcelibrarylist);
  2383. }
  2384. });
  2385. //网络异常时点击屏幕重新加载
  2386. $scope.repeatLoad = function () {
  2387. ConfigService.ressynchroflg = true;
  2388. initResourceLibraryList();
  2389. initResourceLibraryNodeBg();
  2390. };
  2391. // //第一次进入才显示溧阳信
  2392. // if ($scope.isLiyangApp && localStorage.goLetterNum == 0 && !$scope.app) {
  2393. // localStorage.goLetterNum++;
  2394. // $scope.go('liyangLetter');
  2395. // }
  2396. //进入资源库首页
  2397. $scope.goResorceLibaryDetail = function (res) {
  2398. console.log('res', res);
  2399. resourceLibraryTempData.setCategoryIndex(0);
  2400. resourceLibraryTempData.resetChecked();
  2401. if (res.moduleid == false && UserService.node == '330122000') {
  2402. window.open("http://app.zjumap.com:7736/#/index", "_blank");
  2403. } else if (res.moduleid == 44) {
  2404. $scope.go('wujingTeacher');
  2405. } else if (res.moduleid == 43) {
  2406. $scope.go('wujingTechnical');
  2407. } else if (res.moduleid == 33) {
  2408. $scope.go("notification");
  2409. } else {
  2410. //进入公共资源库列表
  2411. if (res.fixtype == 1) {
  2412. $scope.go('publicResource', {
  2413. libtype: res.moduleid,
  2414. name: res.name,
  2415. reclibid: $scope.res.id,
  2416. modlibid: res.id
  2417. });
  2418. } else if (res.fixtype == 2) {
  2419. //进入私人资源库列表
  2420. $scope.go('privateResource', {
  2421. res: angular.toJson(res),
  2422. privateName: res.name,
  2423. groupid: res.parentid,
  2424. restype: res.moduleid,
  2425. privateContent: res.content,
  2426. authority: res.by5
  2427. });
  2428. }
  2429. }
  2430. };
  2431. }
  2432. )