MainViewModel.ets 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import ItemData from './ItemData';
  2. export class MainViewModel{
  3. static readonly OO_MUSIC: number = 100;
  4. static readonly OO_VIDEO: number = 101;
  5. static readonly OO_SIMI: number = 102;
  6. static readonly OO_STREAM: number = 103;
  7. static readonly SAFE_TEST: number = 11;
  8. static readonly SEE_PWD: number = 22;
  9. static readonly SPEED_TEST: number = 33;
  10. static readonly JIAO_CHENG: number = 44;
  11. static readonly CAMERA_TEST: number = 55;
  12. static readonly POWER_TEST: number = 66;
  13. static readonly DELAY_SPEED: number = 66;
  14. static readonly DOWN_SPEED: number = 77;
  15. static readonly AVER_SPEED: number = 88;
  16. static readonly MENU_HOME: number = 66;
  17. static readonly MENU_MUSIC: number = 67;
  18. static readonly MENU_SETTING: number = 68;
  19. static readonly MENU_TEST_SPEED: number = 77;
  20. static readonly MENU_OPTIMIZE: number = 88;
  21. static readonly MENU_ABOUT: number = 99;
  22. static readonly MENU_UPDATE: number = 111;
  23. static readonly MENU_USER: number = 112;
  24. static readonly MENU_YSZC: number = 222;
  25. static readonly MENU_DUTY: number = 221;
  26. static readonly MENU_NET_CONNECT: number = 223;
  27. static readonly MENU_SIMI: number = 224;
  28. static readonly MENU_LIKE: number = 225;
  29. static readonly MENU_HAOPING: number = 226;
  30. static readonly MENU_VIP: number = 227;
  31. static readonly MENU_MIEDIA_KU: number = 228;
  32. static readonly MENU_MIEDIA_ARTIST: number = 229;
  33. static readonly MENU_MIEDIA_ALBUM: number = 230;
  34. static readonly MENU_FILE_SCAN: number = 231;
  35. static readonly MENU_SHARE: number = 232;
  36. //测滑菜单的数据
  37. getDrawerData(): Array<ItemData> {
  38. let drawerGridData: ItemData[] = [
  39. new ItemData($r('app.string.local_music'), { type: 'symbol', value: $r('sys.symbol.music') }, MainViewModel.MENU_MUSIC, false),
  40. // new ItemData($r('app.string.media_ku'), $r('app.media.hm_playlist'),MainViewModel.MENU_MIEDIA_KU,false),
  41. // new ItemData($r('app.string.artist'), $r('app.media.kp_music'),MainViewModel.MENU_MIEDIA_ARTIST,false),
  42. // new ItemData($r('app.string.album'), $r('app.media.llq'),MainViewModel.MENU_MIEDIA_ALBUM,false),
  43. new ItemData($r('app.string.file_scan'), { type: 'symbol', value: $r('sys.symbol.doc_text_badge_magnifyingglass') },MainViewModel.MENU_FILE_SCAN,false),
  44. new ItemData($r('app.string.haoping'), { type: 'symbol', value: $r('sys.symbol.flower') },MainViewModel.MENU_HAOPING,false),
  45. new ItemData($r('app.string.persion_duty'),{ type: 'symbol', value: $r('sys.symbol.doc_plaintext') },MainViewModel.MENU_DUTY,false),
  46. new ItemData($r('app.string.yszc'), { type: 'symbol', value: $r('sys.symbol.lock') },MainViewModel.MENU_YSZC,false),
  47. new ItemData($r('app.string.about_me'), { type: 'symbol', value: $r('sys.symbol.info_shield') },MainViewModel.MENU_ABOUT,false),
  48. new ItemData($r('app.string.setting'), { type: 'symbol', value: $r('sys.symbol.gearshape') },MainViewModel.MENU_SETTING,false),
  49. new ItemData($r('app.string.share_tt'), { type: 'symbol', value: $r('sys.symbol.share') },MainViewModel.MENU_SHARE,false),
  50. // new ItemData($r('app.string.nor_setting'), $r('app.media.hm_gps'),MainViewModel.MENU_SETTING,false),
  51. ];
  52. return drawerGridData;
  53. }
  54. getDrawerData2(): Array<ItemData> {
  55. let drawerGridData: ItemData[] = [
  56. new ItemData($r('app.string.local_music'), { type: 'symbol', value: $r('sys.symbol.music') }, MainViewModel.MENU_MUSIC, false),
  57. // new ItemData($r('app.string.user_center'), { type: 'symbol', value: $r('sys.symbol.person') }, MainViewModel.MENU_USER, false),
  58. new ItemData($r('app.string.file_scan'), { type: 'symbol', value: $r('sys.symbol.doc_text_badge_magnifyingglass') },MainViewModel.MENU_FILE_SCAN,false),
  59. new ItemData($r('app.string.vip'), { type: 'symbol', value: $r('sys.symbol.vip_hand') }, MainViewModel.MENU_VIP, false),
  60. new ItemData($r('app.string.haoping'), { type: 'symbol', value: $r('sys.symbol.flower') },MainViewModel.MENU_HAOPING,false),
  61. new ItemData($r('app.string.persion_duty'),{ type: 'symbol', value: $r('sys.symbol.doc_plaintext') },MainViewModel.MENU_DUTY,false),
  62. new ItemData($r('app.string.yszc'), { type: 'symbol', value: $r('sys.symbol.lock') },MainViewModel.MENU_YSZC,false),
  63. new ItemData($r('app.string.about_me'), { type: 'symbol', value: $r('sys.symbol.info_shield') },MainViewModel.MENU_ABOUT,false),
  64. new ItemData($r('app.string.setting'), { type: 'symbol', value: $r('sys.symbol.gearshape') },MainViewModel.MENU_SETTING,false),
  65. new ItemData($r('app.string.share_tt'), { type: 'symbol', value: $r('sys.symbol.share') },MainViewModel.MENU_SHARE,false),
  66. ];
  67. return drawerGridData;
  68. }
  69. //首页安全体检,查看密码,网络测速的模块数据
  70. getWiFiGridData(): Array<ItemData> {
  71. let firstGridData: ItemData[] = [
  72. // new ItemData($r('app.string.see_pwd'), $r('app.media.icon_cw'),MainViewModel.SEE_PWD,false),
  73. // new ItemData($r('app.string.safe_test'), $r('app.media.safe_icon2'),MainViewModel.SAFE_TEST,false),
  74. // new ItemData($r('app.string.power_test'), $r('app.media.icon_power'),MainViewModel.POWER_TEST,false),
  75. // // new ItemData($r('app.string.add_speed'), $r('app.media.safe_blue'),MainViewModel.CAMERA_TEST,false),
  76. // new ItemData($r('app.string.speed_test'), $r('app.media.find_icon'),MainViewModel.SPEED_TEST,false),
  77. // new ItemData($r('app.string.mac_search'), $r('app.media.icon_mac'),MainViewModel.JIAO_CHENG,false),
  78. ];
  79. return firstGridData;
  80. }
  81. }
  82. export default new MainViewModel();