Wang 5 lat temu
rodzic
commit
bfbf202342
1 zmienionych plików z 36 dodań i 26 usunięć
  1. 36 26
      h5v2/yd20191203/index.html

+ 36 - 26
h5v2/yd20191203/index.html

@@ -197,9 +197,9 @@
                     "onEnterPress":openPopups,
                     onPress:function(){
                         if((this.event.keyCode == 40 || this.event.keyCode == "DOWN")&& this.prevIndex == 2){
-                            if(init.othersProduct_isVip == 0){
+                            if(init.oursProduct_isVip == 0){
                                 this.reSetClass("order_btn",0);
-                            }else if(init.othersProduct_isVip == 1 && init.oursProduct_isVip == 0){
+                            }else if(init.othersProduct_isVip == 0 && init.oursProduct_isVip == 1){
                                 this.reSetClass("order_btn",1);
                             }
                         }
@@ -213,11 +213,11 @@
                     },
                     onPress:function(){
                         if((this.event.keyCode == 40 || this.event.keyCode == "DOWN") && this.currentIndex == 0){
-                            if(init.oursProduct_isVip == 0){
+                            if(init.othersProduct_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){
+                            if(init.oursProduct_isVip == 0){
                                 this.reSetClass("order_btn",0);
                             }else{
                                 this.reSetClass("page_btn",2);
@@ -331,7 +331,7 @@
                             H("unWinToyPopup");
                             this.reSetClass("box");
                         }else{
-                            setCookie("unWinToy","unWinToyPopup");
+                            setCookie("unWinToy",this.currentIndex);
                             order(this.currentIndex);
                         }
                     },
@@ -368,10 +368,12 @@
                     line:1,
                     up:["poster"],
                     onEnterPress:function(){
+                        setCookie("itemIdx","");
                         H("unWinToyVipPopup");
                         this.reSetClass("box");
                     }, 
                     onBack:function(){
+                        setCookie("itemIdx","");
                         H("unWinToyVipPopup");
                         this.reSetClass("box");
                     },
@@ -381,7 +383,7 @@
                     down:["unWinToyVipBtn"],
                     onEnterPress:function(){
                         var url = '',index=this.currentIndex;
-                        setCookie("videoIdx",index);
+                        setCookie("itemIdx",index);
                         if(index==0){
                             fullscreenPlay("00000001000000000002000000120684")
                         }else if(index==1){
@@ -391,6 +393,7 @@
                         }
                     }, 
                     onBack:function(){
+                        setCookie("itemIdx","");
                         H("unWinToyVipPopup");
                         this.reSetClass("box");
                     },
@@ -567,6 +570,7 @@
                                     main.reSetClass("winToyBtn");
                                 }else{
                                     if(init.othersProduct_isVip || init.oursProduct_isVip){
+                                        setCookie("item","chance");
                                         S("unWinToyVipPopup");
                                         main.reSetClass("unWinToyVipBtn");
                                     }else{
@@ -581,9 +585,11 @@
                     }else{
                         if(init.othersProduct_isVip || init.oursProduct_isVip){
                             G("unWinToyVipPopup").style.background = "url('./img/page_08.png') no-repeat center";
+                            setCookie("item","");
                             S("unWinToyVipPopup");
                             this.reSetClass("poster");
                         }else{
+                            setCookie("item",'fromOrder0');
                             G("unWinToyPopup").style.background = "url('./img/page_07.png') no-repeat center";
                             S("unWinToyPopup");
                             this.reSetClass("unWinToyBtn");
@@ -883,6 +889,24 @@
                 })
             }
 
+            function markOrder(){
+                if(!!getCookie("unWinToy")){
+                    if(getCookie("item") == 'fromOrder0'){
+                        G("unWinToyPopup").style.background = "url('./img/page_07.png') no-repeat center";
+                    }else{
+                        G("unWinToyPopup").style.background = "url('./img/page_05.png') no-repeat center";
+                    }
+                    S("unWinToyPopup");
+                    pageConf.focusItem = "unWinToyBtn";
+                    pageConf.focusIdx = getCookie("unWinToy");
+                    setCookie("unWinToy","")
+                    setCookie("item",'');
+                }else{
+                    pageConf.focusItem = "order_btn";
+                    pageConf.focusIdx = getCookie("unWinToy");
+                }
+            }
+
             function pageInit(){
                 if(!getStr("oursBag") && !getStr("othersBag") && !getStr("for")){
                     addUser();
@@ -901,14 +925,7 @@
                         }else{
                             init.oursProduct_isVip = 0;
                             if(!!getStr("oursBag")){
-                                if(!!getCookie("unWinToy")){
-                                    pageConf.focusItem = "unWinToyBtn";
-                                    S("unWinToyPopup")
-                                    setCookie("unWinToy",'');
-                                }else{
-                                    pageConf.focusItem = "order_btn";
-                                }
-                                pageConf.focusIdx = 0;
+                                markOrder();
                             }
                         }
                         authorization(init.contentcode1,uid,usertoken,mac,version,function(res){
@@ -923,14 +940,7 @@
                                 }else{
                                     othersProduct_isVip = 0;
                                     if(!!getStr("othersBag")){
-                                        if(!!getCookie("unWinToy")){
-                                            pageConf.focusItem = "unWinToyBtn";
-                                            S("unWinToyPopup")
-                                            setCookie("unWinToy",'');
-                                        }else{
-                                            pageConf.focusItem = "order_btn";
-                                        }
-                                        pageConf.focusIdx = 1;
+                                        markOrder();
                                     }
                                 }
                                 var vv = init.oursProduct_isVip+init.othersProduct_isVip;
@@ -939,16 +949,16 @@
                                     if(res.code == 0){
                                         init.gameNum = res.data;  
                                         G("times").innerHTML = res.data; 
-                                        if(!!getCookie("videoIdx")){
-                                            if(res.data == 0){
+                                        if(!!getCookie("itemIdx")){
+                                            if(getCookie("item") == 'chance'){
                                                 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","");
+                                            pageConf.focusIdx = getCookie("itemIdx");
+                                            
                                         }
                                         btnInit();
                                     }else{