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

怎样上传网站到百度已认证网站服务费怎么做

怎样上传网站到百度,已认证网站服务费怎么做,网站推广策划方案毕业设计,冰桶挑战是什么网络营销方式【高心星出品】 文章目录 全局自定义弹出框openCustomDialog案例开发步骤完整代码 全局自定义弹出框openCustomDialog CustomDialog是自定义弹出框#xff0c;可用于广告、中奖、警告、软件更新等与用户交互响应操作。开发者可以通过CustomDialogController类显示自定义弹出框…【高心星出品】 文章目录 全局自定义弹出框openCustomDialog案例开发步骤完整代码 全局自定义弹出框openCustomDialog CustomDialog是自定义弹出框可用于广告、中奖、警告、软件更新等与用户交互响应操作。开发者可以通过CustomDialogController类显示自定义弹出框。 但是使用起来有很多问题不支持动态创建也不支持动态刷新在相对较复杂的应用场景中推荐使用UIContext中获取到的PromptAction对象提供的openCustomDialog接口来实现自定义弹出框。 openCustomDialog传参为ComponentContent形式通过ComponentContent封装内容可以与UI界面解耦调用更加灵活可以满足开发者的封装诉求。拥有更强的灵活性弹出框样式是完全自定义的且在弹出框打开之后可以使用updateCustomDialog方法动态更新弹出框的一些参数。 案例 下面将写一个案例点击按钮弹出自定义对话框并且可以动态修改对话框的位置和内容。 运行结果 开发步骤 全局对话框弹出工具 里面只需要UIContextComponentContent和对话框配置option。 里面有打开对话框关闭对话框和更新对话框的方法。 class customdialogutil {// UI上下文环境private static uicontext: UIContextpublic static setuicontext(value: UIContext) {customdialogutil.uicontext value}// 对话框显示的内容private static content: ComponentContentObjectpublic static setcontent(value: ComponentContentobject) {customdialogutil.content value}// 弹出对话框的配置private static option: promptAction.ShowDialogOptionspublic static setoption(value: promptAction.ShowDialogOptions) {customdialogutil.option value}// 打开弹出框static open() {customdialogutil.uicontext.getPromptAction().openCustomDialog(customdialogutil.content, customdialogutil.option).catch((err: Error) {console.error(gxxt , err.message)})}// 关闭弹出框static close() {customdialogutil.uicontext.getPromptAction().closeCustomDialog(customdialogutil.content).catch((err: Error) {console.error(gxxt , err.message)})}// 更新弹出框内容或这样式static update(nopt: promptAction.ShowDialogOptions) {customdialogutil.uicontext.getPromptAction().updateCustomDialog(customdialogutil.content, nopt).catch((err: Error) {console.error(gxxt , err.message)})} }生成对话框界面的构建函数 interface param {message: stringupdck: () voidcloseck: () void }Builder function dialogcontent(p: param) {Column({ space: 20 }) {Text(p.message).fontSize(20).fontWeight(FontWeight.Bolder)Row() {Button(更新).onClick(p.updck)Button(关闭).onClick(p.closeck)}.justifyContent(FlexAlign.SpaceAround).width(100%)}.padding(20).backgroundColor(Color.White).width(80%).borderRadius(20) }页面代码 Entry Component struct CustomdialogPage {build() {Column() {Button(弹出框).width(60%).onClick(() {// 设置ui上下文环境customdialogutil.setuicontext(this.getUIContext())// 第一个builder构建函数生成的compoentcontentlet content: ComponentContentparam new ComponentContentparam(this.getUIContext(), wrapBuilder[param](dialogcontent), {message: 自定义对话框内容1, updck: () {// 更新对话框的位置customdialogutil.update({ alignment: DialogAlignment.Top, offset: { dy: 100, dx: 0 } })}, closeck: () {// 关闭对话框customdialogutil.close()}})// 设置第一个构建函数的componentcontentcustomdialogutil.setcontent(content)customdialogutil.setoption({})// 打开对话框customdialogutil.open()})}.height(100%).width(100%).justifyContent(FlexAlign.Center)} }完整代码 import { ComponentContent, promptAction, typeNode } from kit.ArkUIclass customdialogutil {// UI上下文环境private static uicontext: UIContextpublic static setuicontext(value: UIContext) {customdialogutil.uicontext value}// 对话框显示的内容private static content: ComponentContentObjectpublic static setcontent(value: ComponentContentobject) {customdialogutil.content value}// 弹出对话框的配置private static option: promptAction.ShowDialogOptionspublic static setoption(value: promptAction.ShowDialogOptions) {customdialogutil.option value}// 打开弹出框static open() {customdialogutil.uicontext.getPromptAction().openCustomDialog(customdialogutil.content, customdialogutil.option).catch((err: Error) {console.error(gxxt , err.message)})}// 关闭弹出框static close() {customdialogutil.uicontext.getPromptAction().closeCustomDialog(customdialogutil.content).catch((err: Error) {console.error(gxxt , err.message)})}// 更新弹出框内容或这样式static update(nopt: promptAction.ShowDialogOptions) {customdialogutil.uicontext.getPromptAction().updateCustomDialog(customdialogutil.content, nopt).catch((err: Error) {console.error(gxxt , err.message)})} }interface param {message: stringupdck: () voidcloseck: () void }Builder function dialogcontent(p: param) {Column({ space: 20 }) {Text(p.message).fontSize(20).fontWeight(FontWeight.Bolder)Row() {Button(更新).onClick(p.updck)Button(关闭).onClick(p.closeck)}.justifyContent(FlexAlign.SpaceAround).width(100%)}.padding(20).backgroundColor(Color.White).width(80%).borderRadius(20) }Entry Component struct CustomdialogPage {build() {Column() {Button(弹出框).width(60%).onClick(() {// 设置ui上下文环境customdialogutil.setuicontext(this.getUIContext())// 第一个builder构建函数生成的compoentcontentlet content: ComponentContentparam new ComponentContentparam(this.getUIContext(), wrapBuilder[param](dialogcontent), {message: 自定义对话框内容1, updck: () {// 更新对话框的位置customdialogutil.update({ alignment: DialogAlignment.Top, offset: { dy: 100, dx: 0 } })}, closeck: () {// 关闭对话框customdialogutil.close()}})// 设置第一个构建函数的componentcontentcustomdialogutil.setcontent(content)customdialogutil.setoption({})// 打开对话框customdialogutil.open()})}.height(100%).width(100%).justifyContent(FlexAlign.Center)} }customdialogutil.setcontent(content)customdialogutil.setoption({})// 打开对话框customdialogutil.open()})}.height(100%).width(100%).justifyContent(FlexAlign.Center)} }
http://www.hkea.cn/news/14461702/

相关文章:

  • 媒体网站的销售怎么做室内设计效果图欧式风格
  • 江西网站建设优化服务wordpress取消默认图片
  • 网站下载地址软件商店oppo官方下载
  • 欧美网站模板下载英铭长沙网站建设
  • 苏州网站设计公司价格wordpress 商城站下载
  • 东莞浩智网站建设多少钱wordpress 判断语句
  • 贵州企业网站建设设计专业的英文网站建设
  • 新余百度网站建设wordpress 登陆信息
  • 网站建设08网站建设需求表
  • 巴中建设银行网站西安搬家公司哪家服务好还实惠
  • 北京建设规划许可证网站黑帽seo软件
  • 怎么做一个网站送给女朋友海南百度推广代理商
  • 新华书店网站建设网站建设和考核工作通知
  • 江西建设银行分行网站二级建造师报考条件官网
  • 如何创建个人网站模板华为手机软文范文300
  • 何为网站开发用层还是表格做网站快
  • 网站制作优化排名中山seo关键词
  • 最好用的系统优化软件许昌seo推广
  • 爱有声小说网站捡个校花做老婆哪个网站可以做销售记录
  • 衣服网站建设规划书便捷网站建设推荐
  • 做视频后期的网站html5网站搭建
  • 南京网站制作域名常州市建设工程交易网
  • wordpress没有文章导航网站seo优化
  • 大型房产网站模板网站关键词排名外包
  • 网站 推广 实例中国建设劳动学会是正规网站吗
  • 网站建设与代运营介绍网站维护升级访问
  • 清远医疗网站建设湖北专业的网站制作代理商
  • 机械外贸网站建设html期末作业网页代码
  • 系统花钱做任务的小说魅网站wordpress改插件
  • 做外汇网站代理dw网页设计官网