Commit afbf9959 afbf9959f529dcf565663ed2248dfcd82d3f933e by 金学艇

1.首页敬请期待弹窗修改完成

1 parent 9323a571
......@@ -192,7 +192,7 @@
"array": [
0,
0,
250.28134155273438,
271.060302734375,
0,
0,
0,
......@@ -5460,7 +5460,7 @@
"_oFocusScaleFactorInfo": null,
"_bShowExitBox": false,
"test_json": {
"__uuid__": "d797e6d8-b99b-4992-be3f-35357c9dcd65"
"__uuid__": "2f979325-7c8b-45cc-99a5-30cc9c056bb1"
},
"PFB_COMMON_WIDGET": {
"__uuid__": "57787725-2430-4ac3-b324-c22c08c3f074"
......
......@@ -240,10 +240,10 @@ cc.Class({
cc.log("向下滑动:" + fiFocusTarget.node.name);
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, 1.0, oScrollParameter);
}
// if (this._fiCurrentFocus.node.name == "Play" && this._bShowProgress) { //暂时隐藏选集框,否则点击单曲循环会出现问题
// this.showSelectGatherArea();
// return;
// }
if (this._fiCurrentFocus.node.name == "Play" && this._bShowProgress) { //暂时隐藏选集框,否则点击单曲循环会出现问题
this.showSelectGatherArea();
return;
}
}
if (event.keyCode == cc.macro.KEY.left || event.keyCode == Common.ANDROID_KEY.left) {
if (this._fiCurrentFocus.node.name == "Nothing") {
......
......@@ -403,6 +403,11 @@ cc.Topdraw.TVCanvas =
this.hideDetainBox();
return;
break;
case "onComingSoonConfirmClick":
case "onComingSoonCancelClick":
this.hideComingSoonBox();
return;
break;
case "exit":
cc.game.end();
break;
......@@ -1035,6 +1040,82 @@ cc.Topdraw.TVCanvas =
}
},
/**
* 敬请期待提示框
*/
showComingSoonBox: function (fiBackend, bHideBg) {
try {
this._bShowExitBox = true;
if (this._nodeSystemPrompt) {
try {
this._nodeSystemPrompt.opacity = 255;
if (null == this._aFocusTargets[1]) { //focus放到第二层级,避免冲突
this._aFocusTargets[1] = [];
}
this._aFocusTargets[1]['coming_soon_confirm_btn'] = cc.find("PromptBox/ComingSoonConfirm", this._nodeSystemPrompt);
this._aFocusTargets[1]['coming_soon_cancel_btn'] = cc.find("PromptBox/ComingSoonCancel", this._nodeSystemPrompt);
this._fiBeforeDetainBox = this._fiCurrentFocus;
this._fiBackend = fiBackend;
this._iSceneStatus = 1;
this._cFocus.flyFocus(this._fiCurrentFocus, this._aFocusTargets[1]['coming_soon_confirm_btn'].getComponent(FocusInfo), Common.MOVE_DIRECTION_UP, this._fFocusScaleFactor, null);
this._bIsLoadingPfbSystemPrompt = false;
} catch (error) {
cc.log("Business Exception:Get showComingSoonBox..." + error);
}
} else {
this._bIsLoadingPfbSystemPrompt = true;
//初始弹框
Common.loadRes('Prefab/pfbComingSoonPrompt',//提示预制
function (loadedResource) {
this._nodeSystemPrompt = cc.instantiate(loadedResource);
this._nodeSystemPrompt.parent = this.node;
if (bHideBg) {
this._nodeSystemPrompt.getChildByName("Background").opacity = 0;
}
let nodeConfirm = cc.find("PromptBox/ComingSoonConfirm", this._nodeSystemPrompt);
let nodeCancel = cc.find("PromptBox/ComingSoonCancel", this._nodeSystemPrompt);
nodeConfirm.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, nodeConfirm.width, nodeConfirm.height));
nodeCancel.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, nodeCancel.width, nodeCancel.height));
let fiConfirm = nodeConfirm.addComponent(FocusInfo);
let fiCancel = nodeCancel.addComponent(FocusInfo);
fiConfirm.init('{"click": [{"action": "onComingSoonConfirmClick"}]}', true);
fiCancel.init('{"click": [{"action": "onComingSoonCancelClick"}]}', true);
this.showComingSoonBox(fiBackend);
},
function (error) {
cc.log("Error When Loading Prefab pfbSystemPrompt ...");
}, this
);
}
} catch (error) {
if (cc.sys.isNative) {
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "logInSceneI", "(Ljava/lang/String;)V", "showComingSoonBox Error in TVCanvas==>" + error);
}
}
},
hideComingSoonBox: function () {
try {
this._nodeSystemPrompt.opacity = 0;
delete this._aFocusTargets[1]['system_confirm_btn'];
delete this._aFocusTargets[1]['system_cancel_btn'];
this._iSceneStatus = 0;
let iX = Common.SCREEN_WIDTH / 2 + Common.getX(this._fiBeforeDetainBox.node) - this._fiBeforeDetainBox.node.width / 2;
let iY = Common.SCREEN_HEIGHT / 2 - Common.getY(this._fiBeforeDetainBox.node) + this._fiBeforeDetainBox.node.height / 2;
cc.log("记忆焦点:" + this._fiBeforeDetainBox.node.name);
if (this._fiBeforeDetainBox.getEnable() && iX >= 0 && iX <= Common.SCREEN_WIDTH && iY >= 0 && iY <= Common.SCREEN_HEIGHT + 50) {//这里是考虑给播放元素设置了虚拟位置
this._cFocus.flyFocus(this._fiCurrentFocus, this._fiBeforeDetainBox, Common.MOVE_DIRECTION_UP, this._fFocusScaleFactor, null);
} else {
this._cFocus.flyFocus(this._fiCurrentFocus, this._fiBackend, Common.MOVE_DIRECTION_UP, this._fFocusScaleFactor, null);
}
this._bShowExitBox = false;
} catch (error) {
if (cc.sys.isNative) {
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "logInSceneI", "(Ljava/lang/String;)V", "hideComingSoonBox Error in TVCanvas==>" + error);
}
}
},
getImageByTag: (val, strTag, index) => {
try {
strTag = strTag || "normal";
......
......@@ -233,7 +233,7 @@ cc.Class({
compMarquee.setUIWithFocus();
},
//请求顶部个人中心和订购按钮
//请求顶部个人中心和订购按钮(这里先将图片资源缩小了0.8,否则查找资源有些问题)
getTopNaviRequest: function (strCellName) {
// Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_layout.json", null, null,
// function (strResponse) {
......@@ -261,6 +261,7 @@ cc.Class({
if (i > 0 && strCellName == "topNavi" || strCellName == "topCell") { //刨掉第一个logo图片
// cc.log("头部图片:"+aTopNaviJson[i].imageURL);
if (strCellName == "topCell") {
// nodeNav.scale = 0.5;
this._oInit.aTopCellImg.push(Common.TOPDRAW_IMAGE_SERVER + aTopNaviJson[i].imageURL);
} else {
this._oInit.aTopNaviImg.push(Common.TOPDRAW_IMAGE_SERVER + aTopNaviJson[i].imageURL);
......@@ -691,7 +692,7 @@ cc.Class({
this._iCellCountEachRow = 4;
this._fCellMarginTop = 0;
this._fCellMarginRight = 24;
this._fCellMarginBottom = 16;
this._fCellMarginBottom = 24;
this._fCellMarginLeft = 0;
// break;
// default:
......@@ -921,8 +922,8 @@ cc.Class({
// return [null, oScrollParameter];
// }
if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("topNavi") || 0 == fiFocusTarget.node.name.indexOf("topCell")) {
if (0 != this._fiCurrentFocus.node.name.indexOf("topNavi") && 0 != this._fiCurrentFocus.node.name.indexOf("topCell")) {//如果不是TypeList之间跳转,则哪里来回哪里去
if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("topNavi")) {
if (0 != this._fiCurrentFocus.node.name.indexOf("topNavi")) {//如果不是TypeList之间跳转,则哪里来回哪里去
fiFocusTarget = cc.find("topNavi" + this._oSceneContext._iCurrentLeftIndex, leftNavLayout).getComponent(FocusInfo);
}
}
......@@ -1132,7 +1133,8 @@ cc.Class({
this.backToTop();
return;
} else if (0 == fiCurrentFocus.node.getName().indexOf('topCell')) {
this.commonSimpleTip("敬请期待!", 3);
// this.commonSimpleTip("敬请期待!", 3);
this.showComingSoonBox();
return;
}
else {
......@@ -1271,6 +1273,16 @@ cc.Class({
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
});
}
if (0 == fiFrom.node.getName().indexOf('ComingSoonConfirm')) {
cc.loader.loadRes("SystemExit/btn_confirm_comming_soon", cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
});
}
if (0 == fiFrom.node.getName().indexOf('ComingSoonCancel')) {
cc.loader.loadRes("SystemExit/btn_cancel_comming_soon", cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
});
}
},
onAfterFocusChange: function (event) {
......@@ -1383,7 +1395,8 @@ cc.Class({
if (0 == fiTo.node.getName().indexOf('view_pager_label') || 0 == fiTo.node.getName().indexOf('topNavi')
|| 0 == fiTo.node.getName().indexOf('topCell') || 0 == fiTo.node.getName().indexOf('backToTop')
|| 0 == fiTo.node.getName().indexOf('update_btn') || 0 == fiTo.node.getName().indexOf('close_btn')
|| 0 == fiTo.node.getName().indexOf('Confirm') || 0 == fiTo.node.getName().indexOf('Cancel')) {
|| 0 == fiTo.node.getName().indexOf('Confirm') || 0 == fiTo.node.getName().indexOf('Cancel')
|| 0 == fiTo.node.getName().indexOf('ComingSoonConfirm') || 0 == fiTo.node.getName().indexOf('ComingSoonCancel')) {
this._cFocus.hide();
} else {
if (!this._bIsScrollViewMoving)
......@@ -1411,6 +1424,17 @@ cc.Class({
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
});
}
if (0 == fiTo.node.getName().indexOf('ComingSoonConfirm')) {
cc.loader.loadRes("SystemExit/btn_confirm_comming_soon", cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
});
}
if (0 == fiTo.node.getName().indexOf('ComingSoonCancel')) {
cc.loader.loadRes("SystemExit/btn_cancel_comming_soon", cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
});
}
},
doCurrentFocusTVLinkAction: function (strAction) {
......
......@@ -164,9 +164,9 @@
"name": "个人中心",
"left": 1150,
"top": 8,
"width": 80,
"width": 60,
"code": "eb954b1e-712e-415c-ba27-wergherg",
"height": 80,
"height": 60,
"tvlink": {
"click": [
{
......@@ -184,8 +184,8 @@
"name": "订购",
"left": 1060,
"top": 8,
"width": 80,
"height": 80,
"width": 60,
"height": 60,
"code": "eb954b1e-712e-415c-ba27-asgerg",
"tvlink": {
"click": [
......