123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>陪你学一夏,全能宝贝大比拼</title>
- <!--#include virtual="/h5v2/htm2/head.htm" -->
- <style type="text/css">
- body {
- width: 1280px;
- height: 720px;
- overflow: hidden;
- background: url(img/bg.jpg) no-repeat 0 0;
- }
-
- .btn_focus_btn {
- border: 3px solid #fff;
- border-radius: 20px;
- box-shadow: 0px 0px 10px #3794e2;
- }
-
- .midea {
- width: 175px;
- height: 258px;
- border: 4px solid #fff8d3;
- border-radius: 15px;
- overflow: hidden;
- }
-
- .btn_focus_midea {
- border: 4px solid #51a546;
- box-shadow: 0px 0px 10px #3794e2;
- }
-
- .midea_0 {
- width: 176px;
- height: 258px;
- overflow: hidden;
- position: absolute;
- left: 123px;
- top: 394px;
- }
-
- .midea_1 {
- width: 176px;
- height: 258px;
- overflow: hidden;
- position: absolute;
- left: 338px;
- top: 394px;
- }
-
- .midea_2 {
- width: 176px;
- height: 258px;
- overflow: hidden;
- position: absolute;
- left: 552px;
- top: 394px;
- }
-
- .midea_3 {
- width: 176px;
- height: 258px;
- overflow: hidden;
- position: absolute;
- left: 767px;
- top: 394px;
- }
-
- .midea_4 {
- width: 176px;
- height: 258px;
- overflow: hidden;
- position: absolute;
- left: 980px;
- top: 394px;
- }
-
- #mideaGroup img {
- width: 100%;
- border-radius: 10px;
- }
-
- div#default_tip_css {
- position: absolute;
- left: 340px;
- top: 325px;
- padding: 30px 50px;
- width: 600px;
- height: 150px;
- background-color: #4c4a4b;
- border-radius: 10px;
- text-align: center;
- font-size: 36px;
- color: #ffffff;
- border: solid 2px #ffffff;
- margin: auto;
- z-index: 333;
- visibility: hidden;
- }
- </style>
- </head>
- <body>
- <div id="indexDiv"></div>
- <div id="mideaGroup"></div>
- <div id="ruleDiv" style="visibility:hidden;"></div>
- <!--#include virtual="/h5v2/htm2/foot.htm" -->
- <!--#include virtual="activity_cfg.htm" -->
- <script type="text/javascript">
- // 记录用户
- 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&a=addData",
- data: {
- uid: uid,
- theme_code: 'looktv'
- },
- success: function(res) {
- fn && fn(res);
- },
- error: function() {}
- })
- }
- //鉴权
- function authorization(fn) {
- ajax({
- url: webUrl + "index.php?m=Home&c=order&a=contentCTCAuth",
- data: {
- contentcode: ACTIVITY_CFG.CONTENT_CODE,
- userid: uid, //1.0
- uid: uid, //2.0
- usertoken: UserToken,
- mac: mac,
- version: version,
- fromsource: fromsource
- },
- type: "post",
- dataType: "json",
- success: function(res) {
- if (res.code == 0) {
- if (res.data.result == 0) {
- dudu_is_vip = 1;
- } else {
- dudu_is_vip = 0;
- }
- } else {
- dudu_is_vip = 0;
- }
- fn && fn();
- },
- error: function() {
- fn && fn();
- }
- })
- }
- //统计
- function payResult() {
- if (dudu_is_vip == 1) {
- ajax({
- url: webUrl + "index.php?m=Home&c=DuduApi&a=payResult",
- data: {
- uid: uid,
- product_id: mid_product_id,
- pay_result: 0
- },
- success: function(res) {},
- error: function() {}
- })
- }
- }
- function fullscreenPlay(mid, idx) {
- idx = idx || 0;
- var playIntent = {
- package: "com.hunantv.operator",
- action: "mangotv://com.hunantv.operator/player/vod",
- data: "",
- extras: {
- "video_index": idx,
- "media_asset_id": mid, //媒资包
- },
- flags: []
- };
- Webview.sendIntent("startActivity", playIntent);
- };
- function stopPlay() {
- try {
- starcorExt.stopVideo();
- } catch (e) {}
- }
- try {
- starcorExt.setHandler("Resume", function(isResumed) {
- if (isResumed) { //从全屏或设置键回来
- }
- });
- } catch (e) {}
- var uid = PageH5.getParam('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"
- try {
- uid = Webview.readSystemProp('user.id'); //用户ID
- UserToken = Webview.readSystemProp('user.token'); //用户令牌
- mac = Webview.readSystemProp('device.mac'); //机顶盒mac地址
- version = Webview.readSystemProp('app.version'); //APK版本号
- } catch (e) {}
- var linkImage = CONFIG.SPACER; //透明图片
- var buttons = []; //按钮数组
- var act_id = ACTIVITY_CFG.ACT_ID,
- act_code = ACTIVITY_CFG.ACT_CODE; //活动id及code
- var fromsource = ACTIVITY_CFG.FROM_SOURCE, //来源,电信4,联通5
- dudu_is_vip = 0, //1是会员,0是非会员
- mid_product_id = '', //记录订购成功时候用
- ruleDivIsShow = false, //规则是否展开
- remainTimes = 0; //游戏剩余次数
- var prizeImg = ''; //获奖时的图片
- var isLock = false; //是否锁住按键
- var title_idx = PageH5.getParam('titleIdx') ? PageH5.getParam('titleIdx') : 0; //titleIdx
- var f = PageH5.getParam('f');
- if (PageH5.cookie.get('focusMark')) {
- var focusMark = JSON.parse(PageH5.cookie.get('focusMark'));
- if (focusMark.title_idx)
- title_idx = focusMark.title_idx;
- if (focusMark.focus)
- f = focusMark.focus;
- PageH5.cookie.set('focusMark', '');
- }
- var midea = [
- [{ //语言
- 'name': '可爱巧虎岛 第五季',
- 'img': '',
- 'id': '00000001000000000048000000082109',
- }, {
- 'name': '小猪佩奇 全集',
- 'img': '',
- 'id': '00000001000000000043000000296717',
- }, {
- 'name': '超级宝贝JOJO',
- 'img': '',
- 'id': '00000001000000000025000000333852',
- }, {
- 'name': '我的汤姆猫短片',
- 'img': '',
- 'id': '00000001000000000014000000323353',
- }, {
- 'name': '海绵宝宝 第九季',
- 'img': '',
- 'id': '00000001000000000030000000345063',
- }],
- [{ //国学
- 'name': '宝宝巴士之奇妙汉字 第一季',
- 'img': '',
- 'id': '00000001000000000043000000266913',
- }, {
- 'name': '贝乐虎古诗',
- 'img': '',
- 'id': '00000001000000000031000000254351',
- }, {
- 'name': '贝乐虎三字经',
- 'img': '',
- 'id': '00000001000000000015000000381334',
- }, {
- 'name': '猫小帅古诗',
- 'img': '',
- 'id': '00000001000000000028000000271453',
- }, {
- 'name': '兔小贝成语学堂',
- 'img': '',
- 'id': '00000001000000000032000000022865',
- }],
- [{ //才艺
- 'name': '超级飞侠唱儿歌',
- 'img': '',
- 'id': '00000001000000000032000000022701',
- }, {
- 'name': '超级飞侠画世界',
- 'img': '',
- 'id': '00000001000000000036000000264704',
- }, {
- 'name': '超级飞侠彩笔画 第二季',
- 'img': '',
- 'id': '00000001000000000040000000325516',
- }, {
- 'name': '小鸡彩虹舞台秀第六季',
- 'img': '',
- 'id': '00000001000000000037000000327175',
- }, {
- 'name': '芭比之梦想豪宅全集',
- 'img': '',
- 'id': '00000001000000000002000000074481',
- }],
- [{ //巧手
- 'name': '小伶玩具',
- 'img': '',
- 'id': '00000001000000000007000000166844',
- }, {
- 'name': '和小鹿问问一起做手工',
- 'img': '',
- 'id': '00000001000000000047000000295791',
- }, {
- 'name': '和迷你卡车学习',
- 'img': '',
- 'id': '00000001000000000045000000170689',
- }, {
- 'name': '阿哦玩具',
- 'img': '',
- 'id': '00000001000000000038000000446889',
- }, {
- 'name': '超级飞侠欢乐玩粘土',
- 'img': '',
- 'id': '00000001000000000003000000092944',
- }],
- [{ //科学
- 'name': '猪猪侠之恐龙日记 第二季',
- 'img': '',
- 'id': '00000001000000000025000000316080',
- }, {
- 'name': '汪汪队立大功之百科知识',
- 'img': '',
- 'id': '00000001000000000014000000236195',
- }, {
- 'name': '百变马丁 第六季',
- 'img': '',
- 'id': '00000001000000000032000000375988',
- }, {
- 'name': '阿U学科学 第二季',
- 'img': '',
- 'id': '00000001000000000007000000081017',
- }, {
- 'name': '超级飞侠大百科 第一季',
- 'img': '',
- 'id': '00000000000000000001000000001002',
- }]
- ]
- var typeArr = ['yy', 'gx', 'cy', 'ds', 'kx'];
- PageH5.eventHandler = function(keyCode) {
- if (keyCode == KEY_LEFT && (!isLock)) {
- PageH5.Button.move('left');
- } else if (keyCode == KEY_RIGHT && (!isLock)) {
- PageH5.Button.move('right');
- } else if (keyCode == KEY_UP && (!isLock)) {
- PageH5.Button.move('up');
- } else if (keyCode == KEY_DOWN && (!isLock)) {
- PageH5.Button.move('down');
- } else if (keyCode == KEY_ENTER && (!isLock)) {
- PageH5.Button.click();
- } else if ((keyCode == KEY_BACK || keyCode == KEY_EXIT) && (!isLock)) {
- back();
- }
- }
- function init() {
- PageH5.cookie.set('activity_userid', uid);
- PageH5.cookie.set('activity_is_vip', dudu_is_vip);
- var html = '';
- html += '<div style="position:absolute;left:1110px;top:18px;"><img id="back" src="./img/btn_back.png"/></div>';
- html += '<div style="position:absolute;left:1110px;top:62px;"><img id="rule" src="./img/btn_rules.png"/></div>';
- html += '<div style="position:absolute;left:1110px;top:106px;"><img id="medal" src="./img/btn_medal.png"/></div>';
- html += '<div style="position:absolute;left:1110px;top:150px;"><img id="check" src="./img/btn_check.png"/></div>';
- html += '<div style="position:absolute;left:114px;top:220px;"><img src="./img/title_0.png"/></div>';
- html += '<div style="position:absolute;left:324px;top:220px;"><img src="./img/title_1.png"/></div>';
- html += '<div style="position:absolute;left:538px;top:220px;"><img src="./img/title_2.png"/></div>';
- html += '<div style="position:absolute;left:748px;top:220px;"><img src="./img/title_3.png"/></div>';
- html += '<div style="position:absolute;left:960px;top:220px;"><img src="./img/title_4.png"/></div>';
- html += '<div style="position:absolute;left:110px;top:216px;"><img id="title_0" src="' + linkImage + '"/></div>';
- html += '<div style="position:absolute;left:320px;top:216px;"><img id="title_1" src="' + linkImage + '"/></div>';
- html += '<div style="position:absolute;left:534px;top:216px;"><img id="title_2" src="' + linkImage + '"/></div>';
- html += '<div style="position:absolute;left:744px;top:216px;"><img id="title_3" src="' + linkImage + '"/></div>';
- html += '<div style="position:absolute;left:956px;top:216px;"><img id="title_4" src="' + linkImage + '"/></div>';
- html += '<div class="midea" style="position:absolute;left:120px;top:390px;" id="midea0"></div>';
- html += '<div class="midea" style="position:absolute;left:335px;top:390px;" id="midea1"></div>';
- html += '<div class="midea" style="position:absolute;left:549px;top:390px;" id="midea2"></div>';
- html += '<div class="midea" style="position:absolute;left:764px;top:390px;" id="midea3"></div>';
- html += '<div class="midea" style="position:absolute;left:977px;top:390px;" id="midea4"></div>';
- G('indexDiv').innerHTML = html;
- var ruleDivHTML = '<div style="position:absolute;left:0px;top:0px;"><img src="img/rulePopup.jpg" width="1280" height="720"/></div>';
- ruleDivHTML += '<div style="position:absolute;left:572px;top:645px;"><img id="guize_btn" src="./img/btn_back.png"/></div>';
- G('ruleDiv').innerHTML = ruleDivHTML;
- var guizeBtn = {
- id: 'guize_btn',
- action: goGuizeBtn,
- left: '',
- right: '',
- up: '',
- down: '',
- focusClass: 'btn',
- };
- buttons.push(guizeBtn);
- buttons.push({
- id: 'back',
- action: goAction,
- left: 'start',
- right: '',
- up: '',
- down: 'rule',
- focusClass: 'btn'
- });
- buttons.push({
- id: 'rule',
- action: goAction,
- left: 'start',
- right: '',
- up: 'back',
- down: 'medal',
- focusClass: 'btn'
- });
- buttons.push({
- id: 'medal',
- action: goAction,
- left: '',
- right: '',
- up: 'rule',
- down: 'check',
- focusClass: 'btn'
- });
- buttons.push({
- id: 'check',
- action: goAction,
- left: '',
- right: '',
- up: 'medal',
- down: '',
- focusClass: 'btn',
- beforeMove: upBeforeMove,
- });
- for (var i = 0; i < 5; i++) {
- var obj = {
- id: 'title_' + i,
- index: i,
- right: 'title_' + (i < 4 ? (i + 1) : i),
- left: 'title_' + (i > 0 ? (i - 1) : i),
- up: 'check',
- down: 'midea' + i,
- focusHandler: tab,
- blurHandler: mark,
- focusImage: './img/title_sel.png'
- };
- buttons.push(obj);
- }
- for (var i = 0; i < 5; i++) {
- var obj = {
- id: 'midea' + i,
- action: goAction,
- index: i,
- right: 'midea' + (i < 4 ? (i + 1) : i),
- left: 'midea' + (i > 0 ? (i - 1) : i),
- up: '',
- down: '',
- focusClass: 'midea',
- beforeMove: upBeforeMove,
- };
- buttons.push(obj);
- }
- if (location.search.indexOf('haochuanBag') >= 0) {} else if (location.search.indexOf('childsBag') >= 0) {}
- PageH5.btn.init([f, 'title_0'], buttons, '', false);
- PageH5.cookie.del('activity_prize_name');
- }
- function mark(button) {
- title_idx = button.index;
- }
- function upBeforeMove(dir, current) {
- if ("down" === dir && current.id == "check") {
- PageH5.btn.set('title_' + title_idx);
- return false;
- } else if ("up" === dir && current.id.indexOf('midea') >= 0) {
- PageH5.btn.set('title_' + title_idx);
- return false;
- }
- }
- function tab(button) {
- var midea = document.getElementsByClassName('midea');
- var _html = '';
- for (var i = 0; i < midea.length; i++) {
- _html += '<div class="midea_' + i + '"><img src="./img/midea/midea' + button.index + '/' + i + '.jpg" /></div>';
- }
- G('mideaGroup').innerHTML = _html;
- }
- function ajaxWinning(type, status, idx, focusId) {
- ajax({
- url: webUrl + "index.php?c=Home&c=Activityv2&a=collect",
- data: {
- uid: uid,
- act_code: act_id,
- type: type,
- is_vip: dudu_is_vip,
- run: status,
- },
- success: function(res) {
- if (res.code == 0) {
- goResult('yes', idx, focusId);
- } else {
- goResult('no', idx, focusId);
- }
- },
- error: function() {
- goUnusual();
- }
- })
- }
- function goResult(result, idx, focusId) {
- if (result == 'yes') {
- location.href = './gift.html?prizeImg=./img/title_' + idx + '.png&f=' + focusId + '&titleIdx=' + idx;
- } else {
- location.href = './noGift.html?f=' + focusId + '&titleIdx=' + idx;
- }
- }
- function goUnusual() {
- location.href = './index.html';
- }
- function goAction(button) {
- if (button.id == 'back') { //返回
- back();
- } else if (button.id == 'rule') { //活动规则
- S('ruleDiv');
- ruleDivIsShow = true;
- PageH5.btn.set('guize_btn');
- } else if (button.id == 'medal') { //我的勋章
- location.href = './medalInfo.html?f=' + button.id;
- } else if (button.id == 'check') { //我的勋章
- location.href = './winningInfo.html?f=' + button.id;
- } else if (button.id.indexOf('midea') >= 0) { //内容
- if (dudu_is_vip == 1) {
- setInterval(function() {
- ajaxWinning(typeArr[title_idx], 'uncomplate', title_idx, button.id);
- }, 10000)
- fullscreenPlay(midea[title_idx][button.index].id);
- } else {
- PageH5.tip('需要订购“少儿包”,才能观看此内容噢!正在跳转订购,请稍等……', 4);
- setTimeout(function() {
- order(button.id)
- }, 4000)
- }
- }
- }
- function order(focusId) {
- PageH5.cookie.set('focusMark', JSON.stringify({
- 'focus': focusId,
- 'title_idx': title_idx
- }));
- goMyCommonOrder(webUrl + 'h5v2/' + ACTIVITY_CFG.ACT_CODE + '/index.html?haochuanBag=' + uid)
- }
- function goGuizeBtn(button) {
- H('ruleDiv');
- ruleDivIsShow = false;
- PageH5.btn.set('rule');
- }
- function back() {
- if (ruleDivIsShow) {
- goGuizeBtn(PageH5.btn.get('guize_btn'));
- } else {
- Webview.closeBrwoser("返回");
- }
- }
- window.onload = function() {
- if (!PageH5.getParam('f')) {
- addUser();
- addData();
- }
- authorization(function() {
- init();
- var midea = document.getElementsByClassName('midea');
- var _html = '';
- for (var i = 0; i < midea.length; i++) {
- _html += '<div class="midea_' + i + '"><img src="./img/midea/midea' + title_idx + '/' + i + '.jpg" /></div>';
- }
- G('mideaGroup').innerHTML = _html;
- if (location.search.indexOf('haochuanBag') >= 0) {
- mid_product_id = ACTIVITY_CFG.PRODUCT_ID;
- payResult();
- }
- })
- }
- </script>
- </body>
- </html>
|