LineUpUIData.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { Data } from "../../../mk/data/Data";
  2. import { RewardType } from "../GameData";
  3. export class LineUpUIData extends Data {
  4. public personCount = 0;
  5. public cashId = 0;
  6. public refresh = false;
  7. public redMoney = 0;
  8. public refresh2 = false;
  9. public popType = 0;
  10. showTips() {
  11. console.log(`showTips======${gData.gameData.playerProp.lineRedMoney}`);
  12. if (gData.gameData.playerProp.lineRedMoney > 0) {
  13. cc.tween(this).delay(0.5).call(() => {
  14. let add = Math.round(this.redMoney / 100);
  15. mk.tip.pop(`插队成功,并获得${add}红包币`);
  16. }).start();
  17. } else {
  18. console.log("showTips================");
  19. cc.tween(this).delay(0.5).call(() => {
  20. console.log("showTips================2");
  21. mk.tip.pop("插队成功");
  22. }).start();
  23. }
  24. }
  25. setAdData(data) {
  26. //mk.console.logSingle('LineUpUIData addata ', this.adData);
  27. super.setAdData(data);
  28. console.log(`LineUpUIData=========${data}`);
  29. this.redMoney = 0;
  30. let rewardData = this.adData.videoRedMoney.videoRewardList;
  31. for (let i = 0; i != rewardData.length; ++i) {
  32. if (rewardData[i].rewardType == RewardType.redBag) {
  33. this.redMoney = rewardData[i].rewardNum;
  34. gData.gameData.playerProp.redMoney += this.redMoney;
  35. break;
  36. }
  37. }
  38. this.showTips();
  39. gData.gameData.playerProp.lineRedMoney = data.lineRedMoney;
  40. this.refresh2 = true;
  41. //gData.reward.data = gData.lineUpUIData.adData.videoRedMoney.videoRewardList;
  42. // let world_Pos = this.node_fly.parent.convertToWorldSpaceAR(this.node_fly.getPosition());
  43. // gData.reward.getReward(world_Pos);
  44. }
  45. }