12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534 |
- angular.module('push')
- .controller('activityIndexCtrl', function ($scope, $state, $compile, $rootScope, $timeout, HomeService, ActivityService, $ionicScrollDelegate, $ionicSlideBoxDelegate,
- UtilService, HandleService, homepageOfNodeService, UserService, ConfigService, resourceLibraryTempData, roleService, $ionicModal, dataToolsService, taskModuleService, CommonService, $ionicPopup, ResourceLibraryService, $stateParams, AccountService) {
- $scope.node = UserService.node;
- //加载等待页
- $scope.isloadingPageFloor = true;
- if ($scope.app) {
- if (localStorage.getItem("firstInitApp") == 0) {
- $scope.guidePageCom.show();
- }
- }
- var scrollFunc = function () {
- if (ionic.scroll.lastTop > 440) {
- $scope.addtransparent = true
- } else {
- $scope.addtransparent = false
- }
- }
- console.log("----------", $scope.ddd)
- //给页面绑定滑轮滚动事件
- if (document.addEventListener) { //firefox
- document.addEventListener('DOMMouseScroll', scrollFunc, false);
- }
- //滚动滑轮触发scrollFunc方法 //ie 谷歌
- var move = 'ontouchmove' in document ? 'touchmove' : 'onmousewheel'
- if ('ontouchmove' in document) {
- window.ontouchmove = document.ontouchmove = scrollFunc;
- } else {
- window.onmousewheel = document.onmousewheel = scrollFunc;
- }
- //跳转引导页(如果用户第一次登陆app就显示),
- // if ($scope.app) {
- // $rootScope.db.transaction(function (tx) {
- // tx.executeSql('SELECT count(*) AS mycount FROM guidepage', [], function (tx, rs) {
- // if (rs.rows.item(0).mycount == 0) {
- // //如果为0的话就意味着是第一次登陆
- // $scope.guidePageCom.show();
- // }
- // }, function (tx, error) {
- // console.log('SELECT error: ' + error.message);
- // });
- // });
- // }
- $scope.platformname = UserService.nodename;
- $scope.defaultLan = UserService.defaultLan;
- // 获取溧阳token
- var arr1 = window.location.href.split('token=');
- if (arr1[1]) {
- var arr2 = arr1[1].split('#/');
- var token = arr2[0];
- ActivityService.liyangLogin(token).then(function (res) {
- // console.log(res);
- if (res.code == 3350) {
- ConfigService.islogin = true;
- $scope.islogin = true;
- localStorage.setItem("mobile", res.data.mobile);
- //存储密码用作自动登录
- localStorage.setItem("password", res.data.password);
- UserService.id = res.data.userid;
- AccountService.getUserInfo().then(function (response) {
- UserService.user = response.data;
- UserService.role = response.data.userRoleList;
- })
- }
- })
- }
- // console.log($stateParams);
- document.title = UserService.nodename;
- $scope.showtask = UserService.node != '320481000';
- if ($scope.isLiyangApp) {
- // $(".tab_hide").hide();
- localStorage.showNoticeMask = true;
- }
- //TODO
- if ($scope.app) {
- $scope.setStatusBar(1);
- }
- $scope.$on("$ionicView.beforeEnter", function () {
- //TODO
- if ($scope.app) {
- $scope.setStatusBar(1);
- }
- });
- var sysUsersInfo = {};
- $scope.islogin = ConfigService.islogin;
- // if (device.platform != "Android") {
- // if (flg == 0) {
- // StatusBar.styleDefault();//黑色
- // } else {
- // StatusBar.styleLightContent();//白色
- // }
- // }
- // 保存节点信息
- if (localStorage.node) {
- UserService.node = localStorage.node;
- UserService.nodename = localStorage.nodename;
- } else {
- if (!$scope.isLiyangApp && !$scope.isWujingApp) {
- $scope.go('chooseNodeIndex');
- }
- }
- // 轮播
- var hasSwipe = true;
- var mySwiper;
- var startSwipe = function () {
- mySwiper = new Swiper('.swiper-container', {
- slidesPerView: 'auto',
- grabCursor: true,
- centeredSlides: true,
- loop: true,
- autoplay: {
- delay: 10000,
- disableOnInteraction: false,
- },
- on: {
- tap: function (e) {
- if (this.clickedIndex % 4 == 0 || this.clickedIndex == 0) {
- if (UserService.node == "320412000") {
- $scope.go("academician");
- }
- if (UserService.node == "320481000") {
- $scope.go("suzheng");
- }
- } else if ((this.clickedIndex % 5 == 0 || this.clickedIndex == 1) && (localStorage.node == '320412000')) {
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- return;
- }
- if (sysUsersInfo.authenstatus == 5100) {
- $scope.go('identifyForm', {
- pageTitle: '技术经纪人',
- code: 4801,
- type: sysUsersInfo.authenstatus,
- id: sysUsersInfo.id,
- action: 'submit',
- comfrom: 'tab.activityIndex'
- });
- } else {
- $scope.go('identifyStatus', {
- pageTitle: '技术经纪人',
- code: 4801,
- type: sysUsersInfo.authenstatus,
- id: sysUsersInfo.id,
- action: 'submit',
- comfrom: 'tab.activityIndex'
- });
- }
- } else {
- $scope.go('bannerContent')
- }
- }
- }
- })
- // mySwiper.updateProgress();
- }
- // $scope.showLoadingToast();
- $scope.comfromWeb = sessionStorage.comfrom == 'web';
- $scope.updataversion = "none";//有版本更新时显示;
- $('.tab_hide').css("display", "none");//背景遮层
- $scope.showloadBar = false;//进度条
- // $scope.hideupdate = true;
- $scope.hideupdate = false;
- $rootScope.homeBadge = 10;
- $scope.showtoast = false;//签到弹窗
- $scope.reclib = {
- id: 0,// 资源库文件夹id-武进库
- reclibid: 0,// 资源库细分文件夹id-需求库
- name: "",
- moduleid: 0
- };
- $scope.getNodeInfo = function () {
- $scope.node = UserService.node;//节点号
- $scope.nodename = UserService.nodename;//节点号名称
- };
- $scope.getNodeInfo();
- setInterval(function () {
- $scope.$watch(UserService.node, function () {
- $scope.nodename = UserService.nodename;
- });
- }, 100);
- /*检测更新*/
- var checkUpdate = function () {
- var devicetype = device.platform == "Android" ? 0 : 1;
- HomeService.checkUpdate(devicetype).then(function (response) {
- // HomeService.checkUpdate(1).then(function (response) {
- $scope.checkUpdateInfo = response.data;
- if ($scope.checkUpdateInfo.status != 0) {
- $scope.updatestatus = $scope.checkUpdateInfo.status;
- $scope.version = $scope.checkUpdateInfo.version;
- $rootScope.verno = $scope.checkUpdateInfo.version;
- $scope.isexitapp = $scope.checkUpdateInfo.isexitapp;
- }
- //APK更新
- if ($scope.checkUpdateInfo.status == 1) {
- if ((devicetype == 0 && $scope.checkUpdateInfo.andriodstatus == 0) || (devicetype == 1 && $scope.checkUpdateInfo.iosstatus == 0)) {
- $scope.updataversion = "block";
- $scope.hideupdate = true;
- $scope.showloadBar = false;
- $('.tab_hide').css("display", "block");
- }
- }
- //www更新
- // if ( $scope.checkUpdateInfo.status == 2) {
- // $scope.updataversion = "block";
- // $scope.hideupdate = true;
- // $('.tab_hide').css("display", "block");
- // }
- }, function () {
- });
- };
- //TODO --注释放开
- if ($scope.app) {
- checkUpdate();
- }
- //android更新
- $scope.updateversion = function () {
- if ($scope.updatestatus == 1) {
- if (device.platform == "Android") {
- if ($scope.isLiyangApp) {
- cordova.InAppBrowser.open("http://sj.qq.com/myapp/detail.htm?apkName=com.liyang.liyangapp", '_system', 'location=yes');
- } else {
- //app在线下载(自动更新)
- $scope.updateAuto();
- //app打开应用宝开始下载
- //cordova.InAppBrowser.open("http://sj.qq.com/myapp/detail.htm?apkName=com.push.pushapp", '_system', 'location=yes');
- }
- } else {
- cordova.InAppBrowser.open("https://itunes.apple.com/us/app/push科技/id1218178687?mt=8", '_system', 'location=yes');
- }
- }
- if ($scope.updatestatus == 2) {
- $scope.showloadBar = true;
- $scope.checkForUpdates();
- }
- $scope.updataversion = "none";
- $scope.hideupdate = false;
- $('.tab_hide').css("display", "none");
- };
- //取消更新版本
- $scope.cancleupdateversion = function () {
- $scope.hideupdate = false;
- if ($scope.isexitapp == 1) {
- //直接关闭app
- ionic.Platform.exitApp();
- }
- $scope.updataversion = "none";
- $('.tab_hide').css("display", "none");
- };
- $scope.doUpdate = function () {
- $ionicDeploy.update().then(function (res) {
- // console.log(res);
- }, function () {
- }, function (prog) {
- var loadPercent = parseInt(prog) + "%";
- $("#loadpercent").html(loadPercent);
- $('.progress-bar').css({ 'width': loadPercent });
- });
- };
- // 当前版本号
- $rootScope.verno = angular.copy(ConfigService.versionno);
- //web端检测更新
- var checkUpdatesForWeb = function () {
- ActivityService.checkUpdatesForWeb($rootScope.verno).then(function (res) {
- if (res.code == 3350 && res.data == true) {
- //$scope.clearNavigatorCokkier();
- }
- })
- }
- //代码有Bug,该功能暂时不使用
- //checkUpdatesForWeb();
- //检测更新
- $scope.checkForUpdates = function () {
- $ionicDeploy.check($rootScope.verno).then(function (hasUpdate) {
- $scope.hasUpdate = hasUpdate;
- if (hasUpdate) {
- $scope.doUpdate();
- }
- }, function (err) {
- })
- };
- //版本更新,清除浏览器记录
- $scope.clearNavigatorCokkier = function () {
- var keys = document.cookie.match(/[^ =;]+(?==)/g)
- if (keys) {
- for (var i = keys.length; i--;) {
- document.cookie = keys[i] + '=0;path=/;expires=' + new Date(0).toUTCString() // 清除当前域名下的,例如:m.ratingdog.cn
- document.cookie = keys[i] + '=0;path=/;domain=' + document.domain + ';expires=' + new Date(0).toUTCString() // 清除当前域名下的,例如 .m.ratingdog.cn
- document.cookie = keys[i] + '=0;path=/;domain=ratingdog.cn;expires=' + new Date(0).toUTCString() // 清除一级域名下的或指定的,例如 .ratingdog.cn
- }
- }
- }
- //app在线下载(自动更新)
- $scope.updateAuto = function () {
- //var textStr = "测试代码";测试服务器svn时间
- var source = 'http://pic.ubittc.com/group3/M00/0B/14/wKgBd10etCiAH7eRAAB6AIZYBWw073.apk';
- var target = "/Download/pushkeji.apk";
- var trustAllHosts = true;
- var options = {};
- var fileTransfer = new FileTransfer();
- function successCallback(entry) {
- cordova.plugins.fileOpener2.open(
- target,
- 'application/vnd.android.package-archive'
- );
- $ionicLoading.hide();
- }
- function errorCallback(error) {
- $ionicLoading.show({
- template: "下载失败"
- });
- $timeout(function () {
- $ionicLoading.hide()
- }, 2000);
- }
- fileTransfer.download(source, target, successCallback, errorCallback, trustAllHosts, options);
- fileTransfer.onprogress = function (progressEvent) {
- if (progressEvent.lengthComputable) {
- $ionicLoading.show({
- template: "已经下载:" + Math.floor((progressEvent.loaded / progressEvent.total) * 100) + "%"
- });
- }
- }
- };
- $scope.ButtonShow = ['走访记录', '企业库', '数据看板', '培育库']
- homepageOfNodeService.getNodeAuth(UserService.node).then(function (res) {
- $scope.isUserManager = res.data;
- })
- // 获取活动首页所有信息(宣传图、我的消息、最近的活动、最近的需求反馈)
- var getActivityInfo = function () {
- // $scope.showLoadingToast();
- var clienttype = 0;
- if ($scope.app) {
- clienttype = 1;
- } else {
- clienttype = 2;
- }
- ActivityService.getActivityInfo(clienttype, 0).then(function (response) {
- console.log('index/all', response)
- //关闭启动动画
- //TODO
- if ($scope.app) {
- $timeout(function () {
- navigator.splashscreen.hide();
- }, 1000);
- }
- // $scope.hideLoadingToast();
- $scope.menulist = response.data && response.data.menulist ? response.data.menulist : [];
- // $scope.menulist.push({
- // title:'技术经纪人',
- // url:'identifyForm',
- // icon:'./img/2018/technical_broker.png'
- // });
- // $scope.menulist.push({
- // title:'任务',
- // url:'taskHoll',
- // icon:'./img/2018/task-org.png'
- // });
- // $scope.menulist.push({
- // title:'活动',
- // url:'activitiesHoll',
- // icon:'./img/2018/activities.png'
- // });
- angular.forEach($scope.menulist, function (val) {
- // 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;
- // val.noticeContent=val.title=='技术经纪人'?'快速认证经纪经纪人,领取普适币':val.title=='任务'?'快速进入任务大厅,赚取普适币':'';
- val.hasNotice = (val.noticeContent != null && val.noticeContent != '' && val.noticeContent != "");
- if (val.title == "报表管理") {
- val.hasNotice = false;
- }
- var title = val.title;
- val.wholePicUrl = ConfigService.imgurl + val.icon;
- val.picflag = (title == "技术经纪人" || title == "活动" || title == "需求") ? "1" : "2";
- })
- if (!localStorage.showNoticeMask) {
- $scope.showNoticeMask = true;
- $(".notice-mask").show();
- $(".tab_hide").show();
- $scope.changeNotice();
- }
- //
- // if(mySwiper){
- // mySwiper.slideTo (0);
- // mySwiper.destroy(true)
- // }
- startSwipe();
- $scope.bannerlist = response.data && response.data.adlist ? response.data.adlist : [];//首页宣传图
- console.log("response.data:", response.data);
- sysUsersInfo = response.data && response.data.sysUsersInfo ? response.data.sysUsersInfo : {
- authenstatus: 5100,
- id: 0
- };
- $scope.myMessageList = response.data && response.data.messagelist ? response.data.messagelist : [];
- angular.forEach($scope.myMessageList, function (val) {
- // if(val.msgTypeModel){
- // switch (val.msgTypeModel.mtype){
- // case 2647 :val.title='有人对 '+val.infoname+' 录入了信息';break;
- // case 2645 :val.title=val.applytypename+" "+val.authenstatusname;val.params=val.params?JSON.parse(val.postscript):{};break;
- // case 2614 :val.params=val.postscript?JSON.parse(val.postscript):{};val.title='有人评论了 '+val.params.title;break;
- // case 2646 :val.title='有人走访了 '+val.infoname;break;
- // case 2615 :val.params=val.postscript?JSON.parse(val.postscript):{};val.title='有人点赞了 '+val.params.title;break;
- // case 2640 :val.title='有人申请权限,请审核!';break;
- // case 2641 :val.title='您申请的权限已被处理,请查看!';break;
- // case 2617 :val.params=val.postscript?JSON.parse(val.postscript):{};val.title=val.msgTypeModel.content;break;
- // 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;
- // default:val.params=val.postscript?JSON.parse(val.postscript):{};val.title=val.resultmark;
- // }
- // }
- val.params == val.postscript ? JSON.parse(val.postscript) : {};
- })
- angular.forEach($scope.myMessageList, function (val) {
- // console.log("resultmark=" + val.resultmark + "===标志===:" + val.by2);
- })
- $scope.myMessageList != '' && $scope.myMessageList != [] ? $scope.myMessageList.push($scope.myMessageList.slice(0, 1)[0]) : '';
- // $scope.myMessageList =[
- // {msgTypeModel:{content:'第一條消息'},createtime:'2018-10-10'},
- // {msgTypeModel:{content:'第二條消息'},createtime:'2018-10-10'},
- // {msgTypeModel:{content:'第三條消息'},createtime:'2018-10-10'},
- // {msgTypeModel:{content:'第四條消息'},createtime:'2018-10-10'},
- // {msgTypeModel:{content:'第五條消息'},createtime:'2018-10-10'},
- // {msgTypeModel:{content:'第六條消息'},createtime:'2018-10-10'},
- // ]
- /*5.0版本未调整此部分功能,暂时未取值,注释*/
- /*$scope.myMessageList = response.message;//最新6条消息
- if (angular.isDefined(response.activity)) {
- $scope.newactivity = response.activity[0];//我的最近活动
- }
- if (response.followup.list.length > 0) {
- $scope.folupcount = response.followup.count;
- $scope.actfolup = response.followup.list[0];//我的需求反馈
- }*/
- // 宣传图渲染
- // $timeout(function () {
- // $ionicSlideBoxDelegate.$getByHandle("adBanner").update();
- // }, 50);
- // console.log(mySwiper);
- //
- // if(mySwiper) {
- // console.log(mySwiper);
- // //销毁swiper
- // mySwiper.removeAllSlides();
- // }
- $scope.isloadingPageFloor = false;
- }, function () {
- })
- };
- getActivityInfo();
- // 首页搜索入口
- $scope.goIndexSearch = function () {
- $scope.go("indexSearchReasult");
- };
- // 各模块快捷入口页面跳转
- $scope.jumpPage = function (pageindex) {
- $scope.islogin = ConfigService.islogin;
- switch (pageindex) {
- case 0:
- // 对接宝
- $scope.go("abutmentHome");
- break;
- case 1:
- // 活动中心
- //$scope.go("activityCenter");
- UtilService.showMess("功能正在完善中,敬请期待!");
- break;
- case 2:
- // 普适币
- $scope.go("psMoneyHome");
- break;
- case 3:
- // 我的群组
- break;
- case 4:
- //关注用户
- $scope.go("fancenter", { act: 'activity' });
- break;
- case 5:
- break;
- case 6:
- //技术经纪人
- $scope.go("technicalBrokerButtonSummary");
- break;
- case 7:
- //走企业
- $scope.go("technicalBrokerEnterCompanyInfo");
- break;
- case 8:
- //录入
- if (!$scope.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go("recordInfoAccount");
- }
- break;
- case 9:
- //录入
- $scope.go("reportTypeList");
- break;
- default:
- break;
- }
- };
- // 活动页面快捷入口路由跳转
- $scope.goNextPage = function (index, act) {
- switch (index) {
- case 1:
- // 通知
- $scope.go("activityNotice", { activityid: act.id, title: act.title });
- break;
- case 2:
- // 通知管理
- $scope.go("activityNoticeManger", {
- activityid: act.id,
- title: act.title,
- status: act.status,
- days: act.activityLeaveDays
- });
- break;
- case 3:
- // 报名
- $scope.go("activitySignUpConfirm", { activityid: act.id });
- break;
- case 4:
- // 高校报名管理
- $scope.go("activitySchoolSignUpManger", {
- activityid: act.id,
- title: act.title,
- visittime: act.visitclosingdate
- });
- break;
- case 5:
- // 企业报名管理
- $scope.go("activityCompanySignUpManger", {
- activityid: act.id,
- title: act.title,
- visittime: act.visitclosingdate
- });
- break;
- case 6:
- // 参与企业
- $scope.go("activityCompanyList", { activityid: act.id });
- break;
- case 7:
- // 活动统计
- $scope.go("activityStatistics", { activityid: act.id });
- break;
- case 8:
- // 活动安排管理
- $scope.go("activityArrangeManger", { activityid: act.id });
- break;
- case 9:
- // 签到
- checkIn(act.id);
- break;
- case 10:
- // 反馈(1、非企业用户:1.1 未填写过进入填写页面,1.2 已填写过进入列表 2、企业用户:填写本企业的走访反馈列表)
- if (UserService.role[0] <= 8 && UserService.role[0] != 1) {
- ActivityService.checkFollowupInfo(act.id).then(function (response) {
- if (response.result == 0) {
- $scope.go("activityFeedBack", { activityid: act.id, title: act.title });
- } else {
- $scope.go("activityFeedBackList", { activityid: act.id, title: act.title });
- }
- }, function () {
- });
- } else {
- $scope.go("activityCompanyViewFeedList", { activityid: act.id });
- }
- break;
- case 11:
- // 活动安排
- if (UserService.role[0] <= 8 && UserService.role[0] != 1) {
- $scope.go("activityArrange", { activityid: act.id });
- } else {
- $scope.go("activityCompanyArrange", { activityid: act.id });
- }
- break;
- case 12:
- // 反馈管理
- $scope.go("activityBackManger", { activityid: act.id });
- break;
- case 13:
- // 签到管理
- $scope.go("activitySignManger", { activityid: act.id });
- break;
- case 14:
- // 备案
- $scope.go("activityRecord");
- break;
- case 15:
- // 备案管理
- $scope.go("activityReacordManger");
- break;
- case 16:
- // 选择企业
- $scope.go("activityChooseCompany", { activityid: act.id });
- break;
- case 17:
- // 报名信息
- $scope.go("activitySignUpInfo", { activityid: act.id });
- break;
- case 18:
- // 选择专家
- $scope.go("activityChooseTeacher", { activityid: act.id });
- break;
- default:
- break;
- }
- };
- // 获取模版列表的传参
- $scope.roleModel =
- {
- //TODO
- funid: 2,//所属功能:1走访、2录入等
- roleidList: []// 角色数组
- };
- //根据角色获取所有模版
- $scope.rolePageList = [];
- $scope.roleModel.roleidList.push(0);// 角色默认一笔0,否则后台 in查询会报错
- var getRolePageList = function () {
- if (UtilService.isDefined(UserService.role)) {
- angular.forEach(UserService.role, function (value, index) {
- $scope.roleModel.roleidList.push(value.roleid);
- });
- }
- $scope.roleModel.node = UserService.node;
- //==============根据角色获取所有模版================
- console.log('角色传参', $scope.roleModel, UserService);
- roleService.getRolePageList($scope.roleModel).then(function (response) {
- console.log('来自于大家觉得', response);
- // 模版列表
- $scope.rolePageList = response.data;
- angular.forEach($scope.rolePageList, function (val) {
- val.logo = val.pagename == '基本信息' ? 'iconfont-basic-info'
- : val.pagename == '需求信息' ? 'iconfont-demand'
- : val.pagename == '成果信息' ? 'iconfont-achievement'
- : val.pagename == '产品信息' ? 'iconfont-product'
- : val.pagename == '专利信息' ? 'iconfont-patents'
- : val.pagename == '人才信息' ? 'iconfont-talents'
- : val.pagename == '月报表' ? 'iconfont-report-form'
- : val.pagename == '项目转化' ? 'iconfont-transform'
- : val.pagename == '对接录入' ? 'iconfont-butt-joint'
- : 'ion-compose';
- })
- // console.log($scope.rolePageList);
- }, function () {
- })
- };
- /*
- app5.0开发,功能未调整,不展示,注释
- // 活动是否弹出签到弹窗(否临时人员:弹窗,已报名:直接签到)
- var activityid = 0;
- var checkIntime = function (actid) {
- activityid = actid;
- $scope.showLoadingToast();
- ActivityService.checkIntime(activityid).then(function (response) {
- // console.log(response);
- if (response.result == 1) {
- $scope.userinfo = response.userinfo;
- $scope.showtoast = true;
- $scope.hideLoadingToast();
- } else {
- }
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- // 签到
- var checkIn = function (actid) {
- ActivityService.getCheckInStatus(actid).then(function (response) {
- // 0未签到,1已签到
- if (response.result == 0) {
- ActivityService.checkIn(actid, ConfigService.location.lat, ConfigService.location.lng).then(function (response) {
- // console.log(response);
- if (response.result == 1) {
- UtilService.showMess("签到成功");
- getActivityInfo();
- } else {
- UtilService.showMess("网络不给力,请重试");
- }
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- UtilService.showMess("网络不给力,请重试");
- });
- } else {
- UtilService.showMess("您已成功签到");
- $scope.hideLoadingToast();
- }
- }, function () {
- UtilService.showMess("网络不给力,请重试");
- $scope.hideLoadingToast();
- });
- };
- // 临时人员签到
- $scope.tempCheckin = function () {
- $scope.showLoadingToast();
- ActivityService.tempCheckIn(activityid, ConfigService.location.lat, ConfigService.location.lng, $scope.userinfo).then(function (response) {
- // console.log(response);
- if (response.result == 1) {
- UtilService.showMess("签到成功");
- getActivityInfo();
- $timeout(function () {
- $scope.showtoast = false;
- }, 300);
- } else {
- UtilService.showMess("网络不给力,请重试");
- }
- $scope.hideLoadingToast();
- }, function () {
- UtilService.showMess("网络不给力,请重试");
- $scope.hideLoadingToast();
- });
- };
- // 检查活动当天是否有弹框
- $scope.ifshowResourceWrapFloor = false;
- var checkIspopup = function (moduletype) {
- $scope.showLoadingToast();
- ActivityService.checkIspopup(moduletype).then(function (response) {
- if (response.result == 1) {
- // 获取弹框内容
- getPopupDetail(moduletype);
- $scope.ifshowResourceWrapFloor = true;
- $scope.showResourceWrapFloor = true;
- $("ion-nav-view[name='tab-activityIndex']").css("z-index","8");
- $scope.hideLoadingToast();
- } else {
- $scope.ifshowResourceWrapFloor = false;
- }
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- checkIspopup(0);
- // 获取弹框详情
- var getPopupDetail = function (moduletype) {
- $scope.showLoadingToast();
- ActivityService.getPopupDetail(moduletype).then(function (response) {
- $scope.popupinfo = response;
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- getPopupDetail(0);
- // 查询用户是否输入正确过口令
- $scope.keywordid = 0;
- $scope.ifpostuserkeyword = 0;
- var checkUserKeyword = function (keywordid) {
- ActivityService.checkUserKeyword(keywordid).then(function (response) {
- // 口令id
- $scope.ifpostuserkeyword = response.result;
- }, function () {
- })
- };
- // 判断用户是否有文件夹权限
- $scope.ifhasvisitauth = 2;
- var checkUserAuthority = function () {
- ActivityService.getAuthority().then(function (response) {
- // 有权限1,没有权限2
- $scope.ifhasvisitauth = response.result;
- }, function () {
- })
- };
- // 查询口令的id
- var getkeywordid = function (moduletype) {
- ActivityService.getkeywordid(moduletype).then(function (response) {
- // 口令id
- $scope.keywordid = response.keywordid;
- console.log($scope.keywordid);
- checkUserKeyword($scope.keywordid);
- checkUserAuthority();
- }, function () {
- })
- };
- getkeywordid(0);
- // 输入口令正确,用户获取文件夹权限
- var setAuthority = function (claid) {
- ActivityService.setAuthority(claid).then(function (response) {
- // console.log("设置文件夹权限成功" + response.result);
- }, function () {
- })
- };
- //进入资源库文件夹列表方法
- var goResourceLib = function (id, reclibid, name, linktype) {
- $scope.reclib.id = id;// 资源库文件夹id-武进库
- $scope.reclib.reclibid = reclibid;// 资源库细分文件夹id-需求库
- $scope.reclib.name = name;
- $scope.reclib.moduleid = linktype;// 模块对应的moduleid:6,7,8
- console.log($scope.reclib);
- $scope.go('resourceLibraryPrivate', {reclib: angular.toJson($scope.reclib)});
- };
- // 查询用户输入口令是否正确
- $scope.submitActPas = function (actPassword) {
- ActivityService.postKeyword($scope.keywordid, actPassword).then(function (response) {
- // console.log("aa1:"+response);
- if (response.result == 1) {
- // 输入正确,继续
- $("#consoleHtm").html("口令输入正确");
- // 设置为0,则后台取配置信息
- setAuthority(0);
- $scope.ifpostuserkeyword = 1;
- $scope.ifhasvisitauth = 1;
- // 口令正确,自动进入资源库
- // console.log($scope.popupinfo.popupdetaillist.length);
- // console.log("aa:"+$scope.popupinfo.popupdetaillist[0].detailtitle);
- if ($scope.popupinfo.popupdetaillist.length > 0) {
- goResourceLib($scope.popupinfo.popupdetaillist[0].url,
- $scope.popupinfo.popupdetaillist[0].claid,
- $scope.popupinfo.popupdetaillist[0].detailtitle,
- $scope.popupinfo.popupdetaillist[0].linktype);
- }
- } else if (response.result == 2) {
- // 输入错误
- $("#consoleHtm").html("口令输入错误");
- }
- }, function () {
- })
- };
- //进入资源库文件夹列表
- $scope.goSomeWhere = function (id, reclibid, name, linktype) {
- console.log(name);
- goResourceLib(id, reclibid, name, linktype);
- };
- // 关闭签到弹窗
- $scope.btnHide = function () {
- $timeout(function () {
- $scope.showtoast = false;
- }, 300);
- };*/
- // 进入需求反馈详情页
- $scope.goFolUpDetail = function () {
- $scope.go("activityFeedBackListContent", { folupid: $scope.actfolup.id });
- };
- // 进入需求反馈列表
- $scope.goFeedBackList = function () {
- $scope.go("activityFeedBackList", { activityid: $scope.actfolup.aid, title: $scope.actfolup.activityname });
- };
- //关闭启动动画
- if ($scope.app) {
- $timeout(function () {
- //TODO
- navigator.splashscreen.hide();
- }, 1000);
- }
- if ($scope.app && device.platform != "Android") {
- $scope.isIosPlatform = true;
- }
- $scope.hastask = true;//控制标题栏内容是否显示
- $scope.isScrollEnough = false;
- $scope.showInBody = true;
- // var scrollheight=document.getElementById('click-button').offsetTop;
- var scrollheight;
- /*$timeout(function () {
- scrollheight = document.getElementById('click-position').offsetTop;
- }, 1000)*/
- $scope.getScrollPosition = function () {
- var position = $ionicScrollDelegate.getScrollPosition().top;//取这个ion-content滑动TOP值
- // console.log(position);
- if (position > scrollheight) { //当滚动距离大于250px时执行下面的东西
- $scope.showInBody = false;
- $timeout(function () {
- var scrollWidth = document.querySelector('#click-button-top>li.resource-active').offsetLeft;
- var width = document.querySelector('#click-button-top>li.resource-active').offsetWidth;
- if (scrollWidth > window.innerWidth / 2) {
- // $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(scrollWidth-window.innerWidth/2+allLis[index].offsetWidth/2,0);
- $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(scrollWidth - window.innerWidth / 2 + width / 2, 0);
- } else {
- // $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(0,0);
- $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(0, 0);
- }
- }, 0);
- } else {//当滚动距离小于250的时候执行下面的内容,也就是让导航栏恢复原状
- $scope.showInBody = true;
- $timeout(function () {
- /*var scrollWidth = document.querySelector('#click-button>li.resource-active').offsetLeft;
- var width = document.querySelector('#click-button>li.resource-active').offsetWidth;
- if (scrollWidth > window.innerWidth / 2) {
- $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(scrollWidth - window.innerWidth / 2 + width / 2, 0);
- // $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(scrollWidth-window.innerWidth/2+allLis[index].offsetWidth/2,0);
- } else {
- $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(0, 0);
- // $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(0,0);
- }*/
- }, 0);
- }
- $scope.$apply();//触发用以更新view
- };
- //弹出各类按钮
- $scope.showAnthorBtnWrap = false;
- $scope.showAnthorBtn = function () {
- $scope.islogin = ConfigService.islogin;
- if (!$scope.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.showAnthorBtnWrap = true;
- getRolePageList();
- $("ion-nav-view[name='tab-activityIndex']").css("z-index", "8");
- }
- };
- var hideAnthorBtnf = function () {
- $scope.showAnthorBtnWrap = false;
- $("ion-nav-view[name='tab-activityIndex']").css("z-index", "1");
- };
- $scope.hideAnthorBtnWrap = function () {
- $scope.showAnthorBtnWrap = false;
- $("ion-nav-view[name='tab-activityIndex']").css("z-index", "1");
- };
- $scope.goTaskReceive = function () {
- //$scope.go("technicalBrokerSelfReceiveTask");
- UtilService.showMess("功能正在完善中,敬请期待!");
- };
- $scope.jumpQuick = function (orgtype, pagecode, pagename, id, isedit) {
- if (id == 10) {
- $scope.go('reportEditModal', { pageTitle: '报表录入', pageid: id })
- }
- if (id == 16) {
- $scope.go('dockingInput', {
- comfrom: "dockingInput",
- companyName: "",
- companyid: 0,
- taskId: "",
- taskTitle: ""
- })
- } else {
- if (UserService.node == '330122000' && id == 4) {
- console.log(9999)
- $scope.go('visitModularFormDemand', {
- companyid: 0,
- pageid: id,
- orgtype: orgtype,
- pagecode: pagecode,
- isedit: isedit,
- node: UserService.node,
- pageTitle: '新建录入',
- techtype: 5350
- });
- } else {
- $scope.go('visitModularForm', {
- companyid: 0,
- pageid: id,
- orgtype: orgtype,
- pagecode: pagecode,
- isedit: isedit,
- node: UserService.node,
- pageTitle: '新建录入'
- });
- }
- // if(UserService.node=='320117005'||UserService.node=='320117003'||UserService.node=='320117002'||UserService.node=='320117001'||UserService.node=='320117004'){
- // // $scope.go('typeinAllModal', {companyid: 0, pageid: id, orgtype: orgtype,pagecode:pagecode, isedit: isedit,node:UserService.node});
- // $scope.go('visitModularForm', {companyid: 0, pageid: id, orgtype: orgtype,pagecode:pagecode, isedit: isedit,node:UserService.node,pageTitle:'新建录入'});
- // }else{
- // $scope.go('typeinInformation',{orgtype:orgtype,pagecode:pagecode,pagename:pagename,id:id,isedit:isedit})
- // }
- }
- hideAnthorBtnf();
- };
- //资源库跳转弹窗
- $scope.showResourceWrapFloor = true;
- $scope.showResourceBtn = function () {
- $("ion-nav-view[name='tab-activityIndex']").css("z-index", "8");
- $scope.showResourceWrapFloor = true;
- };
- $scope.resourceBtnHide = function () {
- $("ion-nav-view[name='tab-activityIndex']").css("z-index", "1");
- $scope.showResourceWrapFloor = false;
- };
- //跳转轮播详情页
- $scope.goBannerContent = function () {
- $scope.go('bannerContent')
- };
- // 跳转到选择节点
- $scope.goSelectNode = function () {
- $scope.go('chooseNodeIndex');
- };
- $scope.jumpToPage = function (url, title) {
- $scope.islogin = ConfigService.islogin;
- if (url == 'reward') {
- $scope.go(url);
- } else {
- if (!$scope.islogin) {
- if (url == "technicalBrokerEnterCompanyInfo" || url == "taskHoll" || url == "activitiesHoll" || url == "notification" || url == "linkus") {
- $scope.go(url);
- return;
- } else {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- }
- if (/技术经纪/g.test(title) || "Technical Broker" == title) {
- console.log(sysUsersInfo.authenstatus, url)
- // return;
- var jumpUrl = '';
- if (sysUsersInfo.authenstatus == 5100) {
- jumpUrl = url;
- } else {
- jumpUrl = 'identifyStatus';
- }
- $scope.go(jumpUrl, {
- pageTitle: title,
- code: 4801,
- type: sysUsersInfo.authenstatus,
- id: sysUsersInfo.id,
- action: 'submit',
- comfrom: 'tab.activityIndex'
- });
- } else {
- if (url == "orgInspect") {
- //判断当前用户是不是节点下的管理机构的管理员
- taskModuleService.judgeUserInOrgForTL().then(function (res) {
- console.log(res)
- if (res.code == 3350) {
- $scope.isAdmin = res.data;
- if ($scope.isAdmin) {
- $scope.go('orgInspectList', { isuserlist: false });
- } else {
- taskModuleService.getInspectList(0, '0', '', true).then(function (res) {
- if (res.code == 3350) {
- if (res.data.length > 0) {
- $scope.go('orgInspectList', { isuserlist: true });
- } else {
- $scope.go('orgInspect');
- }
- }
- })
- }
- }
- })
- } else if (title == "企业库") {
- $scope.go('privateResource', {
- res: angular.toJson(url),
- privateName: url.name,
- groupid: url.parentid,
- restype: url.moduleid,
- privateContent: url.content,
- authority: url.by5
- });
- } else if (url == 'Selfcheckentrance') {
- $scope.go(url, { id: title });
- }else if(title=='科技工具'){
- window.open( 'https://cae365.yuansuan.com/')
- }
- else {
- $scope.go(url);
- }
- }
- }
- }
- $scope.changeNotice = function () {
- angular.forEach($scope.menulist, function (value) {
- value.showNotice = false;
- })
- var i = 0;
- for (; i < $scope.menulist.length; i++) {
- if ($scope.menulist[i].hasNotice) {
- $scope.menulist[i].hasNotice = false;
- $scope.menulist[i].showNotice = true;
- $scope.noticeContent = $scope.menulist[i].noticeContent;
- return;
- }
- }
- if (i == $scope.menulist.length) {
- $scope.showNoticeMask = false;
- $(".tab_hide").hide();
- localStorage.showNoticeMask = true;
- }
- }
- $scope.allTaskData = []
- var taskSwiper;
- var taskSwiperFn = function () {
- var num = $scope.isapp ? 2 : 5;
- taskSwiper = new Swiper('.swiper-container-newest-task', {
- // loop: true, // 循环模式选项
- slidesPerView: num,
- spaceBetween: 10,
- initialSlide: 0,
- // hashNavigation: true,
- // 如果需要分页器
- pagination: {
- el: '.swiper-pagination',
- },
- // 如果需要前进后退按钮
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- on: {
- tap: function (e) {
- e.stopPropagation();
- if (e.target.className == 'swiper-button-next') {
- this.slideNext();
- } else if (e.target.className == 'swiper-button-prev') {
- this.slidePrev();
- } else if (this.clickedIndex || this.clickedIndex == 0) {
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- var list = $scope.allTaskData[this.clickedIndex];
- if (list.noSuthority) {
- var alertPopup = $ionicPopup.alert({
- title: '提示',
- template: '自任务发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
- });
- return;
- }
- /*$scope.go('taskDetail', {
- resid: list.unique,
- node: list.source,
- title: list.title,
- restype: list.type,
- comefrom: 'tab.activityIndex',
- ifjoin: list.otherObj.ifjoin,
- actions: list.otherObj.actions,
- taskstatus: list.otherObj.taskstatus,
- taskid: list.otherObj.id,
- opentowho: list.otherObj.opentowho,
- });*/
- }
- }
- }
- },
- // 如果需要滚动条
- // scrollbar: {
- // el: '.swiper-scrollbar',
- // },
- })
- }
- // $scope.showLoadingToast();
- // 获取任务分类标签
- // dataToolsService.getTypeEntryListByTypeName('usertask_type').then(function(res){
- taskModuleService.getAllTaskLable(UserService.node).then(function (res) {
- $scope.labelList = [{
- itemvalue: 0,
- itemkey: '全部',
- isSelected: true
- }];
- if (res.code == 3350) {
- angular.forEach(res.data, function (val) {
- val.isSelected = false;
- })
- $scope.labelList = $scope.labelList.concat(res.data);
- }
- });
- // 获取任务列表
- $scope.getTaskList = function (tasktype, index) {
- if ($scope.labelList) {
- angular.forEach($scope.labelList, function (val) {
- val.isSelected = false;
- })
- $scope.labelList[index].isSelected = true;
- }
- $scope.allTaskData = [];
- $scope.showNoData = false;
- $scope.showLoading = true;
- taskModuleService.getAllTaskList(UserService.node, 0, tasktype, '', 1, 10).then(function (res) {
- $scope.showLoading = false;
- if (res.code == 3350) {
- $scope.allTaskData = res.data;
- angular.forEach($scope.allTaskData, function (val) {
- val.noSuthority = false;
- if (val.otherObj && val.otherObj.creator != UserService.id && val.otherObj.taskstatus == 5300 && !val.otherObj.actions) {
- val.noSuthority = true;
- }
- })
- $scope.showNoData = (res.data && res.data.length == 0);
- //溧阳节点隐藏掉
- $timeout(function () {
- if (taskSwiper && $scope.showtask) {
- taskSwiper.slideTo(0);
- taskSwiper.destroy(true)
- }
- taskSwiperFn();
- }, 200)
- }
- })
- }
- $scope.goTongLuCheckDetail = function (list) {
- if (list.source == '330122000') {
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- var permissionvalue = list.by6;
- var splitArr = [];
- if (permissionvalue == 1 || permissionvalue == 2 || permissionvalue == 3 ||
- permissionvalue == 4 || permissionvalue == 5) {
- splitArr.push(permissionvalue);
- } else if (permissionvalue != null) {
- splitArr = permissionvalue.split(',');
- } else {
- splitArr.push(1);
- }
- for (var i = 0; i < splitArr.length; i++) {
- if (splitArr[i] == 2) {
- taskModuleService.checkTaskDetailPermission(2, UserService.id).then(function (res) {
- if (res.code == 3350) {
- $scope.isVisiableFlag = res.data;
- if (!$scope.isVisiableFlag) {
- taskModuleService.getUserPermissionCheck(list.unique, list.creator, UserService.id).then(function (res) {
- if (res.code == 3350) {
- $scope.isVisiableFlag = res.data;
- if (!$scope.isVisiableFlag) {//true可见,false不可见
- $ionicPopup.confirm({
- title: '确认',
- template: '仅技术经纪人可见,请先认证技术经纪人',
- okText: '去认证',
- cancelText: '取消'
- }).then(function (result) {
- if (result) {
- if ($scope.node == '330122000') {
- $scope.go('identifyFormForTongLu', {
- pageTitle: '技术经纪人认证',
- code: 4801,
- type: 5100,
- id: UserService.userid
- });
- }
- if ($scope.node == '320412000') {
- $scope.go('identifyForm', {
- pageTitle: '技术经纪人认证',
- code: 4801,
- type: 5100,
- id: UserService.userid
- });
- }
- } else {
- $scope.go('tab.activityIndex');
- }
- })
- } else {
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- if (list.noSuthority) {
- var alertPopup = $ionicPopup.alert({
- title: '提示',
- template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
- });
- return;
- }
- // console.log(list);
- if (list.otherObj.taskstatus == 5302) {
- taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
- for (var i = 0; i < res.data.length; i++) {
- if (res.data[i] == UserService.id) {
- list.otherObj.actions = list.otherObj.actions + "," + 5324;
- break;
- }
- }
- })
- }
- $scope.go('taskDetail', {
- resid: list.unique,
- node: list.source,
- title: list.title,
- restype: list.type,
- comefrom: 'taskHoll',
- ifjoin: list.otherObj.ifjoin,
- actions: list.otherObj.actions,
- taskstatus: list.otherObj.taskstatus,
- taskid: list.otherObj.id,
- opentowho: list.otherObj.opentowho
- });
- }
- }
- }
- });
- } else {
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- if (list.noSuthority) {
- var alertPopup = $ionicPopup.alert({
- title: '提示',
- template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
- });
- return;
- }
- // console.log(list);
- if (list.otherObj.taskstatus == 5302) {
- taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
- for (var i = 0; i < res.data.length; i++) {
- if (res.data[i] == UserService.id) {
- list.otherObj.actions = list.otherObj.actions + "," + 5324;
- break;
- }
- }
- })
- }
- $scope.go('taskDetail', {
- resid: list.unique,
- node: list.source,
- title: list.title,
- restype: list.type,
- comefrom: 'taskHoll',
- ifjoin: list.otherObj.ifjoin,
- actions: list.otherObj.actions,
- taskstatus: list.otherObj.taskstatus,
- taskid: list.otherObj.id,
- opentowho: list.otherObj.opentowho
- });
- }
- }
- }
- });
- }
- else if (splitArr[i] == 3) {
- taskModuleService.checkTaskDetailPermission(3, UserService.id).then(function (res) {
- if (res.code == 3350) {
- $scope.isVisiableFlag = res.data;
- if (!$scope.isVisiableFlag) {
- taskModuleService.getUserPermissionCheck(list.unique, list.creator, UserService.id).then(function (res) {
- if (res.code == 3350) {
- $scope.isVisiableFlag = res.data;
- if (!$scope.isVisiableFlag) {//true可见,false不可见
- $ionicPopup.confirm({
- title: '确认',
- template: '仅高校院所专家可见,请先认证高校院所专家',
- okText: '去认证',
- cancelText: '取消'
- }).then(function (result) {
- if (result) {
- $scope.go('identifyForm', {
- pageTitle: '高校认证',
- code: 4804,
- action: 'submit'
- });
- } else {
- $scope.go('tab.activityIndex');
- }
- })
- } else {
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- if (list.noSuthority) {
- var alertPopup = $ionicPopup.alert({
- title: '提示',
- template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
- });
- return;
- }
- // console.log(list);
- if (list.otherObj.taskstatus == 5302) {
- taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
- for (var i = 0; i < res.data.length; i++) {
- if (res.data[i] == UserService.id) {
- list.otherObj.actions = list.otherObj.actions + "," + 5324;
- break;
- }
- }
- })
- }
- $scope.go('taskDetail', {
- resid: list.unique,
- node: list.source,
- title: list.title,
- restype: list.type,
- comefrom: 'taskHoll',
- ifjoin: list.otherObj.ifjoin,
- actions: list.otherObj.actions,
- taskstatus: list.otherObj.taskstatus,
- taskid: list.otherObj.id,
- opentowho: list.otherObj.opentowho
- });
- }
- }
- }
- });
- } else {
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- if (list.noSuthority) {
- var alertPopup = $ionicPopup.alert({
- title: '提示',
- template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
- });
- return;
- }
- // console.log(list);
- if (list.otherObj.taskstatus == 5302) {
- taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
- for (var i = 0; i < res.data.length; i++) {
- if (res.data[i] == UserService.id) {
- list.otherObj.actions = list.otherObj.actions + "," + 5324;
- break;
- }
- }
- })
- }
- $scope.go('taskDetail', {
- resid: list.unique,
- node: list.source,
- title: list.title,
- restype: list.type,
- comefrom: 'taskHoll',
- ifjoin: list.otherObj.ifjoin,
- actions: list.otherObj.actions,
- taskstatus: list.otherObj.taskstatus,
- taskid: list.otherObj.id,
- opentowho: list.otherObj.opentowho
- });
- }
- }
- }
- });
- }
- else if (splitArr[i] == 4) {
- taskModuleService.getUserPermissionCheck(list.unique, list.creator, UserService.id).then(function (res) {
- if (res.code == 3350) {
- $scope.isVisiableFlag = res.data;
- if (list.creator != UserService.id && !$scope.isVisiableFlag) {
- $ionicPopup.confirm({
- title: '提示',
- template: '此需求已设置权限,若需了解需求详情,去向发布者申请权限',
- okText: '去申请权限',
- cancelText: '取消'
- }).then(function (result) {
- if (result) {
- $scope.go("tongluPermissionApply", { resource: list });
- } else {
- $scope.go('tab.activityIndex');
- }
- })
- } else {
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- if (list.noSuthority) {
- var alertPopup = $ionicPopup.alert({
- title: '提示',
- template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
- });
- return;
- }
- // console.log(list);
- if (list.otherObj.taskstatus == 5302) {
- taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
- for (var i = 0; i < res.data.length; i++) {
- if (res.data[i] == UserService.id) {
- list.otherObj.actions = list.otherObj.actions + "," + 5324;
- break;
- }
- }
- })
- }
- $scope.go('taskDetail', {
- resid: list.unique,
- node: list.source,
- title: list.title,
- restype: list.type,
- comefrom: 'taskHoll',
- ifjoin: list.otherObj.ifjoin,
- actions: list.otherObj.actions,
- taskstatus: list.otherObj.taskstatus,
- taskid: list.otherObj.id,
- opentowho: list.otherObj.opentowho
- });
- }
- }
- }
- });
- } else {
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- if (list.noSuthority) {
- var alertPopup = $ionicPopup.alert({
- title: '提示',
- template: '自需求发布起一周内仅被邀请用户方可接单,一周后无人接单才会公开接单权限。'
- });
- return;
- }
- // console.log(list);
- if (list.otherObj.taskstatus == 5302) {
- taskModuleService.getTaskReceiver(list.otherObj.id).then(function (res) {
- for (var i = 0; i < res.data.length; i++) {
- if (res.data[i] == UserService.id) {
- list.otherObj.actions = list.otherObj.actions + "," + 5324;
- break;
- }
- }
- })
- }
- $scope.go('taskDetail', {
- resid: list.unique,
- node: list.source,
- title: list.title,
- restype: list.type,
- comefrom: 'taskHoll',
- ifjoin: list.otherObj.ifjoin,
- actions: list.otherObj.actions,
- taskstatus: list.otherObj.taskstatus,
- taskid: list.otherObj.id,
- opentowho: list.otherObj.opentowho
- });
- }
- }
- }
- }
- $scope.getTaskList(0);
- // 标签点击事件
- $scope.goToTaskDetail = function (list) {
- // console.log(list);
- if (list.noSuthority) {
- if ($scope.app) {
- UtilService.showMess('未开放查看权限!');
- } else {
- CommonService.showMessage('未开放查看权限!', $scope);
- }
- return;
- }
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- // console.log(list);
- $scope.go('taskDetail', {
- resid: list.unique,
- node: list.source,
- title: list.title,
- restype: list.type,
- comefrom: 'tab.activityIndex',
- ifjoin: list.otherObj.ifjoin,
- actions: list.otherObj.actions,
- taskstatus: list.otherObj.taskstatus
- });
- }
- }
- }
- }
- //点击图片,跳转到武进专家页面
- $scope.jumpToWujingTalents = function (banner) {
- if (banner.title == "wjtest.gif") {
- if (UserService.node == "320412000") {
- $scope.go("academician");
- }
- }
- }
- // 刷新页面
- $scope.doRefresh = function () {
- getActivityInfo();
- $scope.getTaskList(0, 0);
- // $scope.go('tab.activityIndex');
- $scope.lishuiNode = false;
- // console.log(UserService.node);
- if (UserService.node == '320117005' || UserService.node == '320117003' || UserService.node == '320117002' || UserService.node == '320117001' || UserService.node == '320117004') {
- $scope.lishuiNode = true;
- }
- $scope.$broadcast('scroll.refreshComplete');
- };
- $scope.doRefresh()
- // 进入消息详情
- $scope.goMessageDetail = function (index) {
- var message = $scope.myMessageList[index];
- switch ($scope.myMessageList[index].msgTypeModel.mtype) {
- case 2647:
- break;
- case 2645:
- var myMessage = $scope.myMessageList[index];
- if (myMessage.params == null || myMessage.params == undefined) {
- var postscript = myMessage.postscript ? JSON.parse(myMessage.postscript) : {};
- var code = postscript.code;
- myMessage.params = {};
- myMessage.params.code = code;
- }
- $scope.go('identifyStatus', {
- code: $scope.myMessageList[index].params.code,
- id: $scope.myMessageList[index].targetid,
- pageTitle: $scope.myMessageList[index].applytypename,
- type: $scope.myMessageList[index].result,
- });
- break;
- case 2614:
- $scope.go($scope.myMessageList[index].msgTypeModel.url, {
- comfrom: $scope.myMessageList[index].params.comfrom,
- node: $scope.myMessageList[index].params.node,
- orgtype: $scope.myMessageList[index].params.orgtype,
- pagecode: $scope.myMessageList[index].params.pagecode,
- // resid: $scope.myMessageList[index].params.recourceid,
- templettype: $scope.myMessageList[index].params.templettype,
- recourcecomefrom: $scope.myMessageList[index].params.node,
- recourcetype: $scope.myMessageList[index].params.recourcetype,
- title: $scope.myMessageList[index].params.title,
- recourceid: $scope.myMessageList[index].params.recourceid,
- actions: $scope.myMessageList[index].params.actions,
- comefrom: 'tab.activityIndex',
- label: $scope.myMessageList[index].params.label,
- // node: $scope.myMessageList[index].params.node,
- opentype: $scope.myMessageList[index].params.opentype,
- resid: $scope.myMessageList[index].params.resid,
- restype: $scope.myMessageList[index].params.restype,
- taskid: $scope.myMessageList[index].params.taskid,
- taskstatus: $scope.myMessageList[index].params.taskstatus,
- activityid: $scope.myMessageList[index].params.activityid
- });
- // if($scope.myMessageList[index].msgTypeModel.url=='taskDetail'){
- // $scope.go('taskDetail',{
- //
- // })
- // }
- break;
- case 2615:
- $scope.go($scope.myMessageList[index].msgTypeModel.url, {
- comfrom: $scope.myMessageList[index].params.comfrom,
- node: $scope.myMessageList[index].params.node,
- orgtype: $scope.myMessageList[index].params.orgtype,
- pagecode: $scope.myMessageList[index].params.pagecode,
- resid: $scope.myMessageList[index].params.recourceid,
- templettype: $scope.myMessageList[index].params.templettype,
- recourcecomefrom: $scope.myMessageList[index].params.node,
- recourcetype: $scope.myMessageList[index].params.recourcetype,
- title: $scope.myMessageList[index].params.title,
- recourceid: $scope.myMessageList[index].params.recourceid,
- actions: $scope.myMessageList[index].params.actions,
- comefrom: 'tab.activityIndex',
- label: $scope.myMessageList[index].params.label,
- // node: $scope.myMessageList[index].params.node,
- opentype: $scope.myMessageList[index].params.opentype,
- // resid: $scope.myMessageList[index].params.resid,
- restype: $scope.myMessageList[index].params.restype,
- taskid: $scope.myMessageList[index].params.taskid,
- taskstatus: $scope.myMessageList[index].params.taskstatus,
- activityid: $scope.myMessageList[index].params.activityid
- });
- break;
- case 2640:
- $scope.go('authorityApply', {
- content: $scope.myMessageList[index].applyinfo,
- messageId: $scope.myMessageList[index].id,
- type: $scope.myMessageList[index].type
- });
- break;
- case 2641:
- $scope.go('authorityApply', {
- content: $scope.myMessageList[index].applyinfo,
- messageId: $scope.myMessageList[index].id,
- type: $scope.myMessageList[index].type
- });
- break;
- case 2662:
- UserService.isMessage = 1;
- var messageParams = message.postscript ? JSON.parse(message.postscript) : {};
- $scope.go('taskDetail', {
- resid: messageParams.resid,
- node: messageParams.node,
- title: messageParams.title,
- restype: messageParams.restype,
- comefrom: 'tab.activityIndex',
- //ifjoin: params.otherObj.ifjoin,
- actions: messageParams.actions,
- taskstatus: messageParams.taskstatus,
- taskid: messageParams.taskid,
- //opentowho: params.otherObj.opentowho,
- });
- break;
- case 2617:
- $scope.go($scope.myMessageList[index].msgTypeModel.url, {
- Id: $scope.myMessageList[index].creator
- });
- break;
- case 5900:
- $scope.go($scope.myMessageList[index].msgTypeModel.url, {
- activityid: $scope.myMessageList[index].targetid
- });
- break;
- case 2681:
- break;
- case 2682:
- break;
- case 2683:
- break;
- case 2684:
- break;
- case 2685:
- break;
- case 2686:
- break;
- default:
- $scope.go($scope.myMessageList[index].msgTypeModel.url, $scope.myMessageList[index].params);
- }
- }
- $scope.subBannerList = [
- { src: './img/2018/subSliderImg1.jpeg' },
- { src: './img/2018/subSliderImg2.jpeg' },
- ]
- // 获取资源列表
- var length = 10;
- ResourceLibraryService.getResourceLibrary('', UserService.node).then(function (res) {
- // console.log(res);
- if (res.code == 3350) {
- $scope.resourceTitle = res.data;
- angular.forEach($scope.resourceTitle, function (val, index) {
- getAllResList(index, val);
- val.active = false;
- val.itemList = [];
- val.isload = true;
- val.pagenum = 0;
- switch (val.content.length) {
- case 1:
- length += 62;
- break;
- case 2:
- length += 62;
- break;
- case 3:
- length += 78;
- break;
- case 4:
- length += 95;
- break;
- case 5:
- length += 110;
- break;
- case 6:
- length += 126;
- break;
- case 7:
- length += 142;
- break;
- case 8:
- length += 158;
- break;
- case 9:
- length += 174;
- break;
- case 10:
- length += 190;
- break;
- default:
- length += 100;
- }
- })
- //document.getElementById('click-button').style.width = length + 'px';
- $('#click-button-top').css("width", length + 'px');
- // document.getElementById('click-button-top').style.width = length + 'px';
- $scope.changeActiveTitle(0);
- }
- })
- $scope.activeIndex = 0;
- $scope.noData = false;
- var clickFirst = false;
- $scope.allResList = [];
- $scope.changeActiveTitle = function (index) {
- $scope.noData = false;
- if (clickFirst) {
- $ionicScrollDelegate.$getByHandle('calenderContent').scrollTo(top, scrollheight);
- }
- clickFirst = true;
- $scope.activeIndex = index;
- $scope.resourceItemList = [];
- angular.forEach($scope.resourceTitle, function (val) {
- val.active = false;
- })
- $scope.resourceTitle[index].active = true;
- if ($scope.resourceTitle[index].itemList.length == 0) {
- ResourceLibraryService.getDefaultSort($scope.resourceTitle[index].moduleid).then(function (getDefaultSortRes) {
- var sort = getDefaultSortRes.data;
- ResourceLibraryService.getFirstResourceList($scope.resourceTitle[index].moduleid, $scope.resourceTitle[index].parentid, $scope.resourceTitle[index].pagenum, '', sort, 0, 0, '').then(function (res) {
- // console.log(res);
- $scope.resourceItemList = res.data || [];
- $scope.resourceTitle[index].itemList = Object.assign([], res.data);
- $scope.resourceTitle[index].pagenum++;
- if (res.page && $scope.resourceTitle[index].pagenum >= res.page.totalPage) {
- $scope.resourceTitle[index].isload = false;
- // $scope.showNoData=true;
- }
- $scope.noData = $scope.resourceItemList.length == 0;
- })
- })
- } else {
- $scope.resourceItemList = $scope.resourceTitle[index].itemList;
- $scope.noData = $scope.resourceItemList.length == 0;
- }
- // 滚动标题栏
- var allLis = document.querySelectorAll(".click-button-item");
- if (allLis.length > 0) {
- var scrollWidth = allLis[index].offsetLeft;
- // console.log(scrollWidth);
- // console.log(window.innerWidth);
- // console.log(allLis[index].offsetWidth);
- if (scrollWidth > window.innerWidth / 2) {
- $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(scrollWidth - window.innerWidth / 2 + allLis[index].offsetWidth / 2, 0);
- // $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(scrollWidth-window.innerWidth/2+allLis[index].offsetWidth/2,0);
- } else {
- $ionicScrollDelegate.$getByHandle('clickButton').scrollTo(0, 0);
- // $ionicScrollDelegate.$getByHandle('clickButtonTop').scrollTo(0,0);
- }
- }
- }
- $scope.loadMoreData = function () {
- ResourceLibraryService.getDefaultSort($scope.resourceTitle[$scope.activeIndex].moduleid).then(function (getDefaultSortRes) {
- var sort = getDefaultSortRes.data;
- ResourceLibraryService.getFirstResourceList($scope.resourceTitle[$scope.activeIndex].moduleid, $scope.resourceTitle[$scope.activeIndex].parentid, $scope.resourceTitle[$scope.activeIndex].pagenum, '', sort, 0, 0, '').then(function (res) {
- // console.log(res);
- $scope.resourceTitle[$scope.activeIndex].pagenum++;
- $scope.resourceTitle[$scope.activeIndex].itemList = $scope.resourceTitle[$scope.activeIndex].itemList.concat(res.data);
- $scope.resourceItemList = $scope.resourceTitle[$scope.activeIndex].itemList;
- if ($scope.resourceTitle[$scope.activeIndex].pagenum >= res.page.totalPage) {
- $scope.resourceTitle[$scope.activeIndex].isload = false;
- // $scope.showNoData=true;
- }
- $scope.noData = $scope.resourceItemList.length == 0;
- }).finally(function () {
- $scope.$broadcast('scroll.infiniteScrollComplete');
- });
- })
- }
- // web端布局
- var getAllResList = function (index, val) {
- // console.log($scope.resourceTitle[index]);
- ResourceLibraryService.getDefaultSort($scope.resourceTitle[index].moduleid).then(function (getDefaultSortRes) {
- var sort = getDefaultSortRes.data;
- ResourceLibraryService.getFirstResourceList($scope.resourceTitle[index].moduleid, $scope.resourceTitle[index].parentid, 0, '', sort, 0, 0, '').then(function (res) {
- // console.log(res);
- $scope.allResList[index] = {
- name: $scope.resourceTitle[index].name,
- list: res.data,
- val: val
- };
- // console.log($scope.allResList);
- })
- })
- }
- // 进入资源详情
- $scope.goResourceDetail = function (resource, ind) {
- // console.log(resource);
- // console.log($stateParams.libtype);
- if (!$scope.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('resourceCommonDetailsPage', {
- recourceid: resource.unique,
- recourcetype: resource.type,
- recourcecomefrom: resource.source,
- creator: resource.clickthrough,
- title: resource.title,
- orgtype: 0,
- // comfrom:$scope.comfrom,
- pagecode: 0,
- label: JSON.stringify(resource.otherObj)
- });
- }
- };
- $scope.goToResList = function (rec) {
- // console.log(rec);
- var reclibc = rec || $scope.resourceTitle[$scope.activeIndex];
- $scope.go('privateResource', {
- reclib: angular.toJson(reclibc),
- privateName: reclibc.name,
- restype: reclibc.moduleid,
- groupid: reclibc.parentid,
- privateContent: reclibc.content,
- authority: reclibc.by5
- })
- }
- $scope.goToTaskList = function () {
- $scope.go('taskHoll');
- }
- //首页显示资源库数据专用
- //初始化资源库列表
- $scope.rescontactflg = 0;//0:本地/云资源库开始查询 2:查询结束
- var tempLocalResourceLibrarylist = [];
- var tempCloudResourceLibrarylist = [];
- var initResourceLibraryList = function () {
- ResourceLibraryService.getResourceLibrary("", UserService.node).then(function (response) {
- console.log('初始化资源', response);
- if (UtilService.isDefined(response.data)) {
- // console.log(response.data);
- // 配置图片
- tempCloudResourceLibrarylist = response.data;
- angular.forEach(tempCloudResourceLibrarylist, function (val) {
- val.logo = [];
- val.logo = val.name == '企业库' ? ['./img/2018/company1.png', './img/2018/company2.jpeg', './img/2018/company3.png']
- : val.name == '高校库' ? ['./img/2018/university1.png', './img/2018/university2.png', './img/2018/university3.png']
- : val.name == '人才库' || val.name == '技术经纪人库' ? ['./img/2018/person1.png', './img/2018/person2.png', './img/2018/person3.png']
- : val.name == '需求库' ? ['./img/2018/demand1.jpg', './img/2018/demand2.jpg']
- : val.name == '成果库' ? ['./img/2018/product1.jpg', './img/2018/product2.jpg', './img/2018/product3.jpg']
- : ['./img/2018/other1-1.jpg', './img/2018/other1-2.jpg', './img/2018/other1-3.jpg'];
- if ($scope.isLiyangApp && val.name == '企业库') {
- val.logo = ['./img/2018/liyang1.jpg', './img/2018/liyang2.jpg', './img/2018/liyang3.jpg'];
- }
- })
- } else {
- tempCloudResourceLibrarylist = [];
- }
- $scope.rescontactflg++;
- $scope.rescontactflg++;
- }, function () {
- tempCloudResourceLibrarylist = [];
- $scope.rescontactflg++;
- $scope.rescontactflg++;
- })
- };
- initResourceLibraryList();
- //节点背景图切换
- var initResourceLibraryNodeBg = function () {
- // $scope.showLoadingToast();
- var clienttype = 0;
- if ($scope.app) {
- clienttype = 1;
- } else {
- clienttype = 2;
- }
- ResourceLibraryService.getResourceLibraryNodeBg(clienttype).then(function (response) {
- $scope.urlBackGImage = response.data;
- 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)) {
- $scope.sourceBgName = $scope.urlBackGImage.adlist[0].sourceName
- } else {
- $scope.sourceBgName = 'group3/M00/0B/01/wKjILFuI0w2AcHjkAAAaToWtucA883.jpg';
- }
- }, function () {
- })
- }; +
- initResourceLibraryNodeBg();
- //拼接本地与云文件夹(按sort、updatetime排序)
- var connectLocalAndCloud = function () {
- HandleService.connectLocalAndCloud(tempLocalResourceLibrarylist, tempCloudResourceLibrarylist).then(function (response) {
- $scope.resourcelibrarylist = response;
- // console.log(response);
- if ($scope.resourcelibrarylist.length == 0) {
- $scope.shownone = true;
- } else {
- $scope.shownone = false;
- $scope.resinfocount = 0;//资源总数
- // 节点资源总数
- angular.forEach($scope.resourcelibrarylist, function (value) {
- $scope.resinfocount += value.infocount;//资源总数
- if (value.moduleid == ConstantService.CATEGORY_MODULE_8) {
- $scope.resexpertcount = value.infocount;//专家总数
- }
- if (value.moduleid == ConstantService.CATEGORY_MODULE_6) {
- $scope.resorgcount = value.infocount;//企业总数
- }
- if (value.moduleid == ConstantService.CATEGORY_MODULE_2) {
- $scope.resresearchfindingcount = value.infocount;//成果总数
- }
- if (value.moduleid == ConstantService.CATEGORY_MODULE_1) {
- $scope.techrequirementcount = value.infocount;//需求总数
- }
- });
- }
- resourceLibraryTempData.setResourceLibraryList($scope.resourcelibrarylist);
- $scope.hideLoadingToast();
- console.log('resourcelibrarylist', $scope.resourcelibrarylist)
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- connectLocalAndCloud();
- //--监听本地与云文件夹查询是否结束
- $scope.$watch("rescontactflg", function (newValue) {
- if (newValue == 2) {
- //本地与云均无,显示缺省页
- if (tempCloudResourceLibrarylist.length == 0 && tempLocalResourceLibrarylist.length == 0) {
- $scope.shownone = true;
- $scope.resourcelibrarylist = [];
- $scope.hideLoadingToast();
- } else {
- //无云文件夹显示本地
- if (tempCloudResourceLibrarylist.length < 1) {
- $scope.resourcelibrarylist = tempLocalResourceLibrarylist;
- // console.log('来自于父亲的爱', $scope.resourcelibrarylist);
- $scope.hideLoadingToast();
- }
- //无本地文件夹显示云
- if (tempLocalResourceLibrarylist.length < 1) {
- $scope.resourcelibrarylist = tempCloudResourceLibrarylist;
- $scope.hideLoadingToast();
- }
- //本地与云均有去拼接
- if (tempCloudResourceLibrarylist.length > 0 && tempLocalResourceLibrarylist.length > 0) {
- connectLocalAndCloud();
- }
- $scope.shownone = false;
- }
- console.log('最终处理', $scope.resourcelibrarylist)
- $scope.rescontactflg = 0;
- resourceLibraryTempData.setResourceLibraryList($scope.resourcelibrarylist);
- // console.log($scope.resourcelibrarylist);
- }
- });
- //网络异常时点击屏幕重新加载
- $scope.repeatLoad = function () {
- ConfigService.ressynchroflg = true;
- initResourceLibraryList();
- initResourceLibraryNodeBg();
- };
- // //第一次进入才显示溧阳信
- // if ($scope.isLiyangApp && localStorage.goLetterNum == 0 && !$scope.app) {
- // localStorage.goLetterNum++;
- // $scope.go('liyangLetter');
- // }
- //进入资源库首页
- $scope.goResorceLibaryDetail = function (res) {
- console.log('res', res);
- resourceLibraryTempData.setCategoryIndex(0);
- resourceLibraryTempData.resetChecked();
- if (res.moduleid == false && UserService.node == '330122000') {
- window.open("http://app.zjumap.com:7736/#/index", "_blank");
- } else if (res.moduleid == 44) {
- $scope.go('wujingTeacher');
- } else if (res.moduleid == 43) {
- $scope.go('wujingTechnical');
- } else if (res.moduleid == 33) {
- $scope.go("notification");
- } else {
- //进入公共资源库列表
- if (res.fixtype == 1) {
- $scope.go('publicResource', {
- libtype: res.moduleid,
- name: res.name,
- reclibid: $scope.res.id,
- modlibid: res.id
- });
- } else if (res.fixtype == 2) {
- //进入私人资源库列表
- $scope.go('privateResource', {
- res: angular.toJson(res),
- privateName: res.name,
- groupid: res.parentid,
- restype: res.moduleid,
- privateContent: res.content,
- authority: res.by5
- });
- }
- }
- };
- }
- )
|