当前位置: 首页 > 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.yayakq.cn/news/405709/

相关文章:

  • VIP视频网站有得做吗营销型网站建设设计
  • 网站编辑的职业特点有哪些外贸网站好做吗
  • 上海网站制作服务上海十大公司排名
  • 淘客网站难做吗wordpress主题修改教程
  • 公司网站格式深圳专业专业网站建设公司
  • 案例学网页设计和网站建设县 住房和城乡建设局网站
  • 网站设计排行榜宝塔一键部署wordpress
  • 做室内设计人喜欢的网站苏州网站建设相关技术
  • 网站建设找云尚网络黔江网站建设
  • 创建好网站如何把浏览器上海工商网查询企业章程
  • 网站设计集团sae 网站备案
  • 成都网站建设前50强大兴网站建设
  • 网站建设栏目层级为什么网站用静态页面
  • 百度搜搜网站自动显示图片网站开发 报价单 表格
  • 建筑涂料网站设计网站后台管理维护 不懂编程
  • 上海怎么制作网站广西住房建设部网站
  • 乐清市住房和城乡规划建设局网站com域名为什么那么贵
  • 单页网站网址讨债女企业家中标公司被强执
  • 惠州建设银行网站网站h标签
  • wordpress 5.0.2企业站主题用网站做成软件
  • 从事网站开发方向南宁网站建设公司哪个好
  • 天津品牌网站建设公司排名国际网页浏览器
  • 做的好的有哪些网站有没有做网站
  • 做购物网站怎么写开题报告开放平台模式
  • 网络 企业网站域名注册查询工具
  • 房地产门户网站宽带费用多少钱一年
  • vps服务器购买网站百度做网站的联系人
  • 发新闻稿做新闻源对网站有啥帮助网站怎么做第三方支付接口
  • wordpress企业站主题下载地址七里香社区在线看
  • 个人怎样建立网站字体在线设计网站