nwo
stringclasses
304 values
sha
stringclasses
304 values
path
stringlengths
9
214
language
stringclasses
1 value
identifier
stringlengths
0
49
docstring
stringlengths
1
34.2k
function
stringlengths
8
59.4k
ast_function
stringlengths
71
497k
obf_function
stringlengths
8
39.4k
url
stringlengths
102
324
function_sha
stringlengths
40
40
source
stringclasses
2 values
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/common/constants/CommonConstants.ets
arkts
一般属性信息
export class CommonConstants { static readonly RDB_NAME = { dbName: 'recordingInfo.db' } as CommonConstantsInfo; // db name /** 每日记账信息统计表 */ static readonly DAY_INFO = { tableName: 'dayInfo', columns: ['date', 'expense', 'income'] } as CommonConstantsInfo static readonly ACCOUNTING_INFO = { tableName: 'accountingInfo', columns: ['id', 'date', 'amount', 'category', 'typeName', 'icon', 'remark'] } as CommonConstantsInfo static readonly CATEGORY_INFO = { tableName: 'categoryInfo', columns: ['category', 'icon', 'index', 'typeName'] } as CommonConstantsInfo // THOUSANDTH static readonly THOUSANDTH_15: string = '1.5%'; // ‘1.5%’ static readonly THOUSANDTH_12: string = '2.2%'; // ‘2.2%’ static readonly THOUSANDTH_33: string = '3.3%'; // ‘3.3%’ static readonly THOUSANDTH_40: string = '4%'; // ‘4%’ static readonly THOUSANDTH_50: string = '5%'; // ‘5%’ static readonly THOUSANDTH_66: string = '6.6%'; // ‘6.6%’ static readonly THOUSANDTH_80: string = '8%'; // ‘8%’ static readonly THOUSANDTH_90: string = '9%'; // ‘9%’ static readonly THOUSANDTH_100: string = '10%'; // ‘10%’ static readonly THOUSANDTH_120: string = '12%'; // ‘12%’ static readonly THOUSANDTH_160: string = '16%'; // ‘16%’ static readonly THOUSANDTH_180: string = '18%'; // ‘18%’ static readonly THOUSANDTH_200: string = '20%'; // ‘20%’ static readonly THOUSANDTH_230: string = '23%'; // ‘23%’ static readonly THOUSANDTH_250: string = '25%'; // ‘25%’ static readonly THOUSANDTH_300: string = '30%'; // ‘30%’ static readonly THOUSANDTH_400: string = '40%'; // ‘40%’ static readonly THOUSANDTH_440: string = '44%'; // ‘44%’ static readonly THOUSANDTH_450: string = '45%'; // ‘45%’ static readonly THOUSANDTH_420: string = '42%'; // ‘42%’ static readonly THOUSANDTH_480: string = '48%'; // ‘48%’ static readonly THOUSANDTH_500: string = '50%'; // ‘50%’ static readonly THOUSANDTH_560: string = '56%'; // ‘56%’ static readonly THOUSANDTH_600: string = '60%'; // ‘60%’ static readonly THOUSANDTH_700: string = '70%'; // ‘70%’ static readonly THOUSANDTH_800: string = '80%'; // ‘80%’ static readonly THOUSANDTH_830: string = '83%'; // ‘83%’ static readonly THOUSANDTH_880: string = '88%'; // ‘88%’ static readonly THOUSANDTH_900: string = '90%'; // ‘90%’ static readonly THOUSANDTH_940: string = '94%'; // ‘94%’ static readonly THOUSANDTH_950: string = '95%'; // ‘95%’ static readonly THOUSANDTH_1000: string = '100%'; // ‘100%’ static readonly DEFAULT_1: number = 1; static readonly DEFAULT_2: number = 2; static readonly DEFAULT_4: number = 4; static readonly DEFAULT_6: number = 6; static readonly DEFAULT_8: number = 8; static readonly DEFAULT_12: number = 12; static readonly DEFAULT_10: number = 10; static readonly DEFAULT_16: number = 16; static readonly DEFAULT_18: number = 18; static readonly DEFAULT_20: number = 20; static readonly DEFAULT_24: number = 24; static readonly DEFAULT_28: number = 28; static readonly DEFAULT_32: number = 32; static readonly DEFAULT_36: number = 36; static readonly DEFAULT_48: number = 48; static readonly DEFAULT_56: number = 56; static readonly DEFAULT_60: number = 60; static readonly DEFAULT_100: number = 100; static readonly DEFAULT_180: number = 180; // 字体大小 static readonly FONT_WEIGHT_400: number = 400; static readonly FONT_WEIGHT_500: number = 500; static readonly FONT_WEIGHT_700: number = 700; static readonly FONT_WEIGHT_900: number = 900; // 透明度 static readonly OPACITY_4: number = 0.4; static readonly OPACITY_6: number = 0.6; // 边框曲率 static readonly BORDER_RADIUS_PERCENT_50: string = '50%'; static readonly BORDER_RADIUS_PERCENT_5: string = '5%'; // 间距 static readonly LIST_ITEM_SPACE: number = 2; static readonly SPACE_4: number = 4; // 列表 static readonly MOUTH_LIST = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10','11', '12']; static readonly YEAR_LIST = ["2020", "2021", "2022", "2023", "2024", "2025", "2026", "2027", "2028", '2029', '2030', '2031']; // navigation title static readonly ADD_TASK_TITLE: string = '添加任务'; static readonly EDIT_TASK_TITLE: string = '编辑任务'; // prompt message static readonly SETTING_FINISHED_MESSAGE = '设置完成!!!'; static readonly SETTING_FINISH_FAILED_MESSAGE = '网络连接错误'; static readonly CHOOSE_TIME_OUT_RANGE: string = '选择时间超出范围'; static readonly NICK_NAME = 'JoIin'; static readonly SIGNATURE = '这是一条简短地个人签'; static readonly HOME_BTN_Z = 1; // unit static readonly PER_DAY: string = '/ 天'; // global data key static readonly GLOBAL_KEY: string = 'global'; // RemindContent static readonly REMINDER_AGENT_TAG: string = 'reminderAgent'; static readonly PACKAGE_NAME: string = 'com.example.healthy_life'; static readonly ENTRY_ABILITY: string = 'EntryAbility'; // offset static readonly ZERO: number = 0; static readonly MINUS_20: number = -20; static readonly HAS_NO_INDEX: number = -1; static readonly OFFSET_24: number = -24; // letter spacing static readonly LETTER_1: number = 0.1; static readonly LETTER_34: number = 3.4; // achievement static readonly ACHIEVE_CARD_IMG_HEIGHT: number = 88; static readonly ACHIEVE_CARD_TOP: number = 38; static readonly ACHIEVE_CARD_BOTTOM: number = 10; static readonly ACHIEVE_SPLIT_RATIO: number = 1 / 3; static readonly ACHIEVE_TITLE_BAR_LEFT: number = 20; static readonly ACHIEVE_TITLE_BAR_TOP: number = 15; static readonly FULL_WIDTH: string = '100%'; static readonly FULL_HEIGHT: string = '100%'; static readonly WEEK_DAY_NUM: number = 7; // number days of one week static readonly WEEK_DAY_TIME: number = 7 * 24 * 60 * 60 * 1000; }
AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { AST#property_declaration#Left static readonly RDB_NAME = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left dbName AST#property_name#Right : AST#expression#Left 'recordingInfo.db' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left CommonConstantsInfo AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ; AST#property_declaration#Right // db name /** 每日记账信息统计表 */ AST#property_declaration#Left static readonly DAY_INFO = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left tableName AST#property_name#Right : AST#expression#Left 'dayInfo' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left columns AST#property_name#Right : AST#expression#Left AST#array_literal#Left [ AST#expression#Left 'date' AST#expression#Right , AST#expression#Left 'expense' AST#expression#Right , AST#expression#Left 'income' AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left CommonConstantsInfo AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#property_declaration#Right AST#property_declaration#Left static readonly ACCOUNTING_INFO = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left tableName AST#property_name#Right : AST#expression#Left 'accountingInfo' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left columns AST#property_name#Right : AST#expression#Left AST#array_literal#Left [ AST#expression#Left 'id' AST#expression#Right , AST#expression#Left 'date' AST#expression#Right , AST#expression#Left 'amount' AST#expression#Right , AST#expression#Left 'category' AST#expression#Right , AST#expression#Left 'typeName' AST#expression#Right , AST#expression#Left 'icon' AST#expression#Right , AST#expression#Left 'remark' AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left CommonConstantsInfo AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#property_declaration#Right AST#property_declaration#Left static readonly CATEGORY_INFO = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left tableName AST#property_name#Right : AST#expression#Left 'categoryInfo' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left columns AST#property_name#Right : AST#expression#Left AST#array_literal#Left [ AST#expression#Left 'category' AST#expression#Right , AST#expression#Left 'icon' AST#expression#Right , AST#expression#Left 'index' AST#expression#Right , AST#expression#Left 'typeName' AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left CommonConstantsInfo AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right // THOUSANDTH AST#property_declaration#Right AST#property_declaration#Left static readonly THOUSANDTH_15 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '1.5%' AST#expression#Right ; AST#property_declaration#Right // ‘1.5%’ AST#property_declaration#Left static readonly THOUSANDTH_12 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '2.2%' AST#expression#Right ; AST#property_declaration#Right // ‘2.2%’ AST#property_declaration#Left static readonly THOUSANDTH_33 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '3.3%' AST#expression#Right ; AST#property_declaration#Right // ‘3.3%’ AST#property_declaration#Left static readonly THOUSANDTH_40 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '4%' AST#expression#Right ; AST#property_declaration#Right // ‘4%’ AST#property_declaration#Left static readonly THOUSANDTH_50 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '5%' AST#expression#Right ; AST#property_declaration#Right // ‘5%’ AST#property_declaration#Left static readonly THOUSANDTH_66 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '6.6%' AST#expression#Right ; AST#property_declaration#Right // ‘6.6%’ AST#property_declaration#Left static readonly THOUSANDTH_80 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '8%' AST#expression#Right ; AST#property_declaration#Right // ‘8%’ AST#property_declaration#Left static readonly THOUSANDTH_90 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '9%' AST#expression#Right ; AST#property_declaration#Right // ‘9%’ AST#property_declaration#Left static readonly THOUSANDTH_100 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '10%' AST#expression#Right ; AST#property_declaration#Right // ‘10%’ AST#property_declaration#Left static readonly THOUSANDTH_120 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '12%' AST#expression#Right ; AST#property_declaration#Right // ‘12%’ AST#property_declaration#Left static readonly THOUSANDTH_160 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '16%' AST#expression#Right ; AST#property_declaration#Right // ‘16%’ AST#property_declaration#Left static readonly THOUSANDTH_180 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '18%' AST#expression#Right ; AST#property_declaration#Right // ‘18%’ AST#property_declaration#Left static readonly THOUSANDTH_200 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '20%' AST#expression#Right ; AST#property_declaration#Right // ‘20%’ AST#property_declaration#Left static readonly THOUSANDTH_230 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '23%' AST#expression#Right ; AST#property_declaration#Right // ‘23%’ AST#property_declaration#Left static readonly THOUSANDTH_250 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '25%' AST#expression#Right ; AST#property_declaration#Right // ‘25%’ AST#property_declaration#Left static readonly THOUSANDTH_300 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '30%' AST#expression#Right ; AST#property_declaration#Right // ‘30%’ AST#property_declaration#Left static readonly THOUSANDTH_400 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '40%' AST#expression#Right ; AST#property_declaration#Right // ‘40%’ AST#property_declaration#Left static readonly THOUSANDTH_440 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '44%' AST#expression#Right ; AST#property_declaration#Right // ‘44%’ AST#property_declaration#Left static readonly THOUSANDTH_450 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '45%' AST#expression#Right ; AST#property_declaration#Right // ‘45%’ AST#property_declaration#Left static readonly THOUSANDTH_420 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '42%' AST#expression#Right ; AST#property_declaration#Right // ‘42%’ AST#property_declaration#Left static readonly THOUSANDTH_480 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '48%' AST#expression#Right ; AST#property_declaration#Right // ‘48%’ AST#property_declaration#Left static readonly THOUSANDTH_500 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '50%' AST#expression#Right ; AST#property_declaration#Right // ‘50%’ AST#property_declaration#Left static readonly THOUSANDTH_560 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '56%' AST#expression#Right ; AST#property_declaration#Right // ‘56%’ AST#property_declaration#Left static readonly THOUSANDTH_600 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '60%' AST#expression#Right ; AST#property_declaration#Right // ‘60%’ AST#property_declaration#Left static readonly THOUSANDTH_700 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '70%' AST#expression#Right ; AST#property_declaration#Right // ‘70%’ AST#property_declaration#Left static readonly THOUSANDTH_800 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '80%' AST#expression#Right ; AST#property_declaration#Right // ‘80%’ AST#property_declaration#Left static readonly THOUSANDTH_830 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '83%' AST#expression#Right ; AST#property_declaration#Right // ‘83%’ AST#property_declaration#Left static readonly THOUSANDTH_880 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '88%' AST#expression#Right ; AST#property_declaration#Right // ‘88%’ AST#property_declaration#Left static readonly THOUSANDTH_900 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '90%' AST#expression#Right ; AST#property_declaration#Right // ‘90%’ AST#property_declaration#Left static readonly THOUSANDTH_940 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '94%' AST#expression#Right ; AST#property_declaration#Right // ‘94%’ AST#property_declaration#Left static readonly THOUSANDTH_950 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '95%' AST#expression#Right ; AST#property_declaration#Right // ‘95%’ AST#property_declaration#Left static readonly THOUSANDTH_1000 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '100%' AST#expression#Right ; AST#property_declaration#Right // ‘100%’ AST#property_declaration#Left static readonly DEFAULT_1 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_2 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 2 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_4 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 4 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_6 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 6 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_8 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 8 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_12 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 12 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_10 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 10 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_16 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 16 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_18 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 18 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_20 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 20 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_24 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 24 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_28 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 28 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_32 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 32 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_36 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 36 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_48 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 48 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_56 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 56 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_60 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 60 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_100 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 100 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly DEFAULT_180 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 180 AST#expression#Right ; AST#property_declaration#Right // 字体大小 AST#property_declaration#Left static readonly FONT_WEIGHT_400 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 400 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly FONT_WEIGHT_500 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 500 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly FONT_WEIGHT_700 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 700 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly FONT_WEIGHT_900 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 900 AST#expression#Right ; AST#property_declaration#Right // 透明度 AST#property_declaration#Left static readonly OPACITY_4 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.4 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly OPACITY_6 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.6 AST#expression#Right ; AST#property_declaration#Right // 边框曲率 AST#property_declaration#Left static readonly BORDER_RADIUS_PERCENT_50 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '50%' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly BORDER_RADIUS_PERCENT_5 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '5%' AST#expression#Right ; AST#property_declaration#Right // 间距 AST#property_declaration#Left static readonly LIST_ITEM_SPACE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 2 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly SPACE_4 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 4 AST#expression#Right ; AST#property_declaration#Right // 列表 AST#property_declaration#Left static readonly MOUTH_LIST = AST#expression#Left AST#array_literal#Left [ AST#expression#Left '1' AST#expression#Right , AST#expression#Left '2' AST#expression#Right , AST#expression#Left '3' AST#expression#Right , AST#expression#Left '4' AST#expression#Right , AST#expression#Left '5' AST#expression#Right , AST#expression#Left '6' AST#expression#Right , AST#expression#Left '7' AST#expression#Right , AST#expression#Left '8' AST#expression#Right , AST#expression#Left '9' AST#expression#Right , AST#expression#Left '10' AST#expression#Right , AST#expression#Left '11' AST#expression#Right , AST#expression#Left '12' AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly YEAR_LIST = AST#expression#Left AST#array_literal#Left [ AST#expression#Left "2020" AST#expression#Right , AST#expression#Left "2021" AST#expression#Right , AST#expression#Left "2022" AST#expression#Right , AST#expression#Left "2023" AST#expression#Right , AST#expression#Left "2024" AST#expression#Right , AST#expression#Left "2025" AST#expression#Right , AST#expression#Left "2026" AST#expression#Right , AST#expression#Left "2027" AST#expression#Right , AST#expression#Left "2028" AST#expression#Right , AST#expression#Left '2029' AST#expression#Right , AST#expression#Left '2030' AST#expression#Right , AST#expression#Left '2031' AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right // navigation title AST#property_declaration#Left static readonly ADD_TASK_TITLE : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '添加任务' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly EDIT_TASK_TITLE : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '编辑任务' AST#expression#Right ; AST#property_declaration#Right // prompt message AST#property_declaration#Left static readonly SETTING_FINISHED_MESSAGE = AST#expression#Left '设置完成!!!' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly SETTING_FINISH_FAILED_MESSAGE = AST#expression#Left '网络连接错误' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly CHOOSE_TIME_OUT_RANGE : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '选择时间超出范围' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly NICK_NAME = AST#expression#Left 'JoIin' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly SIGNATURE = AST#expression#Left '这是一条简短地个人签' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly HOME_BTN_Z = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right // unit AST#property_declaration#Left static readonly PER_DAY : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '/ 天' AST#expression#Right ; AST#property_declaration#Right // global data key AST#property_declaration#Left static readonly GLOBAL_KEY : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'global' AST#expression#Right ; AST#property_declaration#Right // RemindContent AST#property_declaration#Left static readonly REMINDER_AGENT_TAG : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'reminderAgent' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly PACKAGE_NAME : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'com.example.healthy_life' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ENTRY_ABILITY : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'EntryAbility' AST#expression#Right ; AST#property_declaration#Right // offset AST#property_declaration#Left static readonly ZERO : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly MINUS_20 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#unary_expression#Left - AST#expression#Left 20 AST#expression#Right AST#unary_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly HAS_NO_INDEX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#unary_expression#Left - AST#expression#Left 1 AST#expression#Right AST#unary_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly OFFSET_24 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#unary_expression#Left - AST#expression#Left 24 AST#expression#Right AST#unary_expression#Right AST#expression#Right ; AST#property_declaration#Right // letter spacing AST#property_declaration#Left static readonly LETTER_1 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.1 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly LETTER_34 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 3.4 AST#expression#Right ; AST#property_declaration#Right // achievement AST#property_declaration#Left static readonly ACHIEVE_CARD_IMG_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 88 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ACHIEVE_CARD_TOP : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 38 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ACHIEVE_CARD_BOTTOM : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 10 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ACHIEVE_SPLIT_RATIO : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left 1 AST#expression#Right / AST#expression#Left 3 AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ACHIEVE_TITLE_BAR_LEFT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 20 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ACHIEVE_TITLE_BAR_TOP : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 15 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly FULL_WIDTH : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '100%' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly FULL_HEIGHT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '100%' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly WEEK_DAY_NUM : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 7 AST#expression#Right ; AST#property_declaration#Right // number days of one week AST#property_declaration#Left static readonly WEEK_DAY_TIME : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 7 AST#expression#Right * AST#expression#Left 24 AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left 60 AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left 60 AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left 1000 AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class CommonConstants { static readonly RDB_NAME = { dbName: 'recordingInfo.db' } as CommonConstantsInfo; static readonly DAY_INFO = { tableName: 'dayInfo', columns: ['date', 'expense', 'income'] } as CommonConstantsInfo static readonly ACCOUNTING_INFO = { tableName: 'accountingInfo', columns: ['id', 'date', 'amount', 'category', 'typeName', 'icon', 'remark'] } as CommonConstantsInfo static readonly CATEGORY_INFO = { tableName: 'categoryInfo', columns: ['category', 'icon', 'index', 'typeName'] } as CommonConstantsInfo static readonly THOUSANDTH_15: string = '1.5%'; static readonly THOUSANDTH_12: string = '2.2%'; static readonly THOUSANDTH_33: string = '3.3%'; static readonly THOUSANDTH_40: string = '4%'; static readonly THOUSANDTH_50: string = '5%'; static readonly THOUSANDTH_66: string = '6.6%'; static readonly THOUSANDTH_80: string = '8%'; static readonly THOUSANDTH_90: string = '9%'; static readonly THOUSANDTH_100: string = '10%'; static readonly THOUSANDTH_120: string = '12%'; static readonly THOUSANDTH_160: string = '16%'; static readonly THOUSANDTH_180: string = '18%'; static readonly THOUSANDTH_200: string = '20%'; static readonly THOUSANDTH_230: string = '23%'; static readonly THOUSANDTH_250: string = '25%'; static readonly THOUSANDTH_300: string = '30%'; static readonly THOUSANDTH_400: string = '40%'; static readonly THOUSANDTH_440: string = '44%'; static readonly THOUSANDTH_450: string = '45%'; static readonly THOUSANDTH_420: string = '42%'; static readonly THOUSANDTH_480: string = '48%'; static readonly THOUSANDTH_500: string = '50%'; static readonly THOUSANDTH_560: string = '56%'; static readonly THOUSANDTH_600: string = '60%'; static readonly THOUSANDTH_700: string = '70%'; static readonly THOUSANDTH_800: string = '80%'; static readonly THOUSANDTH_830: string = '83%'; static readonly THOUSANDTH_880: string = '88%'; static readonly THOUSANDTH_900: string = '90%'; static readonly THOUSANDTH_940: string = '94%'; static readonly THOUSANDTH_950: string = '95%'; static readonly THOUSANDTH_1000: string = '100%'; static readonly DEFAULT_1: number = 1; static readonly DEFAULT_2: number = 2; static readonly DEFAULT_4: number = 4; static readonly DEFAULT_6: number = 6; static readonly DEFAULT_8: number = 8; static readonly DEFAULT_12: number = 12; static readonly DEFAULT_10: number = 10; static readonly DEFAULT_16: number = 16; static readonly DEFAULT_18: number = 18; static readonly DEFAULT_20: number = 20; static readonly DEFAULT_24: number = 24; static readonly DEFAULT_28: number = 28; static readonly DEFAULT_32: number = 32; static readonly DEFAULT_36: number = 36; static readonly DEFAULT_48: number = 48; static readonly DEFAULT_56: number = 56; static readonly DEFAULT_60: number = 60; static readonly DEFAULT_100: number = 100; static readonly DEFAULT_180: number = 180; static readonly FONT_WEIGHT_400: number = 400; static readonly FONT_WEIGHT_500: number = 500; static readonly FONT_WEIGHT_700: number = 700; static readonly FONT_WEIGHT_900: number = 900; static readonly OPACITY_4: number = 0.4; static readonly OPACITY_6: number = 0.6; static readonly BORDER_RADIUS_PERCENT_50: string = '50%'; static readonly BORDER_RADIUS_PERCENT_5: string = '5%'; static readonly LIST_ITEM_SPACE: number = 2; static readonly SPACE_4: number = 4; static readonly MOUTH_LIST = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10','11', '12']; static readonly YEAR_LIST = ["2020", "2021", "2022", "2023", "2024", "2025", "2026", "2027", "2028", '2029', '2030', '2031']; static readonly ADD_TASK_TITLE: string = '添加任务'; static readonly EDIT_TASK_TITLE: string = '编辑任务'; static readonly SETTING_FINISHED_MESSAGE = '设置完成!!!'; static readonly SETTING_FINISH_FAILED_MESSAGE = '网络连接错误'; static readonly CHOOSE_TIME_OUT_RANGE: string = '选择时间超出范围'; static readonly NICK_NAME = 'JoIin'; static readonly SIGNATURE = '这是一条简短地个人签'; static readonly HOME_BTN_Z = 1; static readonly PER_DAY: string = '/ 天'; static readonly GLOBAL_KEY: string = 'global'; static readonly REMINDER_AGENT_TAG: string = 'reminderAgent'; static readonly PACKAGE_NAME: string = 'com.example.healthy_life'; static readonly ENTRY_ABILITY: string = 'EntryAbility'; static readonly ZERO: number = 0; static readonly MINUS_20: number = -20; static readonly HAS_NO_INDEX: number = -1; static readonly OFFSET_24: number = -24; static readonly LETTER_1: number = 0.1; static readonly LETTER_34: number = 3.4; static readonly ACHIEVE_CARD_IMG_HEIGHT: number = 88; static readonly ACHIEVE_CARD_TOP: number = 38; static readonly ACHIEVE_CARD_BOTTOM: number = 10; static readonly ACHIEVE_SPLIT_RATIO: number = 1 / 3; static readonly ACHIEVE_TITLE_BAR_LEFT: number = 20; static readonly ACHIEVE_TITLE_BAR_TOP: number = 15; static readonly FULL_WIDTH: string = '100%'; static readonly FULL_HEIGHT: string = '100%'; static readonly WEEK_DAY_NUM: number = 7; static readonly WEEK_DAY_TIME: number = 7 * 24 * 60 * 60 * 1000; }
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/constants/CommonConstants.ets#L20-L207
708a6c3aba76371b93d116ae9f802ed63b93f76e
github
RedRackham-R/WanAndroidHarmoney.git
0bb2a7c8d7b49194a96e42a380d43b7e106cdb22
entry/src/main/ets/global/viewmodel/GlobalCollectViewModel.ets
arkts
unSubscribeUnCollectUrlEvent
取消收藏Url事件 @param key @param callback
unSubscribeUnCollectUrlEvent(key: string) { EventBus.getInstance().unregistByKey(WanEventId.EVENT_UNCOLLECT_URL, key) }
AST#method_declaration#Left unSubscribeUnCollectUrlEvent AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left EventBus AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . unregistByKey AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left WanEventId AST#expression#Right . EVENT_UNCOLLECT_URL AST#member_expression#Right AST#expression#Right , AST#expression#Left key AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
unSubscribeUnCollectUrlEvent(key: string) { EventBus.getInstance().unregistByKey(WanEventId.EVENT_UNCOLLECT_URL, key) }
https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/global/viewmodel/GlobalCollectViewModel.ets#L143-L145
3eb320c60881a7e6f7a62da2ba918c6985fea396
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@system.router.d.ets
arkts
getState
Obtains information about the current page state. @returns { RouterState } Page state. @syscap SystemCapability.ArkUI.ArkUI.Full @since 3 @deprecated since 8
static getState(): RouterState;
AST#method_declaration#Left static getState AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left RouterState AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right
static getState(): RouterState;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@system.router.d.ets#L311-L311
205e57bbe1d61995c1d4d588bd752f4e9a85a532
gitee
pangpang20/wavecast.git
d3da8a0009eb44a576a2b9d9d9fe6195a2577e32
entry/src/main/ets/pages/MainPage.ets
arkts
buildQueueTab
队列页签
@Builder buildQueueTab() { Column() { if (this.queueEpisodes.length === 0) { this.buildEmptyView('播放队列为空', '添加单集到队列'); } else { // 队列操作栏 Row() { Text(`待听 ${this.queueEpisodes.length} 集`) .fontSize(14) .fontColor($r('app.color.text_secondary')) Blank() Button('清空队列') .height(32) .fontSize(12) .backgroundColor($r('app.color.accent_red')) .fontColor($r('app.color.text_on_primary')) .onClick(async () => { console.info('[MainPage] Clear queue'); await this.dbService.clearQueue(); await this.loadQueue(); }) } .width('100%') .padding({ left: 16, right: 16, top: 12, bottom: 8 }) List({ space: 8 }) { ForEach(this.queueEpisodes, (episode: Episode, index: number) => { ListItem() { this.buildQueueItem(episode, index); } }, (episode: Episode) => episode.id) } .width('100%') .layoutWeight(1) .padding({ left: 16, right: 16, bottom: 16 }) } } .width('100%') .height('100%') }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildQueueTab AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . queueEpisodes AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . buildEmptyView AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '播放队列为空' AST#expression#Right , AST#expression#Left '添加单集到队列' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } else { // 队列操作栏 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` 待听 AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . queueEpisodes AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right 集 ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 14 AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.text_secondary' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Blank ( ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Button ( AST#expression#Left '清空队列' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . height ( AST#expression#Left 32 AST#expression#Right ) AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.accent_red' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.text_on_primary' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left async AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '[MainPage] Clear queue' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . dbService AST#member_expression#Right AST#expression#Right . clearQueue AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . loadQueue AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left left AST#property_name#Right : AST#expression#Left 16 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left right AST#property_name#Right : AST#expression#Left 16 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left 12 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left 8 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left List ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 8 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#for_each_statement#Left ForEach ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . queueEpisodes AST#member_expression#Right AST#expression#Right , AST#ui_builder_arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left episode : AST#type_annotation#Left AST#primary_type#Left Episode AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#ui_arrow_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ListItem ( ) AST#container_content_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . buildQueueItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left episode AST#expression#Right , AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_arrow_function_body#Right AST#ui_builder_arrow_function#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left episode : AST#type_annotation#Left AST#primary_type#Left Episode AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#member_expression#Left AST#expression#Left episode AST#expression#Right . id AST#member_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#for_each_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . layoutWeight ( AST#expression#Left 1 AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left left AST#property_name#Right : AST#expression#Left 16 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left right AST#property_name#Right : AST#expression#Left 16 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left 16 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder buildQueueTab() { Column() { if (this.queueEpisodes.length === 0) { this.buildEmptyView('播放队列为空', '添加单集到队列'); } else { Row() { Text(`待听 ${this.queueEpisodes.length} 集`) .fontSize(14) .fontColor($r('app.color.text_secondary')) Blank() Button('清空队列') .height(32) .fontSize(12) .backgroundColor($r('app.color.accent_red')) .fontColor($r('app.color.text_on_primary')) .onClick(async () => { console.info('[MainPage] Clear queue'); await this.dbService.clearQueue(); await this.loadQueue(); }) } .width('100%') .padding({ left: 16, right: 16, top: 12, bottom: 8 }) List({ space: 8 }) { ForEach(this.queueEpisodes, (episode: Episode, index: number) => { ListItem() { this.buildQueueItem(episode, index); } }, (episode: Episode) => episode.id) } .width('100%') .layoutWeight(1) .padding({ left: 16, right: 16, bottom: 16 }) } } .width('100%') .height('100%') }
https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/MainPage.ets#L706-L748
ac410173ef7d699e4f302b40376be31025b55394
github
JackJiang2011/harmonychat.git
bca3f3e1ce54d763720510f99acf595a49e37879
entry/src/main/ets/pages/ChatPage.ets
arkts
switchToLoginPage
切换到登陆界面。
switchToLoginPage() { // init MobileIMSDK first(必须保证此代码被调用,否则IM框架无法完成IM服务器的连接等工作) IMClientManager.getInstance().initMobileIMSDK(getContext(this).getApplicationContext(), getContext(this).eventHub); // goto login page! router.replaceUrl({ url: 'pages/LoginPage', }); }
AST#method_declaration#Left switchToLoginPage AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // init MobileIMSDK first(必须保证此代码被调用,否则IM框架无法完成IM服务器的连接等工作) AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left IMClientManager AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . initMobileIMSDK AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left getContext AST#expression#Right AST#argument_list#Left ( AST#expression#Left this AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . getApplicationContext AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left getContext AST#expression#Right AST#argument_list#Left ( AST#expression#Left this AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . eventHub AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right // goto login page! AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left router AST#expression#Right . replaceUrl AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left url AST#property_name#Right : AST#expression#Left 'pages/LoginPage' AST#expression#Right AST#property_assignment#Right , } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
switchToLoginPage() { IMClientManager.getInstance().initMobileIMSDK(getContext(this).getApplicationContext(), getContext(this).eventHub); router.replaceUrl({ url: 'pages/LoginPage', }); }
https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/pages/ChatPage.ets#L220-L225
baa7f427b8e40b09fa559e8cca1f4947d68dbb3a
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/settings/LLMConfigPage.ets
arkts
buildBasicConfigSection
构建基础配置区域
@Builder buildBasicConfigSection() { Column({ space: 16 }) { Text('基础配置') .fontSize(18) .fontWeight(FontWeight.Medium) .fontColor('#333333') .alignSelf(ItemAlign.Start) // API密钥 Column({ space: 8 }) { Text('API密钥') .fontSize(14) .fontWeight(FontWeight.Medium) .fontColor('#333333') .alignSelf(ItemAlign.Start) TextArea({ placeholder: '请输入API密钥', text: this.apiKey }) .fontSize(14) .backgroundColor('#f8f9fa') .borderRadius(8) .padding(12) .onChange((value: string) => { this.apiKey = value; }) } .width('100%') // 自定义基础URL(可选) Column({ space: 8 }) { Row() { Text('API地址') .fontSize(14) .fontWeight(FontWeight.Medium) .fontColor('#333333') .layoutWeight(1) Text('可选') .fontSize(12) .fontColor('#999999') } .width('100%') TextInput({ placeholder: '留空使用默认地址', text: this.baseUrl }) .fontSize(14) .backgroundColor('#f8f9fa') .borderRadius(8) .padding(12) .onChange((value: string) => { this.baseUrl = value; }) } .width('100%') // 模型选择 Column({ space: 8 }) { Text('模型') .fontSize(14) .fontWeight(FontWeight.Medium) .fontColor('#333333') .alignSelf(ItemAlign.Start) this.buildModelSelection() } .width('100%') } .width('100%') .padding(16) .backgroundColor('#ffffff') .borderRadius(12) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildBasicConfigSection AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 16 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left '基础配置' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 18 AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left AST#member_expression#Left AST#expression#Left FontWeight AST#expression#Right . Medium AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left '#333333' AST#expression#Right ) AST#modifier_chain_expression#Left . alignSelf ( AST#expression#Left AST#member_expression#Left AST#expression#Left ItemAlign AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // API密钥 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 8 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left 'API密钥' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 14 AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left AST#member_expression#Left AST#expression#Left FontWeight AST#expression#Right . Medium AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left '#333333' AST#expression#Right ) AST#modifier_chain_expression#Left . alignSelf ( AST#expression#Left AST#member_expression#Left AST#expression#Left ItemAlign AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left TextArea ( AST#component_parameters#Left { AST#component_parameter#Left placeholder : AST#expression#Left '请输入API密钥' AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left text : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . apiKey AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 14 AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left '#f8f9fa' AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 8 AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Left . onChange ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . apiKey AST#member_expression#Right = AST#expression#Left value AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 自定义基础URL(可选) AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 8 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left 'API地址' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 14 AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left AST#member_expression#Left AST#expression#Left FontWeight AST#expression#Right . Medium AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left '#333333' AST#expression#Right ) AST#modifier_chain_expression#Left . layoutWeight ( AST#expression#Left 1 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left '可选' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left '#999999' AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left TextInput ( AST#component_parameters#Left { AST#component_parameter#Left placeholder : AST#expression#Left '留空使用默认地址' AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left text : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . baseUrl AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 14 AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left '#f8f9fa' AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 8 AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Left . onChange ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . baseUrl AST#member_expression#Right = AST#expression#Left value AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 模型选择 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 8 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left '模型' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 14 AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left AST#member_expression#Left AST#expression#Left FontWeight AST#expression#Right . Medium AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left '#333333' AST#expression#Right ) AST#modifier_chain_expression#Left . alignSelf ( AST#expression#Left AST#member_expression#Left AST#expression#Left ItemAlign AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . buildModelSelection AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left 16 AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left '#ffffff' AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder buildBasicConfigSection() { Column({ space: 16 }) { Text('基础配置') .fontSize(18) .fontWeight(FontWeight.Medium) .fontColor('#333333') .alignSelf(ItemAlign.Start) Column({ space: 8 }) { Text('API密钥') .fontSize(14) .fontWeight(FontWeight.Medium) .fontColor('#333333') .alignSelf(ItemAlign.Start) TextArea({ placeholder: '请输入API密钥', text: this.apiKey }) .fontSize(14) .backgroundColor('#f8f9fa') .borderRadius(8) .padding(12) .onChange((value: string) => { this.apiKey = value; }) } .width('100%') Column({ space: 8 }) { Row() { Text('API地址') .fontSize(14) .fontWeight(FontWeight.Medium) .fontColor('#333333') .layoutWeight(1) Text('可选') .fontSize(12) .fontColor('#999999') } .width('100%') TextInput({ placeholder: '留空使用默认地址', text: this.baseUrl }) .fontSize(14) .backgroundColor('#f8f9fa') .borderRadius(8) .padding(12) .onChange((value: string) => { this.baseUrl = value; }) } .width('100%') Column({ space: 8 }) { Text('模型') .fontSize(14) .fontWeight(FontWeight.Medium) .fontColor('#333333') .alignSelf(ItemAlign.Start) this.buildModelSelection() } .width('100%') } .width('100%') .padding(16) .backgroundColor('#ffffff') .borderRadius(12) }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LLMConfigPage.ets#L276-L352
e2ba826db67835a37b354a7e1866b6d2461b740c
github
lentozi/DailyPlan.git
96ce0bec8f545511c51b577c4aa8327c2c5bb0c8
entry/src/main/ets/tabcontent/HomeContent.ets
arkts
stackState
@Watch
stackState() { this.index = this.state.index; hilog.info(0x0000, '[Debug.HomeContent]', this.index.toString()) this.getCurrentDayTodo(); }
AST#method_declaration#Left stackState AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . index AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . state AST#member_expression#Right AST#expression#Right . index AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0000 AST#expression#Right , AST#expression#Left '[Debug.HomeContent]' AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . index AST#member_expression#Right AST#expression#Right . toString AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getCurrentDayTodo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
stackState() { this.index = this.state.index; hilog.info(0x0000, '[Debug.HomeContent]', this.index.toString()) this.getCurrentDayTodo(); }
https://github.com/lentozi/DailyPlan.git/blob/96ce0bec8f545511c51b577c4aa8327c2c5bb0c8/entry/src/main/ets/tabcontent/HomeContent.ets#L45-L49
78093490dcc1d932064bb1adbafa47ec9232e946
github
wenfujing/honms-super-market.git
0858abecd8be5db7b8dcf88dcd77b7c66d37517a
common/src/main/ets/utils/CommonDataSource.ets
arkts
Data Change Listener.
export class CommonDataSource<T> implements IDataSource { private dataArray: T[] = [] private listeners: DataChangeListener[] = [] constructor
AST#export_declaration#Left export AST#ERROR#Left class CommonDataSource AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#implements_clause#Left implements IDataSource AST#implements_clause#Right { AST#property_declaration#Left private dataArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left T [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#property_declaration#Right private listeners : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left DataChangeListener [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#ERROR#Right AST#variable_declaration#Left const AST#variable_declarator#Left ructor AST#variable_declarator#Right AST#variable_declaration#Right AST#export_declaration#Right
export class CommonDataSource<T> implements IDataSource { private dataArray: T[] = [] private listeners: DataChangeListener[] = [] constructor
https://github.com/wenfujing/honms-super-market.git/blob/0858abecd8be5db7b8dcf88dcd77b7c66d37517a/common/src/main/ets/utils/CommonDataSource.ets#L4-L8
deadcacb584098dbaab0659027f80bb120c55546
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.atomicservice.HalfScreenLaunchComponent.d.ets
arkts
HalfScreenLaunchComponent
Declare component HalfScreenLaunchComponent @struct { HalfScreenLaunchComponent } @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 18
@Component export declare struct HalfScreenLaunchComponent { /** * Sets the component content. * @type { Callback<void> } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ @BuilderParam content: Callback<void>; /** * Indicates atomic service appId. * @type { string } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ appId: string; /** * Indicates the atomic service start options. * @type { ?AtomicServiceOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ options?: AtomicServiceOptions; /** * Indicates the callback of onError. * @type { ?ErrorCallback } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ onError?: ErrorCallback; /** * Indicates the callback of onTerminated. * @type { ?Callback<TerminationInfo> } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ onTerminated?: Callback<TerminationInfo>; /** * Indicates the callback of onReceive. * @type { ?Callback<Record<string, Object>> } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 20 */ onReceive?: Callback<Record<string, Object>>; }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct HalfScreenLaunchComponent AST#component_body#Left { /** * Sets the component content. * @type { Callback<void> } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left AST#decorator#Left @ BuilderParam AST#decorator#Right content : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Callback AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Indicates atomic service appId. * @type { string } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left appId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Indicates the atomic service start options. * @type { ?AtomicServiceOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left options ? : AST#type_annotation#Left AST#primary_type#Left AtomicServiceOptions AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Indicates the callback of onError. * @type { ?ErrorCallback } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left onError ? : AST#type_annotation#Left AST#primary_type#Left ErrorCallback AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Indicates the callback of onTerminated. * @type { ?Callback<TerminationInfo> } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left onTerminated ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Callback AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left TerminationInfo AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Indicates the callback of onReceive. * @type { ?Callback<Record<string, Object>> } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 20 */ AST#property_declaration#Left onReceive ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Callback AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right } AST#component_body#Right AST#decorated_export_declaration#Right
@Component export declare struct HalfScreenLaunchComponent { @BuilderParam content: Callback<void>; appId: string; options?: AtomicServiceOptions; onError?: ErrorCallback; onTerminated?: Callback<TerminationInfo>; onReceive?: Callback<Record<string, Object>>; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.atomicservice.HalfScreenLaunchComponent.d.ets#L31-L82
cb21044e51b8ae391cab3e4ae8dc931e6b0078bc
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/word/WordDbAccess.ets
arkts
private db: DBAccessor | null = null;
constructor(textDb: string | null) { this.textDb = textDb; if (this.resDb) { //this.db = new DBAccessor(this.resDb.filePath, null); } this.init(); }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left textDb : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textDb AST#member_expression#Right = AST#expression#Left textDb AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . resDb AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { //this.db = new DBAccessor(this.resDb.filePath, null); } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . init AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right
constructor(textDb: string | null) { this.textDb = textDb; if (this.resDb) { } this.init(); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/word/WordDbAccess.ets#L54-L62
d61a88d28f6f7a0af7f0f69e39ddcd967f09a3e7
github
hqj201013136012/HarmonyMiliUiPro.git
0625e681e07b771998a0ac4430824627d0eb60ed
entry/src/main/ets/utils/speech/AudioCapturerHelper.ets
arkts
onReadDataCallback
监听音频数据读取回调事件(当需要读取音频流数据时触发),使用callback方式返回结果. @param filePath 文件全路径 @returns
static onReadDataCallback(filePath: string) { let bufferSize: number = 0; AudioCapturerHelper.file = Helper.openSync(filePath); let readDataCallback: Callback<ArrayBuffer> = (buffer: ArrayBuffer) => { Helper.writeSync(AudioCapturerHelper.file!!.fd, buffer, { offset: bufferSize, length: buffer.byteLength }); bufferSize += buffer.byteLength; }; AudioCapturerHelper.audioCapturer?.on('readData', readDataCallback); return filePath; }
AST#method_declaration#Left static onReadDataCallback AST#parameter_list#Left ( AST#parameter#Left filePath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left bufferSize : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AudioCapturerHelper AST#expression#Right . file AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Helper AST#expression#Right . openSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left filePath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left readDataCallback : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Callback AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left buffer : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Helper AST#expression#Right . writeSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AudioCapturerHelper AST#expression#Right . file AST#member_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right . fd AST#member_expression#Right AST#expression#Right , AST#expression#Left buffer AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left offset AST#property_name#Right : AST#expression#Left bufferSize AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left length AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left buffer AST#expression#Right . byteLength AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left bufferSize += AST#expression#Left AST#member_expression#Left AST#expression#Left buffer AST#expression#Right . byteLength AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AudioCapturerHelper AST#expression#Right . audioCapturer AST#member_expression#Right AST#expression#Right ?. on AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'readData' AST#expression#Right , AST#expression#Left readDataCallback AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left filePath AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static onReadDataCallback(filePath: string) { let bufferSize: number = 0; AudioCapturerHelper.file = Helper.openSync(filePath); let readDataCallback: Callback<ArrayBuffer> = (buffer: ArrayBuffer) => { Helper.writeSync(AudioCapturerHelper.file!!.fd, buffer, { offset: bufferSize, length: buffer.byteLength }); bufferSize += buffer.byteLength; }; AudioCapturerHelper.audioCapturer?.on('readData', readDataCallback); return filePath; }
https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/utils/speech/AudioCapturerHelper.ets#L76-L85
d97a89667f828976b1e43e823a2c08b5ecbbb31c
github
chenyy0708/wanharmony.git
00e95a536122accf51518d674989d12fafbf37c2
entry/src/main/ets/view/TabBar.ets
arkts
TabBar
The tabBar component.
@Component @Preview export default struct TabBar { @State tabBarArray: TabBean[] = MainViewModel.getTabList(); @State currentIndex: number = 0; @State currentPage: number = 1; @Provide('isBig') isBig: boolean = false; @Builder TabBuilder(index: number, tabBean: TabBean) { Column() { Text(this.tabBarArray[index].name) .fontWeight(this.currentIndex === index ? Const.TabBars_SELECT_TEXT_FONT_WEIGHT : Const.TabBars_UN_SELECT_TEXT_FONT_WEIGHT) .fontSize(14) .fontColor($r('app.color.fontColor_text3')).margin({ bottom: 2 }) Image(tabBean.icon).height(20).width(20) } } aboutToAppear() { } build() { Tabs() { ForEach(this.tabBarArray, (tabsItem: TabBean, index) => { TabContent() { Column() { if (index === 0) { ArticleList({ currentIndex: $currentIndex }) } else if (index === 1) { KnowledgeList() } else if (index === 3) { NavigationList() } else if (index === 4) { ProjectList() } else { Text(tabsItem.name) .onClick(() => { this.isBig = !this.isBig }) .backgroundColor('#00ff00') .height(this.isBig ? 400 : 200) .animation({ duration: 1000, tempo: 3.0, delay: 0, curve: Curve.Linear, playMode: PlayMode.Normal, iterations: 1 }) } } } .tabBar(this.TabBuilder(index, tabsItem)) }, (item: TabBean) => JSON.stringify(item)); } .barHeight(50) .barPosition(BarPosition.End) .barMode(BarMode.Fixed) .barWidth(Const.TabBars_BAR_WIDTH) .backgroundColor($r('app.color.white')) .onChange((index: number) => { this.currentIndex = index; this.currentPage = 1; }) .vertical(false) } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right AST#decorator#Left @ Preview AST#decorator#Right export default struct TabBar AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right tabBarArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TabBean [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left MainViewModel AST#expression#Right . getTabList AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right currentIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right currentPage : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ Provide ( AST#expression#Left 'isBig' AST#expression#Right ) AST#decorator#Right isBig : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right TabBuilder AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left tabBean : AST#type_annotation#Left AST#primary_type#Left TabBean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabBarArray AST#member_expression#Right AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . name AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left Const AST#expression#Right . TabBars_SELECT_TEXT_FONT_WEIGHT AST#member_expression#Right AST#expression#Right : AST#expression#Left Const AST#expression#Right AST#conditional_expression#Right AST#expression#Right . TabBars_UN_SELECT_TEXT_FONT_WEIGHT AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 14 AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.fontColor_text3' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left 2 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Image ( AST#expression#Left AST#member_expression#Left AST#expression#Left tabBean AST#expression#Right . icon AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . height ( AST#expression#Left 20 AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left 20 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Tabs ( ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#for_each_statement#Left ForEach ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabBarArray AST#member_expression#Right AST#expression#Right , AST#ui_builder_arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left tabsItem : AST#type_annotation#Left AST#primary_type#Left TabBean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left index AST#parameter#Right ) AST#parameter_list#Right => AST#ui_arrow_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left TabContent ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ArticleList ( AST#component_parameters#Left { AST#component_parameter#Left currentIndex : AST#expression#Left $currentIndex AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } else AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left KnowledgeList ( ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } else AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left 3 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left NavigationList ( ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } else AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left 4 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ProjectList ( ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } else { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#member_expression#Left AST#expression#Left tabsItem AST#expression#Right . name AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isBig AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right . isBig AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left '#00ff00' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isBig AST#member_expression#Right AST#expression#Right ? AST#expression#Left 400 AST#expression#Right : AST#expression#Left 200 AST#expression#Right AST#conditional_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . animation ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left duration AST#property_name#Right : AST#expression#Left 1000 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left tempo AST#property_name#Right : AST#expression#Left 3.0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left delay AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left curve AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Curve AST#expression#Right . Linear AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left playMode AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left PlayMode AST#expression#Right . Normal AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left iterations AST#property_name#Right : AST#expression#Left 1 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_if_statement#Right AST#ui_if_statement#Right AST#ui_if_statement#Right AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . tabBar ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . TabBuilder AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right , AST#expression#Left tabsItem AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_arrow_function_body#Right AST#ui_builder_arrow_function#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left TabBean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left item AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#for_each_statement#Right AST#ui_control_flow#Right AST#ERROR#Left ; AST#ERROR#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . barHeight ( AST#expression#Left 50 AST#expression#Right ) AST#modifier_chain_expression#Left . barPosition ( AST#expression#Left AST#member_expression#Left AST#expression#Left BarPosition AST#expression#Right . End AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . barMode ( AST#expression#Left AST#member_expression#Left AST#expression#Left BarMode AST#expression#Right . Fixed AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . barWidth ( AST#expression#Left AST#member_expression#Left AST#expression#Left Const AST#expression#Right . TabBars_BAR_WIDTH AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.white' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . onChange ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right = AST#expression#Left index AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentPage AST#member_expression#Right = AST#expression#Left 1 AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Left . vertical ( AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#build_body#Right AST#build_method#Right } AST#component_body#Right AST#decorated_export_declaration#Right
@Component @Preview export default struct TabBar { @State tabBarArray: TabBean[] = MainViewModel.getTabList(); @State currentIndex: number = 0; @State currentPage: number = 1; @Provide('isBig') isBig: boolean = false; @Builder TabBuilder(index: number, tabBean: TabBean) { Column() { Text(this.tabBarArray[index].name) .fontWeight(this.currentIndex === index ? Const.TabBars_SELECT_TEXT_FONT_WEIGHT : Const.TabBars_UN_SELECT_TEXT_FONT_WEIGHT) .fontSize(14) .fontColor($r('app.color.fontColor_text3')).margin({ bottom: 2 }) Image(tabBean.icon).height(20).width(20) } } aboutToAppear() { } build() { Tabs() { ForEach(this.tabBarArray, (tabsItem: TabBean, index) => { TabContent() { Column() { if (index === 0) { ArticleList({ currentIndex: $currentIndex }) } else if (index === 1) { KnowledgeList() } else if (index === 3) { NavigationList() } else if (index === 4) { ProjectList() } else { Text(tabsItem.name) .onClick(() => { this.isBig = !this.isBig }) .backgroundColor('#00ff00') .height(this.isBig ? 400 : 200) .animation({ duration: 1000, tempo: 3.0, delay: 0, curve: Curve.Linear, playMode: PlayMode.Normal, iterations: 1 }) } } } .tabBar(this.TabBuilder(index, tabsItem)) }, (item: TabBean) => JSON.stringify(item)); } .barHeight(50) .barPosition(BarPosition.End) .barMode(BarMode.Fixed) .barWidth(Const.TabBars_BAR_WIDTH) .backgroundColor($r('app.color.white')) .onChange((index: number) => { this.currentIndex = index; this.currentPage = 1; }) .vertical(false) } }
https://github.com/chenyy0708/wanharmony.git/blob/00e95a536122accf51518d674989d12fafbf37c2/entry/src/main/ets/view/TabBar.ets#L26-L94
350f2612c6df3f6b44e44987f27ef6c3c4dc13f4
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/database/DatabaseService.ets
arkts
getAllContacts
获取所有联系人
async getAllContacts(): Promise<ContactEntity[]> { this.checkInitialization(); return await this.contactDAO.getAllContacts(); }
AST#method_declaration#Left async getAllContacts AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ContactEntity [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . checkInitialization AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . contactDAO AST#member_expression#Right AST#expression#Right . getAllContacts AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async getAllContacts(): Promise<ContactEntity[]> { this.checkInitialization(); return await this.contactDAO.getAllContacts(); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/database/DatabaseService.ets#L99-L102
c90b045137df625db7f795837a77da911589c0c8
github
kumaleap/ArkSwipeDeck.git
5afa77b9b2a2a531595d31f895c54a3371e4249a
library/Index.ets
arkts
AnimationUtils
导出工具类
export { AnimationUtils } from './src/main/ets/utils/AnimationUtils';
AST#export_declaration#Left export { AnimationUtils } from './src/main/ets/utils/AnimationUtils' ; AST#export_declaration#Right
export { AnimationUtils } from './src/main/ets/utils/AnimationUtils';
https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/Index.ets#L31-L31
bfd63053e1e320121b76be6e3309be33b765f56c
github
RedRackham-R/WanAndroidHarmoney.git
0bb2a7c8d7b49194a96e42a380d43b7e106cdb22
entry/src/main/ets/ui/pages/collect/CollectPage.ets
arkts
pageTransition
转场动画 从右边弹出
pageTransition() { // 定义页面进入时的效果,从右侧滑入,时长为1200ms,页面栈发生push操作时该效果才生效 PageTransitionEnter({ type: RouteType.Push, duration: 300 }) .slide(SlideEffect.Right) // 定义页面进入时的效果,从左侧滑入,时长为1200ms,页面栈发生pop操作时该效果才生效 PageTransitionEnter({ type: RouteType.Pop, duration: 300 }) .translate({ x: -100, y: 0, }) // 定义页面退出时的效果,向左侧滑出,时长为1000ms,页面栈发生push操作时该效果才生效 PageTransitionExit({ type: RouteType.Push, duration: 300 }) .translate({ x: -100, y: 0, }) // 定义页面退出时的效果,向右侧滑出,时长为1000ms,页面栈发生pop操作时该效果才生效 PageTransitionExit({ type: RouteType.Pop, duration: 300 }) .slide(SlideEffect.Right) }
AST#method_declaration#Left pageTransition AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 定义页面进入时的效果,从右侧滑入,时长为1200ms,页面栈发生push操作时该效果才生效 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left PageTransitionEnter ( AST#component_parameters#Left { AST#component_parameter#Left type : AST#expression#Left AST#member_expression#Left AST#expression#Left RouteType AST#expression#Right . Push AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left duration : AST#expression#Left 300 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . slide ( AST#expression#Left AST#member_expression#Left AST#expression#Left SlideEffect AST#expression#Right . Right AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 定义页面进入时的效果,从左侧滑入,时长为1200ms,页面栈发生pop操作时该效果才生效 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left PageTransitionEnter ( AST#component_parameters#Left { AST#component_parameter#Left type : AST#expression#Left AST#member_expression#Left AST#expression#Left RouteType AST#expression#Right . Pop AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left duration : AST#expression#Left 300 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . translate ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left x AST#property_name#Right : AST#expression#Left AST#unary_expression#Left - AST#expression#Left 100 AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left y AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 定义页面退出时的效果,向左侧滑出,时长为1000ms,页面栈发生push操作时该效果才生效 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left PageTransitionExit ( AST#component_parameters#Left { AST#component_parameter#Left type : AST#expression#Left AST#member_expression#Left AST#expression#Left RouteType AST#expression#Right . Push AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left duration : AST#expression#Left 300 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . translate ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left x AST#property_name#Right : AST#expression#Left AST#unary_expression#Left - AST#expression#Left 100 AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left y AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 定义页面退出时的效果,向右侧滑出,时长为1000ms,页面栈发生pop操作时该效果才生效 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left PageTransitionExit ( AST#component_parameters#Left { AST#component_parameter#Left type : AST#expression#Left AST#member_expression#Left AST#expression#Left RouteType AST#expression#Right . Pop AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left duration : AST#expression#Left 300 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . slide ( AST#expression#Left AST#member_expression#Left AST#expression#Left SlideEffect AST#expression#Right . Right AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
pageTransition() { PageTransitionEnter({ type: RouteType.Push, duration: 300 }) .slide(SlideEffect.Right) PageTransitionEnter({ type: RouteType.Pop, duration: 300 }) .translate({ x: -100, y: 0, }) PageTransitionExit({ type: RouteType.Push, duration: 300 }) .translate({ x: -100, y: 0, }) PageTransitionExit({ type: RouteType.Pop, duration: 300 }) .slide(SlideEffect.Right) }
https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/ui/pages/collect/CollectPage.ets#L78-L101
63065bc436006834f776a84f350aec5d1a13349c
github
waylau/harmonyos-tutorial
74e23dfa769317f8f057cc77c2d09f0b1f2e0773
samples/ArkTSAudioCapturer/entry/src/main/ets/pages/Index.ets
arkts
getAudioCapturer
获取音频采集器实例
async getAudioCapturer() { // 如果已经存在,直接返回 if (this.audioCapturer) { return this.audioCapturer } // 创建音频采集器 const audioCapturer = await audio.createAudioCapturer({ streamInfo: this.audioStreamInfo, capturerInfo: this.audioCapturerInfo }) // 保存方便下次直接获取 this.audioCapturer = audioCapturer // 返回音频采集器 return audioCapturer }
AST#method_declaration#Left async getAudioCapturer AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 如果已经存在,直接返回 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . audioCapturer AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . audioCapturer AST#member_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 创建音频采集器 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left audioCapturer = AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left audio AST#expression#Right AST#await_expression#Right AST#expression#Right . createAudioCapturer AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left streamInfo AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . audioStreamInfo AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left capturerInfo AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . audioCapturerInfo AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right // 保存方便下次直接获取 AST#ERROR#Left this AST#ERROR#Right . audioCapturer AST#member_expression#Right = AST#expression#Left audioCapturer AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#variable_declarator#Right // 返回音频采集器 AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left audioCapturer AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async getAudioCapturer() { if (this.audioCapturer) { return this.audioCapturer } const audioCapturer = await audio.createAudioCapturer({ streamInfo: this.audioStreamInfo, capturerInfo: this.audioCapturerInfo }) this.audioCapturer = audioCapturer return audioCapturer }
https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkTSAudioCapturer/entry/src/main/ets/pages/Index.ets#L85-L99
689829d1cf60e745e28c586835a740808c433797
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Scroll.ets
arkts
MediumPaddingVerticalScroll
带中等内边距的垂直滚动布局
@ComponentV2 export struct MediumPaddingVerticalScroll { /** * 滚动控制器 */ @Param scroller: Scroller = new Scroller(); /** * 是否填充最大尺寸 */ @Param fillMaxSize: boolean = false; /** * 是否填充最大宽度 */ @Param fillMaxWidth: boolean = true; /** * 宽度 */ @Param widthValue: Length | undefined = undefined; /** * 高度 */ @Param heightValue: Length | undefined = undefined; /** * 滚动条状态 */ @Param scrollBarState: BarState = BarState.Off; /** * 内容构建函数 */ @BuilderParam content: CustomBuilder; /** * 构建带中等内边距的垂直滚动布局 * @returns {void} 无返回值 */ build(): void { VerticalScroll({ scroller: this.scroller, fillMaxSize: this.fillMaxSize, fillMaxWidth: this.fillMaxWidth, widthValue: this.widthValue, heightValue: this.heightValue, scrollBarState: this.scrollBarState, paddingValue: $r("app.float.space_padding_medium"), content: this.content }); } }
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct MediumPaddingVerticalScroll AST#component_body#Left { /** * 滚动控制器 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right scroller : AST#type_annotation#Left AST#primary_type#Left Scroller AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Scroller AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right /** * 是否填充最大尺寸 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right fillMaxSize : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#property_declaration#Right /** * 是否填充最大宽度 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right fillMaxWidth : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ; AST#property_declaration#Right /** * 宽度 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right widthValue : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Length AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left undefined AST#expression#Right ; AST#property_declaration#Right /** * 高度 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right heightValue : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Length AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left undefined AST#expression#Right ; AST#property_declaration#Right /** * 滚动条状态 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right scrollBarState : AST#type_annotation#Left AST#primary_type#Left BarState AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left BarState AST#expression#Right . Off AST#member_expression#Right AST#expression#Right ; AST#property_declaration#Right /** * 内容构建函数 */ AST#property_declaration#Left AST#decorator#Left @ BuilderParam AST#decorator#Right content : AST#type_annotation#Left AST#primary_type#Left CustomBuilder AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * 构建带中等内边距的垂直滚动布局 * @returns {void} 无返回值 */ AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left VerticalScroll ( AST#component_parameters#Left { AST#component_parameter#Left scroller : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . scroller AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left fillMaxSize : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fillMaxSize AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left fillMaxWidth : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fillMaxWidth AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left widthValue : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . widthValue AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left heightValue : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . heightValue AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left scrollBarState : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . scrollBarState AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left paddingValue : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.float.space_padding_medium" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left content : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . content AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) ; AST#ui_custom_component_statement#Right } AST#build_body#Right AST#build_method#Right } AST#component_body#Right AST#decorated_export_declaration#Right
@ComponentV2 export struct MediumPaddingVerticalScroll { @Param scroller: Scroller = new Scroller(); @Param fillMaxSize: boolean = false; @Param fillMaxWidth: boolean = true; @Param widthValue: Length | undefined = undefined; @Param heightValue: Length | undefined = undefined; @Param scrollBarState: BarState = BarState.Off; @BuilderParam content: CustomBuilder; build(): void { VerticalScroll({ scroller: this.scroller, fillMaxSize: this.fillMaxSize, fillMaxWidth: this.fillMaxWidth, widthValue: this.widthValue, heightValue: this.heightValue, scrollBarState: this.scrollBarState, paddingValue: $r("app.float.space_padding_medium"), content: this.content }); } }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Scroll.ets#L174-L228
55b3945188222b130d454980880db9678e3abd19
github
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
NEXT/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets
arkts
submitUserInput
用户输入消息函数 @param userIputText
public submitUserInput(userIputText: string) { if (userIputText == '') { console.log(`dxin => "输入内容为空,请重新输入!" `) return; } this.userInput = userIputText; if (this.userInput && !this.isResponding) { if (this.onSendMessage) { this.isResponding = true; this.onSendMessage(this, new ChatMessage({ roleType: ChatRoleType.User, content: this.userInput })) } } }
AST#method_declaration#Left public submitUserInput AST#parameter_list#Left ( AST#parameter#Left userIputText : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left userIputText AST#expression#Right == AST#expression#Left '' AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` dxin => "输入内容为空,请重新输入!" ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . userInput AST#member_expression#Right = AST#expression#Left userIputText AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . userInput AST#member_expression#Right AST#expression#Right && AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . isResponding AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . onSendMessage AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isResponding AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . onSendMessage AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left this AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ChatMessage AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left roleType AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left ChatRoleType AST#expression#Right . User AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left content AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . userInput AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public submitUserInput(userIputText: string) { if (userIputText == '') { console.log(`dxin => "输入内容为空,请重新输入!" `) return; } this.userInput = userIputText; if (this.userInput && !this.isResponding) { if (this.onSendMessage) { this.isResponding = true; this.onSendMessage(this, new ChatMessage({ roleType: ChatRoleType.User, content: this.userInput })) } } }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets#L271-L286
91a373a213272313b194cf384d553e60f2f451e1
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/dealstridesolution/src/main/ets/model/CameraServiceUint.ets
arkts
initCamera
初始化相机功能 @param cameraDeviceIndex - 相机设备索引 @returns 无返回值
async initCamera(cameraDeviceIndex: number): Promise<void> { logger.debug(TAG, `initCamera cameraDeviceIndex: ${cameraDeviceIndex}`); try { await this.releaseCamera(); // 获取相机管理器实例 this.cameraManager = CameraService.getCameraManagerFn(); if (this.cameraManager === undefined) { logger.error(TAG, 'cameraManager is undefined'); return; } this.cameras = CameraService.getSupportedCamerasFn(this.cameraManager); this.curCameraDevice = this.cameras[cameraDeviceIndex]; if (this.curCameraDevice === undefined) { logger.error(TAG, 'Failed to create the camera input.'); return; } // 创建cameraInput输出对象 this.cameraInput = CameraService.createCameraInputFn(this.cameraManager, this.curCameraDevice); if (this.cameraInput === undefined) { logger.error(TAG, 'Failed to create the camera input.'); return; } // 打开相机 let isOpenSuccess = await CameraService.cameraInputOpenFn(this.cameraInput); if (!isOpenSuccess) { logger.error(TAG, 'Failed to open the camera.'); return; } // 选择具有不同的stride和width let previewProfile: camera.Profile = { format: camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP, size: { width: Constants.X_COMPONENT_SURFACE_WIDTH, height: Constants.X_COMPONENT_SURFACE_HEIGHT } }; let size: image.Size = { width: Constants.X_COMPONENT_SURFACE_WIDTH, height: Constants.X_COMPONENT_SURFACE_HEIGHT } this.receiver = image.createImageReceiver(size, image.ImageFormat.JPEG, 8); let surfaceId: string = await this.receiver.getReceivingSurfaceId(); this.previewOutput = CameraService.createPreviewOutputFn(this.cameraManager, previewProfile, surfaceId); this.onImageArrival(this.receiver); if (this.previewOutput === undefined) { logger.error(TAG, 'Failed to create the preview stream.'); return; } // 会话流 await this.sessionFlowFn(this.cameraManager, this.cameraInput, this.previewOutput); } catch (error) { logger.error(TAG, `initCamera fail: ${JSON.stringify(error)}`); } }
AST#method_declaration#Left async initCamera AST#parameter_list#Left ( AST#parameter#Left cameraDeviceIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . debug AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left AST#template_literal#Left ` initCamera cameraDeviceIndex: AST#template_substitution#Left $ { AST#expression#Left cameraDeviceIndex AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . releaseCamera AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 获取相机管理器实例 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraManager AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CameraService AST#expression#Right . getCameraManagerFn AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraManager AST#member_expression#Right AST#expression#Right === AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left 'cameraManager is undefined' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameras AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CameraService AST#expression#Right . getSupportedCamerasFn AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraManager AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . curCameraDevice AST#member_expression#Right = AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameras AST#member_expression#Right AST#expression#Right [ AST#expression#Left cameraDeviceIndex AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . curCameraDevice AST#member_expression#Right AST#expression#Right === AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left 'Failed to create the camera input.' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 创建cameraInput输出对象 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraInput AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CameraService AST#expression#Right . createCameraInputFn AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraManager AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . curCameraDevice AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraInput AST#member_expression#Right AST#expression#Right === AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left 'Failed to create the camera input.' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 打开相机 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left isOpenSuccess = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left CameraService AST#expression#Right AST#await_expression#Right AST#expression#Right . cameraInputOpenFn AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraInput AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left isOpenSuccess AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left 'Failed to open the camera.' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 选择具有不同的stride和width AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left previewProfile : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left camera . Profile AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left format AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left camera AST#expression#Right . CameraFormat AST#member_expression#Right AST#expression#Right . CAMERA_FORMAT_YUV_420_SP AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left size AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left width AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Constants AST#expression#Right . X_COMPONENT_SURFACE_WIDTH AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left height AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Constants AST#expression#Right . X_COMPONENT_SURFACE_HEIGHT AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left size : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . Size AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left width AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Constants AST#expression#Right . X_COMPONENT_SURFACE_WIDTH AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left height AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Constants AST#expression#Right . X_COMPONENT_SURFACE_HEIGHT AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#ERROR#Left this AST#ERROR#Right . receiver AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left image AST#expression#Right . createImageReceiver AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left size AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left image AST#expression#Right . ImageFormat AST#member_expression#Right AST#expression#Right . JPEG AST#member_expression#Right AST#expression#Right , AST#expression#Left 8 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left surfaceId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . receiver AST#member_expression#Right AST#expression#Right . getReceivingSurfaceId AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . previewOutput AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CameraService AST#expression#Right . createPreviewOutputFn AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraManager AST#member_expression#Right AST#expression#Right , AST#expression#Left previewProfile AST#expression#Right , AST#expression#Left surfaceId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . onImageArrival AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . receiver AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . previewOutput AST#member_expression#Right AST#expression#Right === AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left 'Failed to create the preview stream.' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 会话流 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . sessionFlowFn AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraManager AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cameraInput AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . previewOutput AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left AST#template_literal#Left ` initCamera fail: AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async initCamera(cameraDeviceIndex: number): Promise<void> { logger.debug(TAG, `initCamera cameraDeviceIndex: ${cameraDeviceIndex}`); try { await this.releaseCamera(); this.cameraManager = CameraService.getCameraManagerFn(); if (this.cameraManager === undefined) { logger.error(TAG, 'cameraManager is undefined'); return; } this.cameras = CameraService.getSupportedCamerasFn(this.cameraManager); this.curCameraDevice = this.cameras[cameraDeviceIndex]; if (this.curCameraDevice === undefined) { logger.error(TAG, 'Failed to create the camera input.'); return; } this.cameraInput = CameraService.createCameraInputFn(this.cameraManager, this.curCameraDevice); if (this.cameraInput === undefined) { logger.error(TAG, 'Failed to create the camera input.'); return; } let isOpenSuccess = await CameraService.cameraInputOpenFn(this.cameraInput); if (!isOpenSuccess) { logger.error(TAG, 'Failed to open the camera.'); return; } let previewProfile: camera.Profile = { format: camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP, size: { width: Constants.X_COMPONENT_SURFACE_WIDTH, height: Constants.X_COMPONENT_SURFACE_HEIGHT } }; let size: image.Size = { width: Constants.X_COMPONENT_SURFACE_WIDTH, height: Constants.X_COMPONENT_SURFACE_HEIGHT } this.receiver = image.createImageReceiver(size, image.ImageFormat.JPEG, 8); let surfaceId: string = await this.receiver.getReceivingSurfaceId(); this.previewOutput = CameraService.createPreviewOutputFn(this.cameraManager, previewProfile, surfaceId); this.onImageArrival(this.receiver); if (this.previewOutput === undefined) { logger.error(TAG, 'Failed to create the preview stream.'); return; } await this.sessionFlowFn(this.cameraManager, this.cameraInput, this.previewOutput); } catch (error) { logger.error(TAG, `initCamera fail: ${JSON.stringify(error)}`); } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/dealstridesolution/src/main/ets/model/CameraServiceUint.ets#L119-L176
51f117ebae948bd7ce6d7e99712b7af9b539f8ac
gitee
waylau/harmonyos-tutorial
74e23dfa769317f8f057cc77c2d09f0b1f2e0773
samples/ArkUICalculator/entry/src/main/ets/CalculatorButtonInfo.ets
arkts
按钮样式信息
export class CalculatorButtonInfo { text: string // 按钮上的文字 textColor: number // 文字的颜色 bgColor: number // 按钮背景颜色 constructor
AST#export_declaration#Left export AST#ERROR#Left class CalculatorButtonInfo { text : AST#ERROR#Left string // 按钮上的文字 textColor : number // 文字的颜色 bgColor : AST#ERROR#Right number AST#ERROR#Right // 按钮背景颜色 AST#variable_declaration#Left const AST#variable_declarator#Left ructor AST#variable_declarator#Right AST#variable_declaration#Right AST#export_declaration#Right
export class CalculatorButtonInfo { text: string textColor: number bgColor: number constructor
https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkUICalculator/entry/src/main/ets/CalculatorButtonInfo.ets#L2-L7
b3eb14a0f5d282266e915c946d3e9b2310227cf8
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/dialog/ActionBaseCore.ets
arkts
update
刷新自定义弹窗
update<T extends BaseDialogOptions>(dialogId: string, params: T) { const promptActionArg = this.getArgById(dialogId); if (promptActionArg) { promptActionArg.componentContent.update(params); } }
AST#method_declaration#Left update AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left BaseDialogOptions AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left dialogId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left promptActionArg = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getArgById AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left dialogId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left promptActionArg AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptActionArg AST#expression#Right . componentContent AST#member_expression#Right AST#expression#Right . update AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left params AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
update<T extends BaseDialogOptions>(dialogId: string, params: T) { const promptActionArg = this.getArgById(dialogId); if (promptActionArg) { promptActionArg.componentContent.update(params); } }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/ActionBaseCore.ets#L241-L246
822ed90493687d614397dc7519c6f888a7c76443
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets
arkts
enableDashedLine
Enables the line to be drawn in dashed mode, e.g. like this "- - - - - -" @param lineLength the length of the line pieces @param spaceLength the length of space inbetween the pieces @param phase offset, in degrees (normally, use 0)
public enableDashedLine(lineLength: number, spaceLength: number, phase: number) { this.mDashPathEffect = new DashPathEffect([lineLength, spaceLength], phase); }
AST#method_declaration#Left public enableDashedLine AST#parameter_list#Left ( AST#parameter#Left lineLength : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left spaceLength : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left phase : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mDashPathEffect AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left DashPathEffect AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#array_literal#Left [ AST#expression#Left lineLength AST#expression#Right , AST#expression#Left spaceLength AST#expression#Right ] AST#array_literal#Right AST#expression#Right , AST#expression#Left phase AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
public enableDashedLine(lineLength: number, spaceLength: number, phase: number) { this.mDashPathEffect = new DashPathEffect([lineLength, spaceLength], phase); }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets#L114-L116
2979858e4141542d2d59940550ae4276bca1cd35
gitee
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/services/ConfigService.ets
arkts
AGV配置接口定义
export interface AgvConfig { id: number; host: string; drivePort: number; analysisPort: number; cloudUrl: string; cam1: string; cam2: string; cam3: string; cam4: string; username1: string; username2: string; username3: string; username4: string; password1: string; password2: string; password3: string; password4: string; deleteFlag?: boolean; }
AST#export_declaration#Left export AST#interface_declaration#Left interface AgvConfig AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left host : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left drivePort : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left analysisPort : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left cloudUrl : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left cam1 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left cam2 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left cam3 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left cam4 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left username1 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left username2 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left username3 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left username4 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left password1 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left password2 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left password3 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left password4 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left deleteFlag ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface AgvConfig { id: number; host: string; drivePort: number; analysisPort: number; cloudUrl: string; cam1: string; cam2: string; cam3: string; cam4: string; username1: string; username2: string; username3: string; username4: string; password1: string; password2: string; password3: string; password4: string; deleteFlag?: boolean; }
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/ConfigService.ets#L6-L25
f8a875ff0dce6750d74caa0eb744339c72ec4e23
github
LiuAnclouds/Harmony-ArkTS-App.git
2119ce333927599b81a31081bc913e1416837308
WeatherMind/entry/src/main/ets/pages/ChooseCity.ets
arkts
getCurrentLocation
获取当前位置
private async getCurrentLocation() { try { promptAction.showToast({ message: '正在获取当前位置...' }); let requestInfo: geoLocationManager.CurrentLocationRequest = { 'priority': geoLocationManager.LocationRequestPriority.FIRST_FIX, 'scenario': geoLocationManager.LocationRequestScenario.UNSET, 'maxAccuracy': 0 }; geoLocationManager.getCurrentLocation(requestInfo, (err: BusinessError, location: geoLocationManager.Location) => { if (err) { console.error('获取位置失败:', err); promptAction.showToast({ message: '获取位置失败,请检查定位权限' }); return; } if (location) { console.log('获取位置成功:', location); this.getWeatherByLocation(location.latitude, location.longitude); } }); } catch (err) { console.error('定位异常:', err); promptAction.showToast({ message: '定位服务异常' }); } }
AST#method_declaration#Left private async getCurrentLocation AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left message AST#property_name#Right : AST#expression#Left '正在获取当前位置...' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left requestInfo : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left geoLocationManager . CurrentLocationRequest AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left 'priority' AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left geoLocationManager AST#expression#Right . LocationRequestPriority AST#member_expression#Right AST#expression#Right . FIRST_FIX AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left 'scenario' AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left geoLocationManager AST#expression#Right . LocationRequestScenario AST#member_expression#Right AST#expression#Right . UNSET AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left 'maxAccuracy' AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left geoLocationManager AST#expression#Right . getCurrentLocation AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left requestInfo AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left err : AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left location : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left geoLocationManager . Location AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left err AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '获取位置失败:' AST#expression#Right , AST#expression#Left err AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left message AST#property_name#Right : AST#expression#Left '获取位置失败,请检查定位权限' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left location AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '获取位置成功:' AST#expression#Right , AST#expression#Left location AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getWeatherByLocation AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left location AST#expression#Right . latitude AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left location AST#expression#Right . longitude AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( err ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '定位异常:' AST#expression#Right , AST#expression#Left err AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left message AST#property_name#Right : AST#expression#Left '定位服务异常' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private async getCurrentLocation() { try { promptAction.showToast({ message: '正在获取当前位置...' }); let requestInfo: geoLocationManager.CurrentLocationRequest = { 'priority': geoLocationManager.LocationRequestPriority.FIRST_FIX, 'scenario': geoLocationManager.LocationRequestScenario.UNSET, 'maxAccuracy': 0 }; geoLocationManager.getCurrentLocation(requestInfo, (err: BusinessError, location: geoLocationManager.Location) => { if (err) { console.error('获取位置失败:', err); promptAction.showToast({ message: '获取位置失败,请检查定位权限' }); return; } if (location) { console.log('获取位置成功:', location); this.getWeatherByLocation(location.latitude, location.longitude); } }); } catch (err) { console.error('定位异常:', err); promptAction.showToast({ message: '定位服务异常' }); } }
https://github.com/LiuAnclouds/Harmony-ArkTS-App.git/blob/2119ce333927599b81a31081bc913e1416837308/WeatherMind/entry/src/main/ets/pages/ChooseCity.ets#L310-L336
40c7790437a831eab4bfc6eeeb4fc9c6584ae7c2
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/main/src/main/ets/component/HomeTopBar.ets
arkts
rightBuilder
右侧图标构建 @returns {void} 无返回值
@Builder private rightBuilder() { Image($r("app.media.ic_github")) .attributeModifier(size(27)) .onClick((): void => this.onRightTap()); }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private rightBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Image ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.ic_github" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . attributeModifier ( AST#expression#Left AST#call_expression#Left AST#expression#Left size AST#expression#Right AST#argument_list#Left ( AST#expression#Left 27 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . onRightTap AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder private rightBuilder() { Image($r("app.media.ic_github")) .attributeModifier(size(27)) .onClick((): void => this.onRightTap()); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/component/HomeTopBar.ets#L89-L94
d92bbabbaa3f2f9a763a3463dc97c39e80707dc2
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/datasource/src/main/ets/ExamService.ets
arkts
getSimpleQuestionCount
获取简单题数量 @returns
public getSimpleQuestionCount(): number { return this.examDetails.filter(item => item.classificationType === ClassificationTypeEnum.SIMPLE).length; }
AST#method_declaration#Left public getSimpleQuestionCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . examDetails AST#member_expression#Right AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left item => AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left item AST#expression#Right . classificationType AST#member_expression#Right AST#expression#Right === AST#expression#Left ClassificationTypeEnum AST#expression#Right AST#binary_expression#Right AST#expression#Right . SIMPLE AST#member_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public getSimpleQuestionCount(): number { return this.examDetails.filter(item => item.classificationType === ClassificationTypeEnum.SIMPLE).length; }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/datasource/src/main/ets/ExamService.ets#L220-L222
702de7db46b463b4f469490f81dc5a81355ebf54
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/viewModel/Rect.ets
arkts
set
Set value. @param left @param top @param right @param bottom
set(left: number, top: number, right: number, bottom: number): void { this.left = left; this.top = top; this.right = right; this.bottom = bottom; }
AST#method_declaration#Left set AST#parameter_list#Left ( AST#parameter#Left left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left top : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left bottom : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . left AST#member_expression#Right = AST#expression#Left left AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . top AST#member_expression#Right = AST#expression#Left top AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . right AST#member_expression#Right = AST#expression#Left right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . bottom AST#member_expression#Right = AST#expression#Left bottom AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
set(left: number, top: number, right: number, bottom: number): void { this.left = left; this.top = top; this.right = right; this.bottom = bottom; }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/Rect.ets#L55-L60
5615771036c0fdf319387dcacab606096182586c
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
eftool/src/main/ets/core/media/ImageUtil.ets
arkts
packingFromPixelMap
PixelMap转ArrayBuffer @param target PixelMap @param format 目标格式。只支持jpg、webp 、 png @returns
static async packingFromPixelMap(target: image.PixelMap, format: string = 'image/png'): Promise<OutDTO<ArrayBuffer>> { const imagePacker: image.ImagePacker = image.createImagePacker(); //转换 let res = await imagePacker.packing(target, { format: format, quality: 98 }); //释放资源 imagePacker.release(); //返回 return OutDTO.OKByDataRow('PixelMap转ArrayBuffer成功~', res); }
AST#method_declaration#Left static async packingFromPixelMap AST#parameter_list#Left ( AST#parameter#Left target : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . PixelMap AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left format : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'image/png' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left imagePacker : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . ImagePacker AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left image AST#expression#Right . createImagePacker AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //转换 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left res = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left imagePacker AST#expression#Right AST#await_expression#Right AST#expression#Right . packing AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left target AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left format AST#property_name#Right : AST#expression#Left format AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left quality AST#property_name#Right : AST#expression#Left 98 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //释放资源 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left imagePacker AST#expression#Right . release AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right //返回 AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left OutDTO AST#expression#Right . OKByDataRow AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'PixelMap转ArrayBuffer成功~' AST#expression#Right , AST#expression#Left res AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static async packingFromPixelMap(target: image.PixelMap, format: string = 'image/png'): Promise<OutDTO<ArrayBuffer>> { const imagePacker: image.ImagePacker = image.createImagePacker(); let res = await imagePacker.packing(target, { format: format, quality: 98 }); imagePacker.release(); return OutDTO.OKByDataRow('PixelMap转ArrayBuffer成功~', res); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/eftool/src/main/ets/core/media/ImageUtil.ets#L282-L290
9eb7258f7ab6469e1bdf2876fd0744a688bca827
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
AdaptiveCapabilities/entry/src/main/ets/pages/atomicLayoutCapability/flexibleCapability/FlexibleCapability1.ets
arkts
slider
Bottom slider - adjust container size by dragging the slider.
@Builder slider() { Slider({ value: this.sliderWidth, min: 300, max: 1000 }) .blockColor(Color.White) .width('60%') .onChange((value: number) => { this.sliderWidth = value; }) .position({ x: '20%', y: '80%' }) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right slider AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Slider ( AST#component_parameters#Left { AST#component_parameter#Left value : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . sliderWidth AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left min : AST#expression#Left 300 AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left max : AST#expression#Left 1000 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . blockColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '60%' AST#expression#Right ) AST#modifier_chain_expression#Left . onChange ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . sliderWidth AST#member_expression#Right = AST#expression#Left value AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Left . position ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left x AST#property_name#Right : AST#expression#Left '20%' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left y AST#property_name#Right : AST#expression#Left '80%' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder slider() { Slider({ value: this.sliderWidth, min: 300, max: 1000 }) .blockColor(Color.White) .width('60%') .onChange((value: number) => { this.sliderWidth = value; }) .position({ x: '20%', y: '80%' }) }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/AdaptiveCapabilities/entry/src/main/ets/pages/atomicLayoutCapability/flexibleCapability/FlexibleCapability1.ets#L23-L32
b26b61b33deeda1d8f73c7803fbefca6d86e6360
gitee
Jolin-Kan/HarmonyOS-App.git
5b2c84ed90d89d721bc107f2100a64d0203a6e72
entry/src/main/components/WarningDialog.ets
arkts
constructor
使用 Link 来链接动态文本
constructor(controller?: CustomDialogController, warnText: string = '') { super(); this.controller = controller; this.warnText = warnText; // 初始化 warnText }
AST#method_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left controller ? : AST#type_annotation#Left AST#primary_type#Left CustomDialogController AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left warnText : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_custom_component_statement#Left super ( ) ; AST#ui_custom_component_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . controller AST#member_expression#Right = AST#expression#Left controller AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . warnText AST#member_expression#Right = AST#expression#Left warnText AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right // 初始化 warnText } AST#builder_function_body#Right AST#method_declaration#Right
constructor(controller?: CustomDialogController, warnText: string = '') { super(); this.controller = controller; this.warnText = warnText; }
https://github.com/Jolin-Kan/HarmonyOS-App.git/blob/5b2c84ed90d89d721bc107f2100a64d0203a6e72/entry/src/main/components/WarningDialog.ets#L7-L11
f2938b7049910960d76edc067d36fd708e4b4f42
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/collapsemenu/src/main/ets/model/BasicDataSource.ets
arkts
getData
获取指定索引数据
public getData(index: number): T { return this.articleData[index]; }
AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . articleData AST#member_expression#Right AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public getData(index: number): T { return this.articleData[index]; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/collapsemenu/src/main/ets/model/BasicDataSource.ets#L89-L91
e09dede78ebeeedbab390b2a164d8d92786c77ee
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
HDRVivid/AVCodecVideo/entry/src/main/ets/pages/Recorder.ets
arkts
isVideoStabilizationModeSupported
[Start set_video_color]
function isVideoStabilizationModeSupported(session: camera.VideoSession, mode: camera.VideoStabilizationMode): boolean { let isSupported: boolean = false; try { isSupported = session.isVideoStabilizationModeSupported(mode); } catch (error) { // If the failure occurs, the error code error.code is returned and processed let err = error as BusinessError; console.error(`The isVideoStabilizationModeSupported call failed. error code: ${err.code}`); } return isSupported; }
AST#function_declaration#Left function isVideoStabilizationModeSupported AST#parameter_list#Left ( AST#parameter#Left session : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left camera . VideoSession AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left mode : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left camera . VideoStabilizationMode AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left isSupported : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left isSupported = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left session AST#expression#Right . isVideoStabilizationModeSupported AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left mode AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { // If the failure occurs, the error code error.code is returned and processed AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left err = AST#expression#Left AST#as_expression#Left AST#expression#Left error AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` The isVideoStabilizationModeSupported call failed. error code: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left err AST#expression#Right . code AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left isSupported AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right
function isVideoStabilizationModeSupported(session: camera.VideoSession, mode: camera.VideoStabilizationMode): boolean { let isSupported: boolean = false; try { isSupported = session.isVideoStabilizationModeSupported(mode); } catch (error) { let err = error as BusinessError; console.error(`The isVideoStabilizationModeSupported call failed. error code: ${err.code}`); } return isSupported; }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/HDRVivid/AVCodecVideo/entry/src/main/ets/pages/Recorder.ets#L100-L110
03038eec4576a7525d8b32ee4d8e43264b22e123
gitee
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/api/@ohos.file.PhotoPickerComponent.d.ets
arkts
ItemType. include CAMERA and THUMBNAIL @enum { number } ItemType @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core @atomicservice @since 12
export declare enum ItemType { /** * THUMBNAIL. photos or videos item * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 12 */ THUMBNAIL = 0, /** * CAMERA. camera item * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 12 */ CAMERA = 1 }
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ItemType AST#enum_body#Left { /** * THUMBNAIL. photos or videos item * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 12 */ AST#enum_member#Left THUMBNAIL = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , /** * CAMERA. camera item * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 12 */ AST#enum_member#Left CAMERA = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
export declare enum ItemType { THUMBNAIL = 0, CAMERA = 1 }
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.file.PhotoPickerComponent.d.ets#L533-L550
c6be5d89242399cd1ba6056a98a4e9771d0ef03b
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/base/PreviewUtil.ets
arkts
previewTxt
预览文本 @param uri 预览uri
static async previewTxt(uri: string): Promise<void> { await PreviewUtil.openPreview('txt', uri); }
AST#method_declaration#Left static async previewTxt AST#parameter_list#Left ( AST#parameter#Left uri : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left PreviewUtil AST#expression#Right AST#await_expression#Right AST#expression#Right . openPreview AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'txt' AST#expression#Right , AST#expression#Left uri AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
static async previewTxt(uri: string): Promise<void> { await PreviewUtil.openPreview('txt', uri); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/base/PreviewUtil.ets#L35-L37
6072cf0067b3f2ee3560a3f2d8384627f83db0d9
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/search/SearchDetails.ets
arkts
aboutToAppear
初始化
aboutToAppear(): void { }
AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
aboutToAppear(): void { }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/search/SearchDetails.ets#L77-L79
63c8893ef477b20d2ab794b2f8bb8280df9abb39
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/navigationinterceptor/src/main/ets/model/DataModel.ets
arkts
基础的icon数据
export const IconList3: IconListsType[] = [ { name: "头条", num: "0" }, { name: "获赞", num: "0" }, { name: "粉丝", num: "0" }, { name: "关注", num: "0" } ] // 基础服务的icon数据
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left IconList3 : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left IconListsType [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left "头条" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left num AST#property_name#Right : AST#expression#Left "0" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left "获赞" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left num AST#property_name#Right : AST#expression#Left "0" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left "粉丝" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left num AST#property_name#Right : AST#expression#Left "0" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left "关注" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left num AST#property_name#Right : AST#expression#Left "0" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right // 基础服务的icon数据 AST#variable_declaration#Right AST#export_declaration#Right
export const IconList3: IconListsType[] = [ { name: "头条", num: "0" }, { name: "获赞", num: "0" }, { name: "粉丝", num: "0" }, { name: "关注", num: "0" } ]
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/navigationinterceptor/src/main/ets/model/DataModel.ets#L35-L42
8ea97745f418e418e8226bcbf53d8a446b092775
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/RankingDemo/entry/src/main/ets/common/constants/Constants.ets
arkts
The font weight of application.
export enum FontWeight { BOLD = '400', BOLDER = '500', };
AST#export_declaration#Left export AST#enum_declaration#Left enum FontWeight AST#enum_body#Left { AST#enum_member#Left BOLD = AST#expression#Left '400' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left BOLDER = AST#expression#Left '500' AST#expression#Right AST#enum_member#Right , } AST#enum_body#Right AST#enum_declaration#Right ; AST#export_declaration#Right
export enum FontWeight { BOLD = '400', BOLDER = '500', };
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/RankingDemo/entry/src/main/ets/common/constants/Constants.ets#L30-L33
fc8818018a4f20ce794318bc8bb8eb25adf59589
gitee
meltsama/Arkts_HarmonyOS_App.git
546adabde1c0f2e9abb988dd26c5722f4f0e2514
version_1/entry/src/main/ets/pages/qiud/DzfPage.ets
arkts
buildText
自定义弹窗 内部文本按钮等
@Builder function buildText(params: Params) { Column() { //标题文本 Text(params.text) .fontSize(18) .padding({top: 20}) //内容文本 Text('是否继续操作取消申请?') .fontSize(16) .margin(40) //两个按钮的实现 Row(){ Button({type:ButtonType.Normal}){ Text('取消') } .padding({top: 20, bottom: 20}) .borderWidth(1) .borderColor('#F6F9FC') .backgroundColor(Color.White) .borderRadius({bottomLeft:20})//左下角圆角 .width('50%') //点击事件,无功能 .onClick(() => { PromptActionClass.closeDialog() }) Button({type:ButtonType.Normal}){ Text('确定') .fontColor('#1989FA') } .padding({top: 20, bottom: 20}) .borderWidth(1) .borderColor('#F6F9FC') .backgroundColor(Color.White) .borderRadius({bottomRight:20})//右下角圆角 .width('50%') //点击事件,无功能 .onClick(() => { PromptActionClass.closeDialog() }) } } .backgroundColor(Color.White) .width('87%') .height(180) .borderRadius(20) }
AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function buildText AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left Params AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { //标题文本 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#member_expression#Left AST#expression#Left params AST#expression#Right . text AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 18 AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left 20 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right //内容文本 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left '是否继续操作取消申请?' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 16 AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left 40 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right //两个按钮的实现 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Button ( AST#component_parameters#Left { AST#component_parameter#Left type : AST#expression#Left AST#member_expression#Left AST#expression#Left ButtonType AST#expression#Right . Normal AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left '取消' AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left 20 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left 20 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderWidth ( AST#expression#Left 1 AST#expression#Right ) AST#modifier_chain_expression#Left . borderColor ( AST#expression#Left '#F6F9FC' AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left bottomLeft AST#property_name#Right : AST#expression#Left 20 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) //左下角圆角 AST#modifier_chain_expression#Left . width ( AST#expression#Left '50%' AST#expression#Right ) //点击事件,无功能 AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left PromptActionClass AST#expression#Right . closeDialog AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Button ( AST#component_parameters#Left { AST#component_parameter#Left type : AST#expression#Left AST#member_expression#Left AST#expression#Left ButtonType AST#expression#Right . Normal AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left '确定' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left '#1989FA' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left 20 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left 20 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderWidth ( AST#expression#Left 1 AST#expression#Right ) AST#modifier_chain_expression#Left . borderColor ( AST#expression#Left '#F6F9FC' AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left bottomRight AST#property_name#Right : AST#expression#Left 20 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) //右下角圆角 AST#modifier_chain_expression#Left . width ( AST#expression#Left '50%' AST#expression#Right ) //点击事件,无功能 AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left PromptActionClass AST#expression#Right . closeDialog AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '87%' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left 180 AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 20 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#decorated_function_declaration#Right
@Builder function buildText(params: Params) { Column() { Text(params.text) .fontSize(18) .padding({top: 20}) Text('是否继续操作取消申请?') .fontSize(16) .margin(40) Row(){ Button({type:ButtonType.Normal}){ Text('取消') } .padding({top: 20, bottom: 20}) .borderWidth(1) .borderColor('#F6F9FC') .backgroundColor(Color.White) .borderRadius({bottomLeft:20}) .width('50%') .onClick(() => { PromptActionClass.closeDialog() }) Button({type:ButtonType.Normal}){ Text('确定') .fontColor('#1989FA') } .padding({top: 20, bottom: 20}) .borderWidth(1) .borderColor('#F6F9FC') .backgroundColor(Color.White) .borderRadius({bottomRight:20}) .width('50%') .onClick(() => { PromptActionClass.closeDialog() }) } } .backgroundColor(Color.White) .width('87%') .height(180) .borderRadius(20) }
https://github.com/meltsama/Arkts_HarmonyOS_App.git/blob/546adabde1c0f2e9abb988dd26c5722f4f0e2514/version_1/entry/src/main/ets/pages/qiud/DzfPage.ets#L11-L57
58af188d42f26ee8c45d0f8c50a4bc6c81221a78
github
wasd09090030/MyHongmengProject.git
a8ed386b658ceeac69ef5bc42a92d78c7980821c
entry/src/main/ets/components/review/ReviewCardComponents.ets
arkts
AchievementBadges
成就徽章墙
@Builder export function AchievementBadges( completedCount: number, onTimeCount: number ) { Column({ space: 12 }) { Row() { Text('成就徽章') .fontSize(18) .fontWeight(FontWeight.Bold) Blank() SymbolGlyph($r('sys.symbol.rosette')) .fontSize(20) .fontColor(['#FFD700']) } .width('100%') Grid() { GridItem() { BadgeItem('首次专注', 'flame_fill', completedCount >= 1, '#FF6B6B') } GridItem() { BadgeItem('连续7天', 'calendar_badge_clock', false, '#4ECDC4') } GridItem() { BadgeItem('时间大师', 'clock_fill', completedCount >= 10, '#FFD700') } GridItem() { BadgeItem('效率之王', 'bolt_fill', onTimeCount >= 5, '#007DFF') } } .columnsTemplate('1fr 1fr') .rowsTemplate('1fr 1fr') .columnsGap(12) .rowsGap(12) .width('100%') .height(200) } .width('100%') .padding(20) .backgroundColor(Color.White) .borderRadius(16) }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function AchievementBadges AST#parameter_list#Left ( AST#parameter#Left completedCount : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left onTimeCount : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 12 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left '成就徽章' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 18 AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left AST#member_expression#Left AST#expression#Left FontWeight AST#expression#Right . Bold AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Blank ( ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left SymbolGlyph ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'sys.symbol.rosette' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 20 AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#array_literal#Left [ AST#expression#Left '#FFD700' AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Grid ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left GridItem ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left BadgeItem ( AST#expression#Left '首次专注' AST#expression#Right , AST#expression#Left 'flame_fill' AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left completedCount AST#expression#Right >= AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left '#FF6B6B' AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left GridItem ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left BadgeItem ( AST#expression#Left '连续7天' AST#expression#Right , AST#expression#Left 'calendar_badge_clock' AST#expression#Right , AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right , AST#expression#Left '#4ECDC4' AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left GridItem ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left BadgeItem ( AST#expression#Left '时间大师' AST#expression#Right , AST#expression#Left 'clock_fill' AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left completedCount AST#expression#Right >= AST#expression#Left 10 AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left '#FFD700' AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left GridItem ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left BadgeItem ( AST#expression#Left '效率之王' AST#expression#Right , AST#expression#Left 'bolt_fill' AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left onTimeCount AST#expression#Right >= AST#expression#Left 5 AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left '#007DFF' AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . columnsTemplate ( AST#expression#Left '1fr 1fr' AST#expression#Right ) AST#modifier_chain_expression#Left . rowsTemplate ( AST#expression#Left '1fr 1fr' AST#expression#Right ) AST#modifier_chain_expression#Left . columnsGap ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Left . rowsGap ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left 200 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left 20 AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 16 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#decorated_export_declaration#Right
@Builder export function AchievementBadges( completedCount: number, onTimeCount: number ) { Column({ space: 12 }) { Row() { Text('成就徽章') .fontSize(18) .fontWeight(FontWeight.Bold) Blank() SymbolGlyph($r('sys.symbol.rosette')) .fontSize(20) .fontColor(['#FFD700']) } .width('100%') Grid() { GridItem() { BadgeItem('首次专注', 'flame_fill', completedCount >= 1, '#FF6B6B') } GridItem() { BadgeItem('连续7天', 'calendar_badge_clock', false, '#4ECDC4') } GridItem() { BadgeItem('时间大师', 'clock_fill', completedCount >= 10, '#FFD700') } GridItem() { BadgeItem('效率之王', 'bolt_fill', onTimeCount >= 5, '#007DFF') } } .columnsTemplate('1fr 1fr') .rowsTemplate('1fr 1fr') .columnsGap(12) .rowsGap(12) .width('100%') .height(200) } .width('100%') .padding(20) .backgroundColor(Color.White) .borderRadius(16) }
https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/components/review/ReviewCardComponents.ets#L281-L323
0ff89365ae8d42e506cebada3cb2de25b1ba3d05
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/utils/DateHelper.ets
arkts
hasSecond
是否含有秒
static hasSecond(type: DateType): boolean { return type == DateType.YmdHms || type == DateType.Hms || type == DateType.Ms; }
AST#method_declaration#Left static hasSecond AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left DateType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left type AST#expression#Right == AST#expression#Left DateType AST#expression#Right AST#binary_expression#Right AST#expression#Right . YmdHms AST#member_expression#Right AST#expression#Right || AST#expression#Left AST#binary_expression#Left AST#expression#Left type AST#expression#Right == AST#expression#Left DateType AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . Hms AST#member_expression#Right AST#expression#Right || AST#expression#Left AST#binary_expression#Left AST#expression#Left type AST#expression#Right == AST#expression#Left DateType AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . Ms AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static hasSecond(type: DateType): boolean { return type == DateType.YmdHms || type == DateType.Hms || type == DateType.Ms; }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/utils/DateHelper.ets#L86-L88
e967f4426ebf51443ffaf8f311e25c94456d3840
github
openharmony/graphic_graphic_2d
46a11e91c9709942196ad2a7afea2e0fcd1349f3
frameworks/text/interface/export/ani/@ohos.graphics.text.ets
arkts
Enumerates of ellipsis mode. @enum { number } @syscap SystemCapability.Graphics.Drawing @since 12
export enum EllipsisMode { /** * The ellipsis is shown in the start of text. * @syscap SystemCapability.Graphics.Drawing * @since 12 */ START, /** * The ellipsis is shown in the middle of text. * @syscap SystemCapability.Graphics.Drawing * @since 12 */ MIDDLE, /** * The ellipsis is shown in the end of text. * @syscap SystemCapability.Graphics.Drawing * @since 12 */ END, }
AST#export_declaration#Left export AST#enum_declaration#Left enum EllipsisMode AST#enum_body#Left { /** * The ellipsis is shown in the start of text. * @syscap SystemCapability.Graphics.Drawing * @since 12 */ AST#enum_member#Left START AST#enum_member#Right , /** * The ellipsis is shown in the middle of text. * @syscap SystemCapability.Graphics.Drawing * @since 12 */ AST#enum_member#Left MIDDLE AST#enum_member#Right , /** * The ellipsis is shown in the end of text. * @syscap SystemCapability.Graphics.Drawing * @since 12 */ AST#enum_member#Left END AST#enum_member#Right , } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
export enum EllipsisMode { START, MIDDLE, END, }
https://github.com/openharmony/graphic_graphic_2d/blob/46a11e91c9709942196ad2a7afea2e0fcd1349f3/frameworks/text/interface/export/ani/@ohos.graphics.text.ets#L1176-L1197
e108017830a6588467aea2509a3a0325e43b318b
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/ArkTsComponentCollection/MediaQuery/entry/src/main/ets/model/New.ets
arkts
Copyright (c) 2022 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
export const newsList = [{ title: $r('app.string.new_title1'), publisher: $r('app.string.new_publisher1'), newId: 0 }, { title: $r('app.string.new_title2'), publisher: $r('app.string.new_publisher2'), newId: 1 }, { title: $r('app.string.new_title3'), publisher: $r('app.string.new_publisher3'), newId: 2 }, { title: $r('app.string.new_title4'), publisher: $r('app.string.new_publisher4'), newId: 3 }]
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left newsList = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.new_title1' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left publisher AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.new_publisher1' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left newId AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.new_title2' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left publisher AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.new_publisher2' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left newId AST#property_name#Right : AST#expression#Left 1 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.new_title3' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left publisher AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.new_publisher3' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left newId AST#property_name#Right : AST#expression#Left 2 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.new_title4' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left publisher AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.new_publisher4' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left newId AST#property_name#Right : AST#expression#Left 3 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#export_declaration#Right
export const newsList = [{ title: $r('app.string.new_title1'), publisher: $r('app.string.new_publisher1'), newId: 0 }, { title: $r('app.string.new_title2'), publisher: $r('app.string.new_publisher2'), newId: 1 }, { title: $r('app.string.new_title3'), publisher: $r('app.string.new_publisher3'), newId: 2 }, { title: $r('app.string.new_title4'), publisher: $r('app.string.new_publisher4'), newId: 3 }]
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ArkTsComponentCollection/MediaQuery/entry/src/main/ets/model/New.ets#L15-L18
3adf9b72d672edaff2c3db467efba4bd8d961697
gitee
fengmingdev/protobuf-arkts-generator.git
75888d404fd6ce52a046cba2a94807ecf1350147
runtime/arkpb/MessageUtils.ets
arkts
toBinaryBatch
========== 批量操作 ========== 批量序列化消息为二进制 @param messages 消息数组 @returns 二进制数据数组 使用示例: ```typescript const people = [person1, person2, person3] const binaries = MessageUtils.toBinaryBatch(people) ```
static toBinaryBatch<T extends Message>(messages: T[]): Uint8Array[] { return messages.map(m => m.toBinary()) }
AST#method_declaration#Left static toBinaryBatch AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left Message AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left messages : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left T [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Uint8Array [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left messages AST#expression#Right . map AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left m => AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left m AST#expression#Right . toBinary AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static toBinaryBatch<T extends Message>(messages: T[]): Uint8Array[] { return messages.map(m => m.toBinary()) }
https://github.com/fengmingdev/protobuf-arkts-generator.git/blob/75888d404fd6ce52a046cba2a94807ecf1350147/runtime/arkpb/MessageUtils.ets#L41-L43
4065fd54374b1ca242edf913dadb73539c785c7d
github
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/action/ToastUtil.ets
arkts
showShort
弹出土司,时长为:1.5s,距离底部默认为80vp @param message 提示消息 @param options (距离屏幕底部的位置、是否显示在应用之上)
static showShort(message: string | Resource, options: ToastOptions = new ToastOptions()) { if (message || (typeof message === 'string' && message.length > 0)) { options = ToastUtil.initToastDefault(options, 1); let toastOptions = options as promptAction.ShowToastOptions; toastOptions.message = message; promptAction.showToast(toastOptions); } }
AST#method_declaration#Left static showShort AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ToastOptions AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ToastOptions AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left message AST#expression#Right || AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#unary_expression#Left typeof AST#expression#Left message AST#expression#Right AST#unary_expression#Right AST#expression#Right === AST#expression#Left 'string' AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left message AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left options = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left ToastUtil AST#expression#Right . initToastDefault AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left options AST#expression#Right , AST#expression#Left 1 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left toastOptions = AST#expression#Left AST#as_expression#Left AST#expression#Left options AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left promptAction . ShowToastOptions AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left toastOptions AST#expression#Right . message AST#member_expression#Right = AST#expression#Left message AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left toastOptions AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static showShort(message: string | Resource, options: ToastOptions = new ToastOptions()) { if (message || (typeof message === 'string' && message.length > 0)) { options = ToastUtil.initToastDefault(options, 1); let toastOptions = options as promptAction.ShowToastOptions; toastOptions.message = message; promptAction.showToast(toastOptions); } }
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/action/ToastUtil.ets#L60-L67
d1ced23095eeb19f5b43204aafebf322d582ced6
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/SHASync.ets
arkts
@Author csx @DateTime 2024/3/20 21:43 @TODO SHA
export class SHASync { /** * SHA1摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ static digestSHA1(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA1', resultCoding); } /** * SHA224摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ static digestSHA224(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA224', resultCoding); } /** * SHA256摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ static digest(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA256', resultCoding); } /** * SHA384摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ static digestSHA384(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA384', resultCoding); } /** * SHA512摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ static digestSHA512(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA512', resultCoding); } /** * 消息认证码计算 * @param str 计算字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns */ static hmac(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return DynamicSyncUtil.hmac(str, 'SHA256', resultCoding); } }
AST#export_declaration#Left export AST#class_declaration#Left class SHASync AST#class_body#Left { /** * SHA1摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ AST#method_declaration#Left static digestSHA1 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CryptoSyncUtil AST#expression#Right . digest AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right , AST#expression#Left 'SHA1' AST#expression#Right , AST#expression#Left resultCoding AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * SHA224摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ AST#method_declaration#Left static digestSHA224 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CryptoSyncUtil AST#expression#Right . digest AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right , AST#expression#Left 'SHA224' AST#expression#Right , AST#expression#Left resultCoding AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * SHA256摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ AST#method_declaration#Left static digest AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CryptoSyncUtil AST#expression#Right . digest AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right , AST#expression#Left 'SHA256' AST#expression#Right , AST#expression#Left resultCoding AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * SHA384摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ AST#method_declaration#Left static digestSHA384 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CryptoSyncUtil AST#expression#Right . digest AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right , AST#expression#Left 'SHA384' AST#expression#Right , AST#expression#Left resultCoding AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * SHA512摘要 * @param str 带摘要的字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns 摘要后的字符串 */ AST#method_declaration#Left static digestSHA512 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CryptoSyncUtil AST#expression#Right . digest AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right , AST#expression#Left 'SHA512' AST#expression#Right , AST#expression#Left resultCoding AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 消息认证码计算 * @param str 计算字符串 * @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 * @returns */ AST#method_declaration#Left static hmac AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DynamicSyncUtil AST#expression#Right . hmac AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right , AST#expression#Left 'SHA256' AST#expression#Right , AST#expression#Left resultCoding AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class SHASync { static digestSHA1(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA1', resultCoding); } static digestSHA224(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA224', resultCoding); } static digest(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA256', resultCoding); } static digestSHA384(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA384', resultCoding); } static digestSHA512(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA512', resultCoding); } static hmac(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return DynamicSyncUtil.hmac(str, 'SHA256', resultCoding); } }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SHASync.ets#L27-L87
b295f29e564c50614fbb4a1a67baa36a3adf196f
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/statusbaranimation/src/main/ets/model/WindowModel.ets
arkts
deleteEmitter
取消事件订阅
deleteEmitter() { emitter.off(2); }
AST#method_declaration#Left deleteEmitter AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left emitter AST#expression#Right . off AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 2 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
deleteEmitter() { emitter.off(2); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/statusbaranimation/src/main/ets/model/WindowModel.ets#L192-L194
8a2bd0ee42153dd7eb927820937c04de917d97e9
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/AIAssistantService.ets
arkts
消息附件接口
export interface MessageAttachment { id: string; type: AttachmentType; url: string; filename: string; size: number; thumbnail?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface MessageAttachment AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left type : AST#type_annotation#Left AST#primary_type#Left AttachmentType AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left filename : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left size : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left thumbnail ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface MessageAttachment { id: string; type: AttachmentType; url: string; filename: string; size: number; thumbnail?: string; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/AIAssistantService.ets#L57-L64
4db97c1b6a4c59e4460a6531fe7876a5231b523e
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/Performance/NBody/entry/src/main/ets/model/CalculateUtil.ets
arkts
使用Worker开启子线程,执行轨道计算任务 @param totalTimeSteps 时间推移量
export function computeNBodyByWorker(totalTimeSteps: number): void { Logger.info(TAG, "computeNBodyByWorker: start executing"); let workerInstance = new worker.ThreadWorker("entry/ets/workers/CalculateWorker.ts"); // 设置如何处理,来自worker线程的消息 workerInstance.onmessage = (e: MessageEvents): void => { let data: Record<string, Object> = e.data; Logger.info(TAG, 'computeNBodyByWorker: executed successfully, total time costed = ' + data.result + ' ms.'); AppStorage.set<String>('timeCost', util.format(calculateResult, data.result)); } // 设置由主线程向worker线程发送什么消息 workerInstance.postMessage(new WorkerMessage(totalTimeSteps)); }
AST#export_declaration#Left export AST#function_declaration#Left function computeNBodyByWorker AST#parameter_list#Left ( AST#parameter#Left totalTimeSteps : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left "computeNBodyByWorker: start executing" AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left workerInstance = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left worker AST#expression#Right AST#new_expression#Right AST#expression#Right . ThreadWorker AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "entry/ets/workers/CalculateWorker.ts" AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 设置如何处理,来自worker线程的消息 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left workerInstance AST#expression#Right . onmessage AST#member_expression#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left e : AST#type_annotation#Left AST#primary_type#Left MessageEvents AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left data : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left e AST#expression#Right . data AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 'computeNBodyByWorker: executed successfully, total time costed = ' AST#expression#Right + AST#expression#Left data AST#expression#Right AST#binary_expression#Right AST#expression#Right . result AST#member_expression#Right AST#expression#Right + AST#expression#Left ' ms.' AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AppStorage AST#expression#Right . set AST#member_expression#Right AST#expression#Right AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left String AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#argument_list#Left ( AST#expression#Left 'timeCost' AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left util AST#expression#Right . format AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left calculateResult AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . result AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right // 设置由主线程向worker线程发送什么消息 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left workerInstance AST#expression#Right . postMessage AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left WorkerMessage AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left totalTimeSteps AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
export function computeNBodyByWorker(totalTimeSteps: number): void { Logger.info(TAG, "computeNBodyByWorker: start executing"); let workerInstance = new worker.ThreadWorker("entry/ets/workers/CalculateWorker.ts"); workerInstance.onmessage = (e: MessageEvents): void => { let data: Record<string, Object> = e.data; Logger.info(TAG, 'computeNBodyByWorker: executed successfully, total time costed = ' + data.result + ' ms.'); AppStorage.set<String>('timeCost', util.format(calculateResult, data.result)); } workerInstance.postMessage(new WorkerMessage(totalTimeSteps)); }
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Performance/NBody/entry/src/main/ets/model/CalculateUtil.ets#L86-L99
650492e908d3cea1d8771346e1eb1d6c2f826005
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/detailitem/DetailItemManager.ets
arkts
init
MARK: - 初始化
init(): void { this.loadPreference() }
AST#method_declaration#Left init AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . loadPreference AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
init(): void { this.loadPreference() }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/detailitem/DetailItemManager.ets#L83-L85
49abf9bc00911a4375f113adcc3a9bcece51cde3
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/navigation/src/main/ets/NavigationParam.ets
arkts
订单 ID 参数
export interface OrderIdParam { /** * 订单 ID */ orderId: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface OrderIdParam AST#object_type#Left { /** * 订单 ID */ AST#type_member#Left orderId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface OrderIdParam { orderId: number; }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/NavigationParam.ets#L19-L24
d3bc1937067c4f809101cc7c968df3a071761e0a
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/LocationUtil.ets
arkts
getCountryCode
获取当前的国家码(无需申请定位权限) @returns 返回当前位置中文描述
static async getCountryCode(): Promise<string> { let result = await geoLocationManager.getCountryCode(); //获取当前的国家码 if (result.country) { return result.country; } return ""; }
AST#method_declaration#Left static async getCountryCode AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left result = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left geoLocationManager AST#expression#Right AST#await_expression#Right AST#expression#Right . getCountryCode AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //获取当前的国家码 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right . country AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right . country AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left "" AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static async getCountryCode(): Promise<string> { let result = await geoLocationManager.getCountryCode(); if (result.country) { return result.country; } return ""; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LocationUtil.ets#L277-L283
7e5da817b4c7892e4480814861afe28db158c76c
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/MoneyTrack-master/commons/commonlib/src/main/ets/utils/router/Router.ets
arkts
size
获取栈大小
public static size() { return RouterModule._stack.size(); }
AST#method_declaration#Left public static size AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left RouterModule AST#expression#Right . _stack AST#member_expression#Right AST#expression#Right . size AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public static size() { return RouterModule._stack.size(); }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/MoneyTrack-master/commons/commonlib/src/main/ets/utils/router/Router.ets#L103-L105
a18fccbe5b9793fc2d5c508386d0723b05706bc0
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets
arkts
customSegmentButtonItem
自定义分段按钮项 @param index 自定义分段按钮索引。这里对应自定义日历视图类型。0:年视图YEAR,1:月视图MONTH,2:周视图WEEK @param name 自定义分段按钮名。这里对应'年','月','周'
@Builder customSegmentButtonItem(index: number, name: string) { Column() { Text(name) .width(CUSTOM_SEGMENT_BUTTON_MONTH_WIDTH) .textAlign(TextAlign.Center) .height($r('app.integer.calendar_switch_size_thirty_five')) .fontSize($r('app.integer.calendar_switch_size_fourteen')) .fontColor(this.currentIndex === index ? Color.Black : $r('app.color.calendar_switch_segment_button_font_color')) .fontWeight(this.currentIndex === index ? FONT_WEIGHT_FIVE_HUNDRED : FONT_WEIGHT_FOUR_HUNDRED) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .layoutWeight(LAYOUT_WEIGHT_ONE) .onClick(() => { if (index === this.tabSelectedIndex) { // 点击同一个自定义分段按钮项,不做切换,避免冗余操作 return; } this.tabSelectedIndex = index; this.tabController.changeIndex(index); this.currentShowYear = this.currentSelectDay.year; this.currentShowMonth = this.currentSelectDay.month; // TODO 知识点:点击自定义分段按钮customSegmentButton进行年、月、周视图间切换。使用视图控制器的swiperRefresh方法刷新对应视图数据。 if (this.tabSelectedIndex === CalendarViewType.MONTH) { // 刷新月视图 this.calendarMonthController.swiperRefresh(CalendarViewType.MONTH); } else if (this.tabSelectedIndex === CalendarViewType.WEEK) { // 刷新周视图 this.calendarWeekController.swiperRefresh(CalendarViewType.WEEK); } else if (this.tabSelectedIndex === CalendarViewType.YEAR) { // 刷新年视图 this.calendarYearController.swiperRefresh(CalendarViewType.YEAR); } }) } /** * 自定义分段按钮切换动画 * @param duration 动画时长 * @param leftMargin 自定义分段按钮左侧边距 */ startAnimateTo(duration: number, leftMargin: number) { animateTo({ duration: duration, // 动画时长 curve: Curve.Linear, // 动画曲线 iterations: 1, // 播放次数 playMode: PlayMode.Normal, // 动画模式 }, () => { this.indicatorLeftMargin = leftMargin; }) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customSegmentButtonItem AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left name AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left CUSTOM_SEGMENT_BUTTON_MONTH_WIDTH AST#expression#Right ) AST#modifier_chain_expression#Left . textAlign ( AST#expression#Left AST#member_expression#Left AST#expression#Left TextAlign AST#expression#Right . Center AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_thirty_five' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_fourteen' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Black AST#member_expression#Right AST#expression#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.calendar_switch_segment_button_font_color' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#conditional_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left FONT_WEIGHT_FIVE_HUNDRED AST#expression#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left FONT_WEIGHT_FOUR_HUNDRED AST#primary_type#Right AST#type_annotation#Right ) } AST#ERROR#Right . width AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_thirty_five' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . layoutWeight AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left LAYOUT_WEIGHT_ONE AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . onClick AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . tabSelectedIndex AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 点击同一个自定义分段按钮项,不做切换,避免冗余操作 AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right = AST#expression#Left index AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabController AST#member_expression#Right AST#expression#Right . changeIndex AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowYear AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . year AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowMonth AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . month AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // TODO 知识点:点击自定义分段按钮customSegmentButton进行年、月、周视图间切换。使用视图控制器的swiperRefresh方法刷新对应视图数据。 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 刷新月视图 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarMonthController AST#member_expression#Right AST#expression#Right . swiperRefresh AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . WEEK AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 刷新周视图 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarWeekController AST#member_expression#Right AST#expression#Right . swiperRefresh AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . WEEK AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 刷新年视图 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarYearController AST#member_expression#Right AST#expression#Right . swiperRefresh AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#ERROR#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right /** * 自定义分段按钮切换动画 * @param duration 动画时长 * @param leftMargin 自定义分段按钮左侧边距 */ AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left startAnimateTo ( AST#expression#Left duration AST#expression#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right , AST#expression#Left leftMargin AST#expression#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ) { animateTo ( AST#component_parameters#Left { AST#component_parameter#Left duration : AST#expression#Left duration AST#expression#Right AST#component_parameter#Right , // 动画时长 AST#component_parameter#Left curve : AST#expression#Left AST#member_expression#Left AST#expression#Left Curve AST#expression#Right . Linear AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , // 动画曲线 AST#component_parameter#Left iterations : AST#expression#Left 1 AST#expression#Right AST#component_parameter#Right , // 播放次数 AST#component_parameter#Left playMode : AST#expression#Left AST#member_expression#Left AST#expression#Left PlayMode AST#expression#Right . Normal AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , // 动画模式 } AST#component_parameters#Right AST#ERROR#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . indicatorLeftMargin AST#member_expression#Right = AST#expression#Left leftMargin AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder customSegmentButtonItem(index: number, name: string) { Column() { Text(name) .width(CUSTOM_SEGMENT_BUTTON_MONTH_WIDTH) .textAlign(TextAlign.Center) .height($r('app.integer.calendar_switch_size_thirty_five')) .fontSize($r('app.integer.calendar_switch_size_fourteen')) .fontColor(this.currentIndex === index ? Color.Black : $r('app.color.calendar_switch_segment_button_font_color')) .fontWeight(this.currentIndex === index ? FONT_WEIGHT_FIVE_HUNDRED : FONT_WEIGHT_FOUR_HUNDRED) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .layoutWeight(LAYOUT_WEIGHT_ONE) .onClick(() => { if (index === this.tabSelectedIndex) { return; } this.tabSelectedIndex = index; this.tabController.changeIndex(index); this.currentShowYear = this.currentSelectDay.year; this.currentShowMonth = this.currentSelectDay.month; if (this.tabSelectedIndex === CalendarViewType.MONTH) { this.calendarMonthController.swiperRefresh(CalendarViewType.MONTH); } else if (this.tabSelectedIndex === CalendarViewType.WEEK) { this.calendarWeekController.swiperRefresh(CalendarViewType.WEEK); } else if (this.tabSelectedIndex === CalendarViewType.YEAR) { this.calendarYearController.swiperRefresh(CalendarViewType.YEAR); } }) } startAnimateTo(duration: number, leftMargin: number) { animateTo({ duration: duration, curve: Curve.Linear, iterations: 1, playMode: PlayMode.Normal, }, () => { this.indicatorLeftMargin = leftMargin; }) }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets#L253-L305
81062902f6f0a8284ab95e5b359a4d1f99d8f62f
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets
arkts
updateTitleInput
更新标题输入 @param {string} value - 输入内容 @returns {void} 无返回值
updateTitleInput(value: string): void { this.titleInput = value; }
AST#method_declaration#Left updateTitleInput AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . titleInput AST#member_expression#Right = AST#expression#Left value AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
updateTitleInput(value: string): void { this.titleInput = value; }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets#L53-L55
10b18bb0f7682cc38749bef6d4e88d0719773b3e
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/util/StrAndUintUtil.ets
arkts
stringToByteArray
字符串转换为Uint8Array数组 @param str 字符串C1C3C2格式的,true为是 @param keyName 密钥长度 @param isC1C3C2 传入的字符串是否为 @returns Uint8Array数组
static stringToByteArray(str: string, keyName: number, isC1C3C2?: boolean): Uint8Array { if (isC1C3C2) { str = new SM2Convert().i2dSM2(str); } //判断是否为HarmonyOS自己生成的字符串,只包含小写a-z和数字 if (str.length != keyName / 8) { const hexString = str.match(/.{1,2}/g); // 将字符串按每两个字符分割为数组 let arr = new Array<string>(); hexString?.forEach((val) => { arr.push(val); }) let byteArray: number[] = arr.map(byte => parseInt(byte, 16)); // 将每个十六进制字节转换为整数 if (byteArray.length == 0) { let emptyArr = new Array<number>(); for (let i = 0; i < keyName / 8; i++) { emptyArr.push(0); } byteArray = emptyArr; } return new Uint8Array(byteArray); }
AST#method_declaration#Left static stringToByteArray AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left keyName : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left isC1C3C2 ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left isC1C3C2 AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left str = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left SM2Convert AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . i2dSM2 AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right //判断是否为HarmonyOS自己生成的字符串,只包含小写a-z和数字 AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left str AST#expression#Right . length AST#member_expression#Right AST#expression#Right != AST#expression#Left AST#binary_expression#Left AST#expression#Left keyName AST#expression#Right / AST#expression#Left 8 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left const AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left hexString = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left str AST#expression#Right . match AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#ERROR#Left / . AST#ERROR#Right AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#object_literal#Left { AST#ERROR#Left AST#property_name#Left 1 AST#property_name#Right , 2 AST#ERROR#Right } AST#object_literal#Right AST#expression#Right / AST#expression#Left g AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right // 将字符串按每两个字符分割为数组 AST#expression_statement#Left AST#expression#Left let AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left arr = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Array AST#expression#Right AST#new_expression#Right AST#expression#Right AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hexString AST#expression#Right ?. forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left val AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left arr AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left val AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left let AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left byteArray AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left arr AST#expression#Right . map AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left byte => AST#expression#Left AST#call_expression#Left AST#expression#Left parseInt AST#expression#Right AST#argument_list#Left ( AST#expression#Left byte AST#expression#Right , AST#expression#Left 16 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right // 将每个十六进制字节转换为整数 AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left byteArray AST#expression#Right . length AST#member_expression#Right AST#expression#Right == AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left let AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left emptyArr = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Array AST#expression#Right AST#new_expression#Right AST#expression#Right AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left for AST#expression#Right AST#ERROR#Left ( AST#expression#Left AST#assignment_expression#Left let AST#ERROR#Left i AST#ERROR#Right = AST#expression#Left 0 AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#ERROR#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right < AST#expression#Left AST#binary_expression#Left AST#expression#Left keyName AST#expression#Right / AST#expression#Left 8 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right ++ AST#update_expression#Right AST#expression#Right AST#expression_statement#Right AST#ERROR#Left ) AST#ERROR#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left emptyArr AST#property_assignment#Right AST#object_literal#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left byteArray = AST#expression#Left emptyArr AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left return AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Uint8Array AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left byteArray AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
static stringToByteArray(str: string, keyName: number, isC1C3C2?: boolean): Uint8Array { if (isC1C3C2) { str = new SM2Convert().i2dSM2(str); } if (str.length != keyName / 8) { const hexString = str.match(/.{1,2}/g); let arr = new Array<string>(); hexString?.forEach((val) => { arr.push(val); }) let byteArray: number[] = arr.map(byte => parseInt(byte, 16)); if (byteArray.length == 0) { let emptyArr = new Array<number>(); for (let i = 0; i < keyName / 8; i++) { emptyArr.push(0); } byteArray = emptyArr; } return new Uint8Array(byteArray); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/util/StrAndUintUtil.ets#L166-L186
51285b2448d9e41528781e231ad7708986677898
gitee
Active-hue/ArkTS-Accounting.git
c432916d305b407557f08e35017c3fd70668e441
entry/src/main/ets/pages/ReminderSetting.ets
arkts
formatTime
格式化时间(补零)
formatTime(time: number): string { return time < 10 ? `0${time}` : `${time}`; }
AST#method_declaration#Left formatTime AST#parameter_list#Left ( AST#parameter#Left time : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left time AST#expression#Right < AST#expression#Left 10 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#template_literal#Left ` 0 AST#template_substitution#Left $ { AST#expression#Left time AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right : AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left time AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right AST#conditional_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
formatTime(time: number): string { return time < 10 ? `0${time}` : `${time}`; }
https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/pages/ReminderSetting.ets#L135-L137
931af48a72d280ab7ae2c9d48a2ae5a252e4c8fb
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/sync/CloudStorageProvider.ets
arkts
腾讯云存储实现
export class TencentCloudStorageProvider extends CloudStorageProvider { async initialize(): Promise<void> { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Initializing Tencent Cloud Storage'); // TODO: 实现腾讯云存储初始化 } async upload(options: UploadOptions): Promise<string> { // TODO: 实现腾讯云上传 throw new Error('Tencent Cloud storage not implemented yet'); } async download(options: DownloadOptions): Promise<ArrayBuffer> { // TODO: 实现腾讯云下载 throw new Error('Tencent Cloud storage not implemented yet'); } async delete(path: string): Promise<void> { // TODO: 实现腾讯云删除 throw new Error('Tencent Cloud storage not implemented yet'); } async exists(path: string): Promise<boolean> { // TODO: 实现腾讯云存在性检查 throw new Error('Tencent Cloud storage not implemented yet'); } async list(prefix: string): Promise<CloudFile[]> { // TODO: 实现腾讯云列表 throw new Error('Tencent Cloud storage not implemented yet'); } async getFileInfo(path: string): Promise<CloudFile> { // TODO: 实现腾讯云文件信息获取 throw new Error('Tencent Cloud storage not implemented yet'); } }
AST#export_declaration#Left export AST#class_declaration#Left class TencentCloudStorageProvider extends AST#type_annotation#Left AST#primary_type#Left CloudStorageProvider AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#method_declaration#Left async initialize AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left 'Initializing Tencent Cloud Storage' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right // TODO: 实现腾讯云存储初始化 } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left async upload AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left UploadOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // TODO: 实现腾讯云上传 AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Tencent Cloud storage not implemented yet' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left async download AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left DownloadOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // TODO: 实现腾讯云下载 AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Tencent Cloud storage not implemented yet' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left async delete AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // TODO: 实现腾讯云删除 AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Tencent Cloud storage not implemented yet' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left async exists AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // TODO: 实现腾讯云存在性检查 AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Tencent Cloud storage not implemented yet' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left async list AST#parameter_list#Left ( AST#parameter#Left prefix : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CloudFile [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // TODO: 实现腾讯云列表 AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Tencent Cloud storage not implemented yet' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left async getFileInfo AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left CloudFile AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // TODO: 实现腾讯云文件信息获取 AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Tencent Cloud storage not implemented yet' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class TencentCloudStorageProvider extends CloudStorageProvider { async initialize(): Promise<void> { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Initializing Tencent Cloud Storage'); } async upload(options: UploadOptions): Promise<string> { throw new Error('Tencent Cloud storage not implemented yet'); } async download(options: DownloadOptions): Promise<ArrayBuffer> { throw new Error('Tencent Cloud storage not implemented yet'); } async delete(path: string): Promise<void> { throw new Error('Tencent Cloud storage not implemented yet'); } async exists(path: string): Promise<boolean> { throw new Error('Tencent Cloud storage not implemented yet'); } async list(prefix: string): Promise<CloudFile[]> { throw new Error('Tencent Cloud storage not implemented yet'); } async getFileInfo(path: string): Promise<CloudFile> { throw new Error('Tencent Cloud storage not implemented yet'); } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/sync/CloudStorageProvider.ets#L370-L405
c05d0acdb9a8a62d4f1c20131152664a6211971a
github
wasd09090030/MyHongmengProject.git
a8ed386b658ceeac69ef5bc42a92d78c7980821c
entry/src/main/ets/components/TimerPage.ets
arkts
onTaskSwitch
当信号变化时调用
onTaskSwitch() { this.checkAndSetupTask(); }
AST#method_declaration#Left onTaskSwitch AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . checkAndSetupTask AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
onTaskSwitch() { this.checkAndSetupTask(); }
https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/components/TimerPage.ets#L41-L43
af294ecd2f08c390a68e52a604a0f313c0633956
github
Million-mo/tree-sitter-arkts.git
2fd0ad75e2d848709edcf4be038f27b178114ef6
examples/custom_builders.ets
arkts
tabBuilder
本地Builder方法 - 标签页Builder
@Builder tabBuilder(title: string, index: number, icon: string) { Column() { Text(icon) .fontSize(20) .margin({ bottom: 4 }) Text(title) .fontSize(12) .fontColor(this.currentTab === index ? Color.Blue : Color.Gray) } .width(80) .height(60) .justifyContent(FlexAlign.Center) .backgroundColor(this.currentTab === index ? '#e6f3ff' : Color.Transparent) .borderRadius(8) .onClick(() => { this.currentTab = index }) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right tabBuilder AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left icon : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left icon AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 20 AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left 4 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left title AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentTab AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Blue AST#member_expression#Right AST#expression#Right : AST#expression#Left Color AST#expression#Right AST#conditional_expression#Right AST#expression#Right . Gray AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left 80 AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left 60 AST#expression#Right ) AST#modifier_chain_expression#Left . justifyContent ( AST#expression#Left AST#member_expression#Left AST#expression#Left FlexAlign AST#expression#Right . Center AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentTab AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left '#e6f3ff' AST#expression#Right : AST#expression#Left Color AST#expression#Right AST#conditional_expression#Right AST#expression#Right . Transparent AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 8 AST#expression#Right ) AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentTab AST#member_expression#Right = AST#expression#Left index AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder tabBuilder(title: string, index: number, icon: string) { Column() { Text(icon) .fontSize(20) .margin({ bottom: 4 }) Text(title) .fontSize(12) .fontColor(this.currentTab === index ? Color.Blue : Color.Gray) } .width(80) .height(60) .justifyContent(FlexAlign.Center) .backgroundColor(this.currentTab === index ? '#e6f3ff' : Color.Transparent) .borderRadius(8) .onClick(() => { this.currentTab = index }) }
https://github.com/Million-mo/tree-sitter-arkts.git/blob/2fd0ad75e2d848709edcf4be038f27b178114ef6/examples/custom_builders.ets#L141-L160
71798756166460d7badf5679e5290bf6b8ea7c6c
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/networks/Server_Routes.ets
arkts
定义路由枚举
export enum Route { advice = "advice", user_data = "user_data", login = "login", reclaimWord = "reclaim_word", subscription = "subscription", servercfg = "servercfg",//TODO //dict word = "w", search = "search", }
AST#export_declaration#Left export AST#enum_declaration#Left enum Route AST#enum_body#Left { AST#enum_member#Left advice = AST#expression#Left "advice" AST#expression#Right AST#enum_member#Right , AST#enum_member#Left user_data = AST#expression#Left "user_data" AST#expression#Right AST#enum_member#Right , AST#enum_member#Left login = AST#expression#Left "login" AST#expression#Right AST#enum_member#Right , AST#enum_member#Left reclaimWord = AST#expression#Left "reclaim_word" AST#expression#Right AST#enum_member#Right , AST#enum_member#Left subscription = AST#expression#Left "subscription" AST#expression#Right AST#enum_member#Right , AST#enum_member#Left servercfg = AST#expression#Left "servercfg" AST#expression#Right AST#enum_member#Right , //TODO //dict AST#enum_member#Left word = AST#expression#Left "w" AST#expression#Right AST#enum_member#Right , AST#enum_member#Left search = AST#expression#Left "search" AST#expression#Right AST#enum_member#Right , } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
export enum Route { advice = "advice", user_data = "user_data", login = "login", reclaimWord = "reclaim_word", subscription = "subscription", servercfg = "servercfg", word = "w", search = "search", }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/networks/Server_Routes.ets#L20-L35
a402a08f76742ade95e6f6649a64172ef83419f1
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/utils/MD5.ets
arkts
hmac
消息认证码计算,异步 @param data 传入的消息 @param symKey 共享对称密钥。 @param resultCoding 摘要的编码方式(base64/hex),默认不传为hex。
static async hmac(data: string, symKey: cryptoFramework.SymKey = MD5.symKey, resultCoding: crypto.BhCoding = 'hex'): Promise<string> { return CryptoUtil.hmac(data, 'MD5', symKey, resultCoding); }
AST#method_declaration#Left static async hmac AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . SymKey AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left MD5 AST#expression#Right . symKey AST#member_expression#Right AST#expression#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left crypto . BhCoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'hex' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CryptoUtil AST#expression#Right . hmac AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left data AST#expression#Right , AST#expression#Left 'MD5' AST#expression#Right , AST#expression#Left symKey AST#expression#Right , AST#expression#Left resultCoding AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static async hmac(data: string, symKey: cryptoFramework.SymKey = MD5.symKey, resultCoding: crypto.BhCoding = 'hex'): Promise<string> { return CryptoUtil.hmac(data, 'MD5', symKey, resultCoding); }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/utils/MD5.ets#L81-L84
8a5391ec86783500b4502c3811ae3281952b4aa7
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/data/src/main/ets/repository/OrderRepository.ets
arkts
alipayAppPay
发起支付宝 App 支付 @param params 支付参数 @returns 支付签名结果
async alipayAppPay(params: Record<string, number>): Promise<NetworkResponse<string>> { return this.networkDataSource.alipayAppPay(params); }
AST#method_declaration#Left async alipayAppPay AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left NetworkResponse AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . networkDataSource AST#member_expression#Right AST#expression#Right . alipayAppPay AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left params AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async alipayAppPay(params: Record<string, number>): Promise<NetworkResponse<string>> { return this.networkDataSource.alipayAppPay(params); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/OrderRepository.ets#L38-L40
fd3366992e460520869de3068512058f3ef4a7da
github
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/services/TaskService.ets
arkts
任务接口定义
export interface AgvTask { id: number; taskCode: string; taskName: string; startPos: string; taskTrip: string; creator: string; executor: string; execTime?: Date; endTime?: Date; createTime: Date; taskStatus: string; round: number; uploaded: boolean; remark?: string; cloudTaskId?: number; deleteFlag?: boolean; }
AST#export_declaration#Left export AST#interface_declaration#Left interface AgvTask AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left taskCode : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left taskName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left startPos : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left taskTrip : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left creator : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left executor : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left execTime ? : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left endTime ? : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left createTime : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left taskStatus : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left round : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left uploaded : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left remark ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left cloudTaskId ? : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left deleteFlag ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface AgvTask { id: number; taskCode: string; taskName: string; startPos: string; taskTrip: string; creator: string; executor: string; execTime?: Date; endTime?: Date; createTime: Date; taskStatus: string; round: number; uploaded: boolean; remark?: string; cloudTaskId?: number; deleteFlag?: boolean; }
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/TaskService.ets#L5-L22
2655814011fdbf15eca270d774b176af1f3b3767
github
OHPG/FinVideo.git
2b288396af5b2a20a24575faa317b46214965391
entry/src/main/ets/pages/home/prefer/PreferViewModel.ets
arkts
@Author peerless2012 @Email peerless2012@126.com @DateTime 2024/11/28 21:12 @Version V1.0 @Description
export class PreferViewModel extends AppViewModel { }
AST#export_declaration#Left export AST#class_declaration#Left class PreferViewModel extends AST#type_annotation#Left AST#primary_type#Left AppViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class PreferViewModel extends AppViewModel { }
https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/pages/home/prefer/PreferViewModel.ets#L10-L12
64bf7e1c9914ab79e948bebeb286b06ff77b907a
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/model/DataSource.ets
arkts
getData
获取指定数据项
public getData(index: number): T | void { logger.info('getData, index:' + index); }
AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left T AST#primary_type#Right | AST#primary_type#Left void AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left 'getData, index:' AST#expression#Right + AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
public getData(index: number): T | void { logger.info('getData, index:' + index); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/model/DataSource.ets#L29-L31
b3d326dc4cb453be942834c053293d3bcfc1d375
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/NotificationManager.ets
arkts
cancelNotification
取消通知
async cancelNotification(notificationId: number): Promise<void> { try { await notificationManager.cancel(notificationId); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION, `Notification cancelled: ${notificationId}`); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION, `Failed to cancel notification: ${error}`); } }
AST#method_declaration#Left async cancelNotification AST#parameter_list#Left ( AST#parameter#Left notificationId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left notificationManager AST#expression#Right AST#await_expression#Right AST#expression#Right . cancel AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left notificationId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_NOTIFICATION AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Notification cancelled: AST#template_substitution#Left $ { AST#expression#Left notificationId AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_NOTIFICATION AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to cancel notification: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async cancelNotification(notificationId: number): Promise<void> { try { await notificationManager.cancel(notificationId); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION, `Notification cancelled: ${notificationId}`); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION, `Failed to cancel notification: ${error}`); } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationManager.ets#L563-L572
dc8b791be4ec8043daa562cd393dfe981448593d
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/voicerecordynamiceffect/src/main/ets/models/AudioRecorder.ets
arkts
stopRecordingProcess
停止录制对应的流程
async stopRecordingProcess(): Promise<void> { if (this.avRecorder !== undefined) { // 1. 停止录制 if (this.avRecorder.state === 'started' || this.avRecorder.state === 'paused') { // 仅在started或者paused状态下调用stop为合理状态切换 await this.avRecorder.stop(); clearInterval(this.time); } // 2.重置 await this.avRecorder.reset(); // 3.释放录制实例 await this.avRecorder.release(); this.avRecorder = undefined; } }
AST#method_declaration#Left async stopRecordingProcess AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avRecorder AST#member_expression#Right AST#expression#Right !== AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { // 1. 停止录制 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avRecorder AST#member_expression#Right AST#expression#Right . state AST#member_expression#Right AST#expression#Right === AST#expression#Left 'started' AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . avRecorder AST#member_expression#Right AST#expression#Right . state AST#member_expression#Right AST#expression#Right === AST#expression#Left 'paused' AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { // 仅在started或者paused状态下调用stop为合理状态切换 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . avRecorder AST#member_expression#Right AST#expression#Right . stop AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left clearInterval AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . time AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 2.重置 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . avRecorder AST#member_expression#Right AST#expression#Right . reset AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 3.释放录制实例 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . avRecorder AST#member_expression#Right AST#expression#Right . release AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avRecorder AST#member_expression#Right = AST#expression#Left undefined AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async stopRecordingProcess(): Promise<void> { if (this.avRecorder !== undefined) { if (this.avRecorder.state === 'started' || this.avRecorder.state === 'paused') { await this.avRecorder.stop(); clearInterval(this.time); } await this.avRecorder.reset(); await this.avRecorder.release(); this.avRecorder = undefined; } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/voicerecordynamiceffect/src/main/ets/models/AudioRecorder.ets#L98-L112
1874d8c1f2916e7cbf0161358e5336b0b9ae9269
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/EditImage.ets
arkts
repeal
撤销功能
async repeal(): Promise<void> { const pm: image.PixelMap | undefined = this.pixelMapQueue.pop(); if (pm !== null && pm !== undefined) { this.pixelMap = await copyPixelMap(pm); } }
AST#method_declaration#Left async repeal AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left pm : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#qualified_type#Left image . PixelMap AST#qualified_type#Right AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . pixelMapQueue AST#member_expression#Right AST#expression#Right . pop AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left pm AST#expression#Right !== AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left pm AST#expression#Right !== AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . pixelMap AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left copyPixelMap AST#expression#Right AST#await_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left pm AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async repeal(): Promise<void> { const pm: image.PixelMap | undefined = this.pixelMapQueue.pop(); if (pm !== null && pm !== undefined) { this.pixelMap = await copyPixelMap(pm); } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/EditImage.ets#L197-L202
d69ff26a760930f3374755567cc5f9696a98fb1a
gitee
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/commons/constants/CommonConstants.ets
arkts
Public constants.
export class CommonConstants { static readonly HARMONY_HEI_TI_FONT_FAMILY = 'HarmonyHeiTi'; static readonly HARMONY_HEI_TI_MEDIUM_FONT_FAMILY = 'HarmonyHeiTi-Medium'; static readonly HARMONY_HEI_TI_BOLD_FONT_FAMILY = 'HarmonyHeiTi-Bold'; // StatusBarContentColor static readonly StatusBarContentWhiteColor: string = '#ffffff'; static readonly StatusBarContentBlackColor: string = '#000000'; // list上部的标题高度 static readonly LIST_HEADER_HEIGHT: number = 60; // 页面状态栏标题高度 static readonly PAGE_HEADER_HEIGHT: number = 62; // opacity static readonly FIRST_LEVEL_OPACITY: number = 0.9; static readonly SECOND_LEVEL_OPACITY: number = 0.6; static readonly HALF_OPACITY: number = 0.5; static readonly NAVIGATION_BAR_OPACITY_MAX: number = 1; // percent static readonly FULL_PERCENT: string = '100%'; static readonly BANNER_HEIGHT_PERCENT: string = '35%'; // zIndex static readonly Z_INDEX_ONE: number = 1; static readonly Z_INDEX_TWO: number = 2; static readonly Z_INDEX_THREE: number = 3; // aspectRatio static readonly ASPECT_RATIO_ONE: number = 1; static readonly ASPECT_RATIO_SECOND: number = 1.6; // duration static readonly ANIMATION_DURATION: number = 150; static readonly ANIMATION_DURATION1: number = 200; static readonly ANIMATION_DURATION2: number = 300; // offset static readonly MAIN_SCROLLER_OFFSET_X: number = 0; static readonly MAIN_SCROLLER_OFFSET_Y: number = 0; static readonly MAIN_SCROLLER_OFFSET_Y_ZERO: number = 0; static readonly MAIN_SCROLLER_OFFSET_Y_MAX: number = 54; static readonly MAIN_SCROLLER_OFFSET_STATUS_CHANGE: number = 24; // postion static readonly FAVOR_POSITION_X: number = 0; static readonly HIGHLIGHT_POSITION_X: number = 0; static readonly HIGHLIGHT_POSITION_X2: number = 40; static readonly COLLECTED_POSITION_X: number = 0; static readonly COLLECTED_POSITION_X2: number = 80; static readonly SEARCH_POSITION_RIGHT: number = 0; // layoutWeight static readonly LAYOUT_WEIGHT: number = 1; // borderRadius static readonly SEARCH_BORDER_RADIUS1: number = 5; static readonly SEARCH_BORDER_RADIUS2: number = 17; static readonly SHARE_BORDER_RADIUS: number = 15; static readonly SCAN_BORDER_RADIUS: number = 15; static readonly SETTING_BORDER_RADIUS: number = 15; static readonly TYPE_BORDER_RADIUS: number = 4; static readonly ITEM_BORDER_RADIUS: number = 8; static readonly ITEM_IMAGE_BORDER_RADIUS: number = 8; // space static readonly TOOL_VIEW_SPACE: number = 10; static readonly ARTICLES_LIST_SPACE: number = 10; static readonly ARTICLES_LABEL_SPACE: number = 12; // status-navigationBarHeight static readonly NAVIGATION_BAR_HEIGHT: number = 44; static readonly STATUS_BAR_HEIGHT: number = 54; // linearGradientSet static readonly LIST_LINEAR_GRADIENT_START: number = 0.0; static readonly LIST_LINEAR_GRADIENT_END: number = 0.1; static readonly LIST_LINEAR_GRADIENT_START_COLOR: string = '#FF0091FF'; static readonly LIST_LINEAR_GRADIENT_END_COLOR: string = '#FFF1F3F5'; static readonly ITEM_LINEAR_GRADIENT_ANGLE: string = '90'; static readonly ITEM_LINEAR_GRADIENT_START: number = 0; static readonly ITEM_LINEAR_GRADIENT_END: number = 1; static readonly ITEM_LINEAR_GRADIENT_START_COLOR: string = '#FFDCEAF9'; static readonly ITEM_LINEAR_GRADIENT_END_COLOR: string = '#FFF1F3F5'; // maxLines static readonly MAX_LINES_ONE: number = 1; static readonly MAX_LINES_TWO: number = 2; // cachedCount static readonly CACHE_COUNT: number = 2; /** * The request permission. */ static readonly REQUEST_PERMISSIONS: Array<Permissions> = [ 'ohos.permission.APPROXIMATELY_LOCATION', 'ohos.permission.LOCATION' ]; /** * Contact width on LG devices. */ static readonly CONTACTS_PAGE_WIDTH_LG: string = '60%'; /** * Title ID. */ static readonly TITLE_ID: string = 'titleId'; /** * Text ID. */ static readonly TEXT_ID: string = 'textId'; /** * List comm space. */ static readonly LIST_COMM_SPACE: number = 8; /** * Maximum number of images that can be added. */ static readonly MAX_ADD_PIC: number = 9; /** * Local info list width. */ static readonly LOCAL_INFO_LIST_WIDTH: string = '95%'; /** * Route back to the home page url. */ static readonly ROUTE_BACK_HOME_URL: string = 'pages/Home'; /** * URL of the contact page. */ static readonly ROUTE_CONTACT_PAGE_URL: string = 'pages/ContactsPage'; /** * Topic symbol #. */ static readonly TOPIC_SYMBOL: string = '#'; /** * Tips contact symbol @. */ static readonly TIPS_CONTACT_SYMBOL: string = '@'; /** * Default layout weight. */ static readonly DEFAULT_LAYOUT_WEIGHT: number = 1; /** * Start position of the list when it is loaded for the first time. */ static readonly INDEX_START_POSITION: number = 0; /** * Alphabetical Index Bar Alphabetical Area Size. */ static readonly ALPHABET_INDEXER_ITEM_SIZE: number = 20; /** * Last location intercepted from the SM location information. */ static readonly END_SM_LOCAL_INFO: number = 20; /** * Last location intercepted from the MD location information. */ static readonly END_MD_LOCAL_INFO: number = 40; /** * Subscript of the number of characters to be truncated at the start of the position information. */ static readonly START_MD_LOCAL_INFO: number = 0; /** * Omitted character. */ static readonly OMITTED_CHARACTER: string = '...'; /** * Topic information list data. */ static readonly TOPIC_INFO_LIST: TopicInfoList[] = [ new TopicInfoList( [ new TopicInfo('1', $r('app.string.crowd_theme_contest'), '3520.8'), new TopicInfo('2', $r('app.string.crowd_theme_contest'), '3190.8'), new TopicInfo('3', $r('app.string.crowd_theme_contest'), '3130.8'), new TopicInfo('4', $r('app.string.crowd_theme_contest'), '3020.8'), new TopicInfo('5', $r('app.string.crowd_theme_contest'), '2820.8'), new TopicInfo('6', $r('app.string.crowd_theme_contest'), '1520.8') ], $r('app.string.topic1'), '1'), new TopicInfoList( [ new TopicInfo('1', $r('app.string.crowd_theme_contest'), '3520.8'), new TopicInfo('2', $r('app.string.crowd_theme_contest'), '3190.8'), new TopicInfo('3', $r('app.string.crowd_theme_contest'), '3130.8') ], $r('app.string.topic2'), '2'), new TopicInfoList( [ new TopicInfo('1', $r('app.string.crowd_theme_contest'), '3520.8'), new TopicInfo('2', $r('app.string.crowd_theme_contest'), '3190.8'), new TopicInfo('3', $r('app.string.crowd_theme_contest'), '3130.8'), new TopicInfo('4', $r('app.string.crowd_theme_contest'), '3020.8'), new TopicInfo('5', $r('app.string.crowd_theme_contest'), '2820.8'), new TopicInfo('6', $r('app.string.crowd_theme_contest'), '2520.8'), new TopicInfo('7', $r('app.string.crowd_theme_contest'), '1828.8'), new TopicInfo('8', $r('app.string.crowd_theme_contest'), '1620.8') ], $r('app.string.topic3'), '3') ]; /** * Teletext list data. */ static readonly TITLE_INFO_DATA: TitleInfoList[] = [ new TitleInfoList($r('app.string.single_heading'), [ new TitleInfo('📒', $r('app.string.waiting_diary')), new TitleInfo('📉', $r('app.string.energy_sharing')), new TitleInfo('💔', $r('app.string.fond_teasing')), new TitleInfo('💰', $r('app.string.sunning_price')), new TitleInfo('💘', $r('app.string.utility_goods')), new TitleInfo('📷', $r('app.string.beautiful_life')), new TitleInfo('🌹', $r('app.string.love_share')) ]), new TitleInfoList($r('app.string.combined_head'), [ new TitleInfo('🚗', $r('app.string.retrofit_operation')), new TitleInfo('📓', $r('app.string.everyone_reviews')) ]), new TitleInfoList($r('app.string.composite_head'), [ new TitleInfo('📒', $r('app.string.waiting_diary')), new TitleInfo('📉', $r('app.string.energy_sharing')), new TitleInfo('💔', $r('app.string.fond_teasing')), new TitleInfo('💰', $r('app.string.sunning_price')), new TitleInfo('💘', $r('app.string.utility_goods')), new TitleInfo('📷', $r('app.string.beautiful_life')), new TitleInfo('🚗', $r('app.string.retrofit_operation')), new TitleInfo('📓', $r('app.string.everyone_reviews')) ]) ]; /** * Contact list data. */ static readonly CONTACT_DATA: ContactGroup[] = [ new ContactGroup($r('app.string.recent_contact'), [ new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name1')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name3')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name30')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name26')) ]), new ContactGroup('A', [ new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name1')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name2')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name3')) ]), new ContactGroup('B', [ new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name4')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name5')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name6')) ]), new ContactGroup('C', [ new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name7')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name8')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name9')) ]), new ContactGroup('D', [ new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name10')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name11')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name12')) ]), new ContactGroup('E', []), new ContactGroup('F', [ new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name13')), new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name14')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name15')) ]), new ContactGroup('G', [ new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name16')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name17')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name18')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name19')) ]), new ContactGroup('H', [ new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name20')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name21')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name22')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name23')), new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name24')) ]), new ContactGroup('I', []), new ContactGroup('J', [ new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name25')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name26')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name27')) ]), new ContactGroup('K', [ new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name28')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name29')), new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name30')) ]), new ContactGroup('L', [ new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name31')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name32')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name33')) ]), new ContactGroup('M', [ new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name34')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name35')) ]), new ContactGroup('N', [ new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name36')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name37')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name38')), ]), new ContactGroup('O', []), new ContactGroup('P', [ new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name39')), ]), new ContactGroup('Q', [ new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name40')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name41')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name42')), ]), new ContactGroup('R', [ new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name43')), new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name44')), ]), new ContactGroup('S', [ new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name45')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name46')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name47')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name48')), ]), new ContactGroup('T', [ new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name49')), new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name50')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name51')), ]), new ContactGroup('U', [ new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name52'))]), new ContactGroup('V', [ new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name53'))]), new ContactGroup('W', [ new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name54')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name55')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name56')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name57')) ]), new ContactGroup('X', [ new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name58')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name59')), new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name60')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name61')) ]), new ContactGroup('Y', [ new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name62')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name63')), new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name64')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name65')) ]), new ContactGroup('Z', [ new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name66')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name67')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name68')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name69')), new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name70')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name71')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name72')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name73')) ]) ]; /** * AlphabetIndexer alphabetical index bar data. */ static readonly TAB_VALUE: string[] = [ '#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ]; /** * Current location information list. */ static readonly CURRENT_LOCAL_INFO: ResourceStr[] = [ $r('app.string.default_location', 1), $r('app.string.default_location', 2), $r('app.string.default_location', 3), $r('app.string.default_location', 4), $r('app.string.default_location', 5), $r('app.string.default_location', 6), $r('app.string.default_location', 7), $r('app.string.default_location', 8), $r('app.string.default_location', 9), $r('app.string.default_location', 10) ]; }
AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { AST#property_declaration#Left static readonly HARMONY_HEI_TI_FONT_FAMILY = AST#expression#Left 'HarmonyHeiTi' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly HARMONY_HEI_TI_MEDIUM_FONT_FAMILY = AST#expression#Left 'HarmonyHeiTi-Medium' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly HARMONY_HEI_TI_BOLD_FONT_FAMILY = AST#expression#Left 'HarmonyHeiTi-Bold' AST#expression#Right ; AST#property_declaration#Right // StatusBarContentColor AST#property_declaration#Left static readonly StatusBarContentWhiteColor : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '#ffffff' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly StatusBarContentBlackColor : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '#000000' AST#expression#Right ; AST#property_declaration#Right // list上部的标题高度 AST#property_declaration#Left static readonly LIST_HEADER_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 60 AST#expression#Right ; AST#property_declaration#Right // 页面状态栏标题高度 AST#property_declaration#Left static readonly PAGE_HEADER_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 62 AST#expression#Right ; AST#property_declaration#Right // opacity AST#property_declaration#Left static readonly FIRST_LEVEL_OPACITY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.9 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly SECOND_LEVEL_OPACITY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.6 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly HALF_OPACITY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.5 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly NAVIGATION_BAR_OPACITY_MAX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right // percent AST#property_declaration#Left static readonly FULL_PERCENT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '100%' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly BANNER_HEIGHT_PERCENT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '35%' AST#expression#Right ; AST#property_declaration#Right // zIndex AST#property_declaration#Left static readonly Z_INDEX_ONE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly Z_INDEX_TWO : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 2 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly Z_INDEX_THREE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 3 AST#expression#Right ; AST#property_declaration#Right // aspectRatio AST#property_declaration#Left static readonly ASPECT_RATIO_ONE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ASPECT_RATIO_SECOND : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1.6 AST#expression#Right ; AST#property_declaration#Right // duration AST#property_declaration#Left static readonly ANIMATION_DURATION : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 150 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ANIMATION_DURATION1 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 200 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ANIMATION_DURATION2 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 300 AST#expression#Right ; AST#property_declaration#Right // offset AST#property_declaration#Left static readonly MAIN_SCROLLER_OFFSET_X : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly MAIN_SCROLLER_OFFSET_Y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly MAIN_SCROLLER_OFFSET_Y_ZERO : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly MAIN_SCROLLER_OFFSET_Y_MAX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 54 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly MAIN_SCROLLER_OFFSET_STATUS_CHANGE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 24 AST#expression#Right ; AST#property_declaration#Right // postion AST#property_declaration#Left static readonly FAVOR_POSITION_X : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly HIGHLIGHT_POSITION_X : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly HIGHLIGHT_POSITION_X2 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 40 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly COLLECTED_POSITION_X : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly COLLECTED_POSITION_X2 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 80 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly SEARCH_POSITION_RIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right // layoutWeight AST#property_declaration#Left static readonly LAYOUT_WEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right // borderRadius AST#property_declaration#Left static readonly SEARCH_BORDER_RADIUS1 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 5 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly SEARCH_BORDER_RADIUS2 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 17 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly SHARE_BORDER_RADIUS : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 15 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly SCAN_BORDER_RADIUS : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 15 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly SETTING_BORDER_RADIUS : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 15 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly TYPE_BORDER_RADIUS : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 4 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ITEM_BORDER_RADIUS : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 8 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ITEM_IMAGE_BORDER_RADIUS : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 8 AST#expression#Right ; AST#property_declaration#Right // space AST#property_declaration#Left static readonly TOOL_VIEW_SPACE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 10 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ARTICLES_LIST_SPACE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 10 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ARTICLES_LABEL_SPACE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 12 AST#expression#Right ; AST#property_declaration#Right // status-navigationBarHeight AST#property_declaration#Left static readonly NAVIGATION_BAR_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 44 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly STATUS_BAR_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 54 AST#expression#Right ; AST#property_declaration#Right // linearGradientSet AST#property_declaration#Left static readonly LIST_LINEAR_GRADIENT_START : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly LIST_LINEAR_GRADIENT_END : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.1 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly LIST_LINEAR_GRADIENT_START_COLOR : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '#FF0091FF' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly LIST_LINEAR_GRADIENT_END_COLOR : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '#FFF1F3F5' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ITEM_LINEAR_GRADIENT_ANGLE : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '90' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ITEM_LINEAR_GRADIENT_START : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ITEM_LINEAR_GRADIENT_END : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ITEM_LINEAR_GRADIENT_START_COLOR : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '#FFDCEAF9' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly ITEM_LINEAR_GRADIENT_END_COLOR : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '#FFF1F3F5' AST#expression#Right ; AST#property_declaration#Right // maxLines AST#property_declaration#Left static readonly MAX_LINES_ONE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly MAX_LINES_TWO : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 2 AST#expression#Right ; AST#property_declaration#Right // cachedCount AST#property_declaration#Left static readonly CACHE_COUNT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 2 AST#expression#Right ; AST#property_declaration#Right /** * The request permission. */ AST#property_declaration#Left static readonly REQUEST_PERMISSIONS : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left Permissions AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left 'ohos.permission.APPROXIMATELY_LOCATION' AST#expression#Right , AST#expression#Left 'ohos.permission.LOCATION' AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right /** * Contact width on LG devices. */ AST#property_declaration#Left static readonly CONTACTS_PAGE_WIDTH_LG : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '60%' AST#expression#Right ; AST#property_declaration#Right /** * Title ID. */ AST#property_declaration#Left static readonly TITLE_ID : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'titleId' AST#expression#Right ; AST#property_declaration#Right /** * Text ID. */ AST#property_declaration#Left static readonly TEXT_ID : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'textId' AST#expression#Right ; AST#property_declaration#Right /** * List comm space. */ AST#property_declaration#Left static readonly LIST_COMM_SPACE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 8 AST#expression#Right ; AST#property_declaration#Right /** * Maximum number of images that can be added. */ AST#property_declaration#Left static readonly MAX_ADD_PIC : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 9 AST#expression#Right ; AST#property_declaration#Right /** * Local info list width. */ AST#property_declaration#Left static readonly LOCAL_INFO_LIST_WIDTH : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '95%' AST#expression#Right ; AST#property_declaration#Right /** * Route back to the home page url. */ AST#property_declaration#Left static readonly ROUTE_BACK_HOME_URL : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'pages/Home' AST#expression#Right ; AST#property_declaration#Right /** * URL of the contact page. */ AST#property_declaration#Left static readonly ROUTE_CONTACT_PAGE_URL : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'pages/ContactsPage' AST#expression#Right ; AST#property_declaration#Right /** * Topic symbol #. */ AST#property_declaration#Left static readonly TOPIC_SYMBOL : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '#' AST#expression#Right ; AST#property_declaration#Right /** * Tips contact symbol @. */ AST#property_declaration#Left static readonly TIPS_CONTACT_SYMBOL : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '@' AST#expression#Right ; AST#property_declaration#Right /** * Default layout weight. */ AST#property_declaration#Left static readonly DEFAULT_LAYOUT_WEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right /** * Start position of the list when it is loaded for the first time. */ AST#property_declaration#Left static readonly INDEX_START_POSITION : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right /** * Alphabetical Index Bar Alphabetical Area Size. */ AST#property_declaration#Left static readonly ALPHABET_INDEXER_ITEM_SIZE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 20 AST#expression#Right ; AST#property_declaration#Right /** * Last location intercepted from the SM location information. */ AST#property_declaration#Left static readonly END_SM_LOCAL_INFO : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 20 AST#expression#Right ; AST#property_declaration#Right /** * Last location intercepted from the MD location information. */ AST#property_declaration#Left static readonly END_MD_LOCAL_INFO : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 40 AST#expression#Right ; AST#property_declaration#Right /** * Subscript of the number of characters to be truncated at the start of the position information. */ AST#property_declaration#Left static readonly START_MD_LOCAL_INFO : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right /** * Omitted character. */ AST#property_declaration#Left static readonly OMITTED_CHARACTER : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '...' AST#expression#Right ; AST#property_declaration#Right /** * Topic information list data. */ AST#property_declaration#Left static readonly TOPIC_INFO_LIST : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TopicInfoList [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfoList AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3520.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3190.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3130.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '4' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3020.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '5' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '2820.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '1520.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.topic1' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '1' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfoList AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3520.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3190.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3130.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.topic2' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '2' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfoList AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3520.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3190.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3130.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '4' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3020.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '5' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '2820.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '2520.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '7' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '1828.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TopicInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '8' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.crowd_theme_contest' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '1620.8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.topic3' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left '3' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right /** * Teletext list data. */ AST#property_declaration#Left static readonly TITLE_INFO_DATA : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TitleInfoList [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfoList AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.single_heading' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '📒' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.waiting_diary' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '📉' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.energy_sharing' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '💔' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.fond_teasing' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '💰' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.sunning_price' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '💘' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.utility_goods' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '📷' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.beautiful_life' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '🌹' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.love_share' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfoList AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.combined_head' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '🚗' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.retrofit_operation' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '📓' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.everyone_reviews' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfoList AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.composite_head' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '📒' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.waiting_diary' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '📉' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.energy_sharing' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '💔' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.fond_teasing' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '💰' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.sunning_price' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '💘' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.utility_goods' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '📷' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.beautiful_life' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '🚗' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.retrofit_operation' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TitleInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '📓' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.everyone_reviews' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right /** * Contact list data. */ AST#property_declaration#Left static readonly CONTACT_DATA : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ContactGroup [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.recent_contact' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name1' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name3' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic8' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name30' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name26' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'A' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name1' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name2' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name3' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'B' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic4' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name4' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic5' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name5' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name6' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'C' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic7' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name7' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic8' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name8' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic9' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name9' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'D' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic10' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name10' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name11' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name12' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'E' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'F' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name13' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic4' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name14' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic5' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name15' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'G' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name16' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic7' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name17' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic8' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name18' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic9' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name19' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'H' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic10' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name20' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name21' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name22' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name23' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic4' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name24' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'I' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'J' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic5' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name25' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name26' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic7' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name27' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'K' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic8' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name28' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic9' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name29' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic10' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name30' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'L' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name31' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name32' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name33' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'M' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic4' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name34' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic5' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name35' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'N' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name36' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic7' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name37' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic8' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name38' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'O' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'P' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic9' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name39' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Q' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic10' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name40' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name41' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name42' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'R' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name43' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic4' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name44' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'S' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic5' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name45' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name46' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic7' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name47' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic8' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name48' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'T' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic9' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name49' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic10' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name50' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name51' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'U' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name52' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'V' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name53' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'W' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic4' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name54' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic5' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name55' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name56' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic7' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name57' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'X' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic8' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name58' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic9' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name59' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic10' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name60' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name61' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Y' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name62' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name63' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic4' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name64' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic5' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name65' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactGroup AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Z' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic6' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name66' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic7' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name67' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic8' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name68' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic9' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name69' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic10' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name70' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic1' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name71' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic2' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name72' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ContactInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'app.media.ic_comm_pic3' AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.name73' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right /** * AlphabetIndexer alphabetical index bar data. */ AST#property_declaration#Left static readonly TAB_VALUE : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left '#' AST#expression#Right , AST#expression#Left 'A' AST#expression#Right , AST#expression#Left 'B' AST#expression#Right , AST#expression#Left 'C' AST#expression#Right , AST#expression#Left 'D' AST#expression#Right , AST#expression#Left 'E' AST#expression#Right , AST#expression#Left 'F' AST#expression#Right , AST#expression#Left 'G' AST#expression#Right , AST#expression#Left 'H' AST#expression#Right , AST#expression#Left 'I' AST#expression#Right , AST#expression#Left 'J' AST#expression#Right , AST#expression#Left 'K' AST#expression#Right , AST#expression#Left 'L' AST#expression#Right , AST#expression#Left 'M' AST#expression#Right , AST#expression#Left 'N' AST#expression#Right , AST#expression#Left 'O' AST#expression#Right , AST#expression#Left 'P' AST#expression#Right , AST#expression#Left 'Q' AST#expression#Right , AST#expression#Left 'R' AST#expression#Right , AST#expression#Left 'S' AST#expression#Right , AST#expression#Left 'T' AST#expression#Right , AST#expression#Left 'U' AST#expression#Right , AST#expression#Left 'V' AST#expression#Right , AST#expression#Left 'W' AST#expression#Right , AST#expression#Left 'X' AST#expression#Right , AST#expression#Left 'Y' AST#expression#Right , AST#expression#Left 'Z' AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right /** * Current location information list. */ AST#property_declaration#Left static readonly CURRENT_LOCAL_INFO : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ResourceStr [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 1 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 2 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 3 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 4 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 5 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 6 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 7 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 8 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 9 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.default_location' AST#expression#Right , AST#expression#Left 10 AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class CommonConstants { static readonly HARMONY_HEI_TI_FONT_FAMILY = 'HarmonyHeiTi'; static readonly HARMONY_HEI_TI_MEDIUM_FONT_FAMILY = 'HarmonyHeiTi-Medium'; static readonly HARMONY_HEI_TI_BOLD_FONT_FAMILY = 'HarmonyHeiTi-Bold'; static readonly StatusBarContentWhiteColor: string = '#ffffff'; static readonly StatusBarContentBlackColor: string = '#000000'; static readonly LIST_HEADER_HEIGHT: number = 60; static readonly PAGE_HEADER_HEIGHT: number = 62; static readonly FIRST_LEVEL_OPACITY: number = 0.9; static readonly SECOND_LEVEL_OPACITY: number = 0.6; static readonly HALF_OPACITY: number = 0.5; static readonly NAVIGATION_BAR_OPACITY_MAX: number = 1; static readonly FULL_PERCENT: string = '100%'; static readonly BANNER_HEIGHT_PERCENT: string = '35%'; static readonly Z_INDEX_ONE: number = 1; static readonly Z_INDEX_TWO: number = 2; static readonly Z_INDEX_THREE: number = 3; static readonly ASPECT_RATIO_ONE: number = 1; static readonly ASPECT_RATIO_SECOND: number = 1.6; static readonly ANIMATION_DURATION: number = 150; static readonly ANIMATION_DURATION1: number = 200; static readonly ANIMATION_DURATION2: number = 300; static readonly MAIN_SCROLLER_OFFSET_X: number = 0; static readonly MAIN_SCROLLER_OFFSET_Y: number = 0; static readonly MAIN_SCROLLER_OFFSET_Y_ZERO: number = 0; static readonly MAIN_SCROLLER_OFFSET_Y_MAX: number = 54; static readonly MAIN_SCROLLER_OFFSET_STATUS_CHANGE: number = 24; static readonly FAVOR_POSITION_X: number = 0; static readonly HIGHLIGHT_POSITION_X: number = 0; static readonly HIGHLIGHT_POSITION_X2: number = 40; static readonly COLLECTED_POSITION_X: number = 0; static readonly COLLECTED_POSITION_X2: number = 80; static readonly SEARCH_POSITION_RIGHT: number = 0; static readonly LAYOUT_WEIGHT: number = 1; static readonly SEARCH_BORDER_RADIUS1: number = 5; static readonly SEARCH_BORDER_RADIUS2: number = 17; static readonly SHARE_BORDER_RADIUS: number = 15; static readonly SCAN_BORDER_RADIUS: number = 15; static readonly SETTING_BORDER_RADIUS: number = 15; static readonly TYPE_BORDER_RADIUS: number = 4; static readonly ITEM_BORDER_RADIUS: number = 8; static readonly ITEM_IMAGE_BORDER_RADIUS: number = 8; static readonly TOOL_VIEW_SPACE: number = 10; static readonly ARTICLES_LIST_SPACE: number = 10; static readonly ARTICLES_LABEL_SPACE: number = 12; static readonly NAVIGATION_BAR_HEIGHT: number = 44; static readonly STATUS_BAR_HEIGHT: number = 54; static readonly LIST_LINEAR_GRADIENT_START: number = 0.0; static readonly LIST_LINEAR_GRADIENT_END: number = 0.1; static readonly LIST_LINEAR_GRADIENT_START_COLOR: string = '#FF0091FF'; static readonly LIST_LINEAR_GRADIENT_END_COLOR: string = '#FFF1F3F5'; static readonly ITEM_LINEAR_GRADIENT_ANGLE: string = '90'; static readonly ITEM_LINEAR_GRADIENT_START: number = 0; static readonly ITEM_LINEAR_GRADIENT_END: number = 1; static readonly ITEM_LINEAR_GRADIENT_START_COLOR: string = '#FFDCEAF9'; static readonly ITEM_LINEAR_GRADIENT_END_COLOR: string = '#FFF1F3F5'; static readonly MAX_LINES_ONE: number = 1; static readonly MAX_LINES_TWO: number = 2; static readonly CACHE_COUNT: number = 2; static readonly REQUEST_PERMISSIONS: Array<Permissions> = [ 'ohos.permission.APPROXIMATELY_LOCATION', 'ohos.permission.LOCATION' ]; static readonly CONTACTS_PAGE_WIDTH_LG: string = '60%'; static readonly TITLE_ID: string = 'titleId'; static readonly TEXT_ID: string = 'textId'; static readonly LIST_COMM_SPACE: number = 8; static readonly MAX_ADD_PIC: number = 9; static readonly LOCAL_INFO_LIST_WIDTH: string = '95%'; static readonly ROUTE_BACK_HOME_URL: string = 'pages/Home'; static readonly ROUTE_CONTACT_PAGE_URL: string = 'pages/ContactsPage'; static readonly TOPIC_SYMBOL: string = '#'; static readonly TIPS_CONTACT_SYMBOL: string = '@'; static readonly DEFAULT_LAYOUT_WEIGHT: number = 1; static readonly INDEX_START_POSITION: number = 0; static readonly ALPHABET_INDEXER_ITEM_SIZE: number = 20; static readonly END_SM_LOCAL_INFO: number = 20; static readonly END_MD_LOCAL_INFO: number = 40; static readonly START_MD_LOCAL_INFO: number = 0; static readonly OMITTED_CHARACTER: string = '...'; static readonly TOPIC_INFO_LIST: TopicInfoList[] = [ new TopicInfoList( [ new TopicInfo('1', $r('app.string.crowd_theme_contest'), '3520.8'), new TopicInfo('2', $r('app.string.crowd_theme_contest'), '3190.8'), new TopicInfo('3', $r('app.string.crowd_theme_contest'), '3130.8'), new TopicInfo('4', $r('app.string.crowd_theme_contest'), '3020.8'), new TopicInfo('5', $r('app.string.crowd_theme_contest'), '2820.8'), new TopicInfo('6', $r('app.string.crowd_theme_contest'), '1520.8') ], $r('app.string.topic1'), '1'), new TopicInfoList( [ new TopicInfo('1', $r('app.string.crowd_theme_contest'), '3520.8'), new TopicInfo('2', $r('app.string.crowd_theme_contest'), '3190.8'), new TopicInfo('3', $r('app.string.crowd_theme_contest'), '3130.8') ], $r('app.string.topic2'), '2'), new TopicInfoList( [ new TopicInfo('1', $r('app.string.crowd_theme_contest'), '3520.8'), new TopicInfo('2', $r('app.string.crowd_theme_contest'), '3190.8'), new TopicInfo('3', $r('app.string.crowd_theme_contest'), '3130.8'), new TopicInfo('4', $r('app.string.crowd_theme_contest'), '3020.8'), new TopicInfo('5', $r('app.string.crowd_theme_contest'), '2820.8'), new TopicInfo('6', $r('app.string.crowd_theme_contest'), '2520.8'), new TopicInfo('7', $r('app.string.crowd_theme_contest'), '1828.8'), new TopicInfo('8', $r('app.string.crowd_theme_contest'), '1620.8') ], $r('app.string.topic3'), '3') ]; static readonly TITLE_INFO_DATA: TitleInfoList[] = [ new TitleInfoList($r('app.string.single_heading'), [ new TitleInfo('📒', $r('app.string.waiting_diary')), new TitleInfo('📉', $r('app.string.energy_sharing')), new TitleInfo('💔', $r('app.string.fond_teasing')), new TitleInfo('💰', $r('app.string.sunning_price')), new TitleInfo('💘', $r('app.string.utility_goods')), new TitleInfo('📷', $r('app.string.beautiful_life')), new TitleInfo('🌹', $r('app.string.love_share')) ]), new TitleInfoList($r('app.string.combined_head'), [ new TitleInfo('🚗', $r('app.string.retrofit_operation')), new TitleInfo('📓', $r('app.string.everyone_reviews')) ]), new TitleInfoList($r('app.string.composite_head'), [ new TitleInfo('📒', $r('app.string.waiting_diary')), new TitleInfo('📉', $r('app.string.energy_sharing')), new TitleInfo('💔', $r('app.string.fond_teasing')), new TitleInfo('💰', $r('app.string.sunning_price')), new TitleInfo('💘', $r('app.string.utility_goods')), new TitleInfo('📷', $r('app.string.beautiful_life')), new TitleInfo('🚗', $r('app.string.retrofit_operation')), new TitleInfo('📓', $r('app.string.everyone_reviews')) ]) ]; static readonly CONTACT_DATA: ContactGroup[] = [ new ContactGroup($r('app.string.recent_contact'), [ new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name1')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name3')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name30')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name26')) ]), new ContactGroup('A', [ new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name1')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name2')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name3')) ]), new ContactGroup('B', [ new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name4')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name5')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name6')) ]), new ContactGroup('C', [ new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name7')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name8')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name9')) ]), new ContactGroup('D', [ new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name10')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name11')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name12')) ]), new ContactGroup('E', []), new ContactGroup('F', [ new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name13')), new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name14')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name15')) ]), new ContactGroup('G', [ new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name16')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name17')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name18')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name19')) ]), new ContactGroup('H', [ new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name20')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name21')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name22')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name23')), new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name24')) ]), new ContactGroup('I', []), new ContactGroup('J', [ new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name25')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name26')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name27')) ]), new ContactGroup('K', [ new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name28')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name29')), new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name30')) ]), new ContactGroup('L', [ new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name31')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name32')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name33')) ]), new ContactGroup('M', [ new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name34')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name35')) ]), new ContactGroup('N', [ new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name36')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name37')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name38')), ]), new ContactGroup('O', []), new ContactGroup('P', [ new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name39')), ]), new ContactGroup('Q', [ new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name40')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name41')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name42')), ]), new ContactGroup('R', [ new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name43')), new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name44')), ]), new ContactGroup('S', [ new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name45')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name46')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name47')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name48')), ]), new ContactGroup('T', [ new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name49')), new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name50')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name51')), ]), new ContactGroup('U', [ new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name52'))]), new ContactGroup('V', [ new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name53'))]), new ContactGroup('W', [ new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name54')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name55')), new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name56')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name57')) ]), new ContactGroup('X', [ new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name58')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name59')), new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name60')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name61')) ]), new ContactGroup('Y', [ new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name62')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name63')), new ContactInfo('app.media.ic_comm_pic4', $r('app.string.name64')), new ContactInfo('app.media.ic_comm_pic5', $r('app.string.name65')) ]), new ContactGroup('Z', [ new ContactInfo('app.media.ic_comm_pic6', $r('app.string.name66')), new ContactInfo('app.media.ic_comm_pic7', $r('app.string.name67')), new ContactInfo('app.media.ic_comm_pic8', $r('app.string.name68')), new ContactInfo('app.media.ic_comm_pic9', $r('app.string.name69')), new ContactInfo('app.media.ic_comm_pic10', $r('app.string.name70')), new ContactInfo('app.media.ic_comm_pic1', $r('app.string.name71')), new ContactInfo('app.media.ic_comm_pic2', $r('app.string.name72')), new ContactInfo('app.media.ic_comm_pic3', $r('app.string.name73')) ]) ]; static readonly TAB_VALUE: string[] = [ '#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ]; static readonly CURRENT_LOCAL_INFO: ResourceStr[] = [ $r('app.string.default_location', 1), $r('app.string.default_location', 2), $r('app.string.default_location', 3), $r('app.string.default_location', 4), $r('app.string.default_location', 5), $r('app.string.default_location', 6), $r('app.string.default_location', 7), $r('app.string.default_location', 8), $r('app.string.default_location', 9), $r('app.string.default_location', 10) ]; }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/constants/CommonConstants.ets#L9-L400
545d865244068b4581ef289630eaa8b3fc61e82b
gitee
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/common/database/Rdb/TableHelper.ets
arkts
createTableSql
生成创建数据表的SQL语句
createTableSql(tableName: string, columns: Array<ColumnInfo>): string { let sql = `create table if not exists ${tableName}(`; for (let column of columns) { sql = sql.concat(`${column.name} ${column.type}`); sql = sql.concat(`${column.length && column.length > 0 ? `(${column.length})` : ''}`); sql = sql.concat(`${column.primary ? ' primary key' : ''}`); sql = sql.concat(`${column.autoincrement ? ' autoincrement' : ''}`); sql = sql.concat(`${column.nullable ? '' : ' not null'}`); sql = sql.concat(', '); } sql = `${sql.substring(0, sql.length - 2)})`; return sql; }
AST#method_declaration#Left createTableSql AST#parameter_list#Left ( AST#parameter#Left tableName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left columns : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ColumnInfo AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sql = AST#expression#Left AST#template_literal#Left ` create table if not exists AST#template_substitution#Left $ { AST#expression#Left tableName AST#expression#Right } AST#template_substitution#Right ( ` AST#template_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( let column of AST#expression#Left columns AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sql = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left sql AST#expression#Right . concat AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left column AST#expression#Right . name AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left column AST#expression#Right . type AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sql = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left sql AST#expression#Right . concat AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left column AST#expression#Right . length AST#member_expression#Right AST#expression#Right && AST#expression#Left column AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#template_literal#Left ` ( AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left column AST#expression#Right . length AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ) ` AST#template_literal#Right AST#expression#Right : AST#expression#Left '' AST#expression#Right AST#conditional_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sql = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left sql AST#expression#Right . concat AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left column AST#expression#Right . primary AST#member_expression#Right AST#expression#Right ? AST#expression#Left ' primary key' AST#expression#Right : AST#expression#Left '' AST#expression#Right AST#conditional_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sql = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left sql AST#expression#Right . concat AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left column AST#expression#Right . autoincrement AST#member_expression#Right AST#expression#Right ? AST#expression#Left ' autoincrement' AST#expression#Right : AST#expression#Left '' AST#expression#Right AST#conditional_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sql = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left sql AST#expression#Right . concat AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left column AST#expression#Right . nullable AST#member_expression#Right AST#expression#Right ? AST#expression#Left '' AST#expression#Right : AST#expression#Left ' not null' AST#expression#Right AST#conditional_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sql = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left sql AST#expression#Right . concat AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left ', ' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sql = AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left sql AST#expression#Right . substring AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0 AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left sql AST#expression#Right . length AST#member_expression#Right AST#expression#Right - AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right ) ` AST#template_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left sql AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
createTableSql(tableName: string, columns: Array<ColumnInfo>): string { let sql = `create table if not exists ${tableName}(`; for (let column of columns) { sql = sql.concat(`${column.name} ${column.type}`); sql = sql.concat(`${column.length && column.length > 0 ? `(${column.length})` : ''}`); sql = sql.concat(`${column.primary ? ' primary key' : ''}`); sql = sql.concat(`${column.autoincrement ? ' autoincrement' : ''}`); sql = sql.concat(`${column.nullable ? '' : ' not null'}`); sql = sql.concat(', '); } sql = `${sql.substring(0, sql.length - 2)})`; return sql; }
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Rdb/TableHelper.ets#L7-L19
a8717578c51b36ff89f01089df3aaa1d73f61121
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets
arkts
CustomCalendarSamplePage
功能描述:本示例介绍如何使用自定义日历组件CustomCalendar实现日历年视图,月视图,周视图以及视图切换功能。还有如何使用Calendar Kit日历服务实现日程提醒的功能。 推荐场景:需要使用左右滑动切换年视图,月视图,周视图以及需要添加日程提醒的应用场景 核心组件: 1.CustomCalendar 2.SchedulePoint 实现步骤: 日历切换场景: 1.使用Tabs进行年、月、周视图页面布局。 2.调用自定义日历组件CustomCalendar组件分别在TabContent中显示对应年、月、周视图。 3.点击自定义分段按钮customSegmentButton进行年、月、周视图间切换。使用视图控制器的swiperRefresh方法刷新对应视图数据。 日程提醒场景: 1.通过getCalendarManager获取管理日历对象,使用getCalendar获取日历对象,然后使用createCalendar创建自己的日历账户,通过配置 CalendarConfig中enableReminder为true启用日程提醒功能。 2.配置日程参数calendarManager.Event,然后传入addEvent创建日程,Calendar Kit日历服务会根据创建的日程进行相应的日程提醒。同时使用持久 化preferences存储添加的日程信息,用于月视图和周视图中显示相应的日程点。
@Component export struct CustomCalendarSamplePage { // 屏幕宽度 @State screenWidth: number = 0; // 当前显示的年份 @State currentShowYear: number = TODAY_YEAR; // 当前显示的月份 @State currentShowMonth: number = TODAY_MONTH; // 当前月视图或周视图中选中的日期 @State currentSelectDay: DayInfo = new DayInfo(new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate(), 0); // 是否隐藏年、月、周视图中年月信息标题 @State isYearMonthHidden: boolean = true; // 当前选中的自定义分段按钮。0年视图,1月视图,2周视图 @State currentIndex: number = 1; // 自定义分段按钮左侧边距 @State indicatorLeftMargin: number = 0; // 自定义分段按钮白色滑块宽度 @State indicatorWidth: number = 0; // 记录自定义分段按钮切换的index。如果切换到年视图,隐藏年月信息标题中月份 @State tabSelectedIndex: number = 1; // 自定义分段按钮滑动动画时长 private animationDuration: number = 300; // Tabs控制器 private tabController: TabsController = new TabsController(); // 自定义日历年视图控制器 private calendarYearController = new CalendarController(); // 自定义日历月视图控制器 private calendarMonthController = new CalendarController(); // 自定义日历周视图控制器 private calendarWeekController = new CalendarController(); // 检查设备是否可折叠 private isFoldable: boolean = false; // 折叠设备屏幕显示模式回调 private callback: Callback<display.FoldDisplayMode> = (mode: display.FoldDisplayMode) => { // 可折叠设备的显示模式改变时(如展开或者折叠),重新获取屏幕宽度 this.screenWidth = this.getCurrentScreenWidth(); // 重新计算indicatorLeftMargin if (this.currentIndex === CalendarViewType.YEAR) { this.indicatorLeftMargin = (this.screenWidth - PADDING * 2) / 6 * 1 - COLUMN_WIDTH / 2; } else if (this.currentIndex === CalendarViewType.MONTH) { this.indicatorLeftMargin = (this.screenWidth - PADDING * 2) / 2 - COLUMN_WIDTH / 2; } else if (this.currentIndex === CalendarViewType.WEEK) { this.indicatorLeftMargin = (this.screenWidth - PADDING * 2) / 6 * 5 - COLUMN_WIDTH / 2; } if (mode === display.FoldDisplayMode.FOLD_DISPLAY_MODE_FULL) { // 折叠屏展开态显示 CommonData.DEVICE_TYPE = DeviceType.EXPAND_FOLD; } else if (mode === display.FoldDisplayMode.FOLD_DISPLAY_MODE_MAIN) { // 折叠屏折叠态显示 CommonData.DEVICE_TYPE = DeviceType.PHONE; } }; // 依据cases工程Navigation的mode属性说明,如使用Auto,窗口宽度>=600vp时,采用Split模式显示;窗口宽度<600vp时,采用Stack模式显示。 private readonly DEVICESIZE: number = 600; // 不传isPlugin,默认为true。作为插件使用。设置false,适配cases。 isPlugin: boolean = true; /** * 获取当前屏幕宽度 */ getCurrentScreenWidth(): number { let screenWidth: number = px2vp(display.getDefaultDisplaySync().width); // 适配cases中Navigation在不同mode时,计算相对需要使用的屏幕宽度。当屏幕宽度大于600vp时,cases工程Navigation的mode采用Split模式显 // 示,需要重新计算实际页面所需的屏幕宽度。 if (!this.isPlugin && screenWidth >= this.DEVICESIZE) { return screenWidth / 2; } else { return screenWidth; } } aboutToAppear() { // 检查设备是否可折叠。false表示不可折叠,true表示可折叠。 this.isFoldable = display.isFoldable(); CommonData.IS_FOLD = this.isFoldable; if (this.isFoldable) { // 如果是可折叠设备,注册折叠设备屏幕显示模式变化监听 display.on('foldDisplayModeChange', this.callback); if (display.getFoldDisplayMode() === display.FoldDisplayMode.FOLD_DISPLAY_MODE_FULL) { // 设置折叠屏展开态 CommonData.DEVICE_TYPE = DeviceType.EXPAND_FOLD; } } // 获取屏幕宽度 this.screenWidth = this.getCurrentScreenWidth(); // 初始化自定义分段按钮白色滑块的位置,本案例默认首次加载显示月视图。由于onAreaChange获取indicatorLeftMargin有延迟,首次加载会出现白色 // 滑块跳变,所以这里计算indicatorLeftMargin的初始位置。 this.indicatorLeftMargin = (this.screenWidth - COLUMN_WIDTH) / 2 - PADDING; // 判断是否是rk3568。用屏幕宽度480vp来判断 if (px2vp(display.getDefaultDisplaySync().width) === 480) { CommonData.DEVICE_TYPE = DeviceType.RK; } } aboutToDisappear() { if (this.isFoldable) { // 关闭显示设备变化的监听 display.off('foldDisplayModeChange', this.callback); } } /** * 年月信息标题。月视图和周视图显示年月信息,年视图只显示年信息。周视图中如果选中了日期,则优先根据选中日期显示年月信息。 */ @Builder yearMonthTitle() { Row() { Text(`${this.currentShowYear}年 ${this.tabSelectedIndex === CalendarViewType.YEAR ? '' : MONTHS[this.currentShowMonth-1]}`) .fontSize(FONT_SIZE * TEXT_SCALING) .fontWeight(FONT_WEIGHT_FIVE_HUNDRED) // 自定义添加日程组件 // monthViewController: 可选项。传入该控制器,添加日程后,对应日程点会刷新到月视图上 // weekViewController: 可选项。传入该控制器,添加日程后,对应日程点会刷新到周视图上 SchedulePoint({ monthViewController: this.calendarMonthController, weekViewController: this.calendarWeekController }) } .padding({ left: $r('app.integer.calendar_switch_size_ten'), right: $r('app.integer.calendar_switch_size_ten') }) .justifyContent(FlexAlign.SpaceBetween) .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty')) } /** * 自定义分段按钮 */ @Builder customSegmentButton() { Stack({ alignContent: Alignment.TopStart }) { Row() { } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .backgroundColor($r('app.color.calendar_switch_segment_button_row_bgcolor')) .borderRadius($r('app.integer.calendar_switch_border_radius')) .layoutWeight(LAYOUT_WEIGHT_THREE) Column() { Row() { } .borderRadius($r('app.integer.calendar_switch_border_radius')) .height($r('app.string.calendar_switch_full_size')) .width((this.screenWidth - PADDING * 2) / 3 - GAP_SPACE) .backgroundColor(Color.White) } .height($r('app.integer.calendar_switch_size_thirty_five')) .width(COLUMN_WIDTH) .margin({ left: this.indicatorLeftMargin }) .padding({ top: $r('app.integer.calendar_switch_size_three'), bottom: $r('app.integer.calendar_switch_size_three') }) Row() { this.customSegmentButtonItem(CalendarViewType.YEAR, '年') this.customSegmentButtonItem(CalendarViewType.MONTH, '月') this.customSegmentButtonItem(CalendarViewType.WEEK, '周') } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .borderRadius($r('app.integer.calendar_switch_border_radius')) .backgroundColor(Color.Transparent) .layoutWeight(LAYOUT_WEIGHT_THREE) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .margin({ top: $r('app.integer.calendar_switch_size_ten'), bottom: $r('app.integer.calendar_switch_margin_size_twelve') }) } /** * 自定义分段按钮项 * @param index 自定义分段按钮索引。这里对应自定义日历视图类型。0:年视图YEAR,1:月视图MONTH,2:周视图WEEK * @param name 自定义分段按钮名。这里对应'年','月','周' */ @Builder customSegmentButtonItem(index: number, name: string) { Column() { Text(name) .width(CUSTOM_SEGMENT_BUTTON_MONTH_WIDTH) .textAlign(TextAlign.Center) .height($r('app.integer.calendar_switch_size_thirty_five')) .fontSize($r('app.integer.calendar_switch_size_fourteen')) .fontColor(this.currentIndex === index ? Color.Black : $r('app.color.calendar_switch_segment_button_font_color')) .fontWeight(this.currentIndex === index ? FONT_WEIGHT_FIVE_HUNDRED : FONT_WEIGHT_FOUR_HUNDRED) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .layoutWeight(LAYOUT_WEIGHT_ONE) .onClick(() => { if (index === this.tabSelectedIndex) { // 点击同一个自定义分段按钮项,不做切换,避免冗余操作 return; } this.tabSelectedIndex = index; this.tabController.changeIndex(index); this.currentShowYear = this.currentSelectDay.year; this.currentShowMonth = this.currentSelectDay.month; // TODO 知识点:点击自定义分段按钮customSegmentButton进行年、月、周视图间切换。使用视图控制器的swiperRefresh方法刷新对应视图数据。 if (this.tabSelectedIndex === CalendarViewType.MONTH) { // 刷新月视图 this.calendarMonthController.swiperRefresh(CalendarViewType.MONTH); } else if (this.tabSelectedIndex === CalendarViewType.WEEK) { // 刷新周视图 this.calendarWeekController.swiperRefresh(CalendarViewType.WEEK); } else if (this.tabSelectedIndex === CalendarViewType.YEAR) { // 刷新年视图 this.calendarYearController.swiperRefresh(CalendarViewType.YEAR); } }) } /** * 自定义分段按钮切换动画 * @param duration 动画时长 * @param leftMargin 自定义分段按钮左侧边距 */ startAnimateTo(duration: number, leftMargin: number) { animateTo({ duration: duration, // 动画时长 curve: Curve.Linear, // 动画曲线 iterations: 1, // 播放次数 playMode: PlayMode.Normal, // 动画模式 }, () => { this.indicatorLeftMargin = leftMargin; }) } build() { Column() { // 年月信息标题(包含添加日程组件) this.yearMonthTitle() // 自定义分段按钮 this.customSegmentButton() Tabs({ barPosition: BarPosition.End, index: CalendarViewType.MONTH, controller: this.tabController }) { TabContent() { Column() { // 自定义年视图 // calendarViewType: 必选项。自定义日历类型。YEAR年视图 MONTH月视图 WEEK周视图 // onMonthClick: 可选项。年视图月份点击回调。返回年视图点击的年月信息。仅用于年视图。 // onChangeYearMonth: 可选项。年、月、周视图左右滑动切换回调。返回左右切换年、月、周后的年月信息,其中年视图切换实际只返回切换后年份信息。 // calendarSwitch: 可选项。年、月、周视图切换场景的相关设置。 // - controller: 可选项。自定义日历控制器,用于视图切换后的数据刷新。 // - currentSelectDay: 可选项。记录月、周视图中点击选中的日期信息。 // - isYearMonthHidden:可选项。是否隐藏自定义日历年、月、周视图中自带的年月信息标题。 CustomCalendar({ calendarViewType: CalendarViewType.YEAR, onMonthClick: (year: number, month: number) => { if (this.tabController) { // 切到月视图 this.tabController.changeIndex(1); // 刷新年月信息标题 this.currentShowYear = year; this.currentShowMonth = month; // 刷新在年视图上点击月后要跳转的月视图数据 this.calendarMonthController.swiperYearToMonthRefresh(year, month); } }, onChangeYearMonth: (year: number, month: number) => { this.currentShowYear = year; }, calendarSwitch: { controller: this.calendarYearController, currentSelectDay: this.currentSelectDay, isYearMonthHidden: this.isYearMonthHidden } }) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.string.calendar_switch_full_size')) } TabContent() { Column() { // 自定义月视图 // calendarViewType: 必选项。自定义日历类型。YEAR年视图 MONTH月视图 WEEK周视图 // calendarStyle: 可选项。自定义日历样式。仅用于月、周视图。 // - textScaling: 可选项。月视图和周视图中的公历、农历、星期、年月信息标题文字缩放比例。 // - backgroundColor: 可选项。今天选中日期的背景色。 // - monthDayColor: 可选项。本月公历日期颜色。 // - noMonthDayColor: 可选项。非本月公历日期颜色,仅对月视图有效。 // - lunarColor: 可选项。本月农历字体颜色。 // onDateClick: 可选项。日期点击回调。返回点击日期的年月日信息。仅用于月、周视图。 // onChangeYearMonth: 可选项。年、月、周视图左右滑动切换回调,返回左右切换视图后的年月信息,其中年视图切换实际只返回切换后年份信息。 // calendarSwitch: 可选项。用于年、月、周视图切换场景的相关设置。 // - controller: 可选项。自定义日历控制器,用于视图切换后的数据刷新。 // - currentSelectDay: 可选项。记录月、周视图中点击选中的日期信息。 // - isYearMonthHidden:可选项。是否隐藏自定义日历年、月、周视图中自带的年月信息标题。 CustomCalendar({ calendarViewType: CalendarViewType.MONTH, calendarStyle: { textScaling: TEXT_SCALING, backgroundColor: Color.Red, monthDayColor: Color.Black, noMonthDayColor: Color.Gray, lunarColor: Color.Gray }, onDateClick: (year: number, month: number, date: number) => { this.currentSelectDay.year = year; this.currentSelectDay.month = month; this.currentSelectDay.date = date; }, onChangeYearMonth: (year: number, month: number) => { this.currentShowYear = year; this.currentShowMonth = month; }, calendarSwitch: { controller: this.calendarMonthController, currentSelectDay: this.currentSelectDay, isYearMonthHidden: this.isYearMonthHidden, } }) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.string.calendar_switch_full_size')) } TabContent() { Column() { // 自定义周视图 // calendarViewType: 必选项。自定义日历类型。YEAR年视图 MONTH月视图 WEEK周视图 // calendarStyle: 可选项。自定义日历样式。仅用于月、周视图。 // - textScaling: 可选项。月视图和周视图中的公历、农历、星期、年月信息标题文字缩放比例。 // - backgroundColor: 可选项。今天选中日期的背景色。 // - monthDayColor: 可选项。本月公历日期颜色。 // - noMonthDayColor: 可选项。非本月公历日期颜色,仅对月视图有效。 // - lunarColor: 可选项。本月农历字体颜色。 // onDateClick: 可选项。日期点击回调。返回点击日期的年月日信息。仅用于月、周视图。 // onChangeYearMonth: 可选项。年、月、周视图左右滑动切换回调,返回左右切换视图后的年月信息,其中年视图切换实际只返回切换后年份信息。 // calendarSwitch: 可选项。用于年、月、周视图切换场景的相关设置。 // - controller: 可选项。自定义日历控制器,用于视图切换后的数据刷新。 // - currentSelectDay: 可选项。记录月、周视图中点击选中的日期信息。 // - isYearMonthHidden:可选项。是否隐藏自定义日历年、月、周视图中自带的年月信息标题。 CustomCalendar({ calendarViewType: CalendarViewType.WEEK, calendarStyle: { textScaling: TEXT_SCALING, backgroundColor: Color.Red, monthDayColor: Color.Black, lunarColor: Color.Gray }, onDateClick: (year: number, month: number, date: number) => { this.currentSelectDay.year = year; this.currentSelectDay.month = month; this.currentSelectDay.date = date; }, onChangeYearMonth: (year: number, month: number) => { this.currentShowYear = year; this.currentShowMonth = month; }, calendarSwitch: { controller: this.calendarWeekController, currentSelectDay: this.currentSelectDay, isYearMonthHidden: this.isYearMonthHidden } }) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.string.calendar_switch_full_size')) } } .animationDuration(this.animationDuration) .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { // 在年视图中点击月,切换到月视图时,需要显示'年月信息标题'中的的月份信息 if (index === CalendarViewType.YEAR && targetIndex === CalendarViewType.MONTH) { this.tabSelectedIndex = CalendarViewType.MONTH; } // 切换动画开始时触发该回调。白色滑块跟着页面一起滑动。 this.currentIndex = targetIndex; if (targetIndex === CalendarViewType.YEAR) { // 传入自定义分段按钮左侧边距 点击“年”的分段按钮时,分段按钮白色滑块移动到屏幕1/6位置 this.startAnimateTo(this.animationDuration, (this.screenWidth - PADDING * 2) / 6 * 1 - COLUMN_WIDTH / 2); } else if (targetIndex === CalendarViewType.MONTH) { // 传入自定义分段按钮左侧边距 点击“月”的分段按钮时,分段按钮白色滑块移动到屏幕3/6位置 this.startAnimateTo(this.animationDuration, (this.screenWidth - PADDING * 2) / 2 - COLUMN_WIDTH / 2); } else if (targetIndex === CalendarViewType.WEEK) { // 传入自定义分段按钮左侧边距 点击“周”的分段按钮时,分段按钮白色滑块移动到屏幕5/6位置 this.startAnimateTo(this.animationDuration, (this.screenWidth - PADDING * 2) / 6 * 5 - COLUMN_WIDTH / 2); } }) .onAppear(() => { // TODO: 高性能知识点: 组件挂载显示后触发此回调,预加载年视图数据,避免首次切换到年视图时出现卡顿问题 // 针对月视图切换周视图场景,需要预加载周视图(索引2),不然在月视图切换月份,选择日期后,再切换到周视图,周视图不会刷新 this.tabController.preloadItems([0, 2]); // 索引0对应年视图,索引2对应周视图 }) .layoutWeight(LAYOUT_WEIGHT_ONE) .scrollable(false) .barHeight($r('app.integer.calendar_switch_zero')) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.string.calendar_switch_full_size')) .padding(PADDING) } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CustomCalendarSamplePage AST#component_body#Left { // 屏幕宽度 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right screenWidth : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right // 当前显示的年份 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right currentShowYear : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left TODAY_YEAR AST#expression#Right ; AST#property_declaration#Right // 当前显示的月份 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right currentShowMonth : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left TODAY_MONTH AST#expression#Right ; AST#property_declaration#Right // 当前月视图或周视图中选中的日期 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right currentSelectDay : AST#type_annotation#Left AST#primary_type#Left DayInfo AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left DayInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Date AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . getFullYear AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Date AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . getMonth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right + AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Date AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . getDate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left 0 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right // 是否隐藏年、月、周视图中年月信息标题 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right isYearMonthHidden : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ; AST#property_declaration#Right // 当前选中的自定义分段按钮。0年视图,1月视图,2周视图 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right currentIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right // 自定义分段按钮左侧边距 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right indicatorLeftMargin : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right // 自定义分段按钮白色滑块宽度 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right indicatorWidth : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right // 记录自定义分段按钮切换的index。如果切换到年视图,隐藏年月信息标题中月份 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right tabSelectedIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#expression#Right ; AST#property_declaration#Right // 自定义分段按钮滑动动画时长 AST#property_declaration#Left private animationDuration : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 300 AST#expression#Right ; AST#property_declaration#Right // Tabs控制器 AST#property_declaration#Left private tabController : AST#type_annotation#Left AST#primary_type#Left TabsController AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TabsController AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right // 自定义日历年视图控制器 AST#property_declaration#Left private calendarYearController = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left CalendarController AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right // 自定义日历月视图控制器 AST#property_declaration#Left private calendarMonthController = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left CalendarController AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right // 自定义日历周视图控制器 AST#property_declaration#Left private calendarWeekController = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left CalendarController AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right // 检查设备是否可折叠 AST#property_declaration#Left private isFoldable : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#property_declaration#Right // 折叠设备屏幕显示模式回调 AST#property_declaration#Left private callback : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Callback AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left display . FoldDisplayMode AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left mode : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left display . FoldDisplayMode AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { // 可折叠设备的显示模式改变时(如展开或者折叠),重新获取屏幕宽度 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getCurrentScreenWidth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 重新计算indicatorLeftMargin AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . indicatorLeftMargin AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left PADDING AST#expression#Right * AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left 6 AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left COLUMN_WIDTH AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . indicatorLeftMargin AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left PADDING AST#expression#Right * AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left COLUMN_WIDTH AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . WEEK AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . indicatorLeftMargin AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left PADDING AST#expression#Right * AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left 6 AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left 5 AST#expression#Right AST#binary_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left COLUMN_WIDTH AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left mode AST#expression#Right === AST#expression#Left display AST#expression#Right AST#binary_expression#Right AST#expression#Right . FoldDisplayMode AST#member_expression#Right AST#expression#Right . FOLD_DISPLAY_MODE_FULL AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 折叠屏展开态显示 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left CommonData AST#expression#Right . DEVICE_TYPE AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left DeviceType AST#expression#Right . EXPAND_FOLD AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left mode AST#expression#Right === AST#expression#Left display AST#expression#Right AST#binary_expression#Right AST#expression#Right . FoldDisplayMode AST#member_expression#Right AST#expression#Right . FOLD_DISPLAY_MODE_MAIN AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 折叠屏折叠态显示 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left CommonData AST#expression#Right . DEVICE_TYPE AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left DeviceType AST#expression#Right . PHONE AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ; AST#property_declaration#Right // 依据cases工程Navigation的mode属性说明,如使用Auto,窗口宽度>=600vp时,采用Split模式显示;窗口宽度<600vp时,采用Stack模式显示。 AST#property_declaration#Left private readonly DEVICESIZE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 600 AST#expression#Right ; AST#property_declaration#Right // 不传isPlugin,默认为true。作为插件使用。设置false,适配cases。 AST#property_declaration#Left isPlugin : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ; AST#property_declaration#Right /** * 获取当前屏幕宽度 */ AST#method_declaration#Left getCurrentScreenWidth AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left screenWidth : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left px2vp AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left display AST#expression#Right . getDefaultDisplaySync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . width AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 适配cases中Navigation在不同mode时,计算相对需要使用的屏幕宽度。当屏幕宽度大于600vp时,cases工程Navigation的mode采用Split模式显 // 示,需要重新计算实际页面所需的屏幕宽度。 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right . isPlugin AST#member_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left screenWidth AST#expression#Right >= AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . DEVICESIZE AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Left AST#expression#Left screenWidth AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left screenWidth AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 检查设备是否可折叠。false表示不可折叠,true表示可折叠。 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isFoldable AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left display AST#expression#Right . isFoldable AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left CommonData AST#expression#Right . IS_FOLD AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isFoldable AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isFoldable AST#member_expression#Right AST#expression#Right ) { // 如果是可折叠设备,注册折叠设备屏幕显示模式变化监听 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left display AST#expression#Right . on AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'foldDisplayModeChange' AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . callback AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left display AST#expression#Right . getFoldDisplayMode AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right === AST#expression#Left display AST#expression#Right AST#binary_expression#Right AST#expression#Right . FoldDisplayMode AST#member_expression#Right AST#expression#Right . FOLD_DISPLAY_MODE_FULL AST#member_expression#Right AST#expression#Right ) { // 设置折叠屏展开态 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left CommonData AST#expression#Right . DEVICE_TYPE AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left DeviceType AST#expression#Right . EXPAND_FOLD AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right // 获取屏幕宽度 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getCurrentScreenWidth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right // 初始化自定义分段按钮白色滑块的位置,本案例默认首次加载显示月视图。由于onAreaChange获取indicatorLeftMargin有延迟,首次加载会出现白色 // 滑块跳变,所以这里计算indicatorLeftMargin的初始位置。 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . indicatorLeftMargin AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right AST#expression#Right - AST#expression#Left COLUMN_WIDTH AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right - AST#expression#Left PADDING AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right // 判断是否是rk3568。用屏幕宽度480vp来判断 AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left px2vp AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left display AST#expression#Right . getDefaultDisplaySync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . width AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right === AST#expression#Left 480 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left CommonData AST#expression#Right . DEVICE_TYPE AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left DeviceType AST#expression#Right . RK AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left aboutToDisappear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isFoldable AST#member_expression#Right AST#expression#Right ) { // 关闭显示设备变化的监听 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left display AST#expression#Right . off AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'foldDisplayModeChange' AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . callback AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 年月信息标题。月视图和周视图显示年月信息,年视图只显示年信息。周视图中如果选中了日期,则优先根据选中日期显示年月信息。 */ AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right yearMonthTitle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowYear AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right 年 AST#template_substitution#Left $ { AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right ? AST#expression#Left '' AST#expression#Right : AST#expression#Left AST#subscript_expression#Left AST#expression#Left MONTHS AST#expression#Right [ AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowMonth AST#member_expression#Right AST#expression#Right - AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#conditional_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#binary_expression#Left AST#expression#Left FONT_SIZE AST#expression#Right * AST#expression#Left TEXT_SCALING AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left FONT_WEIGHT_FIVE_HUNDRED AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 自定义添加日程组件 // monthViewController: 可选项。传入该控制器,添加日程后,对应日程点会刷新到月视图上 // weekViewController: 可选项。传入该控制器,添加日程后,对应日程点会刷新到周视图上 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left SchedulePoint ( AST#component_parameters#Left { AST#component_parameter#Left monthViewController : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarMonthController AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left weekViewController : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarWeekController AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left left AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_ten' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left right AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_ten' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . justifyContent ( AST#expression#Left AST#member_expression#Left AST#expression#Left FlexAlign AST#expression#Right . SpaceBetween AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_thirty' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 自定义分段按钮 */ AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customSegmentButton AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Stack ( AST#component_parameters#Left { AST#component_parameter#Left alignContent : AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . TopStart AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_thirty_five' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.calendar_switch_segment_button_row_bgcolor' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_border_radius' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . layoutWeight ( AST#expression#Left LAYOUT_WEIGHT_THREE AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_border_radius' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left PADDING AST#expression#Right * AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left 3 AST#expression#Right AST#binary_expression#Right AST#expression#Right - AST#expression#Left GAP_SPACE AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_thirty_five' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left COLUMN_WIDTH AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left left AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . indicatorLeftMargin AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_three' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_three' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customSegmentButtonItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right , AST#expression#Left '年' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customSegmentButtonItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right , AST#expression#Left '月' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customSegmentButtonItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . WEEK AST#member_expression#Right AST#expression#Right , AST#expression#Left '周' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_thirty_five' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_border_radius' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Transparent AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . layoutWeight ( AST#expression#Left LAYOUT_WEIGHT_THREE AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_thirty_five' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_ten' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_margin_size_twelve' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 自定义分段按钮项 * @param index 自定义分段按钮索引。这里对应自定义日历视图类型。0:年视图YEAR,1:月视图MONTH,2:周视图WEEK * @param name 自定义分段按钮名。这里对应'年','月','周' */ AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customSegmentButtonItem AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left name AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left CUSTOM_SEGMENT_BUTTON_MONTH_WIDTH AST#expression#Right ) AST#modifier_chain_expression#Left . textAlign ( AST#expression#Left AST#member_expression#Left AST#expression#Left TextAlign AST#expression#Right . Center AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_thirty_five' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_fourteen' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Black AST#member_expression#Right AST#expression#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.calendar_switch_segment_button_font_color' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#conditional_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left FONT_WEIGHT_FIVE_HUNDRED AST#expression#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left FONT_WEIGHT_FOUR_HUNDRED AST#primary_type#Right AST#type_annotation#Right ) } AST#ERROR#Right . width AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_size_thirty_five' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . layoutWeight AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left LAYOUT_WEIGHT_ONE AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . onClick AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . tabSelectedIndex AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 点击同一个自定义分段按钮项,不做切换,避免冗余操作 AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right = AST#expression#Left index AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabController AST#member_expression#Right AST#expression#Right . changeIndex AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowYear AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . year AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowMonth AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . month AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // TODO 知识点:点击自定义分段按钮customSegmentButton进行年、月、周视图间切换。使用视图控制器的swiperRefresh方法刷新对应视图数据。 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 刷新月视图 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarMonthController AST#member_expression#Right AST#expression#Right . swiperRefresh AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . WEEK AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 刷新周视图 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarWeekController AST#member_expression#Right AST#expression#Right . swiperRefresh AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . WEEK AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 刷新年视图 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarYearController AST#member_expression#Right AST#expression#Right . swiperRefresh AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#ERROR#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right /** * 自定义分段按钮切换动画 * @param duration 动画时长 * @param leftMargin 自定义分段按钮左侧边距 */ AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left startAnimateTo ( AST#expression#Left duration AST#expression#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right , AST#expression#Left leftMargin AST#expression#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ) { animateTo ( AST#component_parameters#Left { AST#component_parameter#Left duration : AST#expression#Left duration AST#expression#Right AST#component_parameter#Right , // 动画时长 AST#component_parameter#Left curve : AST#expression#Left AST#member_expression#Left AST#expression#Left Curve AST#expression#Right . Linear AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , // 动画曲线 AST#component_parameter#Left iterations : AST#expression#Left 1 AST#expression#Right AST#component_parameter#Right , // 播放次数 AST#component_parameter#Left playMode : AST#expression#Left AST#member_expression#Left AST#expression#Left PlayMode AST#expression#Right . Normal AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , // 动画模式 } AST#component_parameters#Right AST#ERROR#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . indicatorLeftMargin AST#member_expression#Right = AST#expression#Left leftMargin AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 年月信息标题(包含添加日程组件) AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . yearMonthTitle AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right // 自定义分段按钮 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customSegmentButton AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Tabs ( AST#component_parameters#Left { AST#component_parameter#Left barPosition : AST#expression#Left AST#member_expression#Left AST#expression#Left BarPosition AST#expression#Right . End AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left index : AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left controller : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabController AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left TabContent ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 自定义年视图 // calendarViewType: 必选项。自定义日历类型。YEAR年视图 MONTH月视图 WEEK周视图 // onMonthClick: 可选项。年视图月份点击回调。返回年视图点击的年月信息。仅用于年视图。 // onChangeYearMonth: 可选项。年、月、周视图左右滑动切换回调。返回左右切换年、月、周后的年月信息,其中年视图切换实际只返回切换后年份信息。 // calendarSwitch: 可选项。年、月、周视图切换场景的相关设置。 // - controller: 可选项。自定义日历控制器,用于视图切换后的数据刷新。 // - currentSelectDay: 可选项。记录月、周视图中点击选中的日期信息。 // - isYearMonthHidden:可选项。是否隐藏自定义日历年、月、周视图中自带的年月信息标题。 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left CustomCalendar ( AST#component_parameters#Left { AST#component_parameter#Left calendarViewType : AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onMonthClick : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabController AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 切到月视图 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabController AST#member_expression#Right AST#expression#Right . changeIndex AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 1 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 刷新年月信息标题 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowYear AST#member_expression#Right = AST#expression#Left year AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowMonth AST#member_expression#Right = AST#expression#Left month AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 刷新在年视图上点击月后要跳转的月视图数据 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarMonthController AST#member_expression#Right AST#expression#Right . swiperYearToMonthRefresh AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left year AST#expression#Right , AST#expression#Left month AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onChangeYearMonth : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowYear AST#member_expression#Right = AST#expression#Left year AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left calendarSwitch : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left controller AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarYearController AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left currentSelectDay AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left isYearMonthHidden AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isYearMonthHidden AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left TabContent ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 自定义月视图 // calendarViewType: 必选项。自定义日历类型。YEAR年视图 MONTH月视图 WEEK周视图 // calendarStyle: 可选项。自定义日历样式。仅用于月、周视图。 // - textScaling: 可选项。月视图和周视图中的公历、农历、星期、年月信息标题文字缩放比例。 // - backgroundColor: 可选项。今天选中日期的背景色。 // - monthDayColor: 可选项。本月公历日期颜色。 // - noMonthDayColor: 可选项。非本月公历日期颜色,仅对月视图有效。 // - lunarColor: 可选项。本月农历字体颜色。 // onDateClick: 可选项。日期点击回调。返回点击日期的年月日信息。仅用于月、周视图。 // onChangeYearMonth: 可选项。年、月、周视图左右滑动切换回调,返回左右切换视图后的年月信息,其中年视图切换实际只返回切换后年份信息。 // calendarSwitch: 可选项。用于年、月、周视图切换场景的相关设置。 // - controller: 可选项。自定义日历控制器,用于视图切换后的数据刷新。 // - currentSelectDay: 可选项。记录月、周视图中点击选中的日期信息。 // - isYearMonthHidden:可选项。是否隐藏自定义日历年、月、周视图中自带的年月信息标题。 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left CustomCalendar ( AST#component_parameters#Left { AST#component_parameter#Left calendarViewType : AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left calendarStyle : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left textScaling AST#property_name#Right : AST#expression#Left TEXT_SCALING AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left backgroundColor AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Red AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left monthDayColor AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Black AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left noMonthDayColor AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Gray AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left lunarColor AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Gray AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onDateClick : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . year AST#member_expression#Right = AST#expression#Left year AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . month AST#member_expression#Right = AST#expression#Left month AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . date AST#member_expression#Right = AST#expression#Left date AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onChangeYearMonth : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowYear AST#member_expression#Right = AST#expression#Left year AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowMonth AST#member_expression#Right = AST#expression#Left month AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left calendarSwitch : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left controller AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarMonthController AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left currentSelectDay AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left isYearMonthHidden AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isYearMonthHidden AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , } AST#object_literal#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left TabContent ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 自定义周视图 // calendarViewType: 必选项。自定义日历类型。YEAR年视图 MONTH月视图 WEEK周视图 // calendarStyle: 可选项。自定义日历样式。仅用于月、周视图。 // - textScaling: 可选项。月视图和周视图中的公历、农历、星期、年月信息标题文字缩放比例。 // - backgroundColor: 可选项。今天选中日期的背景色。 // - monthDayColor: 可选项。本月公历日期颜色。 // - noMonthDayColor: 可选项。非本月公历日期颜色,仅对月视图有效。 // - lunarColor: 可选项。本月农历字体颜色。 // onDateClick: 可选项。日期点击回调。返回点击日期的年月日信息。仅用于月、周视图。 // onChangeYearMonth: 可选项。年、月、周视图左右滑动切换回调,返回左右切换视图后的年月信息,其中年视图切换实际只返回切换后年份信息。 // calendarSwitch: 可选项。用于年、月、周视图切换场景的相关设置。 // - controller: 可选项。自定义日历控制器,用于视图切换后的数据刷新。 // - currentSelectDay: 可选项。记录月、周视图中点击选中的日期信息。 // - isYearMonthHidden:可选项。是否隐藏自定义日历年、月、周视图中自带的年月信息标题。 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left CustomCalendar ( AST#component_parameters#Left { AST#component_parameter#Left calendarViewType : AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . WEEK AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left calendarStyle : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left textScaling AST#property_name#Right : AST#expression#Left TEXT_SCALING AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left backgroundColor AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Red AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left monthDayColor AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Black AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left lunarColor AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Gray AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onDateClick : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . year AST#member_expression#Right = AST#expression#Left year AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . month AST#member_expression#Right = AST#expression#Left month AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right . date AST#member_expression#Right = AST#expression#Left date AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onChangeYearMonth : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowYear AST#member_expression#Right = AST#expression#Left year AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentShowMonth AST#member_expression#Right = AST#expression#Left month AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left calendarSwitch : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left controller AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calendarWeekController AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left currentSelectDay AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentSelectDay AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left isYearMonthHidden AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isYearMonthHidden AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . animationDuration ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . animationDuration AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . onAnimationStart ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left targetIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left event : AST#type_annotation#Left AST#primary_type#Left TabsAnimationEvent AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { // 在年视图中点击月,切换到月视图时,需要显示'年月信息标题'中的的月份信息 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left targetIndex AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabSelectedIndex AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left CalendarViewType AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 切换动画开始时触发该回调。白色滑块跟着页面一起滑动。 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . currentIndex AST#member_expression#Right = AST#expression#Left targetIndex AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left targetIndex AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . YEAR AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 传入自定义分段按钮左侧边距 点击“年”的分段按钮时,分段按钮白色滑块移动到屏幕1/6位置 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . startAnimateTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . animationDuration AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left PADDING AST#expression#Right * AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left 6 AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left COLUMN_WIDTH AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left targetIndex AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . MONTH AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 传入自定义分段按钮左侧边距 点击“月”的分段按钮时,分段按钮白色滑块移动到屏幕3/6位置 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . startAnimateTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . animationDuration AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left PADDING AST#expression#Right * AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left COLUMN_WIDTH AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left targetIndex AST#expression#Right === AST#expression#Left CalendarViewType AST#expression#Right AST#binary_expression#Right AST#expression#Right . WEEK AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 传入自定义分段按钮左侧边距 点击“周”的分段按钮时,分段按钮白色滑块移动到屏幕5/6位置 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . startAnimateTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . animationDuration AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . screenWidth AST#member_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left PADDING AST#expression#Right * AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left 6 AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left 5 AST#expression#Right AST#binary_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left COLUMN_WIDTH AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Left . onAppear ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { // TODO: 高性能知识点: 组件挂载显示后触发此回调,预加载年视图数据,避免首次切换到年视图时出现卡顿问题 // 针对月视图切换周视图场景,需要预加载周视图(索引2),不然在月视图切换月份,选择日期后,再切换到周视图,周视图不会刷新 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabController AST#member_expression#Right AST#expression#Right . preloadItems AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#array_literal#Left [ AST#expression#Left 0 AST#expression#Right , AST#expression#Left 2 AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 索引0对应年视图,索引2对应周视图 } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Left . layoutWeight ( AST#expression#Left LAYOUT_WEIGHT_ONE AST#expression#Right ) AST#modifier_chain_expression#Left . scrollable ( AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . barHeight ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.calendar_switch_zero' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.calendar_switch_full_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left PADDING AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#build_body#Right AST#build_method#Right } AST#component_body#Right AST#decorated_export_declaration#Right
@Component export struct CustomCalendarSamplePage { @State screenWidth: number = 0; @State currentShowYear: number = TODAY_YEAR; @State currentShowMonth: number = TODAY_MONTH; @State currentSelectDay: DayInfo = new DayInfo(new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate(), 0); @State isYearMonthHidden: boolean = true; @State currentIndex: number = 1; @State indicatorLeftMargin: number = 0; @State indicatorWidth: number = 0; @State tabSelectedIndex: number = 1; private animationDuration: number = 300; private tabController: TabsController = new TabsController(); private calendarYearController = new CalendarController(); private calendarMonthController = new CalendarController(); private calendarWeekController = new CalendarController(); private isFoldable: boolean = false; private callback: Callback<display.FoldDisplayMode> = (mode: display.FoldDisplayMode) => { this.screenWidth = this.getCurrentScreenWidth(); if (this.currentIndex === CalendarViewType.YEAR) { this.indicatorLeftMargin = (this.screenWidth - PADDING * 2) / 6 * 1 - COLUMN_WIDTH / 2; } else if (this.currentIndex === CalendarViewType.MONTH) { this.indicatorLeftMargin = (this.screenWidth - PADDING * 2) / 2 - COLUMN_WIDTH / 2; } else if (this.currentIndex === CalendarViewType.WEEK) { this.indicatorLeftMargin = (this.screenWidth - PADDING * 2) / 6 * 5 - COLUMN_WIDTH / 2; } if (mode === display.FoldDisplayMode.FOLD_DISPLAY_MODE_FULL) { CommonData.DEVICE_TYPE = DeviceType.EXPAND_FOLD; } else if (mode === display.FoldDisplayMode.FOLD_DISPLAY_MODE_MAIN) { CommonData.DEVICE_TYPE = DeviceType.PHONE; } }; private readonly DEVICESIZE: number = 600; isPlugin: boolean = true; getCurrentScreenWidth(): number { let screenWidth: number = px2vp(display.getDefaultDisplaySync().width); if (!this.isPlugin && screenWidth >= this.DEVICESIZE) { return screenWidth / 2; } else { return screenWidth; } } aboutToAppear() { 。false表示不可折叠,true表示可折叠。 this.isFoldable = display.isFoldable(); CommonData.IS_FOLD = this.isFoldable; if (this.isFoldable) { display.on('foldDisplayModeChange', this.callback); if (display.getFoldDisplayMode() === display.FoldDisplayMode.FOLD_DISPLAY_MODE_FULL) { CommonData.DEVICE_TYPE = DeviceType.EXPAND_FOLD; } } this.screenWidth = this.getCurrentScreenWidth(); this.indicatorLeftMargin = (this.screenWidth - COLUMN_WIDTH) / 2 - PADDING; if (px2vp(display.getDefaultDisplaySync().width) === 480) { CommonData.DEVICE_TYPE = DeviceType.RK; } } aboutToDisappear() { if (this.isFoldable) { display.off('foldDisplayModeChange', this.callback); } } @Builder yearMonthTitle() { Row() { Text(`${this.currentShowYear}年 ${this.tabSelectedIndex === CalendarViewType.YEAR ? '' : MONTHS[this.currentShowMonth-1]}`) .fontSize(FONT_SIZE * TEXT_SCALING) .fontWeight(FONT_WEIGHT_FIVE_HUNDRED) SchedulePoint({ monthViewController: this.calendarMonthController, weekViewController: this.calendarWeekController }) } .padding({ left: $r('app.integer.calendar_switch_size_ten'), right: $r('app.integer.calendar_switch_size_ten') }) .justifyContent(FlexAlign.SpaceBetween) .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty')) } @Builder customSegmentButton() { Stack({ alignContent: Alignment.TopStart }) { Row() { } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .backgroundColor($r('app.color.calendar_switch_segment_button_row_bgcolor')) .borderRadius($r('app.integer.calendar_switch_border_radius')) .layoutWeight(LAYOUT_WEIGHT_THREE) Column() { Row() { } .borderRadius($r('app.integer.calendar_switch_border_radius')) .height($r('app.string.calendar_switch_full_size')) .width((this.screenWidth - PADDING * 2) / 3 - GAP_SPACE) .backgroundColor(Color.White) } .height($r('app.integer.calendar_switch_size_thirty_five')) .width(COLUMN_WIDTH) .margin({ left: this.indicatorLeftMargin }) .padding({ top: $r('app.integer.calendar_switch_size_three'), bottom: $r('app.integer.calendar_switch_size_three') }) Row() { this.customSegmentButtonItem(CalendarViewType.YEAR, '年') this.customSegmentButtonItem(CalendarViewType.MONTH, '月') this.customSegmentButtonItem(CalendarViewType.WEEK, '周') } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .borderRadius($r('app.integer.calendar_switch_border_radius')) .backgroundColor(Color.Transparent) .layoutWeight(LAYOUT_WEIGHT_THREE) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .margin({ top: $r('app.integer.calendar_switch_size_ten'), bottom: $r('app.integer.calendar_switch_margin_size_twelve') }) } @Builder customSegmentButtonItem(index: number, name: string) { Column() { Text(name) .width(CUSTOM_SEGMENT_BUTTON_MONTH_WIDTH) .textAlign(TextAlign.Center) .height($r('app.integer.calendar_switch_size_thirty_five')) .fontSize($r('app.integer.calendar_switch_size_fourteen')) .fontColor(this.currentIndex === index ? Color.Black : $r('app.color.calendar_switch_segment_button_font_color')) .fontWeight(this.currentIndex === index ? FONT_WEIGHT_FIVE_HUNDRED : FONT_WEIGHT_FOUR_HUNDRED) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.integer.calendar_switch_size_thirty_five')) .layoutWeight(LAYOUT_WEIGHT_ONE) .onClick(() => { if (index === this.tabSelectedIndex) { return; } this.tabSelectedIndex = index; this.tabController.changeIndex(index); this.currentShowYear = this.currentSelectDay.year; this.currentShowMonth = this.currentSelectDay.month; if (this.tabSelectedIndex === CalendarViewType.MONTH) { this.calendarMonthController.swiperRefresh(CalendarViewType.MONTH); } else if (this.tabSelectedIndex === CalendarViewType.WEEK) { this.calendarWeekController.swiperRefresh(CalendarViewType.WEEK); } else if (this.tabSelectedIndex === CalendarViewType.YEAR) { this.calendarYearController.swiperRefresh(CalendarViewType.YEAR); } }) } startAnimateTo(duration: number, leftMargin: number) { animateTo({ duration: duration, curve: Curve.Linear, iterations: 1, playMode: PlayMode.Normal, }, () => { this.indicatorLeftMargin = leftMargin; }) } build() { Column() { this.yearMonthTitle() this.customSegmentButton() Tabs({ barPosition: BarPosition.End, index: CalendarViewType.MONTH, controller: this.tabController }) { TabContent() { Column() { CustomCalendar({ calendarViewType: CalendarViewType.YEAR, onMonthClick: (year: number, month: number) => { if (this.tabController) { this.tabController.changeIndex(1); this.currentShowYear = year; this.currentShowMonth = month; this.calendarMonthController.swiperYearToMonthRefresh(year, month); } }, onChangeYearMonth: (year: number, month: number) => { this.currentShowYear = year; }, calendarSwitch: { controller: this.calendarYearController, currentSelectDay: this.currentSelectDay, isYearMonthHidden: this.isYearMonthHidden } }) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.string.calendar_switch_full_size')) } TabContent() { Column() { CustomCalendar({ calendarViewType: CalendarViewType.MONTH, calendarStyle: { textScaling: TEXT_SCALING, backgroundColor: Color.Red, monthDayColor: Color.Black, noMonthDayColor: Color.Gray, lunarColor: Color.Gray }, onDateClick: (year: number, month: number, date: number) => { this.currentSelectDay.year = year; this.currentSelectDay.month = month; this.currentSelectDay.date = date; }, onChangeYearMonth: (year: number, month: number) => { this.currentShowYear = year; this.currentShowMonth = month; }, calendarSwitch: { controller: this.calendarMonthController, currentSelectDay: this.currentSelectDay, isYearMonthHidden: this.isYearMonthHidden, } }) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.string.calendar_switch_full_size')) } TabContent() { Column() { CustomCalendar({ calendarViewType: CalendarViewType.WEEK, calendarStyle: { textScaling: TEXT_SCALING, backgroundColor: Color.Red, monthDayColor: Color.Black, lunarColor: Color.Gray }, onDateClick: (year: number, month: number, date: number) => { this.currentSelectDay.year = year; this.currentSelectDay.month = month; this.currentSelectDay.date = date; }, onChangeYearMonth: (year: number, month: number) => { this.currentShowYear = year; this.currentShowMonth = month; }, calendarSwitch: { controller: this.calendarWeekController, currentSelectDay: this.currentSelectDay, isYearMonthHidden: this.isYearMonthHidden } }) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.string.calendar_switch_full_size')) } } .animationDuration(this.animationDuration) .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { if (index === CalendarViewType.YEAR && targetIndex === CalendarViewType.MONTH) { this.tabSelectedIndex = CalendarViewType.MONTH; } this.currentIndex = targetIndex; if (targetIndex === CalendarViewType.YEAR) { this.startAnimateTo(this.animationDuration, (this.screenWidth - PADDING * 2) / 6 * 1 - COLUMN_WIDTH / 2); } else if (targetIndex === CalendarViewType.MONTH) { this.startAnimateTo(this.animationDuration, (this.screenWidth - PADDING * 2) / 2 - COLUMN_WIDTH / 2); } else if (targetIndex === CalendarViewType.WEEK) { this.startAnimateTo(this.animationDuration, (this.screenWidth - PADDING * 2) / 6 * 5 - COLUMN_WIDTH / 2); } }) .onAppear(() => { this.tabController.preloadItems([0, 2]); }) .layoutWeight(LAYOUT_WEIGHT_ONE) .scrollable(false) .barHeight($r('app.integer.calendar_switch_zero')) } .width($r('app.string.calendar_switch_full_size')) .height($r('app.string.calendar_switch_full_size')) .padding(PADDING) } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets#L73-L473
977d4f961d53620c1309f5508c32076437fee3dc
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/view/DatabaseConnection.ets
arkts
insertData
插入数据库
public async insertData(context: common.Context, Contact: Contact): Promise<void> { logger.info(TAG, 'insert begin'); if (!context) { logger.info(TAG, 'context is null or undefined'); } const predicates = new rdb.RdbPredicates(TABLE_NAME); if (predicates === null || predicates === undefined) { logger.info(TAG, 'predicates is null or undefined'); } this.rdbStore = await rdb.getRdbStore(context, STORE_CONFIG); let value1 = Contact.name; let value2 = Contact.phone; let value3 = Contact.email; let value4 = Contact.address; let value5 = Contact.avatar; let value6 = Contact.category; const valueBucket: ValuesBucket = { 'name': value1, 'phone': value2, 'email': value3, 'address': value4, 'avatar': value5, 'category': value6 } if (this.rdbStore != undefined) { this.rdbStore.insert(TABLE_NAME, valueBucket, rdb.ConflictResolution.ON_CONFLICT_REPLACE, (err: BusinessError, rows: number) => { if (err) { logger.info(TAG, "Insert failed, err: " + err) return } logger.info(TAG, `insert done:${rows}`); promptAction.showToast({ message: $r('app.string.operate_rdb_in_taskpool_add_prompt_text', Contact.name), duration: CommonConstants.PROMPT_DURATION_TIME }); }) } }
AST#method_declaration#Left public async insertData AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . Context AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left Contact : AST#type_annotation#Left AST#primary_type#Left Contact AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left 'insert begin' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left context AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left 'context is null or undefined' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left predicates = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left rdb AST#expression#Right AST#new_expression#Right AST#expression#Right . RdbPredicates AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TABLE_NAME AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left predicates AST#expression#Right === AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left AST#binary_expression#Left AST#expression#Left predicates AST#expression#Right === AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left 'predicates is null or undefined' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . rdbStore AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left rdb AST#expression#Right AST#await_expression#Right AST#expression#Right . getRdbStore AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left context AST#expression#Right , AST#expression#Left STORE_CONFIG AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left value1 = AST#expression#Left AST#member_expression#Left AST#expression#Left Contact AST#expression#Right . name AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left value2 = AST#expression#Left AST#member_expression#Left AST#expression#Left Contact AST#expression#Right . phone AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left value3 = AST#expression#Left AST#member_expression#Left AST#expression#Left Contact AST#expression#Right . email AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left value4 = AST#expression#Left AST#member_expression#Left AST#expression#Left Contact AST#expression#Right . address AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left value5 = AST#expression#Left AST#member_expression#Left AST#expression#Left Contact AST#expression#Right . avatar AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left value6 = AST#expression#Left AST#member_expression#Left AST#expression#Left Contact AST#expression#Right . category AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left valueBucket : AST#type_annotation#Left AST#primary_type#Left ValuesBucket AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left 'name' AST#property_name#Right : AST#expression#Left value1 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left 'phone' AST#property_name#Right : AST#expression#Left value2 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left 'email' AST#property_name#Right : AST#expression#Left value3 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left 'address' AST#property_name#Right : AST#expression#Left value4 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left 'avatar' AST#property_name#Right : AST#expression#Left value5 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left 'category' AST#property_name#Right : AST#expression#Left value6 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . rdbStore AST#member_expression#Right AST#expression#Right != AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . rdbStore AST#member_expression#Right AST#expression#Right . insert AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TABLE_NAME AST#expression#Right , AST#expression#Left valueBucket AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left rdb AST#expression#Right . ConflictResolution AST#member_expression#Right AST#expression#Right . ON_CONFLICT_REPLACE AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left err : AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left rows : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left err AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left "Insert failed, err: " AST#expression#Right + AST#expression#Left err AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left TAG AST#expression#Right , AST#expression#Left AST#template_literal#Left ` insert done: AST#template_substitution#Left $ { AST#expression#Left rows AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left message AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.operate_rdb_in_taskpool_add_prompt_text' AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left Contact AST#expression#Right . name AST#member_expression#Right AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left duration AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left CommonConstants AST#expression#Right . PROMPT_DURATION_TIME AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public async insertData(context: common.Context, Contact: Contact): Promise<void> { logger.info(TAG, 'insert begin'); if (!context) { logger.info(TAG, 'context is null or undefined'); } const predicates = new rdb.RdbPredicates(TABLE_NAME); if (predicates === null || predicates === undefined) { logger.info(TAG, 'predicates is null or undefined'); } this.rdbStore = await rdb.getRdbStore(context, STORE_CONFIG); let value1 = Contact.name; let value2 = Contact.phone; let value3 = Contact.email; let value4 = Contact.address; let value5 = Contact.avatar; let value6 = Contact.category; const valueBucket: ValuesBucket = { 'name': value1, 'phone': value2, 'email': value3, 'address': value4, 'avatar': value5, 'category': value6 } if (this.rdbStore != undefined) { this.rdbStore.insert(TABLE_NAME, valueBucket, rdb.ConflictResolution.ON_CONFLICT_REPLACE, (err: BusinessError, rows: number) => { if (err) { logger.info(TAG, "Insert failed, err: " + err) return } logger.info(TAG, `insert done:${rows}`); promptAction.showToast({ message: $r('app.string.operate_rdb_in_taskpool_add_prompt_text', Contact.name), duration: CommonConstants.PROMPT_DURATION_TIME }); }) } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/view/DatabaseConnection.ets#L177-L220
166275d0d4d324034591124f1652f760faa63da7
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.EditableTitleBar.d.ets
arkts
Declaration of the menu item on the right side. @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Declaration of the menu item on the right side. @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11
export declare class EditableTitleBarMenuItem { /** * Icon resource for this menu item. * @type { ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Icon resource for this menu item. * @type { ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 11 */ value: ResourceStr; /** * Symbol style for this menu item. * @type { ?SymbolGlyphModifier }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ symbolStyle?: SymbolGlyphModifier; /** * Icon label for this menu item. * @type { ?ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ label?: ResourceStr; /** * Whether to enable this menu item. * @type { ?boolean }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Whether to enable this menu item. * @type { ?boolean }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 11 */ isEnabled?: boolean; /** * Callback function when click on this menu item. * @type { ?() => void }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Callback function when click on this menu item. * @type { ?() => void }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 11 */ action?: () => void; /** * The accessibilityText of this menu item. * @type { ?ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ accessibilityText?: ResourceStr; /** * The accessibilityDescription of this menu item. * @type { ?ResourceStr } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ accessibilityDescription?: ResourceStr; /** * The accessibilityLevel of this menu item. * @type { ?string } * @default "auto" * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ accessibilityLevel?: string; /** * Set the default focus state of this menu item. * @type { ?boolean }. * @default { false }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ defaultFocus?: boolean; }
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class EditableTitleBarMenuItem AST#class_body#Left { /** * Icon resource for this menu item. * @type { ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Icon resource for this menu item. * @type { ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 11 */ AST#property_declaration#Left value : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Symbol style for this menu item. * @type { ?SymbolGlyphModifier }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left symbolStyle ? : AST#type_annotation#Left AST#primary_type#Left SymbolGlyphModifier AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Icon label for this menu item. * @type { ?ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ AST#property_declaration#Left label ? : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Whether to enable this menu item. * @type { ?boolean }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Whether to enable this menu item. * @type { ?boolean }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 11 */ AST#property_declaration#Left isEnabled ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Callback function when click on this menu item. * @type { ?() => void }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Callback function when click on this menu item. * @type { ?() => void }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 11 */ AST#property_declaration#Left action ? : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * The accessibilityText of this menu item. * @type { ?ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left accessibilityText ? : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * The accessibilityDescription of this menu item. * @type { ?ResourceStr } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left accessibilityDescription ? : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * The accessibilityLevel of this menu item. * @type { ?string } * @default "auto" * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left accessibilityLevel ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Set the default focus state of this menu item. * @type { ?boolean }. * @default { false }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#property_declaration#Left defaultFocus ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export declare class EditableTitleBarMenuItem { value: ResourceStr; symbolStyle?: SymbolGlyphModifier; label?: ResourceStr; isEnabled?: boolean; action?: () => void; accessibilityText?: ResourceStr; accessibilityDescription?: ResourceStr; accessibilityLevel?: string; defaultFocus?: boolean; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.EditableTitleBar.d.ets#L36-L137
af6ccf4263c562f64fe38c17b4133924b226b5c5
gitee
OHPG/FinVideo.git
2b288396af5b2a20a24575faa317b46214965391
entry/src/main/ets/router/AppRouter.ets
arkts
goToPlayer
跳转到播放页 @param context @param args
public static goToPlayer(context: UIContext, args: PlayerArgs) { context.getRouter().pushUrl({url: "pages/player/PlayerPage", params: args}) }
AST#method_declaration#Left public static goToPlayer AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left args : AST#type_annotation#Left AST#primary_type#Left PlayerArgs AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left context AST#expression#Right . getRouter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . pushUrl AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left url AST#property_name#Right : AST#expression#Left "pages/player/PlayerPage" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left params AST#property_name#Right : AST#expression#Left args AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
public static goToPlayer(context: UIContext, args: PlayerArgs) { context.getRouter().pushUrl({url: "pages/player/PlayerPage", params: args}) }
https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/router/AppRouter.ets#L17-L19
fb0c4784fa93ab780d40003ef4ab543e16425c4f
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/GlobalTypes.ets
arkts
尺寸接口
export interface Size { width: number; height: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface Size AST#object_type#Left { AST#type_member#Left width : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left height : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface Size { width: number; height: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GlobalTypes.ets#L124-L127
2572c8b562a2469a985462f32d9428fa2537ee03
github
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/SM4.ets
arkts
decryptCBC
解密(CBC模式),异步 @param data 加密或者解密的数据。data不能为null。 @param symKey 指定加密或解密的密钥。 @param ivParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。 @returns
static async decryptCBC(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, ivParams: cryptoFramework.IvParamsSpec): Promise<cryptoFramework.DataBlob> { return SM4.decrypt(data, symKey, ivParams, 'SM4_128|CBC|PKCS7'); }
AST#method_declaration#Left static async decryptCBC AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . SymKey AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left ivParams : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . IvParamsSpec AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left SM4 AST#expression#Right . decrypt AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left data AST#expression#Right , AST#expression#Left symKey AST#expression#Right , AST#expression#Left ivParams AST#expression#Right , AST#expression#Left 'SM4_128|CBC|PKCS7' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static async decryptCBC(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, ivParams: cryptoFramework.IvParamsSpec): Promise<cryptoFramework.DataBlob> { return SM4.decrypt(data, symKey, ivParams, 'SM4_128|CBC|PKCS7'); }
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/SM4.ets#L130-L133
cfa8d8a0618c1bada5a2efd5d23a1bfda3adb04a
github
de8gemaker/AccountApp.git
b5156cd90ac02239b39fd0f91d32851acad8ba42
entry/src/main/ets/service/account.ets
arkts
getAccountByMonth
按月份获取记账记录
getAccountByMonth(time: string | number) { const startMonth = dayjs(time).startOf('month').toDate().getTime(); const endMonth = dayjs(time).endOf('month').toDate().getTime(); return AccountModel.queryByDateRange(startMonth, endMonth); }
AST#method_declaration#Left getAccountByMonth AST#parameter_list#Left ( AST#parameter#Left time : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left startMonth = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left dayjs AST#expression#Right AST#argument_list#Left ( AST#expression#Left time AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . startOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'month' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . toDate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . getTime AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left endMonth = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left dayjs AST#expression#Right AST#argument_list#Left ( AST#expression#Left time AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . endOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'month' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . toDate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . getTime AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AccountModel AST#expression#Right . queryByDateRange AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left startMonth AST#expression#Right , AST#expression#Left endMonth AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
getAccountByMonth(time: string | number) { const startMonth = dayjs(time).startOf('month').toDate().getTime(); const endMonth = dayjs(time).endOf('month').toDate().getTime(); return AccountModel.queryByDateRange(startMonth, endMonth); }
https://github.com/de8gemaker/AccountApp.git/blob/b5156cd90ac02239b39fd0f91d32851acad8ba42/entry/src/main/ets/service/account.ets#L29-L33
1b2764796eb52211d342e2471a4a28d80074d251
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/main/sub/report/RadarView.ets
arkts
drawDataPoints
========== 绘制数据点 ==========
private drawDataPoints(centerX: number, centerY: number, radius: number): void { if (this.parts.length === 0) return; const angleStep = (2 * Math.PI) / this.parts.length; for (let i = 0; i < this.parts.length; i++) { const part = this.parts[i]; const angle = this.START_ANGLE_OFFSET + angleStep * i; const pointRadiusValue = radius * part.ratio; const x = centerX + pointRadiusValue * Math.cos(angle); const y = centerY + pointRadiusValue * Math.sin(angle); // 绘制数据点[2](@ref) this.ctx.fillStyle = part.color; this.ctx.beginPath(); this.ctx.arc(x, y, this.POINT_RADIUS, 0, Math.PI * 2); this.ctx.fill(); // 绘制数据点外圈 this.ctx.strokeStyle = '#FFFFFF'; this.ctx.lineWidth = 1.5; this.ctx.stroke(); } }
AST#method_declaration#Left private drawDataPoints AST#parameter_list#Left ( AST#parameter#Left centerX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left centerY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left radius : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . parts AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left angleStep = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 2 AST#expression#Right * AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right . PI AST#member_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . parts AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left i = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right < AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . parts AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left part = AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . parts AST#member_expression#Right AST#expression#Right [ AST#expression#Left i AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left angle = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . START_ANGLE_OFFSET AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left angleStep AST#expression#Right * AST#expression#Left i AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left pointRadiusValue = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left radius AST#expression#Right * AST#expression#Left part AST#expression#Right AST#binary_expression#Right AST#expression#Right . ratio AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left x = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left centerX AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left pointRadiusValue AST#expression#Right * AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . cos AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left angle AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left y = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left centerY AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left pointRadiusValue AST#expression#Right * AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . sin AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left angle AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 绘制数据点[2](@ref) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ctx AST#member_expression#Right AST#expression#Right . fillStyle AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left part AST#expression#Right . color AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ctx AST#member_expression#Right AST#expression#Right . beginPath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ctx AST#member_expression#Right AST#expression#Right . arc AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left x AST#expression#Right , AST#expression#Left y AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . POINT_RADIUS AST#member_expression#Right AST#expression#Right , AST#expression#Left 0 AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Math AST#expression#Right . PI AST#member_expression#Right AST#expression#Right * AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ctx AST#member_expression#Right AST#expression#Right . fill AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 绘制数据点外圈 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ctx AST#member_expression#Right AST#expression#Right . strokeStyle AST#member_expression#Right = AST#expression#Left '#FFFFFF' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ctx AST#member_expression#Right AST#expression#Right . lineWidth AST#member_expression#Right = AST#expression#Left 1.5 AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ctx AST#member_expression#Right AST#expression#Right . stroke AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private drawDataPoints(centerX: number, centerY: number, radius: number): void { if (this.parts.length === 0) return; const angleStep = (2 * Math.PI) / this.parts.length; for (let i = 0; i < this.parts.length; i++) { const part = this.parts[i]; const angle = this.START_ANGLE_OFFSET + angleStep * i; const pointRadiusValue = radius * part.ratio; const x = centerX + pointRadiusValue * Math.cos(angle); const y = centerY + pointRadiusValue * Math.sin(angle); this.ctx.fillStyle = part.color; this.ctx.beginPath(); this.ctx.arc(x, y, this.POINT_RADIUS, 0, Math.PI * 2); this.ctx.fill(); this.ctx.strokeStyle = '#FFFFFF'; this.ctx.lineWidth = 1.5; this.ctx.stroke(); } }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/main/sub/report/RadarView.ets#L283-L306
f6c494c9e1b18c650f8f79f859d428bb46041bd3
github
common-apps/ZRouter
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
RouterApi/src/main/ets/template/ZLifecycleObserver.ets
arkts
onPageHide
@Entry页面的生命周期函数
onPageHide(): void { }
AST#method_declaration#Left onPageHide AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
onPageHide(): void { }
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/template/ZLifecycleObserver.ets#L28-L29
9d2436043e9003cefbb88685d1f6a077d5e7c685
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/BarDataSet.ets
arkts
setBarShadowColor
Sets the color used for drawing the bar-shadows. The bar shadows is a surface behind the bar that indicates the maximum value. Don't for get to use getResources().getColor(...) to set this. Or Color.rgb(...). @param color
public setBarShadowColor(color: number): void { this.mBarShadowColor = color; }
AST#method_declaration#Left public setBarShadowColor AST#parameter_list#Left ( AST#parameter#Left color : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mBarShadowColor AST#member_expression#Right = AST#expression#Left color AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
public setBarShadowColor(color: number): void { this.mBarShadowColor = color; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarDataSet.ets#L220-L222
1b788ddafba7d02a27036e5be50a537b3b3640f0
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/common/constants/Constants.ets
arkts
Flip page type.
export enum FlipPageType { COVER_FLIP_PAGE = 0, SIMULATE_FLIP_PAGE = 1, SLIDE_FLIP_PAGE = 2, UP_DOWN_FLIP_PAGE = 3 }
AST#export_declaration#Left export AST#enum_declaration#Left enum FlipPageType AST#enum_body#Left { AST#enum_member#Left COVER_FLIP_PAGE = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left SIMULATE_FLIP_PAGE = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left SLIDE_FLIP_PAGE = AST#expression#Left 2 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left UP_DOWN_FLIP_PAGE = AST#expression#Left 3 AST#expression#Right AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
export enum FlipPageType { COVER_FLIP_PAGE = 0, SIMULATE_FLIP_PAGE = 1, SLIDE_FLIP_PAGE = 2, UP_DOWN_FLIP_PAGE = 3 }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/common/constants/Constants.ets#L171-L176
b9708126de0206228752240bd41d4f86b544dbbe
github
wcmzllx/axis-render
34a330085691968cf1c132095e5ce078aa7ee933
AxisRenderLibrary/src/main/ets/common/AxisRender.ets
arkts
getInstance
获取 c++ 渲染实例
getInstance() { return this.instance }
AST#method_declaration#Left getInstance AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . instance AST#member_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
getInstance() { return this.instance }
https://github.com/wcmzllx/axis-render/blob/34a330085691968cf1c132095e5ce078aa7ee933/AxisRenderLibrary/src/main/ets/common/AxisRender.ets#L265-L267
aae8d54b942d5b1f84ce4ae05282ba1e4d5b3f9e
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/plan/CreatePlanView.ets
arkts
open
/打开方式
function open(param: CreatePlanViewConfig.Param){ NavTo(NavKey, param, true) }
AST#function_declaration#Left function open AST#parameter_list#Left ( AST#parameter#Left param : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left CreatePlanViewConfig . Param AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left NavTo AST#expression#Right AST#argument_list#Left ( AST#expression#Left NavKey AST#expression#Right , AST#expression#Left param AST#expression#Right , AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right
function open(param: CreatePlanViewConfig.Param){ NavTo(NavKey, param, true) }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/plan/CreatePlanView.ets#L39-L41
9e6b2abdf24240ce552210cc10e082cba9dc067c
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/dbUtils/DBPrepare.ets
arkts
prepareDbIfNeedsByPath
准备数据库文件(根据具体路径) @param protocol 数据库协议实现 @param context Ability上下文 @param fromAssetsPath assets路径 @param toTargetPath 目标路径 @param async 是否异步操作
static async prepareDbIfNeedsByPath(protocol: DBPrepareProtocol, fromAssetsPath: string, toTargetPath: string) { // 检查磁盘空间 checkDiskSpace(); const exists = FileUtility.isFileExistAt(toTargetPath); if (!exists) { // 不存在就拷贝 await DbFileUtility.copyDatabaseFromAssetsIfNeeds(getAppContext(), fromAssetsPath, toTargetPath); return; } const isOpenable = await protocol.isDbOpenable(toTargetPath) if (!isOpenable) { FileUtility.deleteFileAt(toTargetPath); await DbFileUtility.copyDatabaseFromAssetsIfNeeds(getAppContext(), fromAssetsPath, toTargetPath); } // 文件已存在,检查是否可打开 // protocol.isDbOpenable(toTargetPath) // .then((openable) => { // if (!openable) { // FileUtility.deleteFileAt(toTargetPath); // DbFileUtility.copyDatabaseFromAssetsIfNeedsAsync(getAppContext(), fromAssetsPath, toTargetPath, true); // } // openable 为 true 就不需要任何处理 // }) // .catch(() => { // // 出现异常也认为不可打开,删除并拷贝 // FileUtility.deleteFileAt(toTargetPath); // DbFileUtility.copyDatabaseFromAssetsIfNeedsAsync(getAppContext(), fromAssetsPath, toTargetPath, true); // }); }
AST#method_declaration#Left static async prepareDbIfNeedsByPath AST#parameter_list#Left ( AST#parameter#Left protocol : AST#type_annotation#Left AST#primary_type#Left DBPrepareProtocol AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fromAssetsPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left toTargetPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { // 检查磁盘空间 AST#ui_custom_component_statement#Left checkDiskSpace ( ) ; AST#ui_custom_component_statement#Right AST#expression_statement#Left AST#expression#Left const AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left exists = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left FileUtility AST#expression#Right . isFileExistAt AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left toTargetPath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left exists AST#expression#Right AST#unary_expression#Right AST#expression#Right ) { // 不存在就拷贝 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left DbFileUtility AST#expression#Right AST#await_expression#Right AST#expression#Right . copyDatabaseFromAssetsIfNeeds AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left getAppContext AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left fromAssetsPath AST#expression#Right , AST#expression#Left toTargetPath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left return AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left const AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left isOpenable = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left protocol AST#expression#Right AST#await_expression#Right AST#expression#Right . isDbOpenable AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left toTargetPath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left isOpenable AST#expression#Right AST#unary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left FileUtility AST#expression#Right . deleteFileAt AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left toTargetPath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left DbFileUtility AST#expression#Right AST#await_expression#Right AST#expression#Right . copyDatabaseFromAssetsIfNeeds AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left getAppContext AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left fromAssetsPath AST#expression#Right , AST#expression#Left toTargetPath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right // 文件已存在,检查是否可打开 // protocol.isDbOpenable(toTargetPath) // .then((openable) => { // if (!openable) { // FileUtility.deleteFileAt(toTargetPath); // DbFileUtility.copyDatabaseFromAssetsIfNeedsAsync(getAppContext(), fromAssetsPath, toTargetPath, true); // } // openable 为 true 就不需要任何处理 // }) // .catch(() => { // // 出现异常也认为不可打开,删除并拷贝 // FileUtility.deleteFileAt(toTargetPath); // DbFileUtility.copyDatabaseFromAssetsIfNeedsAsync(getAppContext(), fromAssetsPath, toTargetPath, true); // }); } AST#builder_function_body#Right AST#method_declaration#Right
static async prepareDbIfNeedsByPath(protocol: DBPrepareProtocol, fromAssetsPath: string, toTargetPath: string) { checkDiskSpace(); const exists = FileUtility.isFileExistAt(toTargetPath); if (!exists) { await DbFileUtility.copyDatabaseFromAssetsIfNeeds(getAppContext(), fromAssetsPath, toTargetPath); return; } const isOpenable = await protocol.isDbOpenable(toTargetPath) if (!isOpenable) { FileUtility.deleteFileAt(toTargetPath); await DbFileUtility.copyDatabaseFromAssetsIfNeeds(getAppContext(), fromAssetsPath, toTargetPath); } ; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/dbUtils/DBPrepare.ets#L48-L82
ba3658d19ac658a6983cf2b1d3722966f613a6c7
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/Transformer.ets
arkts
rectValueToPixel
Transform a rectangle with all matrices. @param r
public rectValueToPixel(r: MyRect) { this.mMatrixValueToPx.mapRect(r); this.mViewPortHandler.getMatrixTouch().mapRect(r); this.mMatrixOffset.mapRect(r); }
AST#method_declaration#Left public rectValueToPixel AST#parameter_list#Left ( AST#parameter#Left r : AST#type_annotation#Left AST#primary_type#Left MyRect AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mMatrixValueToPx AST#member_expression#Right AST#expression#Right . mapRect AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left r AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mViewPortHandler AST#member_expression#Right AST#expression#Right . getMatrixTouch AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . mapRect AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left r AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mMatrixOffset AST#member_expression#Right AST#expression#Right . mapRect AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left r AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
public rectValueToPixel(r: MyRect) { this.mMatrixValueToPx.mapRect(r); this.mViewPortHandler.getMatrixTouch().mapRect(r); this.mMatrixOffset.mapRect(r); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/Transformer.ets#L289-L294
2e0239fcbb4fef12add2462e859e51e6d4968655
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/FavoritesService.ets
arkts
getAnalyticsData
获取统计分析数据
getAnalyticsData(): AnalyticsData { const now = new Date(); const thisMonth = now.getMonth(); const thisYear = now.getFullYear(); // 祝福语统计 const greetingHistory = this.generationHistory.filter(h => h.type === 'greeting'); const giftHistory = this.generationHistory.filter(h => h.type === 'gift'); const greetingFavorites = this.favorites.filter(f => f.type === 'greeting'); const giftFavorites = this.favorites.filter(f => f.type === 'gift'); // 祝福语风格分布 const styleDistribution: Record<GreetingStyle, number> = { [GreetingStyle.WARM]: 0, [GreetingStyle.FORMAL]: 0, [GreetingStyle.HUMOROUS]: 0, [GreetingStyle.POETIC]: 0, [GreetingStyle.SIMPLE]: 0 }; // 祝福语场合分布 const occasionDistribution: Record<GreetingOccasion, number> = { [GreetingOccasion.BIRTHDAY]: 0, [GreetingOccasion.ANNIVERSARY]: 0, [GreetingOccasion.HOLIDAY]: 0, [GreetingOccasion.NEW_YEAR]: 0, [GreetingOccasion.SPRING_FESTIVAL]: 0, [GreetingOccasion.VALENTINE]: 0, [GreetingOccasion.MOTHER_DAY]: 0, [GreetingOccasion.FATHER_DAY]: 0, [GreetingOccasion.CHRISTMAS]: 0, [GreetingOccasion.GRADUATION]: 0, [GreetingOccasion.WEDDING]: 0, [GreetingOccasion.OTHER]: 0, [GreetingOccasion.CUSTOM]: 0 }; // 礼物类型分布 const giftTypeDistribution: Record<GiftType, number> = { [GiftType.BOOK]: 0, [GiftType.ELECTRONICS]: 0, [GiftType.CLOTHING]: 0, [GiftType.JEWELRY]: 0, [GiftType.FLOWERS]: 0, [GiftType.FOOD]: 0, [GiftType.EXPERIENCE]: 0, [GiftType.HANDMADE]: 0, [GiftType.DIGITAL]: 0, [GiftType.OTHER]: 0 }; // 价格范围分布 const priceRangeDistribution: Record<PriceRange, number> = { [PriceRange.UNDER_50]: 0, [PriceRange.RANGE_50_100]: 0, [PriceRange.RANGE_100_300]: 0, [PriceRange.RANGE_300_500]: 0, [PriceRange.RANGE_500_1000]: 0, [PriceRange.OVER_1000]: 0 }; // 统计礼物分布 this.savedGifts.forEach(gift => { giftTypeDistribution[gift.type]++; priceRangeDistribution[gift.priceRange]++; }); // AI提供商分布 const providerDistribution: Record<AIProvider, number> = { [AIProvider.ZHIPU]: 0, [AIProvider.DEEPSEEK]: 0, [AIProvider.KIMI]: 0, [AIProvider.CUSTOM]: 0 }; // 计算总token和响应时间 let totalTokens = 0; let totalResponseTime = 0; let totalCalls = this.generationHistory.length; this.generationHistory.forEach(history => { totalTokens += history.tokensUsed; totalResponseTime += history.responseTime; }); // 计算评分 const ratedHistory = this.generationHistory.filter(h => h.rating !== undefined); const averageRating = ratedHistory.length > 0 ? ratedHistory.reduce((sum, h) => sum + (h.rating || 0), 0) / ratedHistory.length : 0; // 计算礼物适合度 const averageSuitability = this.savedGifts.length > 0 ? this.savedGifts.reduce((sum, g) => sum + g.suitability, 0) / this.savedGifts.length : 0; // 月度趋势(最近12个月) const monthlyTrend: MonthlyGreetingStats[] = []; for (let i = 11; i >= 0; i--) { const date = new Date(thisYear, thisMonth - i, 1); const monthKey = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}`; const monthHistory = this.generationHistory.filter(h => { const historyDate = new Date(h.createdAt); return historyDate.getFullYear() === date.getFullYear() && historyDate.getMonth() === date.getMonth(); }); monthlyTrend.push({ month: monthKey, generated: monthHistory.length, sent: monthHistory.filter(h => h.rating !== undefined).length }); } // 热门标签 const tagCounts: Record<string, number> = {}; this.favorites.forEach(f => { f.tags.forEach(tag => { tagCounts[tag] = (tagCounts[tag] || 0) + 1; }); }); const topTags: string[] = []; const entries = Object.entries(tagCounts); entries.sort((entryA, entryB) => entryB[1] - entryA[1]); for (let i = 0; i < Math.min(10, entries.length); i++) { topTags.push(entries[i][0]); } // 联系人分布 const contactDistribution: Record<string, number> = {}; this.favorites.forEach(f => { if (f.contactId) { contactDistribution[f.contactId] = (contactDistribution[f.contactId] || 0) + 1; } }); // 找出最常用的风格和场合 let mostUsedStyle = GreetingStyle.WARM; let maxStyleCount = 0; const styleEntries = Object.entries(styleDistribution); for (const entry of styleEntries) { if (entry[1] > maxStyleCount) { maxStyleCount = entry[1]; mostUsedStyle = entry[0] as GreetingStyle; } } let mostRecommendedType = GiftType.OTHER; let maxGiftCount = 0; const giftEntries = Object.entries(giftTypeDistribution); for (const entry of giftEntries) { if (entry[1] > maxGiftCount) { maxGiftCount = entry[1]; mostRecommendedType = entry[0] as GiftType; } } const analyticsData: AnalyticsData = { greetingStats: { totalGenerated: greetingHistory.length, totalFavorited: greetingFavorites.length, averageRating, mostUsedStyle, styleDistribution, occasionDistribution, monthlyTrend }, giftStats: { totalRecommended: giftHistory.length, totalSaved: this.savedGifts.length, averageSuitability, mostRecommendedType, typeDistribution: giftTypeDistribution, priceRangeDistribution }, modelUsage: { totalCalls, totalTokens, averageResponseTime: totalCalls > 0 ? totalResponseTime / totalCalls : 0, providerDistribution, costEstimate: this.estimateCost(totalTokens) }, favoriteAnalytics: { totalFavorites: this.favorites.length, greetingFavorites: greetingFavorites.length, giftFavorites: giftFavorites.length, topTags, contactDistribution } }; return analyticsData; }
AST#method_declaration#Left getAnalyticsData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AnalyticsData AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left now = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Date AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left thisMonth = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left now AST#expression#Right . getMonth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left thisYear = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left now AST#expression#Right . getFullYear AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 祝福语统计 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left greetingHistory = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . generationHistory AST#member_expression#Right AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left h => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left h AST#expression#Right . type AST#member_expression#Right AST#expression#Right === AST#expression#Left 'greeting' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left giftHistory = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . generationHistory AST#member_expression#Right AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left h => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left h AST#expression#Right . type AST#member_expression#Right AST#expression#Right === AST#expression#Left 'gift' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left greetingFavorites = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . favorites AST#member_expression#Right AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left f => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left f AST#expression#Right . type AST#member_expression#Right AST#expression#Right === AST#expression#Left 'greeting' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left giftFavorites = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . favorites AST#member_expression#Right AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left f => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left f AST#expression#Right . type AST#member_expression#Right AST#expression#Right === AST#expression#Left 'gift' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 祝福语风格分布 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left styleDistribution : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left GreetingStyle AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingStyle AST#expression#Right . WARM AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingStyle AST#expression#Right . FORMAL AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingStyle AST#expression#Right . HUMOROUS AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingStyle AST#expression#Right . POETIC AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingStyle AST#expression#Right . SIMPLE AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 祝福语场合分布 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left occasionDistribution : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left GreetingOccasion AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . BIRTHDAY AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . ANNIVERSARY AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . HOLIDAY AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . NEW_YEAR AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . SPRING_FESTIVAL AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . VALENTINE AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . MOTHER_DAY AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . FATHER_DAY AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . CHRISTMAS AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . GRADUATION AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . WEDDING AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . OTHER AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingOccasion AST#expression#Right . CUSTOM AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 礼物类型分布 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left giftTypeDistribution : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left GiftType AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . BOOK AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . ELECTRONICS AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . CLOTHING AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . JEWELRY AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . FLOWERS AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . FOOD AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . EXPERIENCE AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . HANDMADE AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . DIGITAL AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . OTHER AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 价格范围分布 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left priceRangeDistribution : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left PriceRange AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left PriceRange AST#expression#Right . UNDER_50 AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left PriceRange AST#expression#Right . RANGE_50_100 AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left PriceRange AST#expression#Right . RANGE_100_300 AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left PriceRange AST#expression#Right . RANGE_300_500 AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left PriceRange AST#expression#Right . RANGE_500_1000 AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left PriceRange AST#expression#Right . OVER_1000 AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 统计礼物分布 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . savedGifts AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left gift => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#update_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left giftTypeDistribution AST#expression#Right [ AST#expression#Left AST#member_expression#Left AST#expression#Left gift AST#expression#Right . type AST#member_expression#Right AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#update_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left priceRangeDistribution AST#expression#Right [ AST#expression#Left AST#member_expression#Left AST#expression#Left gift AST#expression#Right . priceRange AST#member_expression#Right AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // AI提供商分布 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left providerDistribution : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AIProvider AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left AIProvider AST#expression#Right . ZHIPU AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left AIProvider AST#expression#Right . DEEPSEEK AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left AIProvider AST#expression#Right . KIMI AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left AIProvider AST#expression#Right . CUSTOM AST#member_expression#Right AST#expression#Right ] AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 计算总token和响应时间 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left totalTokens = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left totalResponseTime = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left totalCalls = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . generationHistory AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . generationHistory AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left history => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left totalTokens += AST#expression#Left AST#member_expression#Left AST#expression#Left history AST#expression#Right . tokensUsed AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left totalResponseTime += AST#expression#Left AST#member_expression#Left AST#expression#Left history AST#expression#Right . responseTime AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 计算评分 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left ratedHistory = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . generationHistory AST#member_expression#Right AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left h => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left h AST#expression#Right . rating AST#member_expression#Right AST#expression#Right !== AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left averageRating = AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left ratedHistory AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left ratedHistory AST#expression#Right . reduce AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left sum AST#parameter#Right , AST#parameter#Left h AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#binary_expression#Left AST#expression#Left sum AST#expression#Right + AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left h AST#expression#Right . rating AST#member_expression#Right AST#expression#Right || AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right , AST#expression#Left 0 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right / AST#expression#Left ratedHistory AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right : AST#expression#Left 0 AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 计算礼物适合度 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left averageSuitability = AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . savedGifts AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . savedGifts AST#member_expression#Right AST#expression#Right . reduce AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left sum AST#parameter#Right , AST#parameter#Left g AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left sum AST#expression#Right + AST#expression#Left g AST#expression#Right AST#binary_expression#Right AST#expression#Right . suitability AST#member_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right , AST#expression#Left 0 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right / AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . savedGifts AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right : AST#expression#Left 0 AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 月度趋势(最近12个月) AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left monthlyTrend : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left MonthlyGreetingStats [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left i = AST#expression#Left 11 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right >= AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right -- AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left date = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Date AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left thisYear AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left thisMonth AST#expression#Right - AST#expression#Left i AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left 1 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left monthKey = AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left date AST#expression#Right . getFullYear AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right - AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left date AST#expression#Right . getMonth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right + AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . toString AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . padStart AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 2 AST#expression#Right , AST#expression#Left '0' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left monthHistory = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . generationHistory AST#member_expression#Right AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left h => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left historyDate = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Date AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left h AST#expression#Right . createdAt AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left historyDate AST#expression#Right . getFullYear AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right === AST#expression#Left date AST#expression#Right AST#binary_expression#Right AST#expression#Right . getFullYear AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right && AST#expression#Left historyDate AST#expression#Right AST#binary_expression#Right AST#expression#Right . getMonth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right === AST#expression#Left date AST#expression#Right AST#binary_expression#Right AST#expression#Right . getMonth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left monthlyTrend AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left month AST#property_name#Right : AST#expression#Left monthKey AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left generated AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left monthHistory AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left sent AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left monthHistory AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left h => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left h AST#expression#Right . rating AST#member_expression#Right AST#expression#Right !== AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right // 热门标签 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left tagCounts : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . favorites AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left f => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left f AST#expression#Right . tags AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left tag => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left tagCounts AST#expression#Right [ AST#expression#Left tag AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#ERROR#Left = AST#ERROR#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left tagCounts AST#expression#Right [ AST#expression#Left tag AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right || AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right + AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left topTags : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left entries = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Object AST#expression#Right . entries AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left tagCounts AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left entries AST#expression#Right . sort AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left entryA AST#parameter#Right , AST#parameter#Left entryB AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left entryB AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right - AST#expression#Left AST#subscript_expression#Left AST#expression#Left entryA AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left i = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right < AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right . min AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 10 AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left entries AST#expression#Right . length AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left topTags AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left entries AST#expression#Right [ AST#expression#Left i AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right [ AST#expression#Left 0 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right // 联系人分布 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left contactDistribution : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . favorites AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left f => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left f AST#expression#Right . contactId AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left contactDistribution AST#expression#Right [ AST#expression#Left AST#member_expression#Left AST#expression#Left f AST#expression#Right . contactId AST#member_expression#Right AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#ERROR#Left = AST#ERROR#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left contactDistribution AST#expression#Right [ AST#expression#Left AST#member_expression#Left AST#expression#Left f AST#expression#Right . contactId AST#member_expression#Right AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right || AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right + AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 找出最常用的风格和场合 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left mostUsedStyle = AST#expression#Left AST#member_expression#Left AST#expression#Left GreetingStyle AST#expression#Right . WARM AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left maxStyleCount = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left styleEntries = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Object AST#expression#Right . entries AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left styleDistribution AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( const entry of AST#expression#Left styleEntries AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left entry AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right > AST#expression#Left maxStyleCount AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left maxStyleCount = AST#expression#Left AST#subscript_expression#Left AST#expression#Left entry AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left mostUsedStyle = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left entry AST#expression#Right [ AST#expression#Left 0 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left GreetingStyle AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left mostRecommendedType = AST#expression#Left AST#member_expression#Left AST#expression#Left GiftType AST#expression#Right . OTHER AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left maxGiftCount = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left giftEntries = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Object AST#expression#Right . entries AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left giftTypeDistribution AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( const entry of AST#expression#Left giftEntries AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left entry AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right > AST#expression#Left maxGiftCount AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left maxGiftCount = AST#expression#Left AST#subscript_expression#Left AST#expression#Left entry AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left mostRecommendedType = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left entry AST#expression#Right [ AST#expression#Left 0 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left GiftType AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left analyticsData : AST#type_annotation#Left AST#primary_type#Left AnalyticsData AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left greetingStats AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left totalGenerated AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left greetingHistory AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left totalFavorited AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left greetingFavorites AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left averageRating AST#property_assignment#Right , AST#property_assignment#Left mostUsedStyle AST#property_assignment#Right , AST#property_assignment#Left styleDistribution AST#property_assignment#Right , AST#property_assignment#Left occasionDistribution AST#property_assignment#Right , AST#property_assignment#Left monthlyTrend AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left giftStats AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left totalRecommended AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left giftHistory AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left totalSaved AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . savedGifts AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left averageSuitability AST#property_assignment#Right , AST#property_assignment#Left mostRecommendedType AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left typeDistribution AST#property_name#Right : AST#expression#Left giftTypeDistribution AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left priceRangeDistribution AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left modelUsage AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left totalCalls AST#property_assignment#Right , AST#property_assignment#Left totalTokens AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left averageResponseTime AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left totalCalls AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right AST#ERROR#Left ? AST#expression#Left totalResponseTime AST#expression#Right / totalCalls : 0 AST#ERROR#Right , AST#property_assignment#Left providerDistribution AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left costEstimate AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . estimateCost AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left totalTokens AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left favoriteAnalytics AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left totalFavorites AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . favorites AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left greetingFavorites AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left greetingFavorites AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left giftFavorites AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left giftFavorites AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left topTags AST#property_assignment#Right , AST#property_assignment#Left contactDistribution AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left analyticsData AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
getAnalyticsData(): AnalyticsData { const now = new Date(); const thisMonth = now.getMonth(); const thisYear = now.getFullYear(); const greetingHistory = this.generationHistory.filter(h => h.type === 'greeting'); const giftHistory = this.generationHistory.filter(h => h.type === 'gift'); const greetingFavorites = this.favorites.filter(f => f.type === 'greeting'); const giftFavorites = this.favorites.filter(f => f.type === 'gift'); const styleDistribution: Record<GreetingStyle, number> = { [GreetingStyle.WARM]: 0, [GreetingStyle.FORMAL]: 0, [GreetingStyle.HUMOROUS]: 0, [GreetingStyle.POETIC]: 0, [GreetingStyle.SIMPLE]: 0 }; const occasionDistribution: Record<GreetingOccasion, number> = { [GreetingOccasion.BIRTHDAY]: 0, [GreetingOccasion.ANNIVERSARY]: 0, [GreetingOccasion.HOLIDAY]: 0, [GreetingOccasion.NEW_YEAR]: 0, [GreetingOccasion.SPRING_FESTIVAL]: 0, [GreetingOccasion.VALENTINE]: 0, [GreetingOccasion.MOTHER_DAY]: 0, [GreetingOccasion.FATHER_DAY]: 0, [GreetingOccasion.CHRISTMAS]: 0, [GreetingOccasion.GRADUATION]: 0, [GreetingOccasion.WEDDING]: 0, [GreetingOccasion.OTHER]: 0, [GreetingOccasion.CUSTOM]: 0 }; const giftTypeDistribution: Record<GiftType, number> = { [GiftType.BOOK]: 0, [GiftType.ELECTRONICS]: 0, [GiftType.CLOTHING]: 0, [GiftType.JEWELRY]: 0, [GiftType.FLOWERS]: 0, [GiftType.FOOD]: 0, [GiftType.EXPERIENCE]: 0, [GiftType.HANDMADE]: 0, [GiftType.DIGITAL]: 0, [GiftType.OTHER]: 0 }; const priceRangeDistribution: Record<PriceRange, number> = { [PriceRange.UNDER_50]: 0, [PriceRange.RANGE_50_100]: 0, [PriceRange.RANGE_100_300]: 0, [PriceRange.RANGE_300_500]: 0, [PriceRange.RANGE_500_1000]: 0, [PriceRange.OVER_1000]: 0 }; this.savedGifts.forEach(gift => { giftTypeDistribution[gift.type]++; priceRangeDistribution[gift.priceRange]++; }); const providerDistribution: Record<AIProvider, number> = { [AIProvider.ZHIPU]: 0, [AIProvider.DEEPSEEK]: 0, [AIProvider.KIMI]: 0, [AIProvider.CUSTOM]: 0 }; let totalTokens = 0; let totalResponseTime = 0; let totalCalls = this.generationHistory.length; this.generationHistory.forEach(history => { totalTokens += history.tokensUsed; totalResponseTime += history.responseTime; }); const ratedHistory = this.generationHistory.filter(h => h.rating !== undefined); const averageRating = ratedHistory.length > 0 ? ratedHistory.reduce((sum, h) => sum + (h.rating || 0), 0) / ratedHistory.length : 0; const averageSuitability = this.savedGifts.length > 0 ? this.savedGifts.reduce((sum, g) => sum + g.suitability, 0) / this.savedGifts.length : 0; const monthlyTrend: MonthlyGreetingStats[] = []; for (let i = 11; i >= 0; i--) { const date = new Date(thisYear, thisMonth - i, 1); const monthKey = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}`; const monthHistory = this.generationHistory.filter(h => { const historyDate = new Date(h.createdAt); return historyDate.getFullYear() === date.getFullYear() && historyDate.getMonth() === date.getMonth(); }); monthlyTrend.push({ month: monthKey, generated: monthHistory.length, sent: monthHistory.filter(h => h.rating !== undefined).length }); } const tagCounts: Record<string, number> = {}; this.favorites.forEach(f => { f.tags.forEach(tag => { tagCounts[tag] = (tagCounts[tag] || 0) + 1; }); }); const topTags: string[] = []; const entries = Object.entries(tagCounts); entries.sort((entryA, entryB) => entryB[1] - entryA[1]); for (let i = 0; i < Math.min(10, entries.length); i++) { topTags.push(entries[i][0]); } const contactDistribution: Record<string, number> = {}; this.favorites.forEach(f => { if (f.contactId) { contactDistribution[f.contactId] = (contactDistribution[f.contactId] || 0) + 1; } }); let mostUsedStyle = GreetingStyle.WARM; let maxStyleCount = 0; const styleEntries = Object.entries(styleDistribution); for (const entry of styleEntries) { if (entry[1] > maxStyleCount) { maxStyleCount = entry[1]; mostUsedStyle = entry[0] as GreetingStyle; } } let mostRecommendedType = GiftType.OTHER; let maxGiftCount = 0; const giftEntries = Object.entries(giftTypeDistribution); for (const entry of giftEntries) { if (entry[1] > maxGiftCount) { maxGiftCount = entry[1]; mostRecommendedType = entry[0] as GiftType; } } const analyticsData: AnalyticsData = { greetingStats: { totalGenerated: greetingHistory.length, totalFavorited: greetingFavorites.length, averageRating, mostUsedStyle, styleDistribution, occasionDistribution, monthlyTrend }, giftStats: { totalRecommended: giftHistory.length, totalSaved: this.savedGifts.length, averageSuitability, mostRecommendedType, typeDistribution: giftTypeDistribution, priceRangeDistribution }, modelUsage: { totalCalls, totalTokens, averageResponseTime: totalCalls > 0 ? totalResponseTime / totalCalls : 0, providerDistribution, costEstimate: this.estimateCost(totalTokens) }, favoriteAnalytics: { totalFavorites: this.favorites.length, greetingFavorites: greetingFavorites.length, giftFavorites: giftFavorites.length, topTags, contactDistribution } }; return analyticsData; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/FavoritesService.ets#L229-L423
f0cbf692e062f2174cfa2e7cfa89c7144208b826
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Distributed/DistributeDraw/entry/src/main/ets/viewmodel/KvStoreModel.ets
arkts
createKvStore
Create a distributed key-value database. @param context Ability context. @param callback Callback.
createKvStore( context: common.UIAbilityContext, callback: (data: distributedKVStore.ChangeNotification) => void ): void { if (this.kvStore !== undefined) { Logger.info('KvStoreModel', 'createKvStore KVManager is exist'); return; } let config: distributedKVStore.KVManagerConfig = { bundleName: context.abilityInfo.bundleName, context: context }; try { this.kvManager = distributedKVStore.createKVManager(config); } catch (error) { Logger.error('KvStoreModel', `createKvStore createKVManager failed, err=${JSON.stringify(error)}`); return; } let options: distributedKVStore.Options = { createIfMissing: true, encrypt: false, backup: false, autoSync: true, kvStoreType: distributedKVStore.KVStoreType.SINGLE_VERSION, securityLevel: distributedKVStore.SecurityLevel.S1 }; this.kvManager.getKVStore(CommonConstants.KVSTORE_ID, options).then((store: distributedKVStore.SingleKVStore) => { if (store === null) { Logger.error('KvStoreModel', `createKvStore getKVStore store is null`); return; } this.kvStore = store; this.kvStore.enableSync(true).then(() => { Logger.info('KvStoreModel', 'createKvStore enableSync success'); }).catch((error: Error) => { Logger.error('KvStoreModel', `createKvStore enableSync fail, error=${JSON.stringify(error)}`); }); this.setDataChangeListener(callback); }).catch((error: Error) => { Logger.error('getKVStore', `createKvStore getKVStore failed, error=${JSON.stringify(error)}`); }) }
AST#method_declaration#Left createKvStore AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left distributedKVStore . ChangeNotification AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . kvStore AST#member_expression#Right AST#expression#Right !== AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'KvStoreModel' AST#expression#Right , AST#expression#Left 'createKvStore KVManager is exist' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left config : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left distributedKVStore . KVManagerConfig AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left bundleName AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left context AST#expression#Right . abilityInfo AST#member_expression#Right AST#expression#Right . bundleName AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left context AST#property_name#Right : AST#expression#Left context AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . kvManager AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left distributedKVStore AST#expression#Right . createKVManager AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left config AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'KvStoreModel' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` createKvStore createKVManager failed, err= AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left options : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left distributedKVStore . Options AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left createIfMissing AST#property_name#Right : AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left encrypt AST#property_name#Right : AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left backup AST#property_name#Right : AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left autoSync AST#property_name#Right : AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left kvStoreType AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left distributedKVStore AST#expression#Right . KVStoreType AST#member_expression#Right AST#expression#Right . SINGLE_VERSION AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left securityLevel AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left distributedKVStore AST#expression#Right . SecurityLevel AST#member_expression#Right AST#expression#Right . S1 AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . kvManager AST#member_expression#Right AST#expression#Right . getKVStore AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CommonConstants AST#expression#Right . KVSTORE_ID AST#member_expression#Right AST#expression#Right , AST#expression#Left options AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . then AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left store : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left distributedKVStore . SingleKVStore AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left store AST#expression#Right === AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'KvStoreModel' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` createKvStore getKVStore store is null ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . kvStore AST#member_expression#Right = AST#expression#Left store AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . kvStore AST#member_expression#Right AST#expression#Right . enableSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . then AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'KvStoreModel' AST#expression#Right , AST#expression#Left 'createKvStore enableSync success' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . catch AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left error : AST#type_annotation#Left AST#primary_type#Left Error AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'KvStoreModel' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` createKvStore enableSync fail, error= AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . setDataChangeListener AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left callback AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . catch AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left error : AST#type_annotation#Left AST#primary_type#Left Error AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'getKVStore' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` createKvStore getKVStore failed, error= AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
createKvStore( context: common.UIAbilityContext, callback: (data: distributedKVStore.ChangeNotification) => void ): void { if (this.kvStore !== undefined) { Logger.info('KvStoreModel', 'createKvStore KVManager is exist'); return; } let config: distributedKVStore.KVManagerConfig = { bundleName: context.abilityInfo.bundleName, context: context }; try { this.kvManager = distributedKVStore.createKVManager(config); } catch (error) { Logger.error('KvStoreModel', `createKvStore createKVManager failed, err=${JSON.stringify(error)}`); return; } let options: distributedKVStore.Options = { createIfMissing: true, encrypt: false, backup: false, autoSync: true, kvStoreType: distributedKVStore.KVStoreType.SINGLE_VERSION, securityLevel: distributedKVStore.SecurityLevel.S1 }; this.kvManager.getKVStore(CommonConstants.KVSTORE_ID, options).then((store: distributedKVStore.SingleKVStore) => { if (store === null) { Logger.error('KvStoreModel', `createKvStore getKVStore store is null`); return; } this.kvStore = store; this.kvStore.enableSync(true).then(() => { Logger.info('KvStoreModel', 'createKvStore enableSync success'); }).catch((error: Error) => { Logger.error('KvStoreModel', `createKvStore enableSync fail, error=${JSON.stringify(error)}`); }); this.setDataChangeListener(callback); }).catch((error: Error) => { Logger.error('getKVStore', `createKvStore getKVStore failed, error=${JSON.stringify(error)}`); }) }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Distributed/DistributeDraw/entry/src/main/ets/viewmodel/KvStoreModel.ets#L31-L78
5eeb02f8370473d35b21a451300ff80346e87f2b
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ColorTemplate.ets
arkts
green
from Color green() @param color
public static green(color: number): number { return (color >> 8) & 0xff; }
AST#method_declaration#Left public static green AST#parameter_list#Left ( AST#parameter#Left color : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left color AST#expression#Right >> AST#expression#Left 8 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right & AST#expression#Left 0xff AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public static green(color: number): number { return (color >> 8) & 0xff; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ColorTemplate.ets#L276-L278
3486d887d38d0d7a5b53436deda743edb2efdcd8
gitee
azhuge233/ASFShortcut-HN.git
d1669c920c56317611b5b0375aa5315c1b91211b
entry/src/main/ets/common/utils/DB.ets
arkts
clearTableSettings
debug 方法
async clearTableSettings() { await this.clearTable(this.TN_HostInfo); }
AST#method_declaration#Left async clearTableSettings AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . clearTable AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . TN_HostInfo AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
async clearTableSettings() { await this.clearTable(this.TN_HostInfo); }
https://github.com/azhuge233/ASFShortcut-HN.git/blob/d1669c920c56317611b5b0375aa5315c1b91211b/entry/src/main/ets/common/utils/DB.ets#L202-L204
fb786b16309649700311fc9ddc093e1303c611a7
github
waylau/harmonyos-tutorial
74e23dfa769317f8f057cc77c2d09f0b1f2e0773
samples/ArkTSVideoPlayer/entry/src/main/ets/viewmodel/HomeVideoListModel.ets
arkts
setInternetVideo
Scan the internet video. @param name Video Name. @param pixelMap pixelMap object. @param src Playback Path. @param duration Video duration. @return Network video list data.
async setInternetVideo(name: string, src: string, pixelMap?: image.PixelMap) { this.videoInternetList.push(new VideoBean(name, src, pixelMap)); globalThis.videoInternetList = this.videoInternetList; return globalThis.videoInternetList; }
AST#method_declaration#Left async setInternetVideo AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pixelMap ? : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . PixelMap AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . videoInternetList AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left VideoBean AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left name AST#expression#Right , AST#expression#Left src AST#expression#Right , AST#expression#Left pixelMap AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left globalThis AST#expression#Right . videoInternetList AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . videoInternetList AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left return AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left globalThis AST#expression#Right . videoInternetList AST#member_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
async setInternetVideo(name: string, src: string, pixelMap?: image.PixelMap) { this.videoInternetList.push(new VideoBean(name, src, pixelMap)); globalThis.videoInternetList = this.videoInternetList; return globalThis.videoInternetList; }
https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkTSVideoPlayer/entry/src/main/ets/viewmodel/HomeVideoListModel.ets#L42-L46
49ed11d8a6332772fdeaaf42f11848ba5458975f
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/widgets/pages/WidgetCard2x2.ets
arkts
formatUpdateTime
格式化更新时间
private formatUpdateTime(): string { const updateTime = this.widgetData.updateTime || ''; if (!updateTime) return ''; // 只显示时分 const timeParts = updateTime.split(':'); if (timeParts.length >= 2) { return `${timeParts[0]}:${timeParts[1]}`; } return updateTime; }
AST#method_declaration#Left private formatUpdateTime AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left updateTime = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . widgetData AST#member_expression#Right AST#expression#Right . updateTime AST#member_expression#Right AST#expression#Right || AST#expression#Left '' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left updateTime AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return AST#expression#Left '' AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right // 只显示时分 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left timeParts = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left updateTime AST#expression#Right . split AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left ':' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left timeParts AST#expression#Right . length AST#member_expression#Right AST#expression#Right >= AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#subscript_expression#Left AST#expression#Left timeParts AST#expression#Right [ AST#expression#Left 0 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right } AST#template_substitution#Right : AST#template_substitution#Left $ { AST#expression#Left AST#subscript_expression#Left AST#expression#Left timeParts AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left updateTime AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private formatUpdateTime(): string { const updateTime = this.widgetData.updateTime || ''; if (!updateTime) return ''; const timeParts = updateTime.split(':'); if (timeParts.length >= 2) { return `${timeParts[0]}:${timeParts[1]}`; } return updateTime; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/widgets/pages/WidgetCard2x2.ets#L186-L197
96e71e52f95d8bb5a6b72ffeb08383e8a758ae2e
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/StrUtil.ets
arkts
isNull
判断字符串是否为空(undefined、null) @param str 被检测的字符串 @returns 是否为空
static isNull(str: string | number | undefined | null): boolean { return str === undefined || str === null; }
AST#method_declaration#Left static isNull AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left str AST#expression#Right === AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left AST#binary_expression#Left AST#expression#Left str AST#expression#Right === AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static isNull(str: string | number | undefined | null): boolean { return str === undefined || str === null; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/StrUtil.ets#L35-L37
313533912d634fdab12b0a260419659b49098642
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/settings/LanguageSettingsPage.ets
arkts
buildAdvancedSettings
构建高级设置
@Builder buildAdvancedSettings() { Column({ space: 16 }) { Text('高级设置') .fontSize(16) .fontColor($r('app.color.text_primary')) .fontWeight(FontWeight.Medium) .width('100%') Column({ space: 0 }) { // 自动检测系统语言 this.buildSettingItem( '自动检测系统语言', '跟随系统语言设置自动切换', this.config.autoDetect, (value: boolean) => { this.updateAutoDetect(value); } ) Divider().color($r('app.color.divider')).strokeWidth(0.5) // 使用系统区域设置 this.buildSettingItem( '使用系统区域设置', '日期和时间格式跟随系统区域', this.config.useSystemLocale, (value: boolean) => { this.updateUseSystemLocale(value); } ) Divider().color($r('app.color.divider')).strokeWidth(0.5) // 回退语言设置 this.buildFallbackLanguageItem() } .width('100%') .backgroundColor(Color.White) .borderRadius(12) } .width('100%') }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildAdvancedSettings AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 16 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left '高级设置' AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 16 AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.text_primary' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left AST#member_expression#Left AST#expression#Left FontWeight AST#expression#Right . Medium AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 0 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { // 自动检测系统语言 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . buildSettingItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '自动检测系统语言' AST#expression#Right , AST#expression#Left '跟随系统语言设置自动切换' AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . config AST#member_expression#Right AST#expression#Right . autoDetect AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . updateAutoDetect AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Divider ( ) AST#ui_component#Right AST#modifier_chain_expression#Left . color ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.divider' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . strokeWidth ( AST#expression#Left 0.5 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 使用系统区域设置 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . buildSettingItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '使用系统区域设置' AST#expression#Right , AST#expression#Left '日期和时间格式跟随系统区域' AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . config AST#member_expression#Right AST#expression#Right . useSystemLocale AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . updateUseSystemLocale AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Divider ( ) AST#ui_component#Right AST#modifier_chain_expression#Left . color ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.divider' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . strokeWidth ( AST#expression#Left 0.5 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 回退语言设置 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . buildFallbackLanguageItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder buildAdvancedSettings() { Column({ space: 16 }) { Text('高级设置') .fontSize(16) .fontColor($r('app.color.text_primary')) .fontWeight(FontWeight.Medium) .width('100%') Column({ space: 0 }) { this.buildSettingItem( '自动检测系统语言', '跟随系统语言设置自动切换', this.config.autoDetect, (value: boolean) => { this.updateAutoDetect(value); } ) Divider().color($r('app.color.divider')).strokeWidth(0.5) this.buildSettingItem( '使用系统区域设置', '日期和时间格式跟随系统区域', this.config.useSystemLocale, (value: boolean) => { this.updateUseSystemLocale(value); } ) Divider().color($r('app.color.divider')).strokeWidth(0.5) this.buildFallbackLanguageItem() } .width('100%') .backgroundColor(Color.White) .borderRadius(12) } .width('100%') }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LanguageSettingsPage.ets#L412-L454
48d6ee958984768b8eab4a6912315ad423b1d899
github
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/api/@ohos.arkui.advanced.Chip.d.ets
arkts
Enum for ChipSize @enum { string } @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @since 11 Enum for ChipSize @enum { string } @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 12
export declare enum ChipSize { /** * Normal type. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Normal type. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ NORMAL = "NORMAL", /** * Small type. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Small type. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ SMALL = "SMALL" }
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ChipSize AST#enum_body#Left { /** * Normal type. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Normal type. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ AST#enum_member#Left NORMAL = AST#expression#Left "NORMAL" AST#expression#Right AST#enum_member#Right , /** * Small type. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Small type. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ AST#enum_member#Left SMALL = AST#expression#Left "SMALL" AST#expression#Right AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
export declare enum ChipSize { NORMAL = "NORMAL", SMALL = "SMALL" }
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.Chip.d.ets#L37-L70
385e71903b04db01bc39626214a4c7fa70cce91c
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PreferencesUtil.ets
arkts
getPreferencesSync
获取Preferences实例 @param name @returns
private static getPreferencesSync(preferenceName: string = PreferencesUtil.defaultPreferenceName): preferences.Preferences { if (preferenceName !== PreferencesUtil.defaultPreferenceName) { return dataPreferences.getPreferencesSync(AppUtil.getContext(), { name: preferenceName }); } else if (!PreferencesUtil.preferences) { PreferencesUtil.preferences = dataPreferences.getPreferencesSync(AppUtil.getContext(), { name: preferenceName }); } return PreferencesUtil.preferences; }
AST#method_declaration#Left private static getPreferencesSync AST#parameter_list#Left ( AST#parameter#Left preferenceName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left PreferencesUtil AST#expression#Right . defaultPreferenceName AST#member_expression#Right AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left preferences . Preferences AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left preferenceName AST#expression#Right !== AST#expression#Left PreferencesUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultPreferenceName AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dataPreferences AST#expression#Right . getPreferencesSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AppUtil AST#expression#Right . getContext AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left preferenceName AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left PreferencesUtil AST#expression#Right AST#unary_expression#Right AST#expression#Right . preferences AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left PreferencesUtil AST#expression#Right . preferences AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dataPreferences AST#expression#Right . getPreferencesSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AppUtil AST#expression#Right . getContext AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left preferenceName AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left PreferencesUtil AST#expression#Right . preferences AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private static getPreferencesSync(preferenceName: string = PreferencesUtil.defaultPreferenceName): preferences.Preferences { if (preferenceName !== PreferencesUtil.defaultPreferenceName) { return dataPreferences.getPreferencesSync(AppUtil.getContext(), { name: preferenceName }); } else if (!PreferencesUtil.preferences) { PreferencesUtil.preferences = dataPreferences.getPreferencesSync(AppUtil.getContext(), { name: preferenceName }); } return PreferencesUtil.preferences; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PreferencesUtil.ets#L50-L57
9e13df1108241a91f255987096f9d076784e6f3c
gitee
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/util/EmitterUtil.ets
arkts
Emitter消息数据结构
export interface EmitterMsgData { type: string; enable?:boolean; data?: Object; }
AST#export_declaration#Left export AST#interface_declaration#Left interface EmitterMsgData AST#object_type#Left { AST#type_member#Left type : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left enable ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left data ? : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface EmitterMsgData { type: string; enable?:boolean; data?: Object; }
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/util/EmitterUtil.ets#L8-L12
afa0c7a9af35e4546521c16f6f77d3999302485f
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/login/LoginView.ets
arkts
login
登录方法
private login(): void { if (!StringUtils.isValidEmail(this.email)) { Toast.showMessage($r('app.string.login_msg_invalid_email')) return; } if (this.password === '') { Toast.showMessage($r('app.string.login_msg_need_pwd')) return; } if (!this.checkAggree()) { return; } //email登录 UserManager.shared.login(this.email, this.password, (succeed: boolean, msg:string |null)=>{ this.handleLoginCompletion(succeed, msg); }) }
AST#method_declaration#Left private login AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left StringUtils AST#expression#Right AST#unary_expression#Right AST#expression#Right . isValidEmail AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . email AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Toast AST#expression#Right . showMessage AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.login_msg_invalid_email' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . password AST#member_expression#Right AST#expression#Right === AST#expression#Left '' AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Toast AST#expression#Right . showMessage AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.login_msg_need_pwd' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right . checkAggree AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right //email登录 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left UserManager AST#expression#Right . shared AST#member_expression#Right AST#expression#Right . login AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . email AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . password AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left succeed : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left msg : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . handleLoginCompletion AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left succeed AST#expression#Right , AST#expression#Left msg AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private login(): void { if (!StringUtils.isValidEmail(this.email)) { Toast.showMessage($r('app.string.login_msg_invalid_email')) return; } if (this.password === '') { Toast.showMessage($r('app.string.login_msg_need_pwd')) return; } if (!this.checkAggree()) { return; } UserManager.shared.login(this.email, this.password, (succeed: boolean, msg:string |null)=>{ this.handleLoginCompletion(succeed, msg); }) }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/login/LoginView.ets#L260-L281
89c218452ee7920c329ea0f296c0d108dab63114
github
kaina404/HarmonyStock.git
99233a46fb0dfb21e02294c730fd80e2fb404f9b
entry/src/main/ets/pages/component/MinuteLineComponent.ets
arkts
drawMinuteLine
绘制分时线
drawMinuteLine() { this.context.strokeStyle = '#364d92' this.context.lineWidth = 0.8600009 this.context.beginPath() let itemCount = Math.max(this.stockData.line.length, 240) let itemDistance = this.minuteRect.width / itemCount let path = new Path2D() this.stockData.line.forEach((value, index) => { if (index >= itemCount) { return } let x = this.minuteRect.startX + index * itemDistance value.lineX = x let y = this.minuteRect.height / 2 - (value.price - this.stockData.prev_close) / this.stockData.maxDistancePrice * (this.minuteRect.height / 2) + this.minuteRect.startY if (index == 0) { path.moveTo(x, y) } else { path.lineTo(x, y) } }) this.context.stroke(path) }
AST#method_declaration#Left drawMinuteLine AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right . strokeStyle AST#member_expression#Right = AST#expression#Left '#364d92' AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right . lineWidth AST#member_expression#Right = AST#expression#Left 0.8600009 AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right . beginPath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left let AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left itemCount = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Math AST#expression#Right . max AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . stockData AST#member_expression#Right AST#expression#Right . line AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right , AST#expression#Left 240 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left let AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left itemDistance = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . minuteRect AST#member_expression#Right AST#expression#Right . width AST#member_expression#Right AST#expression#Right / AST#expression#Left itemCount AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left let AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left path = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Path2D AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . stockData AST#member_expression#Right AST#expression#Right . line AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left value AST#parameter#Right , AST#parameter#Left index AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right >= AST#expression#Left itemCount AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#object_literal#Left { AST#ERROR#Left return AST#ERROR#Right } AST#object_literal#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left x = AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . minuteRect AST#member_expression#Right AST#expression#Right . startX AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right * AST#expression#Left itemDistance AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#ERROR#Left value AST#ERROR#Right . lineX AST#member_expression#Right = AST#expression#Left x AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left y = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . minuteRect AST#member_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left value AST#expression#Right . price AST#member_expression#Right AST#expression#Right - AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . stockData AST#member_expression#Right AST#expression#Right . prev_close AST#member_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . stockData AST#member_expression#Right AST#expression#Right . maxDistancePrice AST#member_expression#Right AST#expression#Right * AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . minuteRect AST#member_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right / AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . minuteRect AST#member_expression#Right AST#expression#Right . startY AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right == AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left path AST#expression#Right . moveTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left x AST#expression#Right , AST#expression#Left y AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left path AST#expression#Right . lineTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left x AST#expression#Right , AST#expression#Left y AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right . stroke AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left path AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
drawMinuteLine() { this.context.strokeStyle = '#364d92' this.context.lineWidth = 0.8600009 this.context.beginPath() let itemCount = Math.max(this.stockData.line.length, 240) let itemDistance = this.minuteRect.width / itemCount let path = new Path2D() this.stockData.line.forEach((value, index) => { if (index >= itemCount) { return } let x = this.minuteRect.startX + index * itemDistance value.lineX = x let y = this.minuteRect.height / 2 - (value.price - this.stockData.prev_close) / this.stockData.maxDistancePrice * (this.minuteRect.height / 2) + this.minuteRect.startY if (index == 0) { path.moveTo(x, y) } else { path.lineTo(x, y) } }) this.context.stroke(path) }
https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/pages/component/MinuteLineComponent.ets#L307-L329
375f76bb94f302bfbff82541a697f173e0527a56
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets
arkts
@file 购物车本地数据源实现 @author Joker.X
export class CartLocalDataSourceImpl implements CartLocalDataSource { /** * 迁移标记,防止重复执行 migrate */ private static migrated: boolean = false; /** * ORM 实例,用于执行数据库操作 */ private orm = getORM(); /** * 构造函数,初始化 ORM 并确保购物车表已迁移 * @returns {CartLocalDataSourceImpl} 实例 */ constructor() { this.ensureMigrated(); } /** * 确保购物车表完成迁移 * @returns {void} 无返回 */ private ensureMigrated(): void { if (!CartLocalDataSourceImpl.migrated) { this.orm.migrate(CartEntity); CartLocalDataSourceImpl.migrated = true; } } /** * 添加商品到购物车 * @param {Cart} cart 购物车商品 * @returns {Promise<void>} Promise<void> */ async addToCart(cart: Cart): Promise<void> { this.orm.insert(this.toEntity(cart)); } /** * 更新购物车中的商品 * @param {Cart} cart 购物车商品 * @returns {Promise<void>} Promise<void> */ async updateCart(cart: Cart): Promise<void> { this.orm.save(this.toEntity(cart)); } /** * 更新购物车中商品的规格数量 * @param {number} goodsId 商品ID * @param {number} specId 规格ID * @param {number} count 规格数量 * @returns {Promise<void>} Promise<void> */ async updateCartSpecCount(goodsId: number, specId: number, count: number): Promise<void> { const entity: CartEntity | undefined = this.findEntityByGoodsId(goodsId); if (!entity) { return; } const specs: CartGoodsSpec[] = this.parseSpecs(entity.specJson); const updatedSpecs: CartGoodsSpec[] = specs.map((spec) => { const next = new CartGoodsSpec(spec); if (next.id === specId) { next.count = count; } return next; }); if (updatedSpecs.length === 0 || updatedSpecs.every((item) => item.count <= 0)) { this.orm.deleteById(CartEntity, goodsId); return; } entity.specJson = JSON.stringify(updatedSpecs); this.orm.save(entity); } /** * 从购物车删除商品 * @param {number} goodsId 商品ID * @returns {Promise<void>} Promise<void> */ async removeFromCart(goodsId: number): Promise<void> { this.orm.deleteById(CartEntity, goodsId); } /** * 从购物车删除商品规格 * @param {number} goodsId 商品ID * @param {number} specId 规格ID * @returns {Promise<void>} Promise<void> */ async removeSpecFromCart(goodsId: number, specId: number): Promise<void> { const entity: CartEntity | undefined = this.findEntityByGoodsId(goodsId); if (!entity) { return; } const specs: CartGoodsSpec[] = this.parseSpecs(entity.specJson).filter((spec) => spec.id !== specId); if (specs.length === 0) { this.orm.deleteById(CartEntity, goodsId); return; } entity.specJson = JSON.stringify(specs); this.orm.save(entity); } /** * 清空购物车 * @returns {Promise<void>} Promise<void> */ async clearCart(): Promise<void> { this.orm.query(CartEntity).delete(); } /** * 获取购物车中所有商品 * @returns {Promise<Cart[]>} 购物车列表 */ async getAllCarts(): Promise<Cart[]> { const list: CartEntity[] = this.orm.query(CartEntity).find(); return list.map((entity) => this.toModel(entity)); } /** * 获取购物车商品总数量 * @returns {Promise<number>} 商品总数 */ async getCartCount(): Promise<number> { return this.orm.query(CartEntity).find().length; } /** * 根据商品ID获取购物车商品 * @param {number} goodsId 商品ID * @returns {Promise<Cart | undefined>} 匹配到的购物车商品 */ async getCartByGoodsId(goodsId: number): Promise<Cart | undefined> { const entity: CartEntity | undefined = this.findEntityByGoodsId(goodsId); return entity ? this.toModel(entity) : undefined; } /** * 根据商品ID查询实体 * @param {number} goodsId 商品ID * @returns {CartEntity | undefined} 匹配实体 */ private findEntityByGoodsId(goodsId: number): CartEntity | undefined { const result: CartEntity[] = this.orm.query(CartEntity).where("goodsId", goodsId).find(); return result[0]; } /** * 将领域模型转换为数据库实体 * @param {Cart} cart 购物车领域模型 * @returns {CartEntity} 数据库实体 */ private toEntity(cart: Cart): CartEntity { const entity: CartEntity = new CartEntity(); entity.goodsId = cart.goodsId; entity.goodsName = cart.goodsName; entity.goodsMainPic = cart.goodsMainPic; entity.specJson = JSON.stringify(cart.spec ?? []); return entity; } /** * 将数据库实体转换为领域模型 * @param {CartEntity} entity 数据库实体 * @returns {Cart} 领域模型 */ private toModel(entity: CartEntity): Cart { const cart: Cart = new Cart(); cart.goodsId = entity.goodsId ?? 0; cart.goodsName = entity.goodsName ?? ""; cart.goodsMainPic = entity.goodsMainPic ?? ""; cart.spec = this.parseSpecs(entity.specJson); return cart; } /** * 解析规格 JSON 字符串为规格列表 * @param {string | undefined} specJson 规格 JSON * @returns {CartGoodsSpec[]} 规格列表 */ private parseSpecs(specJson?: string): CartGoodsSpec[] { if (!specJson) { return []; } try { const raw: CartGoodsSpec[] | undefined = JSON.parse(specJson) as CartGoodsSpec[]; if (Array.isArray(raw)) { return raw.map((item: CartGoodsSpec) => new CartGoodsSpec(item as Partial<CartGoodsSpec>)); } return []; } catch (error) { return []; } } }
AST#export_declaration#Left export AST#class_declaration#Left class CartLocalDataSourceImpl AST#implements_clause#Left implements CartLocalDataSource AST#implements_clause#Right AST#class_body#Left { /** * 迁移标记,防止重复执行 migrate */ AST#property_declaration#Left private static migrated : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#property_declaration#Right /** * ORM 实例,用于执行数据库操作 */ AST#property_declaration#Left private orm = AST#expression#Left AST#call_expression#Left AST#expression#Left getORM AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right /** * 构造函数,初始化 ORM 并确保购物车表已迁移 * @returns {CartLocalDataSourceImpl} 实例 */ AST#constructor_declaration#Left constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ensureMigrated AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right /** * 确保购物车表完成迁移 * @returns {void} 无返回 */ AST#method_declaration#Left private ensureMigrated AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left CartLocalDataSourceImpl AST#expression#Right AST#unary_expression#Right AST#expression#Right . migrated AST#member_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . migrate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left CartEntity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left CartLocalDataSourceImpl AST#expression#Right . migrated AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 添加商品到购物车 * @param {Cart} cart 购物车商品 * @returns {Promise<void>} Promise<void> */ AST#method_declaration#Left async addToCart AST#parameter_list#Left ( AST#parameter#Left cart : AST#type_annotation#Left AST#primary_type#Left Cart AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . insert AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . toEntity AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left cart AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 更新购物车中的商品 * @param {Cart} cart 购物车商品 * @returns {Promise<void>} Promise<void> */ AST#method_declaration#Left async updateCart AST#parameter_list#Left ( AST#parameter#Left cart : AST#type_annotation#Left AST#primary_type#Left Cart AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . save AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . toEntity AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left cart AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 更新购物车中商品的规格数量 * @param {number} goodsId 商品ID * @param {number} specId 规格ID * @param {number} count 规格数量 * @returns {Promise<void>} Promise<void> */ AST#method_declaration#Left async updateCartSpecCount AST#parameter_list#Left ( AST#parameter#Left goodsId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left specId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left count : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left entity : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left CartEntity AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . findEntityByGoodsId AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left goodsId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left entity AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left specs : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CartGoodsSpec [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . parseSpecs AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . specJson AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left updatedSpecs : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CartGoodsSpec [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left specs AST#expression#Right . map AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left spec AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left next = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left CartGoodsSpec AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left spec AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left next AST#expression#Right . id AST#member_expression#Right AST#expression#Right === AST#expression#Left specId AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left next AST#expression#Right . count AST#member_expression#Right = AST#expression#Left count AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left next AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left updatedSpecs AST#expression#Right . length AST#member_expression#Right AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left updatedSpecs AST#expression#Right AST#binary_expression#Right AST#expression#Right . every AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left item AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left item AST#expression#Right . count AST#member_expression#Right AST#expression#Right <= AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . deleteById AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left CartEntity AST#expression#Right , AST#expression#Left goodsId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . specJson AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left updatedSpecs AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . save AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left entity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 从购物车删除商品 * @param {number} goodsId 商品ID * @returns {Promise<void>} Promise<void> */ AST#method_declaration#Left async removeFromCart AST#parameter_list#Left ( AST#parameter#Left goodsId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . deleteById AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left CartEntity AST#expression#Right , AST#expression#Left goodsId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 从购物车删除商品规格 * @param {number} goodsId 商品ID * @param {number} specId 规格ID * @returns {Promise<void>} Promise<void> */ AST#method_declaration#Left async removeSpecFromCart AST#parameter_list#Left ( AST#parameter#Left goodsId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left specId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left entity : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left CartEntity AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . findEntityByGoodsId AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left goodsId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left entity AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left specs : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CartGoodsSpec [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . parseSpecs AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . specJson AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left spec AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left spec AST#expression#Right . id AST#member_expression#Right AST#expression#Right !== AST#expression#Left specId AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left specs AST#expression#Right . length AST#member_expression#Right AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . deleteById AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left CartEntity AST#expression#Right , AST#expression#Left goodsId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . specJson AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left specs AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . save AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left entity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 清空购物车 * @returns {Promise<void>} Promise<void> */ AST#method_declaration#Left async clearCart AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . query AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left CartEntity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . delete AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 获取购物车中所有商品 * @returns {Promise<Cart[]>} 购物车列表 */ AST#method_declaration#Left async getAllCarts AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Cart [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left list : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CartEntity [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . query AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left CartEntity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . find AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left list AST#expression#Right . map AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left entity AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . toModel AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left entity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 获取购物车商品总数量 * @returns {Promise<number>} 商品总数 */ AST#method_declaration#Left async getCartCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . query AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left CartEntity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . find AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 根据商品ID获取购物车商品 * @param {number} goodsId 商品ID * @returns {Promise<Cart | undefined>} 匹配到的购物车商品 */ AST#method_declaration#Left async getCartByGoodsId AST#parameter_list#Left ( AST#parameter#Left goodsId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Cart AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left entity : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left CartEntity AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . findEntityByGoodsId AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left goodsId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#conditional_expression#Left AST#expression#Left entity AST#expression#Right ? AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . toModel AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left entity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right : AST#expression#Left undefined AST#expression#Right AST#conditional_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 根据商品ID查询实体 * @param {number} goodsId 商品ID * @returns {CartEntity | undefined} 匹配实体 */ AST#method_declaration#Left private findEntityByGoodsId AST#parameter_list#Left ( AST#parameter#Left goodsId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left CartEntity AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left result : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CartEntity [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . orm AST#member_expression#Right AST#expression#Right . query AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left CartEntity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . where AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "goodsId" AST#expression#Right , AST#expression#Left goodsId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . find AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#subscript_expression#Left AST#expression#Left result AST#expression#Right [ AST#expression#Left 0 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 将领域模型转换为数据库实体 * @param {Cart} cart 购物车领域模型 * @returns {CartEntity} 数据库实体 */ AST#method_declaration#Left private toEntity AST#parameter_list#Left ( AST#parameter#Left cart : AST#type_annotation#Left AST#primary_type#Left Cart AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CartEntity AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left entity : AST#type_annotation#Left AST#primary_type#Left CartEntity AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left CartEntity AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . goodsId AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left cart AST#expression#Right . goodsId AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . goodsName AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left cart AST#expression#Right . goodsName AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . goodsMainPic AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left cart AST#expression#Right . goodsMainPic AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . specJson AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left cart AST#expression#Right . spec AST#member_expression#Right AST#expression#Right ?? AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left entity AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 将数据库实体转换为领域模型 * @param {CartEntity} entity 数据库实体 * @returns {Cart} 领域模型 */ AST#method_declaration#Left private toModel AST#parameter_list#Left ( AST#parameter#Left entity : AST#type_annotation#Left AST#primary_type#Left CartEntity AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Cart AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left cart : AST#type_annotation#Left AST#primary_type#Left Cart AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Cart AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left cart AST#expression#Right . goodsId AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . goodsId AST#member_expression#Right AST#expression#Right ?? AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left cart AST#expression#Right . goodsName AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . goodsName AST#member_expression#Right AST#expression#Right ?? AST#expression#Left "" AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left cart AST#expression#Right . goodsMainPic AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . goodsMainPic AST#member_expression#Right AST#expression#Right ?? AST#expression#Left "" AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left cart AST#expression#Right . spec AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . parseSpecs AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left entity AST#expression#Right . specJson AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left cart AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 解析规格 JSON 字符串为规格列表 * @param {string | undefined} specJson 规格 JSON * @returns {CartGoodsSpec[]} 规格列表 */ AST#method_declaration#Left private parseSpecs AST#parameter_list#Left ( AST#parameter#Left specJson ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CartGoodsSpec [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left specJson AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left raw : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#array_type#Left CartGoodsSpec [ ] AST#array_type#Right AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . parse AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left specJson AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CartGoodsSpec [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Array AST#expression#Right . isArray AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left raw AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left raw AST#expression#Right . map AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left CartGoodsSpec AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left CartGoodsSpec AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left item AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Partial AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left CartGoodsSpec AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class CartLocalDataSourceImpl implements CartLocalDataSource { private static migrated: boolean = false; private orm = getORM(); constructor() { this.ensureMigrated(); } private ensureMigrated(): void { if (!CartLocalDataSourceImpl.migrated) { this.orm.migrate(CartEntity); CartLocalDataSourceImpl.migrated = true; } } async addToCart(cart: Cart): Promise<void> { this.orm.insert(this.toEntity(cart)); } async updateCart(cart: Cart): Promise<void> { this.orm.save(this.toEntity(cart)); } async updateCartSpecCount(goodsId: number, specId: number, count: number): Promise<void> { const entity: CartEntity | undefined = this.findEntityByGoodsId(goodsId); if (!entity) { return; } const specs: CartGoodsSpec[] = this.parseSpecs(entity.specJson); const updatedSpecs: CartGoodsSpec[] = specs.map((spec) => { const next = new CartGoodsSpec(spec); if (next.id === specId) { next.count = count; } return next; }); if (updatedSpecs.length === 0 || updatedSpecs.every((item) => item.count <= 0)) { this.orm.deleteById(CartEntity, goodsId); return; } entity.specJson = JSON.stringify(updatedSpecs); this.orm.save(entity); } async removeFromCart(goodsId: number): Promise<void> { this.orm.deleteById(CartEntity, goodsId); } async removeSpecFromCart(goodsId: number, specId: number): Promise<void> { const entity: CartEntity | undefined = this.findEntityByGoodsId(goodsId); if (!entity) { return; } const specs: CartGoodsSpec[] = this.parseSpecs(entity.specJson).filter((spec) => spec.id !== specId); if (specs.length === 0) { this.orm.deleteById(CartEntity, goodsId); return; } entity.specJson = JSON.stringify(specs); this.orm.save(entity); } async clearCart(): Promise<void> { this.orm.query(CartEntity).delete(); } async getAllCarts(): Promise<Cart[]> { const list: CartEntity[] = this.orm.query(CartEntity).find(); return list.map((entity) => this.toModel(entity)); } async getCartCount(): Promise<number> { return this.orm.query(CartEntity).find().length; } async getCartByGoodsId(goodsId: number): Promise<Cart | undefined> { const entity: CartEntity | undefined = this.findEntityByGoodsId(goodsId); return entity ? this.toModel(entity) : undefined; } private findEntityByGoodsId(goodsId: number): CartEntity | undefined { const result: CartEntity[] = this.orm.query(CartEntity).where("goodsId", goodsId).find(); return result[0]; } private toEntity(cart: Cart): CartEntity { const entity: CartEntity = new CartEntity(); entity.goodsId = cart.goodsId; entity.goodsName = cart.goodsName; entity.goodsMainPic = cart.goodsMainPic; entity.specJson = JSON.stringify(cart.spec ?? []); return entity; } private toModel(entity: CartEntity): Cart { const cart: Cart = new Cart(); cart.goodsId = entity.goodsId ?? 0; cart.goodsName = entity.goodsName ?? ""; cart.goodsMainPic = entity.goodsMainPic ?? ""; cart.spec = this.parseSpecs(entity.specJson); return cart; } private parseSpecs(specJson?: string): CartGoodsSpec[] { if (!specJson) { return []; } try { const raw: CartGoodsSpec[] | undefined = JSON.parse(specJson) as CartGoodsSpec[]; if (Array.isArray(raw)) { return raw.map((item: CartGoodsSpec) => new CartGoodsSpec(item as Partial<CartGoodsSpec>)); } return []; } catch (error) { return []; } } }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets#L10-L208
e72370961e34575113693bd08bd83d70ae4d357c
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/demo/src/main/ets/view/NetworkRequestPage.ets
arkts
NetworkRequestPage
@file 通用网络请求示例页视图 @author Joker.X
@ComponentV2 export struct NetworkRequestPage { /** * 通用网络请求示例页 ViewModel */ @Local private vm: NetworkRequestViewModel = new NetworkRequestViewModel(); /** * 构建通用网络请求示例页 * @returns {void} 无返回值 */ build() { AppNavDestination({ title: $r("app.string.demo_network_request_title"), viewModel: this.vm }) { this.NetworkRequestContent(); } } /** * 通用网络请求示例页内容视图 * @returns {void} 无返回值 */ @Builder private NetworkRequestContent() { MediumPaddingVerticalScroll() { ColumnBase({ widthValue: P100 }) { IBestButton({ text: $r("app.string.demo_network_request_get_action"), type: "primary", buttonSize: "normal", btnWidth: P100, round: true, loading: this.vm.getLoading, disabled: this.vm.getLoading, onBtnClick: (): void => { this.vm.requestGoodsDetail(); } }); SpaceVerticalLarge(); IBestButton({ text: $r("app.string.demo_network_request_post_action"), type: "default", plain: true, buttonSize: "normal", btnWidth: P100, round: true, loading: this.vm.postLoading, disabled: this.vm.postLoading, onBtnClick: (): void => { this.vm.requestGoodsList(); } }); }; }; } }
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct NetworkRequestPage AST#component_body#Left { /** * 通用网络请求示例页 ViewModel */ AST#property_declaration#Left AST#decorator#Left @ Local AST#decorator#Right private vm : AST#type_annotation#Left AST#primary_type#Left NetworkRequestViewModel AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left NetworkRequestViewModel AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right /** * 构建通用网络请求示例页 * @returns {void} 无返回值 */ AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left AppNavDestination ( AST#component_parameters#Left { AST#component_parameter#Left title : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.string.demo_network_request_title" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left viewModel : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . NetworkRequestContent AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#build_body#Right AST#build_method#Right /** * 通用网络请求示例页内容视图 * @returns {void} 无返回值 */ AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private NetworkRequestContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left MediumPaddingVerticalScroll ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ColumnBase ( AST#component_parameters#Left { AST#component_parameter#Left widthValue : AST#expression#Left P100 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#ui_custom_component_statement#Left IBestButton ( AST#component_parameters#Left { AST#component_parameter#Left text : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.string.demo_network_request_get_action" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left type : AST#expression#Left "primary" AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left buttonSize : AST#expression#Left "normal" AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left btnWidth : AST#expression#Left P100 AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left round : AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left loading : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . getLoading AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left disabled : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . getLoading AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onBtnClick : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . requestGoodsDetail AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) ; AST#ui_custom_component_statement#Right AST#ui_custom_component_statement#Left SpaceVerticalLarge ( ) ; AST#ui_custom_component_statement#Right AST#ui_custom_component_statement#Left IBestButton ( AST#component_parameters#Left { AST#component_parameter#Left text : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.string.demo_network_request_post_action" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left type : AST#expression#Left "default" AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left plain : AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left buttonSize : AST#expression#Left "normal" AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left btnWidth : AST#expression#Left P100 AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left round : AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left loading : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . postLoading AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left disabled : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . postLoading AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onBtnClick : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . requestGoodsList AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) ; AST#ui_custom_component_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#builder_function_body#Right AST#method_declaration#Right } AST#component_body#Right AST#decorated_export_declaration#Right
@ComponentV2 export struct NetworkRequestPage { @Local private vm: NetworkRequestViewModel = new NetworkRequestViewModel(); build() { AppNavDestination({ title: $r("app.string.demo_network_request_title"), viewModel: this.vm }) { this.NetworkRequestContent(); } } @Builder private NetworkRequestContent() { MediumPaddingVerticalScroll() { ColumnBase({ widthValue: P100 }) { IBestButton({ text: $r("app.string.demo_network_request_get_action"), type: "primary", buttonSize: "normal", btnWidth: P100, round: true, loading: this.vm.getLoading, disabled: this.vm.getLoading, onBtnClick: (): void => { this.vm.requestGoodsDetail(); } }); SpaceVerticalLarge(); IBestButton({ text: $r("app.string.demo_network_request_post_action"), type: "default", plain: true, buttonSize: "normal", btnWidth: P100, round: true, loading: this.vm.postLoading, disabled: this.vm.postLoading, onBtnClick: (): void => { this.vm.requestGoodsList(); } }); }; }; } }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/NetworkRequestPage.ets#L10-L70
504897652fdbfd5657cc688233822ee1d9ef1c34
github