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

上传wordpress网站网站建设需要哪些人

上传wordpress网站,网站建设需要哪些人,福建省建设集团有限公司官网,四字顺口名字公司1. HarmonyOS开发-自定义倒计时功能 1.1. 自定义倒计时控件CountdownView 1.1.1. 功能说明: 在这个倒计时应用中,用户可以设置倒计时的初始时间,点击按钮启动倒计时,并在倒计时结束时收到提醒。用户还可以暂停和重置倒计时,并恢复到初始设置的时间。 1.1.2. 所需组件 (1…

1. HarmonyOS开发-自定义倒计时功能

1.1. 自定义倒计时控件CountdownView

在这里插入图片描述

1.1.1. 功能说明:

  在这个倒计时应用中,用户可以设置倒计时的初始时间,点击按钮启动倒计时,并在倒计时结束时收到提醒。用户还可以暂停和重置倒计时,并恢复到初始设置的时间。

1.1.2. 所需组件

  (1)@Entry 和 @Component 装饰器
  (2)Text 组件用于显示倒计时
  (3)Button 组件用于用户交互
  (4)TextInput 组件用于用户输入倒计时初始时间
  (5)setInterval 和 clearInterval 方法用于时间控制

1.1.3. 代码实现

  (1)TextInput():用于用户输入倒计时的初始时间。输入值会同时更新 initialTime 和 timeLeft。
  (2)setInterval() 和 clearInterval():setInterval() 用于每秒更新 timeLeft,实现倒计时;clearInterval() 用于暂停或重置倒计时。
  (3)resetCountdown():将 timeLeft 重置为 initialTime,确保倒计时恢复到用户设置的初始值。

// CountdownPage.ets
@Component
export struct CountdownPage {@State timeLeft: number = 0; // 剩余时间@State initialTime: number = 0; // 初始时间@State isRunning: boolean = false; // 倒计时状态private intervalId: number | null = null; // 定时器 IDbuild() {Column({ space: 20 }) {Row() {Text("倒计时:").fontSize(25).fontWeight(FontWeight.Bold);Text(this.formatTime(this.timeLeft)).fontSize(25).fontColor(Color.Red);}// 输入初始时间TextInput({ placeholder: "设置倒计时时间(秒)" }).type(InputType.Number).onChange((value: string) => {if (!this.isRunning) {this.initialTime = parseInt(value) || 0;this.timeLeft = this.initialTime; // 更新剩余时间}});// 按钮交互行Row({ space: 20 }) {Button(this.isRunning ? '暂停' : '开始').onClick(() => {if (this.isRunning) {this.stopCountdown();} else {this.startCountdown();}});Button('重置').onClick(() => {this.resetCountdown();});}.justifyContent(FlexAlign.Center);// 提示倒计时结束if (this.timeLeft === 0 && this.isRunning) {Text("时间到!").fontSize(30).fontColor(Color.Green).fontWeight(FontWeight.Bold);}}.padding(20).height('100%').width('100%').alignItems(HorizontalAlign.Center);}private startCountdown() {if (this.timeLeft > 0) {this.isRunning = true;this.intervalId = setInterval(() => {if (this.timeLeft > 1) {this.timeLeft -= 1;} else {this.stopCountdown();}}, 1000);}}private stopCountdown() {this.isRunning = false;if (this.intervalId !== null) {clearInterval(this.intervalId);this.intervalId = null;}}private resetCountdown() {this.stopCountdown();this.timeLeft = this.initialTime; // 将倒计时重置为初始时间}private formatTime(time: number): string {return `${Math.floor(time / 60).toString().padStart(2, '0')}:${(time % 60).toString().padStart(2, '0')}`;}
}
// Index.ets
import { CountdownPage } from './CountdownPage'@Entry
@Component
struct Index {build() {Column() {CountdownPage() // 调用自定义组件}.padding(20) // 设置页面内边距}
}

1.2. 验证码倒计时功能

1.2.1. 效果

在这里插入图片描述
在这里插入图片描述

1.2.2. 代码

class TimerBean {timerId: number | nullisRunning: booleantimeStr: stringtimeLeft: numberconstructor(timerId: number | null, isRunning: boolean,timeStr: string, timeLeft: number) {this.timerId = timerIdthis.isRunning = isRunningthis.timeStr = timeStrthis.timeLeft = timeLeft}
}@Entry
@Component
struct TimerPage {@State timerId: number | null = null; // 定时器 ID@State isRunning: boolean = false; // 倒计时状态@State timeStr: string = "获取验证码"; // 剩余时间字符串@State timeLeft: number = 10; // 剩余时间@State plvBean: TimerBean = new TimerBean(null, // 定时器 IDfalse, //倒计时状态"获取验证码", //剩余时间字符串20,//加剩余时间)build() {Column({ space: 20 }) {Row() {Text("倒计时:").fontSize(25)

文章转载自:

http://8Rtz35Eh.bfysg.cn
http://BDipHEs3.bfysg.cn
http://gkVq5JkY.bfysg.cn
http://7uvIPZv3.bfysg.cn
http://LkEyIHR2.bfysg.cn
http://rj0mWbpH.bfysg.cn
http://bsLkIQ70.bfysg.cn
http://H5XrZi1u.bfysg.cn
http://C3DZIHMa.bfysg.cn
http://p276Ga13.bfysg.cn
http://4qCWMWG9.bfysg.cn
http://EbAHOC1l.bfysg.cn
http://K3iGhfWT.bfysg.cn
http://dVHzPsB1.bfysg.cn
http://xtOe01wj.bfysg.cn
http://pFNF2UGb.bfysg.cn
http://ZgWmNAll.bfysg.cn
http://KuWsLczc.bfysg.cn
http://LA1SVnVp.bfysg.cn
http://oK5a7xK7.bfysg.cn
http://J8XV3uvh.bfysg.cn
http://qffZt8yY.bfysg.cn
http://klKnKuN3.bfysg.cn
http://D3v16mLL.bfysg.cn
http://ZL8VTO56.bfysg.cn
http://3ZYuJaG8.bfysg.cn
http://fh0Xmp2y.bfysg.cn
http://KSGt5IV8.bfysg.cn
http://13zZrblN.bfysg.cn
http://t1A5IAKW.bfysg.cn
http://www.dtcms.com/wzjs/705142.html

相关文章:

  • 湖北平台网站建设哪里好wordpress 中文连接
  • 云主机 asp 网站网店运营包括哪些
  • 青岛金融网站建设做app需要多少钱
  • 找人做网站会给源代码吗二级域名能查到一级域名吗
  • 网上商城网站建设网上开店货源怎么找
  • 嘉兴网站优化排名点胶机 东莞网站建设
  • 织梦婚纱网站模板哪里有学习做网站的
  • 网站建设多久学会网站模板
  • 绵阳 网站开发wordpress 批量导入 淘宝
  • 黄石网站制作公司做暧免费观看网站
  • 深圳宝安做网站代理网络游戏平台
  • 集团网站建设策划方案wordpress 慢 google
  • 河南网站建设推广公司城乡建设查询网站
  • 做企业网站找哪家福建有没有网站做一件代发
  • 网站建设框架怎么做做网站怎么租个空间
  • 广东省建设监理协会证书查询网站河南省建设培训中心网站
  • 黄江镇网站建设网站改版中
  • 网站建设需求有哪些霞浦建设局网站
  • 长安仿做网站盐城网站建设官网
  • 公司网站介绍模板 html检测网站点击量
  • 昆明cms模板建站制作个人网站的六个步骤
  • 旅游网站管理系统源码四川有什么好的网站建设公司
  • 网站手机版建设项目书岱山县网站建设
  • 短信轰炸网站开发注册城乡规划师准考证打印时间
  • 建设工程有限公司企业网站做网站多少钱西宁君博正规
  • 网站淘宝客 难做潍坊网站建设套餐
  • 建设视频网站多少钱东莞网站建设seo推广
  • 银川网站建设那家好wordpress中的搜索模板在什么地方
  • 如何用自己电脑做网站页面跟男友做网站
  • 网站开发合同验收设计师要考什么证