index1.html 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="page-view-size" content="1280*720" />
  6. <title>"鼠"你最棒,萌宝"潮"贺岁</title>
  7. <link rel="stylesheet" type="text/css" href="css/page1.css" />
  8. </head>
  9. <body>
  10. <div class="main">
  11. <div id="scrollCont">
  12. <div class="code">
  13. <img id="QRcode" src="" alt="" />
  14. <span>扫码上转萌娃贺岁视频</span>
  15. <span>拼人气赢大奖</span>
  16. </div>
  17. <div class="page_btn pg0"></div>
  18. <div class="page_btn pg1"></div>
  19. <div class="page_btn pg2"></div>
  20. <div class="page_btn pg3"></div>
  21. <div class="page_btn pg4" id="othersProduct"></div>
  22. <!-- <div class="page_btn pg5" id="oursProduct"></div> -->
  23. <div class="prizeNum">抽奖机会:<span id="num"></span></div>
  24. <ul class="list" id="ipUl">
  25. <li class="ip_btn ip1"></li>
  26. <li class="ip_btn ip2"></li>
  27. <li class="ip_btn ip3"></li>
  28. <li class="ip_btn ip4"></li>
  29. <li class="ip_btn ip5"></li>
  30. <li class="ip_btn ip6"></li>
  31. </ul>
  32. <div class="voteGroup">
  33. <div class="tit1">
  34. <img src="img/tit1.png" height="63" width="472" alt="" />
  35. <div class="times"><img src="img/piaoshu.png" height="29" width="109" alt="" /><span id="number"></span></div>
  36. </div>
  37. <ul class="voteList" id="voteUl">
  38. <!-- <li class="voteLi">
  39. <div class="u_img"><img src="img/demo.jpg" alt="" /><i></i></div><div class="u_msg">张宇涵</div><span class="voteBtn">投你一票</span>
  40. </li> -->
  41. </ul>
  42. </div>
  43. <div id="rulesPopup" class="popup">
  44. <div class="rules_btn"></div>
  45. <div class="bar">
  46. <span id="miniBar" class="progress"></span>
  47. </div>
  48. </div>
  49. <div id="lotteryPopup" class="popup">
  50. <div class="lottery_btn confirm"></div>
  51. </div>
  52. <div id="prizePopup" class="popup">
  53. <!-- <img id="prizeImg" src="" alt="" /> -->
  54. <p id="ptizeName"></p>
  55. <div class="prizeBtn cancel"></div>
  56. <div class="prizeBtn toExchange"></div>
  57. </div>
  58. <div id="exchangePopup" class="popup">
  59. <!-- <img id="myPrize" src="" alt="" /> -->
  60. <div id="phone"></div>
  61. <ul id="keyBoard">
  62. <li class="phoneNum">1</li>
  63. <li class="phoneNum">2</li>
  64. <li class="phoneNum">3</li>
  65. <li class="phoneNum">4</li>
  66. <li class="phoneNum">5</li>
  67. <li class="phoneNum">6</li>
  68. <li class="phoneNum">7</li>
  69. <li class="phoneNum">8</li>
  70. <li class="phoneNum">9</li>
  71. <li class="phoneNum">0</li>
  72. <li class="phoneNum otherBtn">删除</li>
  73. <li class="phoneNum otherBtn">清空</li>
  74. </ul>
  75. <div class="exchangeBtn confirm"></div>
  76. <div class="exchangeBtn cancel"></div>
  77. </div>
  78. <div id="unWinToyPopup" class="popup">
  79. <div id="product1" class="unWinToyBtn"></div>
  80. <div id="product2" class="unWinToyBtn"></div>
  81. <div class="unWinToyBtn confirm"></div>
  82. </div>
  83. <div id="unWinToyVipPopup" class="popup">
  84. <div class="pmodel pmodel_1"></div>
  85. <div class="pmodel pmodel_2"></div>
  86. <div class="pmodel pmodel_3"></div>
  87. <div class="poster poster_1"></div>
  88. <div class="poster poster_2"></div>
  89. <div class="poster poster_3"></div>
  90. <div class="unWinToyVipBtn confirm"></div>
  91. </div>
  92. <!-- 中奖查询 -->
  93. <div id="awardPopup" class="popup">
  94. <div id="prizelog"></div>
  95. <div id="myAward"></div>
  96. <div id="myPhone"></div>
  97. <div class="awardBtn cancel"></div>
  98. <div class="awardBtn toAward"></div>
  99. </div>
  100. <div id="markDownPopup" class="popup">
  101. <div class="markDownBtn"></div>
  102. </div>
  103. </div>
  104. </div>
  105. <script src="./js/webview.js" type="text/javascript"></script>
  106. <script src="./js/tvSysBtnBind.v2.js" type="text/javascript"></script>
  107. <script src="./js/comm.js" type="text/javascript"></script>
  108. <script type="text/javascript">
  109. try {
  110. var uid = Webview.readSystemProp('user.id');
  111. var usertoken = Webview.readSystemProp('user.token');
  112. var mac = Webview.readSystemProp('device.mac');
  113. var version = Webview.readSystemProp('app.version');
  114. } catch (e) {
  115. var uid = getStr("uid") || '0100834547692768574';
  116. var usertoken = "00139025650832263889980824152950"
  117. var mac = 'OC-41-E9-DD-EC-DE'
  118. var version = "YYS.4.6.15.266.5.HNDX.0.0_Release"
  119. }
  120. var init = {
  121. act_id:2,
  122. gameNum:0,
  123. theme_id:2,
  124. fromsource:15,
  125. oursId:"8801000638",//"8801000079",
  126. othersId:"8801000646",//不用
  127. oursProduct_isVip:0,
  128. othersProduct_isVip:0,
  129. contentcode:"00000001000000000018000000431421",//少儿月包 00000001000000000025000000024157
  130. // contentcode1:"D00000001201905291020410009898494",
  131. }
  132. var webUrl = 'http://111.23.13.123:8091/';
  133. var backUrl = webUrl+'h5v2/mw_20200108_act/index.html';
  134. // var indexUrl = webUrl+'html/index.html?activity='+init.act_id;
  135. var link = "http://111.23.12.38:8093/h5/act/index.html?mark="+uid;//http://120.78.169.79/h5/act/index.html";
  136. var videoId = "00000001000000000033000000121962";
  137. var videoArr = ["00000001000000000014000000153851","00000001000000000032000000221170","00000001000000000025000000326508","00000001000000000028000000428043","00000001000000000026000000325529","00000001000000000015000000283749"]
  138. var pageConf = {
  139. focusIdx:3,
  140. focusItem:"page_btn",
  141. }
  142. var rulesPopup = false;
  143. var errorMark = false;
  144. var rulesMark = 0;
  145. var data = new Object();
  146. data.rules = {
  147. page_btn:{
  148. 0:[3,0,0,1],
  149. 1:[2,-1,0,1],
  150. 2:[1,-1,0,0],
  151. 3:[0,-1,-1,0],
  152. 4:[0,-1,0,["ip_btn",2]],
  153. onEnterPress:function(){
  154. switch (this.currentIndex) {
  155. case 0:
  156. onBack();
  157. break;
  158. case 1:
  159. stopPlay();
  160. rulesPopup = true;
  161. S("rulesPopup");
  162. this.reSetClass("rules_btn",1);
  163. break;
  164. case 2:
  165. prizelog(uid,init.act_id,init.othersProduct_isVip+init.oursProduct_isVip,function(res){
  166. if (res.code == 0) {
  167. var content = [];
  168. for (var i = 0; i < res.data.length; i++) {
  169. var temp = document.createElement("div");
  170. temp.className = "prizelogRow"
  171. var span1 = document.createElement("div");
  172. span1.className = "prizelogCol1";
  173. var span2 = document.createElement("div");
  174. span2.className = "prizelogCol2";
  175. var span3 = document.createElement("div");
  176. span3.className = "prizelogCol3";
  177. span1.innerText = res.data[i].user_phone;
  178. span2.innerText = res.data[i].prize_name;
  179. span3.innerText = res.data[i].created_at;
  180. temp.appendChild(span1);
  181. temp.appendChild(span2);
  182. temp.appendChild(span3);
  183. content[i] = temp;
  184. }
  185. if (content.length > 4) {
  186. var start = 0;
  187. var end = 4;
  188. var newsHtml = G("prizelog");
  189. var newsTimer = setInterval(function () {
  190. newsHtml.innerHTML = '';
  191. var showNews = content.slice(start, end);
  192. for (var i = 0; i < showNews.length; i++) {
  193. newsHtml.appendChild(showNews[i]);
  194. }
  195. start += 1;
  196. end += 1;
  197. if (start > content.length - 1) {
  198. start = 0;
  199. end = 4;
  200. }
  201. }, 1500)
  202. } else {
  203. var newsHtml = G("prizelog");
  204. newsHtml.innerHTML = '';
  205. var showNews = content;
  206. for (var i = 0; i < showNews.length; i++) {
  207. newsHtml.appendChild(showNews[i]);
  208. }
  209. }
  210. }
  211. })
  212. userPrizelog(uid,init.act_id,init.othersProduct_isVip+init.oursProduct_isVip,function(res){
  213. if(res.code==0){
  214. if (res.data.my_prizes[0]) {
  215. G("myAward").innerText = res.data.my_prizes[0].prize_name;
  216. // G("myPrize").src = res.data.my_prizes[0].show_image;
  217. G("myPhone").innerText = res.data.my_prizes[0].user_phone;
  218. }
  219. if (res.data.user_phone) {
  220. document.getElementById("myPhone").innerText = res.data.user_phone.user_phone;
  221. }
  222. if(res.data.my_prizes[0] && res.data.user_phone.phone_status==2){
  223. init.canPrize = 1;
  224. }else if(res.data.my_prizes[0] && res.data.user_phone.phone_status==1){
  225. init.canPrize = 2
  226. }
  227. }
  228. });
  229. stopPlay();
  230. S("awardPopup");
  231. this.reSetClass("awardBtn");
  232. break;
  233. case 3:
  234. fullscreenPlay(videoId,"1");
  235. break;
  236. case 4:
  237. order(0);
  238. break;
  239. default:
  240. break;
  241. }
  242. },
  243. onPress:function(){
  244. if((this.event.keyCode == 40 || this.event.keyCode == "DOWN")&& this.prevIndex == 3){
  245. if(init.oursProduct_isVip == 0){
  246. this.reSetClass("page_btn",4);
  247. }else{
  248. stopPlay();
  249. G("scrollCont").style.top = - 500 + "px";
  250. this.reSetClass("ip_btn",2);
  251. }
  252. }
  253. },
  254. },
  255. ip_btn:{
  256. line:6,
  257. down:["voteBtn"],
  258. onEnterPress:function(){
  259. // details_page(videoArr[this.currentIndex]);
  260. order();
  261. },
  262. onPress:function(){
  263. stopPlay();
  264. G("scrollCont").style.top = - 500 + "px";
  265. if(errorMark){
  266. errorMark = false;
  267. return;
  268. }
  269. if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
  270. try{
  271. smallvodPlay(videoId);
  272. }catch(e){
  273. }
  274. G("scrollCont").style.top = 0;
  275. if(init.oursProduct_isVip == 0){
  276. this.reSetClass("page_btn",4);
  277. }
  278. else{
  279. this.reSetClass("page_btn",3);
  280. }
  281. }
  282. },
  283. },
  284. voteBtn:{
  285. line:4,
  286. up:["ip_btn",2],
  287. onEnterPress:function(){
  288. vote(uid,init.oursProduct_isVip+init.othersProduct_isVip,voteArr[this.currentIndex],function(res){
  289. if(res.code == 0){
  290. G("number").innerHTML = res.data.num;
  291. G("vote"+main.currentIndex).innerHTML = G("vote"+main.currentIndex).innerHTML*1+1;
  292. tips("投票成功");
  293. if(init.gameNum>0){
  294. S("lotteryPopup");
  295. main.reSetClass("lottery_btn",0);
  296. }
  297. }else if(res.code == "-1"){
  298. tips("您的票已用完");
  299. }
  300. })
  301. },
  302. onPress:function(){
  303. G("scrollCont").style.top = - 780-(parseInt(this.currentIndex/4)*268) + "px";
  304. errorMark = true;
  305. },
  306. onBack:function(){
  307. H("lotteryPopup");
  308. this.reSetClass("voteBtn");
  309. }
  310. },
  311. rules_btn:{
  312. line:1,
  313. onEnterPress:function(){
  314. closeRulesPopup();
  315. },
  316. onPress:function(){
  317. if(this.event.keyCode == 40 || this.event.keyCode == "DOWN"){
  318. if(rulesMark<2)rulesMark+=1;
  319. G("miniBar").style.top = rulesMark*200+"px";
  320. G("rulesPopup").style.top = (-(rulesMark*580))+"px";
  321. }else if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
  322. if(rulesMark>0)rulesMark-=1;
  323. G("miniBar").style.top = rulesMark*200+"px";
  324. G("rulesPopup").style.top = (-(rulesMark*580))+"px";
  325. }
  326. }
  327. },lottery_btn:{
  328. line:1,
  329. onEnterPress:function(){
  330. prize(function(res){
  331. if(res.code==0){
  332. init.gameNum -= 1;
  333. if(res.data.yes.prize_status=="none"){
  334. nowin("nowin");
  335. }else if(res.data.yes.prize_status=="real"){//中奖
  336. // G("prizeImg").src = res.data.yes.prize_img;
  337. G("ptizeName").innerHTML = res.data.yes.prize_name;
  338. // G("myPrize").src = res.data.yes.prize_img;
  339. S("prizePopup");
  340. main.reSetClass("prizeBtn",1);
  341. }
  342. }
  343. })
  344. },
  345. onPress:function(){
  346. },
  347. onBack:function(){
  348. H("lotteryPopup");
  349. this.reSetClass("voteBtn");
  350. }
  351. },
  352. awardBtn:{
  353. line:2,
  354. onEnterPress:function(){
  355. if(this.currentIndex == 0){
  356. try{
  357. smallvodPlay(videoId);
  358. }catch(e){
  359. }
  360. H("awardPopup");
  361. this.reSetClass("page_btn",2);
  362. }else if(this.currentIndex == 1){
  363. if(init.canPrize == 1){
  364. H("awardPopup");
  365. S("exchangePopup");
  366. heguiItem = "page_btn";
  367. this.reSetClass("exchangeBtn",0);
  368. }else if(init.canPrize == 2){
  369. tips("您已提交手机号码!")
  370. }else{
  371. tips("您还未中奖,请继续加油噢!")
  372. }
  373. }
  374. },
  375. onBack:function(){
  376. try{
  377. smallvodPlay(videoId);
  378. }catch(e){
  379. }
  380. H("awardPopup");
  381. this.reSetClass("page_btn",2);
  382. },
  383. },
  384. prizeBtn:{
  385. line:2,
  386. onEnterPress:function(){
  387. if(this.currentIndex == 0){
  388. H("prizePopup");
  389. this.reSetClass("voteBtn");
  390. }else{
  391. H("prizePopup");
  392. S("exchangePopup");
  393. heguiItem = "voteBtn";
  394. this.reSetClass("exchangeBtn",0);
  395. }
  396. },
  397. onBack:function(){
  398. H("prizePopup");
  399. this.reSetClass("voteBtn");
  400. },
  401. },
  402. exchangeBtn:{
  403. 0:[0,["phoneNum",6],1,0],
  404. 1:[-1,["phoneNum",8],0,0],
  405. "onEnterPress":exchangePopups,
  406. onPress:cellphoneNum,
  407. onBack:function(){
  408. H("exchangePopup");
  409. G("phone").innerHTML = "";
  410. if(heguiItem == "page_btn"){
  411. try{
  412. smallvodPlay(videoId);
  413. }catch(e){
  414. }
  415. }
  416. this.reSetClass(heguiItem);
  417. },
  418. },
  419. phoneNum:{
  420. line:6,
  421. down:["exchangeBtn",1],
  422. onEnterPress:function(){
  423. if(this.currentIndex<=9){
  424. if(G("phone").innerHTML.length>10) return;
  425. if(this.currentIndex == 9){
  426. G("phone").innerHTML += 0;
  427. }else{
  428. G("phone").innerHTML += this.currentIndex*1+1;
  429. }
  430. }else if(this.currentIndex == 10){
  431. if(G("phone").innerHTML.length>0)
  432. G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
  433. }else if(this.currentIndex == 11){
  434. if(G("phone").innerHTML.length>0)
  435. G("phone").innerHTML = "";
  436. }
  437. },
  438. onPress:cellphoneNum,
  439. onBack:function(){
  440. if(G("phone").innerHTML.length>0){
  441. G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
  442. }else{
  443. H("exchangePopup");
  444. G("phone").innerHTML = "";
  445. if(heguiItem == "page_btn"){
  446. try{
  447. smallvodPlay(videoId);
  448. }catch(e){
  449. }
  450. }
  451. this.reSetClass(heguiItem);
  452. }
  453. },
  454. },
  455. markDownBtn:{
  456. line:1,
  457. onEnterPress:function(){
  458. H("markDownPopup");
  459. if(heguiItem == "page_btn"){
  460. try{
  461. smallvodPlay(videoId);
  462. }catch(e){
  463. }
  464. }
  465. this.reSetClass(heguiItem);
  466. },
  467. onBack:function(){
  468. H("markDownPopup");
  469. if(heguiItem == "page_btn"){
  470. try{
  471. smallvodPlay(videoId);
  472. }catch(e){
  473. }
  474. }
  475. this.reSetClass(heguiItem);
  476. },
  477. },
  478. unWinToyBtn:{
  479. 0:[0,0,0,1],
  480. 1:[0,0,0,1],
  481. 2:[0,0,0,0],
  482. onEnterPress:function(){
  483. if(this.currentIndex==2){
  484. H("unWinToyPopup");
  485. this.reSetClass("voteBtn");
  486. }else{
  487. order(this.currentIndex);
  488. }
  489. },
  490. onPress:function(){
  491. if(this.prevIndex == 0){
  492. if(this.event.keyCode == 40 || this.event.keyCode == "DOWN"){
  493. if(init.oursProduct_isVip == 0){
  494. this.reSetClass("unWinToyBtn",1);
  495. }else{
  496. this.reSetClass("unWinToyBtn",2);
  497. }
  498. }
  499. }else if(this.prevIndex == 1){
  500. if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
  501. if(init.othersProduct_isVip == 0){
  502. this.reSetClass("unWinToyBtn",0);
  503. }
  504. }
  505. }else if(this.prevIndex == 2){
  506. if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
  507. if(init.oursProduct_isVip == 1){
  508. this.reSetClass("unWinToyBtn",0);
  509. }else if(init.oursProduct_isVip == 0){
  510. this.reSetClass("unWinToyBtn",1);
  511. }else if(init.othersProduct_isVip == 0){
  512. this.reSetClass("unWinToyBtn",0);
  513. }
  514. }
  515. }
  516. },
  517. onBack:function(){
  518. H("unWinToyPopup");
  519. this.reSetClass("voteBtn");
  520. },
  521. },
  522. unWinToyVipBtn:{
  523. line:1,
  524. up:["poster"],
  525. onEnterPress:function(){
  526. if(this.currentIndex==0){
  527. H("unWinToyVipPopup");
  528. this.reSetClass("voteBtn");
  529. }
  530. },
  531. onBack:function(){
  532. setCookie("gameItemIdx","");
  533. setCookie("itemIdx","");
  534. H("unWinToyVipPopup");
  535. this.reSetClass("voteBtn");
  536. },
  537. },
  538. poster:{
  539. line:3,
  540. down:["unWinToyVipBtn"],
  541. onEnterPress:function(){
  542. var url = '',index=this.currentIndex;
  543. if(changeOrwin == "nowin"){
  544. setCookie("gameItemIdx",index);
  545. }else{
  546. setCookie("itemIdx",index);
  547. }
  548. toZhuanti(index);
  549. },
  550. onBack:function(){
  551. setCookie("gameItemIdx","");
  552. setCookie("itemIdx","");
  553. window.location.href = "../index.html";
  554. },
  555. },
  556. }
  557. function onBack(){
  558. if(rulesPopup){
  559. closeRulesPopup();
  560. }else{
  561. stopPlay();
  562. window.location.href = indexUrl;
  563. }
  564. }
  565. function userPrizelog(uid,act_id,is_vip,fn) {
  566. ajax({
  567. url: webUrl + "index.php?m=Home&c=Activityv2&a=userPrizelog",
  568. data: {
  569. uid: uid,
  570. act_id: act_id,
  571. is_vip: is_vip
  572. },
  573. success: function (res) {
  574. fn && fn(res);
  575. },
  576. error: function () {
  577. fn && fn();
  578. }
  579. })
  580. }
  581. function exchangePopups(){
  582. if(this.currentIndex==1){
  583. H("exchangePopup");
  584. G("phone").innerHTML = "";
  585. if(heguiItem == "page_btn"){
  586. try{
  587. smallvodPlay(videoId);
  588. }catch(e){
  589. }
  590. }
  591. this.reSetClass(heguiItem);
  592. }else if(this.currentIndex==0){
  593. var phone = G("phone").innerText;
  594. var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
  595. if(!myreg.test(phone)){
  596. tips('手机号码格式有误!');
  597. }else{
  598. ajax({
  599. url: webUrl + "index.php?m=Home&c=Activityv2&a=setUserInfo",
  600. data: {
  601. uid: uid,
  602. act_id: init.act_id,
  603. is_vip: init.oursProduct_isVip+init.othersProduct_isVip,
  604. phone: phone
  605. },
  606. success: function (res) {
  607. if(res.code == 0){
  608. H("exchangePopup");
  609. G("phone").innerHTML = "";
  610. S("markDownPopup");
  611. main.reSetClass("markDownBtn");
  612. }else{
  613. tips(res.msg);
  614. }
  615. }
  616. })
  617. }
  618. }
  619. }
  620. function toZhuanti(idx){
  621. var exitStr = escape(backUrl);
  622. var url = '';
  623. if(idx==0){
  624. url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1991&exitStr=' + exitStr;
  625. }else if(idx==1){
  626. url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1956&exitStr=' + exitStr;
  627. }else if(idx==2){
  628. url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1467&exitStr=' + exitStr;
  629. }
  630. window.location.href = url;
  631. }
  632. function details_page (id) {
  633. var playIntent = {
  634. package:"com.hunantv.operator",
  635. action: "mangotv://com.hunantv.operator/detail",
  636. data:"",
  637. extras: {
  638. media_assets_id: id,
  639. },
  640. flags: []
  641. };
  642. Webview.sendIntent("startActivity", playIntent);
  643. }
  644. function nowin(type){
  645. if(init.oursProduct_isVip==1||init.othersProduct_isVip==1){
  646. changeOrwin = type;
  647. if(type == "nowin"){
  648. G("unWinToyVipPopup").style.background = "url('./img/page_06.png') no-repeat center";
  649. }else{
  650. G("unWinToyVipPopup").style.background = "url('./img/page_08.png') no-repeat center";
  651. }
  652. S("unWinToyVipPopup");
  653. main.reSetClass("poster");
  654. }else{
  655. if(type == "nowin"){
  656. G("unWinToyPopup").style.background = "url('./img/page_05.png') no-repeat center";
  657. }else{
  658. G("unWinToyPopup").style.background = "url('./img/page_07.png') no-repeat center";
  659. }
  660. S("unWinToyPopup");
  661. main.reSetClass("unWinToyBtn",2);
  662. }
  663. }
  664. function closeRulesPopup(){
  665. try{
  666. smallvodPlay(videoId);
  667. }catch(e){
  668. }
  669. rulesPopup = false;
  670. H("rulesPopup");
  671. main.reSetClass("page_btn",1);
  672. }
  673. function order(idx){
  674. var pid = init.oursId;
  675. var mark = "mw_oursBag";
  676. // if(idx == 1){
  677. // pid = init.oursId;
  678. // mark = "mw_othersBag";
  679. // }
  680. var orderBack = backUrl+'?'+mark+'='+uid;
  681. if(version.indexOf("5a.7") || version.indexOf("5a.8")){
  682. var product_list={
  683. "product_id":pid,
  684. "video_name":"",
  685. "video_type":"",
  686. "product_type":"2",
  687. "cat_id":"",
  688. "channel_id":"",
  689. }
  690. window.location.href = "https://hnydorder.yys.mgtv.com:8080/order/index.html?product_list="+JSON.stringify(product_list)+"&exitStr="+escape(orderBack);
  691. }else{
  692. var playIntent = {
  693. package: "com.hunantv.operator",
  694. action: "mangotv://com.hunantv.operator/order",
  695. data: "",
  696. extras: {
  697. product: {
  698. "id": pid,
  699. "time": "",
  700. "price": "",
  701. "type": "",
  702. "name": "",
  703. "bag": "",
  704. "back_url":orderBack,
  705. }
  706. },
  707. flags: []
  708. };
  709. Webview.sendIntent("startActivity", playIntent);
  710. }
  711. }
  712. function prizelog(uid,act_id,is_vip,fn) {
  713. ajax({
  714. url: webUrl + "index.php?m=Home&c=Activityv2&a=prizelog",
  715. data: {
  716. uid: uid,
  717. act_id: act_id,
  718. is_vip: is_vip,
  719. },
  720. success: function (res) {
  721. fn && fn(res);
  722. },
  723. error: function () {
  724. fn && fn();
  725. }
  726. })
  727. }
  728. function prize(fn) {
  729. ajax({
  730. url: webUrl + "index.php?m=Home&c=Activityv2&a=prize",
  731. data: {
  732. uid: uid,
  733. act_id: init.act_id,
  734. is_vip: init.oursProduct_isVip+init.othersProduct_isVip,//is_vip1+is_vip2
  735. run: "complate",//'complate',
  736. is_test:1,
  737. },
  738. success: function (res) {
  739. fn && fn(res);
  740. },error:function(res){
  741. window.location.href = "../index.html";
  742. }
  743. })
  744. }
  745. function addData(fn) {
  746. ajax({
  747. url:webUrl+"index.php?m=Home&c=ThemeData&a=addData",
  748. data:{
  749. uid: uid,
  750. theme_id: init.theme_id,
  751. },
  752. success: function (res) {
  753. fn && fn(res);
  754. },
  755. error: function () {
  756. }
  757. })
  758. }
  759. function addUser(fn) {
  760. ajax({
  761. url:webUrl+"index.php?m=Home&c=DuduApi&a=addUser",
  762. data:{
  763. uid: uid,
  764. UserToken: usertoken
  765. },
  766. success: function (res) {
  767. fn && fn(res);
  768. },
  769. error: function () {
  770. }
  771. })
  772. }
  773. function authorization(contentcode,uid,usertoken,mac,version,fn) {
  774. ajax({
  775. url:webUrl+"index.php?m=Home&c=order&a=contentCTCAuth",
  776. data:{
  777. contentcode:contentcode,
  778. uid:uid, //2.0
  779. usertoken:usertoken,
  780. mac:mac,
  781. version:version,
  782. fromsource:init.fromsource,
  783. },
  784. type: "post",
  785. dataType: "json",
  786. success: function (res) {
  787. fn && fn(res);
  788. },
  789. error: function (e) {
  790. fn && fn(e);
  791. }
  792. })
  793. }
  794. function payResult(is_vip,uid,product_id){
  795. if(is_vip == 1){
  796. ajax({
  797. url:webUrl+"index.php?m=Home&c=DuduApi&a=payResult",
  798. data:{
  799. uid: uid,
  800. product_id:product_id,
  801. pay_result:0
  802. },
  803. success: function (res) {
  804. },
  805. error: function () {
  806. }
  807. })
  808. }
  809. }
  810. function createQrcode(uid,url,fn){
  811. ajax({
  812. url:webUrl+"index.php?m=Home&c=Activityv2&a=createQrcode",
  813. data:{
  814. act_id:init.act_id,
  815. is_vip:0,
  816. uid: uid,
  817. url:url,
  818. },
  819. success: function (res) {
  820. fn && fn(res);
  821. },
  822. error: function (e) {
  823. fn && fn(e);
  824. }
  825. })
  826. }
  827. function getMengbaoList(uid,is_vip,fn) {
  828. ajax({
  829. url:webUrl+"index.php?m=Home&c=Activityv2&a=getMengbaoList",
  830. data:{
  831. act_id:init.act_id,
  832. uid: uid,
  833. is_vip: is_vip,
  834. },
  835. success: function (res) {
  836. fn && fn(res);
  837. },
  838. error: function () {
  839. }
  840. })
  841. }
  842. function getVoteChance(uid,is_vip,fn) {
  843. ajax({
  844. url:webUrl+"index.php?m=Home&c=Activityv2&a=getVoteChance",
  845. data:{
  846. act_id:init.act_id,
  847. uid: uid,
  848. is_vip: is_vip,
  849. },
  850. success: function (res) {
  851. fn && fn(res);
  852. },
  853. error: function () {
  854. }
  855. })
  856. }
  857. function vote(uid,is_vip,voteid,fn) {
  858. ajax({
  859. url:webUrl+"index.php?m=Home&c=Activityv2&a=vote",
  860. data:{
  861. act_id:init.act_id,
  862. uid: uid,
  863. is_vip: is_vip,
  864. mengbao_id:voteid,
  865. score:1,
  866. },
  867. success: function (res) {
  868. fn && fn(res);
  869. },
  870. error: function () {
  871. }
  872. })
  873. }
  874. function getPrizeNum(uid,is_vip,fn) {
  875. ajax({
  876. url:webUrl+"index.php?m=Home&c=Activityv2&a=getPrizeNum",
  877. data:{
  878. act_id:init.act_id,
  879. uid: uid,
  880. is_vip: is_vip,
  881. },
  882. success: function (res) {
  883. fn && fn(res);
  884. },
  885. error: function () {
  886. }
  887. })
  888. }
  889. function fullscreenPlay(mid) {
  890. var playIntent = {
  891. package : "com.hunantv.operator",
  892. action: "mangotv://com.hunantv.operator/player/vod",
  893. data:"",
  894. extras: {
  895. "video_index": 0,
  896. "media_asset_id": mid, //媒资包
  897. },
  898. flags: []
  899. };
  900. Webview.sendIntent("startActivity", playIntent);
  901. };
  902. function smallvodPlay(media_id,media_num){
  903. media_num = media_num || 0;
  904. stopPlay();
  905. try{
  906. starcorExt.setVideoWindowPosition("345", "179", "577", "323");
  907. var playIntent = {
  908. "video_type": "0",
  909. "media_asset_id": media_id,
  910. "video_index": media_num,
  911. };
  912. starcorExt.playVideo(playIntent);
  913. }catch(e){}
  914. };
  915. function stopPlay(){
  916. try{
  917. starcorExt.stopVideo();
  918. }catch(e){
  919. }
  920. }
  921. try{
  922. starcorExt.setHandler("Resume",function(isResumed){
  923. if(isResumed){//从全屏或设置键回来
  924. smallvodPlay(videoId);
  925. }
  926. });
  927. starcorExt.setHandler("PlayOnCompletion",function(isCompleted){
  928. if(isCompleted){//小视频播放结束
  929. smallvodPlay(videoId);
  930. }
  931. });
  932. }catch(e){
  933. }
  934. function cellphoneNum(){
  935. if(G("phone").innerHTML.length>10) return;
  936. var key = this.event.keyCode;
  937. try {
  938. Webview.setInputTypeTextFlag("true");
  939. if (key >= 0 && key <= 9) {
  940. G("phone").innerText += key;
  941. }
  942. } catch (e) {
  943. if (key > 47 && key < 58) {
  944. G("phone").innerText += (key - 48);
  945. }
  946. }
  947. }
  948. function times(){
  949. getVoteChance(uid,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
  950. if(res.code==0){
  951. G("number").innerHTML = res.data.num;
  952. }
  953. });
  954. getPrizeNum(uid,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
  955. if(res.code==0){
  956. init.gameNum = res.data.num>=0?res.data.num:0;
  957. G("num").innerHTML = res.data.num>=0?res.data.num:0;
  958. }
  959. })
  960. getMengbaoList(uid,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
  961. if(res.code==0){
  962. var _html="";
  963. for(var i=0;i<res.data.length;i++){
  964. mengwaMediaArr.push(res.data[i].media_id);
  965. voteArr.push(res.data[i].mengbao_id);
  966. _html+='<li class="voteLi"><div class="u_img"><img src="'+res.data[i].image+'" alt="" /><i id="vote'+i+'">'+res.data[i].score+'</i></div><div class="u_msg">'+res.data[i].name+'&nbsp;&nbsp;'+res.data[i].age+'</div><span class="voteBtn">投你一票</span></li>'
  967. }
  968. G("voteUl").innerHTML = _html;
  969. }
  970. })
  971. }
  972. function pageInit(){
  973. if(!getStr("mw_oursBag") && !getStr("mw_othersBag") && !getStr("for")){
  974. addUser();
  975. addData();
  976. }
  977. createQrcode(uid,link,function(res){
  978. if(res.code == 0){
  979. G("QRcode").src = res.data.qrcode;
  980. }
  981. })
  982. authorization(init.contentcode,uid,usertoken,mac,version,function(res){
  983. if(res.code == 0 && res.data.result==0){
  984. // init.oursProduct_isVip = 1;
  985. addClass(G("othersProduct"),'hasOrder');
  986. if(!!getStr("mw_oursBag")){
  987. payResult(init.oursProduct_isVip,uid,init.oursId);
  988. };
  989. times();
  990. }else{
  991. init.oursProduct_isVip = 0;
  992. times();
  993. }
  994. },function(){
  995. times();
  996. });
  997. btnInit();
  998. if(main.className == "page_btn"){
  999. smallvodPlay(videoId);
  1000. }
  1001. }
  1002. function btnInit(){
  1003. var btnConfig = {
  1004. className: pageConf.focusItem,
  1005. currentIndex: pageConf.focusIdx,
  1006. rules: data.rules,
  1007. onBack:onBack,
  1008. isFloatLast:true,
  1009. }
  1010. window.main = new tvSysBtnBind(btnConfig);
  1011. main.reLoad();
  1012. }
  1013. btnInit();
  1014. pageInit();
  1015. window.onunload = function(){
  1016. stopPlay();
  1017. }
  1018. </script>
  1019. </body>
  1020. </html>