main.js 32 KB

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