├── .gitignore
├── 01.jpeg
├── 02.jpeg
├── 03.jpeg
├── 04.jpeg
├── 05.jpeg
├── 06.jpeg
├── 07.jpeg
├── 08.jpeg
├── 09.jpeg
├── 10.jpeg
├── 11.jpeg
├── 12.jpeg
├── AppScope
├── app.json5
└── resources
│ └── base
│ ├── element
│ └── string.json
│ └── media
│ └── app_icon.png
├── README.md
├── build-profile.json5
├── commons
├── basic
│ ├── .gitignore
│ ├── BuildProfile.ets
│ ├── Index.ets
│ ├── build-profile.json5
│ ├── consumer-rules.txt
│ ├── hvigorfile.ts
│ ├── obfuscation-rules.txt
│ ├── oh-package.json5
│ └── src
│ │ ├── main
│ │ ├── ets
│ │ │ ├── components
│ │ │ │ ├── HdClockIn.ets
│ │ │ │ ├── HdList.ets
│ │ │ │ ├── HdLoadingDialog.ets
│ │ │ │ ├── HdNav.ets
│ │ │ │ ├── HdSearch.ets
│ │ │ │ ├── HdSkeleton.ets
│ │ │ │ ├── HdTab.ets
│ │ │ │ ├── HdTag.ets
│ │ │ │ └── HdWeb.ets
│ │ │ ├── constants
│ │ │ │ └── BasicConstant.ets
│ │ │ └── utils
│ │ │ │ ├── auth.ets
│ │ │ │ ├── base.ets
│ │ │ │ ├── logger.ets
│ │ │ │ ├── request.ets
│ │ │ │ └── themeManager.ets
│ │ ├── module.json5
│ │ └── resources
│ │ │ ├── base
│ │ │ ├── element
│ │ │ │ ├── color.json
│ │ │ │ ├── float.json
│ │ │ │ └── string.json
│ │ │ └── media
│ │ │ │ ├── ic_common_back.svg
│ │ │ │ ├── ic_common_clocked.png
│ │ │ │ ├── ic_common_search.svg
│ │ │ │ ├── ic_common_unclock.png
│ │ │ │ ├── ic_public_close.svg
│ │ │ │ ├── ic_public_delete.svg
│ │ │ │ ├── ic_public_image.svg
│ │ │ │ └── ic_public_ok.svg
│ │ │ ├── dark
│ │ │ └── element
│ │ │ │ └── color.json
│ │ │ ├── en_US
│ │ │ └── element
│ │ │ │ └── string.json
│ │ │ ├── rawfile
│ │ │ ├── detail.html
│ │ │ ├── github.min.css
│ │ │ └── highlight.min.js
│ │ │ └── zh_CN
│ │ │ └── element
│ │ │ └── string.json
│ │ └── test
│ │ ├── List.test.ets
│ │ └── LocalUnit.test.ets
└── calendar
│ ├── .gitignore
│ ├── BuildProfile.ets
│ ├── Index.ets
│ ├── LICENSE
│ ├── README.md
│ ├── build-profile.json5
│ ├── changelog.md
│ ├── consumer-rules.txt
│ ├── hvigorfile.ts
│ ├── obfuscation-rules.txt
│ ├── oh-package-lock.json5
│ ├── oh-package.json5
│ └── src
│ ├── main
│ ├── ets
│ │ └── components
│ │ │ └── HmCalendar.ets
│ ├── module.json5
│ └── resources
│ │ ├── base
│ │ ├── element
│ │ │ ├── color.json
│ │ │ └── string.json
│ │ └── media
│ │ │ ├── ic_public_arrow_left.svg
│ │ │ └── ic_public_arrow_right.svg
│ │ ├── en_US
│ │ └── element
│ │ │ └── string.json
│ │ └── zh_CN
│ │ └── element
│ │ └── string.json
│ └── test
│ ├── List.test.ets
│ └── LocalUnit.test.ets
├── features
├── home
│ ├── .gitignore
│ ├── BuildProfile.ets
│ ├── Index.ets
│ ├── build-profile.json5
│ ├── consumer-rules.txt
│ ├── hvigorfile.ts
│ ├── obfuscation-rules.txt
│ ├── oh-package-lock.json5
│ ├── oh-package.json5
│ └── src
│ │ ├── main
│ │ ├── ets
│ │ │ ├── components
│ │ │ │ ├── HomeCategoryComp.ets
│ │ │ │ ├── HomeDayQuestionComp.ets
│ │ │ │ ├── HomeQuestionCardComp.ets
│ │ │ │ ├── QuestionFilterComp.ets
│ │ │ │ ├── QuestionItemComp.ets
│ │ │ │ ├── QuestionListComp.ets
│ │ │ │ └── SearchHistoryComp.ets
│ │ │ ├── models
│ │ │ │ ├── QuestionItemModel.ets
│ │ │ │ └── QuestionTypeModel.ets
│ │ │ ├── services
│ │ │ │ └── QuestionService.ets
│ │ │ ├── utils
│ │ │ │ └── history.ets
│ │ │ └── views
│ │ │ │ ├── BootView.ets
│ │ │ │ ├── HomeComp.ets
│ │ │ │ ├── QuestionDetailComp.ets
│ │ │ │ └── SearchComp.ets
│ │ ├── module.json5
│ │ └── resources
│ │ │ ├── base
│ │ │ ├── element
│ │ │ │ ├── float.json
│ │ │ │ └── string.json
│ │ │ └── media
│ │ │ │ ├── banner_ai.png
│ │ │ │ ├── banner_pj.png
│ │ │ │ ├── banner_qa.png
│ │ │ │ ├── boot.png
│ │ │ │ ├── card01.png
│ │ │ │ ├── card02.png
│ │ │ │ ├── card03.png
│ │ │ │ ├── card04.png
│ │ │ │ ├── ic_home_filter.png
│ │ │ │ ├── ic_home_more.png
│ │ │ │ └── ic_home_new.png
│ │ │ ├── en_US
│ │ │ └── element
│ │ │ │ └── string.json
│ │ │ └── zh_CN
│ │ │ └── element
│ │ │ └── string.json
│ │ └── test
│ │ ├── List.test.ets
│ │ └── LocalUnit.test.ets
├── interview
│ ├── .gitignore
│ ├── BuildProfile.ets
│ ├── Index.ets
│ ├── build-profile.json5
│ ├── consumer-rules.txt
│ ├── hvigorfile.ts
│ ├── obfuscation-rules.txt
│ ├── oh-package-lock.json5
│ ├── oh-package.json5
│ └── src
│ │ ├── main
│ │ ├── ets
│ │ │ ├── components
│ │ │ │ ├── InterviewItemComp.ets
│ │ │ │ └── InterviewListComp.ets
│ │ │ ├── models
│ │ │ │ └── InterviewItemModel.ets
│ │ │ ├── services
│ │ │ │ └── InterviewService.ets
│ │ │ └── views
│ │ │ │ ├── InterviewComp.ets
│ │ │ │ └── InterviewDetailComp.ets
│ │ ├── module.json5
│ │ └── resources
│ │ │ ├── base
│ │ │ ├── element
│ │ │ │ └── string.json
│ │ │ └── media
│ │ │ │ ├── ic_company_gg.svg
│ │ │ │ ├── ic_company_hw.svg
│ │ │ │ ├── ic_company_wr.svg
│ │ │ │ ├── ic_company_wy.svg
│ │ │ │ ├── ic_company_zj.svg
│ │ │ │ ├── ic_interview_avatar.svg
│ │ │ │ ├── ic_interview_file.svg
│ │ │ │ ├── ic_interview_logo.png
│ │ │ │ ├── ic_interview_more.png
│ │ │ │ ├── ic_interview_text.png
│ │ │ │ ├── ic_public_detail.svg
│ │ │ │ └── ic_public_forbid.svg
│ │ │ ├── en_US
│ │ │ └── element
│ │ │ │ └── string.json
│ │ │ └── zh_CN
│ │ │ └── element
│ │ │ └── string.json
│ │ └── test
│ │ ├── List.test.ets
│ │ └── LocalUnit.test.ets
├── mine
│ ├── .gitignore
│ ├── BuildProfile.ets
│ ├── Index.ets
│ ├── build-profile.json5
│ ├── consumer-rules.txt
│ ├── hvigorfile.ts
│ ├── obfuscation-rules.txt
│ ├── oh-package-lock.json5
│ ├── oh-package.json5
│ └── src
│ │ ├── main
│ │ ├── ets
│ │ │ ├── components
│ │ │ │ ├── ThemeDialog.ets
│ │ │ │ └── WordSoundDialog.ets
│ │ │ └── views
│ │ │ │ ├── ClockedComp.ets
│ │ │ │ ├── LoginComp.ets
│ │ │ │ ├── MineComp.ets
│ │ │ │ ├── OptionalComp.ets
│ │ │ │ ├── ProfileEditComp.ets
│ │ │ │ ├── SettingsComp.ets
│ │ │ │ ├── StudyTimeComp.ets
│ │ │ │ └── WordComp.ets
│ │ ├── module.json5
│ │ └── resources
│ │ │ ├── base
│ │ │ ├── element
│ │ │ │ └── string.json
│ │ │ └── media
│ │ │ │ ├── clocked_bg.png
│ │ │ │ ├── ic_mine_ai.png
│ │ │ │ ├── ic_mine_avatar.svg
│ │ │ │ ├── ic_mine_coin.png
│ │ │ │ ├── ic_mine_collect.png
│ │ │ │ ├── ic_mine_edit.svg
│ │ │ │ ├── ic_mine_file.png
│ │ │ │ ├── ic_mine_history.png
│ │ │ │ ├── ic_mine_info.png
│ │ │ │ ├── ic_mine_invite.png
│ │ │ │ ├── ic_mine_like.png
│ │ │ │ ├── ic_mine_notes.png
│ │ │ │ ├── ic_mine_setting.png
│ │ │ │ ├── ic_mine_study.png
│ │ │ │ ├── icon.png
│ │ │ │ └── study_time_bg.png
│ │ │ ├── en_US
│ │ │ └── element
│ │ │ │ └── string.json
│ │ │ ├── rawfile
│ │ │ ├── github.min.css
│ │ │ ├── highlight.min.js
│ │ │ ├── word.html
│ │ │ └── word.json
│ │ │ └── zh_CN
│ │ │ └── element
│ │ │ └── string.json
│ │ └── test
│ │ ├── List.test.ets
│ │ └── LocalUnit.test.ets
└── project
│ ├── .gitignore
│ ├── BuildProfile.ets
│ ├── Index.ets
│ ├── build-profile.json5
│ ├── consumer-rules.txt
│ ├── hvigorfile.ts
│ ├── obfuscation-rules.txt
│ ├── oh-package-lock.json5
│ ├── oh-package.json5
│ └── src
│ ├── main
│ ├── ets
│ │ ├── models
│ │ │ └── ProjectItemModel.ets
│ │ ├── services
│ │ │ └── ProjectService.ets
│ │ └── views
│ │ │ ├── ProjectComp.ets
│ │ │ └── ProjectDetailComp.ets
│ ├── module.json5
│ └── resources
│ │ ├── base
│ │ ├── element
│ │ │ └── string.json
│ │ └── media
│ │ │ ├── project01.png
│ │ │ ├── project02.png
│ │ │ ├── project03.png
│ │ │ └── project_bg.png
│ │ ├── en_US
│ │ └── element
│ │ │ └── string.json
│ │ └── zh_CN
│ │ └── element
│ │ └── string.json
│ └── test
│ ├── List.test.ets
│ └── LocalUnit.test.ets
├── hvigor
└── hvigor-config.json5
├── hvigorfile.ts
├── logo.png
├── oh-package-lock.json5
├── oh-package.json5
└── products
└── phone
├── .gitignore
├── build-profile.json5
├── hvigorfile.ts
├── obfuscation-rules.txt
├── oh-package-lock.json5
├── oh-package.json5
└── src
├── main
├── ets
│ ├── contants
│ │ └── index.ets
│ ├── models
│ │ └── TabBarModel.ets
│ ├── pages
│ │ ├── BootPage.ets
│ │ ├── ClockedPage.ets
│ │ ├── Index.ets
│ │ ├── InterviewDetailPage.ets
│ │ ├── LoginPage.ets
│ │ ├── OptionalPage.ets
│ │ ├── ProfileEditPage.ets
│ │ ├── ProjectDetailPage.ets
│ │ ├── QuestionDetailPage.ets
│ │ ├── SearchPage.ets
│ │ ├── SettingsPage.ets
│ │ ├── StudyTimePage.ets
│ │ └── WordPage.ets
│ ├── phoneability
│ │ └── PhoneAbility.ets
│ ├── phoneformability
│ │ └── PhoneFormAbility.ets
│ ├── views
│ │ └── Index
│ │ │ └── TabBarComp.ets
│ └── widget
│ │ └── pages
│ │ └── WidgetCard.ets
├── module.json5
└── resources
│ ├── base
│ ├── element
│ │ ├── color.json
│ │ ├── float.json
│ │ └── string.json
│ ├── media
│ │ ├── card_bg.png
│ │ ├── ic_public_calendar_filled.svg
│ │ ├── ic_public_file_filled.svg
│ │ ├── ic_questionnaire_filled.svg
│ │ ├── icon.png
│ │ ├── startIcon.png
│ │ ├── tabbar_home.png
│ │ ├── tabbar_home_fill.png
│ │ ├── tabbar_interview.png
│ │ ├── tabbar_interview_fill.png
│ │ ├── tabbar_mine.png
│ │ ├── tabbar_mine_fill.png
│ │ ├── tabbar_project.png
│ │ └── tabbar_project_fill.png
│ └── profile
│ │ ├── form_config.json
│ │ └── main_pages.json
│ ├── en_US
│ └── element
│ │ └── string.json
│ └── zh_CN
│ └── element
│ └── string.json
├── mock
└── mock-config.json5
├── ohosTest
├── ets
│ ├── test
│ │ ├── Ability.test.ets
│ │ └── List.test.ets
│ ├── testability
│ │ ├── TestAbility.ets
│ │ └── pages
│ │ │ └── Index.ets
│ └── testrunner
│ │ └── OpenHarmonyTestRunner.ets
├── module.json5
└── resources
│ └── base
│ ├── element
│ ├── color.json
│ └── string.json
│ ├── media
│ └── icon.png
│ └── profile
│ └── test_pages.json
└── test
├── List.test.ets
└── LocalUnit.test.ets
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /oh_modules
3 | /local.properties
4 | /.idea
5 | **/build
6 | /.hvigor
7 | .cxx
8 | /.clangd
9 | /.clang-format
10 | /.clang-tidy
11 | **/.test
12 | .DS_Store
13 | /dependencies
--------------------------------------------------------------------------------
/01.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/01.jpeg
--------------------------------------------------------------------------------
/02.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/02.jpeg
--------------------------------------------------------------------------------
/03.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/03.jpeg
--------------------------------------------------------------------------------
/04.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/04.jpeg
--------------------------------------------------------------------------------
/05.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/05.jpeg
--------------------------------------------------------------------------------
/06.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/06.jpeg
--------------------------------------------------------------------------------
/07.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/07.jpeg
--------------------------------------------------------------------------------
/08.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/08.jpeg
--------------------------------------------------------------------------------
/09.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/09.jpeg
--------------------------------------------------------------------------------
/10.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/10.jpeg
--------------------------------------------------------------------------------
/11.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/11.jpeg
--------------------------------------------------------------------------------
/12.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/12.jpeg
--------------------------------------------------------------------------------
/AppScope/app.json5:
--------------------------------------------------------------------------------
1 | {
2 | "app": {
3 | "bundleName": "com.itcast.pass_interview",
4 | "vendor": "itcast",
5 | "versionCode": 1000000,
6 | "versionName": "1.0.0",
7 | "icon": "$media:app_icon",
8 | "label": "$string:app_name"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/AppScope/resources/base/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "app_name",
5 | "value": "面试通"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/AppScope/resources/base/media/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/AppScope/resources/base/media/app_icon.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ## Pass Interview ( Harmony NEXT )
6 |
7 | A brushing application for front-end programmers, providing front-end frequently met questions, project business
8 | interview questions, interview experience and other content services.
9 |
10 | HarmonyOS NEXT
11 |
12 | - document https://zhousg.atomgit.net/interview_success/
13 | - code https://github.com/HarmonyOS-Next/interview-handbook-project
14 |
15 | HarmonyOS 4.0
16 |
17 | - document https://harmonyos-next.github.io/interview-handbook-project/
18 | - code https://github.com/HarmonyOS-Next/interview-handbook-project/tree/main
19 |
20 | ## Screen Shots
21 |
22 | | | |
23 | |-------------------------------------|-------------------------------------|
24 | |
|
|
25 | |
|
|
26 | |
|
|
27 | |
|
|
28 | |
|
|
29 | |
|
|
30 |
31 |
--------------------------------------------------------------------------------
/build-profile.json5:
--------------------------------------------------------------------------------
1 | {
2 | "app": {
3 | "products": [
4 | {
5 | "name": "default",
6 | "signingConfig": "default",
7 | "compatibleSdkVersion": "5.0.0(12)",
8 | "runtimeOS": "HarmonyOS"
9 | }
10 | ],
11 | "buildModeSet": [
12 | {
13 | "name": "debug"
14 | },
15 | {
16 | "name": "release"
17 | }
18 | ],
19 | "signingConfigs": [
20 | {
21 | "name": "default",
22 | "type": "HarmonyOS",
23 | "material": {
24 | "certpath": "/Users/zhousg/.ohos/config/default_interview-handbook-project_HLKK-jbFP2i_86C1kdyuRrPB-WXQXKhyYK6HPBpJVIo=.cer",
25 | "storePassword": "0000001B299575FFA0D251AB9048152F8DB1430243AF126AFB73D0AACCDEC5120CA2D568368642F6DD6EA9",
26 | "keyAlias": "debugKey",
27 | "keyPassword": "0000001BC94D0060CB5BD78EE7F34D46CFAF8C73FA3CBA8BBC26A2CC4B3AC95BCC425A4A36474F1514BECA",
28 | "profile": "/Users/zhousg/.ohos/config/default_interview-handbook-project_HLKK-jbFP2i_86C1kdyuRrPB-WXQXKhyYK6HPBpJVIo=.p7b",
29 | "signAlg": "SHA256withECDSA",
30 | "storeFile": "/Users/zhousg/.ohos/config/default_interview-handbook-project_HLKK-jbFP2i_86C1kdyuRrPB-WXQXKhyYK6HPBpJVIo=.p12"
31 | }
32 | }
33 | ]
34 | },
35 | "modules": [
36 | {
37 | "name": "phone",
38 | "srcPath": "./products/phone",
39 | "targets": [
40 | {
41 | "name": "default",
42 | "applyToProducts": [
43 | "default"
44 | ]
45 | }
46 | ]
47 | },
48 | {
49 | "name": "basic",
50 | "srcPath": "./commons/basic"
51 | },
52 | {
53 | "name": "home",
54 | "srcPath": "./features/home"
55 | },
56 | {
57 | "name": "interview",
58 | "srcPath": "./features/interview"
59 | },
60 | {
61 | "name": "project",
62 | "srcPath": "./features/project"
63 | },
64 | {
65 | "name": "mine",
66 | "srcPath": "./features/mine"
67 | },
68 | {
69 | "name": "calendar",
70 | "srcPath": "./commons/calendar"
71 | }
72 | ]
73 | }
--------------------------------------------------------------------------------
/commons/basic/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /oh_modules
3 | /.preview
4 | /build
5 | /.cxx
6 | /.test
--------------------------------------------------------------------------------
/commons/basic/BuildProfile.ets:
--------------------------------------------------------------------------------
1 | /**
2 | * Use these variables when you tailor your ArkTS code. They must be of the const type.
3 | */
4 | export const HAR_VERSION = '1.0.0';
5 | export const BUILD_MODE_NAME = 'debug';
6 | export const DEBUG = true;
7 | export const TARGET_NAME = 'default';
8 |
9 | /**
10 | * BuildProfile Class is used only for compatibility purposes.
11 | */
12 | export default class BuildProfile {
13 | static readonly HAR_VERSION = HAR_VERSION;
14 | static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15 | static readonly DEBUG = DEBUG;
16 | static readonly TARGET_NAME = TARGET_NAME;
17 | }
--------------------------------------------------------------------------------
/commons/basic/Index.ets:
--------------------------------------------------------------------------------
1 | export { HdSearch } from './src/main/ets/components/HdSearch'
2 |
3 | export { HdClockIn } from './src/main/ets/components/HdClockIn'
4 |
5 | export { HdTag } from './src/main/ets/components/HdTag'
6 |
7 | export { HdNav } from './src/main/ets/components/HdNav'
8 |
9 | export { HdWeb } from './src/main/ets/components/HdWeb'
10 |
11 | export { HdTab, HdTabItem } from './src/main/ets/components/HdTab'
12 |
13 | export { HdSkeleton, HdSkeletonType } from './src/main/ets/components/HdSkeleton'
14 |
15 | export { HdLoadingDialog } from './src/main/ets/components/HdLoadingDialog'
16 |
17 | export { HdList, HdListController } from './src/main/ets/components/HdList'
18 |
19 | export { BasicConstant } from './src/main/ets/constants/BasicConstant'
20 |
21 | export { hdHttp, HdResponse } from './src/main/ets/utils/request'
22 |
23 | export { authStore, HdUser, AUTH_STORE_KEY } from './src/main/ets/utils/auth'
24 |
25 | export { logger } from './src/main/ets/utils/logger'
26 |
27 | export { getTimeText, getPercentText } from './src/main/ets/utils/base'
28 |
29 | export { themeManager } from './src/main/ets/utils/themeManager'
--------------------------------------------------------------------------------
/commons/basic/build-profile.json5:
--------------------------------------------------------------------------------
1 | {
2 | "apiType": "stageMode",
3 | "buildOption": {
4 | },
5 | "buildOptionSet": [
6 | {
7 | "name": "release",
8 | "arkOptions": {
9 | "obfuscation": {
10 | "ruleOptions": {
11 | "enable": true,
12 | "files": [
13 | "./obfuscation-rules.txt"
14 | ]
15 | },
16 | "consumerFiles": [
17 | "./consumer-rules.txt"
18 | ]
19 | }
20 | },
21 | },
22 | ],
23 | "targets": [
24 | {
25 | "name": "default"
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/commons/basic/consumer-rules.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/commons/basic/consumer-rules.txt
--------------------------------------------------------------------------------
/commons/basic/hvigorfile.ts:
--------------------------------------------------------------------------------
1 | import { harTasks } from '@ohos/hvigor-ohos-plugin';
2 |
3 | export default {
4 | system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5 | plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6 | }
7 |
--------------------------------------------------------------------------------
/commons/basic/obfuscation-rules.txt:
--------------------------------------------------------------------------------
1 | # Define project specific obfuscation rules here.
2 | # You can include the obfuscation configuration files in the current module's build-profile.json5.
3 | #
4 | # For more details, see
5 | # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6 |
7 | # Obfuscation options:
8 | # -disable-obfuscation: disable all obfuscations
9 | # -enable-property-obfuscation: obfuscate the property names
10 | # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11 | # -compact: remove unnecessary blank spaces and all line feeds
12 | # -remove-log: remove all console.* statements
13 | # -print-namecache: print the name cache that contains the mapping from the old names to new names
14 | # -apply-namecache: reuse the given cache file
15 |
16 | # Keep options:
17 | # -keep-property-name: specifies property names that you want to keep
18 | # -keep-global-name: specifies names that you want to keep in the global scope
--------------------------------------------------------------------------------
/commons/basic/oh-package.json5:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@itcast/basic",
3 | "version": "1.0.0",
4 | "description": "Please describe the basic information.",
5 | "main": "Index.ets",
6 | "author": "",
7 | "license": "Apache-2.0",
8 | "dependencies": {}
9 | }
10 |
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/components/HdClockIn.ets:
--------------------------------------------------------------------------------
1 | @Component
2 | export struct HdClockIn {
3 | @Prop
4 | clockCount: number = 0
5 |
6 | build() {
7 | Stack({ alignContent: Alignment.End }) {
8 | Image(this.clockCount > 0 ? $r("app.media.ic_common_clocked") : $r("app.media.ic_common_unclock"))
9 | .objectFit(ImageFit.Fill)
10 | if (this.clockCount > 0) {
11 | Column() {
12 | Text($r('app.string.hd_clock_continue'))
13 | .fontSize($r('app.float.common_font8'))
14 | Text() {
15 | Span(this.clockCount.toString())
16 | .fontWeight(FontWeight.Bold)
17 | .fontSize($r('app.float.common_font12'))
18 | Span($r('app.string.hd_clock_day'))
19 | .fontSize($r('app.float.common_font10'))
20 | }
21 | }
22 | .width($r('app.float.hd_clock_text_width'))
23 | } else {
24 | Text($r('app.string.hd_clock_in'))
25 | .width($r('app.float.hd_clock_text_width'))
26 | .textAlign(TextAlign.Center)
27 | .fontSize($r('app.float.hd_clock_font'))
28 | .fontWeight(500)
29 | .fontColor($r('app.color.black'))
30 | .margin({ bottom: $r('app.float.common_space4') })
31 | }
32 | }
33 | .width($r('app.float.hd_clock_width'))
34 | .height($r('app.float.hd_clock_height'))
35 | }
36 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/components/HdLoadingDialog.ets:
--------------------------------------------------------------------------------
1 | @CustomDialog
2 | export struct HdLoadingDialog {
3 | @State
4 | message: string = ''
5 | controller: CustomDialogController
6 |
7 | build() {
8 | Column({ space: 10 }) {
9 | LoadingProgress()
10 | .width(48)
11 | .height(48)
12 | .color('#ffffff')
13 | if (this.message) {
14 | Text(this.message)
15 | .fontSize(14)
16 | .fontColor('#ffffff')
17 | }
18 | }
19 | .justifyContent(FlexAlign.Center)
20 | .width(120)
21 | .height(120)
22 | .backgroundColor('rgba(0,0,0,0.6)')
23 | .borderRadius(16)
24 | }
25 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/components/HdNav.ets:
--------------------------------------------------------------------------------
1 | import { router } from '@kit.ArkUI'
2 |
3 | @Builder
4 | function defaultBuilder(): void {
5 |
6 | }
7 |
8 | @Component
9 | export struct HdNav {
10 | @StorageProp('topHeight')
11 | topHeight: number = 0
12 | @Prop
13 | title: string = ''
14 | @Prop
15 | hasBorder: boolean = false
16 | @Prop
17 | leftIcon: ResourceStr = $r('app.media.ic_common_back')
18 | @Prop
19 | rightIcon: ResourceStr = $r('sys.media.ohos_ic_public_more')
20 | @Prop
21 | showRightIcon: boolean = true
22 | @BuilderParam
23 | titleBuilder: () => void = defaultBuilder
24 | @BuilderParam
25 | menuBuilder: () => void = defaultBuilder
26 |
27 | build() {
28 | Row({ space: 16 }) {
29 | Image(this.leftIcon)
30 | .size({ width: 24, height: 24 })
31 | .onClick(() => router.back())
32 | .fillColor($r('app.color.black'))
33 | Row() {
34 | if (this.title) {
35 | Text(this.title)
36 | .fontWeight(600)
37 | .layoutWeight(1)
38 | .textAlign(TextAlign.Center)
39 | .fontSize(18)
40 | .maxLines(1)
41 | .textOverflow({ overflow: TextOverflow.Ellipsis })
42 | } else if (this.titleBuilder) {
43 | this.titleBuilder()
44 | }
45 | }
46 | .height(56)
47 | .layoutWeight(1)
48 |
49 | if (this.showRightIcon) {
50 | Image(this.rightIcon)
51 | .size({ width: 24, height: 24 })
52 | .objectFit(ImageFit.Contain)
53 | .bindMenu(this.menuBuilder)
54 | } else {
55 | Blank()
56 | .width(24)
57 | }
58 | }
59 |
60 | .padding({ left: 16, right: 16, top: this.topHeight })
61 | .height(56 + this.topHeight)
62 | .width('100%')
63 | .border({
64 | width: { bottom: this.hasBorder ? $r('app.float.common_border_width') : 0 },
65 | color: $r('app.color.common_gray_bg')
66 | })
67 | }
68 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/components/HdSearch.ets:
--------------------------------------------------------------------------------
1 | import { BasicConstant } from '../constants/BasicConstant'
2 |
3 | @Component
4 | export struct HdSearch {
5 | @Prop
6 | val: string = ''
7 | @State
8 | readonlyMode: boolean = true
9 | ph: string = ''
10 | bg: ResourceStr = ''
11 | color: string = ''
12 | onSubmit: () => void = () => {
13 | }
14 | onChange: (val: string) => void = (val: string) => {
15 | }
16 |
17 | build() {
18 | Row() {
19 | if (this.readonlyMode) {
20 | Row({ space: BasicConstant.SPACE_SM }) {
21 | Image($r("app.media.ic_common_search"))
22 | .width($r('app.float.hd_search_icon_size'))
23 | .aspectRatio(1)
24 | .fillColor(this.color || $r('app.color.common_gray_02'))
25 | Text(this.ph || $r('app.string.hd_search_placeholder'))
26 | .fontColor(this.color || $r('app.color.common_gray_02'))
27 | .fontSize($r('app.float.common_font14'))
28 | }
29 | .height($r('app.float.hd_search_height'))
30 | .width('100%')
31 | .backgroundColor(this.bg || $r('app.color.common_gray_border'))
32 | .borderRadius($r('app.float.hd_search_radius'))
33 | .justifyContent(FlexAlign.Center)
34 | } else {
35 | Search({
36 | placeholder: this.ph || $r('app.string.hd_search_placeholder'),
37 | value: this.val
38 | })
39 | .searchIcon({
40 | size: $r('app.float.hd_search_icon_size'),
41 | src: $r("app.media.ic_common_search"),
42 | color: $r('app.color.common_gray_02')
43 | })
44 | .textFont({ size: $r('app.float.common_font14') })
45 | .width('100%')
46 | .padding(0)
47 | .margin(0)
48 | .backgroundColor(this.bg || $r('app.color.common_gray_border'))
49 | .placeholderColor($r('app.color.common_gray_02'))
50 | .placeholderFont({ size: $r('app.float.common_font14') })
51 | .height($r('app.float.hd_search_height'))
52 | .onSubmit(() => {
53 | this.onSubmit && this.onSubmit()
54 | })
55 | .onChange((val) => {
56 | this.onChange && this.onChange(val)
57 | })
58 | }
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/components/HdSkeleton.ets:
--------------------------------------------------------------------------------
1 | export enum HdSkeletonType {
2 | BASE,
3 | AVATAR,
4 | IMAGE
5 | }
6 |
7 | @Builder
8 | function defaultBuilder() {
9 |
10 | }
11 |
12 | @Component
13 | export struct HdSkeleton {
14 | @BuilderParam
15 | default: () => void = defaultBuilder
16 | // 透明度
17 | @State
18 | opacityValue: number = 1
19 | // 行数
20 | rows: number = 0
21 | // 类型
22 | type: HdSkeletonType = HdSkeletonType.BASE
23 | // 头像尺寸
24 | avatarSize: number = 40
25 | // 图片尺寸
26 | imageSize: number = 100
27 |
28 | build() {
29 | Row({ space: 15 }) {
30 | if (this.default) {
31 | this.default()
32 | } else {
33 | if (this.type === HdSkeletonType.AVATAR) {
34 | HdSkeletonAvatar({ widthValue: this.avatarSize })
35 | .alignSelf(ItemAlign.Start)
36 | }
37 | if (this.type === HdSkeletonType.IMAGE) {
38 | HdSkeletonImage({ widthValue: this.imageSize })
39 | .alignSelf(ItemAlign.Start)
40 | }
41 | Column() {
42 | HdSkeletonRow({ widthValue: '50%' })
43 | .margin({ top: this.type === HdSkeletonType.AVATAR ? 10 : 0 })
44 | ForEach(new Array(this.rows).fill(0), (_: number, i) => {
45 | HdSkeletonRow({ widthValue: i < this.rows - 1 ? '100%' : '75%' })
46 | .margin({ top: 10 })
47 | })
48 | }
49 | .alignItems(HorizontalAlign.Start)
50 | .layoutWeight(1)
51 | .alignSelf(ItemAlign.Start)
52 | }
53 | }
54 | .opacity(this.opacityValue)
55 | .animation({
56 | duration: 600,
57 | playMode: PlayMode.Alternate,
58 | iterations: -1,
59 | curve: Curve.EaseInOut
60 | })
61 | .onAppear(() => {
62 | this.opacityValue = 0.5
63 | })
64 | }
65 | }
66 |
67 |
68 | @Component
69 | export struct HdSkeletonRow {
70 | @Prop
71 | widthValue: Length = '100%'
72 |
73 | build() {
74 | Text()
75 | .height(16)
76 | .width(this.widthValue)
77 | .borderRadius(2)
78 | .backgroundColor($r('app.color.common_gray_bg'))
79 | }
80 | }
81 |
82 | @Component
83 | export struct HdSkeletonAvatar {
84 | @Prop
85 | widthValue: number = 40
86 |
87 | build() {
88 | Text()
89 | .width(this.widthValue)
90 | .aspectRatio(1)
91 | .borderRadius(this.widthValue / 2)
92 | .backgroundColor($r('app.color.common_gray_bg'))
93 | }
94 | }
95 |
96 | @Component
97 | export struct HdSkeletonImage {
98 | @Prop
99 | widthValue: number = 100
100 |
101 | build() {
102 | Row() {
103 | Image($r('app.media.ic_public_image'))
104 | .width(this.widthValue / 2)
105 | .aspectRatio(1)
106 | .fillColor($r('app.color.common_gray_border'))
107 | }
108 | .justifyContent(FlexAlign.Center)
109 | .width(this.widthValue)
110 | .aspectRatio(1)
111 | .borderRadius(2)
112 | .backgroundColor($r('app.color.common_gray_bg'))
113 | }
114 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/components/HdTab.ets:
--------------------------------------------------------------------------------
1 | export interface HdTabItem {
2 | name: string
3 | value?: string | number
4 | }
5 |
6 | @Component
7 | export struct HdTab {
8 | @Prop
9 | activeIndex: number = 0
10 | @Prop
11 | tabConfig: HdTabItem[] = []
12 | @State
13 | left: number = 0
14 | @Prop
15 | lineWidth: number = 20
16 | @Prop
17 | gutter: number = 20
18 | // cb
19 | onTabClick?: (tab: HdTabItem, index: number) => void
20 | onTabChange?: (tab: HdTabItem, index: number) => void
21 |
22 | // 设置线位置
23 | setLineLeft(area: Area) {
24 | const width = area.width as number
25 | const x = area.position.x as number
26 | this.left = x + (width - this.lineWidth) / 2
27 | }
28 |
29 | @Builder
30 | TabBuilder(tab: HdTabItem, index: number) {
31 | Text(tab.name)
32 | .fontSize(15)
33 | .fontColor(this.activeIndex === index ? $r('app.color.black') : '#979797')
34 | .animation({
35 | duration: 300
36 | })
37 | .onClick((e) => {
38 | if (this.activeIndex !== index) {
39 | this.setLineLeft(e.target.area)
40 | this.activeIndex = index
41 | this.onTabChange && this.onTabChange(tab, index)
42 | }
43 | this.onTabClick && this.onTabClick(tab, index)
44 | })
45 | .onAreaChange((_o, n) => {
46 | if (this.activeIndex === index) {
47 | this.setLineLeft(n)
48 | }
49 | })
50 | }
51 |
52 | build() {
53 | Row() {
54 | Row({ space: this.gutter }) {
55 | ForEach(this.tabConfig, (item: HdTabItem, index) => {
56 | this.TabBuilder(item, index)
57 | })
58 | }
59 | .width('100%')
60 | .padding({ left: this.gutter, right: this.gutter })
61 | .height(40)
62 | .border({
63 | width: { bottom: $r('app.float.common_border_width') },
64 | color: $r('app.color.common_gray_border')
65 | })
66 |
67 | Text()
68 | .width(this.lineWidth)
69 | .height(2)
70 | .backgroundColor($r('app.color.black'))
71 | .position({ x: this.left, y: 38 })
72 | .animation({
73 | duration: 300
74 | })
75 | }
76 | }
77 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/components/HdTag.ets:
--------------------------------------------------------------------------------
1 | export interface Tag {
2 | text: ResourceStr
3 | color: ResourceColor
4 | }
5 |
6 | @Component
7 | export struct HdTag {
8 | text: string = ''
9 | difficulty: number = 1
10 |
11 | getTag(): Tag {
12 | if (this.difficulty === 3 || this.difficulty === 4) {
13 | return { text: $r('app.string.hd_tag_general'), color: $r('app.color.common_blue') }
14 | } else if (this.difficulty === 5) {
15 | return { text: $r('app.string.hd_tag_difficult'), color: $r('app.color.common_main_color') }
16 | }
17 | return { text: this.text ? this.text : $r('app.string.hd_tag_simple'), color: $r('app.color.common_green') }
18 | }
19 |
20 | build() {
21 | Text(this.getTag().text)
22 | .fontColor(this.getTag().color)
23 | .fontSize($r('app.float.common_font10'))
24 | .padding({ left: $r('app.float.common_space4'), right: $r('app.float.common_space4')})
25 | .constraintSize({ minWidth: $r('app.float.hd_tag_width') })
26 | .height($r('app.float.hd_tag_height'))
27 | .backgroundColor($r('app.color.common_gray_bg'))
28 | .borderRadius($r('app.float.hd_tag_radius'))
29 | .textAlign(TextAlign.Center)
30 | }
31 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/components/HdWeb.ets:
--------------------------------------------------------------------------------
1 | import { webview } from '@kit.ArkWeb'
2 | import { logger } from '../utils/logger'
3 |
4 | @Component
5 | export struct HdWeb {
6 | layoutMode: WebLayoutMode = WebLayoutMode.NONE
7 | src: ResourceStr = $rawfile('detail.html')
8 | onLoad: () => void = () => {
9 | }
10 | controller: webview.WebviewController = new webview.WebviewController()
11 |
12 | build() {
13 | Web({ src: this.src, controller: this.controller })
14 | .javaScriptAccess(true)
15 | .onPageEnd(() => {
16 | this.onLoad()
17 | })
18 | .onErrorReceive(event => {
19 | logger.error(event!.error.getErrorInfo())
20 | })
21 | .layoutMode(this.layoutMode)
22 | .layoutWeight(1)
23 | }
24 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/constants/BasicConstant.ets:
--------------------------------------------------------------------------------
1 | export class BasicConstant {
2 | static readonly SPACE_SM = 4
3 | static readonly SPACE_MD = 10
4 | static readonly SPACE_LG = 16
5 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/utils/auth.ets:
--------------------------------------------------------------------------------
1 | import { preferences } from '@kit.ArkData'
2 | import { router } from '@kit.ArkUI'
3 |
4 | export interface HdUser {
5 | id: string
6 | username: string
7 | avatar: string
8 | token: string
9 | refreshToken: string
10 | nickName?: string
11 | totalTime?: number
12 | clockinNumbers?: number
13 | }
14 |
15 | export const AUTH_STORE_KEY = 'authStore'
16 |
17 | class AuthStore {
18 | store: preferences.Preferences | null = null
19 |
20 | getStore() {
21 | if (!this.store) {
22 | this.store = preferences.getPreferencesSync(getContext(), { name: AUTH_STORE_KEY })
23 | }
24 | return this.store
25 | }
26 |
27 | async setUser(user: HdUser) {
28 | AppStorage.setOrCreate('user', user)
29 | await this.getStore().put(AUTH_STORE_KEY, JSON.stringify(user))
30 | await this.getStore().flush()
31 | }
32 |
33 | async delUser() {
34 | AppStorage.setOrCreate('user', {})
35 | await this.getStore().put(AUTH_STORE_KEY, '{}')
36 | await this.getStore().flush()
37 | }
38 |
39 | initUser() {
40 | const json = this.getStore().getSync(AUTH_STORE_KEY, '{}') as string
41 | AppStorage.setOrCreate('user', JSON.parse(json))
42 | }
43 |
44 | getUser() {
45 | return AppStorage.get('user') || {} as HdUser
46 | }
47 |
48 | checkAuth(options: router.RouterOptions | Function) {
49 | if (this.getUser().token) {
50 | if (typeof options === 'function') {
51 | options()
52 | } else {
53 | router.pushUrl(options)
54 | }
55 | } else {
56 | if (typeof options === 'function') {
57 | router.pushUrl({
58 | url: 'pages/LoginPage',
59 | })
60 | } else {
61 | const params = options.params as Record || {}
62 | params.return_path = options.url
63 | router.pushUrl({
64 | url: 'pages/LoginPage',
65 | params: params
66 | })
67 | }
68 | }
69 | }
70 | }
71 |
72 | export const authStore = new AuthStore()
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/utils/base.ets:
--------------------------------------------------------------------------------
1 | export const getTimeText = (time: number = 0, hasUnit = true) => {
2 | if (time < 3600) {
3 | return String(Math.floor(time / 60)) + (hasUnit ? ' 分钟' : '')
4 | } else {
5 | return String(Math.round(time / 3600 * 10) / 10) + (hasUnit ? ' 小时' : '')
6 | }
7 | }
8 |
9 | export const getPercentText =
10 | (value: number, total: number) => Math.round(value / total * 100) + '%'
11 |
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/utils/logger.ets:
--------------------------------------------------------------------------------
1 | import hilog from '@ohos.hilog'
2 |
3 | const DOMAIN = 0xFF09
4 | const PREFIX = 'PASS_INTERVIEW_LOGGER'
5 | const FORMAT = '%{public}s, %{public}s'
6 |
7 | class Logger {
8 | debug(...args: string[]) {
9 | hilog.debug(DOMAIN, PREFIX, FORMAT, args)
10 | }
11 |
12 | info(...args: string[]) {
13 | hilog.info(DOMAIN, PREFIX, FORMAT, args)
14 | }
15 |
16 | warn(...args: string[]) {
17 | hilog.warn(DOMAIN, PREFIX, FORMAT, args)
18 | }
19 |
20 | error(...args: string[]) {
21 | hilog.error(DOMAIN, PREFIX, FORMAT, args)
22 | }
23 |
24 | fatal(...args: string[]) {
25 | hilog.fatal(DOMAIN, PREFIX, FORMAT, args)
26 | }
27 |
28 | isLoggable(level: hilog.LogLevel) {
29 | hilog.isLoggable(DOMAIN, PREFIX, level)
30 | }
31 | }
32 |
33 | export const logger = new Logger()
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/utils/request.ets:
--------------------------------------------------------------------------------
1 | import { http } from '@kit.NetworkKit';
2 | import { authStore } from './auth';
3 | import { promptAction, router } from '@kit.ArkUI';
4 | import { BusinessError } from '@ohos.base';
5 | import { logger } from './logger';
6 |
7 | interface HdRequestOptions {
8 | baseURL?: string
9 | }
10 |
11 | type HdParams = Record
12 |
13 | export interface HdResponse {
14 | code: number
15 | message: string
16 | data: T
17 | }
18 |
19 | class HdHttp {
20 | baseURL: string
21 |
22 | constructor(options: HdRequestOptions) {
23 | this.baseURL = options.baseURL || ''
24 | }
25 |
26 | private request(path: string, method: http.RequestMethod = http.RequestMethod.GET, extraData?: Object) {
27 | const httpInstance = http.createHttp()
28 |
29 | const options: http.HttpRequestOptions = {
30 | header: {
31 | 'Content-Type': 'application/json'
32 | },
33 | method,
34 | expectDataType: http.HttpDataType.OBJECT
35 | }
36 |
37 | let fullUrl = this.baseURL + path
38 |
39 | if (method === http.RequestMethod.GET && extraData) {
40 | const strArr = Object.keys(extraData)
41 | .filter(key => (extraData as HdParams)[key] !== undefined)
42 | .map(key => `${key}=${(extraData as HdParams)[key]}`)
43 | fullUrl += `?${strArr.join('&')}`
44 | } else {
45 | options.extraData = extraData
46 | }
47 |
48 | const user = authStore.getUser()
49 | if (user.token && options.header) {
50 | options.header['Authorization'] = `Bearer ${user.token}`
51 | }
52 |
53 | return httpInstance.request(fullUrl, options).then((res) => {
54 | if (res.result) {
55 | const result = res.result as HdResponse
56 | if (result.code === 10000) {
57 | logger.info(fullUrl, JSON.stringify(res.result).substring(0, 200))
58 | return result
59 | }
60 | if (result.code === 401) {
61 | authStore.delUser()
62 | router.pushUrl({
63 | url: 'pages/LoginPage'
64 | }, router.RouterMode.Single)
65 | throw new Error('登录过期')
66 | }
67 | }
68 | return Promise.reject(res.result)
69 | }).catch((err: BusinessError) => {
70 | logger.error(fullUrl, err.code?.toString(), err.message)
71 | promptAction.showToast({ message: err.message || '网络错误' })
72 | return Promise.reject(err)
73 | }).finally(() => {
74 | httpInstance.destroy()
75 | })
76 | }
77 |
78 | get(url: string, data?: Object): Promise> {
79 | return this.request(url, http.RequestMethod.GET, data)
80 | }
81 |
82 | post(url: string, data?: Object): Promise> {
83 | return this.request(url, http.RequestMethod.POST, data)
84 | }
85 |
86 | put(url: string, data?: Object): Promise> {
87 | return this.request(url, http.RequestMethod.PUT, data)
88 | }
89 |
90 | delete(url: string, data?: Object): Promise> {
91 | return this.request(url, http.RequestMethod.DELETE, data)
92 | }
93 | }
94 |
95 |
96 | export const hdHttp = new HdHttp({ baseURL: 'https://api-harmony-teach.itheima.net/hm/' })
--------------------------------------------------------------------------------
/commons/basic/src/main/ets/utils/themeManager.ets:
--------------------------------------------------------------------------------
1 | /**
2 | * 1. 主题设置
3 | * 2. 沉浸式设置
4 | * 3. 通知栏设置
5 | */
6 | import { ConfigurationConstant } from '@kit.AbilityKit'
7 | import { window } from '@kit.ArkUI'
8 | import { logger } from './logger'
9 |
10 | class ThemeManager {
11 | windowStage: window.Window | null = null
12 |
13 | async getWindowStage() {
14 | if (this.windowStage) {
15 | return this.windowStage
16 | } else {
17 | return await window.getLastWindow(getContext())
18 | }
19 | }
20 |
21 | initThemeSetting() {
22 | const app = getContext().getApplicationContext()
23 | app.on('environment', {
24 | onConfigurationUpdated: (config) => {
25 | logger.info('===', JSON.stringify(config))
26 | if (config.colorMode === ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT) {
27 | this.settingStatusBarBlack()
28 | }
29 | if (config.colorMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK) {
30 | this.settingStatusBarWhite()
31 | }
32 | if (config.colorMode === ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET) {
33 | // TODO
34 | }
35 | },
36 | onMemoryLevel: (_level) => {
37 | // TODO
38 | }
39 | })
40 | // 获取应用当前主题
41 | PersistentStorage.persistProp('appColorMode',
42 | ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT)
43 | const appColorMode = AppStorage.get('appColorMode')
44 | app.setColorMode(appColorMode)
45 | }
46 |
47 | settingStatusBarWhite() {
48 | this.settingStatusBar({ statusBarContentColor: '#FFFFFF' })
49 | }
50 |
51 | settingStatusBarBlack() {
52 | this.settingStatusBar({ statusBarContentColor: '#000000' })
53 | }
54 |
55 | settingStatusBar(config: window.SystemBarProperties) {
56 | this.getWindowStage()
57 | .then((windowStage: window.Window) => {
58 | windowStage.setWindowSystemBarProperties(config)
59 | })
60 | }
61 |
62 | enableFullScreen() {
63 | this.getWindowStage()
64 | .then((windowStage: window.Window) => {
65 | windowStage.setWindowLayoutFullScreen(true)
66 | const topArea = windowStage.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM)
67 | AppStorage.setOrCreate('topHeight', px2vp(topArea.topRect.height))
68 | const bottomArea = windowStage.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR)
69 | AppStorage.setOrCreate('bottomHeight', px2vp(bottomArea.bottomRect.height))
70 | })
71 | }
72 |
73 | disableFullScreen() {
74 | this.getWindowStage()
75 | .then((windowStage: window.Window) => {
76 | windowStage.setWindowLayoutFullScreen(false)
77 | AppStorage.setOrCreate('topHeight', 0)
78 | AppStorage.setOrCreate('bottomHeight', 0)
79 | })
80 | }
81 | }
82 |
83 | export const themeManager = new ThemeManager()
--------------------------------------------------------------------------------
/commons/basic/src/main/module.json5:
--------------------------------------------------------------------------------
1 | {
2 | "module": {
3 | "name": "basic",
4 | "type": "har",
5 | "deviceTypes": [
6 | "default",
7 | "tablet",
8 | "2in1"
9 | ]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/element/color.json:
--------------------------------------------------------------------------------
1 | {
2 | "color": [
3 | {
4 | "name": "common_gray_01",
5 | "value": "#979797"
6 | },
7 | {
8 | "name": "common_gray_02",
9 | "value": "#848484"
10 | },
11 | {
12 | "name": "common_gray_03",
13 | "value": "#666666"
14 | },
15 | {
16 | "name": "common_gray_bg",
17 | "value": "#f3f4f5"
18 | },
19 | {
20 | "name": "common_gray_border",
21 | "value": "#e8e7ee"
22 | },
23 | {
24 | "name": "common_main_color",
25 | "value": "#FA6D1D"
26 | },
27 | {
28 | "name": "common_green",
29 | "value": "#41B883"
30 | },
31 | {
32 | "name": "common_blue",
33 | "value": "#3266EE"
34 | },
35 | {
36 | "name": "common_blue_bg",
37 | "value": "#EDF2FF"
38 | },
39 | {
40 | "name": "black",
41 | "value": "#131313"
42 | },
43 | {
44 | "name": "white",
45 | "value": "#ffffff"
46 | },
47 | {
48 | "name": "home_gray",
49 | "value": "#EDECF2"
50 | }
51 | ]
52 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/element/float.json:
--------------------------------------------------------------------------------
1 | {
2 | "float": [
3 | {
4 | "name": "common_border_width",
5 | "value": "0.5vp"
6 | },
7 | {
8 | "name": "common_gutter",
9 | "value": "16vp"
10 | },
11 | {
12 | "name": "common_font14",
13 | "value": "14fp"
14 | },
15 | {
16 | "name": "common_font12",
17 | "value": "12fp"
18 | },
19 | {
20 | "name": "common_font10",
21 | "value": "10fp"
22 | },
23 | {
24 | "name": "common_font8",
25 | "value": "8fp"
26 | },
27 | {
28 | "name": "common_space4",
29 | "value": "4vp"
30 | },
31 | {
32 | "name": "common_space10",
33 | "value": "10vp"
34 | },
35 | {
36 | "name": "common_space16",
37 | "value": "16vp"
38 | },
39 | {
40 | "name": "hd_search_icon_size",
41 | "value": "14vp"
42 | },
43 | {
44 | "name": "hd_search_height",
45 | "value": "32vp"
46 | },
47 | {
48 | "name": "hd_search_radius",
49 | "value": "16vp"
50 | },
51 | {
52 | "name": "hd_clock_font",
53 | "value": "18fp"
54 | },
55 | {
56 | "name": "hd_clock_text_width",
57 | "value": "50vp"
58 | },
59 | {
60 | "name": "hd_clock_width",
61 | "value": "74vp"
62 | },
63 | {
64 | "name": "hd_clock_height",
65 | "value": "28vp"
66 | },
67 | {
68 | "name": "hd_tag_width",
69 | "value": "34vp"
70 | },
71 | {
72 | "name": "hd_tag_height",
73 | "value": "18vp"
74 | },
75 | {
76 | "name": "hd_tag_radius",
77 | "value": "2vp"
78 | },
79 | {
80 | "name": "hd_list_load_height",
81 | "value": "80vp"
82 | },
83 | {
84 | "name": "hd_list_load_font",
85 | "value": "14fp"
86 | },
87 | {
88 | "name": "hd_list_load_icon",
89 | "value": "24vp"
90 | }
91 | ]
92 | }
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "hd_search_placeholder",
5 | "value": "搜索题目"
6 | },
7 | {
8 | "name": "hd_clock_continue",
9 | "value": "已连续打卡"
10 | },
11 | {
12 | "name": "hd_clock_day",
13 | "value": " 天"
14 | },
15 | {
16 | "name": "hd_tag_simple",
17 | "value": "简单"
18 | },
19 | {
20 | "name": "hd_tag_general",
21 | "value": "一般"
22 | },
23 | {
24 | "name": "hd_tag_difficult",
25 | "value": "困难"
26 | },
27 | {
28 | "name": "hd_list_loading",
29 | "value": "加载中..."
30 | },
31 | {
32 | "name": "hd_list_finished",
33 | "value": "没有更多了~"
34 | },
35 | {
36 | "name": "hd_clock_in",
37 | "value": "打卡"
38 | }
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/media/ic_common_back.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/media/ic_common_clocked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/commons/basic/src/main/resources/base/media/ic_common_clocked.png
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/media/ic_common_search.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/media/ic_common_unclock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/commons/basic/src/main/resources/base/media/ic_common_unclock.png
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/media/ic_public_close.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/media/ic_public_delete.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/base/media/ic_public_ok.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/dark/element/color.json:
--------------------------------------------------------------------------------
1 | {
2 | "color": [
3 | {
4 | "name": "common_gray_01",
5 | "value": "#979797"
6 | },
7 | {
8 | "name": "common_gray_02",
9 | "value": "#848484"
10 | },
11 | {
12 | "name": "common_gray_03",
13 | "value": "#666666"
14 | },
15 | {
16 | "name": "common_gray_bg",
17 | "value": "#232323"
18 | },
19 | {
20 | "name": "common_gray_border",
21 | "value": "#323232"
22 | },
23 | {
24 | "name": "common_main_color",
25 | "value": "#FA6D1D"
26 | },
27 | {
28 | "name": "common_green",
29 | "value": "#41B883"
30 | },
31 | {
32 | "name": "common_blue",
33 | "value": "#3266EE"
34 | },
35 | {
36 | "name": "common_blue_bg",
37 | "value": "#EDF2FF"
38 | },
39 | {
40 | "name": "black",
41 | "value": "#ffffff"
42 | },
43 | {
44 | "name": "white",
45 | "value": "#131313"
46 | },
47 | {
48 | "name": "home_gray",
49 | "value": "#b3b3cc"
50 | }
51 | ]
52 | }
53 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/en_US/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "hd_search_placeholder",
5 | "value": "search question"
6 | },
7 | {
8 | "name": "hd_clock_continue",
9 | "value": "continue clock"
10 | },
11 | {
12 | "name": "hd_clock_day",
13 | "value": " day"
14 | },
15 | {
16 | "name": "hd_tag_simple",
17 | "value": "simple"
18 | },
19 | {
20 | "name": "hd_tag_general",
21 | "value": "general"
22 | },
23 | {
24 | "name": "hd_tag_difficult",
25 | "value": "difficult"
26 | },
27 | {
28 | "name": "hd_list_loading",
29 | "value": "loading..."
30 | },
31 | {
32 | "name": "hd_list_finished",
33 | "value": "no more data ~"
34 | },
35 | {
36 | "name": "hd_clock_in",
37 | "value": "clock"
38 | }
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/rawfile/detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 | Detail
9 |
11 |
12 |
28 |
29 |
30 |
31 |
39 |
40 |
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/rawfile/github.min.css:
--------------------------------------------------------------------------------
1 | pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
2 | Theme: GitHub
3 | Description: Light theme as seen on github.com
4 | Author: github.com
5 | Maintainer: @Hirse
6 | Updated: 2021-05-15
7 |
8 | Outdated base version: https://github.com/primer/github-syntax-light
9 | Current colors taken from GitHub's CSS
10 | */.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}
--------------------------------------------------------------------------------
/commons/basic/src/main/resources/zh_CN/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "hd_search_placeholder",
5 | "value": "搜索题目"
6 | },
7 | {
8 | "name": "hd_clock_continue",
9 | "value": "已连续打卡"
10 | },
11 | {
12 | "name": "hd_clock_day",
13 | "value": " 天"
14 | },
15 | {
16 | "name": "hd_tag_simple",
17 | "value": "简单"
18 | },
19 | {
20 | "name": "hd_tag_general",
21 | "value": "一般"
22 | },
23 | {
24 | "name": "hd_tag_difficult",
25 | "value": "困难"
26 | },
27 | {
28 | "name": "hd_list_loading",
29 | "value": "加载中..."
30 | },
31 | {
32 | "name": "hd_list_finished",
33 | "value": "没有更多了~"
34 | },
35 | {
36 | "name": "hd_clock_in",
37 | "value": "打卡"
38 | }
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/commons/basic/src/test/List.test.ets:
--------------------------------------------------------------------------------
1 | import localUnitTest from './LocalUnit.test';
2 |
3 | export default function testsuite() {
4 | localUnitTest();
5 | }
--------------------------------------------------------------------------------
/commons/basic/src/test/LocalUnit.test.ets:
--------------------------------------------------------------------------------
1 | import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
2 |
3 | export default function localUnitTest() {
4 | describe('localUnitTest',() => {
5 | // Defines a test suite. Two parameters are supported: test suite name and test suite function.
6 | beforeAll(() => {
7 | // Presets an action, which is performed only once before all test cases of the test suite start.
8 | // This API supports only one parameter: preset action function.
9 | });
10 | beforeEach(() => {
11 | // Presets an action, which is performed before each unit test case starts.
12 | // The number of execution times is the same as the number of test cases defined by **it**.
13 | // This API supports only one parameter: preset action function.
14 | });
15 | afterEach(() => {
16 | // Presets a clear action, which is performed after each unit test case ends.
17 | // The number of execution times is the same as the number of test cases defined by **it**.
18 | // This API supports only one parameter: clear action function.
19 | });
20 | afterAll(() => {
21 | // Presets a clear action, which is performed after all test cases of the test suite end.
22 | // This API supports only one parameter: clear action function.
23 | });
24 | it('assertContain', 0, () => {
25 | // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
26 | let a = 'abc';
27 | let b = 'b';
28 | // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
29 | expect(a).assertContain(b);
30 | expect(a).assertEqual(a);
31 | });
32 | });
33 | }
--------------------------------------------------------------------------------
/commons/calendar/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /oh_modules
3 | /.preview
4 | /build
5 | /.cxx
6 | /.test
--------------------------------------------------------------------------------
/commons/calendar/BuildProfile.ets:
--------------------------------------------------------------------------------
1 | /**
2 | * Use these variables when you tailor your ArkTS code. They must be of the const type.
3 | */
4 | export const HAR_VERSION = '2.0.2';
5 | export const BUILD_MODE_NAME = 'debug';
6 | export const DEBUG = true;
7 | export const TARGET_NAME = 'default';
8 |
9 | /**
10 | * BuildProfile Class is used only for compatibility purposes.
11 | */
12 | export default class BuildProfile {
13 | static readonly HAR_VERSION = HAR_VERSION;
14 | static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15 | static readonly DEBUG = DEBUG;
16 | static readonly TARGET_NAME = TARGET_NAME;
17 | }
--------------------------------------------------------------------------------
/commons/calendar/Index.ets:
--------------------------------------------------------------------------------
1 | export { HmCalendar, HmCalendarType, HmCalendarSelectedDay } from './src/main/ets/components/HmCalendar'
2 |
--------------------------------------------------------------------------------
/commons/calendar/build-profile.json5:
--------------------------------------------------------------------------------
1 | {
2 | "apiType": "stageMode",
3 | "buildOption": {
4 | },
5 | "buildOptionSet": [
6 | {
7 | "name": "release",
8 | "arkOptions": {
9 | "obfuscation": {
10 | "ruleOptions": {
11 | "enable": true,
12 | "files": [
13 | "./obfuscation-rules.txt"
14 | ]
15 | },
16 | "consumerFiles": [
17 | "./consumer-rules.txt"
18 | ]
19 | }
20 | },
21 | },
22 | ],
23 | "targets": [
24 | {
25 | "name": "default"
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/commons/calendar/changelog.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## Release 2.0.2
4 |
5 | - fix: month dot layout
6 |
7 | ## Release 2.0.1
8 |
9 | - fix: export type and enum
10 | - chore: remove test code
11 |
12 | ## Release 2.0.0
13 |
14 | - support harmonyos next
15 | - add mini calendar mode
16 | - add week calendar mode
17 | - support text 、textColor、backgroundColor custom
18 |
19 | ## Release 1.0.0
20 |
21 | - add min calendar component
22 | - add vp2vp until function
--------------------------------------------------------------------------------
/commons/calendar/consumer-rules.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/commons/calendar/consumer-rules.txt
--------------------------------------------------------------------------------
/commons/calendar/hvigorfile.ts:
--------------------------------------------------------------------------------
1 | import { harTasks } from '@ohos/hvigor-ohos-plugin';
2 |
3 | export default {
4 | system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5 | plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6 | }
7 |
--------------------------------------------------------------------------------
/commons/calendar/obfuscation-rules.txt:
--------------------------------------------------------------------------------
1 | # Define project specific obfuscation rules here.
2 | # You can include the obfuscation configuration files in the current module's build-profile.json5.
3 | #
4 | # For more details, see
5 | # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6 |
7 | # Obfuscation options:
8 | # -disable-obfuscation: disable all obfuscations
9 | # -enable-property-obfuscation: obfuscate the property names
10 | # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11 | # -compact: remove unnecessary blank spaces and all line feeds
12 | # -remove-log: remove all console.* statements
13 | # -print-namecache: print the name cache that contains the mapping from the old names to new names
14 | # -apply-namecache: reuse the given cache file
15 |
16 | # Keep options:
17 | # -keep-property-name: specifies property names that you want to keep
18 | # -keep-global-name: specifies names that you want to keep in the global scope
--------------------------------------------------------------------------------
/commons/calendar/oh-package-lock.json5:
--------------------------------------------------------------------------------
1 | {
2 | "meta": {
3 | "stableOrder": false
4 | },
5 | "lockfileVersion": 3,
6 | "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7 | "specifiers": {
8 | "dayjs@1.11.7": "dayjs@1.11.7"
9 | },
10 | "packages": {
11 | "dayjs@1.11.7": {
12 | "name": "dayjs",
13 | "version": "1.11.7",
14 | "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==",
15 | "resolved": "https://repo.harmonyos.com/ohpm/dayjs/-/dayjs-1.11.7.tgz",
16 | "shasum": "4b296922642f70999544d1144a2c25730fce63e2",
17 | "registryType": "ohpm"
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/commons/calendar/oh-package.json5:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@ohmos/calendar",
3 | "version": "2.0.2",
4 | "description": "a mini calendar support harmony next.",
5 | "keywords": [
6 | "calendar"
7 | ],
8 | "main": "Index.ets",
9 | "author": {
10 | "name": 'zhousg',
11 | "email": "zhousg1007@qq.com"
12 | },
13 | "license": "Apache-2.0",
14 | "repository": "https://github.com/HarmonyOS-Next/mini-calendar",
15 | "homepage": "https://github.com/HarmonyOS-Next/mini-calendar",
16 | "dependencies": {
17 | "dayjs": "1.11.7"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/commons/calendar/src/main/module.json5:
--------------------------------------------------------------------------------
1 | {
2 | "module": {
3 | "name": "calendar",
4 | "type": "har",
5 | "deviceTypes": [
6 | "default",
7 | "tablet",
8 | "2in1"
9 | ]
10 | },
11 | }
12 |
--------------------------------------------------------------------------------
/commons/calendar/src/main/resources/base/element/color.json:
--------------------------------------------------------------------------------
1 | {
2 | "color": [
3 | {
4 | "name": "hm_calendar_color",
5 | "value": "#ffaa00"
6 | },
7 | {
8 | "name": "hm_calendar_title",
9 | "value": "#6E7B8A"
10 | },
11 | {
12 | "name": "hm_calendar_invalid",
13 | "value": "#E1E4E7"
14 | },
15 | {
16 | "name": "hm_calendar_valid",
17 | "value": "#7C86A2"
18 | },
19 | {
20 | "name": "hm_calendar_arrow",
21 | "value": "#c6c6c6"
22 | },
23 | {
24 | "name": "hm_calendar_bg",
25 | "value": "#ededed"
26 | }
27 | ]
28 | }
--------------------------------------------------------------------------------
/commons/calendar/src/main/resources/base/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | },
7 | {
8 | "name": "hm_calendar_monday",
9 | "value": "一"
10 | },
11 | {
12 | "name": "hm_calendar_tuesday",
13 | "value": "二"
14 | },
15 | {
16 | "name": "hm_calendar_wednesday",
17 | "value": "三"
18 | },
19 | {
20 | "name": "hm_calendar_thursday",
21 | "value": "四"
22 | },
23 | {
24 | "name": "hm_calendar_friday",
25 | "value": "五"
26 | },
27 | {
28 | "name": "hm_calendar_saturday",
29 | "value": "六"
30 | },
31 | {
32 | "name": "hm_calendar_sunday",
33 | "value": "日"
34 | },
35 | {
36 | "name": "hm_calendar_clocked",
37 | "value": "已打卡"
38 | }
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/commons/calendar/src/main/resources/base/media/ic_public_arrow_left.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/commons/calendar/src/main/resources/base/media/ic_public_arrow_right.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/commons/calendar/src/main/resources/en_US/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | },
7 | {
8 | "name": "hm_calendar_monday",
9 | "value": "Mon"
10 | },
11 | {
12 | "name": "hm_calendar_tuesday",
13 | "value": "Tue"
14 | },
15 | {
16 | "name": "hm_calendar_wednesday",
17 | "value": "Wed"
18 | },
19 | {
20 | "name": "hm_calendar_thursday",
21 | "value": "Thu"
22 | },
23 | {
24 | "name": "hm_calendar_friday",
25 | "value": "Fri"
26 | },
27 | {
28 | "name": "hm_calendar_saturday",
29 | "value": "Sat"
30 | },
31 | {
32 | "name": "hm_calendar_sunday",
33 | "value": "Sun"
34 | },
35 | {
36 | "name": "hm_calendar_clocked",
37 | "value": "Clocked"
38 | }
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/commons/calendar/src/main/resources/zh_CN/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | },
7 | {
8 | "name": "hm_calendar_monday",
9 | "value": "一"
10 | },
11 | {
12 | "name": "hm_calendar_tuesday",
13 | "value": "二"
14 | },
15 | {
16 | "name": "hm_calendar_wednesday",
17 | "value": "三"
18 | },
19 | {
20 | "name": "hm_calendar_thursday",
21 | "value": "四"
22 | },
23 | {
24 | "name": "hm_calendar_friday",
25 | "value": "五"
26 | },
27 | {
28 | "name": "hm_calendar_saturday",
29 | "value": "六"
30 | },
31 | {
32 | "name": "hm_calendar_sunday",
33 | "value": "日"
34 | },
35 | {
36 | "name": "hm_calendar_clocked",
37 | "value": "已打卡"
38 | }
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/commons/calendar/src/test/List.test.ets:
--------------------------------------------------------------------------------
1 | import localUnitTest from './LocalUnit.test';
2 |
3 | export default function testsuite() {
4 | localUnitTest();
5 | }
--------------------------------------------------------------------------------
/commons/calendar/src/test/LocalUnit.test.ets:
--------------------------------------------------------------------------------
1 | import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
2 |
3 | export default function localUnitTest() {
4 | describe('localUnitTest',() => {
5 | // Defines a test suite. Two parameters are supported: test suite name and test suite function.
6 | beforeAll(() => {
7 | // Presets an action, which is performed only once before all test cases of the test suite start.
8 | // This API supports only one parameter: preset action function.
9 | });
10 | beforeEach(() => {
11 | // Presets an action, which is performed before each unit test case starts.
12 | // The number of execution times is the same as the number of test cases defined by **it**.
13 | // This API supports only one parameter: preset action function.
14 | });
15 | afterEach(() => {
16 | // Presets a clear action, which is performed after each unit test case ends.
17 | // The number of execution times is the same as the number of test cases defined by **it**.
18 | // This API supports only one parameter: clear action function.
19 | });
20 | afterAll(() => {
21 | // Presets a clear action, which is performed after all test cases of the test suite end.
22 | // This API supports only one parameter: clear action function.
23 | });
24 | it('assertContain', 0, () => {
25 | // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
26 | let a = 'abc';
27 | let b = 'b';
28 | // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
29 | expect(a).assertContain(b);
30 | expect(a).assertEqual(a);
31 | });
32 | });
33 | }
--------------------------------------------------------------------------------
/features/home/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /oh_modules
3 | /.preview
4 | /build
5 | /.cxx
6 | /.test
--------------------------------------------------------------------------------
/features/home/BuildProfile.ets:
--------------------------------------------------------------------------------
1 | /**
2 | * Use these variables when you tailor your ArkTS code. They must be of the const type.
3 | */
4 | export const HAR_VERSION = '1.0.0';
5 | export const BUILD_MODE_NAME = 'debug';
6 | export const DEBUG = true;
7 | export const TARGET_NAME = 'default';
8 |
9 | /**
10 | * BuildProfile Class is used only for compatibility purposes.
11 | */
12 | export default class BuildProfile {
13 | static readonly HAR_VERSION = HAR_VERSION;
14 | static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15 | static readonly DEBUG = DEBUG;
16 | static readonly TARGET_NAME = TARGET_NAME;
17 | }
--------------------------------------------------------------------------------
/features/home/Index.ets:
--------------------------------------------------------------------------------
1 | export { HomeComp } from './src/main/ets/views/HomeComp'
2 |
3 | export { QuestionListComp } from './src/main/ets/components/QuestionListComp'
4 |
5 | export { QuestionItemComp } from './src/main/ets/components/QuestionItemComp'
6 |
7 | export { QuestionDetailComp } from './src/main/ets/views/QuestionDetailComp'
8 |
9 | export { SearchComp } from './src/main/ets/views/SearchComp'
10 |
11 | export { BootView } from './src/main/ets/views/BootView'
12 |
13 | export { QuestionItem } from './src/main/ets/models/QuestionItemModel'
14 |
--------------------------------------------------------------------------------
/features/home/build-profile.json5:
--------------------------------------------------------------------------------
1 | {
2 | "apiType": "stageMode",
3 | "buildOption": {
4 | },
5 | "buildOptionSet": [
6 | {
7 | "name": "release",
8 | "arkOptions": {
9 | "obfuscation": {
10 | "ruleOptions": {
11 | "enable": true,
12 | "files": [
13 | "./obfuscation-rules.txt"
14 | ]
15 | },
16 | "consumerFiles": [
17 | "./consumer-rules.txt"
18 | ]
19 | }
20 | },
21 | },
22 | ],
23 | "targets": [
24 | {
25 | "name": "default"
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/features/home/consumer-rules.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/consumer-rules.txt
--------------------------------------------------------------------------------
/features/home/hvigorfile.ts:
--------------------------------------------------------------------------------
1 | import { harTasks } from '@ohos/hvigor-ohos-plugin';
2 |
3 | export default {
4 | system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5 | plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6 | }
7 |
--------------------------------------------------------------------------------
/features/home/obfuscation-rules.txt:
--------------------------------------------------------------------------------
1 | # Define project specific obfuscation rules here.
2 | # You can include the obfuscation configuration files in the current module's build-profile.json5.
3 | #
4 | # For more details, see
5 | # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6 |
7 | # Obfuscation options:
8 | # -disable-obfuscation: disable all obfuscations
9 | # -enable-property-obfuscation: obfuscate the property names
10 | # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11 | # -compact: remove unnecessary blank spaces and all line feeds
12 | # -remove-log: remove all console.* statements
13 | # -print-namecache: print the name cache that contains the mapping from the old names to new names
14 | # -apply-namecache: reuse the given cache file
15 |
16 | # Keep options:
17 | # -keep-property-name: specifies property names that you want to keep
18 | # -keep-global-name: specifies names that you want to keep in the global scope
--------------------------------------------------------------------------------
/features/home/oh-package-lock.json5:
--------------------------------------------------------------------------------
1 | {
2 | "meta": {
3 | "stableOrder": false
4 | },
5 | "lockfileVersion": 3,
6 | "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7 | "specifiers": {
8 | "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic",
9 | "@itcast/interview@../interview": "@itcast/interview@../interview"
10 | },
11 | "packages": {
12 | "@itcast/basic@../../commons/basic": {
13 | "name": "@itcast/basic",
14 | "version": "1.0.0",
15 | "resolved": "../../commons/basic",
16 | "registryType": "local"
17 | },
18 | "@itcast/interview@../interview": {
19 | "name": "@itcast/interview",
20 | "version": "1.0.0",
21 | "resolved": "../interview",
22 | "registryType": "local",
23 | "dependencies": {
24 | "@itcast/basic": "file:../../commons/basic"
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/features/home/oh-package.json5:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@itcast/home",
3 | "version": "1.0.0",
4 | "description": "Please describe the basic information.",
5 | "main": "Index.ets",
6 | "author": "",
7 | "license": "Apache-2.0",
8 | "dependencies": {
9 | "@itcast/basic": "file:../../commons/basic",
10 | "@itcast/interview": "file:../../features/interview",
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/features/home/src/main/ets/components/HomeDayQuestionComp.ets:
--------------------------------------------------------------------------------
1 | import { HmCalendar, HmCalendarType } from '@ohmos/calendar'
2 |
3 | @Component
4 | export struct HomeDayQuestionComp {
5 | monthWords: string[] = [
6 | "JAN",
7 | "FEB",
8 | "MAR",
9 | "APR",
10 | "MAY",
11 | "JUN",
12 | "JUL",
13 | "AUG",
14 | "SEP",
15 | "OCT",
16 | "NOV",
17 | "DEC"
18 | ]
19 | monthText: string = this.monthWords[new Date().getMonth()]
20 | today: string = new Date().getDate().toString().padStart(2, '0')
21 |
22 | build() {
23 | Row() {
24 | Row() {
25 | Column() {
26 | Text(this.monthText)
27 | .fontColor('#fc3c30')
28 | .fontSize(12)
29 | .fontWeight(500)
30 | .margin(4)
31 | Text(this.today)
32 | .fontSize(22)
33 | }
34 | .height(60)
35 | .width(44)
36 | .translate({ y: -10 })
37 | .backgroundColor($r('app.color.white'))
38 | .borderRadius(8)
39 | .margin({ left: 12 })
40 | .shadow(ShadowStyle.OUTER_DEFAULT_LG)
41 | .justifyContent(FlexAlign.Center)
42 |
43 | Column() {
44 | Text('每日 1 题')
45 | .fontColor(14)
46 | .fontSize(10)
47 | .margin({ bottom: 8 })
48 | Text('JS 闭包你是怎么理解的?')
49 | .fontSize(12)
50 | .fontWeight(FontWeight.Bold)
51 | .textOverflow({
52 | overflow: TextOverflow.Ellipsis
53 | })
54 | .maxLines(1)
55 | }
56 | .layoutWeight(1)
57 | .alignItems(HorizontalAlign.Start)
58 | .padding({ left: 20 })
59 |
60 | HmCalendar({
61 | type: HmCalendarType.MONTH_DOT,
62 | selectedDays: [{ date: new Date().toString() }],
63 | color: 'green'
64 | })
65 | .margin({ right: 20 })
66 | }
67 | .width('100%')
68 | .height(60)
69 | .backgroundColor($r('app.color.home_gray'))
70 | .borderRadius(8)
71 | }
72 | .padding(16)
73 | }
74 | }
--------------------------------------------------------------------------------
/features/home/src/main/ets/components/HomeQuestionCardComp.ets:
--------------------------------------------------------------------------------
1 | @Component
2 | export struct HomeQuestionCardComp {
3 | linearColor: LinerColorType = LinerColorType.GREEN
4 | title: string = ''
5 | subTitle: string = ''
6 |
7 | build() {
8 | Row() {
9 | Column() {
10 | Text(this.title)
11 | .fontSize(14)
12 | .padding({ top: 8, bottom: 8 })
13 | .fontColor(Color.White)
14 | Text(this.subTitle)
15 | .fontSize(10)
16 | .fontColor(Color.White)
17 | }
18 | .alignItems(HorizontalAlign.Start)
19 | .layoutWeight(1)
20 | .alignSelf(ItemAlign.Start)
21 | .padding({ right: 8 })
22 |
23 | Image(IMAGES[this.linearColor])
24 | .width(50)
25 | .alignSelf(ItemAlign.End)
26 | }
27 | .padding(8)
28 | .width(140)
29 | .height(100)
30 | .linearGradient({
31 | colors: LINEAR_COLOR[this.linearColor]
32 | })
33 | .borderRadius(8)
34 | }
35 | }
36 |
37 | enum LinerColorType {
38 | GREEN,
39 | BLUE,
40 | YELLOW,
41 | ORANGE,
42 | }
43 |
44 | const LINEAR_COLOR: [ResourceColor, number][][] = [
45 | [['#026bf1', 0], ['#52d3ff', 1]],
46 | [['#fe6544', 0], ['#fdd081', 1]],
47 | [['#1FDE06', 0], ['#61F27A', 1]],
48 | [['#fe954a', 0], ['#f9b388', 1]],
49 | ]
50 |
51 | const IMAGES: ResourceStr[] = [
52 | $r('app.media.card01'),
53 | $r('app.media.card02'),
54 | $r('app.media.card03'),
55 | $r('app.media.card04'),
56 | ]
--------------------------------------------------------------------------------
/features/home/src/main/ets/components/QuestionItemComp.ets:
--------------------------------------------------------------------------------
1 | import { HdTag } from '@itcast/basic'
2 | import { QuestionItem, QuestionItemModel } from '../models/QuestionItemModel'
3 |
4 | @Component
5 | export struct QuestionItemComp {
6 | item: QuestionItemModel = {} as QuestionItem
7 | onClickItem: () => void = () => {
8 | }
9 |
10 | @Builder
11 | SplitBuilder() {
12 | Text('|')
13 | .width(30)
14 | .textAlign(TextAlign.Center)
15 | .fontColor($r('app.color.common_gray_01'))
16 | .fontSize(13)
17 | }
18 |
19 | @Builder
20 | TextBuilder(text: string) {
21 | Text(text)
22 | .fontColor($r('app.color.common_gray_01'))
23 | .fontSize(13)
24 | }
25 |
26 | build() {
27 | Column() {
28 | Row({ space: 5 }) {
29 | HdTag({ difficulty: this.item.difficulty })
30 | Text(this.item.stem)
31 | .fontSize(15)
32 | .layoutWeight(1)
33 | .textOverflow({ overflow: TextOverflow.Ellipsis })
34 | .maxLines(1)
35 | .fontWeight(500)
36 | }.width('100%')
37 |
38 | Row() {
39 | this.TextBuilder(`点赞 ${this.item.likeCount}`)
40 | this.SplitBuilder()
41 | this.TextBuilder(`浏览 ${this.item.views}`)
42 | if (this.item.readFlag === 1) {
43 | this.SplitBuilder()
44 | this.TextBuilder(`已看过`)
45 | }
46 | }
47 | .width('100%')
48 | .margin({ top: 10 })
49 | }
50 | .height(80)
51 | .justifyContent(FlexAlign.Center)
52 | .width('100%')
53 | .onClick(e => {
54 | this.onClickItem()
55 | })
56 | }
57 | }
--------------------------------------------------------------------------------
/features/home/src/main/ets/components/QuestionListComp.ets:
--------------------------------------------------------------------------------
1 | import { authStore, HdList, HdListController } from '@itcast/basic/Index'
2 | import { QuestionItem, QuestionItemModel } from '../models/QuestionItemModel'
3 | import { QuestionItemComp } from './QuestionItemComp'
4 | import promptAction from '@ohos.promptAction'
5 | import { QuestionService } from '../services/QuestionService'
6 |
7 | export interface DetailParams {
8 | item: QuestionItem,
9 | list: QuestionItem[]
10 | }
11 |
12 | @Component
13 | export struct QuestionListComp {
14 | @Prop
15 | typeId: number
16 | @Prop
17 | keyword: string = ''
18 | @Prop
19 | activeIndex: number = -1
20 | @Prop
21 | @Watch('reLoad')
22 | difficult: number = -1
23 | @Prop
24 | @Watch('reLoad')
25 | sort: number = -1
26 | @State
27 | page: number = 1
28 | @State
29 | list: QuestionItemModel[] = []
30 | // self index
31 | selfIndex: number = -1
32 | timer: number = 0
33 | controller = new HdListController()
34 |
35 | onLoad() {
36 | QuestionService.findQuestionList({
37 | questionBankType: 10,
38 | type: this.typeId,
39 | page: this.page,
40 | sort: this.sort,
41 | keyword: this.keyword
42 | }).then(res => {
43 | this.list.push(...res.data.rows)
44 | this.controller.loaded()
45 | if (this.page < res.data.pageTotal) {
46 | this.page++
47 | } else {
48 | this.controller.finished()
49 | }
50 | })
51 |
52 | }
53 |
54 | onRefresh() {
55 | this.page = 1
56 | Promise.all([
57 | new Promise((resolve, reject) => {
58 | setTimeout(() => {
59 | resolve()
60 | }, 1000)
61 | }),
62 | QuestionService.findQuestionList({
63 | questionBankType: 10,
64 | type: this.typeId,
65 | page: this.page,
66 | sort: this.sort,
67 | keyword: this.keyword
68 | })
69 | ]).then(arr => {
70 | this.list = arr[1].data.rows
71 | this.controller.refreshed()
72 | promptAction.showToast({ message: '已更新' })
73 | if (this.page < arr[1].data.pageTotal) {
74 | this.page++
75 | } else {
76 | this.controller.finished()
77 | }
78 | })
79 | }
80 |
81 | reLoad() {
82 | if (this.list.length && this.activeIndex === this.selfIndex) {
83 | if (this.timer) clearTimeout(this.timer)
84 | this.timer = setTimeout(() => {
85 | this.controller.reload()
86 | this.onRefresh()
87 | })
88 | }
89 | }
90 |
91 | build() {
92 | HdList({
93 | controller: this.controller,
94 | onLoad: () => {
95 | this.onLoad()
96 | },
97 | onRefresh: () => {
98 | this.onRefresh()
99 | }
100 | }) {
101 | ForEach(this.list, (item: QuestionItemModel) => {
102 | ListItem() {
103 | QuestionItemComp({
104 | item,
105 | onClickItem: () => {
106 | const params: DetailParams = { item, list: this.list }
107 | authStore.checkAuth({
108 | url: 'pages/QuestionDetailPage',
109 | params: params
110 | })
111 | }
112 | })
113 | }
114 | })
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/features/home/src/main/ets/components/SearchHistoryComp.ets:
--------------------------------------------------------------------------------
1 | import { historyStore } from '../utils/history'
2 |
3 | interface BtnItem {
4 | text: string
5 | onClick?: () => void
6 | }
7 |
8 |
9 | @Component
10 | export struct SearchHistoryComp {
11 | @State
12 | isDeleting: boolean = false
13 | onSearch: (val: string) => void = () => {
14 | }
15 | @State
16 | keywords: string[] = []
17 |
18 | aboutToAppear(): void {
19 | this.keywords = historyStore.getAll()
20 | }
21 |
22 | build() {
23 | // 搜索历史
24 | Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) {
25 | Row() {
26 | Text('搜索记录')
27 | .fontSize(15)
28 | .fontColor($r('app.color.common_gray_01'))
29 | Blank()
30 | if (this.isDeleting) {
31 | Text() {
32 | Span('全部删除')
33 | .onClick(() => {
34 | historyStore.clear()
35 | this.keywords = historyStore.getAll()
36 | })
37 | Span(' | ')
38 | Span('完成')
39 | .onClick(() => {
40 | this.isDeleting = false
41 | })
42 | }
43 | .fontSize(14)
44 | .fontColor($r('app.color.common_gray_01'))
45 | } else {
46 | Image($r('app.media.ic_public_delete'))
47 | .width(16)
48 | .aspectRatio(1)
49 | .fillColor($r('app.color.common_gray_01'))
50 | .onClick(() => {
51 | this.isDeleting = true
52 | })
53 | }
54 | }
55 | .width('100%')
56 |
57 | ForEach(this.keywords, (keyword: string) => {
58 | Row({ space: 8 }) {
59 | Text(keyword)
60 | .fontSize(14)
61 | .fontColor('#6F6F6F')
62 | if (this.isDeleting) {
63 | Image($r('app.media.ic_public_close'))
64 | .width(12)
65 | .aspectRatio(1)
66 | .fillColor('#878787')
67 | .onClick(() => {
68 | historyStore.delItem(keyword)
69 | this.keywords = historyStore.getAll()
70 | })
71 | }
72 | }
73 | .padding({ left: 12, right: 12 })
74 | .height(32)
75 | .backgroundColor('#f3f4f5')
76 | .borderRadius(16)
77 | .margin({ right: 15, top: 15 })
78 | .onClick(() => {
79 | if (!this.isDeleting) {
80 | this.onSearch(keyword)
81 | }
82 | })
83 | })
84 | }
85 | .padding(15)
86 | }
87 | }
--------------------------------------------------------------------------------
/features/home/src/main/ets/models/QuestionItemModel.ets:
--------------------------------------------------------------------------------
1 | export interface QuestionItem {
2 | id: string
3 | stem: string
4 | difficulty: number
5 | likeCount: number
6 | views: number
7 | readFlag: 0 | 1
8 | }
9 |
10 | export class QuestionItemModel implements QuestionItem {
11 | id: string = ''
12 | stem: string = ''
13 | difficulty: number = 0
14 | likeCount: number = 0
15 | views: number = 0
16 | readFlag: 0 | 1 = 0
17 |
18 | constructor(model: QuestionItem) {
19 | this.id = model.id
20 | this.stem = model.stem
21 | this.difficulty = model.difficulty
22 | this.likeCount = model.likeCount
23 | this.views = model.views
24 | this.readFlag = model.readFlag
25 | }
26 | }
27 |
28 | export interface QuestionDetail extends QuestionItem {
29 | answer: string
30 | collectFlag: 0 | 1
31 | likeFlag: 0 | 1
32 | stage: Array
33 | }
34 |
35 | export const questionListData: QuestionItem[] = [
36 | {
37 | id: '100',
38 | stem: '@Prop 是否可以设置默认值?',
39 | difficulty: 1,
40 | likeCount: 102,
41 | views: 321,
42 | readFlag: 0
43 | },
44 | {
45 | id: '101',
46 | stem: '@State支持哪些类型数据?',
47 | difficulty: 2,
48 | likeCount: 32,
49 | views: 854,
50 | readFlag: 0
51 | },
52 | {
53 | id: '102',
54 | stem: 'Vue3中内置组件有哪些?分别有什么作用?',
55 | difficulty: 3,
56 | likeCount: 10,
57 | views: 1002,
58 | readFlag: 0
59 | },
60 | {
61 | id: '103',
62 | stem: '华为支付如何实现?',
63 | difficulty: 4,
64 | likeCount: 45,
65 | views: 123,
66 | readFlag: 0
67 | },
68 | {
69 | id: '104',
70 | stem: '运动健康服务如何开启?',
71 | difficulty: 5,
72 | likeCount: 90,
73 | views: 423,
74 | readFlag: 0
75 | },
76 | {
77 | id: '105',
78 | stem: '@Prop 是否可以设计默认值?',
79 | difficulty: 1,
80 | likeCount: 345,
81 | views: 5433,
82 | readFlag: 0
83 | },
84 | {
85 | id: '106',
86 | stem: '@State支持哪些类型数据?',
87 | difficulty: 2,
88 | likeCount: 23,
89 | views: 139,
90 | readFlag: 0
91 | },
92 | {
93 | id: '107',
94 | stem: 'Vue3中内置组件有哪些?',
95 | difficulty: 3,
96 | likeCount: 12,
97 | views: 767,
98 | readFlag: 0
99 | },
100 | {
101 | id: '108',
102 | stem: '华为支付如何实现?',
103 | difficulty: 4,
104 | likeCount: 65,
105 | views: 723,
106 | readFlag: 0
107 | },
108 | {
109 | id: '109',
110 | stem: '运动健康服务如何开启?',
111 | difficulty: 5,
112 | likeCount: 12,
113 | views: 432,
114 | readFlag: 0
115 | }
116 | ]
117 |
118 | export class QuestionListParams {
119 | type: number = 0
120 | page: number = 1
121 | questionBankType: number = 9
122 | sort?: number = 0
123 | keyword?: string = ''
124 | difficult?: number = 0
125 | }
--------------------------------------------------------------------------------
/features/home/src/main/ets/models/QuestionTypeModel.ets:
--------------------------------------------------------------------------------
1 | export interface QuestionType {
2 | id: number
3 | name: string
4 | displayNewestFlag: 0 | 1
5 | }
6 |
7 | export class QuestionTypeModel implements QuestionType {
8 | id: number = 0
9 | name: string = ''
10 | displayNewestFlag: 0 | 1 = 0
11 |
12 | constructor(model: QuestionType) {
13 | this.id = model.id
14 | this.name = model.name
15 | this.displayNewestFlag = model.displayNewestFlag
16 | }
17 | }
18 |
19 | export const questionTypeData: QuestionType[] = [
20 | {
21 | id: 1,
22 | name: "全部",
23 | displayNewestFlag: 0,
24 | },
25 | {
26 | id: 21,
27 | name: "鸿蒙",
28 | displayNewestFlag: 0,
29 | },
30 | {
31 | id: 18,
32 | name: "HTML5",
33 | displayNewestFlag: 0,
34 | },
35 | {
36 | id: 26,
37 | name: "Vue",
38 | displayNewestFlag: 1,
39 | },
40 | {
41 | id: 19,
42 | name: "CSS3",
43 | displayNewestFlag: 0,
44 | },
45 | {
46 | id: 20,
47 | name: "移动端布局",
48 | displayNewestFlag: 1,
49 | },
50 | {
51 | id: 22,
52 | name: "jQuery",
53 | displayNewestFlag: 0,
54 | },
55 | {
56 | id: 23,
57 | name: "AJAX",
58 | displayNewestFlag: 0,
59 | },
60 | {
61 | id: 25,
62 | name: "Node",
63 | displayNewestFlag: 0,
64 | },
65 | {
66 | id: 27,
67 | name: "React",
68 | displayNewestFlag: 0,
69 | },
70 | {
71 | id: 28,
72 | name: "小程序",
73 | displayNewestFlag: 0,
74 | },
75 | {
76 | id: 304,
77 | name: "其它",
78 | displayNewestFlag: 0,
79 | },
80 | {
81 | id: 399,
82 | name: "性能优化",
83 | displayNewestFlag: 1,
84 | },
85 | {
86 | id: 398,
87 | name: "兼容性问题",
88 | displayNewestFlag: 1,
89 | },
90 | ];
91 |
--------------------------------------------------------------------------------
/features/home/src/main/ets/services/QuestionService.ets:
--------------------------------------------------------------------------------
1 | import { hdHttp } from '@itcast/basic'
2 | import { QuestionItemModel, QuestionListParams } from '../models/QuestionItemModel'
3 | import { QuestionTypeModel } from '../models/QuestionTypeModel'
4 |
5 | interface PageResult {
6 | total: number
7 | pageTotal: number
8 | rows: QuestionItemModel[]
9 | }
10 |
11 | export class QuestionService {
12 | static findQuestionTypeList() {
13 | return hdHttp.get('question/type')
14 | }
15 |
16 | static findQuestionList(params: QuestionListParams) {
17 | return hdHttp.get('question/list', params)
18 | }
19 | }
--------------------------------------------------------------------------------
/features/home/src/main/ets/utils/history.ets:
--------------------------------------------------------------------------------
1 | import { preferences } from '@kit.ArkData'
2 |
3 | class HistoryStore {
4 | KEY = 'historyStore'
5 | store = preferences.getPreferencesSync(getContext(), { name: this.KEY })
6 |
7 | setItem(keyword: string) {
8 | this.store.putSync(keyword, keyword)
9 | this.store.flush()
10 | }
11 |
12 | delItem(keyword: string) {
13 | this.store.deleteSync(keyword)
14 | this.store.flush()
15 | }
16 |
17 | clear() {
18 | this.store.clearSync()
19 | }
20 |
21 | getAll() {
22 | const obj = this.store.getAllSync()
23 | return Object.keys(obj)
24 | }
25 | }
26 |
27 | export const historyStore = new HistoryStore()
--------------------------------------------------------------------------------
/features/home/src/main/ets/views/BootView.ets:
--------------------------------------------------------------------------------
1 | import { router } from '@kit.ArkUI'
2 |
3 | @Component
4 | export struct BootView {
5 | @StorageProp('topHeight')
6 | topHeight: number = 0
7 | @State
8 | time: number = 2
9 | timer: number | null = null
10 |
11 | aboutToAppear(): void {
12 | this.timer = setInterval(() => {
13 | this.time--
14 | if (this.time <= 0) {
15 | router.replaceUrl({ url: 'pages/Index' })
16 | }
17 | }, 1000)
18 | }
19 |
20 | aboutToDisappear(): void {
21 | clearInterval(this.timer)
22 | }
23 |
24 | build() {
25 | Column() {
26 | Text(this.time + 's')
27 | .width(50)
28 | .height(24)
29 | .borderRadius(12)
30 | .textAlign(TextAlign.Center)
31 | .fontSize(14)
32 | .backgroundColor('#33000000')
33 | .fontColor($r('app.color.white'))
34 | .alignSelf(ItemAlign.End)
35 | .margin({ right: 20, top: this.topHeight + 20 })
36 | }
37 | .width('100%')
38 | .height('100%')
39 | .backgroundImage($r('app.media.boot'))
40 | .backgroundImageSize(ImageSize.Cover)
41 | .geometryTransition("boot")
42 | .transition(TransitionEffect.OPACITY)
43 | }
44 | }
--------------------------------------------------------------------------------
/features/home/src/main/ets/views/SearchComp.ets:
--------------------------------------------------------------------------------
1 | import { HdSearch, HdTab, HdTabItem } from '@itcast/basic'
2 | import { InterviewListComp } from '@itcast/interview'
3 | import { router } from '@kit.ArkUI'
4 | import { QuestionListComp } from '../components/QuestionListComp'
5 | import { SearchHistoryComp } from '../components/SearchHistoryComp'
6 | import { historyStore } from '../utils/history'
7 |
8 | interface RouterParams {
9 | type?: number
10 | questionBankType: 9 | 10
11 | }
12 |
13 | @Component
14 | export struct SearchComp {
15 | @StorageProp('topHeight')
16 | topHeight: number = 0
17 | @State
18 | left: number = 15
19 | @State
20 | questionBankType: 9 | 10 = 10
21 | @State
22 | isSearching: Boolean = false
23 | @State
24 | keyword: string = ''
25 | // tab
26 | tabConfig: HdTabItem[] = [
27 | { name: '试题', value: 10 },
28 | { name: '面经', value: 9 }
29 | ]
30 |
31 | aboutToAppear(): void {
32 | const params = (router.getParams() || {}) as RouterParams
33 | this.questionBankType = params.questionBankType
34 | }
35 |
36 | build() {
37 | Column() {
38 | Row({ space: 15 }) {
39 | HdSearch({
40 | ph: '请输入关键词',
41 | readonlyMode: false,
42 | bg: '#f3f4f5',
43 | val: this.keyword,
44 | onSubmit: () => {
45 | if (this.keyword) {
46 | this.isSearching = true
47 | historyStore.setItem(this.keyword)
48 | }
49 | },
50 | onChange: (val: string) => {
51 | this.keyword = val
52 | if (!val) {
53 | this.isSearching = false
54 | }
55 | }
56 | })
57 | .layoutWeight(1)
58 | Text('取消')
59 | .fontSize(15)
60 | .fontColor($r('app.color.black'))
61 | .onClick(() => router.back())
62 | }
63 | .padding({ top: 15, left: 15, right: 15, bottom: 2 })
64 |
65 | HdTab({
66 | tabConfig: this.tabConfig,
67 | activeIndex: this.questionBankType === 9 ? 1 : 0,
68 | onTabClick: (item) => {
69 | this.questionBankType = item.value as 9 | 10
70 | }
71 | })
72 |
73 | if (this.isSearching) {
74 | if (this.questionBankType === 10) {
75 | QuestionListComp({
76 | keyword: encodeURIComponent(this.keyword),
77 | sort: 0
78 | })
79 | .layoutWeight(1)
80 | }
81 | if (this.questionBankType === 9) {
82 | InterviewListComp({
83 | keyword: encodeURIComponent(this.keyword)
84 | })
85 | }
86 | } else {
87 | SearchHistoryComp({
88 | onSearch: (text: string) => {
89 | this.keyword = text
90 | this.isSearching = true
91 | }
92 | })
93 | }
94 | }
95 | .padding({ top: this.topHeight })
96 | }
97 | }
--------------------------------------------------------------------------------
/features/home/src/main/module.json5:
--------------------------------------------------------------------------------
1 | {
2 | "module": {
3 | "name": "home",
4 | "type": "har",
5 | "deviceTypes": [
6 | "default",
7 | "tablet",
8 | "2in1"
9 | ]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/element/float.json:
--------------------------------------------------------------------------------
1 | {
2 | "float": [
3 | {
4 | "name": "float_1",
5 | "value": "30.6"
6 | }
7 | ]
8 | }
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/banner_ai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/banner_ai.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/banner_pj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/banner_pj.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/banner_qa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/banner_qa.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/boot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/boot.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/card01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/card01.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/card02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/card02.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/card03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/card03.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/card04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/card04.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/ic_home_filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/ic_home_filter.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/ic_home_more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/ic_home_more.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/base/media/ic_home_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/home/src/main/resources/base/media/ic_home_new.png
--------------------------------------------------------------------------------
/features/home/src/main/resources/en_US/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/home/src/main/resources/zh_CN/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/home/src/test/List.test.ets:
--------------------------------------------------------------------------------
1 | import localUnitTest from './LocalUnit.test';
2 |
3 | export default function testsuite() {
4 | localUnitTest();
5 | }
--------------------------------------------------------------------------------
/features/home/src/test/LocalUnit.test.ets:
--------------------------------------------------------------------------------
1 | import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
2 |
3 | export default function localUnitTest() {
4 | describe('localUnitTest',() => {
5 | // Defines a test suite. Two parameters are supported: test suite name and test suite function.
6 | beforeAll(() => {
7 | // Presets an action, which is performed only once before all test cases of the test suite start.
8 | // This API supports only one parameter: preset action function.
9 | });
10 | beforeEach(() => {
11 | // Presets an action, which is performed before each unit test case starts.
12 | // The number of execution times is the same as the number of test cases defined by **it**.
13 | // This API supports only one parameter: preset action function.
14 | });
15 | afterEach(() => {
16 | // Presets a clear action, which is performed after each unit test case ends.
17 | // The number of execution times is the same as the number of test cases defined by **it**.
18 | // This API supports only one parameter: clear action function.
19 | });
20 | afterAll(() => {
21 | // Presets a clear action, which is performed after all test cases of the test suite end.
22 | // This API supports only one parameter: clear action function.
23 | });
24 | it('assertContain', 0, () => {
25 | // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
26 | let a = 'abc';
27 | let b = 'b';
28 | // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
29 | expect(a).assertContain(b);
30 | expect(a).assertEqual(a);
31 | });
32 | });
33 | }
--------------------------------------------------------------------------------
/features/interview/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /oh_modules
3 | /.preview
4 | /build
5 | /.cxx
6 | /.test
--------------------------------------------------------------------------------
/features/interview/BuildProfile.ets:
--------------------------------------------------------------------------------
1 | /**
2 | * Use these variables when you tailor your ArkTS code. They must be of the const type.
3 | */
4 | export const HAR_VERSION = '1.0.0';
5 | export const BUILD_MODE_NAME = 'debug';
6 | export const DEBUG = true;
7 | export const TARGET_NAME = 'default';
8 |
9 | /**
10 | * BuildProfile Class is used only for compatibility purposes.
11 | */
12 | export default class BuildProfile {
13 | static readonly HAR_VERSION = HAR_VERSION;
14 | static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15 | static readonly DEBUG = DEBUG;
16 | static readonly TARGET_NAME = TARGET_NAME;
17 | }
--------------------------------------------------------------------------------
/features/interview/Index.ets:
--------------------------------------------------------------------------------
1 | export { InterviewComp } from './src/main/ets/views/InterviewComp'
2 |
3 | export { InterviewDetailComp } from './src/main/ets/views/InterviewDetailComp'
4 |
5 | export { InterviewListComp } from './src/main/ets/components/InterviewListComp'
6 |
7 | export { InterviewItemComp } from './src/main/ets/components/InterviewItemComp'
8 |
9 | export { InterviewItem } from './src/main/ets/models/InterviewItemModel'
10 |
--------------------------------------------------------------------------------
/features/interview/build-profile.json5:
--------------------------------------------------------------------------------
1 | {
2 | "apiType": "stageMode",
3 | "buildOption": {
4 | },
5 | "buildOptionSet": [
6 | {
7 | "name": "release",
8 | "arkOptions": {
9 | "obfuscation": {
10 | "ruleOptions": {
11 | "enable": true,
12 | "files": [
13 | "./obfuscation-rules.txt"
14 | ]
15 | },
16 | "consumerFiles": [
17 | "./consumer-rules.txt"
18 | ]
19 | }
20 | },
21 | },
22 | ],
23 | "targets": [
24 | {
25 | "name": "default"
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/features/interview/consumer-rules.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/interview/consumer-rules.txt
--------------------------------------------------------------------------------
/features/interview/hvigorfile.ts:
--------------------------------------------------------------------------------
1 | import { harTasks } from '@ohos/hvigor-ohos-plugin';
2 |
3 | export default {
4 | system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5 | plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6 | }
7 |
--------------------------------------------------------------------------------
/features/interview/obfuscation-rules.txt:
--------------------------------------------------------------------------------
1 | # Define project specific obfuscation rules here.
2 | # You can include the obfuscation configuration files in the current module's build-profile.json5.
3 | #
4 | # For more details, see
5 | # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6 |
7 | # Obfuscation options:
8 | # -disable-obfuscation: disable all obfuscations
9 | # -enable-property-obfuscation: obfuscate the property names
10 | # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11 | # -compact: remove unnecessary blank spaces and all line feeds
12 | # -remove-log: remove all console.* statements
13 | # -print-namecache: print the name cache that contains the mapping from the old names to new names
14 | # -apply-namecache: reuse the given cache file
15 |
16 | # Keep options:
17 | # -keep-property-name: specifies property names that you want to keep
18 | # -keep-global-name: specifies names that you want to keep in the global scope
--------------------------------------------------------------------------------
/features/interview/oh-package-lock.json5:
--------------------------------------------------------------------------------
1 | {
2 | "meta": {
3 | "stableOrder": false
4 | },
5 | "lockfileVersion": 3,
6 | "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7 | "specifiers": {
8 | "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic"
9 | },
10 | "packages": {
11 | "@itcast/basic@../../commons/basic": {
12 | "name": "@itcast/basic",
13 | "version": "1.0.0",
14 | "resolved": "../../commons/basic",
15 | "registryType": "local"
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/features/interview/oh-package.json5:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@itcast/interview",
3 | "version": "1.0.0",
4 | "description": "Please describe the basic information.",
5 | "main": "Index.ets",
6 | "author": "",
7 | "license": "Apache-2.0",
8 | "dependencies": {
9 | "@itcast/basic": "file:../../commons/basic"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/features/interview/src/main/ets/components/InterviewItemComp.ets:
--------------------------------------------------------------------------------
1 | import { authStore, BasicConstant, HdTag } from '@itcast/basic'
2 | import { InterviewItem, InterviewItemModel } from '../models/InterviewItemModel'
3 |
4 | @Component
5 | export struct InterviewItemComp {
6 | item: InterviewItemModel = new InterviewItemModel({} as InterviewItem)
7 |
8 | @Builder
9 | menuBuilder() {
10 | Menu() {
11 | MenuItem({ content: '屏蔽' }).width(64)
12 | MenuItem({ content: '举报' }).width(64)
13 | }
14 | .radius(12)
15 | }
16 |
17 | build() {
18 | Column({ space: 12 }) {
19 | Row({ space: BasicConstant.SPACE_MD }) {
20 | Image(this.item.creatorAvatar)
21 | .width(36)
22 | .aspectRatio(1)
23 | Column({ space: BasicConstant.SPACE_SM }) {
24 | Text(this.item.stem)
25 | .fontWeight(600)
26 | .maxLines(1)
27 | .textOverflow({ overflow: TextOverflow.Ellipsis })
28 | Text() {
29 | Span(this.item.creatorName)
30 | Span(' · ')
31 | Span(this.item.createdAt)
32 | }
33 | .fontSize($r('app.float.common_font10'))
34 | .fontColor('#bdbdbd')
35 | }
36 | .alignItems(HorizontalAlign.Start)
37 | .layoutWeight(1)
38 |
39 | Image($r('app.media.ic_interview_more'))
40 | .width(20)
41 | .aspectRatio(1)
42 | .alignSelf(ItemAlign.Start)
43 | .bindMenu(this.menuBuilder())
44 | }
45 |
46 | Text(this.item.content)
47 | .fontSize($r('app.float.common_font14'))
48 | .fontColor($r('app.color.common_gray_03'))
49 | .maxLines(2)
50 | .textOverflow({ overflow: TextOverflow.Ellipsis })
51 | .lineHeight(20)
52 | .width('100%')
53 |
54 | Row({ space: BasicConstant.SPACE_SM }) {
55 | ForEach(['大厂', '面经'], (tag: string) => {
56 | HdTag({ text: tag })
57 | })
58 | }
59 | .width('100%')
60 |
61 | Text() {
62 | Span('点赞 ' + this.item.likeCount)
63 | Span(' · ')
64 | Span('浏览 ' + this.item.views)
65 | if (this.item.likeFlag === 1) {
66 | Span(' · ')
67 | Span('已点赞')
68 | }
69 | }
70 | .width('100%')
71 | .fontSize($r('app.float.common_font12'))
72 | .fontColor('#bdbdbd')
73 | }
74 | .padding({ top: 16, bottom: 16 })
75 | .onClick(() => {
76 | authStore.checkAuth({ url: 'pages/InterviewDetailPage', params: this.item })
77 | })
78 | }
79 | }
--------------------------------------------------------------------------------
/features/interview/src/main/ets/components/InterviewListComp.ets:
--------------------------------------------------------------------------------
1 | import { InterviewItemComp } from './InterviewItemComp'
2 | import { InterviewItemModel } from '../models/InterviewItemModel'
3 | import { HdList, HdListController } from '@itcast/basic/Index'
4 | import promptAction from '@ohos.promptAction'
5 | import { InterviewService } from '../services/InterviewService'
6 |
7 | @Component
8 | export struct InterviewListComp {
9 | @State
10 | list: InterviewItemModel[] = []
11 | controller = new HdListController()
12 | @State
13 | page: number = 1
14 | @State
15 | keyword: string = ''
16 | @Prop
17 | @Watch('onUpdate')
18 | sort: number = 30
19 | timer: number = -1
20 |
21 | onUpdate() {
22 | if (this.timer) clearTimeout(this.timer)
23 | this.timer = setTimeout(() => {
24 | this.controller.reload()
25 | this.onRefresh()
26 | }, 500)
27 | }
28 |
29 | onRefresh() {
30 | this.page = 1
31 | InterviewService.findInterviewList({
32 | questionBankType: 9,
33 | page: this.page,
34 | sort: this.sort,
35 | keyword: this.keyword
36 | }).then(res => {
37 | this.list = res.data.rows
38 | this.controller.refreshed()
39 | if (this.page >= res.data.pageTotal) {
40 | this.controller.finished()
41 | } else {
42 | this.page++
43 | }
44 | promptAction.showToast({ message: '已更新' })
45 | })
46 | }
47 |
48 | build() {
49 | HdList({
50 | lw: 1,
51 | controller: this.controller,
52 | onRefresh: () => {
53 | this.onRefresh()
54 | },
55 | onLoad: () => {
56 | InterviewService.findInterviewList({
57 | questionBankType: 9,
58 | page: this.page,
59 | sort: this.sort,
60 | keyword: this.keyword
61 | }).then(res => {
62 | this.list.push(...res.data.rows)
63 | this.controller.loaded()
64 | if (this.page >= res.data.pageTotal) {
65 | this.controller.finished()
66 | } else {
67 | this.page++
68 | }
69 | })
70 | }
71 | }) {
72 | ForEach(this.list, (item: InterviewItemModel) => {
73 | ListItem() {
74 | InterviewItemComp({ item })
75 | }
76 | })
77 | }
78 |
79 | // .width('100%')
80 | // .layoutWeight(1)
81 |
82 | // .divider({
83 | // strokeWidth: 8,
84 | // color: $r('app.color.common_gray_bg'),
85 | // })
86 | }
87 | }
--------------------------------------------------------------------------------
/features/interview/src/main/ets/models/InterviewItemModel.ets:
--------------------------------------------------------------------------------
1 | export interface InterviewItem {
2 | id: string
3 | stem: string
4 | content: string
5 | likeCount: number
6 | views: number
7 | creatorName: string
8 | creatorAvatar: ResourceStr
9 | createdAt: string
10 | stage: string[]
11 | likeFlag: 0 | 1 | null
12 | relatedQuestions: InterviewRelatedQuestion[] | null
13 | }
14 |
15 | export interface InterviewRelatedQuestion {
16 | id: string
17 | stem: string
18 | }
19 |
20 | export class InterviewListParams {
21 | page: number = 1
22 | questionBankType: number = 9
23 | sort: number = 30
24 | keyword: string = ''
25 | }
26 |
27 | export class InterviewItemModel implements InterviewItem {
28 | id: string = ''
29 | stem: string = ''
30 | content: string = ''
31 | likeCount: number = 0
32 | views: number = 0
33 | creatorName: string = ''
34 | creatorAvatar: ResourceStr = ''
35 | createdAt: string = ''
36 | stage: string[] = []
37 | likeFlag: 0 | 1 | null = null
38 | relatedQuestions: InterviewRelatedQuestion[] | null = null
39 |
40 | constructor(model: InterviewItem) {
41 | this.id = model.id
42 | this.stem = model.stem
43 | this.content = model.content
44 | this.likeCount = model.likeCount
45 | this.views = model.views
46 | this.creatorName = model.creatorName
47 | this.creatorAvatar = model.creatorAvatar
48 | this.createdAt = model.createdAt
49 | this.stage = model.stage
50 | this.likeFlag = model.likeFlag
51 | this.relatedQuestions = model.relatedQuestions
52 | }
53 | }
54 |
55 | export const interviewListData: InterviewItem[] = [
56 | {
57 | id: '10001',
58 | stem: '微软谷歌面试算法难度 | 你想象不到的简单',
59 | content: '内推 候选人可以找到认识的微软员工,员工会把简历提交到微软人才库。这样微软HR就可以在人才库的系统中查看到你的简历。',
60 | likeCount: 13,
61 | views: 347,
62 | creatorName: '凡人的积累',
63 | creatorAvatar: $r('app.media.ic_interview_avatar'),
64 | createdAt: '一周前',
65 | stage: ['大厂', '算法'],
66 | likeFlag: 1,
67 | relatedQuestions: []
68 | },
69 | {
70 | id: '10002',
71 | stem: '美团-工程效能组-开发工程师实习生(工程基建方向)-一面',
72 | content: '项目介绍网页音视频项目项目代码量多少?是一个人完成的吗?介绍SaaS视频项目SpringSpring框架有什么特性?(不知道这个问题要问什么,答的扩展性、封装性啥的)控制反转了解吗?',
73 | likeCount: 32,
74 | views: 503,
75 | creatorName: '响亮的名字',
76 | creatorAvatar: $r('app.media.ic_interview_avatar'),
77 | createdAt: '10 小时前',
78 | stage: ['大厂', 'Java'],
79 | likeFlag: 0,
80 | relatedQuestions: []
81 | },
82 | {
83 | id: '10003',
84 | stem: '中邮消费金融AI算法工程师(实习生)',
85 | content: '这个是在猎聘上投递的 能收到面试属实是意外之喜面试官是nlp方向的,主要是问nlp相关 首先自我介绍说一个在上段实习中的项目 这里说了一个搭建智能客服对话助手',
86 | likeCount: 10,
87 | views: 98,
88 | creatorName: '不想秃头的夜猫子',
89 | creatorAvatar: $r('app.media.ic_interview_avatar'),
90 | createdAt: '23 分钟前',
91 | stage: ['国企', '实习'],
92 | likeFlag: 1,
93 | relatedQuestions: []
94 | }
95 | ]
--------------------------------------------------------------------------------
/features/interview/src/main/ets/services/InterviewService.ets:
--------------------------------------------------------------------------------
1 | import { hdHttp } from '@itcast/basic/Index'
2 | import { InterviewItemModel, InterviewListParams } from '../models/InterviewItemModel'
3 |
4 | interface PageResult {
5 | total: number
6 | pageTotal: number
7 | rows: InterviewItemModel[]
8 | }
9 |
10 | export class InterviewService {
11 | static findInterviewList(params: InterviewListParams) {
12 | return hdHttp.get('question/list', params)
13 | }
14 | }
--------------------------------------------------------------------------------
/features/interview/src/main/ets/views/InterviewComp.ets:
--------------------------------------------------------------------------------
1 | import { authStore, HdSearch, HdTab, HdTabItem } from '@itcast/basic'
2 | import { InterviewListComp } from '../components/InterviewListComp'
3 |
4 | interface Company {
5 | icon: ResourceStr
6 | count: number
7 | }
8 |
9 | @Component
10 | export struct InterviewComp {
11 | @State
12 | left: number = 16
13 | @State
14 | sort: number | undefined = 30
15 | @StorageProp('topHeight')
16 | topHeight: number = 0
17 | // tab
18 | tabConfig: HdTabItem[] = [
19 | { name: '推荐', value: 30 },
20 | { name: '最新', value: undefined }
21 | ]
22 |
23 | @Builder
24 | companyBuilder(com: Company) {
25 | Column({ space: 12 }) {
26 | Image(com.icon)
27 | .width(36)
28 | .aspectRatio(1)
29 | .margin({ top: 20 })
30 | .objectFit(ImageFit.Contain)
31 | Text() {
32 | Span('热门指数')
33 | Span(`${com.count}K`)
34 | .fontColor($r('app.color.common_green'))
35 | }
36 | .fontSize(13)
37 | .fontColor($r('app.color.common_gray_01'))
38 |
39 | Button({ type: ButtonType.Normal }) {
40 | Text('查看')
41 | .fontSize(14)
42 | }
43 | .backgroundColor($r('app.color.common_gray_bg'))
44 | .padding(0)
45 | .height(30)
46 | .width(80)
47 | .borderRadius(8)
48 |
49 | }
50 | .backgroundColor($r('app.color.white'))
51 | .borderRadius(8)
52 | .height(140)
53 | .width(100)
54 | }
55 |
56 | build() {
57 | Column() {
58 | Row({ space: 16 }) {
59 | Image($r('app.media.ic_interview_text'))
60 | .width(54)
61 | .height(20)
62 | HdSearch({ ph: '请输入关键词', bg: $r('app.color.common_gray_bg') })
63 | .layoutWeight(1)
64 | .onClick(() => {
65 | interface Params {
66 | questionBankType: 9 | 10
67 | }
68 |
69 | authStore.checkAuth({
70 | url: 'pages/SearchPage',
71 | params: ({ questionBankType: 9 }) as Params
72 | })
73 | })
74 | }
75 | .padding({ left: 16, right: 16 })
76 | .height(64)
77 | .margin({ top: this.topHeight })
78 |
79 | // 热门企业
80 | Scroll() {
81 | Row({ space: 10 }) {
82 | this.companyBuilder({ icon: $r('app.media.ic_company_hw'), count: 1.5 })
83 | this.companyBuilder({ icon: $r('app.media.ic_company_wr'), count: 2.9 })
84 | this.companyBuilder({ icon: $r('app.media.ic_company_gg'), count: 3.1 })
85 | this.companyBuilder({ icon: $r('app.media.ic_company_zj'), count: 5.3 })
86 | this.companyBuilder({ icon: $r('app.media.ic_company_wy'), count: 3.6 })
87 | }
88 | }
89 | .width('100%')
90 | .height(160)
91 | .scrollable(ScrollDirection.Horizontal)
92 | .scrollBar(BarState.Off)
93 | .padding(10)
94 |
95 | .edgeEffect(EdgeEffect.Spring)
96 | .backgroundColor($r('app.color.common_gray_bg'))
97 |
98 | // 标签页
99 | HdTab({
100 | tabConfig: this.tabConfig,
101 | lineWidth: 16,
102 | onTabChange: (item) => {
103 | this.sort = item.value as number
104 | }
105 | })
106 | // 文章列表
107 | InterviewListComp({ sort: this.sort })
108 | }
109 | .width('100%')
110 | .height('100%')
111 | }
112 | }
--------------------------------------------------------------------------------
/features/interview/src/main/module.json5:
--------------------------------------------------------------------------------
1 | {
2 | "module": {
3 | "name": "interview",
4 | "type": "har",
5 | "deviceTypes": [
6 | "default",
7 | "tablet",
8 | "2in1"
9 | ]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/media/ic_company_gg.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/media/ic_company_wr.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/media/ic_company_zj.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/media/ic_interview_file.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/media/ic_interview_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/interview/src/main/resources/base/media/ic_interview_logo.png
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/media/ic_interview_more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/interview/src/main/resources/base/media/ic_interview_more.png
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/media/ic_interview_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/interview/src/main/resources/base/media/ic_interview_text.png
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/media/ic_public_detail.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/features/interview/src/main/resources/base/media/ic_public_forbid.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/features/interview/src/main/resources/en_US/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/interview/src/main/resources/zh_CN/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/interview/src/test/List.test.ets:
--------------------------------------------------------------------------------
1 | import localUnitTest from './LocalUnit.test';
2 |
3 | export default function testsuite() {
4 | localUnitTest();
5 | }
--------------------------------------------------------------------------------
/features/interview/src/test/LocalUnit.test.ets:
--------------------------------------------------------------------------------
1 | import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
2 |
3 | export default function localUnitTest() {
4 | describe('localUnitTest',() => {
5 | // Defines a test suite. Two parameters are supported: test suite name and test suite function.
6 | beforeAll(() => {
7 | // Presets an action, which is performed only once before all test cases of the test suite start.
8 | // This API supports only one parameter: preset action function.
9 | });
10 | beforeEach(() => {
11 | // Presets an action, which is performed before each unit test case starts.
12 | // The number of execution times is the same as the number of test cases defined by **it**.
13 | // This API supports only one parameter: preset action function.
14 | });
15 | afterEach(() => {
16 | // Presets a clear action, which is performed after each unit test case ends.
17 | // The number of execution times is the same as the number of test cases defined by **it**.
18 | // This API supports only one parameter: clear action function.
19 | });
20 | afterAll(() => {
21 | // Presets a clear action, which is performed after all test cases of the test suite end.
22 | // This API supports only one parameter: clear action function.
23 | });
24 | it('assertContain', 0, () => {
25 | // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
26 | let a = 'abc';
27 | let b = 'b';
28 | // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
29 | expect(a).assertContain(b);
30 | expect(a).assertEqual(a);
31 | });
32 | });
33 | }
--------------------------------------------------------------------------------
/features/mine/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /oh_modules
3 | /.preview
4 | /build
5 | /.cxx
6 | /.test
--------------------------------------------------------------------------------
/features/mine/BuildProfile.ets:
--------------------------------------------------------------------------------
1 | /**
2 | * Use these variables when you tailor your ArkTS code. They must be of the const type.
3 | */
4 | export const HAR_VERSION = '1.0.0';
5 | export const BUILD_MODE_NAME = 'debug';
6 | export const DEBUG = true;
7 | export const TARGET_NAME = 'default';
8 |
9 | /**
10 | * BuildProfile Class is used only for compatibility purposes.
11 | */
12 | export default class BuildProfile {
13 | static readonly HAR_VERSION = HAR_VERSION;
14 | static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15 | static readonly DEBUG = DEBUG;
16 | static readonly TARGET_NAME = TARGET_NAME;
17 | }
--------------------------------------------------------------------------------
/features/mine/Index.ets:
--------------------------------------------------------------------------------
1 | export { MineComp } from './src/main/ets/views/MineComp'
2 |
3 | export { ClockedComp } from './src/main/ets/views/ClockedComp'
4 |
5 | export { StudyTimeComp } from './src/main/ets/views/StudyTimeComp'
6 |
7 | export { WordComp } from './src/main/ets/views/WordComp'
8 |
9 | export { SettingsComp } from './src/main/ets/views/SettingsComp'
10 |
11 | export { LoginComp } from './src/main/ets/views/LoginComp'
12 |
13 | export { ProfileEditComp } from './src/main/ets/views/ProfileEditComp'
14 |
15 | export { OptionalComp } from './src/main/ets/views/OptionalComp'
16 |
--------------------------------------------------------------------------------
/features/mine/build-profile.json5:
--------------------------------------------------------------------------------
1 | {
2 | "apiType": "stageMode",
3 | "buildOption": {
4 | },
5 | "buildOptionSet": [
6 | {
7 | "name": "release",
8 | "arkOptions": {
9 | "obfuscation": {
10 | "ruleOptions": {
11 | "enable": true,
12 | "files": [
13 | "./obfuscation-rules.txt"
14 | ]
15 | },
16 | "consumerFiles": [
17 | "./consumer-rules.txt"
18 | ]
19 | }
20 | },
21 | },
22 | ],
23 | "targets": [
24 | {
25 | "name": "default"
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/features/mine/consumer-rules.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/consumer-rules.txt
--------------------------------------------------------------------------------
/features/mine/hvigorfile.ts:
--------------------------------------------------------------------------------
1 | import { harTasks } from '@ohos/hvigor-ohos-plugin';
2 |
3 | export default {
4 | system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5 | plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6 | }
7 |
--------------------------------------------------------------------------------
/features/mine/obfuscation-rules.txt:
--------------------------------------------------------------------------------
1 | # Define project specific obfuscation rules here.
2 | # You can include the obfuscation configuration files in the current module's build-profile.json5.
3 | #
4 | # For more details, see
5 | # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6 |
7 | # Obfuscation options:
8 | # -disable-obfuscation: disable all obfuscations
9 | # -enable-property-obfuscation: obfuscate the property names
10 | # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11 | # -compact: remove unnecessary blank spaces and all line feeds
12 | # -remove-log: remove all console.* statements
13 | # -print-namecache: print the name cache that contains the mapping from the old names to new names
14 | # -apply-namecache: reuse the given cache file
15 |
16 | # Keep options:
17 | # -keep-property-name: specifies property names that you want to keep
18 | # -keep-global-name: specifies names that you want to keep in the global scope
--------------------------------------------------------------------------------
/features/mine/oh-package-lock.json5:
--------------------------------------------------------------------------------
1 | {
2 | "meta": {
3 | "stableOrder": false
4 | },
5 | "lockfileVersion": 3,
6 | "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7 | "specifiers": {
8 | "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic",
9 | "@itcast/home@../home": "@itcast/home@../home",
10 | "@itcast/interview@../interview": "@itcast/interview@../interview"
11 | },
12 | "packages": {
13 | "@itcast/basic@../../commons/basic": {
14 | "name": "@itcast/basic",
15 | "version": "1.0.0",
16 | "resolved": "../../commons/basic",
17 | "registryType": "local"
18 | },
19 | "@itcast/home@../home": {
20 | "name": "@itcast/home",
21 | "version": "1.0.0",
22 | "resolved": "../home",
23 | "registryType": "local",
24 | "dependencies": {
25 | "@itcast/basic": "file:../../commons/basic",
26 | "@itcast/interview": "file:../../features/interview"
27 | }
28 | },
29 | "@itcast/interview@../interview": {
30 | "name": "@itcast/interview",
31 | "version": "1.0.0",
32 | "resolved": "../interview",
33 | "registryType": "local",
34 | "dependencies": {
35 | "@itcast/basic": "file:../../commons/basic"
36 | }
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/features/mine/oh-package.json5:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@itcast/mine",
3 | "version": "1.0.0",
4 | "description": "Please describe the basic information.",
5 | "main": "Index.ets",
6 | "author": "",
7 | "license": "Apache-2.0",
8 | "dependencies": {
9 | "@itcast/basic": "file:../../commons/basic",
10 | "@itcast/home": "file:../../features/home",
11 | "@itcast/interview": "file:../../features/interview"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/features/mine/src/main/module.json5:
--------------------------------------------------------------------------------
1 | {
2 | "module": {
3 | "name": "mine",
4 | "type": "har",
5 | "deviceTypes": [
6 | "default",
7 | "tablet",
8 | "2in1"
9 | ]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/clocked_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/clocked_bg.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_ai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_ai.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_coin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_coin.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_collect.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_edit.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_file.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_history.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_info.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_invite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_invite.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_like.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_like.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_notes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_notes.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_setting.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/ic_mine_study.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/ic_mine_study.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/icon.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/base/media/study_time_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/mine/src/main/resources/base/media/study_time_bg.png
--------------------------------------------------------------------------------
/features/mine/src/main/resources/en_US/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/mine/src/main/resources/rawfile/github.min.css:
--------------------------------------------------------------------------------
1 | pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
2 | Theme: GitHub
3 | Description: Light theme as seen on github.com
4 | Author: github.com
5 | Maintainer: @Hirse
6 | Updated: 2021-05-15
7 |
8 | Outdated base version: https://github.com/primer/github-syntax-light
9 | Current colors taken from GitHub's CSS
10 | */.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}
--------------------------------------------------------------------------------
/features/mine/src/main/resources/rawfile/word.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 | Word
9 |
11 |
12 |
19 |
20 |
21 |
22 |
31 |
32 |
--------------------------------------------------------------------------------
/features/mine/src/main/resources/zh_CN/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/mine/src/test/List.test.ets:
--------------------------------------------------------------------------------
1 | import localUnitTest from './LocalUnit.test';
2 |
3 | export default function testsuite() {
4 | localUnitTest();
5 | }
--------------------------------------------------------------------------------
/features/mine/src/test/LocalUnit.test.ets:
--------------------------------------------------------------------------------
1 | import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
2 |
3 | export default function localUnitTest() {
4 | describe('localUnitTest',() => {
5 | // Defines a test suite. Two parameters are supported: test suite name and test suite function.
6 | beforeAll(() => {
7 | // Presets an action, which is performed only once before all test cases of the test suite start.
8 | // This API supports only one parameter: preset action function.
9 | });
10 | beforeEach(() => {
11 | // Presets an action, which is performed before each unit test case starts.
12 | // The number of execution times is the same as the number of test cases defined by **it**.
13 | // This API supports only one parameter: preset action function.
14 | });
15 | afterEach(() => {
16 | // Presets a clear action, which is performed after each unit test case ends.
17 | // The number of execution times is the same as the number of test cases defined by **it**.
18 | // This API supports only one parameter: clear action function.
19 | });
20 | afterAll(() => {
21 | // Presets a clear action, which is performed after all test cases of the test suite end.
22 | // This API supports only one parameter: clear action function.
23 | });
24 | it('assertContain', 0, () => {
25 | // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
26 | let a = 'abc';
27 | let b = 'b';
28 | // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
29 | expect(a).assertContain(b);
30 | expect(a).assertEqual(a);
31 | });
32 | });
33 | }
--------------------------------------------------------------------------------
/features/project/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /oh_modules
3 | /.preview
4 | /build
5 | /.cxx
6 | /.test
--------------------------------------------------------------------------------
/features/project/BuildProfile.ets:
--------------------------------------------------------------------------------
1 | /**
2 | * Use these variables when you tailor your ArkTS code. They must be of the const type.
3 | */
4 | export const HAR_VERSION = '1.0.0';
5 | export const BUILD_MODE_NAME = 'debug';
6 | export const DEBUG = true;
7 | export const TARGET_NAME = 'default';
8 |
9 | /**
10 | * BuildProfile Class is used only for compatibility purposes.
11 | */
12 | export default class BuildProfile {
13 | static readonly HAR_VERSION = HAR_VERSION;
14 | static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15 | static readonly DEBUG = DEBUG;
16 | static readonly TARGET_NAME = TARGET_NAME;
17 | }
--------------------------------------------------------------------------------
/features/project/Index.ets:
--------------------------------------------------------------------------------
1 | export { ProjectComp } from './src/main/ets/views/ProjectComp'
2 |
3 | export { ProjectDetailComp } from './src/main/ets/views/ProjectDetailComp'
4 |
5 | export { ProjectItem, ProjectItemModel } from './src/main/ets/models/ProjectItemModel'
6 |
--------------------------------------------------------------------------------
/features/project/build-profile.json5:
--------------------------------------------------------------------------------
1 | {
2 | "apiType": "stageMode",
3 | "buildOption": {
4 | },
5 | "buildOptionSet": [
6 | {
7 | "name": "release",
8 | "arkOptions": {
9 | "obfuscation": {
10 | "ruleOptions": {
11 | "enable": true,
12 | "files": [
13 | "./obfuscation-rules.txt"
14 | ]
15 | },
16 | "consumerFiles": [
17 | "./consumer-rules.txt"
18 | ]
19 | }
20 | },
21 | },
22 | ],
23 | "targets": [
24 | {
25 | "name": "default"
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/features/project/consumer-rules.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/project/consumer-rules.txt
--------------------------------------------------------------------------------
/features/project/hvigorfile.ts:
--------------------------------------------------------------------------------
1 | import { harTasks } from '@ohos/hvigor-ohos-plugin';
2 |
3 | export default {
4 | system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5 | plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6 | }
7 |
--------------------------------------------------------------------------------
/features/project/obfuscation-rules.txt:
--------------------------------------------------------------------------------
1 | # Define project specific obfuscation rules here.
2 | # You can include the obfuscation configuration files in the current module's build-profile.json5.
3 | #
4 | # For more details, see
5 | # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6 |
7 | # Obfuscation options:
8 | # -disable-obfuscation: disable all obfuscations
9 | # -enable-property-obfuscation: obfuscate the property names
10 | # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11 | # -compact: remove unnecessary blank spaces and all line feeds
12 | # -remove-log: remove all console.* statements
13 | # -print-namecache: print the name cache that contains the mapping from the old names to new names
14 | # -apply-namecache: reuse the given cache file
15 |
16 | # Keep options:
17 | # -keep-property-name: specifies property names that you want to keep
18 | # -keep-global-name: specifies names that you want to keep in the global scope
--------------------------------------------------------------------------------
/features/project/oh-package-lock.json5:
--------------------------------------------------------------------------------
1 | {
2 | "meta": {
3 | "stableOrder": false
4 | },
5 | "lockfileVersion": 3,
6 | "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7 | "specifiers": {
8 | "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic",
9 | "@itcast/home@../home": "@itcast/home@../home",
10 | "@itcast/interview@../interview": "@itcast/interview@../interview"
11 | },
12 | "packages": {
13 | "@itcast/basic@../../commons/basic": {
14 | "name": "@itcast/basic",
15 | "version": "1.0.0",
16 | "resolved": "../../commons/basic",
17 | "registryType": "local"
18 | },
19 | "@itcast/home@../home": {
20 | "name": "@itcast/home",
21 | "version": "1.0.0",
22 | "resolved": "../home",
23 | "registryType": "local",
24 | "dependencies": {
25 | "@itcast/basic": "file:../../commons/basic",
26 | "@itcast/interview": "file:../../features/interview"
27 | }
28 | },
29 | "@itcast/interview@../interview": {
30 | "name": "@itcast/interview",
31 | "version": "1.0.0",
32 | "resolved": "../interview",
33 | "registryType": "local",
34 | "dependencies": {
35 | "@itcast/basic": "file:../../commons/basic"
36 | }
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/features/project/oh-package.json5:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@itcast/project",
3 | "version": "1.0.0",
4 | "description": "Please describe the basic information.",
5 | "main": "Index.ets",
6 | "author": "",
7 | "license": "Apache-2.0",
8 | "dependencies": {
9 | "@itcast/basic": "file:../../commons/basic",
10 | "@itcast/home": "file:../../features/home"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/features/project/src/main/ets/models/ProjectItemModel.ets:
--------------------------------------------------------------------------------
1 | export interface ProjectTag {
2 | tagName: string
3 | }
4 |
5 | export interface ProjectItem {
6 | id: number
7 | name: string
8 | icon: ResourceStr
9 | describeInfo: string | null
10 | tags: ProjectTag[]
11 | }
12 |
13 | export class ProjectItemModel implements ProjectItem {
14 | id: number
15 | name: string
16 | icon: ResourceStr
17 | describeInfo: string | null
18 | tags: ProjectTag[]
19 |
20 | constructor(model: ProjectItem) {
21 | this.id = model.id
22 | this.name = model.name
23 | this.icon = model.icon
24 | this.describeInfo = model.describeInfo
25 | this.tags = model.tags
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/features/project/src/main/ets/services/ProjectService.ets:
--------------------------------------------------------------------------------
1 | import { hdHttp } from '@itcast/basic'
2 | import { ProjectItemModel } from '../models/ProjectItemModel'
3 |
4 | export class ProjectService {
5 | static findProjectList() {
6 | return hdHttp.get('question/type', new Object({ type: 'items' }))
7 | }
8 | }
--------------------------------------------------------------------------------
/features/project/src/main/module.json5:
--------------------------------------------------------------------------------
1 | {
2 | "module": {
3 | "name": "project",
4 | "type": "har",
5 | "deviceTypes": [
6 | "default",
7 | "tablet",
8 | "2in1"
9 | ]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/features/project/src/main/resources/base/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/project/src/main/resources/base/media/project01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/project/src/main/resources/base/media/project01.png
--------------------------------------------------------------------------------
/features/project/src/main/resources/base/media/project02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/project/src/main/resources/base/media/project02.png
--------------------------------------------------------------------------------
/features/project/src/main/resources/base/media/project03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/project/src/main/resources/base/media/project03.png
--------------------------------------------------------------------------------
/features/project/src/main/resources/base/media/project_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/features/project/src/main/resources/base/media/project_bg.png
--------------------------------------------------------------------------------
/features/project/src/main/resources/en_US/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/project/src/main/resources/zh_CN/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "page_show",
5 | "value": "page from package"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/features/project/src/test/List.test.ets:
--------------------------------------------------------------------------------
1 | import localUnitTest from './LocalUnit.test';
2 |
3 | export default function testsuite() {
4 | localUnitTest();
5 | }
--------------------------------------------------------------------------------
/features/project/src/test/LocalUnit.test.ets:
--------------------------------------------------------------------------------
1 | import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
2 |
3 | export default function localUnitTest() {
4 | describe('localUnitTest',() => {
5 | // Defines a test suite. Two parameters are supported: test suite name and test suite function.
6 | beforeAll(() => {
7 | // Presets an action, which is performed only once before all test cases of the test suite start.
8 | // This API supports only one parameter: preset action function.
9 | });
10 | beforeEach(() => {
11 | // Presets an action, which is performed before each unit test case starts.
12 | // The number of execution times is the same as the number of test cases defined by **it**.
13 | // This API supports only one parameter: preset action function.
14 | });
15 | afterEach(() => {
16 | // Presets a clear action, which is performed after each unit test case ends.
17 | // The number of execution times is the same as the number of test cases defined by **it**.
18 | // This API supports only one parameter: clear action function.
19 | });
20 | afterAll(() => {
21 | // Presets a clear action, which is performed after all test cases of the test suite end.
22 | // This API supports only one parameter: clear action function.
23 | });
24 | it('assertContain', 0, () => {
25 | // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
26 | let a = 'abc';
27 | let b = 'b';
28 | // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
29 | expect(a).assertContain(b);
30 | expect(a).assertEqual(a);
31 | });
32 | });
33 | }
--------------------------------------------------------------------------------
/hvigor/hvigor-config.json5:
--------------------------------------------------------------------------------
1 | {
2 | "modelVersion": "5.0.0",
3 | "dependencies": {
4 | },
5 | "execution": {
6 | // "analyze": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */
7 | // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
8 | // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
9 | // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
10 | // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
11 | },
12 | "logging": {
13 | // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
14 | },
15 | "debugging": {
16 | // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
17 | },
18 | "nodeOptions": {
19 | // "maxOldSpaceSize": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */
20 | }
21 | }
--------------------------------------------------------------------------------
/hvigorfile.ts:
--------------------------------------------------------------------------------
1 | import { appTasks } from '@ohos/hvigor-ohos-plugin';
2 |
3 | export default {
4 | system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5 | plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6 | }
7 |
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/logo.png
--------------------------------------------------------------------------------
/oh-package-lock.json5:
--------------------------------------------------------------------------------
1 | {
2 | "meta": {
3 | "stableOrder": false
4 | },
5 | "lockfileVersion": 3,
6 | "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7 | "specifiers": {
8 | "@ohos/hamock@1.0.0-rc": "@ohos/hamock@1.0.0-rc",
9 | "@ohos/hypium@1.0.15": "@ohos/hypium@1.0.15",
10 | "@ohmos/calendar@commons/calendar": "@ohmos/calendar@commons/calendar",
11 | "dayjs@1.11.7": "dayjs@1.11.7"
12 | },
13 | "packages": {
14 | "@ohmos/calendar@commons/calendar": {
15 | "name": "@ohmos/calendar",
16 | "version": "2.0.2",
17 | "resolved": "commons/calendar",
18 | "registryType": "local",
19 | "dependencies": {
20 | "dayjs": "1.11.7"
21 | }
22 | },
23 | "@ohos/hypium@1.0.15": {
24 | "name": "@ohos/hypium",
25 | "version": "1.0.15",
26 | "integrity": "sha512-AhkuYX2l/IzrVARV/hKRGsJDQPtZ5bygr6Q1N2M9W15kBllNYL3khQ0dNvJwh/CIGoEPMDVcME9q6MhFGccqkw==",
27 | "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.15.har",
28 | "registryType": "ohpm"
29 | },
30 | "@ohos/hamock@1.0.0-rc": {
31 | "name": "@ohos/hamock",
32 | "version": "1.0.0-rc",
33 | "integrity": "sha512-O8cdoxTWiQQlln+tAlTmK6Tesefc/MYaNI5ixJnmYih6Ixfed9nWtFpEAakSO6q6FWSPNodCiP1IyegrB8Ta3Q==",
34 | "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hamock/-/hamock-1.0.0-rc.har",
35 | "registryType": "ohpm"
36 | },
37 | "dayjs@1.11.7": {
38 | "name": "dayjs",
39 | "version": "1.11.7",
40 | "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==",
41 | "resolved": "https://repo.harmonyos.com/ohpm/dayjs/-/dayjs-1.11.7.tgz",
42 | "shasum": "4b296922642f70999544d1144a2c25730fce63e2",
43 | "registryType": "ohpm"
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/oh-package.json5:
--------------------------------------------------------------------------------
1 | {
2 | "modelVersion": "5.0.0",
3 | "name": "pass_interview",
4 | "version": "1.0.0",
5 | "description": "Please describe the basic information.",
6 | "main": "",
7 | "author": "",
8 | "license": "",
9 | "dependencies": {
10 | "@ohmos/calendar": "file:./commons/calendar"
11 | },
12 | "devDependencies": {
13 | "@ohos/hypium": "1.0.15",
14 | "@ohos/hamock": "1.0.0-rc"
15 | }
16 | }
--------------------------------------------------------------------------------
/products/phone/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /oh_modules
3 | /.preview
4 | /build
5 | /.cxx
6 | /.test
--------------------------------------------------------------------------------
/products/phone/build-profile.json5:
--------------------------------------------------------------------------------
1 | {
2 | "apiType": "stageMode",
3 | "buildOption": {
4 | "arkOptions": {
5 | // "apPath": "./modules.ap" /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */
6 | }
7 | },
8 | "buildOptionSet": [
9 | {
10 | "name": "release",
11 | "arkOptions": {
12 | "obfuscation": {
13 | "ruleOptions": {
14 | "enable": true,
15 | "files": [
16 | "./obfuscation-rules.txt"
17 | ]
18 | }
19 | }
20 | },
21 | "nativeLib": {
22 | "debugSymbol": {
23 | "strip": true,
24 | "exclude": []
25 | }
26 | }
27 | },
28 | ],
29 | "targets": [
30 | {
31 | "name": "default"
32 | },
33 | {
34 | "name": "ohosTest",
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/products/phone/hvigorfile.ts:
--------------------------------------------------------------------------------
1 | import { hapTasks } from '@ohos/hvigor-ohos-plugin';
2 |
3 | export default {
4 | system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5 | plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6 | }
7 |
--------------------------------------------------------------------------------
/products/phone/obfuscation-rules.txt:
--------------------------------------------------------------------------------
1 | # Define project specific obfuscation rules here.
2 | # You can include the obfuscation configuration files in the current module's build-profile.json5.
3 | #
4 | # For more details, see
5 | # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6 |
7 | # Obfuscation options:
8 | # -disable-obfuscation: disable all obfuscations
9 | # -enable-property-obfuscation: obfuscate the property names
10 | # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11 | # -compact: remove unnecessary blank spaces and all line feeds
12 | # -remove-log: remove all console.* statements
13 | # -print-namecache: print the name cache that contains the mapping from the old names to new names
14 | # -apply-namecache: reuse the given cache file
15 |
16 | # Keep options:
17 | # -keep-property-name: specifies property names that you want to keep
18 | # -keep-global-name: specifies names that you want to keep in the global scope
--------------------------------------------------------------------------------
/products/phone/oh-package-lock.json5:
--------------------------------------------------------------------------------
1 | {
2 | "meta": {
3 | "stableOrder": false
4 | },
5 | "lockfileVersion": 3,
6 | "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7 | "specifiers": {
8 | "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic",
9 | "@itcast/home@../../features/home": "@itcast/home@../../features/home",
10 | "@itcast/project@../../features/project": "@itcast/project@../../features/project",
11 | "@itcast/interview@../../features/interview": "@itcast/interview@../../features/interview",
12 | "@itcast/mine@../../features/mine": "@itcast/mine@../../features/mine"
13 | },
14 | "packages": {
15 | "@itcast/basic@../../commons/basic": {
16 | "name": "@itcast/basic",
17 | "version": "1.0.0",
18 | "resolved": "../../commons/basic",
19 | "registryType": "local"
20 | },
21 | "@itcast/home@../../features/home": {
22 | "name": "@itcast/home",
23 | "version": "1.0.0",
24 | "resolved": "../../features/home",
25 | "registryType": "local",
26 | "dependencies": {
27 | "@itcast/basic": "file:../../commons/basic",
28 | "@itcast/interview": "file:../../features/interview"
29 | }
30 | },
31 | "@itcast/project@../../features/project": {
32 | "name": "@itcast/project",
33 | "version": "1.0.0",
34 | "resolved": "../../features/project",
35 | "registryType": "local",
36 | "dependencies": {
37 | "@itcast/basic": "file:../../commons/basic",
38 | "@itcast/home": "file:../../features/home"
39 | }
40 | },
41 | "@itcast/interview@../../features/interview": {
42 | "name": "@itcast/interview",
43 | "version": "1.0.0",
44 | "resolved": "../../features/interview",
45 | "registryType": "local",
46 | "dependencies": {
47 | "@itcast/basic": "file:../../commons/basic"
48 | }
49 | },
50 | "@itcast/mine@../../features/mine": {
51 | "name": "@itcast/mine",
52 | "version": "1.0.0",
53 | "resolved": "../../features/mine",
54 | "registryType": "local",
55 | "dependencies": {
56 | "@itcast/basic": "file:../../commons/basic",
57 | "@itcast/home": "file:../../features/home",
58 | "@itcast/interview": "file:../../features/interview"
59 | }
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/products/phone/oh-package.json5:
--------------------------------------------------------------------------------
1 | {
2 | "name": "phone",
3 | "version": "1.0.0",
4 | "description": "Please describe the basic information.",
5 | "main": "",
6 | "author": "",
7 | "license": "",
8 | "dependencies": {
9 | "@itcast/basic": "file:../../commons/basic",
10 | "@itcast/home": "file:../../features/home",
11 | "@itcast/project": "file:../../features/project",
12 | "@itcast/interview": "file:../../features/interview",
13 | "@itcast/mine": "file:../../features/mine"
14 | }
15 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/contants/index.ets:
--------------------------------------------------------------------------------
1 | import { TabBarModel } from '../models/TabBarModel'
2 |
3 | export const TabBarItems: TabBarModel[] = [
4 | // {
5 | // defaultIcon: $r('app.media.ic_tabbar_home'),
6 | // activeIcon: $r('app.media.ic_tabbar_home_select'),
7 | // label: '首页'
8 | // },
9 | // {
10 | // defaultIcon: $r('app.media.ic_tabbar_project'),
11 | // activeIcon: $r('app.media.ic_tabbar_project_select'),
12 | // label: '项目'
13 | // },
14 | // {
15 | // defaultIcon: $r('app.media.ic_tabbar_interview'),
16 | // activeIcon: $r('app.media.ic_tabbar_interview_select'),
17 | // label: '面经'
18 | // },
19 | // {
20 | // defaultIcon: $r('app.media.ic_tabbar_mine'),
21 | // activeIcon: $r('app.media.ic_tabbar_mine_select'),
22 | // label: '我的'
23 | // }
24 | {
25 | defaultIcon: $r('app.media.tabbar_home'),
26 | activeIcon: $r('app.media.tabbar_home_fill'),
27 | label: '首页'
28 | },
29 | {
30 | defaultIcon: $r('app.media.tabbar_project'),
31 | activeIcon: $r('app.media.tabbar_project_fill'),
32 | label: '项目'
33 | },
34 | {
35 | defaultIcon: $r('app.media.tabbar_interview'),
36 | activeIcon: $r('app.media.tabbar_interview_fill'),
37 | label: '面经'
38 | },
39 | {
40 | defaultIcon: $r('app.media.tabbar_mine'),
41 | activeIcon: $r('app.media.tabbar_mine_fill'),
42 | label: '我的'
43 | }
44 | ]
--------------------------------------------------------------------------------
/products/phone/src/main/ets/models/TabBarModel.ets:
--------------------------------------------------------------------------------
1 | export class TabBarModel {
2 | defaultIcon: ResourceStr = ''
3 | activeIcon: ResourceStr = ''
4 | label: string = ''
5 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/BootPage.ets:
--------------------------------------------------------------------------------
1 | import { authStore, themeManager } from '@itcast/basic'
2 | import { BootView } from '@itcast/home'
3 |
4 | @Entry
5 | @Component
6 | struct BootPage {
7 | aboutToAppear(): void {
8 | themeManager.initThemeSetting()
9 | themeManager.enableFullScreen()
10 | authStore.initUser()
11 |
12 | getContext().getApplicationContext().getRunningProcessInformation()
13 | }
14 |
15 | build() {
16 | Column() {
17 | BootView()
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/ClockedPage.ets:
--------------------------------------------------------------------------------
1 | import { ClockedComp } from '@itcast/mine'
2 |
3 | @Entry
4 | @Component
5 | struct ClockedPage {
6 | build() {
7 | Column() {
8 | ClockedComp()
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/Index.ets:
--------------------------------------------------------------------------------
1 | import { TabBarComp } from '../views/Index/TabBarComp';
2 | import { themeManager } from '@itcast/basic';
3 | import { emitter } from '@kit.BasicServicesKit';
4 | import { common } from '@kit.AbilityKit';
5 | import { promptAction } from '@kit.ArkUI';
6 |
7 | @Entry
8 | @Component
9 | struct Index {
10 | @State
11 | @Watch('onChangeIndex')
12 | activeIndex: number = 0
13 |
14 | aboutToAppear(): void {
15 | emitter.on({ eventId: 10000 }, (e) => {
16 | if (e.data && e.data.activeIndex) {
17 | this.activeIndex = e.data.activeIndex
18 | }
19 | })
20 | }
21 |
22 | onChangeIndex() {
23 | if (this.activeIndex === 3) themeManager.settingStatusBarWhite()
24 | else themeManager.settingStatusBarBlack()
25 | }
26 |
27 | onPageShow(): void {
28 | this.onChangeIndex()
29 | }
30 |
31 | onPageHide(): void {
32 | this.onChangeIndex()
33 | themeManager.settingStatusBarBlack()
34 | this.backTimes = 0
35 | }
36 |
37 | backTimes: number = 0
38 |
39 | onBackPress(): boolean | void {
40 | this.backTimes++
41 | if (this.backTimes <= 1) {
42 | promptAction.showToast({ message: '再按一次将退出应用' })
43 | }
44 | if (this.backTimes >= 2) {
45 | const ctx = getContext() as common.UIAbilityContext
46 | ctx.terminateSelf()
47 | }
48 |
49 |
50 | return true
51 | }
52 |
53 | build() {
54 | Flex() {
55 | TabBarComp({ activeIndex: this.activeIndex })
56 | }
57 | .backgroundColor($r('app.color.white'))
58 | }
59 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/InterviewDetailPage.ets:
--------------------------------------------------------------------------------
1 | import { InterviewDetailComp } from '@itcast/interview/Index';
2 |
3 | @Entry
4 | @Component
5 | struct InterviewDetailPage {
6 | @StorageProp('bottomHeight')
7 | bottomHeight: number = 0
8 |
9 | build() {
10 | Column() {
11 | InterviewDetailComp()
12 | }
13 | .padding({ bottom: this.bottomHeight })
14 | }
15 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/LoginPage.ets:
--------------------------------------------------------------------------------
1 | import { LoginComp } from '@itcast/mine'
2 |
3 | @Entry
4 | @Component
5 | struct LoginPage {
6 | build() {
7 | Column() {
8 | LoginComp()
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/OptionalPage.ets:
--------------------------------------------------------------------------------
1 | import { OptionalComp } from '@itcast/mine';
2 |
3 | @Entry
4 | @Component
5 | struct OptionalPage {
6 | build() {
7 | Column() {
8 | OptionalComp()
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/ProfileEditPage.ets:
--------------------------------------------------------------------------------
1 | import { ProfileEditComp } from '@itcast/mine';
2 |
3 | @Entry
4 | @Component
5 | struct ProfileEditPage {
6 | @StorageProp('bottomHeight')
7 | bottomHeight: number = 0
8 |
9 | build() {
10 | Column() {
11 | ProfileEditComp()
12 | }
13 | .margin({ bottom: this.bottomHeight })
14 | }
15 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/ProjectDetailPage.ets:
--------------------------------------------------------------------------------
1 | import { themeManager } from '@itcast/basic'
2 | import { ProjectDetailComp } from '@itcast/project'
3 |
4 | @Entry
5 | @Component
6 | struct ProjectPage {
7 | onPageShow(): void {
8 | themeManager.settingStatusBarWhite()
9 | }
10 |
11 | onPageHide(): void {
12 | themeManager.settingStatusBarBlack()
13 | }
14 |
15 | build() {
16 | Column() {
17 | ProjectDetailComp()
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/QuestionDetailPage.ets:
--------------------------------------------------------------------------------
1 | import { QuestionDetailComp } from '@itcast/home'
2 |
3 | @Entry
4 | @Component
5 | struct QuestionDetailPage {
6 | @StorageProp('bottomHeight')
7 | bottomHeight: number = 0
8 |
9 | build() {
10 | Column() {
11 | QuestionDetailComp()
12 | }
13 | .padding({ bottom: this.bottomHeight })
14 | }
15 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/SearchPage.ets:
--------------------------------------------------------------------------------
1 | import { SearchComp } from '@itcast/home';
2 |
3 | @Entry
4 | @Component
5 | struct SearchPage {
6 | build() {
7 | Column() {
8 | SearchComp()
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/SettingsPage.ets:
--------------------------------------------------------------------------------
1 | import { SettingsComp } from '@itcast/mine';
2 |
3 | @Entry
4 | @Component
5 | struct SettingsPage {
6 | build() {
7 | Column() {
8 | SettingsComp()
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/StudyTimePage.ets:
--------------------------------------------------------------------------------
1 | import { StudyTimeComp } from '@itcast/mine'
2 |
3 | @Entry
4 | @Component
5 | struct StudyTimePage {
6 | build() {
7 | Column() {
8 | StudyTimeComp()
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/pages/WordPage.ets:
--------------------------------------------------------------------------------
1 | import { WordComp } from '@itcast/mine'
2 |
3 | @Entry
4 | @Component
5 | struct WordPage {
6 | build() {
7 | Column() {
8 | WordComp()
9 | }
10 | }
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/products/phone/src/main/ets/phoneability/PhoneAbility.ets:
--------------------------------------------------------------------------------
1 | import AbilityConstant from '@ohos.app.ability.AbilityConstant';
2 | import UIAbility from '@ohos.app.ability.UIAbility';
3 | import Want from '@ohos.app.ability.Want';
4 | import window from '@ohos.window';
5 | import { rpc } from '@kit.IPCKit';
6 | import { logger } from '@itcast/basic';
7 | import { emitter } from '@kit.BasicServicesKit';
8 |
9 | class MyParcelable implements rpc.Parcelable {
10 | marshalling(dataOut: rpc.MessageSequence): boolean {
11 | return true
12 | }
13 |
14 | unmarshalling(dataIn: rpc.MessageSequence): boolean {
15 | return true
16 | }
17 | }
18 |
19 | export default class PhoneAbility extends UIAbility {
20 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
21 | logger.info('Ability onCreate')
22 | // call form
23 | try {
24 | this.callee.on('clock_in', (data: rpc.MessageSequence) => {
25 | logger.info('clock_in', data.readString())
26 | return new MyParcelable()
27 | })
28 | } catch (e) {
29 | logger.error('call form', e.message)
30 | }
31 | // router form
32 | emitter.emit({
33 | eventId: 10000
34 | }, {
35 | data: {
36 | activeIndex: want.parameters?.page === 'interview' ? 2 : 0
37 | }
38 | })
39 | }
40 |
41 | onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void {
42 | logger.info('Ability onNewWant')
43 | // router form
44 | emitter.emit({
45 | eventId: 10000
46 | }, {
47 | data: {
48 | activeIndex: want.parameters?.page === 'interview' ? 2 : 0
49 | }
50 | })
51 | }
52 |
53 | onDestroy(): void {
54 | logger.info('Ability onDestroy');
55 | }
56 |
57 | onWindowStageCreate(windowStage: window.WindowStage): void {
58 | // Main window is created, set main page for this ability
59 | logger.info('Ability onWindowStageCreate');
60 |
61 | windowStage.loadContent('pages/BootPage', (err, data) => {
62 | if (err.code) {
63 | logger.error('Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
64 | return;
65 | }
66 | logger.info('Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
67 |
68 | });
69 | }
70 |
71 | onWindowStageDestroy(): void {
72 | // Main window is destroyed, release UI related resources
73 | logger.info('Ability onWindowStageDestroy');
74 | }
75 |
76 | onForeground(): void {
77 | // Ability has brought to foreground
78 | logger.info('Ability onForeground');
79 | }
80 |
81 | onBackground(): void {
82 | // Ability has back to background
83 | logger.info('Ability onBackground');
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/products/phone/src/main/ets/phoneformability/PhoneFormAbility.ets:
--------------------------------------------------------------------------------
1 | import { formBindingData, FormExtensionAbility, formInfo } from '@kit.FormKit';
2 | import { Want } from '@kit.AbilityKit';
3 | import { authStore } from '@itcast/basic';
4 |
5 | export interface CardData {
6 | formId: string
7 | token: string
8 | clockinNumbers: number
9 | }
10 |
11 | export default class PhoneFormAbility extends FormExtensionAbility {
12 | onAddForm(want: Want) {
13 | // Called to return a FormBindingData object.
14 | const user = authStore.getUser()
15 | const formId = want.parameters?.[formInfo.FormParam.IDENTITY_KEY]
16 | const data: CardData = {
17 | formId: formId ? formId.toString() : '',
18 | token: user.token || '',
19 | clockinNumbers: user.clockinNumbers || 0
20 | }
21 | return formBindingData.createFormBindingData(data);
22 | }
23 |
24 | onCastToNormalForm(formId: string) {
25 | // Called when the form provider is notified that a temporary form is successfully
26 | // converted to a normal form.
27 | }
28 |
29 | onUpdateForm(formId: string) {
30 | // Called to notify the form provider to update a specified form.
31 |
32 | }
33 |
34 | onChangeFormVisibility(newStatus: Record) {
35 | // Called when the form provider receives form events from the system.
36 | }
37 |
38 | onFormEvent(formId: string, message: string) {
39 | // Called when a specified message event defined by the form provider is triggered.
40 | }
41 |
42 | onRemoveForm(formId: string) {
43 | // Called to notify the form provider that a specified form has been destroyed.
44 | }
45 |
46 | onAcquireFormState(want: Want) {
47 | // Called to return a {@link FormState} object.
48 | return formInfo.FormState.READY;
49 | }
50 | };
--------------------------------------------------------------------------------
/products/phone/src/main/ets/views/Index/TabBarComp.ets:
--------------------------------------------------------------------------------
1 | import { HomeComp } from '@itcast/home'
2 | import { ProjectComp } from '@itcast/project'
3 | import { InterviewComp } from '@itcast/interview'
4 | import { MineComp } from '@itcast/mine'
5 | import { BasicConstant } from '@itcast/basic'
6 | import mediaquery from '@ohos.mediaquery'
7 | import { TabBarItems } from '../../contants'
8 | import { TabBarModel } from '../../models/TabBarModel'
9 |
10 | @Component
11 | export struct TabBarComp {
12 | @StorageProp('bottomHeight')
13 | bottomHeight: number = 0
14 | @Link
15 | activeIndex: number
16 | @State
17 | isLandscape: boolean = false
18 | listenerScreen = mediaquery.matchMediaSync('(orientation: landscape) and (device-type: tablet)')
19 |
20 | aboutToAppear() {
21 | this.listenerScreen.on('change', (mediaQueryResult) => {
22 | this.isLandscape = mediaQueryResult.matches
23 | })
24 | }
25 |
26 | @Builder
27 | TabBarBuilder(item: TabBarModel, index: number) {
28 | Column({ space: BasicConstant.SPACE_SM }) {
29 | Image(this.activeIndex === index ? item.activeIcon : item.defaultIcon)
30 | .width($r('app.float.tab_bar_item_icon_size'))
31 | Text(item.label)
32 | .fontSize($r('app.float.tab_bar_item_font_size'))
33 | .fontColor(this.activeIndex === index ? $r('app.color.black') : $r('app.color.common_gray_01'))
34 | .animation({ duration: 300 })
35 | }
36 | }
37 |
38 | build() {
39 | Tabs({
40 | index: this.activeIndex
41 | }) {
42 | ForEach(TabBarItems, (item: TabBarModel, index: number) => {
43 | TabContent() {
44 | if (index === 0) HomeComp()
45 | else if (index === 1) ProjectComp()
46 | else if (index === 2) InterviewComp()
47 | else MineComp()
48 | }
49 | .tabBar(this.TabBarBuilder(item, index))
50 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
51 | })
52 | }
53 | .divider({ strokeWidth: $r('app.float.common_border_width'), color: $r('app.color.common_gray_border') })
54 | .vertical(this.isLandscape)
55 | .barPosition(this.isLandscape ? BarPosition.Start : BarPosition.End)
56 | .onTabBarClick((index) => {
57 | this.activeIndex = index
58 | })
59 | .barHeight(this.isLandscape ? $r('app.float.tab_bar_item_height_lg') : $r('app.float.tab_bar_item_height_sm'))
60 | .scrollable(false)
61 | .margin({ bottom: this.bottomHeight })
62 | }
63 | }
--------------------------------------------------------------------------------
/products/phone/src/main/ets/widget/pages/WidgetCard.ets:
--------------------------------------------------------------------------------
1 | const shard = LocalStorage.getShared()
2 |
3 | export interface BtnItem {
4 | src: ResourceStr
5 | text?: ResourceStr
6 | onClick?: () => void
7 | }
8 |
9 | @Entry(shard)
10 | @Component
11 | struct WidgetCard {
12 | @LocalStorageProp('formId')
13 | formId: string = ''
14 | @LocalStorageProp('clockinNumbers')
15 | clockinNumbers: number = 0
16 | @LocalStorageProp('token')
17 | token: string = ''
18 |
19 | @Builder
20 | BtnBuilder(item: BtnItem) {
21 | Column({ space: 6 }) {
22 | Row() {
23 | Image(item.src)
24 | .width(24)
25 | .aspectRatio(1)
26 | .fillColor($r('app.color.common_main_color'))
27 | }
28 | .justifyContent(FlexAlign.Center)
29 | .backgroundColor($r('app.color.white'))
30 | .width(40)
31 | .aspectRatio(1)
32 | .borderRadius(20)
33 |
34 | Text(item.text)
35 | .fontSize(12)
36 | .fontColor($r('app.color.white'))
37 | }
38 | .onClick(() => {
39 | item.onClick && item.onClick()
40 | })
41 | }
42 |
43 | build() {
44 | Stack() {
45 | Image($r('app.media.card_bg'))
46 | .width('100%')
47 | .height('100%')
48 | .opacity(0.4)
49 | .objectFit(ImageFit.Cover)
50 | Column({ space: 12 }) {
51 | Row({ space: 6 }) {
52 | Image($r('app.media.icon'))
53 | .width(20)
54 | .height(20)
55 | .borderRadius(4)
56 | Text('面试通')
57 | .fontSize(16)
58 | .fontColor($r('app.color.white'))
59 | }
60 |
61 | Text('搞定企业面试真题')
62 | .fontSize(13)
63 | .fontColor($r('app.color.white'))
64 | .opacity(0.6)
65 |
66 | Row({ space: 36 }) {
67 | this.BtnBuilder({
68 | src: this.token && this.clockinNumbers > 0
69 | ? $r('app.media.ic_questionnaire_filled')
70 | : $r('app.media.ic_public_calendar_filled'),
71 | text: '打卡',
72 | onClick: () => {
73 | console.log('INTERVIEW_LOGGER', this.formId)
74 | postCardAction(this, {
75 | action: 'call',
76 | abilityName: 'PhoneAbility',
77 | params: {
78 | formId: this.formId,
79 | method: 'clock_in'
80 | }
81 | })
82 | }
83 | })
84 | this.BtnBuilder({
85 | src: $r('app.media.ic_public_file_filled'),
86 | text: '面经',
87 | onClick: () => {
88 | postCardAction(this, {
89 | action: 'router',
90 | abilityName: 'PhoneAbility',
91 | params: {
92 | page: 'interview',
93 | }
94 | })
95 | }
96 | })
97 | }
98 | .width('100%')
99 | .justifyContent(FlexAlign.Center)
100 | .margin({ top: 8 })
101 | }
102 | .alignItems(HorizontalAlign.Start)
103 | .width('100%')
104 | .height('100%')
105 | .padding(12)
106 | }
107 | .width('100%')
108 | .height('100%')
109 | .backgroundColor($r('app.color.common_main_color'))
110 | }
111 | }
--------------------------------------------------------------------------------
/products/phone/src/main/module.json5:
--------------------------------------------------------------------------------
1 | {
2 | "module": {
3 | "name": "phone",
4 | "type": "entry",
5 | "description": "$string:module_desc",
6 | "requestPermissions": [
7 | {
8 | "name": "ohos.permission.INTERNET"
9 | },
10 | {
11 | "name": "ohos.permission.KEEP_BACKGROUND_RUNNING"
12 | },
13 | ],
14 | "mainElement": "PhoneAbility",
15 | "deviceTypes": [
16 | "phone",
17 | "tablet",
18 | "2in1"
19 | ],
20 | "deliveryWithInstall": true,
21 | "installationFree": false,
22 | "pages": "$profile:main_pages",
23 | "abilities": [
24 | {
25 | "name": "PhoneAbility",
26 | "srcEntry": "./ets/phoneability/PhoneAbility.ets",
27 | "description": "$string:PhoneAbility_desc",
28 | "icon": "$media:icon",
29 | "label": "$string:PhoneAbility_label",
30 | "startWindowIcon": "$media:startIcon",
31 | "startWindowBackground": "$color:start_window_background",
32 | "exported": true,
33 | "skills": [
34 | {
35 | "entities": [
36 | "entity.system.home"
37 | ],
38 | "actions": [
39 | "action.system.home"
40 | ]
41 | }
42 | ]
43 | }
44 | ],
45 | "extensionAbilities": [
46 | {
47 | "name": "PhoneFormAbility",
48 | "srcEntry": "./ets/phoneformability/PhoneFormAbility.ets",
49 | "label": "$string:PhoneFormAbility_label",
50 | "description": "$string:PhoneFormAbility_desc",
51 | "type": "form",
52 | "metadata": [
53 | {
54 | "name": "ohos.extension.form",
55 | "resource": "$profile:form_config"
56 | }
57 | ]
58 | }
59 | ]
60 | }
61 | }
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/element/color.json:
--------------------------------------------------------------------------------
1 | {
2 | "color": [
3 | {
4 | "name": "start_window_background",
5 | "value": "#FFFFFF"
6 | },
7 | {
8 | "name": "item_title_font",
9 | "value": "#E6000000"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/element/float.json:
--------------------------------------------------------------------------------
1 | {
2 | "float": [
3 | {
4 | "name": "tab_bar_item_font_size",
5 | "value": "10fp"
6 | },
7 | {
8 | "name": "tab_bar_item_icon_size",
9 | "value": "22vp"
10 | },
11 | {
12 | "name": "tab_bar_item_height_sm",
13 | "value": "50vp"
14 | },
15 | {
16 | "name": "tab_bar_item_height_lg",
17 | "value": "400vp"
18 | },
19 | {
20 | "name": "font_size",
21 | "value": "14fp"
22 | }
23 | ]
24 | }
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "module_desc",
5 | "value": "module description"
6 | },
7 | {
8 | "name": "PhoneAbility_desc",
9 | "value": "description"
10 | },
11 | {
12 | "name": "PhoneAbility_label",
13 | "value": "面试通"
14 | },
15 | {
16 | "name": "index_home",
17 | "value": "首页"
18 | },
19 | {
20 | "name": "PhoneFormAbility_desc",
21 | "value": "form_description"
22 | },
23 | {
24 | "name": "PhoneFormAbility_label",
25 | "value": "form_label"
26 | },
27 | {
28 | "name": "widget_desc",
29 | "value": "搞定企业面试真题"
30 | },
31 | {
32 | "name": "widget_display_name",
33 | "value": "widget"
34 | }
35 | ]
36 | }
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/card_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/card_bg.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/ic_public_calendar_filled.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/ic_public_file_filled.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/ic_questionnaire_filled.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/icon.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/startIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/startIcon.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/tabbar_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/tabbar_home.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/tabbar_home_fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/tabbar_home_fill.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/tabbar_interview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/tabbar_interview.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/tabbar_interview_fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/tabbar_interview_fill.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/tabbar_mine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/tabbar_mine.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/tabbar_mine_fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/tabbar_mine_fill.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/tabbar_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/tabbar_project.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/media/tabbar_project_fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/main/resources/base/media/tabbar_project_fill.png
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/profile/form_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "forms": [
3 | {
4 | "name": "widget",
5 | "displayName": "$string:widget_display_name",
6 | "description": "$string:widget_desc",
7 | "src": "./ets/widget/pages/WidgetCard.ets",
8 | "uiSyntax": "arkts",
9 | "window": {
10 | "designWidth": 720,
11 | "autoDesignWidth": true
12 | },
13 | "colorMode": "auto",
14 | "isDynamic": true,
15 | "isDefault": true,
16 | "updateEnabled": false,
17 | "scheduledUpdateTime": "10:30",
18 | "updateDuration": 1,
19 | "defaultDimension": "2*2",
20 | "supportDimensions": [
21 | "2*2"
22 | ]
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/products/phone/src/main/resources/base/profile/main_pages.json:
--------------------------------------------------------------------------------
1 | {
2 | "src": [
3 | "pages/Index",
4 | "pages/ProjectDetailPage",
5 | "pages/InterviewDetailPage",
6 | "pages/QuestionDetailPage",
7 | "pages/LoginPage",
8 | "pages/ClockedPage",
9 | "pages/StudyTimePage",
10 | "pages/WordPage",
11 | "pages/SettingsPage",
12 | "pages/ProfileEditPage",
13 | "pages/SearchPage",
14 | "pages/BootPage",
15 | "pages/OptionalPage"
16 | ]
17 | }
--------------------------------------------------------------------------------
/products/phone/src/main/resources/en_US/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "module_desc",
5 | "value": "module description"
6 | },
7 | {
8 | "name": "PhoneAbility_desc",
9 | "value": "interview question, company article"
10 | },
11 | {
12 | "name": "PhoneAbility_label",
13 | "value": "handbook"
14 | },
15 | {
16 | "name": "index_home",
17 | "value": "home"
18 | },
19 | {
20 | "name": "PhoneFormAbility_desc",
21 | "value": "form_description"
22 | },
23 | {
24 | "name": "PhoneFormAbility_label",
25 | "value": "form_label"
26 | },
27 | {
28 | "name": "widget_desc",
29 | "value": "This is a service widget."
30 | },
31 | {
32 | "name": "widget_display_name",
33 | "value": "widget"
34 | }
35 | ]
36 | }
--------------------------------------------------------------------------------
/products/phone/src/main/resources/zh_CN/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "module_desc",
5 | "value": "模块描述"
6 | },
7 | {
8 | "name": "PhoneAbility_desc",
9 | "value": "面试题刷题、企业面经"
10 | },
11 | {
12 | "name": "PhoneAbility_label",
13 | "value": "面试通"
14 | },
15 | {
16 | "name": "index_home",
17 | "value": "首页"
18 | },
19 | {
20 | "name": "PhoneFormAbility_desc",
21 | "value": "form_description"
22 | },
23 | {
24 | "name": "PhoneFormAbility_label",
25 | "value": "form_label"
26 | },
27 | {
28 | "name": "widget_desc",
29 | "value": "搞定企业面试真题"
30 | },
31 | {
32 | "name": "widget_display_name",
33 | "value": "widget"
34 | }
35 | ]
36 | }
--------------------------------------------------------------------------------
/products/phone/src/mock/mock-config.json5:
--------------------------------------------------------------------------------
1 | {
2 | }
--------------------------------------------------------------------------------
/products/phone/src/ohosTest/ets/test/Ability.test.ets:
--------------------------------------------------------------------------------
1 | import hilog from '@ohos.hilog';
2 | import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
3 |
4 | export default function abilityTest() {
5 | describe('ActsAbilityTest', () => {
6 | // Defines a test suite. Two parameters are supported: test suite name and test suite function.
7 | beforeAll(() => {
8 | // Presets an action, which is performed only once before all test cases of the test suite start.
9 | // This API supports only one parameter: preset action function.
10 | })
11 | beforeEach(() => {
12 | // Presets an action, which is performed before each unit test case starts.
13 | // The number of execution times is the same as the number of test cases defined by **it**.
14 | // This API supports only one parameter: preset action function.
15 | })
16 | afterEach(() => {
17 | // Presets a clear action, which is performed after each unit test case ends.
18 | // The number of execution times is the same as the number of test cases defined by **it**.
19 | // This API supports only one parameter: clear action function.
20 | })
21 | afterAll(() => {
22 | // Presets a clear action, which is performed after all test cases of the test suite end.
23 | // This API supports only one parameter: clear action function.
24 | })
25 | it('assertContain', 0, () => {
26 | // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
27 | hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
28 | let a = 'abc';
29 | let b = 'b';
30 | // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
31 | expect(a).assertContain(b);
32 | expect(a).assertEqual(a);
33 | })
34 | })
35 | }
--------------------------------------------------------------------------------
/products/phone/src/ohosTest/ets/test/List.test.ets:
--------------------------------------------------------------------------------
1 | import abilityTest from './Ability.test';
2 |
3 | export default function testsuite() {
4 | abilityTest();
5 | }
--------------------------------------------------------------------------------
/products/phone/src/ohosTest/ets/testability/TestAbility.ets:
--------------------------------------------------------------------------------
1 | import UIAbility from '@ohos.app.ability.UIAbility';
2 | import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
3 | import hilog from '@ohos.hilog';
4 | import { Hypium } from '@ohos/hypium';
5 | import testsuite from '../test/List.test';
6 | import window from '@ohos.window';
7 | import Want from '@ohos.app.ability.Want';
8 | import AbilityConstant from '@ohos.app.ability.AbilityConstant';
9 |
10 | export default class TestAbility extends UIAbility {
11 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
12 | hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
13 | hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
14 | hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? '');
15 | let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
16 | abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
17 | let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs;
18 | abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments();
19 | hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
20 | Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite);
21 | }
22 |
23 | onDestroy() {
24 | hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
25 | }
26 |
27 | onWindowStageCreate(windowStage: window.WindowStage) {
28 | hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
29 | windowStage.loadContent('testability/pages/Index', (err, data) => {
30 | if (err.code) {
31 | hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
32 | return;
33 | }
34 | hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
35 | JSON.stringify(data) ?? '');
36 | });
37 | }
38 |
39 | onWindowStageDestroy() {
40 | hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
41 | }
42 |
43 | onForeground() {
44 | hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
45 | }
46 |
47 | onBackground() {
48 | hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
49 | }
50 | }
--------------------------------------------------------------------------------
/products/phone/src/ohosTest/ets/testability/pages/Index.ets:
--------------------------------------------------------------------------------
1 | @Entry
2 | @Component
3 | struct Index {
4 | @State message: string = 'Hello World';
5 |
6 | build() {
7 | Row() {
8 | Column() {
9 | Text(this.message)
10 | .fontSize(50)
11 | .fontWeight(FontWeight.Bold)
12 | }
13 | .width('100%')
14 | }
15 | .height('100%')
16 | }
17 | }
--------------------------------------------------------------------------------
/products/phone/src/ohosTest/module.json5:
--------------------------------------------------------------------------------
1 | {
2 | "module": {
3 | "name": "phone_test",
4 | "type": "feature",
5 | "description": "$string:module_test_desc",
6 | "mainElement": "TestAbility",
7 | "deviceTypes": [
8 | "phone",
9 | "tablet",
10 | "2in1"
11 | ],
12 | "deliveryWithInstall": true,
13 | "installationFree": false,
14 | "pages": "$profile:test_pages",
15 | "abilities": [
16 | {
17 | "name": "TestAbility",
18 | "srcEntry": "./ets/testability/TestAbility.ets",
19 | "description": "$string:TestAbility_desc",
20 | "icon": "$media:icon",
21 | "label": "$string:TestAbility_label",
22 | "exported": true,
23 | "startWindowIcon": "$media:icon",
24 | "startWindowBackground": "$color:start_window_background",
25 | "skills": [
26 | {
27 | "actions": [
28 | "action.system.home"
29 | ],
30 | "entities": [
31 | "entity.system.home"
32 | ]
33 | }
34 | ]
35 | }
36 | ]
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/products/phone/src/ohosTest/resources/base/element/color.json:
--------------------------------------------------------------------------------
1 | {
2 | "color": [
3 | {
4 | "name": "start_window_background",
5 | "value": "#FFFFFF"
6 | }
7 | ]
8 | }
--------------------------------------------------------------------------------
/products/phone/src/ohosTest/resources/base/element/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "string": [
3 | {
4 | "name": "module_test_desc",
5 | "value": "test ability description"
6 | },
7 | {
8 | "name": "TestAbility_desc",
9 | "value": "the test ability"
10 | },
11 | {
12 | "name": "TestAbility_label",
13 | "value": "test label"
14 | }
15 | ]
16 | }
--------------------------------------------------------------------------------
/products/phone/src/ohosTest/resources/base/media/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarmonyOS-Next/interview-handbook-project/443452976a144e8a53aa01e1d32f9d3961dce255/products/phone/src/ohosTest/resources/base/media/icon.png
--------------------------------------------------------------------------------
/products/phone/src/ohosTest/resources/base/profile/test_pages.json:
--------------------------------------------------------------------------------
1 | {
2 | "src": [
3 | "testability/pages/Index"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/products/phone/src/test/List.test.ets:
--------------------------------------------------------------------------------
1 | import localUnitTest from './LocalUnit.test';
2 |
3 | export default function testsuite() {
4 | localUnitTest();
5 | }
--------------------------------------------------------------------------------
/products/phone/src/test/LocalUnit.test.ets:
--------------------------------------------------------------------------------
1 | import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
2 |
3 | export default function localUnitTest() {
4 | describe('localUnitTest',() => {
5 | // Defines a test suite. Two parameters are supported: test suite name and test suite function.
6 | beforeAll(() => {
7 | // Presets an action, which is performed only once before all test cases of the test suite start.
8 | // This API supports only one parameter: preset action function.
9 | });
10 | beforeEach(() => {
11 | // Presets an action, which is performed before each unit test case starts.
12 | // The number of execution times is the same as the number of test cases defined by **it**.
13 | // This API supports only one parameter: preset action function.
14 | });
15 | afterEach(() => {
16 | // Presets a clear action, which is performed after each unit test case ends.
17 | // The number of execution times is the same as the number of test cases defined by **it**.
18 | // This API supports only one parameter: clear action function.
19 | });
20 | afterAll(() => {
21 | // Presets a clear action, which is performed after all test cases of the test suite end.
22 | // This API supports only one parameter: clear action function.
23 | });
24 | it('assertContain', 0, () => {
25 | // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
26 | let a = 'abc';
27 | let b = 'b';
28 | // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
29 | expect(a).assertContain(b);
30 | expect(a).assertEqual(a);
31 | });
32 | });
33 | }
--------------------------------------------------------------------------------