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

做海报好的psd网站网站开发数据库课程设计

做海报好的psd网站,网站开发数据库课程设计,特级a做爰网站,八角网站建设一、操作环境 操作系统: Windows 11 专业版、IDE:DevEco Studio 3.1.1 Release、SDK:HarmonyOS 3.1.0(API 9) 二、效果图 可实现两种选择方式,可带时分选择,也可不带,使用更加方便。 三、代码 SelectedDateDialog…
一、操作环境

操作系统:  Windows 11 专业版、IDE:DevEco Studio 3.1.1 Release、SDK:HarmonyOS 3.1.0(API 9)

二、效果图

       

可实现两种选择方式,可带时分选择,也可不带,使用更加方便。

三、代码

SelectedDateDialog.ets文件
/*** 时间选择*/
@CustomDialog
export struct SelectedDateDialog {private selectedDate: Dateprivate isShowTime: Visibility = Visibility.Hidden //是否展示时分栏private callback: (value: Date) => voidcontroller: CustomDialogController //自定义dialog必须声明aboutToAppear() {console.log("时间选择展示:" + JSON.stringify(this.selectedDate))}build() {Column() {Row() {DatePicker({start: new Date('2000-1-1'), //起始时间end: new Date('2050-1-1'), //结束时间selected: this.selectedDate //默认所选时间}).width(this.isShowTime == Visibility.Visible ? '60%' : '100%') //不显示时分,则宽为100.height('100%').lunar(false) //日期是否显示农历。 - true:展示农历。 - false:不展示农历。 默认值:false.onChange(value => {// console.log("轮换结果:" + JSON.stringify(value))this.selectedDate.setFullYear(value.year, value.month, value.day)})TimePicker({ selected: this.selectedDate }).width('35%').height('100%').visibility(this.isShowTime).useMilitaryTime(true) //24小时制.onChange(value => {// console.info('select current date is: ' + JSON.stringify(value))if (value.hour >= 0) {this.selectedDate.setHours(value.hour, value.minute)}})}.width('100%').height('80%')Blank()Button('确定').borderRadius('3').width('40%').margin({ bottom: 20 }).onClick((event: ClickEvent) => {console.log('选择时间:' + JSON.stringify(this.selectedDate))this.callback?.(this.selectedDate)this.controller.close()})}.width('100%').height('50%')}
}

使用其中的参数isShowTime控制是否显示时分栏的选择,Visibility.Visible为显示,Visibility.Hidden不显示

在page中的调用方式:

 @State selectInspectionTime: Date = new Date()selectInspectionDialog: CustomDialogControllerinitSelectInspectionDialog() {this.selectInspectionDialog = new CustomDialogController({builder: SelectedDateDialog({ selectedDate: this.selectInspectionTime, isShowTime: Visibility.Visible,callback: (value) => {let time = value.getFullYear() + "-" + (value.getMonth() + 1) + "-" + value.getDate()+ "T" + value.getHours() + ":" + value.getMinutes() //月份从0开始,故需+1} }),cancel: this.closeInspectionDialog, //点击空白区域回调autoCancel: true,alignment: DialogAlignment.Bottom,offset: { dx: 0, dy: -20 },gridCount: 4,customStyle: false})}closeInspectionDialog() {console.info('Click the callback in the blank area')this.selectInspectionDialog.close()}openDialog() {//点击事件调用打开dialogthis.selectInspectionDialog.open()}

http://www.laogonggong.com/news/89750.html

相关文章:

  • html5响应式网站建设平台如何做网站拉动条
  • 可以做网站的软件上传歌曲合作在惠州做网站
  • 什么是网站一般网站有哪些模块
  • 如何本地搭建自己的网站dede做的网站被植入广告
  • 赤峰网站建设哪家好mega menu wordpress
  • 可以做兼职的网站有哪些工作计算机二级网页设计考什么
  • 福建网站开发公司电话口碑营销的名词解释
  • 网站建设平台计划书wordpress模板修改教程
  • 公司网站首页大图怎么做成都网站制作哪家好
  • 网站开发维护人员深圳市造价信息网官网入口
  • 古云网站建设域名网站电话
  • 重庆seo黄智济南网站关键词优化公司
  • 企业做网站 乐云seo网站建设投标书模板
  • 做网站用后缀好xydown wordpress
  • 石家庄网站建设套免费咨询律师的软件
  • 秒收录网站软文广告有哪些
  • 专业做网站哪里好网站建设功能的策划书
  • 给用ps做的网站加div博物馆网站页面设计说明
  • 做塑料的网站名字快速整站排名seo教程
  • 做网站的报价方案wordpress ajax查询文章
  • 专业网站建设组织新西兰网站建设
  • 门户网站建设目的html静态页面兼职
  • 做个网站一年要多少钱中国服务器市场
  • 做企业网站注意些啥eclipse网站开发实例
  • 给客户建设网站税率ppt模板千库网
  • 鞍山哪里做网站网站高速下载如何做
  • 北京企业网站网站首页设计分析
  • 淘宝api 做网站网站备案的幕布尺寸
  • 做网站的网络公司有哪些网站怎么优化关键词快速提升排名
  • 爱站网关键词密度开发软件的流程