Browse Source

debug by hah

Wang 5 years ago
parent
commit
2f1ccde94e

+ 30 - 12
h5v2/yd20191203/css/page.css

@@ -1,8 +1,8 @@
 /* 
 * @Author: Wang
-* @Date:   2019-11-26 16:53:40
+* @Date:   2019-12-03 16:53:40
 * @Last Modified by:   Marte
-* @Last Modified time: 2019-12-03 17:49:44
+* @Last Modified time: 2019-12-04 12:07:17
 */
 html, body, ul, li, p, h1, h2, h3, h4, h5, h6, form, img { margin:0; padding:0; }
 img,input,button { border:none; padding:0;margin:0;outline-style:none; }
@@ -115,7 +115,7 @@ body{
     background: url('../img/btn_mh_def.png') no-repeat center;
     position: absolute;
     bottom: 0;
-    left: 14px;
+    left: 0;
 }
 
 .pageLeft .current{
@@ -128,7 +128,7 @@ body{
     height: 91px;
     position: absolute;
     top: 26px;
-    left: 8px;
+    left: -10px;
 }
 .btnGroup .pb_1{
     background: url('../img/btn_fh_def.png') no-repeat center;
@@ -155,7 +155,7 @@ body{
     background: url('../img/btn_dh_sel.png') no-repeat center;
 }
 
-.btnGroup .order_btn,#othersProduct{
+.btnGroup .order_btn,#othersProduct,#oursProduct{
     width: 220px;
     height: 150px;
 }
@@ -163,18 +163,32 @@ body{
 .btnGroup .order_btn{
     position: absolute;
     bottom: 0;
-    left: 16px;
+    left: 0;
 }
 
-.btnGroup .ob_1,#othersProduct{
-    background: url('../img/btn_ysb_def.png') no-repeat center;
+.btnGroup .ob_1,#oursProduct{
+    background: url('../img/btn_seb_def.png') no-repeat center;
+}
+
+.btnGroup .ob_1{
+    bottom:146px;
+}
+.btnGroup .ob_1.current,#oursProduct.current{
+    background: url('../img/btn_seb_sel.png') no-repeat center;
 }
 
-.btnGroup .ob_1.current,#othersProduct.current{
+
+.btnGroup .ob_2,#othersProduct{
+    background: url('../img/btn_ysb_def.png') no-repeat center;
+}
+.btnGroup .ob_2.current,#othersProduct.current{
     background: url('../img/btn_ysb_sel.png') no-repeat center;
 }
 
-.btnGroup .ob_1.hasOrder,#othersProduct.hasOrder{
+.btnGroup .ob_1.hasOrder,#oursProduct.hasOrder{
+    background: url('../img/btn_seb_hasOrder.png') no-repeat center;
+}
+.btnGroup .ob_2.hasOrder,#othersProduct.hasOrder{
     background: url('../img/btn_ysb_hasOrder.png') no-repeat center;
 }
 
@@ -309,10 +323,14 @@ body{
     font-size: 18px;
 }
 
-#othersProduct{
+#othersProduct,#oursProduct{
     position: absolute;
     top: 354px;
-    left: 524px;
+    left: 400px;
+}
+
+#othersProduct{
+    left: 680px;
 }
 
 #unWinToyPopup .confirm{

BIN
h5v2/yd20191203/img/baixiake.png


BIN
h5v2/yd20191203/img/btn_seb_def.png


BIN
h5v2/yd20191203/img/btn_seb_hasOrder.png


BIN
h5v2/yd20191203/img/btn_seb_sel.png


BIN
h5v2/yd20191203/img/content0.jpg


BIN
h5v2/yd20191203/img/content1.jpg


BIN
h5v2/yd20191203/img/content2.jpg


BIN
h5v2/yd20191203/img/page_06.png


BIN
h5v2/yd20191203/img/page_08.png


+ 197 - 64
h5v2/yd20191203/index.html

@@ -3,8 +3,8 @@
     <head>
         <meta charset="utf-8">
         <meta name="page-view-size" content="1280*720" />
-        <link rel="stylesheet" type="text/css" href="./css/page.css?v=201906"/>
-        <title>明侦盲盒活动</title>
+        <link rel="stylesheet" type="text/css" href="./css/page.css?v=201908"/>
+        <title>移动-明侦盲盒活动</title>
     </head>
     <body>
         <div id="content">
@@ -26,7 +26,8 @@
                 <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="othersP"></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">
@@ -76,6 +77,7 @@
                 <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>
@@ -135,6 +137,7 @@
                 act_id:5,
                 gameNum:0,
                 canPrize:0,
+                oursProduct_isVip:0,
                 othersProduct_isVip:0,
                 contentcode:"D00000001201808211755370019993899",//内容标识
                 contentcode1:"D00000001201911281044560065291302"
@@ -143,7 +146,17 @@
             var pageItem = ["box","myBox_btn","page_btn","order_btn"];
             // var popupItem = ["rulesBtn","myBoxBtn","unExchangeBtn","unExchangeBtn","exchangeBtn","phoneNum","markDownBtn","unWinToyBtn","unWinToyVipBtn","poster","winToyBtn"]
 
-            var webUrl = 'http://111.23.13.123:8090/';
+            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');
@@ -151,7 +164,7 @@
                 var mac = Webview.readSystemProp('device.mac');//机顶盒mac地址
                 var version = Webview.readSystemProp('app.version');//APK版本号
             } catch(e) {
-                var uid = getStr("uid") || '6830027';
+                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"
@@ -171,9 +184,11 @@
                     6:[-1,-4,0,0],
                     "onEnterPress":openBox,
                     onPress:function(){
-                        if((this.event.keyCode == 39 || this.event.keyCode == "RIGHT") && this.currentIndex == 6){
+                        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);
                             }
                         }
                     },
@@ -194,16 +209,30 @@
                         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:{
-                    line:1,
-                    up:["page_btn"],
-                    left:["box",6],
+                    0:[["box",7],["page_btn",2],0,0],
+                    1:[["box",7],0,0,0],
                     onEnterPress:function(){
-                        order();
+                        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:{
@@ -305,14 +334,39 @@
                     },
                 },
                 unWinToyBtn:{
-                    0:[0,0,0,1],
-                    1:[0,-1,0,0],
+                    0:[0,0,0,2],
+                    1:[0,0,0,1],
+                    2:[0,0,0,0],
                     onEnterPress:function(){
-                        if(this.currentIndex==1){
+                        if(this.currentIndex==2){
                             H("unWinToyPopup");
                             this.reSetClass("box");
                         }else{
-                            order();
+                            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(){
@@ -337,13 +391,13 @@
                     down:["unWinToyVipBtn"],
                     onEnterPress:function(){
                         var url = '',index=this.currentIndex;
-                        backUrl = backUrl+'?for=poster'+index;
+                        setCookie("videoIdx",index);
                         if(index==0){
-                            url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1991&exitStr=' + escape(backUrl);
+                            fullscreenPlay("00000001000000000002000000120684")
                         }else if(index==1){
-                            url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1956&exitStr=' + escape(backUrl);
+                            fullscreenPlay("00000001000000000014000000387305")
                         }else if(index==2){
-                            url = 'http://10.255.0.219/en/pandian2018/index.html?activityId=1467&exitStr=' + escape(backUrl);
+                            fullscreenPlay("00000001000000000029000000278889")
                         }
                         window.location.href = url;
                     }, 
@@ -372,7 +426,7 @@
                 CollectedSuccessBtn:{
                     line:1,
                     onEnterPress:function(){
-                        prize(uid,init.act_id,init.othersProduct_isVip,function(res){
+                        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;
@@ -399,7 +453,7 @@
                     line:2,
                     onEnterPress:function(){
                         if(this.currentIndex == 0){
-                            userPrizelog(uid,init.act_id,init.othersProduct_isVip,function(res){
+                            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){
@@ -439,47 +493,67 @@
                         H("submittedPopup");
                         this.reSetClass(heguiItem);
                     },
-
                 }
             }
 
-            if(!!getCookie("jumpToPay")){
-                pageConf.focusItem = "order_btn";
-                pageConf.focusIdx = getCookie("jumpToPay");
-            }
-
-            var btnConfig = {
-                className: pageConf.focusItem,
-                currentIndex: pageConf.focusIdx,
-                rules: data.rules,
-                onBack:onBack,
-            }
-
-            function order(){
+            // 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":"8801000077",
+                    "product_id":product_id,
                     "time":"30",
                     "product_type":"1",
-                    "price":"29.9",
-                    "button_name":"影视包",
-                    "name":"影视包",
-                    "bag":"ys_bag",
+                    "price":price,
+                    "button_name":name,
+                    "name":name,
+                    "bag":bag,
                     "back_url":backUrl+'?'+mark+'='+uid,
                 }
-                setCookie("jumpToPay",0);
-                window.location.href = "http://10.255.0.219/en/jump_order/index.html?product_list="+JSON.stringify(product_list);  
+                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){
+                        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,function(res){
+                        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;
@@ -489,7 +563,7 @@
                                     heguiItem = "box";
                                     main.reSetClass("winToyBtn");
                                 }else{
-                                    if(init.othersProduct_isVip){
+                                    if(init.othersProduct_isVip || init.oursProduct_isVip){
                                         S("unWinToyVipPopup");
                                         main.reSetClass("unWinToyVipBtn");
                                     }else{
@@ -502,7 +576,7 @@
                         })
                         
                     }else{
-                        if(init.othersProduct_isVip){
+                        if(init.othersProduct_isVip || init.oursProduct_isVip){
                             G("unWinToyVipPopup").style.background = "url('./img/page_08.png') no-repeat center";
                             S("unWinToyVipPopup");
                             this.reSetClass("poster");
@@ -524,7 +598,7 @@
                     this.reSetClass("rulesBtn");
                 }else if(this.currentIndex==2){
                     heguiItem = "page_btn";
-                    userPrizelog(uid,init.act_id,init.othersProduct_isVip,function(res){
+                    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){
@@ -548,7 +622,7 @@
             }
 
             function myBoxGroup(mark){
-                getUserCollects(uid,init.act_id,init.othersProduct_isVip,function(res){
+                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;
@@ -595,7 +669,7 @@
                             data: {
                                 uid: uid,
                                 act_id: init.act_id,
-                                is_vip: init.othersProduct_isVip,
+                                is_vip: init.oursProduct_isVip+init.othersProduct_isVip,
                                 phone: phone
                             },
                             success: function (res) {
@@ -633,7 +707,7 @@
             function onBack(){
                 if(pageItem.indexOf(main.className)>-1){
                     // window.location.href = webUrl+"/h5v2/special/dx20191126/index.html"
-                    Webview.closeBrwoser("返回");   
+                    Webview.closeBrwoser("返回");  
                 }else{
 
                 }
@@ -813,31 +887,90 @@
                     addData();
                 }
                 
-                authorization(init.contentcode1,uid,usertoken,mac,version,function(res){
+                authorization(init.contentcode,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") || (getCookie("jumpToPay")).toString()=="0"){
-                                payResult(init.othersProduct_isVip,uid,"10664")   
+                            init.oursProduct_isVip = 1;
+                            addClass(G("oursP"),'hasOrder');
+                            addClass(G("oursProduct"),'hasOrder');
+                            if(!!getStr("oursBag")){
+                                payResult(init.oursProduct_isVip,uid,"11187");
                             }
                         }else{
-                            othersProduct_isVip = 0;
+                            init.oursProduct_isVip = 0;
+                            if(!!getStr("oursBag")){
+                                pageConf.focusItem = "order_btn";
+                                pageConf.focusIdx = 1;
+                            }
                         }
-                        
-                        getPrizeNum(uid,init.act_id,init.othersProduct_isVip,function(res){
+                        authorization(init.contentcode1,uid,usertoken,mac,version,function(res){
                             if(res.code == 0){
-                                init.gameNum = res.data;  
-                                G("times").innerHTML = res.data; 
+                                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();
                     }
-                    window.main = new tvSysBtnBind(btnConfig);
-                    main.reLoad();
                     
                 });
-                setCookie("jumpToPay","");
+            }
+
+            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){