feedback_selected.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { _decorator, Component, Node, SpriteFrame } from 'cc';
  2. import { base_ui } from '../../fw/base_ui';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('feedback_selected')
  5. export class feedback_selected extends base_ui {
  6. @property(Node) btn_xcxst:Node = null
  7. @property(Node) btn_ymcw:Node = null
  8. @property(Node) btn_kd:Node = null
  9. @property(Node) btn_qtyc:Node = null
  10. @property(Node) btn_xcy:Node = null
  11. @property(Node) btn_xtyh:Node = null
  12. @property(SpriteFrame) sf_xcxst:SpriteFrame = null
  13. @property(SpriteFrame) sf_ymcw:SpriteFrame = null
  14. @property(SpriteFrame) sf_kd:SpriteFrame = null
  15. @property(SpriteFrame) sf_qtyc:SpriteFrame = null
  16. @property(SpriteFrame) sf_xcy:SpriteFrame = null
  17. @property(SpriteFrame) sf_xtyh:SpriteFrame = null
  18. private data_list = []
  19. private m_click_item_cb = null
  20. start() {
  21. this.onButtonListen(this.btn_xcxst, ()=>{
  22. this.onClick(0)
  23. })
  24. this.onButtonListen(this.btn_ymcw, ()=>{
  25. this.onClick(1)
  26. })
  27. this.onButtonListen(this.btn_kd, ()=>{
  28. this.onClick(2)
  29. })
  30. this.onButtonListen(this.btn_qtyc, ()=>{
  31. this.onClick(3)
  32. })
  33. this.onButtonListen(this.btn_xcy, ()=>{
  34. this.onClick(4)
  35. })
  36. this.onButtonListen(this.btn_xtyh, ()=>{
  37. this.onClick(5)
  38. })
  39. this.data_list =
  40. [{'title':'小程序闪退', 'sf':this.sf_xcxst},
  41. {'title':'页面错位', 'sf':this.sf_ymcw},
  42. {'title':'卡顿', 'sf':this.sf_kd},
  43. {'title':'其他异常', 'sf':this.sf_qtyc},
  44. {'title':'新创意', 'sf':this.sf_xcy},
  45. {'title':'系统优化', 'sf':this.sf_xtyh}]
  46. }
  47. initView(click_item_cb) {
  48. this.m_click_item_cb = click_item_cb
  49. }
  50. onClick(index:number) {
  51. if(this.m_click_item_cb!=null) {
  52. let data = this.data_list[index]
  53. this.m_click_item_cb(data)
  54. }
  55. }
  56. }