# BestPoetryHarmonyOS **Repository Path**: BestPoetry/BestPoetryHarmonyOS ## Basic Information - **Project Name**: BestPoetryHarmonyOS - **Description**: 醉诗词鸿蒙端 - **Primary Language**: JavaScript - **License**: MulanPSL-2.0 - **Default Branch**: develop - **Homepage**: https://poetry.codefe.cn/ - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 4 - **Created**: 2025-07-16 - **Last Updated**: 2025-12-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 醉诗词 > * `images`:配图 > * `lICENSE`:仓库协议 > * `HarmonyOS`:鸿蒙端 ## 简介 1. 醉诗词项目项目为庄生和帝心于2025年夏天的灵机一动,项目暂定包含[醉诗词网站](https://poetry.codefe.cn/)、醉诗词鸿蒙APP端、[醉诗词服务端github](https://github.com/JasonKing5/poetry)等。 2. 我们计划使用最新原生技术开发多端醉诗词项目,而非采用跨端方案,是为了尽可能提供更多课程内容。 # 鸿蒙端开发 ## 服务器域名 ``` https://poetry.codefe.cn/api ``` ## 获取当日日历信息 接口地址:https://poetry.codefe.cn/api/poetryprops/lunar ```` /poetryprops/lunar ```` 日历结构 ``` // 当日日历响应结构 export interface ZodiacResp { code: number data: Zodiac message: string } // 日历接口 export interface Zodiac { shengxiao: string lubarmonth: string lunarday: string } ``` 服务端响应结果: ``` { "code": 0, "data": { "gregoriandate": "2025-05-13", "lunardate": "2025-4-16", "lunar_festival": "", "festival": "", "fitness": "除服.疗病.出行.拆卸.入宅", "taboo": "求官.上任.开张.搬家.探病", "shenwei": "喜神:正南 福神:东南 财神:正南 阳贵:正东 阴贵:东南 ", "taishen": "仓库忌修弄,碓须忌,厨灶莫相干胎神在外西北停留6天", "chongsha": "马日冲(丙子)鼠", "suisha": "岁煞北", "wuxingjiazi": "水", "wuxingnayear": "佛灯火", "wuxingnamonth": "白腊金", "xingsu": "北方室火猪-吉", "pengzu": "壬不泱水 午不苫盖", "jianshen": "除", "tiangandizhiyear": "乙巳", "tiangandizhimonth": "辛巳", "tiangandizhiday": "壬午", "lmonthname": "孟夏", "shengxiao": "蛇", "lubarmonth": "四月", "lunarday": "十六", "jieqi": "" }, "message": "success" } ``` 鸿蒙端获取所需日历数据 ``` @Local zodiac: Zodiac = { shengxiao: '猴', lubarmonth: '十月', lunarday: '二十八' } async aboutToAppear(): Promise { let respData = await http.createHttp().request(BestPoetryConstants.apiBase + '/poetryprops/lunar') let ZodiacResp = JSON.parse(respData.result.toString()) as ZodiacResp this.zodiac = ZodiacResp.data } ``` 布局展示 ``` Column({space:8}) { Text(this.zodiac.shengxiao) .fontColor('#fff').fontSize(16).fontWeight(700) Text(this.zodiac.lubarmonth) .fontColor('#fff').fontSize(16) Text(this.zodiac.lunarday).fontColor('#fff').fontSize(14) } .width('20%') .height('100%') .justifyContent(FlexAlign.Center) ``` ``` ``` ``` ``` ``` ``` ``` ```