main.js 33 KB

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