ItemName.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { ProductType } from "../../data/GameData";
  2. const { ccclass, property } = cc._decorator;
  3. @ccclass
  4. export default class ItemName extends cc.Component{
  5. @property({displayName: '复选组件', type: cc.Toggle})
  6. public toggle: cc.Toggle = null;
  7. @property({displayName: '名字', type: cc.Label})
  8. public lbl_name: cc.Label = null;
  9. @property({displayName: '是否解锁标识', type: cc.Node})
  10. public sp_luck: cc.Node = null;
  11. @property({displayName: '红点', type: cc.Node})
  12. public node_redPoint: cc.Node = null;
  13. @property({displayName: '按钮', type: cc.Button})
  14. public btn_luck: cc.Button = null;
  15. pt:ProductType = ProductType.nzw;
  16. start(){
  17. }
  18. InitUI(name: string, luck: boolean, showRedPoint: boolean)
  19. {
  20. }
  21. setShowUIState(luck: boolean, showRedPoint: boolean, id: ProductType)
  22. {
  23. this.sp_luck.active = luck;
  24. this.btn_luck.node.active = luck;
  25. this.node_redPoint.active = showRedPoint;
  26. this.pt = id;
  27. }
  28. clickLuckBtn()
  29. {
  30. let data = gData.gameData.getProductArrByType(this.pt);
  31. if(data && data.length> 0 && data[0].unlock == 2)
  32. {
  33. if(gData.gameData.playerProp.orderData){
  34. let times = data[0].value - gData.gameData.playerProp.orderData.overTimes;
  35. mk.tip.pop(`订单提现${times}次后解锁`);
  36. }else{
  37. mk.tip.pop(`提现订单后解锁`);
  38. }
  39. }
  40. }
  41. }