HarmonyOS ArkTS 实战:实现一个校园迎新与报到注册应用
HarmonyOS ArkTS 实战实现一个校园迎新与报到注册应用项目效果本文使用 HarmonyOS 和 ArkTS 实现一个校园迎新与报到注册应用。应用可以帮助新生完成线上报到填写个人信息缴纳学费查看报到流程分配宿舍并提供迎新志愿者对接、报到统计和流程进度跟踪等功能。项目使用 DevEco Studio 开发适配 API 23 及以上版本。运行效果功能介绍本项目实现了以下功能新生信息填写报到流程指引学费缴纳宿舍分配查询班级和辅导员信息迎新志愿者对接报到进度跟踪绿色通道申请报到统计校园地图导航常见问题解答定义数据结构首先定义报到流程和新生信息的数据结构interfaceReportStep{id:number;name:string;description:string;location:string;status:string;completeTime:string;}interfaceNewStudent{id:number;studentId:string;name:string;gender:string;idCard:string;college:string;major:string;className:string;counselor:string;counselorPhone:string;dormBuilding:string;dormRoom:string;volunteer:string;volunteerPhone:string;totalFee:number;paidFee:number;reportStatus:string;reportTime:string;steps:ReportStep[];}字段说明如下ReportStep报到步骤id步骤编号name步骤名称description步骤说明location办理地点status状态未开始/进行中/已完成completeTime完成时间NewStudent新生信息id编号studentId学号name姓名gender性别idCard身份证号college学院major专业className班级counselor辅导员counselorPhone辅导员电话dormBuilding宿舍楼dormRoom宿舍号volunteer对接志愿者volunteerPhone志愿者电话totalFee应缴费用paidFee已缴费用reportStatus报到状态未报到/报到中/已报到reportTime报到时间steps报到步骤列表初始化页面状态使用State保存新生信息、当前步骤StateprivatenameText:string;StateprivatestudentIdText:string;StateprivateidCardText:string;StateprivatephoneText:string;StateprivatecurrentStep:number0;StateprivategreenChannel:booleanfalse;StateprivatenextStudentId:number2;准备一些初始新生数据Stateprivatestudents:NewStudent[][{id:1,studentId:20260001,name:张新生,gender:男,idCard:310***********1234,college:计算机学院,major:计算机科学与技术,className:计科2601班,counselor:李老师,counselorPhone:138****1001,dormBuilding:12号楼,dormRoom:302室,volunteer:王学长,volunteerPhone:139****2002,totalFee:7800,paidFee:7800,reportStatus:已报到,reportTime:2026-09-01 09:30,steps:[{id:1,name:身份验证,description:核验录取通知书和身份证,location:正门迎新点,status:已完成,completeTime:2026-09-01 08:30},{id:2,name:学院报到,description:到学院迎新点登记,location:计算机学院楼,status:已完成,completeTime:2026-09-01 08:50},{id:3,name:费用缴纳,description:缴纳学费住宿费,location:财务处,status:已完成,completeTime:2026-09-01 09:00},{id:4,name:宿舍入住,description:领取钥匙入住宿舍,location:12号楼,status:已完成,completeTime:2026-09-01 09:20},{id:5,name:领取物资,description:领取军训服和校园卡,location:大学生活动中心,status:已完成,completeTime:2026-09-01 09:30}]}];新生报到注册新生填写信息完成报到privatesubmitReport():void{constnamethis.nameText.trim();conststudentIdthis.studentIdText.trim();constidCardthis.idCardText.trim();if(name.length0||studentId.length0||idCard.length0){return;}conststeps:ReportStep[][{id:1,name:身份验证,description:核验录取通知书和身份证,location:正门迎新点,status:进行中,completeTime:},{id:2,name:学院报到,description:到学院迎新点登记,location:各学院楼,status:未开始,completeTime:},{id:3,name:费用缴纳,description:缴纳学费住宿费,location:财务处/线上,status:未开始,completeTime:},{id:4,name:宿舍入住,description:领取钥匙入住宿舍,location:各宿舍楼,status:未开始,completeTime:},{id:5,name:领取物资,description:领取军训服和校园卡,location:大学生活动中心,status:未开始,completeTime:}];conststudent:NewStudent{id:this.nextStudentId,studentId,name,gender:男,idCard,college:计算机学院,major:计算机科学与技术,className:计科2601班,counselor:李老师,counselorPhone:138****1001,dormBuilding:12号楼,dormRoom:305室,volunteer:王学长,volunteerPhone:139****2002,totalFee:this.greenChannel?0:7800,paidFee:0,reportStatus:报到中,reportTime:,steps};this.students[student,...this.students];this.nextStudentId1;this.nameText;this.studentIdText;this.idCardText;this.phoneText;}完成报到步骤逐步完成报到流程privatecompleteStep(studentId:number,stepId:number):void{constnownewDate();consttimeStr${now.getFullYear()}-${String(now.getMonth()1).padStart(2,0)}-${String(now.getDate()).padStart(2,0)}${String(now.getHours()).padStart(2,0)}:${String(now.getMinutes()).padStart(2,0)};this.studentsthis.students.map((student:NewStudent){if(student.studentIdstudentId){constupdatedStepsstudent.steps.map((step:ReportStep,index:number){if(step.idstepId){return{...step,status:已完成,completeTime:timeStr};}if(step.status未开始student.steps[index-1]?.idstepId){return{...step,status:进行中};}returnstep;});constallCompletedupdatedSteps.every(ss.status已完成);constallPaidstudent.paidFeestudent.totalFee;return{...student,steps:updatedSteps,reportStatus:allCompletedallPaid?已报到:报到中,reportTime:allCompletedallPaid?timeStr:};}returnstudent;});}缴纳学费privatepayFee(studentId:number,amount:number):void{this.studentsthis.students.map((student:NewStudent){if(student.studentIdstudentId){constnewPaidMath.min(student.paidFeeamount,student.totalFee);return{...student,paidFee:newPaid};}returnstudent;});}绿色通道申请家庭经济困难学生可以申请绿色通道privateapplyGreenChannel(studentId:number):void{this.studentsthis.students.map((student:NewStudent){if(student.studentIdstudentId){return{...student,totalFee:0,greenChannel:true};}returnstudent;});}报到进度计算privategetProgress(student:NewStudent):number{constcompletedstudent.steps.filter(ss.status已完成).length;returnMath.round((completed/student.steps.length)*100);}统计数据privategetTotalStudents():number{returnthis.students.length;}privategetReportedCount():number{returnthis.students.filter(ss.reportStatus已报到).length;}privategetReportingCount():number{returnthis.students.filter(ss.reportStatus报到中).length;}privategetTotalFeePaid():number{returnthis.students.reduce((sum,s)sums.paidFee,0);}顶部统计区域展示总人数、已报到、报到中、已缴费用this.StatCard(新生总数,${this.getTotalStudents()},#0EA5E9,#F0F9FF);this.StatCard(已报到,${this.getReportedCount()},#059669,#ECFDF5);this.StatCard(报到中,${this.getReportingCount()},#F59E0B,#FFFBEB);this.StatCard(已缴费用,¥${this.getTotalFeePaid()},#2563EB,#EFF6FF);设置状态颜色privategetStepStatusColor(status:string):ResourceColor{if(status已完成)return#059669;if(status进行中)return#0EA5E9;return#9CA3AF;}privategetReportStatusColor(status:string):ResourceColor{if(status已报到)return#059669;if(status报到中)return#F59E0B;return#DC2626;}privategetReportStatusBgColor(status:string):ResourceColor{if(status已报到)return#DCFCE7;if(status报到中)return#FEF3C7;return#FEE2E2;}绿色已完成/已报到天蓝色进行中橙色报到中红色未报到灰色未开始天蓝色系页面主题色报到流程时间线使用垂直时间线展示报到步骤Column(){ForEach(student.steps,(step:ReportStep,index:number){Row(){Column(){Circle().width(24).height(24).fill(this.getStepStatusColor(step.status))if(indexstudent.steps.length-1){Divider().vertical(true).height(40).color(#E5E7EB)}}.width(30).alignItems(HorizontalAlign.Center)Column(){Text(step.name).fontSize(15).fontWeight(FontWeight.Medium).fontColor(#111827)Text(step.description).fontSize(12).fontColor(#6B7280).margin({top:4})Text(地点${step.location}).fontSize(12).fontColor(#0EA5E9).margin({top:2})}.alignItems(HorizontalAlign.Start).layoutWeight(1).margin({left:12})}.width(100%).alignItems(VerticalAlign.Top)},(step:ReportStep)step.id.toString())}.width(100%)页面设计说明应用使用天蓝色作为主题色体现青春、欢迎、希望的迎新氛围。页面主要分为以下区域顶部欢迎横幅报到数据统计新生报到表单我的报到信息卡片报到流程时间线缴费和绿色通道入口志愿者和辅导员联系信息页面采用浅灰色背景和白色卡片。报到进度使用进度条展示流程步骤使用时间线样式已完成步骤使用绿色对勾标记进行中步骤使用天蓝色高亮联系电话使用可点击样式。SDK 配置本项目使用 HarmonyOS API 24满足 API 23 及以上要求{ name: default, compatibleSdkVersion: 6.1.1(24), runtimeOS: HarmonyOS, targetSdkVersion: 6.1.1(24), compileSdkVersion: 6.1.1(24) }entry 模块中的运行系统也要保持一致{ apiType: stageMode, targets: [ { name: default, runtimeOS: HarmonyOS } ] }运行项目使用 DevEco Studio 打开项目然后找到entry/src/main/ets/pages/Index.ets等待项目同步完成点击右侧的Preview按钮即可查看应用效果。项目总结本文使用 HarmonyOS 和 ArkTS 实现了一个校园迎新与报到注册应用。项目实现了新生信息填写、报到流程指引、学费缴纳、宿舍分配查询、志愿者对接、进度跟踪、绿色通道、报到统计等功能。通过这个项目可以掌握ArkTS 接口定义和步骤数据结构State状态管理流程进度跟踪时间线组件布局List和ForEach列表渲染进度条计算自定义Builder组件HarmonyOS 迎新类应用布局后续还可以加入人脸识别报到、扫码签到、校园导航、新生群聊、迎新直播、家长端、行李托运、军训服装尺码选择和报到预约时段等功能。

相关新闻

Montserrat字体:如何为你的设计项目找到完美免费字体解决方案

Montserrat字体:如何为你的设计项目找到完美免费字体解决方案

Montserrat字体:如何为你的设计项目找到完美免费字体解决方案 【免费下载链接】Montserrat 项目地址: https://gitcode.com/gh_mirrors/mo/Montserrat 寻找既美观又免费的字体?Montserrat字体家族正是你需要的终极开源字体解决方案。这款完全免费…

2026/7/28 0:48:12 阅读更多 →
TwitterMediaHarvest贡献指南:如何参与开源项目并提交你的第一个PR

TwitterMediaHarvest贡献指南:如何参与开源项目并提交你的第一个PR

TwitterMediaHarvest贡献指南:如何参与开源项目并提交你的第一个PR 【免费下载链接】TwitterMediaHarvest Download twitter media with only one-click. 项目地址: https://gitcode.com/gh_mirrors/tw/TwitterMediaHarvest 想要为流行的Twitter媒体下载器Tw…

2026/7/29 17:25:27 阅读更多 →
如何免费创建个性化Project Sekai贴纸:Discord社区的终极表情包制作指南

如何免费创建个性化Project Sekai贴纸:Discord社区的终极表情包制作指南

如何免费创建个性化Project Sekai贴纸:Discord社区的终极表情包制作指南 【免费下载链接】sekai-stickers Project Sekai sticker maker 项目地址: https://gitcode.com/gh_mirrors/se/sekai-stickers Project Sekai贴纸生成器是一个开源工具,让你…

2026/7/29 16:49:30 阅读更多 →

最新新闻

FPGA开发中LFSR的Verilog实现:从原理到实战应用

FPGA开发中LFSR的Verilog实现:从原理到实战应用

1. 项目概述:为什么LFSR是FPGA工程师的“瑞士军刀”?在FPGA开发的世界里,线性反馈移位寄存器(LFSR)绝对是一个高频出现的“明星模块”。我第一次接触它,是在一个需要生成高速伪随机序列的通信项目中。当时项…

2026/7/30 9:59:58 阅读更多 →
STM32F103C8T6引脚全解析:从GPIO到外设的硬件设计指南

STM32F103C8T6引脚全解析:从GPIO到外设的硬件设计指南

1. 从一块“蓝板”说起:为什么你需要吃透引脚定义 如果你刚接触STM32,大概率是从一块蓝色的、印着“STM32F103C8T6”的小板子开始的。这块被戏称为“蓝桥杯神器”或“最小系统板”核心的芯片,几乎是每个嵌入式开发者入门ARM Cortex-M3的必经之…

2026/7/30 9:59:58 阅读更多 →
WarcraftHelper终极指南:如何让经典魔兽争霸3在现代电脑上完美运行

WarcraftHelper终极指南:如何让经典魔兽争霸3在现代电脑上完美运行

WarcraftHelper终极指南:如何让经典魔兽争霸3在现代电脑上完美运行 【免费下载链接】WarcraftHelper Warcraft III Helper , support 1.20e, 1.24e, 1.26a, 1.27a, 1.27b 项目地址: https://gitcode.com/gh_mirrors/wa/WarcraftHelper 魔兽争霸3作为一代经典…

2026/7/30 9:59:58 阅读更多 →
cJSON深度解析:C语言JSON处理库的设计原理与嵌入式实战

cJSON深度解析:C语言JSON处理库的设计原理与嵌入式实战

1. 项目概述:为什么cJSON是嵌入式与C语言开发的“瑞士军刀” 在C语言的世界里,处理JSON数据曾经是个挺头疼的事儿。JSON作为一种轻量级的数据交换格式,在Web API、配置文件、物联网设备通信中无处不在,但C标准库并没有原生支持。早…

2026/7/30 9:59:58 阅读更多 →
如何通过DockDoor解决macOS多窗口管理的技术挑战

如何通过DockDoor解决macOS多窗口管理的技术挑战

如何通过DockDoor解决macOS多窗口管理的技术挑战 【免费下载链接】DockDoor Window peeking, alt-tab and other enhancements for macOS 项目地址: https://gitcode.com/gh_mirrors/do/DockDoor DockDoor是一款专为macOS设计的开源窗口管理增强工具,旨在解决…

2026/7/30 9:59:58 阅读更多 →
three.js 编辑器的测试与质量保障

three.js 编辑器的测试与质量保障

three.js 编辑器的测试与质量保障 本文围绕 three.js 编辑器(一款基于 Three.js 的 AI 驱动可视化低代码编辑器)展开。- 🌐 在线预览:https://z2586300277.github.io/threejs-editor/- 📦 GitHub 开源仓库:…

2026/7/30 9:58:58 阅读更多 →

日新闻

Windows驱动存储终极清理工具:DriverStoreExplorer完全指南

Windows驱动存储终极清理工具:DriverStoreExplorer完全指南

Windows驱动存储终极清理工具:DriverStoreExplorer完全指南 【免费下载链接】DriverStoreExplorer Driver Store Explorer 项目地址: https://gitcode.com/gh_mirrors/dr/DriverStoreExplorer 您是否曾因Windows系统盘空间不足而烦恼?是否遇到过设…

2026/7/30 0:00:13 阅读更多 →
如何3步掌握Video Download Helper:网页视频下载的完整实战指南

如何3步掌握Video Download Helper:网页视频下载的完整实战指南

如何3步掌握Video Download Helper:网页视频下载的完整实战指南 【免费下载链接】VideoDownloadHelper Chrome Extension to Help Download Video for Some Video Sites. 项目地址: https://gitcode.com/gh_mirrors/vi/VideoDownloadHelper 你是否曾经在浏览…

2026/7/30 0:00:13 阅读更多 →
“双减”后首个AI备课压力测试报告:覆盖32所中小学的176节AI辅助课,暴露4大隐性增负节点

“双减”后首个AI备课压力测试报告:覆盖32所中小学的176节AI辅助课,暴露4大隐性增负节点

更多请点击: https://intelliparadigm.com 第一章:AI 教师备课辅助 AI 教师备课辅助系统正逐步成为教育数字化转型的核心支撑工具,它并非替代教师,而是通过语义理解、知识图谱与多模态生成能力,将教师从重复性劳动中解…

2026/7/30 0:00:13 阅读更多 →

周新闻

深度学习道路桥梁裂缝检测系统 道路桥梁裂缝检测数据集 道路桥梁病害识别检测数据集

深度学习道路桥梁裂缝检测系统 道路桥梁裂缝检测数据集 道路桥梁病害识别检测数据集

深度学习道路桥梁裂缝检测系统 数据集6000张 完整源码已标注数据集训练好的模型环境配置教程程序运行说明文档,可以直接使用!系统支持图片、视频、摄像头等多种方式检测裂缝,功能强大实用。 1数据集6000张 8各类别

2026/7/29 22:18:20 阅读更多 →
深度学习YOLO模型如何训练 PUBG 绝地求生目标检测数据集

深度学习YOLO模型如何训练 PUBG 绝地求生目标检测数据集

pubg数据集 精选原图1.42万数据 1.49万标签 无任何重复、算法增强或冗余图像! pubg绝地求生目标检测数据集 1分类:e_body,14905个标签,txt格式 共计14244张图,99%为640*640尺寸图像 适合yolo目标检测、AI训练关键词&am…

2026/7/29 14:34:28 阅读更多 →
Apex英雄目标检测数据集 深度学习框架YOLO如何训练APEX数据集

Apex英雄目标检测数据集 深度学习框架YOLO如何训练APEX数据集

Apex检测数据集数据集详情检测类别: allies enemy tag图片总量:7247张训练集:5139张验证集:1425张测试集:683张标注状态:全部已标注,即拿即用数据格式:支持YOLO格式及其他格式&#…

2026/7/29 15:00:03 阅读更多 →

月新闻