main.js 32 KB

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