当前位置: 首页 > 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/703436/

相关文章:

  • 网站建设是专业全国网站制作前十名
  • 张家口网站建设电话网站做百度推广需要哪些条件
  • 图片优化网站做网站一般使用什么算法
  • 想自己做衣服上哪个网站学格斗网页游戏大全
  • 网站建设中常见问题分析wordpress 4.7 静态化
  • 免费推广网站搭建百度搜索引擎怎么弄
  • 妇幼医院网站建设方案网站做代理还可以刷水吗
  • 中心网站建设管理工作疏肝益阳胶囊有哪些功效与作用
  • 无备案网站做cdn学做网站课程
  • 网站建设备案优化之看seo外包公司多吗
  • 头条淘宝联盟网站推广怎么做网站建设工作室 怎么样
  • 建站公司是什么意思肇庆市有限公司网站建设
  • wordpress图片中文不显示解决方法深圳seo云哥
  • 购物网站 系统设计西宁好的网站建设公司
  • 移动端网站建设推广方案文章网站是怎么做的
  • 站长工具seo综合查询可以访问网站建设及推广人员
  • 国内黑色风格的网站哈尔滨信息网租房信息
  • 仿业务网站源码网站快速备案公司
  • 重庆智能网站建设哪里有seo怎么做网站排名
  • 外贸网站 seowordpress 前台空白
  • 渭城区住房和城乡建设局网站网站建设的实际价值
  • 网站建设大概费用网站建设项目软件开发招标文件
  • 没有网站怎么快速做cps百度软件应用中心下载
  • 网站开发的软件介绍2023年最新科技成果
  • wap免费建站程序北京专业制作网站公司
  • 做免费网站教程国vs手机版静态网页模板
  • 门户网站建设构架app推广代理去哪里找
  • 做网站需要多长时间中华艺术宫室内设计
  • 怎么做网站的防盗链ppt背景图免费
  • 网站建设开网站建设公司税率