main.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  1. import * as compnt from "../../../../public/js/compnt.js";
  2. import * as unicom from "../../../../public/js/unicom.js";
  3. import "../scss/main.scss";
  4. $(document).ready(function() {
  5. var newVisitor = isNewVisitor(); // 如果是新访客
  6. if (newVisitor === true) {
  7. // 动画弹出消息框
  8. compnt.showAlertlt('订购返话费活动期间成功订购产品,可返10元话费。快来参与吧!');
  9. // 标记:已经向该访客弹出过消息。2个月之内不要再弹
  10. setCookie("gznotes-visited_rbt15", "true", 93);
  11. }
  12. });
  13. function isNewVisitor() {
  14. // 从cookie读取“已经向访客提示过消息”的标志位
  15. var flg = getCookie("gznotes-visited_rbt15");
  16. if (flg === "") {
  17. return true;
  18. } else {
  19. return false;
  20. }
  21. }
  22. // 写cookie
  23. function setCookie(cname, cvalue, exdays) {
  24. var d = new Date();
  25. d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
  26. var expires = "expires=" + d.toUTCString();
  27. document.cookie = cname + "=" + cvalue + "; " + expires + ";path=/";
  28. }
  29. // 读cookie
  30. function getCookie(cname) {
  31. var name = cname + "=";
  32. var ca = document.cookie.split(';');
  33. for (var i = 0; i < ca.length; i++) {
  34. var c = ca[i];
  35. while (c.charAt(0) == ' ') c = c.substring(1);
  36. if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
  37. }
  38. return "";
  39. }
  40. var alichannel = '';
  41. compnt.showLoading();
  42. //alert('开始初始化')
  43. unicom.init().then(function(response) {
  44. compnt.hideLoading();
  45. unicom.product = response.product[0];
  46. unicom.fesname = response.festival;
  47. // alert('页面初始化完成')
  48. findRbtMvs();
  49. bindEvent();
  50. if (location.href.indexOf('/cancel') >= 0) {
  51. unicom.burypointLogId('110002'); // 退订页面pv, pv去重得到uv
  52. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'cancel_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  53. } else if (location.href.indexOf('/draw') >= 0) {
  54. unicom.burypointLogId('110003'); // 领取页面pv, pv去重得到uv
  55. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'draw_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  56. } else if (location.href.indexOf('/flow') >= 0) {
  57. unicom.burypointLogId('110004'); // 流量查询pv, pv去重得到uv
  58. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'flow_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  59. } else if (location.href.indexOf('/active') >= 0) {
  60. unicom.burypointLogId('110005'); // 激活页面pv, pv去重得到uv
  61. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'active_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  62. } else if (location.href.indexOf('/refund') >= 0) {
  63. unicom.burypointLogId('110006'); // 退款
  64. } else {
  65. unicom.burypointLogId('110001'); // 订购页面pv, pv去重得到uv
  66. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'open', ea: 'order_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  67. }
  68. })
  69. function bindEvent() {
  70. $('#btn-order').unbind('click').on('click', function() {
  71. if (!compnt.lockClick()) {
  72. return;
  73. }
  74. doOrder(null);
  75. })
  76. $('#open-agr').unbind('click').on('click', function() {
  77. showDialogAgr();
  78. })
  79. }
  80. function doOrder(ringid) {
  81. unicom.showCapPage().then(function(data) {
  82. compnt.unlockClick();
  83. order(data.userid, data.token, data.usermob, ringid || unicom.query.ringid);
  84. }).fail(function(response) {
  85. compnt.unlockClick();
  86. })
  87. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_click_order_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  88. }
  89. function showCancelPage($parentDialog) {
  90. $parentDialog && $parentDialog.hide();
  91. unicom.showCancelReasonPage().done(function(cancelReason) {
  92. doShowCancelPage(cancelReason)
  93. }).fail(function() {
  94. });
  95. function doShowCancelPage(cancelReason) {
  96. var $overlay = $('<div class="overlay"></div>');
  97. var $dialog = $(
  98. '<div class="fixed-center sms-form section-login"' +
  99. ' <div class="sms-form">' +
  100. ' <div class="form-group">' +
  101. ' <div class="input-row">' +
  102. ' <input class="usermob" type="tel" maxLength="11" name="phone" placeholder="请输入您的手机号码" />' +
  103. ' </div>' +
  104. ' <div class="input-row">' +
  105. ' <input class="smscode" type="tel" maxLength="6" name="sms" placeholder="请输入验证码">' +
  106. ' <span class="sendcode">获取验证码</span>' +
  107. ' </div>' +
  108. ' </div>' +
  109. ' <div class="actions">' +
  110. ' <div class="btn btn-primary cancel">取消</div>' +
  111. ' <div class="btn btn-info okay">确认</div>' +
  112. ' </div>' +
  113. ' </div>' +
  114. '</div>');
  115. $overlay.appendTo($(document.body))
  116. $dialog.appendTo($(document.body))
  117. $('body').css('overflow', 'hidden')
  118. $dialog.close = function() {
  119. $overlay.remove();
  120. $dialog.remove();
  121. $parentDialog && $parentDialog.show();
  122. $("body").css("overflow", "auto");
  123. }
  124. $dialog.find('.cancel').unbind('click').on('click', function() {
  125. $dialog.close()
  126. })
  127. $dialog.find('.sendcode').unbind('click').on('click', function() {
  128. unicom.sendSms($dialog, 'cancellogin');
  129. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_click_send_sms_code_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  130. })
  131. $dialog.find('.okay').unbind('click').on('click', function() {
  132. compnt.showLoading();
  133. unicom.checkCode($dialog).done(function() {
  134. compnt.hideLoading();
  135. $dialog.close();
  136. showConfirm('您确定退订视频彩铃包吗?', function() {
  137. doCancel($dialog, $parentDialog, cancelReason)
  138. });
  139. }).fail(function(data) {
  140. compnt.hideLoading();
  141. })
  142. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_click_confirm_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  143. return $dialog;
  144. });
  145. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_open' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  146. }
  147. }
  148. function doCancel($dialog, $parentDialog, cancelReason) {
  149. compnt.showLoading();
  150. unicom.cancel(null, null, cancelReason.canceltype, cancelReason.cancelmsg).done(function(response) {
  151. compnt.hideLoading();
  152. switch (response.resultCode) {
  153. case "0000":
  154. showAlertDialog('退订成功');
  155. $dialog.close();
  156. $parentDialog.close();
  157. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_success' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  158. break;
  159. case "7605": //应该是已经退订了吧,因此不需要在重复退订啦
  160. compnt.showAlert(response.errorInfo);
  161. $dialog.close();
  162. $parentDialog.close();
  163. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  164. break;
  165. default:
  166. var prefix = '';
  167. if (response.errorInfo.indexOf('退订失败') < 0) {
  168. prefix = '退订失败,';
  169. }
  170. compnt.showAlert(prefix + response.errorInfo);
  171. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  172. break;
  173. }
  174. }).fail(function(data) {
  175. compnt.hideLoading();
  176. })
  177. }
  178. function findRbtMvs() {
  179. unicom.findRbtMvs('2021073001').then(function(data) {
  180. // alert('列表加载完成')
  181. window.rbtMvList = JSON.parse(data).data;
  182. window.rbtMvListLength = JSON.parse(data).data.length;
  183. for (var i = 0; i < window.rbtMvList.length; i++) {
  184. window.rbtMvList[i]['shown'] = '0';
  185. }
  186. showRbtMvs();
  187. }).fail(function(response) {
  188. })
  189. }
  190. function showRbtMvs(label) {
  191. $('#rbt-item-box').empty();
  192. var labelMap = {};
  193. for (var i = 0; i < window.rbtMvList.length; i++) {
  194. if (labelMap[window.rbtMvList[i].label] == null) {
  195. labelMap[window.rbtMvList[i].label] = '其它';
  196. }
  197. }
  198. // 重排序,使热门排在第一个
  199. var labelList = []
  200. $.each(labelMap, function(item, i) {
  201. if (item == '热门') {
  202. labelList[labelList.length] = labelList[0];
  203. labelList[0] = item;
  204. } else {
  205. labelList[labelList.length] = item;
  206. }
  207. })
  208. $.each(labelList, function(i, item) {
  209. var $item = $('<div id="' + item + '" class="item" total="0" showcount="0" oldshowcount="0">' + item + '</div>');
  210. if (label == null && item == '热门') {
  211. $item.addClass('item-active');
  212. label = '热门';
  213. }
  214. $item.on('click', function(event) {
  215. if ($(event.target).hasClass('item-active')) {
  216. return;
  217. }
  218. // 删除以前选择的
  219. $('#rbt-item-box .item-active').removeClass('item-active');
  220. $(event.target).addClass('item-active');
  221. $(event.target).attr("showcount", "0"); //用于翻页
  222. $(event.target).attr("oldshowcount", "0");
  223. $('#rbtmv-container').attr('scrollTop', 0);
  224. $('#rbtmv-content').empty();
  225. for (var i = 0; i < window.rbtMvList.length; i++) {
  226. window.rbtMvList[i]['shown'] = '0';
  227. }
  228. showRbtMvsBody($(event.target).html());
  229. })
  230. for (var i = 0; i < window.rbtMvList.length; i++) {
  231. if (window.rbtMvList[i].label == item) {
  232. var total = $item.attr("total");
  233. $item.attr("total", parseInt(total) + 1);
  234. }
  235. }
  236. $item.appendTo($('#rbt-item-box'));
  237. })
  238. // alert('标题加载完成')
  239. showRbtMvsBody(label);
  240. }
  241. function showRbtMvsBody(label) {
  242. for (var i = 0; i < window.rbtMvList.length; i++) {
  243. if (window.rbtMvList[i].label == label) {
  244. var total = parseInt($('#' + label).attr("total"));
  245. var showcount = parseInt($('#' + label).attr("showcount"));
  246. var oldshowcount = parseInt($('#' + label).attr("oldshowcount"));
  247. if (showcount == oldshowcount + 6) {
  248. $('#' + label).attr("oldshowcount", showcount);
  249. break;
  250. }
  251. if (window.rbtMvList[i]['shown'] == '1') {
  252. continue;
  253. }
  254. $('#' + label).attr("showcount", showcount + 1);
  255. window.rbtMvList[i]['shown'] = '1';
  256. var $item = $(
  257. '<div class="rbt-item">' +
  258. ' <div class="rbt-main" src="' + window.rbtMvList[i].videUrl + '" poster="' + window.rbtMvList[i].coverUrl +
  259. '" contentid="' + window.rbtMvList[i].contentid + '" contentname="' + window.rbtMvList[i].contentname + '">' +
  260. ' <img class="rbt-cover" src="' + window.rbtMvList[i].coverUrl + '">' +
  261. ' <img class="rbt-play" src="v2/images/icon-play.png">' +
  262. ' <div class="btn btn-setting">设为彩铃</div>' +
  263. ' </div>' +
  264. ' <div class="rbt-title">' + window.rbtMvList[i].contentname + '</div>' +
  265. '</div>');
  266. $item.find('.rbt-play').unbind('click').on('click', function(event) {
  267. var videoUrl = $(event.target).parent().attr('src');
  268. var poster = $(event.target).parent().attr('poster');
  269. var ringid = $(event.target).parent().attr('contentid');
  270. var ringname = $(event.target).parent().attr('contentname');
  271. showDialogPreview(videoUrl, ringid, ringname, poster);
  272. });
  273. $item.find('.btn-setting').on('click', function() {
  274. var ringid = $(event.target).parent().attr('contentid');
  275. var ringname = $(event.target).parent().attr('contentname');
  276. setting(ringid, ringname);
  277. });
  278. $item.appendTo($('#rbtmv-content'));
  279. // 已经显示到底了
  280. if (total == showcount + 1) {
  281. var $dom = $('<div class="no-more"><div class="line"></div><div class="title">已经到底啦</div><div class="line"></div></div>')
  282. $dom.appendTo($('#rbtmv-content'))
  283. }
  284. }
  285. }
  286. }
  287. function setting(ringid, ringname) {
  288. if (ringid == null || ringid.trim() == "") {
  289. compnt.showAlert("请选择一个视频彩铃!");
  290. return;
  291. }
  292. var user = unicom.loadUserInfo();
  293. if (user != null && user.userid != null) {
  294. queryOrderStatusForSetting(user.userid, null, ringid, ringname);
  295. } else {
  296. showDialogMobile(ringid, ringname);
  297. }
  298. }
  299. function settingExecutor(ringid, ringname) {
  300. var usermob = unicom.user.usermob.substr(0, 3) + 'xxxx' + unicom.user.usermob.substr(7, 4);
  301. var message = '确认设置“' + ringname + '” 为' + usermob + '的视频彩铃吗?';
  302. showConfirm(message, function() {
  303. compnt.showLoading();
  304. unicom.setting(ringid).done(function(data) {
  305. compnt.hideLoading();
  306. if (data.resultCode == "0000") {
  307. showAlertDialog('设置成功')
  308. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_success' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  309. } else {
  310. compnt.showAlert(data.errorInfo);
  311. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  312. }
  313. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_click_confirm_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  314. });
  315. })
  316. }
  317. function showDialogMobile(ringid, ringname) {
  318. var $overlay = $('<div class="overlay"></div>');
  319. var $dialog = $(
  320. '<div class="fixed-center section-setting">' +
  321. ' <div class="content">' +
  322. ' <div class="form-group">' +
  323. ' <input class="mobile" maxLength="11" type="tel" placeholder="输入联通手机号码">' +
  324. ' </div>' +
  325. ' </div>' +
  326. ' <div class="actions">' +
  327. ' <div class="btn btn-lg btn-primary">去设置</div>' +
  328. ' </div>' +
  329. '</div>');
  330. $overlay.appendTo($(document.body))
  331. $dialog.appendTo($(document.body))
  332. $dialog.close = function() {
  333. $overlay.remove();
  334. $dialog.remove();
  335. }
  336. $dialog.find('.btn').on('click', function(event) {
  337. var mobile = $dialog.find('.mobile').val();
  338. if (mobile == null || mobile.length != 11) {
  339. compnt.showAlert('请输入正确的手机号码!');
  340. return;
  341. }
  342. $dialog.close();
  343. queryOrderStatusForSetting(null, mobile, ringid, ringname);
  344. })
  345. $overlay.on('click', function() {
  346. $dialog.close();
  347. })
  348. return $dialog;
  349. }
  350. function queryOrderStatusForSetting(userid, mobile, ringid, ringname) {
  351. unicom.loadUserInfo();
  352. if (unicom.user != null && unicom.user.userid != null && (
  353. unicom.user.orderStatus == "0000" ||
  354. unicom.user.orderStatus == "0001")) {
  355. settingExecutor(ringid, ringname);
  356. return;
  357. }
  358. compnt.showLoading();
  359. unicom.queryOrder(userid, mobile).then(function(data) {
  360. compnt.hideLoading();
  361. switch (data.resultCode) {
  362. case "0000": //订购
  363. case "0001": //退订
  364. if (unicom.user != null && unicom.user.userid != null) {
  365. unicom.user.orderStatus = data.resultCode;
  366. unicom.saveUserInfo();
  367. }
  368. if (userid) {
  369. settingExecutor(ringid, ringname)
  370. } else {
  371. showDialogSmsCode(mobile, ringid, ringname);
  372. }
  373. break;
  374. case "9201":
  375. showConfirm('您未订购视频彩铃包产品', function() {
  376. // alert(ringid)
  377. doOrder(ringid);
  378. // $('#btn-order').trigger('click');
  379. }, '取消', '去订购');
  380. break;
  381. default:
  382. compnt.showAlert(data.errorInfo);
  383. break;
  384. }
  385. return;
  386. })
  387. }
  388. function showDialogPreview(videUrl, ringid, ringname, poster) {
  389. var $dialog = $(
  390. '<div class="section-preview">' +
  391. ' <div class="content">' +
  392. ' <div class="close"><span>《</span>返回</div>' +
  393. ' <video src="' + videUrl + '" poster="' + poster + '"></video>' +
  394. ' <div class="play"></div>' +
  395. ' <div class="dail"></div>' +
  396. ' <div class="setting">设为视频彩铃</div>' +
  397. ' <a class="must-know" href="https://m.10155.com/h5/mactivity/terminal.html">设置须知</a>' +
  398. ' </div>' +
  399. '</div>');
  400. $dialog.appendTo($(document.body))
  401. $dialog.close = function() {
  402. $dialog.remove();
  403. }
  404. var $video = $dialog.find('video');
  405. var $playIcon = $dialog.find('.play');
  406. $video.on('play', function() {
  407. $playIcon.css('display', 'none')
  408. });
  409. $video.on('pause', function() {
  410. $playIcon.css('display', 'block')
  411. });
  412. $video.on('ended', function() {
  413. $playIcon.css('display', 'block')
  414. });
  415. $video.on('click', function() {
  416. if ($video.prop('paused')) {
  417. $video[0].play();
  418. } else {
  419. $video[0].pause();
  420. }
  421. });
  422. $playIcon.on('click', function() {
  423. $video[0].play()
  424. });
  425. $dialog.find('.setting').on('click', function() {
  426. setting(ringid, ringname, $dialog);
  427. })
  428. $dialog.find('.close').on('click', function() {
  429. $dialog.close();
  430. })
  431. return $dialog;
  432. }
  433. function showDialogAgr() {
  434. var $overlay = $('<div class="overlay"></div>');
  435. var $dialog = $(
  436. '<div id="section-agr" class="section-agr">' +
  437. ' <div class="agr-title">' +
  438. ' <div class="close"></div>' +
  439. ' </div>' +
  440. ' <div class="agr-content">' +
  441. ' <div class="title">活动说明</div>' +
  442. ' <div class="content">' +
  443. ' <ul>' +
  444. ' <li>1.活动时间:2023年5月1日-2023年9月30日;</li>' +
  445. ' <li>2.参加活动的用户按19元/月扣取手机话费,订购成功用户当月未退订,次月续订可返10元话费,返还话费将于续订扣费后的10个工作日内充值至订购手机号码。</li>' +
  446. ' </ul>' +
  447. ' </div>' +
  448. ' <div class="title">业务说明</div>' +
  449. ' <div class="content">' +
  450. ' <ul>' +
  451. ' <li>1.该产品资费19元/月,包含10GB专属定向流量+抖音视频彩铃,按自然月扣费,次月自动续订;</li>' +
  452. ' <li>2.符合订购约定的中国联通手机套餐用户均可订购定向流量产品。4G/5G套餐中的全国共享组合套餐、4G/5G全国套餐主副卡用户和智慧沃家共享套餐中手机用户等共享类套餐用户的手机号码不共享定向流量产品中的流量及权益,需单独订购;</li>' +
  453. ' <li>3.办理限制: (1)用户处于停机状态不可订购; (2)融合共享版用户,不可订购; (3)若订购产品与您当前基础套餐存在互斥将不能成功办理;</li>' +
  454. ' <li>4.该产品内定向流量仅限当月使用,未使用部分不能延续、累加至次月及以后各月使用,且服从中国联通套餐流量封顶统一限制;</li>' +
  455. ' <li>5.请使用手机默认3GNET接入点访问本产品(如需修改请在手机设置-移动网络-接入点APN内更改);</li>' +
  456. ' <li>6.流量包生效后用户可享受5G基础服务(上行峰值速率75Mbps下行峰值速率300Mbps)。5G基础服务对应的上下行峰值速率值仅为最高值,用户实际体验速率受网络环境、用户位置、同一时间上网用户数、终端、业务等因素的影响可能会低于最高值;</li>' +
  457. ' <li>7.如您需要退订业务,可点此进行<a id="tuid_channel" style="color: #266cd6;text-decoration: none">退订</a>;</li>' +
  458. ' <li>8.对我们有任何意见和建议,点此<a href="https://account.bol.wo.cn/v2/feedback?clientId=directflow2021073001" style="color: #266cd6">反馈</a>。</li>' +
  459. ' <li>9.关于产品使用过程中有任何疑问可咨询联通客服:10010。</li>' +
  460. ' </ul>' +
  461. ' </div>' +
  462. ' <div class="title">流量说明</div>' +
  463. ' <div class="content">' +
  464. ' <ul>' +
  465. ' <li>1.定向流量适用范围包含:抖音短视频、今日头条、西瓜视频、火山小视频、多闪、懂车帝、图虫、皮皮虾、海豚股票、海豚财富、gogokid、轻颜、好好学习、飞聊、时光相册、半次元、飞书、激萌、番茄畅听APP使用;</li>' +
  466. ' <li>2.定向流量包适用范围不包含:发起直播及上传视频产生的流量;第三方提供的广告、视频、图片产生的流量;下载、缓存客户端及第三方链接视频产生的流量;使用抖音系产品拍摄上传功能,上传分享至抖音系外部应用产生的流量;视频聊天、语音聊天产生的流量;</li>' +
  467. ' <li>3.若您的套餐为蚂蚁宝卡、阿里宝卡、钉钉宝卡、工商银行e卡或懂我卡等互联网卡,流量使用范围包含抖音系相关产品,将优先使用套餐内的定向流量,用罄后即消耗该产品包内的定向流量;否则将直接消耗该产品内定向流量;</li> ' +
  468. ' <li>4.达量限速套餐用户订购本产品,包内定向流量不提升原套餐限速阈值和网速,不能作为限速后解限的加速包使用,依然执行基础套餐限速阈值的约定。</li> ' +
  469. ' </ul>' +
  470. ' </div>' +
  471. ' <div class="title">视频彩铃说明</div>' +
  472. ' <div class="content">' +
  473. ' <ul>' +
  474. ' <li>备注:视频彩铃功能开通是设置/订购视频彩铃的前提,如果用户不支持视频彩铃功能开通,则无法设置/订购视频彩铃。</li>' +
  475. ' <li>1.中国联通手机4G、5G套餐用户(其中5G腾讯王卡用户入网第三个月起)可以享受抖音视频彩铃服务;</li>' +
  476. ' <li>2.部分省分4G/5G联通用户如有一号多端IVPN服务,则不支持视频彩铃功能开通,即不支持视频彩铃业务使用;目前已有24个省分已支持一号多端IVPN服务同时使用视频彩铃业务,包括河南、湖北、浙江、四川、海南、河北、山东、山西、上海、江苏、福建、北京、江西、辽宁、吉林、内蒙古、广东、天津、湖南、贵州、陕西、广西、黑龙江、西藏;</li>' +
  477. ' <li>3.订购该产品用户可通过抖音APP客户端进入视频彩铃专区,享受任意设置视频彩铃服务,同时可通过页面进行彩铃DIY;</li>' +
  478. ' <li>4.成功设置视频彩铃后,其他人拨打已订购本产品的设备电话时,Ta就能看到已设置的视频;</li>' +
  479. ' <li>5.本产品中的抖音视频彩铃仅支持适配终端使用,适配手机终端型号可在温馨提示的视频彩铃说明中查看;</li>' +
  480. ' <li>6.成功设置视频彩铃后,他人来电时看到已订购本产品设备的视频彩铃有2个条件: ①Ta的终端支持播放中国联通视频彩铃; ②Ta开通了VoLTE网络并拨打您电话时处于VoLTE网络下,手机信号显示HD或5G(手机设置—移动网络—移动数据—volte高清通话,打开volte高清通话并编辑短信“DGVOLTE”至10010免费开通); 注:仅支持联通用户间拨打观看;</li>' +
  481. ' <li>7.手机终端型号支持拨打呈现视频彩铃适用机型可通过关注“沃音乐”微信公众号发送“终端”进行查询或点击链接<a href="https://m.10155.com/h5/mactivity/terminal.html">https://m.10155.com/h5/mactivity/terminal.html</a>了解适配机型。</li>' +
  482. ' </ul>' +
  483. ' </div>' +
  484. ' </div>' +
  485. // ' <div class="action">' +
  486. // ' <div class="btn cancel">退订入口</div>' +
  487. // ' </div>' +
  488. '</div>');
  489. $overlay.appendTo($(document.body))
  490. $dialog.appendTo($(document.body))
  491. $('body').css('overflow', 'hidden')
  492. $dialog.close = function() {
  493. $overlay.remove();
  494. $dialog.remove();
  495. $("body").css("overflow", "auto");
  496. }
  497. $dialog.hide = function() {
  498. $overlay.css('display', 'none');
  499. $dialog.css('display', 'none');
  500. }
  501. $dialog.show = function() {
  502. $overlay.css('display', 'block');
  503. $dialog.css('display', 'block');
  504. }
  505. $dialog.find('.close').unbind('click').on('click', function() {
  506. $dialog.close()
  507. })
  508. $dialog.find('.cancel').unbind('click').on('click', function() {
  509. $dialog.close();
  510. showCancelPage($dialog)
  511. })
  512. $dialog.find('#tuid_channel').unbind('click').on('click', function() {
  513. unicom.showCancelReasonPages().done(function(cancelReason) {
  514. var k = JSON.stringify(cancelReason)
  515. var h = JSON.stringify(alichannel)
  516. window.localStorage.setItem('kye', k)
  517. window.localStorage.setItem('kyes', h)
  518. gotoUrl('douyin/5Grbt/channel')
  519. }).fail(function() {
  520. });
  521. $dialog.close();
  522. })
  523. return $dialog;
  524. }
  525. function showDialogSmsCode(mobile, ringid, ringname) {
  526. var $overlay = $('<div class="overlay"></div>');
  527. var $dialog = $(
  528. '<div class="fixed-center section-setting">' +
  529. ' <div class="content">' +
  530. ' <div class="form-group">' +
  531. ' <input type="hidden" class="usermob" value="' + mobile + '">' +
  532. ' <input class="code smscode" maxLength="6" type="tel" placeholder="输入联通验证码">' +
  533. ' <input class="send sendcode" type="button" value="发送验证码">' +
  534. ' </div>' +
  535. ' </div>' +
  536. ' <div class="actions">' +
  537. ' <div class="btn close">取消</div>' +
  538. ' <div class="btn btn-primary login">确认</div>' +
  539. ' </div>' +
  540. '</div>');
  541. $overlay.appendTo($(document.body))
  542. $dialog.appendTo($(document.body))
  543. $dialog.find('.close').unbind('click').on('click', function() {
  544. $dialog.close()
  545. })
  546. $dialog.find('.sendcode').on('click', function() {
  547. unicom.sendSms($dialog, 'drawlogin');
  548. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'draw_click_send_sms_code_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) })
  549. })
  550. $dialog.find('.login').on('click', function() {
  551. compnt.showLoading();
  552. unicom.checkCode($dialog).done(function() {
  553. compnt.hideLoading();
  554. unicom.saveUserInfo();
  555. $dialog.close();
  556. settingExecutor(ringid, ringname);
  557. }).fail(function() {
  558. compnt.hideLoading();
  559. })
  560. })
  561. $dialog.find('.sendcode').trigger('click');
  562. $('body').css('overflow', 'hidden')
  563. $dialog.close = function() {
  564. $overlay.remove();
  565. $dialog.remove();
  566. $dialog = null;
  567. $('body').css('overflow', 'auto')
  568. }
  569. return $dialog;
  570. }
  571. function showAlertDialog(message) {
  572. var $overlay = $('<div class="overlay"></div>');
  573. var $dialog = $(
  574. '<div class="fixed-center section-setting section-alert">' +
  575. ' <div class="content">' +
  576. ' <div class="status">' +
  577. ' <span class="status-name">' + message + '</span>' +
  578. ' <div class="status-icon"></div>' +
  579. ' </div>' +
  580. ' </div>' +
  581. ' <div class="actions">' +
  582. ' <div class="btn btn-lg btn-primary">知道了</div>' +
  583. ' </div>' +
  584. '</div>');
  585. $overlay.appendTo($(document.body))
  586. $dialog.appendTo($(document.body))
  587. $dialog.find('.btn').unbind('click').on('click', function() {
  588. $dialog.close()
  589. })
  590. $dialog.close = function() {
  591. $overlay.remove();
  592. $dialog.remove();
  593. $dialog = null;
  594. $('body').css('overflow', 'auto')
  595. }
  596. $('body').css('overflow', 'hidden')
  597. return $dialog;
  598. }
  599. function showConfirm(message, handler, cancelLabel, okayLabel) {
  600. var $overlay = $('<div class="overlay"></div>');
  601. var $dialog = $(
  602. '<div class="fixed-center section-message">' +
  603. ' <div class="content">' + message + '</div>' +
  604. ' <div class="actions">' +
  605. ' <div class="btn close btn-primary">' + (cancelLabel || "取消") + '</div>' +
  606. ' <div class="btn okay btn-info">' + (okayLabel || '确认') + '</div>' +
  607. ' </div>' +
  608. '</div>');
  609. $overlay.appendTo($(document.body))
  610. $dialog.appendTo($(document.body))
  611. $dialog.find('.close').unbind('click').on('click', function() {
  612. $dialog.close()
  613. })
  614. $dialog.find('.okay').unbind('click').on('click', function() {
  615. handler && handler();
  616. $dialog.close();
  617. })
  618. $dialog.close = function() {
  619. $overlay.remove();
  620. $dialog.remove();
  621. $dialog = null;
  622. }
  623. return $dialog;
  624. }
  625. /**
  626. * 订购
  627. */
  628. function order(userid, token, usermob, ringid) {
  629. compnt.showLoading('处理中,请稍后...');
  630. unicom.order(userid, token, usermob, ringid).done(function(response) {
  631. compnt.hideLoading();
  632. switch (response.resultCode) {
  633. case "0000": //订购成功!跳转到领取会员页面
  634. unicom.saveUserInfo();
  635. showAlertDialog('订购成功');
  636. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_success' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) });
  637. return;
  638. case "0013":
  639. compnt.showAlert('该号码归属省分2/3G暂未开通此产品!');
  640. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) });
  641. break;
  642. case "6611":
  643. compnt.showAlert('错误代码(6611),订购失败,请重试!');
  644. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) });
  645. break;
  646. case "6615":
  647. compnt.showAlert('订购失败,请确定用户套餐!');
  648. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) });
  649. break;
  650. case "6622": // 用户已订购过此产品!跳转到流量查页面
  651. // localStorage.setItem('message', '您已经订购了本产品~');
  652. compnt.showAlert('您已经订购了本产品~')
  653. unicom.saveUserInfo();
  654. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) });
  655. break;
  656. default:
  657. compnt.showAlert(response.errorInfo + ',订购失败,请确定用户套餐!');
  658. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'order_failure' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(unicom.query.sou, 32) });
  659. break;
  660. }
  661. }).fail(function(error) {
  662. compnt.hideLoading();
  663. console.log(error);
  664. });
  665. }
  666. $('#rbtmv-container').on('touchmove', function(event) {
  667. if ($('#rbtmv-content').height() + $('#rbtmv-content').scrollTop() >= $('#rbtmv-container').height()) {
  668. showRbtMvsBody($('.item-active')[0].id);
  669. }
  670. })
  671. $('#rbtmv-container').on('touchstart', function(event) {
  672. if ($('#rbtmv-content').height() + $('#rbtmv-content').scrollTop() >= $('#rbtmv-container').height()) {
  673. showRbtMvsBody($('.item-active')[0].id);
  674. }
  675. })
  676. var t1 = 0;
  677. var t2 = 0;
  678. let timer = null;
  679. $('#rbtmv-content').on('scroll', function(event) {
  680. clearTimeout(timer)
  681. timer = setTimeout(isScrollEnd, 100)
  682. t1 = $('#rbtmv-content').scrollTop()
  683. })
  684. function isScrollEnd() {
  685. t2 = $('#rbtmv-content').scrollTop();
  686. if (t2 == t1) {
  687. clearTimeout(timer)
  688. if ($('#rbtmv-content').height() + $('#rbtmv-content').scrollTop() >= $('#rbtmv-container').height() - 200) {
  689. showRbtMvsBody();
  690. }
  691. }
  692. }