Wang 5 년 전
부모
커밋
0bbf00b83a

+ 3 - 3
h5v2/mw_20200108_act/css/page1.css

@@ -2,7 +2,7 @@
 * @Author: Marte
 * @Date:   2020-01-14 09:57:52
 * @Last Modified by:   Marte
-* @Last Modified time: 2020-01-19 16:33:36
+* @Last Modified time: 2020-01-19 21:33:56
 */
 html, body, ul, li, p, img { margin:0; padding:0; }
 ul, ol { list-style:none; }
@@ -125,7 +125,7 @@ body{
 
 .pg4{
 
-    left: 320px;
+left: 480px;
 }
 
 #product1,#product2{
@@ -155,7 +155,7 @@ body{
     left: 650px;
 }
 .pg5,#product2{
-    background: url("../img/btn_miniBag_def.png") no-repeat center;
+    /* background: url("../img/btn_miniBag_def.png") no-repeat center; */
 }
 
 .pg5.current,#product2.current{

BIN
h5v2/mw_20200108_act/img/btn_bigBag_def.png


BIN
h5v2/mw_20200108_act/img/btn_bigBag_hasOrder.png


BIN
h5v2/mw_20200108_act/img/btn_bigBag_sel.png


+ 7 - 2
h5v2/mw_20200108_act/index.html

@@ -57,7 +57,7 @@
                 gameNum:0,
                 theme_id:2,
                 fromsource:15,
-                oursId:"8801000079",
+                oursId:"8801000638",//"8801000079",
                 othersId:"8801000646",//不用
                 oursProduct_isVip:0,
                 othersProduct_isVip:0,
@@ -139,7 +139,12 @@
                 ip_btn:{
                     line:6,
                     onEnterPress:function(){
-                        details_page(videoArr[this.currentIndex])
+                        // if(this.currentIndex == 5){
+                        //     order(0)
+                        // }else{
+                            details_page(videoArr[this.currentIndex])
+                            
+                        // }
                         // mylib.goToDetailsOrPlay(videoArr[this.currentIndex]);
                         // if(init.oursProduct_isVip == 1){
                         //     fullscreenPlay(videoArr[this.currentIndex]);

+ 123 - 174
h5v2/mw_20200108_act/index1.html

@@ -9,17 +9,17 @@
     <body>
         <div class="main">
             <div id="scrollCont">
-               <!--  <div class="code">
+                <div class="code">
                     <img id="QRcode" src="" alt="" />
                     <span>扫码上转萌娃贺岁视频</span>
                     <span>拼人气赢大奖</span>
-                </div> -->
+                </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="page_btn pg5" id="oursProduct"></div> -->
                 <div class="prizeNum">抽奖机会:<span id="num"></span></div>
 
                 <ul class="list" id="ipUl">
@@ -113,63 +113,54 @@
         <script src="./js/tvSysBtnBind.v2.js" type="text/javascript"></script>
         <script src="./js/comm.js" type="text/javascript"></script>
         <script type="text/javascript">
-            try {
+           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');
-                webUrl = 'http://10.255.1.98:8090/DuduToy_v2/';
             } catch (e) {
-                var uid = getStr("uid") || '6830011';
+                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"
-                if (location.href.indexOf('10.255.1.98:8090') >= 0) {
-                    webUrl = 'http://10.255.1.98:8090/DuduToy_v2/';
-                } else {
-                    webUrl = 'http://10.200.10.28:28090/DuduToy_v2/';
-                }
             }
 
 
             var init = {
-                act_id:8,
+                act_id:2,
                 gameNum:0,
-                theme_id:4,
-                fromsource:4,
-                oursId:"11187",
-                othersId:"500007",//"3651",
+                theme_id:2,
+                fromsource:15,
+                oursId:"8801000638",//"8801000079",
+                othersId:"8801000646",//不用
                 oursProduct_isVip:0,
                 othersProduct_isVip:0,
-                contentcode:"D00000001201808211755370019993899",
-                contentcode1:"D00000001201905291020410009898494",
+                contentcode:"00000001000000000018000000431421",//少儿月包 00000001000000000025000000024157
+                // contentcode1:"D00000001201905291020410009898494",
             }
 
-            var backUrl = webUrl+'h5v2/activity/mw_20200108_act/index.html';
-            var indexUrl = webUrl+'h5v2/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 = "5e17fb792bd3ea2f150093412b2ff949";
-            var videoArr = ["5bad90c33abf28bd044f94ab5a5c1480","5e048e862deef11139c2d7a44b17e255","5d5587243774e3b6b5505992040d859e","5db010fb39de445723026d4c28603884","5d7223d86a8e57d624f235d5ed9e6eb1","5c09f38e1fa572d3eb673900007a07a7"]
-            var mengwaMediaArr = [],voteArr = [];
+            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 heguiItem = "";
-            var changeOrwin = "";
-            var errorMark = false;
             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],
+                    2:[1,-1,0,0],
                     3:[0,-1,-1,0],
                     4:[0,-1,0,["ip_btn",2]],
-                    5:[0,-2,0,["ip_btn",3]],
                     onEnterPress:function(){
                         switch (this.currentIndex) {
                             case 0:
@@ -260,9 +251,6 @@
                             case 4:
                                 order(0);
                                 break;
-                            case 5:
-                                order(1);
-                                break;
                             default:
                                 break;
                         }
@@ -270,23 +258,13 @@
                     },
                     onPress:function(){
                         if((this.event.keyCode == 40 || this.event.keyCode == "DOWN")&& this.prevIndex == 3){
-                            if(init.othersProduct_isVip == 0){
+                            if(init.oursProduct_isVip == 0){
                                 this.reSetClass("page_btn",4);
-                            }else if(init.oursProduct_isVip == 0 && init.othersProduct_isVip == 1){
-                                this.reSetClass("page_btn",5);
                             }else{
                                 stopPlay();
                                 G("scrollCont").style.top = - 500 + "px";
                                 this.reSetClass("ip_btn",2);
                             }
-                        }else if((this.event.keyCode == 39 || this.event.keyCode == "RIGHT")&& this.prevIndex == 4){
-                            if(init.oursProduct_isVip == 0){
-                                this.reSetClass("page_btn",5);
-                            }
-                        }else if((this.event.keyCode == 37 || this.event.keyCode == "LEFT")&& this.prevIndex == 5){
-                            if(init.othersProduct_isVip == 0){
-                                this.reSetClass("page_btn",4);
-                            }
                         }
                     },
                 },
@@ -294,11 +272,8 @@
                     line:6,
                     down:["voteBtn"],
                     onEnterPress:function(){
-                        if(init.othersProduct_isVip == 1){
-                            fullscreenPlay(videoArr[this.currentIndex]);
-                        }else{
-                            order(0);
-                        }
+                         // details_page(videoArr[this.currentIndex]);
+                         order();
                     },
                     onPress:function(){
                         stopPlay();
@@ -314,11 +289,10 @@
                                 
                             }
                             G("scrollCont").style.top = 0;
-                            if(init.othersProduct_isVip == 0){
+                            if(init.oursProduct_isVip == 0){
                                 this.reSetClass("page_btn",4);
-                            }else if(init.oursProduct_isVip == 0 && init.othersProduct_isVip == 1){
-                                this.reSetClass("page_btn",5);
-                            }else{
+                            }
+                            else{
                                 this.reSetClass("page_btn",3);
                             }
                         }
@@ -687,6 +661,19 @@
                 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;
@@ -721,30 +708,44 @@
 
 
             function order(idx){
-                var product_id = init.oursId;
-                var price = "15";
-                var name = "玩具总动员";
-                var bag = "wjzdy_bag";
+                var pid = init.oursId;
                 var mark = "mw_oursBag";
-                if(idx==0){
-                    product_id=init.othersId,
-                    price="24.9",
-                    name="少儿会员",
-                    bag="shaoer_package",
-                    mark = "mw_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,
+                // 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); 
                 }
-                window.location.href = "http://10.255.0.219/en/jump_order/index.html?product_list="+JSON.stringify(product_list);  
-            }
+            } 
 
             function prizelog(uid,act_id,is_vip,fn) {
                 ajax({
@@ -850,23 +851,23 @@
                 }
             }
 
-            // 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 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) {
@@ -935,47 +936,33 @@
                 })
             }
 
-            function fullscreenPlay(mid,num) {
-                num = num || 30;
-                stopPlay();
+            function fullscreenPlay(mid) {
                 var playIntent = {
-                    action: "com.mgtv.hndx.prop.mgplayer.MgVodPlayerActivity", //湖南电信、湖南联通(6期)
+                    package : "com.hunantv.operator",
+                    action: "mangotv://com.hunantv.operator/player/vod", 
+                    data:"",
                     extras: {
-                        "cmd_ex": "play_video",
-                        "play_video_direct": 1,
-                        "video_id": mid,
-                        "video_type": 0,
                         "video_index": 0,
-                        "video_all_index": num,
-                        "ui_style": 0,
-                        "media_asset_id": "TVseries",
-                        "category_id": "",
-                        "video_new_index": num-1,
+                        "media_asset_id": mid, //媒资包
                     },
-                    flags: ["SINGLE_TOP"]
+                    flags: []
                 };
-                Webview.sendIntent("startActivity", playIntent); //全屏播放
+                Webview.sendIntent("startActivity", playIntent);     
             };
 
 
-            function smallvodPlay(mid){       
+            function smallvodPlay(media_id,media_num){   
+                media_num  = media_num || 0;  
                 stopPlay();
-                starcorExt.setVideoWindowPosition("345", "179", "577", "323");
-                starcorExt.setHandler("PlayPrepared",function(prepared){
-                var playIntent = {
-                    "cmd_ex" : "play_video",
-                    "play_video_direct" : 1,
-                    "video_id" : mid,
-                    "video_type" : 0,
-                    "video_index" : 0,
-                    "video_all_index": 1,
-                    "ui_style": 0,
-                    "video_new_index": 0
+                try{
+                    starcorExt.setVideoWindowPosition("345", "179", "577", "323");
+                    var playIntent = {
+                        "video_type": "0", 
+                        "media_asset_id": media_id,
+                        "video_index": media_num,
                     };
-                    if(prepared){
-                        starcorExt.playVideo(playIntent);
-                    }
-                });
+                    starcorExt.playVideo(playIntent);
+                }catch(e){}
             };
 
             function stopPlay(){
@@ -1045,66 +1032,28 @@
                     addData();
                 }
 
-                // createQrcode(uid,link,function(res){
-                //     if(res.code == 0){
-                //         G("QRcode").src = res.data.qrcode;
-                //     }
-                // })
+                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){
-                        if(res.data.result==0){
-                            init.oursProduct_isVip = 1;
-                            addClass(G("oursProduct"),'hasOrder');
-                            addClass(G("product2"),'hasOrder');
-                            if(!!getStr("mw_oursBag")){
-                                payResult(init.oursProduct_isVip,uid,init.oursId);
-                            }
-                        }else{
-                            init.oursProduct_isVip = 0;
-                        }
-                        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";
-                            }
-                            G("scrollCont").style.top = - 780-(parseInt(0/4)*268) + "px";
-                            S("unWinToyVipPopup");
-                            pageConf.focusItem = "poster";
-                            pageConf.focusIdx = getCookie("itemIdx");
-                            setCookie("gameItemIdx","");
-                            setCookie("itemIdx","");
-                        }
-                        btnInit();
- 
-                        authorization(init.contentcode1,uid,usertoken,mac,version,function(res){
-                            if(res.code == 0){
-                                if(res.data.result==0){
-                                    init.othersProduct_isVip = 1;
-                                    addClass(G("othersProduct"),'hasOrder');
-                                     addClass(G("product1"),'hasOrder');
-                                    if(!!getStr("mw_othersBag")){
-                                        payResult(init.othersProduct_isVip,uid,init.othersId)   
-                                    }
-                                }else{
-                                    init.othersProduct_isVip = 0;
-                                }                       
-                                times();
-                            }else{
-                                times();
-                            }
-                        },function(){
-                            times();
-                        });
+                    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(){
-                    btnInit();
                     times();
                 });
+                btnInit();
                 if(main.className == "page_btn"){
                     smallvodPlay(videoId);
                 }