|
@@ -74,33 +74,6 @@ function getKfDate(res) {
|
|
|
|
|
|
}
|
|
|
var kfType = {}
|
|
|
-function shunted () {
|
|
|
- $.post({
|
|
|
- url: '/message/obtainShunt',
|
|
|
- type: 'POST',
|
|
|
- // async: false,
|
|
|
- data: JSON.stringify({type: 'PC'}),
|
|
|
- contentType: 'application/json',
|
|
|
- success: function (res) {
|
|
|
- var kfDatas = JSON.stringify({
|
|
|
- isShunt: res.data.isShunt,
|
|
|
- url: res.data.url,
|
|
|
- currentDate: new Date(new Date()).toLocaleDateString()
|
|
|
- })
|
|
|
- var getDates = localStorage.getItem('kf-shunt-data')
|
|
|
- var currents = new Date(new Date()).toLocaleDateString()
|
|
|
- console.info(!getDates, currents)
|
|
|
- if (!getDates) {
|
|
|
- localStorage.setItem('kf-shunt-data', kfDatas)
|
|
|
- } else {
|
|
|
- if (res.data.isShunt && currents !== JSON.parse(getDates).currentDate) {
|
|
|
- localStorage.setItem('kf-shunt-data', kfDatas)
|
|
|
- }
|
|
|
- }
|
|
|
- console.info(localStorage.getItem('kf-shunt-data'))
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
function kfContact() {
|
|
|
/* 客服咨询 */
|
|
|
$.post({
|
|
@@ -116,7 +89,7 @@ function kfContact() {
|
|
|
})
|
|
|
var getDates = localStorage.getItem('kf-shunt-data')
|
|
|
var currents = new Date(new Date()).toLocaleDateString()
|
|
|
- console.info(!getDates, currents)
|
|
|
+ console.info(getDates, currents)
|
|
|
if (getDates) {
|
|
|
if (currents !== JSON.parse(getDates).currentDate) {
|
|
|
localStorage.setItem('kf-shunt-data', kfDatas)
|
|
@@ -126,7 +99,7 @@ function kfContact() {
|
|
|
}
|
|
|
kfType = localStorage.getItem('kf-shunt-data')
|
|
|
console.info(JSON.parse(kfType).url)
|
|
|
- if (JSON.parse(kfType).url == 'zcpc') {
|
|
|
+ if (JSON.parse(kfType).isShunt && JSON.parse(kfType).url == 'zcpc') {
|
|
|
;(function (w, d, e, x) {
|
|
|
w[e] = function () { w.cbk = w.cbk || []; w.cbk.push(arguments); }
|
|
|
x = d.createElement('script');
|
|
@@ -194,10 +167,10 @@ $(function () {
|
|
|
kfContact()
|
|
|
})
|
|
|
$('.help-slide-bottom .open-customer').on('click', function (e) {
|
|
|
- e.stopPropagation()
|
|
|
+ // e.stopPropagation()
|
|
|
var shunt = JSON.parse(localStorage.getItem('kf-shunt-data'))
|
|
|
if (shunt.url && shunt.url == 'zcpc') {
|
|
|
- return
|
|
|
+ // return
|
|
|
} else {
|
|
|
location.href = shunt.url + '&mini=0'
|
|
|
}
|
|
@@ -223,6 +196,13 @@ $(window).on('click', function (e) {
|
|
|
var openDom = $(e.target).hasClass('open-customer') || $(e.target).parents().hasClass('open-customer')
|
|
|
if (openDom) {
|
|
|
openCustomDig = true
|
|
|
+ // var shunt = JSON.parse(localStorage.getItem('kf-shunt-data'))
|
|
|
+ // console.info(shunt)
|
|
|
+ // if (shunt.url && shunt.url == 'zcpc') {
|
|
|
+ // // return
|
|
|
+ // } else {
|
|
|
+ // location.href = shunt.url + '&mini=0'
|
|
|
+ // }
|
|
|
$(".icon-badge-number").removeAttr('data-badge-number');
|
|
|
var href = window.location.href;
|
|
|
var sourceStr =""
|