' CrmWxLogin.append(html) } $(".wechat-login-shadow").data("target",_target); $("#loginBox").data("target",_target); $('.uc_login').click(); }; function openWechatCommonLogin() { //CRM模式优化登录 var obj = new WxLogin({ self_redirect: true, id: "login_container", appid: "wx7369eebb3f9338d8", scope: "snsapi_login", redirect_uri: "https://cs.loupan.com/wechat_callback/im_login/", style: "black", href: "https://public.loupan.com/public/assets_v4/css/wechatCallback.css" }); document.querySelector('.wechat-login-shadow').style.display = 'block'; }; function closeDialog () { _curPage = window._curPage; document.querySelector('.wechat-login-shadow').style.display = 'none'; var $target = $('.wechat-login-shadow').data("target"); if (!$target) { return; } var recordPoint = $target.dataset.recordpoint; if(recordPoint){ recordPoint = JSON.parse(recordPoint); if(recordPoint.close){ LOUPAN_COMMON.StatisticsEvent(recordPoint.close) } } }; function getCookie (sName){ var aCookie = document.cookie.split("; "); for (var i=0; i < aCookie.length; i++) { var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) { return unescape(aCrumb[1]); } } return null; }; function setCookie (sName, sValue, expiredays = 7) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = sName + "=" + escape(sValue) + "; expires=" + exdate.toGMTString() + "; path=/;domain=.loupan.com"; }; function successCallback (params) { if (params.data.type !== 'wechatLogin') { return null; } var info = params.data.data; var tel = params.data.tel; var data_1 = JSON.parse(info); var data = JSON.parse(data_1); if (data.statusCode === 'visitor') { usercenter.showConfirmBox(data.wechatInfo) $.cookie('visitedInfo', JSON.stringify(data.visitorInfo), { expires: 7, path: '/', domain: '.loupan.com' }); } else if (data.statusCode === 'member') { $.cookie('token', data.token, { expires: 7, path: '/', domain: '.loupan.com' }); $.cookie('userInfo', JSON.stringify(data.profile), { expires: 7, path: '/', domain: '.loupan.com' }); $.cookie('visitedInfo', JSON.stringify(data.visitorInfo), { expires: 7, path: '/', domain: '.loupan.com' }); loginSuc(data.profile); } closeDialog(); var _target = $(".wechat-login-shadow").data("target"); if(_target){ _target.click(); } //触发页面函数 usercenter.loginSuccessHandle(); // 埋点 var $target = $('.wechat-login-shadow').data("target"); if ($target) { var recordPoint = $target.dataset.recordpoint; if(recordPoint){ recordPoint = JSON.parse(recordPoint); if(recordPoint.success){ LOUPAN_COMMON.StatisticsEvent(recordPoint.success) } } } if (typeof usercenter !== 'undefined' && typeof usercenter.loginSuccessJump !== 'undefined') { // 扫码登录成功后跳转到新页面 usercenter.loginSuccessJump($("#loginBox")); } }; function loginSuc (data) { var loginBox = $('.userState.login2'), that = this, html = ''; html += '' + data.phone; html += '

个人用户中心

'; html += '
/'; html += '退出'; loginBox.html(html); }; window.addEventListener("message", successCallback, false); var openChat = function (params,_record,scan,login) { var tel = params.mobile; var position_id=params.position_id; var userInfo = getCookie('userInfo'); var imLogin=JSON.parse(getCookie('imLogin') || '{}'); let _target = window.event.currentTarget; var house_id = params.house_id || window.house_detail_id || ""; // 埋点 var recordpoint = $(_target).data("recordpoint"), _msg = $(_target).attr("msg") || ""; if(recordpoint){ if(recordpoint.open){ LOUPAN_COMMON.StatisticsEvent(recordpoint.open) } } if(userInfo){ if(imLogin.id){ ChatSass.initAgentAccount({'angentTel':tel,'imLogin':imLogin.id,'house_id':house_id,'position_id':position_id,'company_id':params.company_id},_msg) }else{ userInfo=JSON.parse(userInfo); ChatSass.loginIm({'angentTel':tel,'tel':userInfo.origin_phone,'house_id':house_id,'position_id':position_id,'company_id':params.company_id},_msg) } }else{ var _dataset = _target.dataset, _nick = _dataset.nick, _avatar = _dataset.avatar; ChatSass.imTarget(tel,_target); ChatSass.createDemoChat({'nick':_nick,'avatar':_avatar},house_id) } }; var openWxCommonLogin = function(){ //CRM模式优化登录 if($(".wechat-login-shadow .wechat-con .login_way").length == 0){ var CrmWxLogin=$(".wechat-login-shadow .wechat-con"); var html=''; html+='' CrmWxLogin.append(html) } $("#loginBox").hide(); openWechatCommonLogin(); }

全国统一服务热线 4008180066转66 | 邮箱:[email protected] ICP备案号:湘ICP备12003586号-55

投诉电话:4008180066 转 017942(在线时间为周一至周五9:00-18:00)

Copyright 东莞楼盘网网络科技有限公司

楼盘网产品使用意见反馈
创建时间:2024-12-16
感谢您对楼盘网的支持与关注,请将您遇到的问题或者建议反馈给我们,我们虚心接受您最诚挚的意见和建议。

反馈内容*

联系方式*