|
|
@@ -12,6 +12,9 @@ export default class RichHelpPanel extends cc.Component {
|
|
|
@property(cc.Label)
|
|
|
txtGiftName: cc.Label = null;
|
|
|
|
|
|
+ @property(cc.Prefab)
|
|
|
+ videoPre: cc.Prefab = null;
|
|
|
+
|
|
|
@property(cc.Node)
|
|
|
rds: cc.Node[] = [];
|
|
|
@property(cc.Sprite)
|
|
|
@@ -62,7 +65,7 @@ export default class RichHelpPanel extends cc.Component {
|
|
|
for (let i = 0; i < this.rewardData.length; i++) {
|
|
|
this.rds[i].active = true;
|
|
|
this.suc_rds[i].active = true;
|
|
|
- cc.loader.loadRes("xiyou/icon/reward" + this.rewardData[i].type, cc.SpriteFrame, (err, res) => {
|
|
|
+ cc.loader.loadRes("module/icon/reward" + this.rewardData[i].type, cc.SpriteFrame, (err, res) => {
|
|
|
if (err) { console.log("img load err:" + JSON.stringify(err)); }
|
|
|
this.rd_imgs[i].spriteFrame = res;
|
|
|
this.suc_rd_imgs[i].spriteFrame = res;
|
|
|
@@ -99,7 +102,7 @@ export default class RichHelpPanel extends cc.Component {
|
|
|
coolTime = false
|
|
|
/** 点击教程 */
|
|
|
async Click_TeachBtn() {
|
|
|
- GameM.audioM.playEffect(AUDIO_TYPE.button)
|
|
|
+ mk.audio.playEffect('button');
|
|
|
if (this.coolTime) {
|
|
|
return
|
|
|
}
|
|
|
@@ -107,9 +110,8 @@ export default class RichHelpPanel extends cc.Component {
|
|
|
this.coolTime = true
|
|
|
|
|
|
console.log('clickTeach')
|
|
|
- GameM.commonData.teachVideoType = 2;
|
|
|
- let temp = await Utils.loadResPromise('prefabs/VideoNode')
|
|
|
- this.videoNode = cc.instantiate(temp)
|
|
|
+ gData.redCodeData.teachVideoType = 2;
|
|
|
+ this.videoNode = cc.instantiate(this.videoPre)
|
|
|
this.videoNode.getChildByName('video').on("completed", this.onCompleted, this)
|
|
|
this.node.addChild(this.videoNode)
|
|
|
}
|
|
|
@@ -117,89 +119,79 @@ export default class RichHelpPanel extends cc.Component {
|
|
|
onCompleted() {
|
|
|
this.videoNode.getChildByName('video').off("completed", this.onCompleted, this)
|
|
|
this.videoNode.destroy()
|
|
|
- //西游
|
|
|
- GameM.audioM.setTempEffect(true)
|
|
|
- GameController.Ins.SwitchAudio(1)
|
|
|
- //GameM.audioM.setResumeMusic()
|
|
|
+ // GameM.audioM.setResumeMusic()
|
|
|
this.coolTime = false
|
|
|
}
|
|
|
|
|
|
/** 点击复制公众号 */
|
|
|
clickCopyOfficial() {
|
|
|
- GameM.audioM.playEffect(AUDIO_TYPE.button)
|
|
|
- AdM.setClipboard("白羊游戏社")
|
|
|
+ mk.audio.playEffect('button');
|
|
|
+ // AdM.setClipboard("白羊游戏社")
|
|
|
}
|
|
|
|
|
|
/** 点击复制礼包名 */
|
|
|
clickCopyInfo() {
|
|
|
- GameM.audioM.playEffect(AUDIO_TYPE.button)
|
|
|
- AdM.setClipboard(this.txtTitle.string)
|
|
|
- }
|
|
|
-
|
|
|
- Click_CloseBtn() {
|
|
|
- UiM.Instance.offPanel(PANEL_NAME.RedeemNode);
|
|
|
-
|
|
|
- //let classnew: any = cc.js.getClassByName("CashOut");
|
|
|
- //console.log("-->: " + classnew);
|
|
|
+ mk.audio.playEffect('button');
|
|
|
+ // AdM.setClipboard(this.txtTitle.string)
|
|
|
}
|
|
|
|
|
|
async Click_GetBtn() {
|
|
|
this.suc_node.active = false;
|
|
|
let richDice: any = null;
|
|
|
|
|
|
- for (let i = 0; i < this.rewardData.length; i++) {
|
|
|
- if (this.rewardData[i].type == "10001") {
|
|
|
- let coinNum = Sciencen_M.instance.accMul(GameM.commonData.goldSecond.toString(), (Number(this.rewardData[i].count) * 60).toString());
|
|
|
- GameM.commonData.updateGold(coinNum);
|
|
|
- GameM.audioM.playEffect(AUDIO_TYPE.getGold, false);
|
|
|
- EffectNode.instance.PlayCoinAnim(0, 5, cc.v2(0, -300));
|
|
|
- } else if (this.rewardData[i].type == "10002") {
|
|
|
- GameM.commonData.updateRedMoney(Number(this.rewardData[i].count))
|
|
|
- EffectNode.instance.PlayCoinAnim(1, 5, cc.v2(0, -300));
|
|
|
- } else if (this.rewardData[i].type == "20002") {
|
|
|
- GameM.commonData.roleData.turntableCard += Number(this.rewardData[i].count);
|
|
|
- EffectNode.instance.PlayCoinAnim(11, 5, cc.v2(0, -300));
|
|
|
- } else if (this.rewardData[i].type == "20001") {
|
|
|
- GameM.commonData.roleData.speedCard += Number(this.rewardData[i].count);
|
|
|
- EffectNode.instance.PlayCoinAnim(10, 5, cc.v2(0, -300));
|
|
|
- } else if (this.rewardData[i].type == "20003") {
|
|
|
- GameM.commonData.roleData.ticket += Number(this.rewardData[i].count);
|
|
|
- EffectNode.instance.PlayCoinAnim(12, 5, cc.v2(0, -300));
|
|
|
- } else if (this.rewardData[i].type == "20006") {
|
|
|
- MateData.Ins.talentCoin += Number(this.rewardData[i].count)
|
|
|
- GameM.httpM.SendData(HTTP_TYPE.updateBattleStoneCount, { "count": MateData.Ins.talentCoin })
|
|
|
- EffectNode.instance.PlayCoinAnim(13, 5, cc.v2(0, -300));
|
|
|
- } else if (this.rewardData[i].type == "30001") {
|
|
|
- if (richDice == null) richDice = {};
|
|
|
- richDice.diceAdNum = Number(this.rewardData[i].count);
|
|
|
- EffectNode.instance.PlayCoinAnim(6, 5, cc.v2(0, -300));
|
|
|
- } else if (this.rewardData[i].type == "30002") {
|
|
|
- if (richDice == null) richDice = {};
|
|
|
- richDice.remoteCtrlNum = Number(this.rewardData[i].count);
|
|
|
- EffectNode.instance.PlayCoinAnim(7, 5, cc.v2(0, -300));
|
|
|
- } else if (this.rewardData[i].type == "30004") {
|
|
|
- if (richDice == null) richDice = {};
|
|
|
- richDice.scriptureNum = Number(this.rewardData[i].count);
|
|
|
- EffectNode.instance.PlayCoinAnim(9, 5, cc.v2(0, -300));
|
|
|
- } else if (this.rewardData[i].type == "30005") {
|
|
|
- if (richDice == null) richDice = {};
|
|
|
- richDice.doubleNum = Number(this.rewardData[i].count);
|
|
|
- EffectNode.instance.PlayCoinAnim(8, 5, cc.v2(0, -300));
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (let i = 0; i < this.rewardData.length; i++) {
|
|
|
+ // if (this.rewardData[i].type == "10001") {
|
|
|
+ // let coinNum = Sciencen_M.instance.accMul(GameM.commonData.goldSecond.toString(), (Number(this.rewardData[i].count) * 60).toString());
|
|
|
+ // GameM.commonData.updateGold(coinNum);
|
|
|
+ // GameM.audioM.playEffect(AUDIO_TYPE.getGold, false);
|
|
|
+ // EffectNode.instance.PlayCoinAnim(0, 5, cc.v2(0, -300));
|
|
|
+ // } else if (this.rewardData[i].type == "10002") {
|
|
|
+ // GameM.commonData.updateRedMoney(Number(this.rewardData[i].count))
|
|
|
+ // EffectNode.instance.PlayCoinAnim(1, 5, cc.v2(0, -300));
|
|
|
+ // } else if (this.rewardData[i].type == "20002") {
|
|
|
+ // GameM.commonData.roleData.turntableCard += Number(this.rewardData[i].count);
|
|
|
+ // EffectNode.instance.PlayCoinAnim(11, 5, cc.v2(0, -300));
|
|
|
+ // } else if (this.rewardData[i].type == "20001") {
|
|
|
+ // GameM.commonData.roleData.speedCard += Number(this.rewardData[i].count);
|
|
|
+ // EffectNode.instance.PlayCoinAnim(10, 5, cc.v2(0, -300));
|
|
|
+ // } else if (this.rewardData[i].type == "20003") {
|
|
|
+ // GameM.commonData.roleData.ticket += Number(this.rewardData[i].count);
|
|
|
+ // EffectNode.instance.PlayCoinAnim(12, 5, cc.v2(0, -300));
|
|
|
+ // } else if (this.rewardData[i].type == "20006") {
|
|
|
+ // MateData.Ins.talentCoin += Number(this.rewardData[i].count)
|
|
|
+ // GameM.httpM.SendData(HTTP_TYPE.updateBattleStoneCount, { "count": MateData.Ins.talentCoin })
|
|
|
+ // EffectNode.instance.PlayCoinAnim(13, 5, cc.v2(0, -300));
|
|
|
+ // } else if (this.rewardData[i].type == "30001") {
|
|
|
+ // if (richDice == null) richDice = {};
|
|
|
+ // richDice.diceAdNum = Number(this.rewardData[i].count);
|
|
|
+ // EffectNode.instance.PlayCoinAnim(6, 5, cc.v2(0, -300));
|
|
|
+ // } else if (this.rewardData[i].type == "30002") {
|
|
|
+ // if (richDice == null) richDice = {};
|
|
|
+ // richDice.remoteCtrlNum = Number(this.rewardData[i].count);
|
|
|
+ // EffectNode.instance.PlayCoinAnim(7, 5, cc.v2(0, -300));
|
|
|
+ // } else if (this.rewardData[i].type == "30004") {
|
|
|
+ // if (richDice == null) richDice = {};
|
|
|
+ // richDice.scriptureNum = Number(this.rewardData[i].count);
|
|
|
+ // EffectNode.instance.PlayCoinAnim(9, 5, cc.v2(0, -300));
|
|
|
+ // } else if (this.rewardData[i].type == "30005") {
|
|
|
+ // if (richDice == null) richDice = {};
|
|
|
+ // richDice.doubleNum = Number(this.rewardData[i].count);
|
|
|
+ // EffectNode.instance.PlayCoinAnim(8, 5, cc.v2(0, -300));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
- if (richDice != null) {
|
|
|
- //进入取经战斗 前提就是满足奖励条件下
|
|
|
- RichData.Ins.UpdateItemCard2(richDice, null, false);
|
|
|
- }
|
|
|
+ // if (richDice != null) {
|
|
|
+ // //进入取经战斗 前提就是满足奖励条件下
|
|
|
+ // RichData.Ins.UpdateItemCard2(richDice, null, false);
|
|
|
+ // }
|
|
|
|
|
|
let response = await gData.redeem.redeemGetRedemption();
|
|
|
- if (response && response.data.code == 1) {
|
|
|
- this.InitData();
|
|
|
- }
|
|
|
- else {
|
|
|
+ // if (response && response.data.code == 1) {
|
|
|
+ // this.InitData();
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
|
|
|
- }
|
|
|
+ // }
|
|
|
|
|
|
// HttpM.Instance.SendData(HTTP_TYPE.redeemGetRedemption, {}, (res) => {
|
|
|
// console.log("--->RedeemGift RedeemPanel:", res);
|