1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081 |
- <!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="" /> -->
- <p id="ptizeName"></p>
- <div class="prizeBtn cancel"></div>
- <div class="prizeBtn toExchange"></div>
- </div>
- <div id="exchangePopup" class="popup">
- <!-- <img id="myPrize" src="" alt="" /> -->
- <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"></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 = {
- 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/index.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 pageConf = {
- focusIdx:3,
- focusItem:"page_btn",
- }
- 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,0],
- 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,init.othersProduct_isVip+init.oursProduct_isVip,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,init.othersProduct_isVip+init.oursProduct_isVip,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]);
- order();
- },
- 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(){
- vote(uid,init.oursProduct_isVip+init.othersProduct_isVip,voteArr[this.currentIndex],function(res){
- if(res.code == 0){
- G("number").innerHTML = res.data.num;
- G("vote"+main.currentIndex).innerHTML = G("vote"+main.currentIndex).innerHTML*1+1;
- tips("投票成功");
- if(init.gameNum>0){
- S("lotteryPopup");
- main.reSetClass("lottery_btn",0);
- }
- }else if(res.code == "-1"){
- tips("您的票已用完");
- }
- })
- },
- onPress:function(){
- G("scrollCont").style.top = - 780-(parseInt(this.currentIndex/4)*268) + "px";
- errorMark = true;
- },
- onBack:function(){
- H("lotteryPopup");
- this.reSetClass("voteBtn");
- }
- },
- 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;
- 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,0,0,1],
- 2:[0,0,0,0],
- onEnterPress:function(){
- if(this.currentIndex==2){
- 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");
- this.reSetClass("voteBtn");
- }
- },
- onBack:function(){
- setCookie("gameItemIdx","");
- setCookie("itemIdx","");
- H("unWinToyVipPopup");
- this.reSetClass("voteBtn");
- },
- },
- 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(){
- setCookie("gameItemIdx","");
- setCookie("itemIdx","");
- window.location.href = "../index.html";
- },
- },
- }
- function onBack(){
- if(rulesPopup){
- closeRulesPopup();
- }else{
- stopPlay();
- window.location.href = indexUrl;
- }
- }
- function userPrizelog(uid,act_id,is_vip,fn) {
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=userPrizelog",
- data: {
- uid: uid,
- act_id: act_id,
- is_vip: 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{
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=setUserInfo",
- data: {
- uid: uid,
- act_id: init.act_id,
- is_vip: init.oursProduct_isVip+init.othersProduct_isVip,
- 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(idx==0){
- url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1991&exitStr=' + exitStr;
- }else if(idx==1){
- url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1956&exitStr=' + exitStr;
- }else if(idx==2){
- url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1467&exitStr=' + exitStr;
- }
- 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",2);
- }
- }
- 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,is_vip,fn) {
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=prizelog",
- data: {
- uid: uid,
- act_id: act_id,
- is_vip: is_vip,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- fn && fn();
- }
- })
- }
- function prize(fn) {
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=prize",
- data: {
- uid: uid,
- act_id: init.act_id,
- is_vip: init.oursProduct_isVip+init.othersProduct_isVip,//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,is_vip,fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=getMengbaoList",
- data:{
- act_id:init.act_id,
- uid: uid,
- is_vip: is_vip,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function getVoteChance(uid,is_vip,fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=getVoteChance",
- data:{
- act_id:init.act_id,
- uid: uid,
- is_vip: is_vip,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function vote(uid,is_vip,voteid,fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=vote",
- data:{
- act_id:init.act_id,
- uid: uid,
- is_vip: is_vip,
- mengbao_id:voteid,
- score:1,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function getPrizeNum(uid,is_vip,fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=getPrizeNum",
- data:{
- act_id:init.act_id,
- uid: uid,
- is_vip: is_vip,
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- }
- })
- }
- function fullscreenPlay(mid) {
- var playIntent = {
- package : "com.hunantv.operator",
- action: "mangotv://com.hunantv.operator/player/vod",
- data:"",
- extras: {
- "video_index": 0,
- "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){//从全屏或设置键回来
- 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 {
- Webview.setInputTypeTextFlag("true");
- 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,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
- if(res.code==0){
- G("number").innerHTML = res.data.num;
- }
- });
- getPrizeNum(uid,init.oursProduct_isVip+init.othersProduct_isVip,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,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
- if(res.code==0){
- var _html="";
- for(var i=0;i<res.data.length;i++){
- mengwaMediaArr.push(res.data[i].media_id);
- voteArr.push(res.data[i].mengbao_id);
- _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+' '+res.data[i].age+'</div><span class="voteBtn">投你一票</span></li>'
- }
- 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();
- });
- btnInit();
- if(main.className == "page_btn"){
- smallvodPlay(videoId);
- }
- }
- function btnInit(){
- var btnConfig = {
- className: pageConf.focusItem,
- currentIndex: pageConf.focusIdx,
- rules: data.rules,
- onBack:onBack,
- isFloatLast:true,
- }
- window.main = new tvSysBtnBind(btnConfig);
- main.reLoad();
- }
- btnInit();
- pageInit();
- window.onunload = function(){
- stopPlay();
- }
- </script>
- </body>
- </html>
|