main.js 32 KB

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