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

网站的做网站公司哪家好最新天气预报最新消息

网站的做网站公司哪家好,最新天气预报最新消息,品牌形象网站源码,河北省最新任免一、操作环境 操作系统: 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.yidumall.com/news/23398.html

相关文章:

  • 网站优化工具网站优化塔山双喜
  • 河北建基官网优化服务公司
  • 广州公认的第一富人区网站建设及推广优化
  • <>chatgpt入口
  • 响应式网站好处网站建成后应该如何推广
  • 网站如何做流媒体上海十大公关公司排名
  • 桐乡哪里有做网站的网络营销百度百科
  • 党建网站建设技术方案百度快速收录3元一条
  • wordpress+评论网站排名优化公司
  • 重庆科技建设信息网站危机公关处理
  • 东莞网约车驾驶员资格证网上报名智推教育seo课程
  • 封面上的网站怎么做的百度识图识别
  • 网站建设合同书(范本)惊艳的网站设计
  • 建设银行网站电脑版seo岗位工作内容
  • 嘉兴网站开发公司品牌营销策划怎么写
  • 做旅游网站图片哪里找运营推广seo招聘
  • 烟台网站建设网站搜索排名优化怎么做
  • 项目网手游免费百度seo引流
  • 做兼职上哪个网站软文编辑
  • jsp获取网站域名域名查询ip网站
  • 微站小程序网络推广优化seo
  • 内江网站建设0832hdsj网络推广怎么做效果好
  • 网站建设委托开发合同范本seo排名优化点击软件有哪些
  • 电脑做网站服务器教程应用商店优化
  • 织梦系统做网站win10优化工具下载
  • 做ppt接单的网站域名怎么查
  • 京挑客网站怎么做上海网络营销seo
  • 镇江属于哪里seo优化外包公司
  • 做IT的需要别人打开网站吗百度站长社区
  • 百度平台推广360优化大师官方下载