123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="page-view-size" content="1280*720" />
- <link rel="stylesheet" type="text/css" href="./css/page.css?v=201908"/>
- <title>移动-明侦盲盒活动</title>
- </head>
- <body>
- <div id="content">
- <div class="gameNum"><span id="times">0</span></div>
- <div class="pageLeft fl">
- <div class="myBox_btn"></div>
- </div>
- <ul id="boxUl" class="boxGroup fl">
- <li class="box box_1"></li>
- <li class="box box_2"></li>
- <li class="box box_3"></li>
- <li class="box box_4"></li>
- <li class="box box_5"></li>
- <li class="box box_6"></li>
- <li class="box box_7"></li>
- </ul>
- <div id="btnDiv" class="btnGroup fl">
- <div class="page_btn pb_1"></div>
- <div class="page_btn pb_2"></div>
- <div class="page_btn pb_3"></div>
- <div class="order_btn ob_1" id="oursP"></div>
- <div class="order_btn ob_2" id="othersP"></div>
- </div>
- <div id="rulesPopup" class="popup">
- <div class="rulesBtn"></div>
- </div>
- <div id="myBoxPopup" class="popup">
- <ul class="toyGroup">
- <li class="toyLi0"><img src="img/toy_bxk.png" height="133" width="117" alt=""/><span id="toy_0">0</span><i id="txt_0"></i></li>
- <li class="toyLi1"><img src="img/toy_dgw.png" height="133" width="117" alt=""/><span id="toy_1">0</span><i id="txt_1"></i></li>
- <li class="toyLi2"><img src="img/toy_hmn.png" height="133" width="117" alt=""/><span id="toy_2">0</span><i id="txt_2"></i></li>
- <li class="toyLi3"><img src="img/toy_lcd.png" height="133" width="117" alt=""/><span id="toy_3">0</span><i id="txt_3"></i></li>
- <li class="toyLi4"><img src="img/toy_stt.png" height="133" width="117" alt=""/><span id="toy_4">0</span><i id="txt_4"></i></li>
- <li class="toyLi5"><img src="img/toy_wgz.png" height="133" width="117" alt=""/><span id="toy_5">0</span><i id="txt_5"></i></li>
- <li class="toyLi6"><img src="img/toy_zys.png" height="133" width="117" alt=""/><span id="toy_6">0</span><i id="txt_6"></i></li>
- </ul>
- <div class="myBoxBtn"></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="unExchangePopup" class="popup">
- <div class="unExchangeBtn"></div>
- </div>
-
- <div id="winToyPopup" class="popup">
- <img id="toyImg" src="" height="264" width="172" alt="" />
- <div class="winToyBtn myBox"></div>
- <div class="winToyBtn confirm"></div>
- </div>
- <div id="unWinToyPopup" class="popup">
- <div id="oursProduct" class="unWinToyBtn"></div>
- <div id="othersProduct" 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"></div>
- </div>
- <!-- <div id="noChancePopup" class="popup">
- <div class="noChanceBtn"></div>
- </div>
- <div id="noChanceVipPopup" class="popup">
- <div class="noChanceVipBtn"></div>
- </div> -->
- <div id="CollectedSuccessPopup" class="popup">
- <div class="CollectedSuccessBtn"></div>
- </div>
- <div id="openBoxPopup" class="popup">
- <img id="bigPrize" src="" alt="" />
- <div class="openBoxBtn oBbtn_1"></div>
- <div class="openBoxBtn oBbtn_2"></div>
- </div>
- <div id="markDownPopup" class="popup">
- <div class="markDownBtn"></div>
- </div>
- <div id="runOutPopup" class="popup">
- <div class="runOutBtn"></div>
- </div>
- <div id="submittedPopup" class="popup">
- <div class="submittedBtn"></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?v=11" type="text/javascript"></script>
- <script src="js/api.js?v=11" type="text/javascript"></script>
- <script type="text/javascript">
- var pageConf = {
- focusIdx:1,
- focusItem:"box",
- }
- var click = true;
- var heguiItem = "box";
- var init = {
- prize:0,
- act_id:5,
- gameNum:0,
- canPrize:0,
- oursProduct_isVip:0,
- othersProduct_isVip:0,
- contentcode:"D00000001201808211755370019993899",//内容标识
- contentcode1:"D00000001201911281044560065291302"
- }
- var pageItem = ["box","myBox_btn","page_btn","order_btn"];
- // var popupItem = ["rulesBtn","myBoxBtn","unExchangeBtn","unExchangeBtn","exchangeBtn","phoneNum","markDownBtn","unWinToyBtn","unWinToyVipBtn","poster","winToyBtn"]
- var webUrl = '';
- try {
- Webview.setInputTypeTextFlag("true");
- webUrl = 'http://10.255.1.98:8090/DuduToy_v2/';
- } catch (e) {
- if (location.href.indexOf('10.255.1.98:8090') >= 0) {
- webUrl = 'http://10.255.1.98:8090/DuduToy_v2/';
- } else if (location.href.indexOf('10.200.10.28:28090') >= 0) {
- webUrl = 'http://10.200.10.28:28090/DuduToy_v2/';
- }
- }
- try{
- var uid = Webview.readSystemProp('user.id');
- var usertoken = Webview.readSystemProp('user.token');//令牌
- var mac = Webview.readSystemProp('device.mac');//机顶盒mac地址
- var version = Webview.readSystemProp('app.version');//APK版本号
- } catch(e) {
- var uid = getStr("uid") || '6830011';
- var usertoken = "00139025650832263889980824152950"
- var mac = 'OC-41-E9-DD-EC-DE'
- var version = "YYS.4.6.15.266.5.HNDX.0.0_Release"
- }
- var backUrl = webUrl+'h5v2/yd20191203/index.html';
- var data = new Object();
- data.rules = {
- box:{
- 0:[["myBox_btn",0],0,1,3],
- 1:[-1,0,1,3],
- 2:[-1,0,["page_btn",2],3],
- 3:[["myBox_btn",0],-3,1,0],
- 4:[-1,-3,1,0],
- 5:[-1,-3,1,0],
- 6:[-1,-4,0,0],
- "onEnterPress":openBox,
- onPress:function(){
- if((this.event.keyCode == 39 || this.event.keyCode == "RIGHT") && this.prevIndex == 6){
- if(init.othersProduct_isVip == 0){
- this.reSetClass("order_btn",0);
- }else if(init.othersProduct_isVip == 1 && init.oursProduct_isVip == 0){
- this.reSetClass("order_btn",1);
- }
- }
- },
- },
- myBox_btn:{
- line:1,
- right:["box"],
- onEnterPress:function(){
- heguiItem = "myBox_btn";
- myBoxGroup();
- }
- },
- page_btn:{
- line:1,
- left:["box",2],
- "onEnterPress":openPopups,
- onPress:function(){
- if((this.event.keyCode == 40 || this.event.keyCode == "DOWN")&& this.prevIndex == 2){
- if(init.othersProduct_isVip == 0){
- this.reSetClass("order_btn",0);
- }else if(init.othersProduct_isVip == 1 && init.oursProduct_isVip == 0){
- this.reSetClass("order_btn",1);
- }
- }
- },
- },
- order_btn:{
- 0:[["box",7],["page_btn",2],0,0],
- 1:[["box",7],0,0,0],
- onEnterPress:function(){
- order(this.currentIndex);
- },
- onPress:function(){
- if((this.event.keyCode == 40 || this.event.keyCode == "DOWN") && this.currentIndex == 0){
- if(init.oursProduct_isVip == 0){
- this.reSetClass("order_btn",1);
- }
- }else if((this.event.keyCode == 38 || this.event.keyCode == "UP")&& this.currentIndex == 1){
- if(init.othersProduct_isVip == 0){
- this.reSetClass("order_btn",0);
- }else{
- this.reSetClass("page_btn",2);
- }
- }
- },
- },
- rulesBtn:{
- line:1,
- onEnterPress:function(){
- H("rulesPopup");
- this.reSetClass("page_btn",1);
- },
- onBack:function(){
- H("rulesPopup");
- this.reSetClass("page_btn",1);
- },
- },
- myBoxBtn:{
- line:1,
- onEnterPress:function(){
- H("myBoxPopup");
- this.reSetClass(heguiItem);
- },
- onBack:function(){
- H("myBoxPopup");
- this.reSetClass(heguiItem);
- },
- },
- unExchangeBtn:{
- line:1,
- onEnterPress:function(){
- H("unExchangePopup");
- this.reSetClass("page_btn",2);
- },
- onBack:function(){
- H("unExchangePopup");
- this.reSetClass("page_btn",2);
- },
- },
- exchangeBtn:{
- // 0:[0,0,0,["phoneNum",0]],
- 0:[0,["phoneNum",6],1,0],
- 1:[-1,["phoneNum",8],0,0],
- "onEnterPress":exchangePopups,
- onPress:cellphoneNum,
- onBack:function(){
- H("exchangePopup");
- G("phone").innerHTML = "";
- this.reSetClass(heguiItem);
- },
- },
- phoneNum:{
- line:6,
- // up:["exchangeBtn",0],
- 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 = "";
- this.reSetClass(heguiItem);
- }
- },
- },
- markDownBtn:{
- line:1,
- onEnterPress:function(){
- H("markDownPopup");
- this.reSetClass("page_btn",2);
- },
- onBack:function(){
- H("markDownPopup");
- this.reSetClass("page_btn",2);
- },
- },
- runOutBtn:{
- line:1,
- onEnterPress:function(){
- H("runOutPopup");
- this.reSetClass(heguiItem);
- },
- onBack:function(){
- H("runOutPopup");
- this.reSetClass(heguiItem);
- },
- },
- unWinToyBtn:{
- 0:[0,0,0,2],
- 1:[0,0,0,1],
- 2:[0,0,0,0],
- onEnterPress:function(){
- if(this.currentIndex==2){
- H("unWinToyPopup");
- this.reSetClass("box");
- }else{
- order(this.currentIndex);
- }
- },
- onPress:function(){
- if(this.currentIndex == 0){
- if(this.event.keyCode == 39 || this.event.keyCode == "RIGHT"){
- if(init.oursProduct_isVip == 0){
- this.reSetClass("unWinToyBtn",1);
- }
- }
- }else if(this.currentIndex == 1){
- if(this.event.keyCode == 37 || this.event.keyCode == "LEFT"){
- if(init.othersProduct_isVip == 0){
- this.reSetClass("unWinToyBtn",0);
- }
- }
- }else if(this.currentIndex == 2){
- if(this.event.keyCode == 38 || this.event.keyCode == "UP"){
- if(init.othersProduct_isVip == 0){
- this.reSetClass("unWinToyBtn",0);
- }else if(init.oursProduct_isVip == 0){
- this.reSetClass("unWinToyBtn",1);
- }
- }
- }
- },
- onBack:function(){
- H("unWinToyPopup");
- this.reSetClass("box");
- },
- },
- unWinToyVipBtn:{
- line:1,
- up:["poster"],
- onEnterPress:function(){
- H("unWinToyVipPopup");
- this.reSetClass("box");
- },
- onBack:function(){
- H("unWinToyVipPopup");
- this.reSetClass("box");
- },
- },
- poster:{
- line:3,
- down:["unWinToyVipBtn"],
- onEnterPress:function(){
- var url = '',index=this.currentIndex;
- setCookie("videoIdx",index);
- if(index==0){
- fullscreenPlay("00000001000000000002000000120684")
- }else if(index==1){
- fullscreenPlay("00000001000000000014000000387305")
- }else if(index==2){
- fullscreenPlay("00000001000000000029000000278889")
- }
- window.location.href = url;
- },
- onBack:function(){
- H("unWinToyVipPopup");
- this.reSetClass("box");
- },
- },
- winToyBtn:{
- line:2,
- onEnterPress:function(){
- H("winToyPopup");
- if(this.currentIndex == 0){
- myBoxGroup();
- // S("myBoxPopup");
- // this.reSetClass("myBoxBtn");
- }else{
- this.reSetClass(heguiItem);
- }
- },
- onBack:function(){
- H("winToyPopup");
- this.reSetClass(heguiItem);
- },
- },
- CollectedSuccessBtn:{
- line:1,
- onEnterPress:function(){
- prize(uid,init.act_id,init.othersProduct_isVip+init.oursProduct_isVip,function(res){
- if (res.code == 0) {
- if(res.data.yes.prize_status == "real"){//中奖
- G("bigPrize").src = res.data.yes.prize_img;
- H("myBoxPopup");
- H("CollectedSuccessPopup");
- S("openBoxPopup");
- main.reSetClass("openBoxBtn");
- }else{
- S("runOutPopup");
- main.reSetClass("runOutBtn");
- }
- }else{
- tips(res.msg);
- }
- })
- },
- onBack:function(){
- H("myBoxPopup");
- H("CollectedSuccessPopup");
- this.reSetClass(heguiItem);
- },
- },
- openBoxBtn:{
- line:2,
- onEnterPress:function(){
- if(this.currentIndex == 0){
- userPrizelog(uid,init.act_id,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
- if(res.code == 0){
- if(res.data.my_prizes[0]){
- if(res.data.user_phone.phone_status !=1){
- G('myPrize').src = res.data.my_prizes[0].show_image;
- H("openBoxPopup");
- S("exchangePopup");
- main.reSetClass("phoneNum",0);
- }else{
- H("openBoxPopup");
- S("submittedPopup");
- main.reSetClass("submittedBtn");
- }
- }else{
- //未中奖
- }
- }else{
- tips(res.msg)
- }
- });
- }else{
- H("openBoxPopup");
- this.reSetClass(heguiItem);
- }
- },
- onBack:function(){
- H("openBoxPopup");
- this.reSetClass(heguiItem);
- },
- },
- submittedBtn:{
- line:1,
- onEnterPress:function(){
- H("submittedPopup");
- this.reSetClass(heguiItem);
- },
- onBack:function(){
- H("submittedPopup");
- this.reSetClass(heguiItem);
- },
- }
- }
- // var btnConfig = {
- // className: pageConf.focusItem,
- // currentIndex: pageConf.focusIdx,
- // rules: data.rules,
- // onBack:onBack,
- // }
- function order(idx){
- var product_id = "11187";
- var price = "125";
- var name = "少儿包";
- var bag = "se_bag";
- var mark = "oursBag";
- if(idx==1){
- product_id = "8801000077";
- price = "15";
- name = "影视包"
- bag = "ys_bag";
- mark = "othersBag";
- }
- var product_list={
- "product_id":product_id,
- "time":"30",
- "product_type":"1",
- "price":price,
- "button_name":name,
- "name":name,
- "bag":bag,
- "back_url":backUrl+'?'+mark+'='+uid,
- }
- window.location.href = "https://hnydorder.yys.mgtv.com:8080/v2.0_new/order/index.html?product_list="+JSON.stringify(product_list);
- }
- 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 openBox(){
- if(click){
- click = false;
- if(init.gameNum){
- if(init.othersProduct_isVip || init.oursProduct_isVip){
- G("unWinToyVipPopup").style.background = "url('./img/page_06.png') no-repeat center";
- }else{
- G("unWinToyPopup").style.background = "url('./img/page_05.png') no-repeat center";
- }
- goCollect(uid,init.act_id,init.othersProduct_isVip+init.oursProduct_isVip,function(res){
- if(res.code==0){
- init.gameNum -= 1;
- G("times").innerHTML = init.gameNum;
- if(res.data.collect_status=='yes'){
- G("toyImg").src=res.data.collect_list[0].collect_img;
- S("winToyPopup");
- heguiItem = "box";
- main.reSetClass("winToyBtn");
- }else{
- if(init.othersProduct_isVip || init.oursProduct_isVip){
- S("unWinToyVipPopup");
- main.reSetClass("unWinToyVipBtn");
- }else{
- S("unWinToyPopup");
- main.reSetClass("unWinToyBtn");
- }
- }
- }
- click = true;
- })
-
- }else{
- if(init.othersProduct_isVip || init.oursProduct_isVip){
- G("unWinToyVipPopup").style.background = "url('./img/page_08.png') no-repeat center";
- S("unWinToyVipPopup");
- this.reSetClass("poster");
- }else{
- G("unWinToyPopup").style.background = "url('./img/page_07.png') no-repeat center";
- S("unWinToyPopup");
- this.reSetClass("unWinToyBtn");
- }
- click = true;
- }
- }
- }
- function openPopups(){
- if(this.currentIndex==0){
- Webview.closeBrwoser("返回");//退出
- }else if(this.currentIndex==1){
- S("rulesPopup");
- this.reSetClass("rulesBtn");
- }else if(this.currentIndex==2){
- heguiItem = "page_btn";
- userPrizelog(uid,init.act_id,init.oursProduct_isVip+init.othersProduct_isVip,function(res){
- if(res.code == 0){
- if(res.data.my_prizes[0]){
- if(res.data.user_phone.phone_status !=1){
- G('myPrize').src = res.data.my_prizes[0].show_image;
- S("exchangePopup");
- main.reSetClass("phoneNum",0);
- }else{
- H("exchangePopup");
- S("submittedPopup");
- main.reSetClass("submittedBtn");
- }
- }else{
-
- }
- }else{
- myBoxGroup("mark");
- }
- });
- }
- }
- function myBoxGroup(mark){
- getUserCollects(uid,init.act_id,init.othersProduct_isVip+init.oursProduct_isVip,function(res){
- if(res.code == 0){
- for(var i=0;i<res.data.collect.length;i++){
- G("toy_"+i).innerHTML = res.data.collect[i].num;
- G("txt_"+i).innerHTML = res.data.collect[i].collect_name;
- }
- if(res.data.complate && res.data.complate[0].exchange_id>=1){
- init.canPrize = 1;
- if(!mark){
- S("myBoxPopup");
- }
- S("CollectedSuccessPopup");
- main.reSetClass("CollectedSuccessBtn");
- }else{
- if(mark){
- S("unExchangePopup");
- main.reSetClass("unExchangeBtn");
- }else{
- S("myBoxPopup");
- main.reSetClass("myBoxBtn");
- }
- }
- }else{
- if(!mark){
- S("myBoxPopup");
- main.reSetClass("myBoxBtn");
- }
- }
- })
- }
- function exchangePopups(){
- if(this.currentIndex==1){
- H("exchangePopup");
- G("phone").innerHTML = "";
- 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 cellphoneNum(){
- console.log(this.event.keyCode)
- 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 onBack(){
- if(pageItem.indexOf(main.className)>-1){
- // window.location.href = webUrl+"/h5v2/special/dx20191126/index.html"
- Webview.closeBrwoser("返回");
- }else{
- }
- }
- 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 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 addData(fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=ThemeData&addData&a=addData",
- data:{
- uid: uid,
- theme_id: 1
- },
- 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:4
- },
- type: "post",
- dataType: "json",
- success: function (res) {
- fn && fn(res);
- },
- error: function (e) {
- fn && fn(e);
- }
- })
- }
- //游戏次数
- function getPrizeNum(uid,act_id,is_vip,fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=getPrizeNum",
- data: {
- uid: uid,
- act_id: act_id,
- is_vip: is_vip//is_vip1+is_vip2
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- fn && fn();
- }
- })
- }
- function goCollect(uid,act_id,is_vip,fn) {//开盒抽卡
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=collect",
- data: {
- uid: uid,
- act_id: act_id,
- is_vip: is_vip,//is_vip1+is_vip2
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- fn && fn();
- }
- })
- }
- function getUserCollects(uid,act_id,is_vip,fn) {
- ajax({
- url:webUrl+"index.php?m=Home&c=Activityv2&a=getUserCollects",
- data: {
- uid: uid,
- act_id: act_id,
- is_vip: is_vip//is_vip1+is_vip2
- },
- success: function (res) {
- fn && fn(res);
- },
- error: function () {
- fn && fn();
- }
- })
- }
- function prize(uid,act_id,is_vip,fn) {
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=prize",
- data: {
- uid: uid,
- act_id: act_id,
- is_vip: is_vip,//is_vip1+is_vip2
- run: 'complate',
- },
- success: function (res) {
- fn && fn(res);
- }
- })
- }
- 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 pageInit(){
- if(!getStr("oursBag") && !getStr("othersBag") && !getStr("for")){
- addUser();
- addData();
- }
-
- authorization(init.contentcode,uid,usertoken,mac,version,function(res){
- if(res.code == 0){
- if(res.data.result==0){
- init.oursProduct_isVip = 1;
- addClass(G("oursP"),'hasOrder');
- addClass(G("oursProduct"),'hasOrder');
- if(!!getStr("oursBag")){
- payResult(init.oursProduct_isVip,uid,"11187");
- }
- }else{
- init.oursProduct_isVip = 0;
- if(!!getStr("oursBag")){
- pageConf.focusItem = "order_btn";
- pageConf.focusIdx = 1;
- }
- }
- authorization(init.contentcode1,uid,usertoken,mac,version,function(res){
- if(res.code == 0){
- if(res.data.result==0){
- init.othersProduct_isVip = 1;
- addClass(G("othersP"),'hasOrder');
- addClass(G("othersProduct"),'hasOrder');
- if(!!getStr("othersBag")){
- payResult(init.othersProduct_isVip,uid,"10664")
- }
- }else{
- othersProduct_isVip = 0;
- if(!!getStr("othersBag")){
- pageConf.focusItem = "order_btn";
- pageConf.focusIdx = 0;
- }
- }
- var vv = init.oursProduct_isVip+init.othersProduct_isVip;
-
- getPrizeNum(uid,init.act_id,vv,function(res){
- if(res.code == 0){
- init.gameNum = res.data;
- G("times").innerHTML = res.data;
- if(!!getCookie("videoIdx")){
- if(res.data == 0){
- 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";
- }
- S("unWinToyVipPopup");
- pageConf.focusItem = "poster";
- pageConf.focusIdx = getCookie("videoIdx");
- setCookie("videoIdx","");
- }
- btnInit();
- }else{
- btnInit();
- }
- })
- // var btnConfig = {
- // className: pageConf.focusItem,
- // currentIndex: pageConf.focusIdx,
- // rules: data.rules,
- // onBack:onBack,
- // }
- // window.main = new tvSysBtnBind(btnConfig);
- // main.reLoad();
-
- }
- else{
- btnInit();
- }
- });
- }else{
- btnInit();
- }
-
- });
- }
- function btnInit(){
- var btnConfig = {
- className: pageConf.focusItem,
- currentIndex: pageConf.focusIdx,
- rules: data.rules,
- onBack:onBack,
- }
- window.main = new tvSysBtnBind(btnConfig);
- main.reLoad();
- }
- function G(id){
- return document.getElementById(id)
- }
- function S(id){
- G(id).style.visibility = "visible";
- }
- function H(id){
- G(id).style.visibility = "hidden";
- }
- pageInit();
- </script>
- </body>
- </html>
|