123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479 |
- window.addEventListener('pageshow', function(event) {
- if(event.persisted) { // ios 有效, android 和 pc 每次都是 false
- // location.reload();
- _this.getCardNumber();
- _this.myVue.$children[0].initData();
- } else { // ios 除外
- if(sessionStorage.getItem('home_refresh') === 'true') {
- // location.reload();
- _this.getCardNumber();
- _this.myVue.$children[0].initData();
- }
- }
- sessionStorage.removeItem('home_refresh');
- });
- _this.pageinit = function(){
- localeResource = mylocaleResource;
- var storeEid = mbos.getRequestParams().storeEid;
- if(storeEid) {
- storeEid = "&storeEid=" + storeEid
- } else {
- storeEid = ""
- }
- _this.pagePath = location.origin + location.pathname + '?appid='+encodeURIComponent(mbos.getRequestParams().appid)+'&eid='+encodeURIComponent(mbos.getRequestParams().eid)+'&path='+mbos.getRequestParams().path+storeEid+'&name=';
- _this.imgPath = location.origin+'/mbos/store/'+encodeURIComponent(mbos.getRequestParams().storeEid || mbos.getRequestParams().eid)+'/'+mbos.getRequestParams().path;
- $('.img_hi').css({
- 'background-image': 'url('+_this.imgPath+'/img-20230510-00.png)'
- })
- var personName = easContext.person.name;
- if(typeof personName == 'object'){
- personName = personName.l2;
- }
- $('.person_name').text(personName);
- _this.getVersion();
- _this.getCardNumber();
- _this.initBannerVue();
- }
- _this.mbosEasInvokeScript = function(methodName,param,callback){
- mbos.eas.invokeScript({
- name : 'commonOSFservice',
- param : [methodName, JSON.stringify(param)],
- success : function (res) {
- callback(res);
- },
- error:function(e){
- console.log(e);
- }
- })
- }
- _this.getVersion = function(){
- _this.mbosEasInvokeScript('InterGo_GetCurrUserInfoService',{},function(res){
- _this.version = Number(res.data.version);
- localStorage.InterGo_Version = _this.version;
- if(_this.version < 2.1 || !_this.version){
- mbos('flexpanel5').hide();
- $('title').text('面试GO')
- }
- });
- }
- _this.getCardNumber = function(){
- _this.mbosEasInvokeScript('InterGo_GetAllTaskCount',{},function(res){
- var totalInterCount = res.data.totalInterCount;
- var totalJudgeCount = res.data.totalJudgeCount;
- var totalScreenCount = res.data.totalScreenCount;
- mbos('label5').value(totalInterCount);
- mbos('label7').value(totalJudgeCount);
- mbos('label3').value(totalScreenCount)
- });
- }
- // 待面试
- _this.openTointerview = function(event){
- sessionStorage.toDoListAtciveTab = '';
- // var src = _this.pagePath+'01.navui&tabIndex=0&pageType=interviewResults';
- // location.href = src;
- mbos.ui.open({
- path: mbos.getRequestParams().path,
- name:"01.navui",
- params:{
- tabIndex:0,
- pageType:'interviewResults'
- }
- });
- }
- // 面试分析
- _this.openInterAnalyse = function(){
- var src = _this.pagePath+'00.custom#/inter_analyse';
- location.href = src;
- // mbos.ui.open({
- // path: mbos.getRequestParams().path,
- // name:"00.custom#/inter_analyse"
- // });
- }
- // 创建需求
- // _this.createRequirements = function(event){
- // alert('创建需求')
- // }
- // // 上传简历
- // _this.uploadResume = function(event){
- // alert('上传简历')
- // }
- // // 安排面试
- // _this.scheduleInterview = function(event){
- // alert('安排面试')
- // }
- // // 分享海报
- // _this.sharePoster = function(event){
- // alert('分享海报')
- // }
- // 待筛选简历
- _this.screeningResumes = function(event){
- sessionStorage.toDoListAtciveTab = '';
- mbos.ui.open({
- path: mbos.getRequestParams().path,
- name:"01.navui",
- params:{
- tabIndex:0,
- pageType:'resumeScreening'
- }
- });
- }
- // 待录面试结果
- _this.recordInterviewResults = function(event){
- sessionStorage.toDoListAtciveTab = '';
- mbos.ui.open({
- path: mbos.getRequestParams().path,
- name:"01.navui",
- params:{
- tabIndex:1,
- pageType:'interviewResults'
- }
- });
- }
- // 我的需求
- // _this.myNeeds = function(event){
- // alert('我的需求')
- // }
-
- mbos('page').bind('afterOnload',function(){
- var videomsgDialog = {
- template: '#videomsgDialog',
- data: function(){
- return {
- videoInterMsg: [],
- showVideoMsgBox: false,
- showLoading: false,
- imgPath: location.origin+'/mbos/store/'+encodeURIComponent(mbos.getRequestParams().storeEid || mbos.getRequestParams().eid)+'/'+mbos.getRequestParams().path,
- 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=',
- }
- },
- props: [],
- created: function(){
- this.localeResource = window.localeResource;
- },
- components: {
-
- },
- methods: {
- // 获取视频面试信息弹框
- getVideoInterviewMsg: function(recordId){
- var that = this;
- try{
- /*判断某条待面试记录所处状态*/
- mbos.eas.invokeScript({
- name:"commonOSFservice",
- param:['GetVideoInterviewServiceOSF',JSON.stringify({recordId: recordId})],
- success:function(res){
- if(res.code=="0"){
- that.videoInterMsg = res.data;
- that.showVideoMsgBox = true
- }else{
- var resJson = JSON.stringify(res);
- if (resJson.indexOf("请求云之家openauth2服务失败") >= 0) {
- alert(that.localeResource.common_loginTimeout)
- }else if (resJson.indexOf("无法连接EAS服务器") >= 0) {
- alert(that.localeResource.common_EAS500)
- }else{
- var tipInfo = that.localeResource.common_errorMsg;
- if(res.mesg){
- tipInfo = res.mesg;
- }
- mbos.ui.showError({
- title:tipInfo,
- })
- }
- return false;
- }
- },
- error:function(e){
- return false;
- }
- })
- }catch(e){
- console.log(e)
- }
- },
- openZoomLink: function(){
- this.showLoading = true;
- window.location.href = this.videoInterMsg.startUrl;
- },
- doCopy: function () {
- var that = this;
- this.$copyText(this.videoInterMsg.meetingId || 'abc').then(function (e) {
- var msg;
- that.videoInterMsg.videoType == 'tencent' ?
- msg = that.localeResource.videomsgDialog_info_2 :
- msg = that.localeResource.videomsgDialog_info_3;
- that.$toast(msg);
- }, function (e) {
- that.$toast('Can not copy');
- })
- }
- }
- }
- // 首页
- var cA = {
- template:'#comA',
- data: function(){
- return {
- hasData:false,
- todayNum:'',
- tomorrowNum:'',
- curIndex:0,
- taskList:[],
- curList:{
- taskItemList:[]
- },
- bannerImgBg: [],
- currYear: '<span>'+new Date().getFullYear()+'</span>',
- imgPath: location.origin+'/mbos/store/'+encodeURIComponent(mbos.getRequestParams().storeEid || mbos.getRequestParams().eid)+'/'+mbos.getRequestParams().path,
- 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=',
- currItem: {}
- }
- },
- components: {
- videomsgDialog: videomsgDialog
- },
- created: function(){
- this.localeResource = window.localeResource;
- this.initData();
-
- },
- methods: {
- initData: function(){
- var that = this;
- mbos.eas.invokeScript({
- name:"commonOSFservice",
- param:['InterGo_GetRecentTaskListService',JSON.stringify({daysCount: 2})],
- //needShowLoading: false, 此属性为false时加载数据不会出现mbos自带的loading动画
- success:function(res){
- if(res.code=="0"){
- that.taskList = res.data.taskList;
- that.hasData = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum == 0 ) ? false : true;
- that.curIndex = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum != 0 ) ? 1 : 0;
- that.curList = that.taskList[that.curIndex];
- that.todayNum = that.taskList[0].countNum;
- that.tomorrowNum = that.taskList[1].countNum;
- }else{
- var resJson = JSON.stringify(res);
- if (resJson.indexOf("请求云之家openauth2服务失败") >= 0) {
- alert(that.localeResource.common_loginTimeout)
- }else if (resJson.indexOf("无法连接EAS服务器") >= 0) {
- alert(that.localeResource.common_EAS500)
- }else{
- var tipInfo = that.localeResource.common_errorMsg;
- if(res.mesg){
- tipInfo = res.mesg;
- }
- mbos.ui.showError({
- title:tipInfo,
- })
- }
- that.taskList = [{countNum:0,items:[]},{countNum:0,items:[]}];
- that.hasData = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum == 0 ) ? false : true;
- that.curIndex = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum != 0 ) ? 1 : 0;
- that.curList = that.taskList[that.curIndex];
- that.todayNum = that.taskList[0].countNum;
- that.tomorrowNum = that.taskList[1].countNum;
- }
- },
- error:function(e){
- console.log(e);
- that.taskList = [{countNum:0,items:[]},{countNum:0,items:[]}];
- that.hasData = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum == 0 ) ? false : true;
- that.curIndex = ( that.taskList[0].countNum == 0 && that.taskList[1].countNum != 0 ) ? 1 : 0;
- that.curList = that.taskList[that.curIndex] ;
- that.todayNum = that.taskList[0].countNum;
- that.tomorrowNum = that.taskList[1].countNum;
- // mbos.ui.showError({
- // title:"调用接口失败,请联系管理员",
- // })
- }
- });
- },
- showList: function(index){
- this.curIndex = index;
- this.curList = this.taskList[index];
- },
- linkPage: function(item){
- if(item.state=='待面试'){
- location.href = this.pagePath + '00.custom#/resume_detail?recordId='+encodeURIComponent(item.recordId);
- }else if(item.state==='待评价'){
- location.href = this.pagePath + '00.custom#/judge_page?recordId='+encodeURIComponent(item.recordId);
- }else{
- location.href = this.pagePath + '00.custom#/judge_page?recordId='+encodeURIComponent(item.recordId);
- }
- },
- // 显示视频面试信息弹框
- openVideoInterviewBox: function(item){
- this.$refs.videobox.getVideoInterviewMsg(item.recordId);
- },
- }
- }
-
- var routes = [
- { path: '/', meta: {title:'招聘GO', tab: true}, component: cA, name: 'a'},
- ]
- var router = new VueRouter({
- routes: routes
- });
- router.beforeEach(function(to, from, next) {
- if (to.meta.title) {//如果设置标题,拦截后设置标题
- document.title = to.meta.title
- }
- next()
- })
- var VueClipboard = VueClipboard;
- // 入口
- setTimeout(function(){
- _this.myVue = new Vue({
- router: router,
- VueClipboard: VueClipboard,
- el: '#app',
- data: function(){
- return {}
- },
- created: function(){
- // this[this.$route.name] = '/mbos/store/4000148/fileLibrary/attendance-'+ this.$route.name +'.png';
- },
- watch: {
- // '$route': function(to, from){
- // this[to.name] = '/mbos/store/4000148/fileLibrary/attendance-'+ to.name +'.png';
- // this[from.name] = '/mbos/store/4000148/fileLibrary/attendance-'+ from.name +'1.png';
- // if(to.meta.tab){
- // this.tabShow = true;
- // }else{
- // this.tabShow = false;
- // }
- // }
- },
- components:{
- cA: cA,
- },
- methods: {
- close: function(){
- this.bills = false;
- }
- }
- }).$mount('#app')
- })
- })
- // _this.openPage = function(event){
- // }
- _this.initBannerVue = function(){
- // rem --> px
- ; (function (win, doc) {
- function change() {
- var rem = (doc.documentElement.clientWidth * 20) / 375
- doc.documentElement.style.fontSize = rem + 'px'
- var d = document.createElement('div')
- d.style.cssText = 'width:10rem;height:0;overflow: hidden;position:absolute;z-index:-1;visibility: hidden;'
- document.body.appendChild(d)
- var dw = d.offsetWidth // 10rem的实际展示px值
- document.body.removeChild(d)
- realRem = (rem * rem * 10) / dw
- doc.documentElement.style.fontSize = realRem + 'px'
- }
- if ($('body').length >= 1) {
- change()
- }
- win.addEventListener('load', change, false)
- win.addEventListener('resize', change, false)
- win.addEventListener('orientationchange', change, false)
- })(window, document)
- // s-HR设置的banner图
- var bannerBox = {
- template:'#bannerBox',
- data: function(){
- return {
- imgPath: location.origin+'/mbos/store/'+encodeURIComponent(mbos.getRequestParams().eid)+'/'+mbos.getRequestParams().path+'/',
- bannerImgBg: [],
- }
- },
- components: {},
- created: function(){
- this.localeResource = window.localeResource;
- this.getBannerImage();
- },
- methods: {
- // banner图
- getBannerImage: function(){
- var that = this;
- mbos.eas.invokeScript({
- name:"commonOSFservice",
- param:['getLightAppBannerService',JSON.stringify({number:'002'})],
- success:function(res){
- console.log('调用接口成功');
- if(res.code == 0){
- if(res.data.imageSrc.length > 0){
- var imageSrc = res.data.imageSrc;
- var easUrl = easContext.easUrl+'/shr';
- for(var i = 0; i < imageSrc.length; i ++){
- that.bannerImgBg.push(location.protocol+'//wscloud.kingdee.com/recRegister/recDemand/getSHRImageByURL?serviceURL=' + encodeURIComponent(easUrl) + '&imageURL=' + imageSrc[i]);
- }
- $('.glicon').hide();
- // console.log(that.bannerImgBg)
- }else{
- $('#bannerBoxHtml').hide();
- $('.glicon').css('visibility','visible');
- }
- }else{
- var tipInfo = that.localeResource.home_info_3;
- if(res.msg){
- tipInfo = res.msg;
- }
- $('#bannerBoxHtml').hide();
- $('.glicon').css('visibility','visible');
- }
- },
- error:function(e){
- console.log('调用接口失败');
- console.log(e);
- $('#bannerBoxHtml').hide();
- $('.glicon').css('visibility','visible');
- }
- })
- },
- }
- }
-
- var routes = [
- { path: '/', meta: {title:'', tab: true}, component: bannerBox, name: 'bannerBox'},
- ]
- var router = new VueRouter({
- routes: routes
- });
- router.beforeEach(function(to, from, next) {
- if (to.meta.title) {//如果设置标题,拦截后设置标题
- document.title = to.meta.title
- }
- next()
- })
- // 入口
- setTimeout(function(){
- _this.myBanerVue = new Vue({
- router: router,
- el: '#customBaner',
- data: function(){
- return {}
- },
- created: function(){
- },
- components:{
- bannerBox: bannerBox,
- },
- methods: {
- close: function(){
- this.bills = false;
- }
- }
- }).$mount('#customBaner')
- })
- }
-
|