import * as compnt from "../../../public/js/compnt.js"; import * as unicom from "../../../public/js/unicom.js"; import "../scss/stackpkg.scss"; import "../../../public/scss/unicom.scss"; init(); function init() { compnt.showLoading(); unicom.init().then(function(response) { compnt.hideLoading(); unicom.setProduct(response.product[0]); unicom.setFesname(response.festival); // alert(JSON.stringify(unicom.query)) if (!!unicom.query.tradeno) { showPayQueryDialog(); } // bindSend(); // bindOrder(); if (location.href.indexOf('/cancel') >= 0) { unicom.burypointLogId('110002'); // 退订页面pv, pv去重得到uv // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'cancel_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } else if (location.href.indexOf('/draw') >= 0) { unicom.burypointLogId('110003'); // 领取页面pv, pv去重得到uv // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'draw_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } else if (location.href.indexOf('/flow') >= 0) { unicom.burypointLogId('110004'); // 流量查询pv, pv去重得到uv // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'flow_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } else if (location.href.indexOf('/active') >= 0) { unicom.burypointLogId('110005'); // 激活页面pv, pv去重得到uv // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'active_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } else { // location.href.indexOf('/index') >= 0 // location.href.indexOf('/order') >= 0 unicom.burypointLogId('110001'); // 订购页面pv, pv去重得到uv // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'order_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } }) // bindShowAgr(); } // function bindSend() { // // @ts-ignore // var $container = $('.section-login').find('.form-group'); // $container.find('.sendcode').unbind('click').on('click', function() { // unicom.sendSms($container, 'orderlogin'); // unicom.burypointLogId('200001'); // // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_click_send_sms_code_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) // }) // } $(".btn_al").click(function() { $('.overlayr').css('display', 'none') $('.overlayss').css('display', 'none') $('body').css('overflow', 'auto') compnt.unlockClick(); }); $(".box_a").click(function() { if (!compnt.lockClick()) { return; } var ticket = getUrlParam("ticket"); if (ticket == null || ticket == '') { if (navigator.userAgent.toLocaleLowerCase().indexOf('unicom') < 0) { compnt.showAlert('请在中国联通APP中访问本页面!'); compnt.unlockClick(); return; } else { compnt.showAlert('未获取到ticket,请联系管理员!'); compnt.unlockClick(); return; } } if (window.localStorage.getItem('ticket') == unicom.query.ticket) { if (window.localStorage.getItem('ticketMessage') == null) { compnt.showAlert('会话已过期,请重新打开!'); } else { // compnt.showAlert(window.localStorage.getItem('ticketMessage')); $('.overlayr').css('display', 'none') $('.overlayss').css('display', 'block') $('.text_abkl').html(window.localStorage.getItem('ticketMessage')) $('.section-logins').css('display', 'none') } compnt.unlockClick(); return; } window.localStorage.setItem('ticket', unicom.query.ticket); $('.overlayssr').css('display', 'flex') $('body').css('overflow', 'hidden') // compnt.showLoading(); unicom.allowdeaw(ticket).done(function(response) { $('.overlayssr').css('display', 'none'); $('body').css('overflow', 'auto'); // compnt.hideLoading(); compnt.unlockClick(); // console.log(response) // compnt.hideLoading(); // console.log(response.resultCode) if (response.resultCode == '1104') { $('.overlayr').css('display', 'none') $('.overlayss').css('display', 'block') $('.section-logins').css('display', 'none') $('.text_abkl').html("号码原因不支持领取!") window.localStorage.setItem("ticketMessage", "号码原因不支持领取!"); WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } else if (response.resultCode == '0000') { $('.overlayr').css('display', 'block') $('.overlayss').css('display', 'none') $('.section-logins').css('display', 'none') window.localStorage.setItem("ticketMessage", "您已领取过该产品!"); WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_success' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } else if (response.resultCode == '1105') { $('.overlayr').css('display', 'none') $('.overlayss').css('display', 'block') $('.text_abkl').html("您已领取过该产品!") window.localStorage.setItem("ticketMessage", "您已领取过该产品!"); $('.section-logins').css('display', 'none') WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } else if (response.resultCode == '6034') { $('.overlayr').css('display', 'none') $('.overlayss').css('display', 'block') $('.text_abkl').html("您已领取过该产品!") $('.section-logins').css('display', 'none') window.localStorage.setItem("ticketMessage", "您已领取过该产品!"); WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } else if (response.resultCode == '1061') { $('.overlayr').css('display', 'none') $('.overlayss').css('display', 'block') $('.text_abkl').html("无效的ticket,请联系管理员!") $('.section-logins').css('display', 'none') window.localStorage.setItem("ticketMessage", "无效的ticket,请联系管理员!"); WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) } }).fail(function(response) { $('.overlayssr').css('display', 'none'); $('body').css('overflow', 'auto'); compnt.unlockClick(); }) function getUrlParam(urlprm) { var reg = new RegExp("(^|&)" + urlprm + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) { return r[2]; } } }); function showAgr() { var $overlay = $('
'); var $dialog = $( '
' + '
' + ' ' + '
' + '
活动说明
' + '
' + '
    ' + '
  • 01
    ' + '

    针对已订购今日头条定向流量10GB月包(前向)且流量剩余接近阈值的用户,现在可叠加订购今日头条定向流量10GB月包(后向)。每个用户本月仅限订购一次今日头条定向流量10GB月包(后向)。

    ' + '
  • ' + '
  • 02
    ' + '

    “今日头条定向流量10GB月包(后向)”订购成功后立即生效,月底失效,次月不自动续订,本流量包不支持重复订购。

    ' + '
  • ' + '
' + '
' + '
温馨提示
' + '
' + '
    ' + '
  • 01
    ' + '

    符合订购约定的中国联通手机4G、5G套餐用户(除4G冰激凌套餐、4G、5G冰激凌套餐副卡及懂我卡等)用户均可订购,智慧沃家成员用户、主副卡用户订购当前定向流量产品,只限该成员使用,其他成员不可共享。

    ' + '
  • ' + '
  • 02
    ' + '

    达量限速套餐用户订购当前定向流量产品,包内定向流量不提升原套餐限速阈值和网速,不能做为限速后解限的加速包使用,依然执行基础套餐限速阈值的约定。

    ' + '
  • ' + '
  • 03
    ' + '

    “今日头条定向流量10GB月包(前向)”和“今日头条定向流量10GB月包(后向)”两者可以叠加订购;叠加订购时,先消耗“今日头条定向流量10GB月包(前向)”中的定向流量,再消耗“今日头条定向流量10GB月包(后向)”中的定向流量,都超出后按照用户所选套餐资费或标准资费及联通公司已审批备案公示的资费标准收取。

    ' + '
  • ' + '
  • 04
    ' + '

    用户须处于正常可用状态下才可订购,处于紧急停机(挂失)、欠费停机、停机保号等状态的后付费用户及处于未激活器、充值期、锁定期的预付费用户不可办理。

    ' + '
  • ' + '
  • 05
    ' + '

    请在UNINET、3GNET 、WONET手机接入点环境下访问使用,其他接入点将无法正常使用定向流量。

    ' + '
  • ' + '
  • 06
    ' + '

    定向流量使用区域:在全国范围可以使用(不含港澳台地区),在国际漫游情况下不能使用。

    ' + '
  • ' + '
  • 07
    ' + '

    用户成功订购该头条系流量包后,如果遇到页面提示不免流,敬请忽略,正常使用。

    ' + '
  • ' + '
  • 08
    ' + '

    关于产品使用过程中有任何疑问可咨询联通客服:10010。

    ' + '
  • ' + '
' + '
' + '
流量说明
' + '
' + '
    ' + '
  • 01
    ' + '

    定向流量包适用范围包含:今日头条、今日头条lite版本、西瓜视频、抖音火山版、抖音视频、多闪、图虫、懂车帝、皮皮虾、海豚股票、海豚财富、gogokid、轻颜、好好学习、飞聊、飞书、激萌、时光相册、半次元、番茄畅听APP使用。

    ' + '
  • ' + '
  • 02
    ' + '

    定向流量适用范围不包含:发起直播及上传视频;第三方提供的广告、视频、图片;下载/缓存客户端及第三方链接视频所产生的流量。

    ' + '
  • ' + '
  • 03
    ' + '

    如您是头条相关互联网卡套餐用户,如蚂蚁宝卡、阿里宝卡、钉钉宝卡或工商银行e卡等,将优先使用套餐内的专属定向流量,用罄后即消耗该产品包内的定向流量。

    ' + '
  • ' + '
' + '
' + '
' ) $overlay.appendTo($(document.body)) $dialog.appendTo($(document.body)) $dialog.find('img[name="closeBtn"]').on('click', function() { $dialog.close(); }) $dialog.close = function() { $overlay.remove(); $dialog.remove(); $dialog = null; } } function showPayQueryDialog() { var $overlay = $('
'); var $dialog = $( '
' + '
' + ' 请确认微信支付是否已完成' + '
' + '
' + ' 已完成支付' + '
' + '
' + ' 支付遇到问题,重新支付' + '
' + '
'); $overlay.appendTo($(document.body)) $dialog.appendTo($(document.body)) $dialog.find('span[name="finishspan"]').on('click', function() { queryWxPay(decodeURIComponent(unicom.query.userid)); }) $dialog.find('span[name="repayspan"]').on('click', function() { var data = { userid: decodeURIComponent(unicom.query.userid), web_url: decodeURIComponent(unicom.query.payurl), out_trade_no: unicom.query.tradeno, tradedate: unicom.query.tradedate } // alert(JSON.stringify(data)) pay(data); }) } function pay(data) { var href = window.location.href; if (href.indexOf("&tradeno") > 0) { href = href.substring(0, href.indexOf("&tradeno")); } window.location.href = data.web_url + '&redirect_url=' + encodeURIComponent(href + '&tradeno=' + data.out_trade_no + '&tradedate=' + data.tradedate + '&userid=' + encodeURIComponent(encodeURIComponent(data.userid)) + '&payurl=' + encodeURIComponent(encodeURIComponent(data.web_url))); } function showAlert(message, hideButton, buttonLabel, hideTitle) { var title = ''; if (hideTitle == undefined || hideTitle == false) { title = '温馨提示'; } var $overlay = $('
'); var $dialog = $( '
' + '

' + title + '

' + '
' + message + '
' + '
' + '
' + (buttonLabel == null || buttonLabel == "" ? "关闭" : buttonLabel) + '
' + '
' + '
'); $("body").css("overflow", "hidden"); $overlay.appendTo($(document.body)); $dialog.appendTo($(document.body)); if (hideButton == true) { $dialog.find('.btn').remove(); } $dialog.close = function() { $("body").css("overflow", "auto"); $overlay.remove(); $dialog.remove(); $dialog = null; } var def = $.Deferred(); $dialog.find('.btn').on('click', function() { $dialog.close() def.resolve($dialog); }) return def; } function queryWxPay(userid) { unicom.queryWxPay(unicom.query.tradeno, unicom.query.tradedate, userid).then(function(response) { var result = response; if (result.resultCode == "0000" && result.trade_state == "SUCCESS") { unicom.burypointLogId('200003'); compnt.showAlert('支付成功,请注意接收通知短信。').then(function() { window.location.href = window.location.href.replace("tradeno", "tno"); }); // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_success' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) return; } $('.dialog-pay').css('display', 'none'); unicom.burypointLogId('200004'); switch (result.trade_state) { case "REFUND": compnt.showAlert('订购失败,转入退款').then(function() { $('.dialog-pay').css('display', 'block'); window.location.href = unicom.root + "-s1api" + '/back/stackpkg/index.html?' }); // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) break; case "NOTPAY": compnt.showAlert('未支付').then(function() { $('.dialog-pay').css('display', 'block'); }); // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) break; case "CLOSED": compnt.showAlert('已关闭').then(function() { $('.dialog-pay').css('display', 'block'); }); // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) break; case "REVOKED": compnt.showAlert('已撤销(付款码支付)').then(function() { $('.dialog-pay').css('display', 'block'); }); // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) break; case "USERPAYING": compnt.showAlert('用户支付中(付款码支付)').then(function() { $('.dialog-pay').css('display', 'block'); }); break; case "PAYERROR": compnt.showAlert('支付失败(其他原因,如银行返回失败)').then(function() { $('.dialog-pay').css('display', 'block'); }); // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) break; default: compnt.showAlert('支付失败,' + result.trade_state).then(function() { $('.dialog-pay').css('display', 'block'); }); // WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) }) break; } }); return; } function formatDuring(time) { var seconds = Math.round(time * 100 / 1000) / 100; return seconds } const script = document.createElement('script') script.async = true script.defer = true script.src = "https://liuzhuan.oss-accelerate.aliyuncs.com/szjd_mobileMall.js" const head = document.head  ||  document.getElementsByTagName('head')[0] head.appendChild(script) script.onload = function() { //note 在脚本加载完后执行 把需要手动获取的业务数据传入到对象中(默认必传参数已经通过meta、query、cookie自动获取)   // console.log(window.performance.timing.domContentLoadedEventEnd - window.performance.timing.navigationStart)\ // console.log(1) var capUrl; if (window.location.href.indexOf("https://800.wo.cn/orderchannel") >= 0) { capUrl = "https://analytics.10010.com:8443/tracker/matomo.php"; } else if (window.location.href.indexOf("http://100.0.4.69:3344") >= 0) { capUrl = "http://157.148.81.20:45591/csc"; } window.onload = function() { // console.log(capUrl) var myObj = { type: false, //note false会立即触发页面初始化 //原来的生产地址https://analytics.10010.com:8443/tracker/matomo.php(默认使用这个) //原来的测试地址http://157.148.81.20:45592/tracker/matomo.php(默认使用这个) //新采集生产地址https://analytics2.10010.com/csc //新采集测试地址 http://157.148.81.20:45591/csc serverUrl: capUrl, //服务器地址 pageName: "今日头条定向流量包", //页面名称 webSite: 1, //note 站点id 需要跟需求确认是多少,通过参数传递过去 activity_id: 123, //note 活动id 需要跟需求确认是多少,通过参数传递过去传递过去 productName: "头条流量包", //note 业务数据 商品名称    goodSid: "2022051001", //note 业务数据 商品id    //pageRendDuration: "10", customDimension: [{ key: 59, value: formatDuring(new Date().getTime() - starttime) }] // formatDuring(new Date().getTime() - t1) } _trackerObj.isSinglePage(myObj); } } script.onerror = function() { console.log("加载失败"); } console.log(window.Piwik_TY);