1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="page-view-size" content="1280*720" />
- <title>"鼠"你最棒,萌宝"潮"贺岁</title>
- <link rel="stylesheet" type="text/css" href="css/page1.css" />
- </head>
- <body>
- <div class="main">
- <div id="scrollCont">
- <div class="code">
- <img id="QRcode" src="" alt="" />
- <span>扫码上传萌娃贺岁视频</span>
- <span>拼人气赢大奖</span>
- </div>
- <div class="page_btn pg0"></div>
- <div class="page_btn pg1"></div>
- <div class="page_btn pg2"></div>
- <div class="page_btn pg3"></div>
- <div class="page_btn pg4" id="othersProduct"></div>
- <!-- <div class="page_btn pg5" id="oursProduct"></div> -->
- <div class="prizeNum">抽奖机会:<span id="num"></span></div>
- <ul class="list" id="ipUl">
- <li class="ip_btn ip1"></li>
- <li class="ip_btn ip2"></li>
- <li class="ip_btn ip3"></li>
- <li class="ip_btn ip4"></li>
- <li class="ip_btn ip5"></li>
- <li class="ip_btn ip6"></li>
- </ul>
- <div class="voteGroup">
- <div class="tit1">
- <img src="img/tit1.png" height="63" width="472" alt="" />
- <div class="times"><img src="img/piaoshu.png" height="29" width="109" alt="" /><span id="number"></span></div>
- </div>
- <ul class="voteList" id="voteUl">
- <!-- <li class="voteLi">
- <div class="u_img"><img src="img/demo.jpg" alt="" /><i></i></div><div class="u_msg">张宇涵</div><span class="voteBtn">投你一票</span>
- </li> -->
- </ul>
- </div>
- <div id="rulesPopup" class="popup">
- <div class="rules_btn"></div>
- <div class="bar">
- <span id="miniBar" class="progress"></span>
- </div>
- </div>
- <div id="lotteryPopup" class="popup">
- <div class="lottery_btn confirm"></div>
- </div>
-
- <div id="prizePopup" class="popup">
- <img id="prizeImg" src="" alt="" style="position: absolute;left: 515px;top: 180px;"/>
- <p id="ptizeName" style="text-align: center;width: 180px;height: 50px;line-height: 50px;position: absolute;left: 554px;top: 457px;color: #dd002b;font-size: 25px;font-weight: bold;"></p>
- <div class="prizeBtn cancel"></div>
- <div class="prizeBtn toExchange"></div>
- </div>
- <div id="exchangePopup" class="popup">
- <img id="myPrize" src="" alt="" style="position: absolute;left: 330px;top: 260px;" />
- <div id="phone"></div>
- <ul id="keyBoard">
- <li class="phoneNum">1</li>
- <li class="phoneNum">2</li>
- <li class="phoneNum">3</li>
- <li class="phoneNum">4</li>
- <li class="phoneNum">5</li>
- <li class="phoneNum">6</li>
- <li class="phoneNum">7</li>
- <li class="phoneNum">8</li>
- <li class="phoneNum">9</li>
- <li class="phoneNum">0</li>
- <li class="phoneNum otherBtn">删除</li>
- <li class="phoneNum otherBtn">清空</li>
- </ul>
- <div class="exchangeBtn confirm"></div>
- <div class="exchangeBtn cancel"></div>
- </div>
- <div id="unWinToyPopup" class="popup">
- <div id="product1" class="unWinToyBtn"></div>
- <!-- <div id="product2" class="unWinToyBtn"></div> -->
- <div class="unWinToyBtn confirm"></div>
- </div>
- <div id="unWinToyVipPopup" class="popup">
- <div class="pmodel pmodel_1"></div>
- <div class="pmodel pmodel_2"></div>
- <div class="pmodel pmodel_3"></div>
- <div class="poster poster_1"></div>
- <div class="poster poster_2"></div>
- <div class="poster poster_3"></div>
- <div class="unWinToyVipBtn confirm"></div>
- </div>
- <!-- 中奖查询 -->
- <div id="awardPopup" class="popup">
- <div id="prizelog"></div>
- <div id="myAward"></div>
- <div id="myPhone"></div>
- <div class="awardBtn cancel"></div>
- <div class="awardBtn toAward"></div>
- </div>
- <div id="markDownPopup" class="popup">
- <div class="markDownBtn confirm"></div>
- </div>
- </div>
- </div>
- <script src="./js/webview.js" type="text/javascript"></script>
- <script src="./js/tvSysBtnBind.v2.js" type="text/javascript"></script>
- <script src="./js/comm.js" type="text/javascript"></script>
- <script type="text/javascript">
- try {
- var uid = Webview.readSystemProp('user.id');
- var usertoken = Webview.readSystemProp('user.token');
- var mac = Webview.readSystemProp('device.mac');
- var version = Webview.readSystemProp('app.version');
- } catch (e) {
- var uid = getStr("uid") || '0100834547692768574';
- var usertoken = "00139025650832263889980824152950"
- var mac = 'OC-41-E9-DD-EC-DE'
- var version = "YYS.4.6.15.266.5.HNDX.0.0_Release"
- }
- var init = {
- is_vip:0,
- act_id:2,
- gameNum:0,
- theme_id:2,
- fromsource:15,
- oursId:"8801000638",//"8801000079",
- othersId:"8801000646",//不用
- oursProduct_isVip:0,
- othersProduct_isVip:0,
- contentcode:"00000001000000000018000000431421",//少儿月包 00000001000000000025000000024157
- // contentcode1:"D00000001201905291020410009898494",
- }
- var webUrl = 'http://111.23.13.123:8091/';
- var backUrl = webUrl+'h5v2/mw_20200108_act/index1.html';
- // var indexUrl = webUrl+'html/index.html?activity='+init.act_id;
- var link = "http://111.23.12.38:8093/h5/act/index.html?mark="+uid;//http://120.78.169.79/h5/act/index.html";
- var videoId = "00000001000000000033000000121962";
- var videoArr = ["00000001000000000014000000153851","00000001000000000032000000221170","00000001000000000025000000326508","00000001000000000028000000428043","00000001000000000026000000325529","00000001000000000015000000283749"]
- var mengwaMediaArr = [],voteArr = [],numArr=[];
- var pageConf = {
- focusIdx:3,
- focusItem:"page_btn",
- }
- var listM = 0;
- var heguiItem = "";
- var changeOrwin = "";
- var rulesPopup = false;
- var errorMark = false;
- var rulesMark = 0;
- var data = new Object();
- data.rules = {
- page_btn:{
- 0:[3,0,0,1],
- 1:[2,-1,0,1],
- 2:[1,-1,0,1],
- 3:[0,-1,-1,0],
- 4:[0,-1,0,["ip_btn",2]],
- onEnterPress:function(){
- switch (this.currentIndex) {
- case 0:
- onBack();
- break;
- case 1:
- stopPlay();
- rulesPopup = true;
- S("rulesPopup");
- this.reSetClass("rules_btn",1);
- break;
- case 2:
- prizelog(uid,init.act_id,function(res){
- if (res.code == 0) {
- var content = [];
- for (var i = 0; i < res.data.length; i++) {
- var temp = document.createElement("div");
- temp.className = "prizelogRow"
- var span1 = document.createElement("div");
- span1.className = "prizelogCol1";
- var span2 = document.createElement("div");
- span2.className = "prizelogCol2";
- var span3 = document.createElement("div");
- span3.className = "prizelogCol3";
- span1.innerText = res.data[i].user_phone;
- span2.innerText = res.data[i].prize_name;
- span3.innerText = res.data[i].created_at;
- temp.appendChild(span1);
- temp.appendChild(span2);
- temp.appendChild(span3);
- content[i] = temp;
- }
- if (content.length > 4) {
- var start = 0;
- var end = 4;
- var newsHtml = G("prizelog");
- var newsTimer = setInterval(function () {
- newsHtml.innerHTML = '';
- var showNews = content.slice(start, end);
- for (var i = 0; i < showNews.length; i++) {
- newsHtml.appendChild(showNews[i]);
- }
- start += 1;
- end += 1;
- if (start > content.length - 1) {
- start = 0;
- end = 4;
- }
- }, 1500)
- } else {
- var newsHtml = G("prizelog");
- newsHtml.innerHTML = '';
- var showNews = content;
- for (var i = 0; i < showNews.length; i++) {
- newsHtml.appendChild(showNews[i]);
- }
- }
- }
- })
- userPrizelog(uid,init.act_id,function(res){
- if(res.code==0){
- if (res.data.my_prizes[0]) {
- G("myAward").innerText = res.data.my_prizes[0].prize_name;
- G("myPrize").src = res.data.my_prizes[0].show_image;
- G("myPhone").innerText = res.data.my_prizes[0].user_phone;
- }
- if (res.data.user_phone) {
- document.getElementById("myPhone").innerText = res.data.user_phone.user_phone;
- }
- if(res.data.my_prizes[0] && res.data.user_phone.phone_status==2){
- init.canPrize = 1;
- }else if(res.data.my_prizes[0] && res.data.user_phone.phone_status==1){
- init.canPrize = 2
- }
- }
- });
- stopPlay();
- S("awardPopup");
- this.reSetClass("awardBtn");
- break;
- case 3:
- fullscreenPlay(videoId,"1");
- break;
- case 4:
- order(0);
- break;
- default:
- break;
- }
-
- },
- onPress:function(){
- if((this.event.keyCode == 40 || this.event.keyCode == "DOWN")&& this.prevIndex == 3){
- if(init.oursProduct_isVip == 0){
- this.reSetClass("page_btn",4);
- }else{
- stopPlay();
- G("scrollCont").style.top = - 500 + "px";
- this.reSetClass("ip_btn",2);
- }
- }
- },
- },
- ip_btn:{
- line:6,
- down:["voteBtn"],
- onEnterPress:function(){
- details_page(videoArr[this.currentIndex]);
- },
- onPress:function(){
- stopPlay();
- G("scrollCont").style.top = - 500 + "px";
- if(errorMark){
- errorMark = false;
- return;
- }
- if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
- try{
- smallvodPlay(videoId);
- }catch(e){
-
- }
- G("scrollCont").style.top = 0;
- if(init.oursProduct_isVip == 0){
- this.reSetClass("page_btn",4);
- }
- else{
- this.reSetClass("page_btn",3);
- }
- }
- },
- },
- voteBtn:{
- line:4,
- up:["ip_btn",2],
- onEnterPress:function(){
- if(!this.current.getAttribute("data-mark")){
- // var idx = this.currentIndex>3?this.currentIndex-4:this.currentIndex;
- fullscreenPlay(this.current.getAttribute("data-media"),this.current.getAttribute("data-num"));
- }else{
- vote(uid,this.current.getAttribute("data-mengbao"),function(res){
- if(res.code == 0){
- G("number").innerHTML = res.data.num;
- G("vote"+(main.current.getAttribute("data-mark"))).innerHTML = G("vote"+(main.current.getAttribute("data-mark"))).innerHTML*1+1;
- tips("投票成功");
- getPrizeNum(uid,function(res){
- if(res.code==0){
- init.gameNum = res.data.num>=0?res.data.num:0;
- G("num").innerHTML = res.data.num>=0?res.data.num:0;
- if( res.data.num>0){
- setCookie("mark",main.currentIndex)
- S("lotteryPopup");
- main.reSetClass("lottery_btn",0);
- }
- }
- })
- }else if(res.code == "-1"){
- tips("您的票已用完");
- }
- })
-
- }
- },
- onPress:function(){
- if(this.event.keyCode == 40 || this.event.keyCode == "DOWN"){
- if(this.prevIndex+4>=this.hotbtn.length){
- if(this.prevIndex == this.hotbtn.length-1) return;
- if(this.prevIndex == this.hotbtn.length-2){
- this.reSetClass("voteBtn",this.hotbtn.length-1);
- }else{
- this.reSetClass("voteBtn",this.hotbtn.length-1-listM);
- }
- }else if(!!this.prev.getAttribute("data-mark") && !!this.hotbtn[this.prevIndex+4].getAttribute("data-mark")){
- this.reSetClass("voteBtn",this.hotbtn.length-2);
- }
- }else if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
- if(this.prev.getAttribute("data-key")){
- this.reSetClass("voteBtn",this.prevIndex-listM);
- }
- }
- if(!this.current.getAttribute("data-mark")){
- var h = document.getElementsByClassName("voteTxt")[0].offsetHeight+document.getElementsByClassName("voteLi")[0].offsetHeight+20
- G("scrollCont").style.top = - 770-(parseInt(this.currentIndex/4/2)*h) + "px";
- }
- errorMark = true;
- },
- },
- rules_btn:{
- line:1,
- onEnterPress:function(){
- closeRulesPopup();
- },
- onPress:function(){
- if(this.event.keyCode == 40 || this.event.keyCode == "DOWN"){
- if(rulesMark<2)rulesMark+=1;
- G("miniBar").style.top = rulesMark*200+"px";
- G("rulesPopup").style.top = (-(rulesMark*580))+"px";
- }else if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
- if(rulesMark>0)rulesMark-=1;
- G("miniBar").style.top = rulesMark*200+"px";
- G("rulesPopup").style.top = (-(rulesMark*580))+"px";
- }
- }
- },lottery_btn:{
- line:1,
- onEnterPress:function(){
- prize(function(res){
- if(res.code==0){
- init.gameNum -= 1;
- H("lotteryPopup");
- if(res.data.yes.prize_status=="none"){
- nowin("nowin");
- }else if(res.data.yes.prize_status=="real"){//中奖
- G("prizeImg").src = res.data.yes.prize_img;
- G("ptizeName").innerHTML = res.data.yes.prize_name;
- G("myPrize").src = res.data.yes.prize_img;
- S("prizePopup");
- main.reSetClass("prizeBtn",1);
- }
- }
- })
- },
- onPress:function(){
- },
- onBack:function(){
- H("lotteryPopup");
- this.reSetClass("voteBtn");
- }
- },
- awardBtn:{
- line:2,
- onEnterPress:function(){
- if(this.currentIndex == 0){
- try{
- smallvodPlay(videoId);
- }catch(e){
-
- }
- H("awardPopup");
- this.reSetClass("page_btn",2);
- }else if(this.currentIndex == 1){
- if(init.canPrize == 1){
- H("awardPopup");
- S("exchangePopup");
- heguiItem = "page_btn";
- this.reSetClass("exchangeBtn",0);
- }else if(init.canPrize == 2){
- tips("您已提交手机号码!")
- }else{
- tips("您还未中奖,请继续加油噢!")
- }
- }
- },
- onBack:function(){
- try{
- smallvodPlay(videoId);
- }catch(e){
-
- }
- H("awardPopup");
- this.reSetClass("page_btn",2);
- },
- },
- prizeBtn:{
- line:2,
- onEnterPress:function(){
- if(this.currentIndex == 0){
- H("prizePopup");
- this.reSetClass("voteBtn");
- }else{
- H("prizePopup");
- S("exchangePopup");
- heguiItem = "voteBtn";
- this.reSetClass("exchangeBtn",0);
- }
- },
- onBack:function(){
- H("prizePopup");
- this.reSetClass("voteBtn");
- },
- },
- exchangeBtn:{
- 0:[0,["phoneNum",6],1,0],
- 1:[-1,["phoneNum",8],0,0],
- "onEnterPress":exchangePopups,
- "onPress":cellphoneNum,
- onBack:function(){
- H("exchangePopup");
- G("phone").innerHTML = "";
- if(heguiItem == "page_btn"){
- try{
- smallvodPlay(videoId);
- }catch(e){
- }
- }
- this.reSetClass(heguiItem);
- },
- },
- phoneNum:{
- line:6,
- down:["exchangeBtn",1],
- onEnterPress:function(){
- if(this.currentIndex<=9){
- if(G("phone").innerHTML.length>10) return;
- if(this.currentIndex == 9){
- G("phone").innerHTML += 0;
- }else{
- G("phone").innerHTML += this.currentIndex*1+1;
- }
- }else if(this.currentIndex == 10){
- if(G("phone").innerHTML.length>0)
- G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
- }else if(this.currentIndex == 11){
- if(G("phone").innerHTML.length>0)
- G("phone").innerHTML = "";
- }
- },
- "onPress":cellphoneNum,
- onBack:function(){
- if(G("phone").innerHTML.length>0){
- G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
- }else{
- H("exchangePopup");
- G("phone").innerHTML = "";
- if(heguiItem == "page_btn"){
- try{
- smallvodPlay(videoId);
- }catch(e){
-
- }
- }
- this.reSetClass(heguiItem);
- }
- },
- },
- markDownBtn:{
- line:1,
- onEnterPress:function(){
- H("markDownPopup");
- if(heguiItem == "page_btn"){
- try{
- smallvodPlay(videoId);
- }catch(e){
-
- }
- }
- this.reSetClass(heguiItem);
- },
- onBack:function(){
- H("markDownPopup");
- if(heguiItem == "page_btn"){
- try{
- smallvodPlay(videoId);
- }catch(e){
-
- }
- }
- this.reSetClass(heguiItem);
- },
- },
- unWinToyBtn:{
- 0:[0,0,0,1],
- 1:[0,-1,0,0],
- // 2:[0,0,0,0],
- onEnterPress:function(){
- if(this.currentIndex==1){
- H("unWinToyPopup");
- this.reSetClass("voteBtn");
- }else{
- order(this.currentIndex);
- }
- },
- onPress:function(){
- // if(this.prevIndex == 0){
- // if(this.event.keyCode == 40 || this.event.keyCode == "DOWN"){
- // if(init.oursProduct_isVip == 0){
- // this.reSetClass("unWinToyBtn",1);
- // }else{
- // this.reSetClass("unWinToyBtn",2);
- // }
- // }
- // }else if(this.prevIndex == 1){
- // if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
- // if(init.othersProduct_isVip == 0){
- // this.reSetClass("unWinToyBtn",0);
- // }
- // }
- // }else if(this.prevIndex == 2){
- // if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
- // if(init.oursProduct_isVip == 1){
- // this.reSetClass("unWinToyBtn",0);
- // }else if(init.oursProduct_isVip == 0){
- // this.reSetClass("unWinToyBtn",1);
- // }else if(init.othersProduct_isVip == 0){
- // this.reSetClass("unWinToyBtn",0);
- // }
- // }
- // }
- },
- onBack:function(){
- H("unWinToyPopup");
- this.reSetClass("voteBtn");
- },
- },
- unWinToyVipBtn:{
- line:1,
- up:["poster"],
- onEnterPress:function(){
- if(this.currentIndex==0){
- H("unWinToyVipPopup");
- if(!!getCookie("mark")&&(!!getCookie("gameItemIdx") || !!getCookie("itemIdx"))){
- this.reSetClass("voteBtn",getCookie("mark"));
- }else{
- this.reSetClass("voteBtn");
- }
- setCookie("gameItemIdx","");
- setCookie("itemIdx","");
- setCookie("mark","");
- }
- },
- onBack:function(){
- H("unWinToyVipPopup");
- if(!!getCookie("mark")&&(!!getCookie("gameItemIdx") || !!getCookie("itemIdx"))){
- this.reSetClass("voteBtn",getCookie("mark"));
- }else{
- this.reSetClass("voteBtn");
- }
- setCookie("gameItemIdx","");
- setCookie("itemIdx","");
- setCookie("mark","");
- },
- },
- poster:{
- line:3,
- down:["unWinToyVipBtn"],
- onEnterPress:function(){
- var url = '',index=this.currentIndex;
- if(changeOrwin == "nowin"){
- setCookie("gameItemIdx",index);
- }else{
- setCookie("itemIdx",index);
- }
- toZhuanti(index);
- },
- onBack:function(){
- H("unWinToyVipPopup");
- if(!!getCookie("mark")&&(!!getCookie("gameItemIdx") || !!getCookie("itemIdx"))){
- this.reSetClass("voteBtn",getCookie("mark"));
- }else{
- this.reSetClass("voteBtn");
- }
- setCookie("gameItemIdx","");
- setCookie("itemIdx","");
- setCookie("mark","");
- },
- },
- }
- function onBack(){
- if(rulesPopup){
- closeRulesPopup();
- }else{
- stopPlay();
- Webview.closeBrwoser("返回");
- // window.location.href = indexUrl;
- }
- }
- function userPrizelog(uid,act_id,fn) {
- juge();
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=userPrizelog",
- data: {
- uid: uid,
- act_id: act_id,
- is_vip: init.is_vip,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- fn && fn();
- }
- })
- }
- function exchangePopups(){
- if(this.currentIndex==1){
- H("exchangePopup");
- G("phone").innerHTML = "";
- if(heguiItem == "page_btn"){
- try{
- smallvodPlay(videoId);
- }catch(e){
-
- }
- }
- this.reSetClass(heguiItem);
- }else if(this.currentIndex==0){
- var phone = G("phone").innerText;
- var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
- if(!myreg.test(phone)){
- tips('手机号码格式有误!');
- }else{
- juge();
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=setUserInfo",
- data: {
- uid: uid,
- act_id: init.act_id,
- is_vip: init.is_vip,
- phone: phone
- },
- success: function (res) {
- if(res.code == 0){
- H("exchangePopup");
- G("phone").innerHTML = "";
- S("markDownPopup");
- main.reSetClass("markDownBtn");
- }else{
- tips(res.msg);
- }
-
- }
- })
- }
- }
- }
- function toZhuanti(index){
- // var exitStr = escape(backUrl);
- // var url = '';
- if(index==0){
- fullscreenPlay("00000001000000000025000000326508")
- }else if(index==1){
- fullscreenPlay("00000001000000000032000000221170")
- }else if(index==2){
- fullscreenPlay("00000001000000000028000000428043")
- }
- // window.location.href = url;
- }
- function details_page (id) {
- var playIntent = {
- package:"com.hunantv.operator",
- action: "mangotv://com.hunantv.operator/detail",
- data:"",
- extras: {
- media_assets_id: id,
- },
- flags: []
- };
- Webview.sendIntent("startActivity", playIntent);
- }
- function nowin(type){
- if(init.oursProduct_isVip==1||init.othersProduct_isVip==1){
- changeOrwin = type;
- if(type == "nowin"){
- G("unWinToyVipPopup").style.background = "url('./img/page_06.png') no-repeat center";
- }else{
- G("unWinToyVipPopup").style.background = "url('./img/page_08.png') no-repeat center";
- }
- S("unWinToyVipPopup");
- main.reSetClass("poster");
- }else{
- if(type == "nowin"){
- G("unWinToyPopup").style.background = "url('./img/page_05.png') no-repeat center";
- }else{
- G("unWinToyPopup").style.background = "url('./img/page_07.png') no-repeat center";
- }
- S("unWinToyPopup");
- main.reSetClass("unWinToyBtn");
- }
- }
- function closeRulesPopup(){
- try{
- smallvodPlay(videoId);
- }catch(e){
-
- }
- rulesPopup = false;
- H("rulesPopup");
- main.reSetClass("page_btn",1);
- }
- function order(idx){
- var pid = init.oursId;
- var mark = "mw_oursBag";
- // if(idx == 1){
- // pid = init.oursId;
- // mark = "mw_othersBag";
- // }
- var orderBack = backUrl+'?'+mark+'='+uid;
- if(version.indexOf("5a.7") || version.indexOf("5a.8")){
- var product_list={
- "product_id":pid,
- "video_name":"",
- "video_type":"",
- "product_type":"2",
- "cat_id":"",
- "channel_id":"",
- }
- window.location.href = "https://hnydorder.yys.mgtv.com:8080/order/index.html?product_list="+JSON.stringify(product_list)+"&exitStr="+escape(orderBack);
- }else{
- var playIntent = {
- package: "com.hunantv.operator",
- action: "mangotv://com.hunantv.operator/order",
- data: "",
- extras: {
- product: {
- "id": pid,
- "time": "",
- "price": "",
- "type": "",
- "name": "",
- "bag": "",
- "back_url":orderBack,
- }
- },
- flags: []
- };
- Webview.sendIntent("startActivity", playIntent);
- }
- }
- function prizelog(uid,act_id,fn) {
- juge();
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=prizelog",
- data: {
- uid: uid,
- act_id: act_id,
- is_vip: init.is_vip,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- fn && fn();
- }
- })
- }
- function prize(fn) {
- juge();
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=prize",
- data: {
- uid: uid,
- act_id: init.act_id,
- is_vip: init.is_vip,//is_vip1+is_vip2
- run: "complate",//'complate',
- is_test:1,
- },
- success: function (res) {
- fn && fn(res);
- },error:function(res){
- window.location.href = "../index.html";
- }
- })
- }
- function addData(fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=ThemeData&a=addData",
- data:{
- uid: uid,
- theme_id: init.theme_id,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function addUser(fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=DuduApi&a=addUser",
- data:{
- uid: uid,
- UserToken: usertoken
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function authorization(contentcode,uid,usertoken,mac,version,fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=order&a=contentCTCAuth",
- data:{
- contentcode:contentcode,
- uid:uid, //2.0
- usertoken:usertoken,
- mac:mac,
- version:version,
- fromsource:init.fromsource,
- },
- type: "post",
- dataType: "json",
- success: function (res) {
- fn && fn(res);
- },
- error: function (e) {
- fn && fn(e);
- }
- })
- }
- function payResult(is_vip,uid,product_id){
- if(is_vip == 1){
- ajax({
- url:webUrl+"index.php?m=Home&c=DuduApi&a=payResult",
- data:{
- uid: uid,
- product_id:product_id,
- pay_result:0
- },
- success: function (res) {
- },
- error: function () {
- }
- })
- }
- }
- function createQrcode(uid,url,fn){
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=createQrcode",
- data:{
- act_id:init.act_id,
- is_vip:0,
- uid: uid,
- url:url,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function (e) {
- fn && fn(e);
- }
- })
- }
- function getMengbaoList(uid,fn) {
- juge();
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=getMengbaoList",
- data:{
- act_id:init.act_id,
- uid: uid,
- is_vip: init.is_vip,
- limit:100,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function getVoteChance(uid,fn) {
- juge();
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=getVoteChance",
- data:{
- act_id:init.act_id,
- uid: uid,
- is_vip: init.is_vip,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function vote(uid,voteid,fn) {
- juge();
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=vote",
- data:{
- act_id:init.act_id,
- uid: uid,
- is_vip: init.is_vip,
- mengbao_id:voteid,
- score:1,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function getPrizeNum(uid,fn) {
- juge();
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=getPrizeNum",
- data:{
- act_id:init.act_id,
- uid: uid,
- is_vip: init.is_vip,
- test:1,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function fullscreenPlay(mid,idx) {
- idx = idx*1-1 || 0;
- var playIntent = {
- package : "com.hunantv.operator",
- action: "mangotv://com.hunantv.operator/player/vod",
- data:"",
- extras: {
- "video_index": idx,
- "media_asset_id": mid, //媒资包
- },
- flags: []
- };
- Webview.sendIntent("startActivity", playIntent);
- };
- function smallvodPlay(media_id,media_num){
- media_num = media_num || 0;
- stopPlay();
- try{
- starcorExt.setVideoWindowPosition("345", "179", "577", "323");
- var playIntent = {
- "video_type": "0",
- "media_asset_id": media_id,
- "video_index": media_num,
- };
- starcorExt.playVideo(playIntent);
- }catch(e){}
- };
- function stopPlay(){
- try{
- starcorExt.stopVideo();
- }catch(e){
- }
- }
- try{
- starcorExt.setHandler("Resume",function(isResumed){
- if(isResumed){//从全屏或设置键回来
- if(main.className == "page_btn"){
- smallvodPlay(videoId);
- }
- }
- });
- starcorExt.setHandler("PlayOnCompletion",function(isCompleted){
- if(isCompleted){//小视频播放结束
- smallvodPlay(videoId);
- }
- });
- }catch(e){
- }
- function cellphoneNum(){
- if(G("phone").innerHTML.length>10) return;
- var key = this.event.keyCode;
- try {
- if (key >= 0 && key <= 9) {
- G("phone").innerText += key;
- }
- } catch (e) {
- if (key > 47 && key < 58) {
- G("phone").innerText += (key - 48);
- }
- }
- }
- function times(){
- getVoteChance(uid,function(res){
- if(res.code==0){
- G("number").innerHTML = res.data.num;
- }
- });
- getPrizeNum(uid,function(res){
- if(res.code==0){
- init.gameNum = res.data.num>=0?res.data.num:0;
- G("num").innerHTML = res.data.num>=0?res.data.num:0;
- }
- })
- getMengbaoList(uid,function(res){
- if(res.code==0){
- var _html="",_li="",_span="";
- listM = res.data.length%4;
- var _len = res.data.length%4==0?res.data.length/4:parseInt(res.data.length/4)+1;
- for(var i=0;i<_len;i++){
- mengwaMediaArr.push(res.data[i].media_id);
- numArr.push(res.data[i].media_num);
- voteArr.push(res.data[i].mengbao_id);
- _li="";_span="";
- for(var j=0;j<4;j++){
- if(i*4+j<res.data.length){
- _li+= '<li class="voteLi"><div class="u_img voteBtn" data-media="'+res.data[i*4+j].media_id+'" data-num="'+res.data[i*4+j].media_num+'"><img src="'+res.data[i*4+j].image+'" alt="" /><i id="vote'+(i*4+j)+'">'+res.data[i*4+j].score+'</i></div><div class="u_msg">'+res.data[i*4+j].name+' '+res.data[i*4+j].age+'岁</div></li>';
- if(i==_len-1&&res.data.length%4!=0){
- _span += '<span class="voteBtn voteTxt" data-mark="'+(i*4+j)+'" data-key="1" data-mengbao="'+res.data[i*4+j].mengbao_id+'"><i>投你一票</i></span>';
- }else{
- _span += '<span class="voteBtn voteTxt" data-mark="'+(i*4+j)+'" data-mengbao="'+res.data[i*4+j].mengbao_id+'"><i>投你一票</i></span>';
- }
- }else if(i*4+j>=res.data.length&&(i*4+j)<res.data.length+(4-(res.data.length%4))){
- _li+= '<li class="voteLi" style="width: 239px;height: 200px;"></li>';
- _span += '<span class="blacktxt"><i></i></span>';
- }
- }
- _html += (_li + _span);
- }
- G("voteUl").innerHTML = _html;
- }
- })
- }
- function pageInit(){
- if(!getStr("mw_oursBag") && !getStr("mw_othersBag") && !getStr("for")){
- addUser();
- addData();
- }
- createQrcode(uid,link,function(res){
- if(res.code == 0){
- G("QRcode").src = res.data.qrcode;
- }
- })
-
- authorization(init.contentcode,uid,usertoken,mac,version,function(res){
- if(res.code == 0 && res.data.result==0){
- init.oursProduct_isVip = 1;
- addClass(G("othersProduct"),'hasOrder');
- if(!!getStr("mw_oursBag")){
- payResult(init.oursProduct_isVip,uid,init.oursId);
- };
- times();
- }else{
- init.oursProduct_isVip = 0;
- times();
- }
- },function(){
- times();
- });
- // if(!!getCookie("itemIdx") || !!getCookie("gameItemIdx")){
- // if(!!getCookie("itemIdx")){
- // G("unWinToyVipPopup").style.background = "url('./img/page_08.png') no-repeat center";
- // }else{
- // G("unWinToyVipPopup").style.background = "url('./img/page_06.png') no-repeat center";
- // }
- // var idx = (!!getCookie("mark"))?getCookie("mark")-4:0;
- // var h = document.getElementsByClassName("voteTxt")[0].offsetHeight+document.getElementsByClassName("voteLi")[0].offsetHeight+20
- // G("scrollCont").style.top = - 770-(parseInt(idx/4/2)*h) + "px";
- // S("unWinToyVipPopup");
- // pageConf.focusItem = "poster";
- // pageConf.focusIdx = getCookie("itemIdx");
- // setCookie("gameItemIdx","");
- // setCookie("itemIdx","");
- // }
- btnInit();
- }
- function juge(){
- if(init.othersProduct_isVip || init.oursProduct_isVip){
- init.is_vip = 1;
- }
- else if(init.othersProduct_isVip==0 && init.oursProduct_isVip==0){
- init.is_vip = 0;
- }
- }
- function btnInit(){
- if(!!getStr("for")){
- pageConf.focusItem = "ip_btn";
- pageConf.focusIdx = getStr("for");
- G("scrollCont").style.top = - 500 + "px";
- }
- if(pageConf.focusItem == "page_btn"){
- smallvodPlay(videoId);
- }
- var btnConfig = {
- className: pageConf.focusItem,
- currentIndex: pageConf.focusIdx,
- rules: data.rules,
- onBack:onBack,
- isFloatLast:true,
- }
- window.main = new tvSysBtnBind(btnConfig);
- main.reLoad();
- }
- pageInit();
- window.onunload = function(){
- stopPlay();
- }
- </script>
- </body>
- </html>
|