12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196 |
- <!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;
- // tips(mengwaMediaArr[idx]+"++++++++"+numArr[idx],6000);
- fullscreenPlay(mengwaMediaArr[idx],numArr[idx]);
- }else{
- vote(uid,voteArr[this.currentIndex-4],function(res){
- if(res.code == 0){
- G("number").innerHTML = res.data.num;
- G("vote"+(main.currentIndex-4)).innerHTML = G("vote"+(main.currentIndex-4)).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(idx){
- var exitStr = escape(backUrl);
- var url = '';
- if(index==0){
- fullscreenPlay("00000001000000000002000000120684")
- }else if(index==1){
- fullscreenPlay("00000001000000000014000000387305")
- }else if(index==2){
- fullscreenPlay("00000001000000000029000000278889")
- }
- // 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 || 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"><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="1" data-key="1"><i>投你一票</i></span>';
- }else{
- _span += '<span class="voteBtn voteTxt" data-mark="1"><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.isYearVip){
- init.is_vip = 2;
- }
- else if(init.othersProduct_isVip || init.oursProduct_isVip || init.allProduce_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>
|