123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702 |
- import * as compnt from "../../../../public/js/compnt.js";
- import * as unicom from "../../../../public/js/unicom.js";
- import "../scss/order.scss";
- $(document).ready(function() {
- var newVisitor = isNewVisitor(); // 如果是新访客
- if (newVisitor === true) {
- // 动画弹出消息框
- compnt.showAlertlt('活动期间成功订购产品,可返15元话费。快来参与吧!');
- // 标记:已经向该访客弹出过消息。2个月之内不要再弹
- setCookie("gznotes-visited30", "true", 93);
- }
- });
- function isNewVisitor() {
- // 从cookie读取“已经向访客提示过消息”的标志位
- var flg = getCookie("gznotes-visited30");
- if (flg === "") {
- return true;
- } else {
- return false;
- }
- }
- // 写cookie
- function setCookie(cname, cvalue, exdays) {
- var d = new Date();
- d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
- var expires = "expires=" + d.toUTCString();
- document.cookie = cname + "=" + cvalue + "; " + expires + ";path=/";
- }
- // 读cookie
- function getCookie(cname) {
- var name = cname + "=";
- var ca = document.cookie.split(';');
- for (var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ') c = c.substring(1);
- if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
- }
- return "";
- }
- $(function() {
- var isPageHide = false;
- window.addEventListener('pageshow', function() {
- if (isPageHide) {
- window.location.reload();
- }
- });
- window.addEventListener('pagehide', function() {
- isPageHide = true;
- });
- if (window.location.href.indexOf('draw.html') >= 0) {
- var user = JSON.parse(localStorage.getItem('user'));
- if (user != null) {
- $('.usermob').val(user.usermob);
- }
- }
- })
- init();
- function init() {
- var message = localStorage.getItem('message');
- if (message != null && message != '') {
- compnt.showAlert(message);
- localStorage.removeItem('message');
- }
- compnt.showLoading();
- console.log(1)
- unicom.init().then(function(response) {
- compnt.hideLoading();
- console.log(response.product)
- if (response.product[0].productid == "2021073001") {
- unicom.product = response.product[1]
- } else {
- unicom.product = response.product[0];
- }
- unicom.fesname = response.festival;
- unicom.loadUserInfo();
- if (location.href.indexOf("15/index") >= 0) {
- showOrderPage();
- } else {
- openPage();
- }
- if (location.href.indexOf('/channel20220704') >= 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 if (location.href.indexOf('/refund') >= 0) {
- unicom.burypointLogId('110006'); // 退款
- } else {
- 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) })
- }
- })
- }
- function openPage(pageName) {
- if (pageName == null) {
- if (location.href.indexOf("index.html") >= 0) pageName = "order";
- if (location.href.indexOf("channel20220704.html") >= 0) pageName = "cancel";
- if (location.href.indexOf("draw.html") >= 0) pageName = "draw";
- if (location.href.indexOf("active.html") >= 0) pageName = "active";
- if (location.href.indexOf("flow.html") >= 0) pageName = "flow";
- }
- switch (pageName) {
- case "active":
- showActivePage();
- break;
- case "cancel":
- showCancelPage();
- break;
- case "draw":
- showDrawPage();
- break;
- case "flow":
- showFlowPage();
- break;
- default:
- showOrderPage();
- break;
- }
- }
- $('#btn-cancel').unbind('click').on('click', function() {
- showCancelPage();
- })
- $('#btn-active').unbind('click').on('click', function() {
- showActivePage();
- })
- $('#gotoDrawPage').unbind('click').on('click', function() {
- showDrawPage(window.location.href.substring(window.location.href.lastIndexOf('/') + 1, window.location.href.lastIndexOf('.')))
- })
- function showDrawPage(back) {
- if (location.href.indexOf("draw.html") < 0) {
- window.location.href = "draw.html?fes=" + unicom.query.fes + "&sou=" + unicom.query.sou + '&back=' + (back == null ? '' : back);
- return;
- }
- var $container = $('.section-login').find('.form-group');
- $container.find('.sendcode').unbind('click').on('click', function() {
- var account = $container.find('.account').val();
- var arr = new Array()
- arr = account.split(' ')
- if (arr.length != 1) {
- compnt.showAlert('抖音短视频账号不能含有空格');
- return
- }
- if (account == null || account == "") {
- compnt.showAlert('请输入抖音短视频账号');
- return;
- }
- unicom.sendSms($container, 'drawlogin');
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_click_send_sms_code_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- })
- $container.find('.login').unbind('click').on('click', function() {
- var usermob = $container.find('.usermob').val();
- var account = $container.find('.account').val();
- var smscode = $container.find('.smscode').val();
- if (usermob == null || usermob == "") {
- compnt.showAlert('请输入联通手机号');
- return;
- }
- var arr = new Array()
- arr = account.split(' ')
- if (arr.length != 1) {
- compnt.showAlert('抖音短视频账号不能含有空格');
- return
- }
- if (account == null || account == "") {
- compnt.showAlert('请输入抖音短视频账号');
- return;
- }
- if (account == null || account == "") {
- compnt.showAlert('请输入抖音短视频账号');
- return;
- }
- if (smscode == null || smscode == "") {
- compnt.showAlert('请输入验证码');
- return;
- }
- var $comfirm = showConfirmDialog(account);
- $comfirm.find('.cancel').on('click', function() {
- compnt.hideLoading();
- });
- $comfirm.find('.okay').on('click', function() {
- unicom.checkCode($container, true).done(function() {
- /*unicom.canDrawCoin(account).then(function (response) {
- if (response.resultCode != "0000") {
- compnt.hideLoading();
- compnt.showAlert(response.errorInfo);
- return;
- }
-
- drawCoin(account)
- })*/
- drawCoin(account);
- }).fail(function(data) {
- compnt.hideLoading();
- })
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_click_confirm_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- });
- })
- }
- function drawCoin(account) {
- // var $comfirm = showConfirmDialog(account);
- // $comfirm.find('.cancel').on('click', function() {
- // compnt.hideLoading();
- // });
- //$comfirm.find('.okay').on('click', function() {
- // var $container = $('.section-login').find('.form-group');
- // $container.find('.usermob').val('')
- // $container.find('.usermob').val('')
- // $container.find('.account').val('');
- compnt.showLoading();
- unicom.drawCoin(account, '').done(function(response) {
- compnt.hideLoading();
- switch (response.resultCode) {
- case "0000":
- var $container = $('.section-login').find('.form-group');
- $container.find('.usermob').val('');
- $container.find('.smscode').val('');
- $container.find('.account').val('');
- compnt.showAlert('抖币充值中,详情结果以短信形式告知').then(function() {
- if (unicom.query.back != null && unicom.query.back != '') {
- showOrderPage(unicom.query.back + ".html");
- }
- });
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_success' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- case "7605":
- compnt.showAlert(response.errorInfo);
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- case '6776':
- var prefix = '';
- compnt.showAlert(prefix + response.errorInfo);
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- default:
- var prefix = '';
- if (response.errorInfo.indexOf('领取失败') < 0) {
- prefix = '领取失败,';
- }
- compnt.showAlert(prefix + response.errorInfo);
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- }
- }).fail(function(data) {
- compnt.hideLoading();
- })
- }
- function showOrderPage(backPage) {
- // if (location.href.indexOf('30/index') < 0) {
- // if (backPage == null || backPage == '') {
- // backPage = 'index.html';
- // }
- // window.location.href = backPage + "?fes=" + unicom.query.fes + "&sou=" + unicom.query.sou;
- // return;
- // }
- // var yesar = '1';
- // $('#nodex').unbind('click').on('click', function(event) {
- // //compnt.showAlert('退订成功');
- // var yuans = document.querySelector('.yuans')
- // if (yuans.style.background == '') {
- // yesar = '2'
- // console.log(yesar)
- // yuans.style.background = "#0064ff"
- // yuans.style.backgroundSize = "100% 104% "
- // yuans.style.border = "solid 0.04rem #ffff"
- // yuans.style.width = "0.18rem"
- // yuans.style.height = "0.18rem"
- // } else {
- // yesar = '1'
- // console.log(yesar)
- // yuans.style.background = ""
- // yuans.style.border = "solid 0.02rem #ffff"
- // yuans.style.width = "0.22rem"
- // yuans.style.height = "0.22rem"
- // }
- // })
- $('#btn-order').unbind('click').on('click', function(event) {
- //compnt.showAlert('退订成功');
- if (!compnt.lockClick()) {
- return;
- }
- unicom.showCapPage(null, null, false, false, true).then(function(data) {
- compnt.unlockClick();
- order(data.userid, data.token, data.usermob);
- }).fail(function(response) {
- compnt.unlockClick();
- })
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_click_order_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- })
- $('#tuid_channel').unbind('click').on('click', function(event) {
- unicom.showCancelReasonPage().done(function(cancelReason) {
- var k = JSON.stringify(cancelReason)
- window.localStorage.setItem('kye', k)
- gotoUrl('douyin/30/channel20220704')
- }).fail(function() {
- });
- // //compnt.showAlert('退订成功');
- // window.location.href = "channel20220704.html?fes=" +
- // unicom.query.fes + "&sou=" + unicom.query.sou
- // return;
- })
- }
- function showFlowPage() {
- if (location.href.indexOf("flow.html") < 0) {
- window.location.href = "flow.html?fes=" +
- unicom.query.fes + "&sou=" + unicom.query.sou +
- "&userid=" + unicom.user.userid + "&usermob=" + unicom.user.usermob +
- "&usertime=" + (unicom.user.usertime || (new Date().getTime()));
- return;
- }
- var $container = $('.section-flow');
- var usermob = unicom.user.usermob;
- $container.find('.phone').html(usermob.substring(0, 3) + 'xxxx' + usermob.substring(7, 11));
- $container.find('.btn').unbind('click').on('click', function() {
- //if (!compnt.lockClick()) {
- // return;
- //}
- queryFlow().then(function(message) {
- compnt.unlockClick()
- if (message != null && message != "") {
- compnt.showAlert(message);
- }
- }).fail(function() {
- compnt.unlockClick();
- });
- })
- queryFlow();
- }
- function showActivePage() {
- if (location.href.indexOf("active.html") < 0) {
- window.location.href = "active.html?fes=" + unicom.query.fes + "&sou=" +
- unicom.query.sou;
- return;
- }
- var $container = $('.section-login').find('.form-group');
- $container.find('.sendcode').unbind('click').on('click', function() {
- if (!checkEquip()) return;
- unicom.sendSms($container, 'activelogin');
- })
- $container.find('.login').unbind('click').on('click', function(event) {
- if (!checkEquip()) return;
- if (!compnt.lockClick()) {
- return;
- }
- unicom.checkCode($container).then(function() {
- compnt.unlockClick()
- active()
- }).fail(function() {
- compnt.unlockClick();
- });
- })
- window.scrollTo(0, 0)
- }
- function showCancelPage() {
- // if (location.href.indexOf("cannel20220313.html") < 0) {
- // window.location.href = "cannel20220313.html?fes=" + unicom.query.fes + "&sou=" + unicom.query.sou;
- // return;
- // }
- var cancelReason = JSON.parse(window.localStorage.getItem('kye'))
- var $container = $('.section-login').find('.form-group');
- $container.find('.sendcode').unbind('click').on('click', function() {
- unicom.sendSms($container, 'cancellogin');
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_click_send_sms_code_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- })
- $container.find('.login').unbind('click').on('click', function() {
- compnt.showLoading();
- unicom.checkCode($container).done(function() {
- unicom.cancel(null, null, cancelReason.canceltype, cancelReason.cancelmsg).done(function(response) {
- compnt.hideLoading();
- switch (response.resultCode) {
- case "0000":
- compnt.showAlert('退订成功'); //.then(function(message) {
- //showFlowPage();
- //});
- window.localStorage.removeItem("kye");
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_success' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- case "7605": //应该是已经退订了吧,因此不需要在重复退订啦
- compnt.showAlert(response.errorInfo); //.then(function(message) {
- //showFlowPage();
- //});
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- default:
- var prefix = '';
- if (response.errorInfo.indexOf('退订失败') < 0) {
- prefix = '退订失败,';
- }
- compnt.showAlert(prefix + response.errorInfo);
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- }
- }).fail(function(data) {
- compnt.hideLoading();
- })
- }).fail(function(data) {
- compnt.hideLoading();
- })
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_click_confirm_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- })
- window.scrollTo(0, 0)
- }
- function checkEquip() {
- /*if (!baidu.app.baidu) {
- compnt.showAlert('请到百度产品客户端中激活免流~')
- return false;
- }
- if (!baidu.checkWeiboVersion()) {
- compnt.showAlert('请到升级到最新版百度产品客户端后激活免流~')
- return false;
- }*/
- return true;
- }
- /**
- * 订购
- */
- function order(userid, token, usermob) {
- compnt.showLoading('处理中,请稍后...');
- unicom.order(userid, token, usermob).done(function(response) {
- compnt.hideLoading();
- switch (response.resultCode) {
- case "0000": //订购成功!跳转到领取会员页面
- unicom.saveUserInfo();
- compnt.showAlert('订购成功');
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_success' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- return;
- case "0013":
- //showAlertDialog('orderFailure','该号码归属省分2/3G暂未开通此产品!');
- compnt.showAlert('该号码归属省分2/3G暂未开通此产品!');
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- case "6611":
- // showAlertDialog('orderFailure','错误代码(6611),' + '订购失败,请重试!');
- compnt.showAlert('错误代码(6611),订购失败,请重试!');
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- case "6615":
- //showAlertDialog('orderFailure', '订购失败,请确定用户套餐!');
- compnt.showAlert('订购失败,请确定用户套餐!');
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- case "6622": // 用户已订购过此产品!跳转到流量查页面
- // localStorage.setItem('message', '您已经订购了本产品~');
- compnt.showAlert('您已经订购了本产品~');
- unicom.saveUserInfo();
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- // showFlowPage();
- break;
- default:
- //showAlertDialog('orderFailure', response.errorInfo + ',订购失败,请确定用户套餐!');
- compnt.showAlert(response.errorInfo + ',订购失败,请确定用户套餐!');
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
- break;
- }
- }).fail(function(error) {
- compnt.hideLoading();
- console.log(error);
- });
- }
- function showAlertDialog(action, message) {
- var className = '';
- switch (action) {
- case 'orderSuccess':
- className = 'dialog-message-order-success';
- break;
- case 'orderFailure':
- className = 'dialog-message-order-failure';
- break;
- case 'activeSuccess':
- className = 'dialog-message-active-success';
- break;
- case 'activeFailure':
- className = 'dialog-message-active-failure';
- break;
- case 'cancelSuccess':
- className = 'dialog-message-cancel-success';
- break;
- case 'cancelFailure':
- className = 'dialog-message-cancel-failure';
- break;
- default:
- break;
- }
- var $overlay = $('<div class="overlay"></div>');
- var $dialog = $(
- '<div class="dialog dialog-message ' + className + '">' +
- ' <div class="title"></div>' +
- ' <div class="content">' + message + '</div>' +
- ' <div class="actions">' +
- ' <div class="btn">确定</div>' +
- ' </div>' +
- '</div>');
- $overlay.appendTo($(document.body))
- $dialog.appendTo($(document.body))
- $dialog.find('.btn').unbind('click').on('click', function() {
- $dialog.close()
- })
- $dialog.close = function() {
- $overlay.remove();
- $dialog.remove();
- $dialog = null;
- }
- return $dialog;
- }
- /**
- * 查询用户剩余流量
- */
- function queryFlow() {
- var $container = $('.section-flow');
- //return new Promise(function(resolve, reject) {
- var def = $.Deferred();
- unicom.queryFlow().then(function(response) {
- // var response = JSON.parse(responseText);
- // console.log("流量剩余情况:" + response.data)
- switch (response.resultCode) {
- case "0000":
- //compnt.showAlert(JSON.stringify(response.data));
- //console.log(response.data)
- //console.log(JSON.parse(response.data).surplusFlow)
- var surplus = compnt.returnFloat(JSON.parse(response.data).surplusFlow / 1024 / 1024);
- $container.find('.surplus').html(surplus + 'GB');
- var usedFlowKb = parseInt(JSON.parse(response.data).usedFlow);
- if (usedFlowKb > 0 && usedFlowKb < 1024) {
- def.resolve("剩余流量更新成功,为您免流了" + usedFlowKb + "KB~");
- } else if (usedFlowKb > 1024) {
- var useedFlow = compnt.returnFloat(usedFlowKb / 1024);
- def.resolve("剩余流量更新成功,为您免流了" + useedFlow + "MB~");
- } else {
- def.resolve("剩余流量更新成功~");
- }
- break;
- case "9201": //{"resultCode":"9201","errorInfo":"查询失败,请检查是否有订购关系!"}
- def.resolve("您未订购百度定向流量包~")
- $container.find('.phone').html('用户未订购此产品!');
- break;
- case "9203": //{"resultCode":"9203","errorInfo":"流量查询失败,没有获取到用户所使用流量信息!"}
- //compnt.showAlert("没有获取到用户所使用流量信息!");
- def.resolve("剩余流量更新成功~")
- $container.find('.suplus').html('本月剩余<br>8.00GB');
- break;
- default:
- def.resolve("剩余流量更新成功~")
- break;
- }
- })
- return def;
- //})
- }
- function active() {
- baidu.active().then(function() {
- //checkActiveResult();
- compnt.showAlert('激活成功').then(function() {
- unicom.saveUserInfo()
- // showFlowPage();
- });
- })
- }
- $('.section-agr').find('.footer').on('click', function() {
- if ($($('.section-agr .scope').find('li')[2]).hasClass('hidden')) {
- $('.section-agr .scope').find('li').each(function(i, ele) {
- $(ele).removeClass('hidden');
- })
- $('.section-agr').find('.footer').html('隐藏<span class="arrow">>');
- } else {
- $('.section-agr .scope').find('li').each(function(i, ele) {
- if (i >= 1) {
- $(ele).addClass('hidden');
- }
- })
- $('.section-agr').find('.footer').html('查看更多专属流量适用范围<span class="arrow">>');
- }
- });
- function showConfirmDialog(account) {
- var $overlay = $('<div class="overlay"></div>')
- var $dialog = $(
- '<div class="dialog dialog-confirm">' +
- ' <div class="content">请确认是否领取抖音币到' + account + '账号?</div>' +
- ' <div class="actions">' +
- ' <div class="btn cancel">取消</div>' +
- ' <div class="btn okay">确认</div>' +
- ' </div>' +
- '</div>');
- $overlay.appendTo($(document.body))
- $dialog.appendTo($(document.body))
- $dialog.find('.btn').on('click', function() {
- $overlay.remove();
- $dialog.remove();
- $dialog = null;
- })
- $dialog.close = function() {
- $overlay.remove();
- $dialog.remove();
- $dialog = null;
- }
- return $dialog;
- }
|