mianshi_go_index 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. window.addEventListener('pageshow', function(event) {
  2.  if(event.persisted) { // ios 有效, android 和 pc 每次都是 false
  3.   // location.reload();
  4. _this.getCardNumber();
  5. _this.myVue.$children[0].initData();
  6.  } else { // ios 除外
  7.   if(sessionStorage.getItem('home_refresh') === 'true') {
  8.    // location.reload();
  9. _this.getCardNumber();
  10. _this.myVue.$children[0].initData();
  11.   }
  12.  }
  13.  sessionStorage.removeItem('home_refresh');
  14. });
  15. _this.pageinit = function(){
  16. localeResource = mylocaleResource;
  17. var storeEid = mbos.getRequestParams().storeEid;
  18. if(storeEid) {
  19. storeEid = "&storeEid=" + storeEid
  20. } else {
  21. storeEid = ""
  22. }
  23. _this.pagePath = location.origin + location.pathname + '?appid='+encodeURIComponent(mbos.getRequestParams().appid)+'&eid='+encodeURIComponent(mbos.getRequestParams().eid)+'&path='+mbos.getRequestParams().path+storeEid+'&name=';
  24. _this.imgPath = location.origin+'/mbos/store/'+encodeURIComponent(mbos.getRequestParams().storeEid || mbos.getRequestParams().eid)+'/'+mbos.getRequestParams().path;
  25. $('.img_hi').css({
  26. 'background-image': 'url('+_this.imgPath+'/img-20230510-00.png)'
  27. })
  28. var personName = easContext.person.name;
  29. if(typeof personName == 'object'){
  30. personName = personName.l2;
  31. }
  32. $('.person_name').text(personName);
  33. _this.getVersion();
  34. _this.getCardNumber();
  35. _this.initBannerVue();
  36. }
  37. _this.mbosEasInvokeScript = function(methodName,param,callback){
  38. mbos.eas.invokeScript({
  39. name : 'commonOSFservice',
  40. param : [methodName, JSON.stringify(param)],
  41. success : function (res) {
  42. callback(res);
  43. },
  44. error:function(e){
  45. console.log(e);
  46. }
  47. })
  48. }
  49. _this.getVersion = function(){
  50. _this.mbosEasInvokeScript('InterGo_GetCurrUserInfoService',{},function(res){
  51. _this.version = Number(res.data.version);
  52. localStorage.InterGo_Version = _this.version;
  53. if(_this.version < 2.1 || !_this.version){
  54. mbos('flexpanel5').hide();
  55. $('title').text('面试GO')
  56. }
  57. });
  58. }
  59. _this.getCardNumber = function(){
  60. _this.mbosEasInvokeScript('InterGo_GetAllTaskCount',{},function(res){
  61. var totalInterCount = res.data.totalInterCount;
  62. var totalJudgeCount = res.data.totalJudgeCount;
  63. var totalScreenCount = res.data.totalScreenCount;
  64. mbos('label5').value(totalInterCount);
  65. mbos('label7').value(totalJudgeCount);
  66. mbos('label3').value(totalScreenCount)
  67. });
  68. }
  69. // 待面试
  70. _this.openTointerview = function(event){
  71. sessionStorage.toDoListAtciveTab = '';
  72. // var src = _this.pagePath+'01.navui&tabIndex=0&pageType=interviewResults';
  73. // location.href = src;
  74. mbos.ui.open({
  75. path: mbos.getRequestParams().path,
  76. name:"01.navui",
  77. params:{
  78. tabIndex:0,
  79. pageType:'interviewResults'
  80. }
  81. });
  82. }
  83. // 面试分析
  84. _this.openInterAnalyse = function(){
  85. var src = _this.pagePath+'00.custom#/inter_analyse';
  86. location.href = src;
  87. // mbos.ui.open({
  88. // path: mbos.getRequestParams().path,
  89. // name:"00.custom#/inter_analyse"
  90. // });
  91. }
  92. // 创建需求
  93. // _this.createRequirements = function(event){
  94. // alert('创建需求')
  95. // }
  96. // // 上传简历
  97. // _this.uploadResume = function(event){
  98. // alert('上传简历')
  99. // }
  100. // // 安排面试
  101. // _this.scheduleInterview = function(event){
  102. // alert('安排面试')
  103. // }
  104. // // 分享海报
  105. // _this.sharePoster = function(event){
  106. // alert('分享海报')
  107. // }
  108. // 待筛选简历
  109. _this.screeningResumes = function(event){
  110. sessionStorage.toDoListAtciveTab = '';
  111. mbos.ui.open({
  112. path: mbos.getRequestParams().path,
  113. name:"01.navui",
  114. params:{
  115. tabIndex:0,
  116. pageType:'resumeScreening'
  117. }
  118. });
  119. }
  120. // 待录面试结果
  121. _this.recordInterviewResults = function(event){
  122. sessionStorage.toDoListAtciveTab = '';
  123. mbos.ui.open({
  124. path: mbos.getRequestParams().path,
  125. name:"01.navui",
  126. params:{
  127. tabIndex:1,
  128. pageType:'interviewResults'
  129. }
  130. });
  131. }
  132. // 我的需求
  133. // _this.myNeeds = function(event){
  134. // alert('我的需求')
  135. // }
  136. mbos('page').bind('afterOnload',function(){
  137. var videomsgDialog = {
  138. template: '#videomsgDialog',
  139. data: function(){
  140. return {
  141. videoInterMsg: [],
  142. showVideoMsgBox: false,
  143. showLoading: false,
  144. imgPath: location.origin+'/mbos/store/'+encodeURIComponent(mbos.getRequestParams().storeEid || mbos.getRequestParams().eid)+'/'+mbos.getRequestParams().path,
  145. pagePath: location.origin + location.pathname + '?appid='+encodeURIComponent(mbos.getRequestParams().appid)+'&eid='+encodeURIComponent(mbos.getRequestParams().eid)+'&path='+mbos.getRequestParams().path+(mbos.getRequestParams().storeEid ? "&storeEid=" + mbos.getRequestParams().storeEid : '')+'&name=',
  146. }
  147. },
  148. props: [],
  149. created: function(){
  150. this.localeResource = window.localeResource;
  151. },
  152. components: {
  153. },
  154. methods: {
  155. // 获取视频面试信息弹框
  156. getVideoInterviewMsg: function(recordId){
  157. var that = this;
  158. try{
  159. /*判断某条待面试记录所处状态*/
  160. mbos.eas.invokeScript({
  161. name:"commonOSFservice",
  162. param:['GetVideoInterviewServiceOSF',JSON.stringify({recordId: recordId})],
  163. success:function(res){
  164. if(res.code=="0"){
  165. that.videoInterMsg = res.data;
  166. that.showVideoMsgBox = true
  167. }else{
  168. var resJson = JSON.stringify(res);
  169. if (resJson.indexOf("请求云之家openauth2服务失败") >= 0) {
  170. alert(that.localeResource.common_loginTimeout)
  171. }else if (resJson.indexOf("无法连接EAS服务器") >= 0) {
  172. alert(that.localeResource.common_EAS500)
  173. }else{
  174. var tipInfo = that.localeResource.common_errorMsg;
  175. if(res.mesg){
  176. tipInfo = res.mesg;
  177. }
  178. mbos.ui.showError({
  179. title:tipInfo,
  180. })
  181. }
  182. return false;
  183. }
  184. },
  185. error:function(e){
  186. return false;
  187. }
  188. })
  189. }catch(e){
  190. console.log(e)
  191. }
  192. },
  193. openZoomLink: function(){
  194. this.showLoading = true;
  195. window.location.href = this.videoInterMsg.startUrl;
  196. },
  197. doCopy: function () {
  198. var that = this;
  199. this.$copyText(this.videoInterMsg.meetingId || 'abc').then(function (e) {
  200. var msg;
  201. that.videoInterMsg.videoType == 'tencent' ?
  202. msg = that.localeResource.videomsgDialog_info_2 :
  203. msg = that.localeResource.videomsgDialog_info_3;
  204. that.$toast(msg);
  205. }, function (e) {
  206. that.$toast('Can not copy');
  207. })
  208. }
  209. }
  210. }
  211. // 首页
  212. var cA = {
  213. template:'#comA',
  214. data: function(){
  215. return {
  216. hasData:false,
  217. todayNum:'',
  218. tomorrowNum:'',
  219. curIndex:0,
  220. taskList:[],
  221. curList:{
  222. taskItemList:[]
  223. },
  224. bannerImgBg: [],
  225. currYear: '<span>'+new Date().getFullYear()+'</span>',
  226. imgPath: location.origin+'/mbos/store/'+encodeURIComponent(mbos.getRequestParams().storeEid || mbos.getRequestParams().eid)+'/'+mbos.getRequestParams().path,
  227. pagePath: location.origin + location.pathname + '?appid='+encodeURIComponent(mbos.getRequestParams().appid)+'&eid='+encodeURIComponent(mbos.getRequestParams().eid)+'&path='+mbos.getRequestParams().path+(mbos.getRequestParams().storeEid ? "&storeEid=" + mbos.getRequestParams().storeEid : '')+'&name=',
  228. currItem: {}
  229. }
  230. },
  231. components: {
  232. videomsgDialog: videomsgDialog
  233. },
  234. created: function(){
  235. this.localeResource = window.localeResource;
  236. this.initData();
  237. },
  238. methods: {
  239. initData: function(){
  240. var that = this;
  241. mbos.eas.invokeScript({
  242. name:"commonOSFservice",
  243. param:['InterGo_GetRecentTaskListService',JSON.stringify({daysCount: 2})],
  244. //needShowLoading: false, 此属性为false时加载数据不会出现mbos自带的loading动画
  245. success:function(res){
  246. if(res.code=="0"){
  247. that.taskList = res.data.taskList;
  248. that.hasData = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum == 0 ) ? false : true;
  249. that.curIndex = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum != 0 ) ? 1 : 0;
  250. that.curList = that.taskList[that.curIndex];
  251. that.todayNum = that.taskList[0].countNum;
  252. that.tomorrowNum = that.taskList[1].countNum;
  253. }else{
  254. var resJson = JSON.stringify(res);
  255. if (resJson.indexOf("请求云之家openauth2服务失败") >= 0) {
  256. alert(that.localeResource.common_loginTimeout)
  257. }else if (resJson.indexOf("无法连接EAS服务器") >= 0) {
  258. alert(that.localeResource.common_EAS500)
  259. }else{
  260. var tipInfo = that.localeResource.common_errorMsg;
  261. if(res.mesg){
  262. tipInfo = res.mesg;
  263. }
  264. mbos.ui.showError({
  265. title:tipInfo,
  266. })
  267. }
  268. that.taskList = [{countNum:0,items:[]},{countNum:0,items:[]}];
  269. that.hasData = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum == 0 ) ? false : true;
  270. that.curIndex = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum != 0 ) ? 1 : 0;
  271. that.curList = that.taskList[that.curIndex];
  272. that.todayNum = that.taskList[0].countNum;
  273. that.tomorrowNum = that.taskList[1].countNum;
  274. }
  275. },
  276. error:function(e){
  277. console.log(e);
  278. that.taskList = [{countNum:0,items:[]},{countNum:0,items:[]}];
  279. that.hasData = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum == 0 ) ? false : true;
  280. that.curIndex = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum != 0 ) ? 1 : 0;
  281. that.curList = that.taskList[that.curIndex] ;
  282. that.todayNum = that.taskList[0].countNum;
  283. that.tomorrowNum = that.taskList[1].countNum;
  284. // mbos.ui.showError({
  285. // title:"调用接口失败,请联系管理员",
  286. // })
  287. }
  288. });
  289. },
  290. showList: function(index){
  291. this.curIndex = index;
  292. this.curList = this.taskList[index];
  293. },
  294. linkPage: function(item){
  295. if(item.state=='待面试'){
  296. location.href = this.pagePath + '00.custom#/resume_detail?recordId='+encodeURIComponent(item.recordId);
  297. }else if(item.state==='待评价'){
  298. location.href = this.pagePath + '00.custom#/judge_page?recordId='+encodeURIComponent(item.recordId);
  299. }else{
  300. location.href = this.pagePath + '00.custom#/judge_page?recordId='+encodeURIComponent(item.recordId);
  301. }
  302. },
  303. // 显示视频面试信息弹框
  304. openVideoInterviewBox: function(item){
  305. this.$refs.videobox.getVideoInterviewMsg(item.recordId);
  306. },
  307. }
  308. }
  309. var routes = [
  310. { path: '/', meta: {title:'招聘GO', tab: true}, component: cA, name: 'a'},
  311. ]
  312. var router = new VueRouter({
  313. routes: routes
  314. });
  315. router.beforeEach(function(to, from, next) {
  316. if (to.meta.title) {//如果设置标题,拦截后设置标题
  317. document.title = to.meta.title
  318. }
  319. next()
  320. })
  321. var VueClipboard = VueClipboard;
  322. // 入口
  323. setTimeout(function(){
  324. _this.myVue = new Vue({
  325. router: router,
  326. VueClipboard: VueClipboard,
  327. el: '#app',
  328. data: function(){
  329. return {}
  330. },
  331. created: function(){
  332. // this[this.$route.name] = '/mbos/store/4000148/fileLibrary/attendance-'+ this.$route.name +'.png';
  333. },
  334. watch: {
  335. // '$route': function(to, from){
  336. // this[to.name] = '/mbos/store/4000148/fileLibrary/attendance-'+ to.name +'.png';
  337. // this[from.name] = '/mbos/store/4000148/fileLibrary/attendance-'+ from.name +'1.png';
  338. // if(to.meta.tab){
  339. // this.tabShow = true;
  340. // }else{
  341. // this.tabShow = false;
  342. // }
  343. // }
  344. },
  345. components:{
  346. cA: cA,
  347. },
  348. methods: {
  349. close: function(){
  350. this.bills = false;
  351. }
  352. }
  353. }).$mount('#app')
  354. })
  355. })
  356. // _this.openPage = function(event){
  357. // }
  358. _this.initBannerVue = function(){
  359. // rem --> px
  360. ; (function (win, doc) {
  361. function change() {
  362. var rem = (doc.documentElement.clientWidth * 20) / 375
  363. doc.documentElement.style.fontSize = rem + 'px'
  364. var d = document.createElement('div')
  365. d.style.cssText = 'width:10rem;height:0;overflow: hidden;position:absolute;z-index:-1;visibility: hidden;'
  366. document.body.appendChild(d)
  367. var dw = d.offsetWidth // 10rem的实际展示px值
  368. document.body.removeChild(d)
  369. realRem = (rem * rem * 10) / dw
  370. doc.documentElement.style.fontSize = realRem + 'px'
  371. }
  372. if ($('body').length >= 1) {
  373. change()
  374. }
  375. win.addEventListener('load', change, false)
  376. win.addEventListener('resize', change, false)
  377. win.addEventListener('orientationchange', change, false)
  378. })(window, document)
  379. // s-HR设置的banner图
  380. var bannerBox = {
  381. template:'#bannerBox',
  382. data: function(){
  383. return {
  384. imgPath: location.origin+'/mbos/store/'+encodeURIComponent(mbos.getRequestParams().eid)+'/'+mbos.getRequestParams().path+'/',
  385. bannerImgBg: [],
  386. }
  387. },
  388. components: {},
  389. created: function(){
  390. this.localeResource = window.localeResource;
  391. this.getBannerImage();
  392. },
  393. methods: {
  394. // banner图
  395. getBannerImage: function(){
  396. var that = this;
  397. mbos.eas.invokeScript({
  398. name:"commonOSFservice",
  399. param:['getLightAppBannerService',JSON.stringify({number:'002'})],
  400. success:function(res){
  401. console.log('调用接口成功');
  402. if(res.code == 0){
  403. if(res.data.imageSrc.length > 0){
  404. var imageSrc = res.data.imageSrc;
  405. var easUrl = easContext.easUrl+'/shr';
  406. for(var i = 0; i < imageSrc.length; i ++){
  407. that.bannerImgBg.push(location.protocol+'//wscloud.kingdee.com/recRegister/recDemand/getSHRImageByURL?serviceURL=' + encodeURIComponent(easUrl) + '&imageURL=' + imageSrc[i]);
  408. }
  409. $('.glicon').hide();
  410. // console.log(that.bannerImgBg)
  411. }else{
  412. $('#bannerBoxHtml').hide();
  413. $('.glicon').css('visibility','visible');
  414. }
  415. }else{
  416. var tipInfo = that.localeResource.home_info_3;
  417. if(res.msg){
  418. tipInfo = res.msg;
  419. }
  420. $('#bannerBoxHtml').hide();
  421. $('.glicon').css('visibility','visible');
  422. }
  423. },
  424. error:function(e){
  425. console.log('调用接口失败');
  426. console.log(e);
  427. $('#bannerBoxHtml').hide();
  428. $('.glicon').css('visibility','visible');
  429. }
  430. })
  431. },
  432. }
  433. }
  434. var routes = [
  435. { path: '/', meta: {title:'', tab: true}, component: bannerBox, name: 'bannerBox'},
  436. ]
  437. var router = new VueRouter({
  438. routes: routes
  439. });
  440. router.beforeEach(function(to, from, next) {
  441. if (to.meta.title) {//如果设置标题,拦截后设置标题
  442. document.title = to.meta.title
  443. }
  444. next()
  445. })
  446. // 入口
  447. setTimeout(function(){
  448. _this.myBanerVue = new Vue({
  449. router: router,
  450. el: '#customBaner',
  451. data: function(){
  452. return {}
  453. },
  454. created: function(){
  455. },
  456. components:{
  457. bannerBox: bannerBox,
  458. },
  459. methods: {
  460. close: function(){
  461. this.bills = false;
  462. }
  463. }
  464. }).$mount('#customBaner')
  465. })
  466. }