index1.html 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132
  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. webUrl = 'http://10.255.1.98:8090/DuduToy_v2/';
  115. } catch (e) {
  116. var uid = getStr("uid") || '6830011';
  117. var usertoken = "00139025650832263889980824152950"
  118. var mac = 'OC-41-E9-DD-EC-DE'
  119. var version = "YYS.4.6.15.266.5.HNDX.0.0_Release"
  120. if (location.href.indexOf('10.255.1.98:8090') >= 0) {
  121. webUrl = 'http://10.255.1.98:8090/DuduToy_v2/';
  122. } else {
  123. webUrl = 'http://10.200.10.28:28090/DuduToy_v2/';
  124. }
  125. }
  126. var init = {
  127. act_id:8,
  128. gameNum:0,
  129. theme_id:4,
  130. fromsource:4,
  131. oursId:"11187",
  132. othersId:"500007",//"3651",
  133. oursProduct_isVip:0,
  134. othersProduct_isVip:0,
  135. contentcode:"D00000001201808211755370019993899",
  136. contentcode1:"D00000001201905291020410009898494",
  137. }
  138. var backUrl = webUrl+'h5v2/activity/mw_20200108_act/index.html';
  139. var indexUrl = webUrl+'h5v2/index.html?activity='+init.act_id;
  140. // var link = "http://111.23.12.38:8093/h5/act/index.html?mark="+uid;//http://120.78.169.79/h5/act/index.html";
  141. var videoId = "5e17fb792bd3ea2f150093412b2ff949";
  142. var videoArr = ["5bad90c33abf28bd044f94ab5a5c1480","5e048e862deef11139c2d7a44b17e255","5d5587243774e3b6b5505992040d859e","5db010fb39de445723026d4c28603884","5d7223d86a8e57d624f235d5ed9e6eb1","5c09f38e1fa572d3eb673900007a07a7"]
  143. var mengwaMediaArr = [],voteArr = [];
  144. var pageConf = {
  145. focusIdx:3,
  146. focusItem:"page_btn",
  147. }
  148. var heguiItem = "";
  149. var changeOrwin = "";
  150. var errorMark = false;
  151. var rulesPopup = false;
  152. var rulesMark = 0;
  153. var data = new Object();
  154. data.rules = {
  155. page_btn:{
  156. 0:[3,0,0,1],
  157. 1:[2,-1,0,1],
  158. 2:[1,-1,0,1],
  159. 3:[0,-1,-1,0],
  160. 4:[0,-1,0,["ip_btn",2]],
  161. 5:[0,-2,0,["ip_btn",3]],
  162. onEnterPress:function(){
  163. switch (this.currentIndex) {
  164. case 0:
  165. onBack();
  166. break;
  167. case 1:
  168. stopPlay();
  169. rulesPopup = true;
  170. S("rulesPopup");
  171. this.reSetClass("rules_btn",1);
  172. break;
  173. case 2:
  174. prizelog(uid,init.act_id,init.othersProduct_isVip+init.oursProduct_isVip,function(res){
  175. if (res.code == 0) {
  176. var content = [];
  177. for (var i = 0; i < res.data.length; i++) {
  178. var temp = document.createElement("div");
  179. temp.className = "prizelogRow"
  180. var span1 = document.createElement("div");
  181. span1.className = "prizelogCol1";
  182. var span2 = document.createElement("div");
  183. span2.className = "prizelogCol2";
  184. var span3 = document.createElement("div");
  185. span3.className = "prizelogCol3";
  186. span1.innerText = res.data[i].user_phone;
  187. span2.innerText = res.data[i].prize_name;
  188. span3.innerText = res.data[i].created_at;
  189. temp.appendChild(span1);
  190. temp.appendChild(span2);
  191. temp.appendChild(span3);
  192. content[i] = temp;
  193. }
  194. if (content.length > 4) {
  195. var start = 0;
  196. var end = 4;
  197. var newsHtml = G("prizelog");
  198. var newsTimer = setInterval(function () {
  199. newsHtml.innerHTML = '';
  200. var showNews = content.slice(start, end);
  201. for (var i = 0; i < showNews.length; i++) {
  202. newsHtml.appendChild(showNews[i]);
  203. }
  204. start += 1;
  205. end += 1;
  206. if (start > content.length - 1) {
  207. start = 0;
  208. end = 4;
  209. }
  210. }, 1500)
  211. } else {
  212. var newsHtml = G("prizelog");
  213. newsHtml.innerHTML = '';
  214. var showNews = content;
  215. for (var i = 0; i < showNews.length; i++) {
  216. newsHtml.appendChild(showNews[i]);
  217. }
  218. }
  219. }
  220. })
  221. userPrizelog(uid,init.act_id,init.othersProduct_isVip+init.oursProduct_isVip,function(res){
  222. if(res.code==0){
  223. if (res.data.my_prizes[0]) {
  224. G("myAward").innerText = res.data.my_prizes[0].prize_name;
  225. // G("myPrize").src = res.data.my_prizes[0].show_image;
  226. G("myPhone").innerText = res.data.my_prizes[0].user_phone;
  227. }
  228. if (res.data.user_phone) {
  229. document.getElementById("myPhone").innerText = res.data.user_phone.user_phone;
  230. }
  231. if(res.data.my_prizes[0] && res.data.user_phone.phone_status==2){
  232. init.canPrize = 1;
  233. }else if(res.data.my_prizes[0] && res.data.user_phone.phone_status==1){
  234. init.canPrize = 2
  235. }
  236. }
  237. });
  238. stopPlay();
  239. S("awardPopup");
  240. this.reSetClass("awardBtn");
  241. break;
  242. case 3:
  243. fullscreenPlay(videoId,"1");
  244. break;
  245. case 4:
  246. order(0);
  247. break;
  248. case 5:
  249. order(1);
  250. break;
  251. default:
  252. break;
  253. }
  254. },
  255. onPress:function(){
  256. if((this.event.keyCode == 40 || this.event.keyCode == "DOWN")&& this.prevIndex == 3){
  257. if(init.othersProduct_isVip == 0){
  258. this.reSetClass("page_btn",4);
  259. }else if(init.oursProduct_isVip == 0 && init.othersProduct_isVip == 1){
  260. this.reSetClass("page_btn",5);
  261. }else{
  262. stopPlay();
  263. G("scrollCont").style.top = - 500 + "px";
  264. this.reSetClass("ip_btn",2);
  265. }
  266. }else if((this.event.keyCode == 39 || this.event.keyCode == "RIGHT")&& this.prevIndex == 4){
  267. if(init.oursProduct_isVip == 0){
  268. this.reSetClass("page_btn",5);
  269. }
  270. }else if((this.event.keyCode == 37 || this.event.keyCode == "LEFT")&& this.prevIndex == 5){
  271. if(init.othersProduct_isVip == 0){
  272. this.reSetClass("page_btn",4);
  273. }
  274. }
  275. },
  276. },
  277. ip_btn:{
  278. line:6,
  279. down:["voteBtn"],
  280. onEnterPress:function(){
  281. if(init.othersProduct_isVip == 1){
  282. fullscreenPlay(videoArr[this.currentIndex]);
  283. }else{
  284. order(0);
  285. }
  286. },
  287. onPress:function(){
  288. stopPlay();
  289. G("scrollCont").style.top = - 500 + "px";
  290. if(errorMark){
  291. errorMark = false;
  292. return;
  293. }
  294. if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
  295. try{
  296. smallvodPlay(videoId);
  297. }catch(e){
  298. }
  299. G("scrollCont").style.top = 0;
  300. if(init.othersProduct_isVip == 0){
  301. this.reSetClass("page_btn",4);
  302. }else if(init.oursProduct_isVip == 0 && init.othersProduct_isVip == 1){
  303. this.reSetClass("page_btn",5);
  304. }else{
  305. this.reSetClass("page_btn",3);
  306. }
  307. }
  308. },
  309. },
  310. voteBtn:{
  311. line:4,
  312. up:["ip_btn",2],
  313. onEnterPress:function(){
  314. vote(uid,init.oursProduct_isVip+init.othersProduct_isVip,voteArr[this.currentIndex],function(res){
  315. if(res.code == 0){
  316. G("number").innerHTML = res.data.num;
  317. G("vote"+main.currentIndex).innerHTML = G("vote"+main.currentIndex).innerHTML*1+1;
  318. tips("投票成功");
  319. if(init.gameNum>0){
  320. S("lotteryPopup");
  321. main.reSetClass("lottery_btn",0);
  322. }
  323. }else if(res.code == "-1"){
  324. tips("您的票已用完");
  325. }
  326. })
  327. },
  328. onPress:function(){
  329. G("scrollCont").style.top = - 780-(parseInt(this.currentIndex/4)*268) + "px";
  330. errorMark = true;
  331. },
  332. onBack:function(){
  333. H("lotteryPopup");
  334. this.reSetClass("voteBtn");
  335. }
  336. },
  337. rules_btn:{
  338. line:1,
  339. onEnterPress:function(){
  340. closeRulesPopup();
  341. },
  342. onPress:function(){
  343. if(this.event.keyCode == 40 || this.event.keyCode == "DOWN"){
  344. if(rulesMark<2)rulesMark+=1;
  345. G("miniBar").style.top = rulesMark*200+"px";
  346. G("rulesPopup").style.top = (-(rulesMark*580))+"px";
  347. }else if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
  348. if(rulesMark>0)rulesMark-=1;
  349. G("miniBar").style.top = rulesMark*200+"px";
  350. G("rulesPopup").style.top = (-(rulesMark*580))+"px";
  351. }
  352. }
  353. },lottery_btn:{
  354. line:1,
  355. onEnterPress:function(){
  356. prize(function(res){
  357. if(res.code==0){
  358. init.gameNum -= 1;
  359. if(res.data.yes.prize_status=="none"){
  360. nowin("nowin");
  361. }else if(res.data.yes.prize_status=="real"){//中奖
  362. // G("prizeImg").src = res.data.yes.prize_img;
  363. G("ptizeName").innerHTML = res.data.yes.prize_name;
  364. // G("myPrize").src = res.data.yes.prize_img;
  365. S("prizePopup");
  366. main.reSetClass("prizeBtn",1);
  367. }
  368. }
  369. })
  370. },
  371. onPress:function(){
  372. },
  373. onBack:function(){
  374. H("lotteryPopup");
  375. this.reSetClass("voteBtn");
  376. }
  377. },
  378. awardBtn:{
  379. line:2,
  380. onEnterPress:function(){
  381. if(this.currentIndex == 0){
  382. try{
  383. smallvodPlay(videoId);
  384. }catch(e){
  385. }
  386. H("awardPopup");
  387. this.reSetClass("page_btn",2);
  388. }else if(this.currentIndex == 1){
  389. if(init.canPrize == 1){
  390. H("awardPopup");
  391. S("exchangePopup");
  392. heguiItem = "page_btn";
  393. this.reSetClass("exchangeBtn",0);
  394. }else if(init.canPrize == 2){
  395. tips("您已提交手机号码!")
  396. }else{
  397. tips("您还未中奖,请继续加油噢!")
  398. }
  399. }
  400. },
  401. onBack:function(){
  402. try{
  403. smallvodPlay(videoId);
  404. }catch(e){
  405. }
  406. H("awardPopup");
  407. this.reSetClass("page_btn",2);
  408. },
  409. },
  410. prizeBtn:{
  411. line:2,
  412. onEnterPress:function(){
  413. if(this.currentIndex == 0){
  414. H("prizePopup");
  415. this.reSetClass("voteBtn");
  416. }else{
  417. H("prizePopup");
  418. S("exchangePopup");
  419. heguiItem = "voteBtn";
  420. this.reSetClass("exchangeBtn",0);
  421. }
  422. },
  423. onBack:function(){
  424. H("prizePopup");
  425. this.reSetClass("voteBtn");
  426. },
  427. },
  428. exchangeBtn:{
  429. 0:[0,["phoneNum",6],1,0],
  430. 1:[-1,["phoneNum",8],0,0],
  431. "onEnterPress":exchangePopups,
  432. onPress:cellphoneNum,
  433. onBack:function(){
  434. H("exchangePopup");
  435. G("phone").innerHTML = "";
  436. if(heguiItem == "page_btn"){
  437. try{
  438. smallvodPlay(videoId);
  439. }catch(e){
  440. }
  441. }
  442. this.reSetClass(heguiItem);
  443. },
  444. },
  445. phoneNum:{
  446. line:6,
  447. down:["exchangeBtn",1],
  448. onEnterPress:function(){
  449. if(this.currentIndex<=9){
  450. if(G("phone").innerHTML.length>10) return;
  451. if(this.currentIndex == 9){
  452. G("phone").innerHTML += 0;
  453. }else{
  454. G("phone").innerHTML += this.currentIndex*1+1;
  455. }
  456. }else if(this.currentIndex == 10){
  457. if(G("phone").innerHTML.length>0)
  458. G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
  459. }else if(this.currentIndex == 11){
  460. if(G("phone").innerHTML.length>0)
  461. G("phone").innerHTML = "";
  462. }
  463. },
  464. onPress:cellphoneNum,
  465. onBack:function(){
  466. if(G("phone").innerHTML.length>0){
  467. G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
  468. }else{
  469. H("exchangePopup");
  470. G("phone").innerHTML = "";
  471. if(heguiItem == "page_btn"){
  472. try{
  473. smallvodPlay(videoId);
  474. }catch(e){
  475. }
  476. }
  477. this.reSetClass(heguiItem);
  478. }
  479. },
  480. },
  481. markDownBtn:{
  482. line:1,
  483. onEnterPress:function(){
  484. H("markDownPopup");
  485. if(heguiItem == "page_btn"){
  486. try{
  487. smallvodPlay(videoId);
  488. }catch(e){
  489. }
  490. }
  491. this.reSetClass(heguiItem);
  492. },
  493. onBack:function(){
  494. H("markDownPopup");
  495. if(heguiItem == "page_btn"){
  496. try{
  497. smallvodPlay(videoId);
  498. }catch(e){
  499. }
  500. }
  501. this.reSetClass(heguiItem);
  502. },
  503. },
  504. unWinToyBtn:{
  505. 0:[0,0,0,1],
  506. 1:[0,0,0,1],
  507. 2:[0,0,0,0],
  508. onEnterPress:function(){
  509. if(this.currentIndex==2){
  510. H("unWinToyPopup");
  511. this.reSetClass("voteBtn");
  512. }else{
  513. order(this.currentIndex);
  514. }
  515. },
  516. onPress:function(){
  517. if(this.prevIndex == 0){
  518. if(this.event.keyCode == 40 || this.event.keyCode == "DOWN"){
  519. if(init.oursProduct_isVip == 0){
  520. this.reSetClass("unWinToyBtn",1);
  521. }else{
  522. this.reSetClass("unWinToyBtn",2);
  523. }
  524. }
  525. }else if(this.prevIndex == 1){
  526. if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
  527. if(init.othersProduct_isVip == 0){
  528. this.reSetClass("unWinToyBtn",0);
  529. }
  530. }
  531. }else if(this.prevIndex == 2){
  532. if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
  533. if(init.oursProduct_isVip == 1){
  534. this.reSetClass("unWinToyBtn",0);
  535. }else if(init.oursProduct_isVip == 0){
  536. this.reSetClass("unWinToyBtn",1);
  537. }else if(init.othersProduct_isVip == 0){
  538. this.reSetClass("unWinToyBtn",0);
  539. }
  540. }
  541. }
  542. },
  543. onBack:function(){
  544. H("unWinToyPopup");
  545. this.reSetClass("voteBtn");
  546. },
  547. },
  548. unWinToyVipBtn:{
  549. line:1,
  550. up:["poster"],
  551. onEnterPress:function(){
  552. if(this.currentIndex==0){
  553. H("unWinToyVipPopup");
  554. this.reSetClass("voteBtn");
  555. }
  556. },
  557. onBack:function(){
  558. setCookie("gameItemIdx","");
  559. setCookie("itemIdx","");
  560. H("unWinToyVipPopup");
  561. this.reSetClass("voteBtn");
  562. },
  563. },
  564. poster:{
  565. line:3,
  566. down:["unWinToyVipBtn"],
  567. onEnterPress:function(){
  568. var url = '',index=this.currentIndex;
  569. if(changeOrwin == "nowin"){
  570. setCookie("gameItemIdx",index);
  571. }else{
  572. setCookie("itemIdx",index);
  573. }
  574. toZhuanti(index);
  575. },
  576. onBack:function(){
  577. setCookie("gameItemIdx","");
  578. setCookie("itemIdx","");
  579. window.location.href = "../index.html";
  580. },
  581. },
  582. }
  583. function onBack(){
  584. if(rulesPopup){
  585. closeRulesPopup();
  586. }else{
  587. stopPlay();
  588. window.location.href = indexUrl;
  589. }
  590. }
  591. function userPrizelog(uid,act_id,is_vip,fn) {
  592. ajax({
  593. url: webUrl + "index.php?m=Home&c=Activityv2&a=userPrizelog",
  594. data: {
  595. uid: uid,
  596. act_id: act_id,
  597. is_vip: is_vip
  598. },
  599. success: function (res) {
  600. fn && fn(res);
  601. },
  602. error: function () {
  603. fn && fn();
  604. }
  605. })
  606. }
  607. function exchangePopups(){
  608. if(this.currentIndex==1){
  609. H("exchangePopup");
  610. G("phone").innerHTML = "";
  611. if(heguiItem == "page_btn"){
  612. try{
  613. smallvodPlay(videoId);
  614. }catch(e){
  615. }
  616. }
  617. this.reSetClass(heguiItem);
  618. }else if(this.currentIndex==0){
  619. var phone = G("phone").innerText;
  620. var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
  621. if(!myreg.test(phone)){
  622. tips('手机号码格式有误!');
  623. }else{
  624. ajax({
  625. url: webUrl + "index.php?m=Home&c=Activityv2&a=setUserInfo",
  626. data: {
  627. uid: uid,
  628. act_id: init.act_id,
  629. is_vip: init.oursProduct_isVip+init.othersProduct_isVip,
  630. phone: phone
  631. },
  632. success: function (res) {
  633. if(res.code == 0){
  634. H("exchangePopup");
  635. G("phone").innerHTML = "";
  636. S("markDownPopup");
  637. main.reSetClass("markDownBtn");
  638. }else{
  639. tips(res.msg);
  640. }
  641. }
  642. })
  643. }
  644. }
  645. }
  646. function toZhuanti(idx){
  647. var exitStr = escape(backUrl);
  648. var url = '';
  649. if(idx==0){
  650. url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1991&exitStr=' + exitStr;
  651. }else if(idx==1){
  652. url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1956&exitStr=' + exitStr;
  653. }else if(idx==2){
  654. url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1467&exitStr=' + exitStr;
  655. }
  656. window.location.href = url;
  657. }
  658. function nowin(type){
  659. if(init.oursProduct_isVip==1||init.othersProduct_isVip==1){
  660. changeOrwin = type;
  661. if(type == "nowin"){
  662. G("unWinToyVipPopup").style.background = "url('./img/page_06.png') no-repeat center";
  663. }else{
  664. G("unWinToyVipPopup").style.background = "url('./img/page_08.png') no-repeat center";
  665. }
  666. S("unWinToyVipPopup");
  667. main.reSetClass("poster");
  668. }else{
  669. if(type == "nowin"){
  670. G("unWinToyPopup").style.background = "url('./img/page_05.png') no-repeat center";
  671. }else{
  672. G("unWinToyPopup").style.background = "url('./img/page_07.png') no-repeat center";
  673. }
  674. S("unWinToyPopup");
  675. main.reSetClass("unWinToyBtn",2);
  676. }
  677. }
  678. function closeRulesPopup(){
  679. try{
  680. smallvodPlay(videoId);
  681. }catch(e){
  682. }
  683. rulesPopup = false;
  684. H("rulesPopup");
  685. main.reSetClass("page_btn",1);
  686. }
  687. function order(idx){
  688. var product_id = init.oursId;
  689. var price = "15";
  690. var name = "玩具总动员";
  691. var bag = "wjzdy_bag";
  692. var mark = "mw_oursBag";
  693. if(idx==0){
  694. product_id=init.othersId,
  695. price="24.9",
  696. name="少儿会员",
  697. bag="shaoer_package",
  698. mark = "mw_othersBag"
  699. }
  700. var product_list={
  701. "product_id":product_id,
  702. "time":"30",
  703. "product_type":"1",
  704. "price":price,
  705. "button_name":name,
  706. "name":name,
  707. "bag":bag,
  708. "back_url":backUrl+'?'+mark+'='+uid,
  709. }
  710. window.location.href = "http://10.255.0.219/en/jump_order/index.html?product_list="+JSON.stringify(product_list);
  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,num) {
  890. num = num || 30;
  891. stopPlay();
  892. var playIntent = {
  893. action: "com.mgtv.hndx.prop.mgplayer.MgVodPlayerActivity", //湖南电信、湖南联通(6期)
  894. extras: {
  895. "cmd_ex": "play_video",
  896. "play_video_direct": 1,
  897. "video_id": mid,
  898. "video_type": 0,
  899. "video_index": 0,
  900. "video_all_index": num,
  901. "ui_style": 0,
  902. "media_asset_id": "TVseries",
  903. "category_id": "",
  904. "video_new_index": num-1,
  905. },
  906. flags: ["SINGLE_TOP"]
  907. };
  908. Webview.sendIntent("startActivity", playIntent); //全屏播放
  909. };
  910. function smallvodPlay(mid){
  911. stopPlay();
  912. starcorExt.setVideoWindowPosition("345", "179", "577", "323");
  913. starcorExt.setHandler("PlayPrepared",function(prepared){
  914. var playIntent = {
  915. "cmd_ex" : "play_video",
  916. "play_video_direct" : 1,
  917. "video_id" : mid,
  918. "video_type" : 0,
  919. "video_index" : 0,
  920. "video_all_index": 1,
  921. "ui_style": 0,
  922. "video_new_index": 0
  923. };
  924. if(prepared){
  925. starcorExt.playVideo(playIntent);
  926. }
  927. });
  928. };
  929. function stopPlay(){
  930. try{
  931. starcorExt.stopVideo();
  932. }catch(e){
  933. }
  934. }
  935. try{
  936. starcorExt.setHandler("Resume",function(isResumed){
  937. if(isResumed){//从全屏或设置键回来
  938. smallvodPlay(videoId);
  939. }
  940. });
  941. starcorExt.setHandler("PlayOnCompletion",function(isCompleted){
  942. if(isCompleted){//小视频播放结束
  943. smallvodPlay(videoId);
  944. }
  945. });
  946. }catch(e){
  947. }
  948. function cellphoneNum(){
  949. if(G("phone").innerHTML.length>10) return;
  950. var key = this.event.keyCode;
  951. try {
  952. Webview.setInputTypeTextFlag("true");
  953. if (key >= 0 && key <= 9) {
  954. G("phone").innerText += key;
  955. }
  956. } catch (e) {
  957. if (key > 47 && key < 58) {
  958. G("phone").innerText += (key - 48);
  959. }
  960. }
  961. }
  962. function times(){
  963. getVoteChance(uid,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
  964. if(res.code==0){
  965. G("number").innerHTML = res.data.num;
  966. }
  967. });
  968. getPrizeNum(uid,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
  969. if(res.code==0){
  970. init.gameNum = res.data.num>=0?res.data.num:0;
  971. G("num").innerHTML = res.data.num>=0?res.data.num:0;
  972. }
  973. })
  974. getMengbaoList(uid,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
  975. if(res.code==0){
  976. var _html="";
  977. for(var i=0;i<res.data.length;i++){
  978. mengwaMediaArr.push(res.data[i].media_id);
  979. voteArr.push(res.data[i].mengbao_id);
  980. _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>'
  981. }
  982. G("voteUl").innerHTML = _html;
  983. }
  984. })
  985. }
  986. function pageInit(){
  987. if(!getStr("mw_oursBag") && !getStr("mw_othersBag") && !getStr("for")){
  988. addUser();
  989. addData();
  990. }
  991. // createQrcode(uid,link,function(res){
  992. // if(res.code == 0){
  993. // G("QRcode").src = res.data.qrcode;
  994. // }
  995. // })
  996. authorization(init.contentcode,uid,usertoken,mac,version,function(res){
  997. if(res.code == 0){
  998. if(res.data.result==0){
  999. init.oursProduct_isVip = 1;
  1000. addClass(G("oursProduct"),'hasOrder');
  1001. addClass(G("product2"),'hasOrder');
  1002. if(!!getStr("mw_oursBag")){
  1003. payResult(init.oursProduct_isVip,uid,init.oursId);
  1004. }
  1005. }else{
  1006. init.oursProduct_isVip = 0;
  1007. }
  1008. if(!!getCookie("itemIdx") || !!getCookie("gameItemIdx")){
  1009. if(!!getCookie("itemIdx")){
  1010. G("unWinToyVipPopup").style.background = "url('./img/page_08.png') no-repeat center";
  1011. }else{
  1012. G("unWinToyVipPopup").style.background = "url('./img/page_06.png') no-repeat center";
  1013. }
  1014. G("scrollCont").style.top = - 780-(parseInt(0/4)*268) + "px";
  1015. S("unWinToyVipPopup");
  1016. pageConf.focusItem = "poster";
  1017. pageConf.focusIdx = getCookie("itemIdx");
  1018. setCookie("gameItemIdx","");
  1019. setCookie("itemIdx","");
  1020. }
  1021. btnInit();
  1022. authorization(init.contentcode1,uid,usertoken,mac,version,function(res){
  1023. if(res.code == 0){
  1024. if(res.data.result==0){
  1025. init.othersProduct_isVip = 1;
  1026. addClass(G("othersProduct"),'hasOrder');
  1027. addClass(G("product1"),'hasOrder');
  1028. if(!!getStr("mw_othersBag")){
  1029. payResult(init.othersProduct_isVip,uid,init.othersId)
  1030. }
  1031. }else{
  1032. init.othersProduct_isVip = 0;
  1033. }
  1034. times();
  1035. }else{
  1036. times();
  1037. }
  1038. },function(){
  1039. times();
  1040. });
  1041. }else{
  1042. times();
  1043. }
  1044. },function(){
  1045. btnInit();
  1046. times();
  1047. });
  1048. if(main.className == "page_btn"){
  1049. smallvodPlay(videoId);
  1050. }
  1051. }
  1052. function btnInit(){
  1053. var btnConfig = {
  1054. className: pageConf.focusItem,
  1055. currentIndex: pageConf.focusIdx,
  1056. rules: data.rules,
  1057. onBack:onBack,
  1058. isFloatLast:true,
  1059. }
  1060. window.main = new tvSysBtnBind(btnConfig);
  1061. main.reLoad();
  1062. }
  1063. btnInit();
  1064. pageInit();
  1065. window.onunload = function(){
  1066. stopPlay();
  1067. }
  1068. </script>
  1069. </body>
  1070. </html>