当前位置: 首页 > news >正文

鸿蒙开发—黑马云音乐之Music页面

目录

1.外层容器效果

2.信息区-发光效果

3.信息区-内容布局

4.播放列表布局

5.播放列表动态化

6.模拟器运行并配置权限


效果:

1.外层容器效果

@Entry
@Component
export struct MuiscPage {build() {Column() {// 信息区域Column() {}.width('100%')// .backgroundColor(Color.Pink).layoutWeight(1)// 播放列表Column() {}.width('100%').backgroundColor('#ff333333').layoutWeight(2).borderRadius({topLeft:10,topRight:10})}.height('100%').width('100%').backgroundColor(Color.Black)}
}

外层布局就不多说了,使用column容器组件,再增加属性调整。

2.信息区-发光效果

 Column() {}.width('100%')// .backgroundColor(Color.Pink).layoutWeight(1).radialGradient({center:['90%','-10%'],  // 设置中心点radius:'150%',// 设置半径colors:[  //设置颜色的['#5c4111',0.2],[Color.Transparent,1]  //Color.Transparent表示透明色]})

使用径向渐变实现,可以自行设置背景色和中心点。

3.信息区-内容布局

@Entry
@Component
export struct MuiscPage {build() {Column() {// 信息区域Column({space:40}) {// 喜欢的音乐Row({space:10}) {Column() {Image($r('app.media.ic_favorite')).width(80).fillColor('#ff5286')}.justifyContent(FlexAlign.Center).width(100).height(100).backgroundColor(Color.White).borderRadius(10)// 文字信息Column({space:10}){Text('我喜欢的音乐').fontColor(Color.White).width('100%').fontWeight(700)Text('黑马程序员').fontColor('#ffb7b8ba').width('100%').fontSize(12)}}.width('100%')// 三个按钮Row() {Button({ type:ButtonType.Normal }){Row({space:10}){Image($r('app.media.ic_share')).width(20).fillColor('#d2577c')Text('分享').fontColor(Color.White).fontSize(12)}}.backgroundColor('#ff363737').width(90).height(40).borderRadius(20)Button({ type:ButtonType.Normal }){Row({space:10}){Image($r('app.media.ic_comment')).width(20).fillColor('#d2577c')Text('评论').fontColor(Color.White)   .fontSize(12)}}.backgroundColor('#ff363737').width(90).height(40).borderRadius(20)Button({ type:ButtonType.Normal }){Row({space:10}){Image($r('app.media.ic_collect')).width(20).fillColor('#d2577c')Text('收藏').fontColor(Color.White)   .fontSize(12)}}.backgroundColor('#ff363737').width(90).height(40).borderRadius(20)}.width('100%').justifyContent(FlexAlign.SpaceBetween)}.padding({top:30,right:20,bottom:30,left:20}).width('100%')// .backgroundColor(Color.Pink).layoutWeight(1).radialGradient({center: ['90%', '-10%'], // 设置中心点radius: '150%', // 设置半径colors: [ // 设置颜色的['#5c4111', 0.2],[Color.Transparent, 1] //Color.Transparent表示透明色]})// 播放列表Column() {}.width('100%').backgroundColor('#ff333333').layoutWeight(2).borderRadius({ topLeft: 10, topRight: 10 })}.height('100%').width('100%').backgroundColor(Color.Black)}
}

信息区域也只是简单的静态布局,图片从首页导航栏的资源下载。

4.播放列表布局

@Entry
@Component
export struct MuiscPage {build() {Column() {// 信息区域Column({ space: 40 }) {// 喜欢的音乐Row({ space: 10 }) {Column() {Image($r('app.media.ic_favorite')).width(80).fillColor('#ff5286')}.justifyContent(FlexAlign.Center).width(100).height(100).backgroundColor(Color.White).borderRadius(10)// 文字信息Column({ space: 10 }) {Text('我喜欢的音乐').fontColor(Color.White).width('100%').fontWeight(700)Text('黑马程序员').fontColor('#ffb7b8ba').width('100%').fontSize(12)}}.width('100%')// 三个按钮Row() {Button({ type: ButtonType.Normal }) {Row({ space: 10 }) {Image($r('app.media.ic_share')).width(20).fillColor('#d2577c')Text('分享').fontColor(Color.White).fontSize(12)}}.backgroundColor('#ff363737').width(90).height(40).borderRadius(20)Button({ type: ButtonType.Normal }) {Row({ space: 10 }) {Image($r('app.media.ic_comment')).width(20).fillColor('#d2577c')Text('评论').fontColor(Color.White).fontSize(12)}}.backgroundColor('#ff363737').width(90).height(40).borderRadius(20)Button({ type: ButtonType.Normal }) {Row({ space: 10 }) {Image($r('app.media.ic_collect')).width(20).fillColor('#d2577c')Text('收藏').fontColor(Color.White).fontSize(12)}}.backgroundColor('#ff363737').width(90).height(40).borderRadius(20)}.width('100%').justifyContent(FlexAlign.SpaceBetween)}.padding({ top: 30, right: 20, bottom: 30, left: 20 }).width('100%')// .backgroundColor(Color.Pink).layoutWeight(1).radialGradient({center: ['90%', '-10%'], // 设置中心点radius: '150%', // 设置半径colors: [ // 设置颜色的['#5c4111', 0.2],[Color.Transparent, 1] //Color.Transparent表示透明色]})// 播放列表Column() {// 全部播放容器Row({ space: 5 }) {Image($r('app.media.ic_play')).width(15).fillColor('#d2577c')Text('播放全部(16)').fontColor(Color.White).fontSize(12)}.width('100%').padding(10)//   歌曲列表List() {// 每一首歌曲的信息布局ListItem() {Row() {Text('1').fontColor(Color.White).width(30).textAlign(TextAlign.Center)Row({space:10}) {Image('http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/0.jpg').width(30).borderRadius(5)Column() {Text('直到世界的尽头').fontColor('#ff9fa0a1').fontSize(12).width('100%')Text('WANDS').fontColor('#ff9fa0a1').fontSize(10).width('100%')}}.layoutWeight(1)Image($r('app.media.ic_more')).fillColor(Color.White).width(15)}.width('100%').padding({top:8,bottom:8})}ListItem() {Row() {Text('4').fontColor(Color.White).width(30).textAlign(TextAlign.Center)Row({space:10}) {Column() {Text('麝香夫人').fontColor('#ff9fa0a1').fontSize(12).width('100%')Text('凤凰传奇').fontColor('#ff9fa0a1').fontSize(10).width('100%')}}.layoutWeight(1)Image($r('app.media.ic_more')).fillColor(Color.White).width(15)}.width('100%').padding({top:8,bottom:8})}}}.width('100%').backgroundColor('#ff333333').layoutWeight(2).borderRadius({ topLeft: 10, topRight: 10 })}.height('100%').width('100%').backgroundColor(Color.Black)}
}

歌曲列表是两种格式,一种是排名前三的歌曲(带有歌曲图片),另一种是前三之外的歌曲(不带有歌曲图片),首先设置好这两种静态布局后才进入下一步。

5.播放列表动态化

export interface songItemType {img: stringname: stringauthor: stringurl: stringid: string
}@Entry
@Component
export struct MuiscPage {// 歌曲列表@State songs: songItemType[] = [{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/0.jpg',name: '直到世界的尽头',author: 'WANDS',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/0.m4a',id: '0000'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/1.jpg',name: '画',author: '赵磊',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/1.mp3',id: '0001'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/2.jpg',name: 'Sweet Dreams',author: 'TPaul Sax / Eurythmics',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/2.mp3',id: '0002'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/3.jpg',name: '奢香夫人',author: '凤凰传奇',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/3.m4a',id: '0003'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/4.jpg',name: '空心',author: '光泽',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/4.mp3',id: '0004'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/5.jpg',name: '反转地球',author: '潘玮柏',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/5.mp3',id: '0005'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/6.jpg',name: 'No.9',author: 'T-ara',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/6.m4a',id: '0006'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/7.jpg',name: '孤独',author: 'G.E.M.邓紫棋',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/7.m4a',id: '0007'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/8.jpg',name: 'Lose Control',author: 'Hedley',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/8.m4a',id: '0008'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/9.jpg',name: '倩女幽魂',author: '张国荣',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/9.m4a',id: '0009'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/10.jpg',name: '北京北京',author: '汪峰',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/10.m4a',id: '0010'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/11.jpg',name: '苦笑',author: '汪苏泷',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/11.mp3',id: '0011'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/12.jpg',name: '一生所爱',author: '卢冠廷 / 莫文蔚',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/12.m4a',id: '0012'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/13.jpg',name: '月半小夜曲',author: '李克勤',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/13.mp3',id: '0013'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/14.jpg',name: 'Rolling in the Deep',author: 'Adele',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/14.m4a',id: '0014'},{img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/15.jpg',name: '海阔天空',author: 'Beyond',url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/15.m4a',id: '0015'}]build() {Column() {// 信息区域Column({ space: 40 }) {// 喜欢的音乐Row({ space: 10 }) {Column() {Image($r('app.media.ic_favorite')).width(80).fillColor('#ff5286')}.justifyContent(FlexAlign.Center).width(100).height(100).backgroundColor(Color.White).borderRadius(10)// 文字信息Column({ space: 10 }) {Text('我喜欢的音乐').fontColor(Color.White).width('100%').fontWeight(700)Text('黑马程序员').fontColor('#ffb7b8ba').width('100%').fontSize(12)}}.width('100%')// 三个按钮Row() {Button({ type: ButtonType.Normal }) {Row({ space: 10 }) {Image($r('app.media.ic_share')).width(20).fillColor('#d2577c')Text('分享').fontColor(Color.White).fontSize(12)}}.backgroundColor('#ff363737').width(90).height(40).borderRadius(20)Button({ type: ButtonType.Normal }) {Row({ space: 10 }) {Image($r('app.media.ic_comment')).width(20).fillColor('#d2577c')Text('评论').fontColor(Color.White).fontSize(12)}}.backgroundColor('#ff363737').width(90).height(40).borderRadius(20)Button({ type: ButtonType.Normal }) {Row({ space: 10 }) {Image($r('app.media.ic_collect')).width(20).fillColor('#d2577c')Text('收藏').fontColor(Color.White).fontSize(12)}}.backgroundColor('#ff363737').width(90).height(40).borderRadius(20)}.width('100%').justifyContent(FlexAlign.SpaceBetween)}.padding({ top: 30, right: 20, bottom: 30, left: 20 }).width('100%')// .backgroundColor(Color.Pink).layoutWeight(1).radialGradient({center: ['90%', '-10%'], // 设置中心点radius: '150%', // 设置半径colors: [ // 设置颜色的['#5c4111', 0.2],[Color.Transparent, 1] //Color.Transparent表示透明色]})// 播放列表Column() {// 全部播放容器Row({ space: 5 }) {Image($r('app.media.ic_play')).width(15).fillColor('#d2577c')Text('播放全部(16)').fontColor(Color.White).fontSize(12)}.width('100%').padding(10)//   歌曲列表List() {ForEach(this.songs, (item: songItemType, index: number) => {if (index < 3) {// 每一首歌曲的信息布局(带图片)ListItem() {Row() {// 如果是第0个,则显示黄色文字编号if (index == 0) {Text((index + 1).toString()).fontColor(Color.Yellow).width(30).textAlign(TextAlign.Center)}// 如果是第1个,则显示红色文字编号if (index == 1) {Text((index + 1).toString()).fontColor('#d2577c').width(30).textAlign(TextAlign.Center)}// 如果是第2个,则显示蓝色文字编号if (index == 2) {Text((index + 1).toString()).fontColor('#0094ff').width(30).textAlign(TextAlign.Center)}Row({ space: 10 }) {Image(item.img).width(30).borderRadius(5)Column() {Text(item.name).fontColor('#ff9fa0a1').fontSize(12).width('100%')Text(item.author).fontColor('#ff9fa0a1').fontSize(10).width('100%')}}.layoutWeight(1)Image($r('app.media.ic_more')).fillColor(Color.White).width(15)}.width('100%').padding({ top: 8, bottom: 8 })}} else {// 每一首歌曲的信息布局(不带图片)ListItem() {Row() {Text((index + 1).toString()).fontColor(Color.White).width(30).textAlign(TextAlign.Center)Row({ space: 10 }) {Column() {Text(item.name).fontColor('#ff9fa0a1').fontSize(12).width('100%')Text(item.author).fontColor('#ff9fa0a1').fontSize(10).width('100%')}}.layoutWeight(1)Image($r('app.media.ic_more')).fillColor(Color.White).width(15)}.width('100%').padding({ top: 8, bottom: 8 })}}})// 增加ListItem来防止最后一个歌曲看不到的问题ListItem(){Text('已经到低了~~~~').fontColor(Color.White).width('100%').textAlign(TextAlign.Center)}.height(60).padding({bottom:40})}}.width('100%').backgroundColor('#ff333333').layoutWeight(2).borderRadius({ topLeft: 10, topRight: 10 })}.height('100%').width('100%').backgroundColor(Color.Black)}
}

初始化一个歌曲数组songs,里面包含歌曲的名字歌手,图片url等信息。

关键是使用ForEach遍历数组中的信息,根据开始设置的格式,用变量替换掉常量,就可以实现前三个歌曲格式一样,前三之外的歌曲格式一样。

 ForEach(this.songs, (item: songItemType, index: number) => { if (index < 3),index从0开始,这里表示遍历数组中前三个歌曲,之后的 else{} 表示遍历除前三之外的歌曲,数组中有几个前三之外的歌曲,就遍历几个,从第四首遍历到最后一首。

6.模拟器运行并配置权限

预览器不能直接播放歌曲,需要在模拟器中播放,而模拟器播放需要配置联网权限,使模拟器连接到网络才能正常播歌。

找到src/main/module.json5文件。

在"deliveryWithInstall": true,
    "installationFree": false,
    "pages": "$profile:main_pages",

后面加上

"requestPermissions": [{"name": "ohos.permission.INTERNET"}],

整体是

"deliveryWithInstall": true,"installationFree": false,"pages": "$profile:main_pages","requestPermissions": [{"name": "ohos.permission.INTERNET"}],"abilities": [{"name": "EntryAbility","srcEntry": "./ets/entryability/EntryAbility.ts","description": "$string:EntryAbility_desc","icon": "$media:icon","label": "$string:EntryAbility_label","startWindowIcon": "$media:icon","startWindowBackground": "$color:start_window_background","exported": true,

这样才能连上网络,才能在模拟器中正常播放歌曲。

相关文章:

鸿蒙开发—黑马云音乐之Music页面

目录 1.外层容器效果 2.信息区-发光效果 3.信息区-内容布局 4.播放列表布局 5.播放列表动态化 6.模拟器运行并配置权限 效果&#xff1a; 1.外层容器效果 Entry Component export struct MuiscPage {build() {Column() {// 信息区域Column() {}.width(100%)// .backgroun…...

IsaacLab | 如何在Manipulation任务中添加新的目标(target)

如是我闻&#xff1a; 终于让我给摸索出来了&#xff0c;在这里描述一下问题场景。 假使说我们有一个机械臂操作的任务&#xff0c;这样婶的 Isaac Lab | Push 我们想做多目标的任务&#xff0c;这时候需要向环境中添加第二个目标&#xff0c;像这样 Isaac Lab | Add target 那…...

【Python从入门到进阶】61、Pandas中DataFrame对象的操作(二)

接上篇《60、Pandas中DataFrame对象的操作&#xff08;一&#xff09;》 上一篇我们讲解了DataFrame对象的简介、基本操作及数据清洗相关的内容。本篇我们来继续讲解DataFrame对象的统计分析、可视化以及数据导出与保存相关内容。 一、DataFrame的统计分析 在数据分析和处理中…...

Linux(虚拟机)的介绍

Linux介绍 常见的操作系统 Windows&#xff1a;微软公司开发的一款桌面操作系统&#xff08;闭源系统&#xff09;。版本有dos&#xff0c;win98&#xff0c;win NT&#xff0c;win XP , win7, win vista. win8, win10&#xff0c;win11。服务器操作系统&#xff1a;winserve…...

CSS(九)——CSS 轮廓(outline)

CSS 轮廓&#xff08;outline&#xff09; 轮廓&#xff08;outline&#xff09;是绘制于元素周围的一条线&#xff0c;位于边框边缘的外围&#xff0c;可起到突出元素的作用。 轮廓&#xff08;outline&#xff09;属性指定元素轮廓的样式、颜色和宽度。 让我们用一个图来看…...

Unity Timeline:构建复杂动画序列的利器

Unity的Timeline是一个强大的动画工具&#xff0c;它允许开发者创建复杂的动画序列&#xff0c;将动画、音频和事件整合到一个统一的时间轴上。Timeline的可视化编辑界面使得动画制作变得更加直观和灵活。本文将介绍Unity Timeline的基本概念、功能以及如何使用它来实现动画。 …...

C# 与C++ cli

cli CLI&#xff08;Command Line Interface&#xff09;是一种通过命令行界面与计算机系统进行交互的方式。它提供了一种以文本形式输入命令和接收系统输出的方法&#xff0c;用于执行各种操作和管理计算机系统。以下是CLI的详细解释&#xff1a; 一、定义与基本概念 定义&…...

Linux文件编程--打开及创建

...

Vue3点击按钮实现跳转页面并携带参数

前提&#xff1a;有完整的路由规则 1.源页面 <template><div><h1>源页面</h1><!--通过js代码跳转--><template #default"scope"><button click"toTargetView(scope.row)">点击跳转携带参数</button><…...

探索Linux-1-虚拟机远程登陆XShell6远程传输文件Xftp6

Linux是什么&#xff1f; Linux是一个开源的操作系统内核&#xff0c;由林纳斯托瓦兹&#xff08;Linus Torvalds&#xff09;于1991年首次发布。它基于Unix操作系统&#xff0c;但提供了更多的自由和灵活性。Linux内核是操作系统的核心部分&#xff0c;负责管理系统资源、处理…...

SpringBoot中使用监听器

1.定义一个事件 /*** 定义事件* author hrui* date 2024/7/25 12:46*/ public class CustomEvent extends ApplicationEvent {private String message;public CustomEvent(Object source, String message) {super(source);this.message message;}public String getMessage() …...

mybatise全接触-面试宝典-知识大全

1 . 简述什么是Mybatis和原理 &#xff1f; Mybatis工作原理&#xff1a; &#xff08;1&#xff09;Mybatis是一个半ORM&#xff08;对象关系映射&#xff09;框架&#xff0c;它内部封装了JDBC&#xff0c;加载驱动、创建连接、创建statement等繁杂的过程&#xff0c;开发者…...

Catalyst优化器:让你的Spark SQL查询提速10倍

目录 1 逻辑优化阶段 2.1 逻辑计划解析 2.2 逻辑计划优化 2.2.1 Catalys的优化过程 2.2.2 Cache Manager优化 2 物理优化阶段 2.1 优化 Spark Plan 2.1.1 Catalyst 的 Join 策略 2.1.2 如何决定选择哪一种 Join 策略 2.2 Physical Plan 2.2.1 EnsureRequirements 规则 3 相关文…...

【Hot100】LeetCode—416. 分割等和子集

目录 题目1- 思路2- 实现⭐152. 乘积最大子数组——题解思路 3- ACM 实现 题目 原题连接&#xff1a;416. 分割等和子集 1- 思路 理解为背包问题 思路&#xff1a; 能否将均分的子集理解为一个背包&#xff0c;比如对于 [1,5,11,5]&#xff0c;判断能否凑齐背包为 11 的容量…...

前端开发知识-vue

大括号里边放键值对&#xff0c;即是一个对象。 一、vue可以简化前端javascript的操作。 主要特点是可以实现视图、数据的双向绑定。 使用vue主要分为三个步骤&#xff1a; 1.javascript中引入vue.js 可以src中可以是vue的网址&#xff0c;也可以是本地下载。 2.在javasc…...

【嵌入式硬件】快衰减和慢衰减

1.引语 在使用直流有刷电机驱动芯片A4950时,这款芯片采用的是PWM控制方式,我发现他的正转、反转有两种控制方式,分别是快衰减和慢衰减。 2.理解 慢衰减:相当于加在电机(感性原件)两端电压消失,将电机两端正负短接。 快衰减:相当于加在电机(感性原件)两端电压消失,将电机…...

C语言 | Leetcode C语言题解之第275题H指数II

题目&#xff1a; 题解&#xff1a; int hIndex(int* citations, int citationsSize) {int left 0, right citationsSize - 1;while (left < right) {int mid left (right - left) / 2;if (citations[mid] > citationsSize - mid) {right mid - 1;} else {left mi…...

速盾:网络安全和 CDN 之间的关系是怎样的?

网络安全和内容交付网络&#xff08;CDN&#xff09;之间有着密切的关系。网络安全主要涉及保护网络和系统免受各种威胁和攻击&#xff0c;而CDN是一种用于提供更快速、高效和可靠的内容交付服务的技术。在当今数字化和云计算时代&#xff0c;网络安全和CDN之间的关系变得更加紧…...

数据库安全:MySQL安全配置,MySQL安全基线检查加固

「作者简介」:冬奥会网络安全中国代表队,CSDN Top100,就职奇安信多年,以实战工作为基础著作 《网络安全自学教程》,适合基础薄弱的同学系统化的学习网络安全,用最短的时间掌握最核心的技术。 这一章节我们需要知道MySQL的安全基线标准和加固方式。 MySQL基线检查 1、更新…...

【SpringBoot】参数传递

1.定义URL变量 RequestMapping("/user/{username}") ResponseBody public String userProfile(PathVariable String username){ return "user:"username; } 2.定义多个URL变量 RequestMapping("/user/{username}/blog/{blogId}") Response…...

2.Vue编写一个app

1.src中重要的组成 1.1main.ts // 引入createApp用于创建应用 import { createApp } from "vue"; // 引用App根组件 import App from ./App.vue;createApp(App).mount(#app)1.2 App.vue 其中要写三种标签 <template> <!--html--> </template>…...

鸿蒙中用HarmonyOS SDK应用服务 HarmonyOS5开发一个医院查看报告小程序

一、开发环境准备 ​​工具安装​​&#xff1a; 下载安装DevEco Studio 4.0&#xff08;支持HarmonyOS 5&#xff09;配置HarmonyOS SDK 5.0确保Node.js版本≥14 ​​项目初始化​​&#xff1a; ohpm init harmony/hospital-report-app 二、核心功能模块实现 1. 报告列表…...

C++ 基础特性深度解析

目录 引言 一、命名空间&#xff08;namespace&#xff09; C 中的命名空间​ 与 C 语言的对比​ 二、缺省参数​ C 中的缺省参数​ 与 C 语言的对比​ 三、引用&#xff08;reference&#xff09;​ C 中的引用​ 与 C 语言的对比​ 四、inline&#xff08;内联函数…...

C++ 求圆面积的程序(Program to find area of a circle)

给定半径r&#xff0c;求圆的面积。圆的面积应精确到小数点后5位。 例子&#xff1a; 输入&#xff1a;r 5 输出&#xff1a;78.53982 解释&#xff1a;由于面积 PI * r * r 3.14159265358979323846 * 5 * 5 78.53982&#xff0c;因为我们只保留小数点后 5 位数字。 输…...

深入解析C++中的extern关键字:跨文件共享变量与函数的终极指南

&#x1f680; C extern 关键字深度解析&#xff1a;跨文件编程的终极指南 &#x1f4c5; 更新时间&#xff1a;2025年6月5日 &#x1f3f7;️ 标签&#xff1a;C | extern关键字 | 多文件编程 | 链接与声明 | 现代C 文章目录 前言&#x1f525;一、extern 是什么&#xff1f;&…...

自然语言处理——循环神经网络

自然语言处理——循环神经网络 循环神经网络应用到基于机器学习的自然语言处理任务序列到类别同步的序列到序列模式异步的序列到序列模式 参数学习和长程依赖问题基于门控的循环神经网络门控循环单元&#xff08;GRU&#xff09;长短期记忆神经网络&#xff08;LSTM&#xff09…...

网络编程(UDP编程)

思维导图 UDP基础编程&#xff08;单播&#xff09; 1.流程图 服务器&#xff1a;短信的接收方 创建套接字 (socket)-----------------------------------------》有手机指定网络信息-----------------------------------------------》有号码绑定套接字 (bind)--------------…...

AspectJ 在 Android 中的完整使用指南

一、环境配置&#xff08;Gradle 7.0 适配&#xff09; 1. 项目级 build.gradle // 注意&#xff1a;沪江插件已停更&#xff0c;推荐官方兼容方案 buildscript {dependencies {classpath org.aspectj:aspectjtools:1.9.9.1 // AspectJ 工具} } 2. 模块级 build.gradle plu…...

华为OD机考-机房布局

import java.util.*;public class DemoTest5 {public static void main(String[] args) {Scanner in new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextLine()) { // 注意 while 处理多个 caseSystem.out.println(solve(in.nextLine()));}}priv…...

学习一下用鸿蒙​​DevEco Studio HarmonyOS5实现百度地图

在鸿蒙&#xff08;HarmonyOS5&#xff09;中集成百度地图&#xff0c;可以通过以下步骤和技术方案实现。结合鸿蒙的分布式能力和百度地图的API&#xff0c;可以构建跨设备的定位、导航和地图展示功能。 ​​1. 鸿蒙环境准备​​ ​​开发工具​​&#xff1a;下载安装 ​​De…...