shop_huobi_page.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { _decorator, Component, Node, Prefab, instantiate, Label } from 'cc';
  2. import { Holder } from '../adapter/abstract/Holder';
  3. import { itemData } from '../config/ItemDataConfig';
  4. import { huobi_shop_item } from './huobi_shop_item';
  5. import { jishiqi_shop_item } from './jishiqi_shop_item';
  6. import { touxiangkuang_shop_item } from './touxiangkuang_shop_item';
  7. const { ccclass, property } = _decorator;
  8. @ccclass('shop_huobi_page')
  9. export class shop_huobi_page extends Component {
  10. @property(Node) page_view:Node = null;
  11. @property(Node) lab_name:Node = null;
  12. start() {
  13. }
  14. update(deltaTime: number) {
  15. }
  16. show(prefab:Prefab,list:itemData[]){
  17. this.page_view.removeAllChildren()
  18. this.lab_name.getComponent(Label).string = list[0].name
  19. for (let index = 0; index < list.length; index++) {
  20. const element = list[index];
  21. var item = instantiate(prefab);
  22. this.page_view.addChild(item);
  23. item.getComponent(huobi_shop_item).show(element)
  24. }
  25. }
  26. hide(){
  27. }
  28. }