footer.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. let isPC = ''
  2. if (document.documentElement.clientWidth > 750) {
  3. isPC = true
  4. $(".footer-share-logo-wx").hover(function () {
  5. $(".footer-share-er").show()
  6. }, function () {
  7. $(".footer-share-er").hide()
  8. });
  9. } else {
  10. isPC = false
  11. $(".footer-share-logo-wx").click(function () {
  12. let ifTrue = $(".footer-share-er").css("display") === "none"
  13. if (ifTrue) {
  14. $(".footer-share-er").show()
  15. } else {
  16. $(".footer-share-er").hide()
  17. }
  18. })
  19. }
  20. // 判断是否首次进入
  21. if ($.cookie('has_entered') === "1") {
  22. $('.advisory-tips-box').hide()
  23. } else {
  24. $.cookie('has_entered', 1, { expires: 1 });
  25. setTimeout(function () {
  26. $('.advisory-tips-1').show()
  27. setTimeout(function () {
  28. $('.advisory-tips-1').hide()
  29. setTimeout(function () {
  30. $('.advisory-tips-2').show()
  31. setTimeout(function () {
  32. $('.advisory-tips-2').hide()
  33. $('.advisory-img-box').addClass('advisory-img-radius')
  34. }, 2400);
  35. }, 10000);
  36. }, 1500);
  37. }, 600);
  38. }
  39. // 客服咨询打开
  40. $('.advisory-img').click(function () {
  41. let ifTrue = $('.advisory-box').css('display') === 'none';;
  42. if (ifTrue) {
  43. $('.advisory-box').show();
  44. $('.advisory-tips-box').hide()
  45. $('.advisory-img-box').addClass('advisory-img-radius-none')
  46. } else {
  47. $('.advisory-box').hide();
  48. }
  49. })
  50. // 客服咨询区域外关闭导航栏
  51. $('.wrap').click(function () {
  52. let ifTrue = $('.advisory-box').css('display') === 'none';;
  53. if (!ifTrue) {
  54. $('.advisory-box').hide();
  55. }
  56. });
  57. //点击区域阻止冒泡
  58. $('.advisory-box,.advisory-img').click(function (event) {
  59. event.stopPropagation();
  60. });
  61. // 个人号
  62. $('.advisory-pc-personal').click(function () {
  63. if ($.cookie('kingdee_uid')) {
  64. let _Data = {
  65. uid: $.cookie('kingdee_uid'),
  66. prodClientType: 'WEB',
  67. };
  68. $.ajax({
  69. url: CONFIG.api + '/cmsadmin/robert/goRobert',
  70. type: 'POST',
  71. dataType: 'json',
  72. contentType: "application/json;charset=UTF-8",
  73. headers: {
  74. 'site_param': $.cookie('site_param')
  75. },
  76. data: JSON.stringify(_Data),
  77. success: function (da) {
  78. if (da.code === 200) {
  79. newWin(da.data, 'newa6')
  80. } else if (da.code === 202) {
  81. window.location.href = da.data
  82. }
  83. },
  84. error: function () {
  85. }
  86. })
  87. } else {
  88. let _Data = {
  89. uid: null,
  90. prodClientType: 'WEB',
  91. };
  92. $.ajax({
  93. url: CONFIG.api + '/cmsadmin/robert/goRobert',
  94. type: 'POST',
  95. dataType: 'json',
  96. contentType: "application/json;charset=UTF-8",
  97. headers: {
  98. 'site_param': null
  99. },
  100. data: JSON.stringify(_Data),
  101. success: function (da) {
  102. if (da.code === 200) {
  103. newWin(da.data, 'newa7')
  104. } else if (da.code === 202) {
  105. //alert('请登录后,再进行操作!')
  106. window.location.href = da.data
  107. }
  108. },
  109. error: function () {
  110. }
  111. })
  112. }
  113. })
  114. // 售前咨询
  115. $('.advisory-pc-item-before').click(function () {
  116. if ($.cookie('kingdee_uid')) {
  117. let _Data = {
  118. uid: $.cookie('kingdee_uid'),
  119. utm_source: $.cookie('utm_source')
  120. };
  121. if (isPC) {
  122. $.ajax({
  123. url: CONFIG.api + '/cmsadmin/imchat/redirectPCIM',
  124. type: 'POST',
  125. dataType: 'json',
  126. contentType: "application/json;charset=UTF-8",
  127. data: JSON.stringify(_Data),
  128. success: function (da) {
  129. if (da.code === 200) {
  130. newWin(da.data, 'newa8')
  131. } else {
  132. }
  133. },
  134. error: function () {
  135. }
  136. })
  137. } else {
  138. $.ajax({
  139. url: CONFIG.api + '/cmsadmin/imchat/redirectH5IM',
  140. type: 'POST',
  141. dataType: 'json',
  142. contentType: "application/json;charset=UTF-8",
  143. data: JSON.stringify(_Data),
  144. success: function (da) {
  145. if (da.code === 200) {
  146. newWin(da.data, 'newa9')
  147. } else {
  148. }
  149. },
  150. error: function () {
  151. }
  152. })
  153. }
  154. } else {
  155. let utm_source = $.cookie('utm_source')
  156. if (utm_source) {
  157. utm_source = utm_source == "baidu" ? "百度" : utm_source == "sogou" ? "搜狗" : utm_source == "sm" ? "神马" : utm_source == "toutiao" ? "今日头条"
  158. : utm_source == "wxmp" ? "微信MP" : utm_source == "baiduxin" ? "百度信息流" : utm_source == "zhihufolw" ? "知乎" : utm_source == "txfolw" ? "腾讯新闻" : utm_source;
  159. } else {
  160. utm_source = "金蝶官网";
  161. }
  162. let host = "support.kingdee.com";
  163. if (window.location.host == "uat.kingdee.com") {
  164. host = "supportest.kingdee.com";
  165. }
  166. let to_url = 'https://' + host + '/osp2016/chat/pc/index.php?vendorID=8&type=Sales&source=KingdeePC&utm_source=' + utm_source;
  167. newWin(to_url, 'newa10');
  168. }
  169. })
  170. var purchaseList = [];
  171. function obtainData() {
  172. // 获取下拉数据
  173. /*let res = [{
  174. title: '苍穹',
  175. sequence: 'SKYCLOUD'
  176. }, {
  177. title: 'EAS Cloud',
  178. sequence: 'EAS'
  179. }, {
  180. title: '金蝶云·星空',
  181. sequence: 'K3CLOUD'
  182. }, {
  183. title: 'K/3 WISE',
  184. sequence: 'K3WISE'
  185. }, {
  186. title: 'KIS',
  187. sequence: 'KIS'
  188. }, {
  189. title: 'KIS专业版',
  190. sequence: 'KISPRO'
  191. }, {
  192. title: 'KIS标准版',
  193. sequence: 'KISSTD'
  194. }, {
  195. title: '数据互通',
  196. sequence: 'JDY'
  197. }, {
  198. title: '智慧记',
  199. sequence: 'ZHJ'
  200. }, {
  201. title: 's-HR',
  202. sequence: 'SHR'
  203. }, {
  204. title: '管易云',
  205. sequence: 'GYY'
  206. }, {
  207. title: '账无忧',
  208. sequence: 'ZWY'
  209. }, {
  210. title: '云之家',
  211. sequence: 'YZJ'
  212. }, {
  213. title: '行业产品',
  214. sequence: 'INDUSTRY'
  215. }, {
  216. title: '其它产品',
  217. sequence: 'OTHERS'
  218. }]*/
  219. function obtain(res) {
  220. let html = ''
  221. res.forEach(function (item, i) {
  222. html += '<li value ="saab"><h4>' + item.title + '</h4><p>序列号 <span>' + item.prodSN + '</span></p><span style="display:none">' + item.prodCategoryCode + '</span><span style="display:none">' + item.prodDeployWay + '</span><span style="display:none">' + item.prodVersion + '</span></li>'
  223. })
  224. $('.after-sale-servicr-ul').html(html)
  225. }
  226. let prodConvert = {
  227. "C01": "EAS",
  228. "C02": "K3WISE",
  229. "C03": "KIS",
  230. "C04": "K3CLOUD",
  231. "C05": "SKYCLOUD",
  232. "C06": "JDY",
  233. "C07": "GYY",
  234. "C10": "ZWY",
  235. "C11": "OTHERS",
  236. "C22": "EAS"
  237. };
  238. if (purchaseList.length > 0) {
  239. // 下拉框显示
  240. $('.after-sale-servicr').show()
  241. obtain(purchaseList)
  242. } else {
  243. // 获取下拉列表数据
  244. $.ajax({
  245. url: CONFIG.api + '/cmsadmin/imchat/queryProductDataList',
  246. type: 'POST',
  247. dataType: 'json',
  248. contentType: 'application/json;charset=UTF-8',
  249. headers: {
  250. 'site_param': $.cookie('site_param')
  251. },
  252. success: function (da) {
  253. if (da.code === 200) {
  254. let res = [];
  255. if (da.data.length > 0) {
  256. da.data.forEach(function (item1, i1) {
  257. item1.active_product.forEach(function (item, i) {
  258. res.push({
  259. title: item.category_name,
  260. prodCategoryCode: prodConvert[item.category_code],
  261. prodSN: item.sn,
  262. prodDeployWay: item.prod_deploy_way,
  263. prodVersion: item.version
  264. });
  265. })
  266. })
  267. }
  268. purchaseList = res;
  269. if (res.length > 0) {
  270. // 下拉框显示
  271. $('.after-sale-servicr').show()
  272. obtain(res)
  273. } else {
  274. // 拦截框显示
  275. $('.sales-intercept').show()
  276. }
  277. }
  278. },
  279. error: function () {
  280. }
  281. })
  282. }
  283. }
  284. // 售后咨询,智能客服菜单
  285. $('.advisory-pc-item-after,a.autoCustService').click(function () {
  286. if ($.cookie('kingdee_uid')) {
  287. let _Data = {
  288. uid: $.cookie('kingdee_uid'),
  289. };
  290. if (isPC) {
  291. // 下拉列表
  292. obtainData()
  293. // $.ajax({
  294. // url: CONFIG.api + '/cmsadmin/imchat/redirectPCIMLater',
  295. // type: 'POST',
  296. // dataType: 'json',
  297. // contentType: "application/json;charset=UTF-8",
  298. // data: JSON.stringify(_Data),
  299. // success: function (da) {
  300. // if (da.code === 200) {
  301. // window.open(da.data)
  302. // } else {
  303. // }
  304. // },
  305. // error: function () {
  306. // }
  307. // })
  308. } else {
  309. $.ajax({
  310. url: CONFIG.api + '/cmsadmin/imchat/redirectH5IMLater',
  311. type: 'POST',
  312. dataType: 'json',
  313. contentType: "application/json;charset=UTF-8",
  314. data: JSON.stringify(_Data),
  315. success: function (da) {
  316. if (da.code === 200) {
  317. // window.open(da.data)
  318. } else {
  319. }
  320. },
  321. error: function () {
  322. }
  323. })
  324. }
  325. } else {
  326. //alert('请登录后,再进行操作!')
  327. $.ajax({
  328. url: CONFIG.api + '/cmsadmin/robert/goRobert',
  329. type: 'POST',
  330. dataType: 'json',
  331. contentType: "application/json;charset=UTF-8",
  332. headers: {
  333. 'site_param': null,
  334. 'sale_after': '1'
  335. },
  336. data: JSON.stringify({}),
  337. success: function (da) {
  338. if (da.code === 202) {
  339. window.location.href = da.data
  340. }
  341. },
  342. error: function () {
  343. }
  344. })
  345. }
  346. });
  347. // PC个人号展开
  348. // $(".advisory-pc-default-box-under").hover(function () {
  349. // $(".advisory-pc-dialog-box").show();
  350. // }, function () {
  351. // if ($('.advisory-pc-dialog-box:hover').length === 0) {
  352. // // $(".advisory-pc-dialog-box").hide();
  353. // }
  354. // });
  355. // $(".advisory-pc-dialog-box").mouseleave(function () {
  356. // if ($('.advisory-pc-default-box-under:hover').length === 0) {
  357. // $(".advisory-pc-dialog-box").hide();
  358. // }
  359. // })
  360. function gifToggle() {
  361. $(".content-gif1").show();
  362. $(".content-gif2").hide();
  363. setTimeout(function () {
  364. $(".content-gif1").hide();
  365. $(".content-gif2").show();
  366. }, 5000);
  367. }
  368. setInterval(function () {
  369. gifToggle()
  370. }, 10000)
  371. $(".after-sale-box-item-under").hover(function () {
  372. $(".advisory-pc-dialog-box").show()
  373. },function(){
  374. if ($('.advisory-pc-dialog-box:hover').length === 0) {
  375. $(".advisory-pc-dialog-box").hide();
  376. }
  377. })
  378. $(".advisory-pc-dialog-box").mouseleave(function () {
  379. if ($('.after-sale-box-item-under:hover').length === 0) {
  380. $(".advisory-pc-dialog-box").hide();
  381. }
  382. })
  383. $(".after-sale-box-item-center").hover(function () {
  384. $(".content-gif1").attr('src', 'https://www.kingdee.com/r/cms/www/default/v0.1/images/index/advisory-pc/content-gif2.gif');
  385. $(".after-sale-dialog-center").show()
  386. }, function () {
  387. $(".content-gif1").attr('src', 'https://www.kingdee.com/r/cms/www/default/v0.1/images/index/advisory-pc/content-gif1.gif');
  388. if ($('.after-sale-dialog-center:hover').length === 0) {
  389. $(".after-sale-dialog-center").hide();
  390. }
  391. })
  392. $(".after-sale-dialog-center").mouseleave(function () {
  393. if ($('.after-sale-box-item-center:hover').length === 0) {
  394. $(".after-sale-dialog-center").hide();
  395. }
  396. })
  397. // ------------------------左侧留咨----------------
  398. // 页面加载10s后向右侧自动滑入展开 10s
  399. // 滑开过程2s 2s
  400. // 无操作 展开状态停留10s后自动收回 10s
  401. // 10s后向右侧自动滑入展开
  402. setTimeout(function () {
  403. moveToLeft()
  404. // }, 2000);
  405. }, 10000);
  406. function moveToLeft() {
  407. $(".advisory-footer-left").hide();
  408. $(".advisory-footer-box").show();
  409. $(".advisory-footer-box").addClass("animateToRight")
  410. }
  411. // 向左滑
  412. // 展开状态停留10s后自动收回(用户无操作:悬停、点击、手机号、验证码输入等操作),否则则取消自动收回规则
  413. function moveToRight() {
  414. $(".advisory-footer-box").removeClass("animateToRight")
  415. $(".advisory-footer-box").addClass("animateToLeft")
  416. setTimeout(function () {
  417. $(".advisory-footer-left").show();
  418. $(".advisory-footer-box").hide();
  419. }, 500);
  420. }
  421. setTimeout(function () {
  422. if ($('.advisory-footer-box:hover').length === 0) {
  423. moveToRight()
  424. } else {
  425. }
  426. }, 20500);
  427. // }, 6000);
  428. $(".advisory-footer-left").click(function () {
  429. $(".advisory-footer-box").removeClass("animateToLeft")
  430. moveToLeft()
  431. })
  432. $(".advisory-footer-close").click(function () {
  433. $(".advisory-footer-box").removeClass("animateToRight")
  434. moveToRight()
  435. })
  436. setTimeout(function () {
  437. $(".advisory-footer-left").click(function () {
  438. $(".advisory-footer-box").removeClass("animateToLeft")
  439. moveToLeft()
  440. })
  441. $(".advisory-footer-close").click(function () {
  442. $(".advisory-footer-box").removeClass("animateToRight")
  443. moveToRight()
  444. })
  445. $(".advisory-footer-content-success .advisory-footer-content-right div").click(function () {
  446. moveToRight()
  447. })
  448. }, 10500);
  449. // }, 4000);
  450. $(".advisory-footer-content-code-text1 span").click(function(){
  451. $(".advisory-footer-content-code").hide();
  452. $(".advisory-footer-content-apply").show()
  453. })
  454. var applyPhone = document.querySelector('#apply-phone');// 手机号
  455. var codeInput;
  456. var codeNum = '123456'
  457. var codeList = $(".advisory-footer-content-code-num input")// 验证码
  458. var codeInputList //输入的验证码
  459. var codeText = document.querySelector('.codeText')
  460. var countDown = 60;
  461. var codeArr = new Array(6);
  462. $('#apply-phone').on('keypress', function (event) {
  463. if (event.keyCode == 13) {
  464. if (checkPhone()) {
  465. $(".advisory-footer-content-apply").hide();
  466. $(".advisory-footer-content-code-text .codePhone").text(applyPhone.value);
  467. setTime();
  468. $(".advisory-footer-content-code").css("display","flex");
  469. sendMsgCode()
  470. } else {
  471. $("#apply-phone").attr("placeholder", "")
  472. $("#apply-phone").blur();
  473. $("#apply-phone").val("")
  474. $(".phone-error").show()
  475. $(".phone-error").click(function () {
  476. $("#apply-phone").focus();
  477. $(".phone-error").hide()
  478. })
  479. }
  480. }
  481. });
  482. $(".advisory-footer-content-btn").click(function () {
  483. if (checkPhone()) {
  484. $(".advisory-footer-content-apply").hide();
  485. $(".advisory-footer-content-code-text .codePhone").text(applyPhone.value);
  486. setTime();
  487. $(".advisory-footer-content-code").show();
  488. sendMsgCode()
  489. } else {
  490. $("#apply-phone").attr("placeholder", "")
  491. $("#apply-phone").blur();
  492. $("#apply-phone").val("")
  493. $(".phone-error").show()
  494. $(".phone-error").click(function () {
  495. $("#apply-phone").focus();
  496. $(".phone-error").hide()
  497. })
  498. }
  499. })
  500. function checkPhone() {
  501. if (!(/^1[3456789]\d{9}$/.test(applyPhone.value)) || applyPhone.value == '') {
  502. return false;
  503. }
  504. return true;
  505. }
  506. $('.advisory-footer-content-code-num input:gt(0)').attr('readOnly', 'true');
  507. $('.advisory-footer-content-code-num input').keyup(function (e) {
  508. if(e.keyCode == 8){
  509. $(this).prev().focus();
  510. }else{
  511. $(".code-error-box").hide()
  512. if (/^[0-9]{1}$/g.test($(this).val())) {
  513. $(this).next().removeAttr('readOnly').focus();
  514. codeArr[$(this).index()] = $(this).val();
  515. if ($(this).index() == 5) {
  516. codeArr.join('')
  517. codeInput = codeArr.join('')
  518. checkMsgCode()
  519. }
  520. } else {
  521. $(this).val('');
  522. }
  523. }
  524. });
  525. // 验证码时间
  526. function setTime() {
  527. if (countDown == 0) {
  528. codeText.removeAttribute("disabled");
  529. codeText.innerText = "重新发送";
  530. countDown = 60;
  531. return;
  532. } else {
  533. codeText.setAttribute("disabled", true);
  534. codeText.innerText = countDown + "s";
  535. countDown--;
  536. }
  537. setTimeout(function () {
  538. setTime()
  539. }, 1000)
  540. }
  541. $(".codeText").click(function(){
  542. setTime()
  543. })
  544. // 向手机发送验证码
  545. function sendMsgCode() {
  546. if (!checkPhone()) {
  547. return;
  548. }
  549. let tel = {
  550. phone: applyPhone.value
  551. }
  552. $.ajax({
  553. type: "POST",
  554. url: CONFIG.api + "/cmsadmin/inquiry/sendMsgCode",
  555. data: JSON.stringify(tel),
  556. dataType: "json",
  557. contentType: 'application/json;charset=utf-8',
  558. success: function (res) {
  559. console.log(res)
  560. if (res.code == -1) {
  561. console.log(res.message)
  562. alert(res.message)
  563. } else {
  564. setTime()
  565. }
  566. },
  567. error: function (err) {
  568. console.error(err);
  569. alert(err)
  570. }
  571. })
  572. }
  573. function checkMsgCode() {
  574. let telCode = {
  575. phone: applyPhone.value,
  576. vcode: codeInput
  577. }
  578. // 初次请求,验证输入的手机和验证码是否对的上
  579. $.ajax({
  580. type: "post",
  581. url: CONFIG.api + "/cmsadmin/inquiry/vaildMsgCode",
  582. data: JSON.stringify(telCode),
  583. dataType: "json",
  584. contentType: "application/json;charset=utf-8",
  585. success: function (res) {
  586. console.log(res);
  587. if (res.code == -1) {
  588. console.log(res.message);
  589. // alert(res.message);
  590. for (var i = 0; i < codeList.length; i++) {
  591. codeList.eq(i).val('');
  592. codeList.eq(0).focus()
  593. $(".code-error-box").hide()
  594. }
  595. $(".code-error-box").show()
  596. } else {
  597. $(".advisory-footer-content-enter").hide()
  598. $(".advisory-footer-content-success").css("display", "flex")
  599. }
  600. },
  601. error: function (err) {
  602. console.log(err);
  603. alert(err)
  604. }
  605. })
  606. }
  607. // ------------------------左侧留咨 end ----------------
  608. // 回到顶部
  609. $(function () {
  610. $(window).scroll(function () {
  611. let scrollTop = document.documentElement.scrollTop || document.body.scrollTop
  612. let windowH = $(window).height()
  613. if (scrollTop > windowH) {
  614. $(".back-to-top").show()
  615. } else {
  616. $(".back-to-top").hide()
  617. }
  618. })
  619. })
  620. $(".back-to-top").on('click', function () {
  621. window.scrollTo({ top: 0, behavior: 'smooth' })
  622. })
  623. // ================下拉框
  624. // 点击下拉
  625. let isshow = false
  626. $('.after-sale-servicr-selection').click(function (e) {
  627. e.stopPropagation()
  628. isshow = !isshow
  629. if (isshow) {
  630. $('.after-sale-servicr-ul').show()
  631. } else {
  632. $('.after-sale-servicr-ul').hide()
  633. }
  634. })
  635. // 选项点击
  636. $('.after-sale-servicr-ul').on('click', 'li', function (e) {
  637. e.stopPropagation()
  638. // let prodCategoryCode = {
  639. // EAS: 'C01',
  640. // K3WISE: 'C02',
  641. // KIS: 'C03',
  642. // C04K3CLOUD: 'C04',
  643. // SKYCLOUD: 'C05',
  644. // JDY: 'C06',
  645. // GYY: 'C07',
  646. // ZWY: 'C10',
  647. // OTHERS: 'C11',
  648. // EAS: 'C22',
  649. // }
  650. $('.after-sale-servicr-active').removeClass('after-sale-servicr-active')
  651. $(this).addClass('after-sale-servicr-active')
  652. $('.after-sale-servicr-selection').text($(this).children('h4').text())
  653. $('.after-sale-servicr-selection').attr('prodSN', $(this).children('p').children('span').text());
  654. $('.after-sale-servicr-selection').attr('prodCategoryCode', $(this).children('span').get(0).innerText)
  655. $('.after-sale-servicr-selection').attr('prodDeployWay', $(this).children('span').get(1).innerText)
  656. $('.after-sale-servicr-selection').attr('prodVersion', $(this).children('span').get(2).innerText)
  657. // $('.after-sale-servicr-selection').attr('prodCategoryCode',prodCategoryCode[$(this).children('p').children('span').text()])
  658. isshow = false
  659. $('.after-sale-servicr-ul').hide()
  660. })
  661. // 遮罩层点击隐藏
  662. $('.after-sale-servicr').click(function () {
  663. $(this).hide()
  664. })
  665. // 阻止冒泡
  666. $('.after-sale-servicr-box').click(function (e) {
  667. e.stopPropagation()
  668. isshow = false
  669. $('.after-sale-servicr-ul').hide()
  670. })
  671. // 取消
  672. $('.after-sale-servicr-cancel').click(function (e) {
  673. e.stopPropagation()
  674. $('.after-sale-servicr').hide()
  675. })
  676. // 确定
  677. $('.after-sale-servicr-determine').click(function (e) {
  678. e.stopPropagation()
  679. if ($('.after-sale-servicr-selection').attr('prodSN')) {
  680. let _Data = {
  681. kduid: $.cookie('kingdee_uid'),
  682. site_param: $.cookie('site_param'),
  683. prodCategoryCode: $('.after-sale-servicr-selection').attr('prodCategoryCode'),
  684. prodSN: $('.after-sale-servicr-selection').attr('prodSN'),
  685. prodDeployWay: $('.after-sale-servicr-selection').attr('prodDeployWay'),
  686. prodVersion: $('.after-sale-servicr-selection').attr('prodVersion')
  687. }
  688. $.ajax({
  689. // url: 'https://supportest.kingdee.com/productSelect.php',
  690. url: CONFIG.api + '/cmsadmin/imchat/redirectPCIMLater',
  691. type: 'POST',
  692. dataType: 'json',
  693. contentType: "application/json;charset=UTF-8",
  694. data: JSON.stringify(_Data),
  695. headers: {
  696. 'kduid': $.cookie('kingdee_uid'),
  697. 'site_param': $.cookie('site_param')
  698. },
  699. success: function (da) {
  700. if (da.code === 200) {
  701. newWin(da.data, 'newa12')
  702. } else {
  703. }
  704. },
  705. error: function () {
  706. }
  707. })
  708. }
  709. })
  710. // 客服电话弹框
  711. if (document.querySelector('.customer_phone_mask')) {
  712. function customerBoxEject(time) {
  713. setTimeout(function () {
  714. $('.customer_phone_mask').fadeIn(1000);
  715. $('.customer_phone_buts').animate({ marginLeft: '0' }, 1000)
  716. $('.customer_phone_text').animate({ marginLeft: '0' }, 1000)
  717. }, time);
  718. }
  719. if (sessionStorage.getItem("FirstEntry")) {
  720. customerBoxEject(60000)
  721. } else {
  722. sessionStorage.setItem("FirstEntry", "false")
  723. customerBoxEject(10000)
  724. }
  725. $('.customer_phone_close').click(function () {
  726. $('.customer_phone_mask').hide()
  727. customerBoxEject(60000)
  728. })
  729. }
  730. //a标签动态click
  731. function newWin(url, id) {
  732. let a = document.createElement('a');
  733. a.setAttribute('href', url);
  734. a.setAttribute('target', '_blank');
  735. a.setAttribute('id', id);
  736. // 防止反复添加
  737. if (!document.getElementById(id)) document.body.appendChild(a);
  738. a.click();
  739. }
  740. // 未购买商品售后拦击弹框
  741. $('.sales-intercept-close').click(function () {
  742. $('.sales-intercept').hide()
  743. })
  744. $('.sales-intercept-butt').click(function (e) {
  745. e.preventDefault()
  746. $('.sales-intercept').hide()
  747. })