当前位置:首页>鸿蒙APP>纯血鸿蒙自定义弹窗最佳实践:从「到处复制」到「一行调用」

纯血鸿蒙自定义弹窗最佳实践:从「到处复制」到「一行调用」

  • 2026-07-01 04:12:22
纯血鸿蒙自定义弹窗最佳实践:从「到处复制」到「一行调用」

本文基于 ArkTS + ArkUI V2 的工程实践,介绍如何把 PromptAction.openCustomDialog 封装成可复用、可扩展、易维护的对话框体系,核心思路可直接复用到自己的模块。

一、为什么需要二次封装?

HarmonyOS NEXT 提供了两种主流弹窗能力:

  • CustomDialogController:与页面强绑定,适合简单场景。
  • PromptAction.openCustomDialog:通过 ComponentContent 解耦 UI 上下文,支持动态更新、生命周期监听,更适合业务级封装。

直接使用 openCustomDialog 时,每个页面都要重复写一段「创建 ComponentContent → 绑定 UIContext → 打开 → 关闭 → 释放」的样板代码。一旦业务需要统一对话框样式、按钮风格、转场动画,就会发现代码散落在各处,难以维护。

我们的目标是:业务侧一行代码唤起对话框,样式、动画、关闭逻辑全部收敛到公共组件。

二、整体架构

entry/src/main/ets
├── components/dialog
│   ├── AppDialogBuilder.ets      // 对外暴露的 Builder 与 show 方法
│   └── DialogCard.ets               // 对话框内容组件
└── utils
    └── DialogManager.ets           // ComponentContent / PromptAction 的封装
  • DialogManager:负责 ComponentContent 的绑定、打开、关闭、更新、释放,屏蔽 PromptAction 细节。
  • DialogCard:纯展示组件,只接收 @Param,不持有弹窗状态。
  • AppDialogBuilder:把「参数 → Builder → ComponentContent → 打开」的链路串起来,提供业务友好的 showAppDialog() API。

三、DialogManager:把 PromptAction 包成工具类

核心职责只有四个:绑定、打开、关闭、释放。

// entry/src/main/ets/utils/DialogManager.ets
import { BusinessError } from '@kit.BasicServicesKit'
import { ComponentContent, promptAction, UIContext } from '@kit.ArkUI'

export class DialogManager {
private uiContextUIContext | null = null
private contentNodeComponentContent<Object> | null = null
private options: promptAction.BaseDialogOptions = {
alignmentDialogAlignment.Center,
autoCanceltrue,
showInSubWindowfalse,
isModaltrue
  }

bind(contextUIContextnodeComponentContent<Object>, options?: promptAction.BaseDialogOptions): void {
this.uiContext = context
this.contentNode = node
if (options) {
this.options = options
    }
  }

open(): void {
if (!this.uiContext || !this.contentNode) {
console.error('DialogManager open failed: dialog context or content is not bound')
return
    }
this.uiContext.getPromptAction()
      .openCustomDialog(this.contentNodethis.options)
      .catch((errBusinessError) => {
console.error(`openCustomDialog failed, code: ${err.code}`)
      })
  }

close(): void {
if (!this.uiContext || !this.contentNode) {
return
    }
this.uiContext.getPromptAction()
      .closeCustomDialog(this.contentNode)
      .catch((errBusinessError) => {
console.error(`closeCustomDialog failed, code: ${err.code}`)
      })
this.dispose()
  }

updateContent(paramsObject): void {
if (!this.contentNode) {
return
    }
this.contentNode.update(params)
  }

dispose(): void {
if (this.contentNode) {
this.contentNode.dispose()
this.contentNode = null
    }
this.uiContext = null
  }
}

设计要点

  1. 单例 or 实例? 如果业务同时只存在一个弹窗,可以用一个全局实例;如果允许弹窗层叠,建议每个 showAppDialog() 调用创建新的 DialogManager 实例,避免关闭时误伤上一个弹窗。

  2. 关闭即释放close() 中调用 dispose(),防止 ComponentContent 内存泄漏。ComponentContent 不会随弹窗消失自动销毁,必须手动释放。

  3. 错误兜底openCustomDialog 可能因上下文销毁、重复打开等原因失败,统一用 .catch 捕获并输出 console.error,不要抛到业务层。

四、DialogCard:把弹窗当纯展示组件写

使用 ArkUI V2 装饰器,所有可变状态通过 @Param 传入,所有事件通过回调传出。

// entry/src/main/ets/components/dialog/DialogCard.ets

function buildCardTransition(): TransitionEffect {
return TransitionEffect.asymmetric(
TransitionEffect.OPACITY
      .combine(TransitionEffect.translate({ y20 }))
      .combine(TransitionEffect.scale({ x0.96y0.96 }))
      .animation({ duration240curveCurve.FastOutSlowIn }),
TransitionEffect.opacity(0)
      .combine(TransitionEffect.translate({ y12 }))
      .combine(TransitionEffect.scale({ x0.98y0.98 }))
      .animation({ duration140curveCurve.EaseIn })
  )
}

@ComponentV2
export struct DialogCard {
@Param icon?: ResourceStr = undefined
@Param iconBgColor?: ResourceColor = undefined
@Param titleResourceStr = ''
@Param contentResourceStr = ''
@Param cancelText?: ResourceStr = '取消'
@Param confirmText?: ResourceStr = undefined
@Param onCancel?: () => void = undefined
@Param onConfirm?: () => void = undefined
@Param isTextBtnboolean = false

@Computed
get hasDivider(): boolean {
return this.isTextBtn && Boolean(this.cancelText) && Boolean(this.confirmText)
  }

build() {
Column({ space16 }) {
if (this.icon) {
Row() {
Image(this.icon)
            .width(24).height(24)
            .fillColor(Color.White)
            .draggable(false)
        }
        .width(48).height(48)
        .borderRadius(16)
        .backgroundColor(this.iconBgColor ?? '
#FF5B6CFD')
        .justifyContent(FlexAlign.Center)
      }

if (this.title) {
Text(this.title)
          .fontSize(20)
          .fontWeight(700)
          .fontColor('#E6000000')
          .textAlign(TextAlign.Center)
      }

Text(this.content)
        .fontSize(14)
        .lineHeight(22)
        .fontColor('#99000000')
        .textAlign(TextAlign.Center)

Row({ space24 }) {
if (this.cancelText) {
Button(this.cancelText)
            .layoutWeight(1)
            .height(44)
            .fontSize(16)
            .fontColor(this.isTextBtn ? '#FF5B6CFD' : '#E6000000')
            .backgroundColor(this.isTextBtn ? Color.Transparent : '#0F000000')
            .borderRadius('50%')
            .onClick(() => this.onCancel?.())
        }

if (this.hasDivider) {
Divider()
            .vertical(true)
            .color('#99000000')
            .height(16)
        }

if (this.confirmText) {
Button(this.confirmText)
            .layoutWeight(1)
            .height(44)
            .fontSize(16)
            .fontColor(this.isTextBtn ? '#FF5B6CFD' : Color.White)
            .backgroundColor(this.isTextBtn ? Color.Transparent : '#FF5B6CFD')
            .borderRadius('50%')
            .onClick(() => this.onConfirm?.())
        }
      }
      .width('100%')
      .margin({ top6 })
    }
    .padding({ top24bottom16left24right24 })
    .width('100%')
    .backgroundColor(Color.White)
    .shadow({ radius16color'#0F000000'offsetX0offsetY: -4 })
    .borderRadius(32)
    .transition(buildCardTransition())
  }
}

设计要点

  1. V2 装饰器,单向数据流 全部使用 @Param 接收输入,回调函数输出事件,组件内部不持有弹窗开关状态。

  2. 样式转场动效收敛到组件内部 颜色、字号、圆角、阴影等调用方无需关心 buildCardTransition() 放在组件文件里,业务不需要关心弹窗怎么出现、怎么消失。

五、AppDialogBuilder:一行代码打开弹窗

把「参数 → Builder → ComponentContent → DialogManager」串起来,业务侧只需调用 showAppDialog(params)

// entry/src/main/ets/components/dialog/AppDialogBuilder.ets
import { DialogCardDialogContainer } from './DialogCard'
import { ComponentContentUIContext } from '@kit.ArkUI'
import { DialogManager } from '../utils/DialogManager'

export class AppDialogParams {
titleResourceStr = ''
contentResourceStr = ''
icon?: ResourceStr
iconBgColor?: ResourceColor
cancelText?: ResourceStr
confirmText?: ResourceStr
onCancel?: () => void
onConfirm?: () => void
maskCancel?: boolean
isTextBtn?: boolean
}

@Builder
export function AppDialogBuilder(paramsAppDialogParams): void {
DialogContainer({
maskCancel: params.maskCancel ?? false,
onCancel: params.onCancel
  }) {
DialogCard({
title: params.title,
content: params.content,
icon: params.icon,
iconBgColor: params.iconBgColor,
cancelText: params.cancelText,
confirmText: params.confirmText ?? '确认',
onCancel: params.onCancel,
onConfirm: params.onConfirm,
isTextBtn: params.isTextBtn ?? false
    })
  }
}

const globalDialog = new DialogManager()
const globalWrap = wrapBuilder(AppDialogBuilder)

export function showAppDialog(paramsAppDialogParamsctxUIContext) {
// 包装回调:业务逻辑执行后自动关闭弹窗
// 这里直接修改入参对象,因为 AppDialogParams 是一次性配置对象
const originalCancel = params.onCancel
  params.onCancel = () => {
    originalCancel?.()
    globalDialog.close()
  }
const originalConfirm = params.onConfirm
  params.onConfirm = () => {
    originalConfirm?.()
    globalDialog.close()
  }

const contentNode = new ComponentContent(ctx, globalWrap, params)
  globalDialog.bind(ctx, contentNode)
  globalDialog.open()
}

对应的蒙层容器:

// entry/src/main/ets/components/dialog/DialogCard.ets(同文件追加)

@Builder
function noopBuilder() {}

@ComponentV2
export struct DialogContainer {
@Param maskCancelboolean = false
@Event onCancel?: () => void = undefined
@BuilderParam content() => void = noopBuilder

build() {
Stack({ alignContentAlignment.Center }) {
Column() {
this.content()
      }
      .width('100%')
      .onClick(() => {}) // 消费内容区点击事件,避免向上冒泡触发蒙层关闭
    }
    .width('100%')
    .height('100%')
    .padding({ left16right16 })
    .transition(TransitionEffect.OPACITY.animation({ duration180curveCurve.EaseOut }))
    .onClick(() => {
if (this.maskCancel) {
this.onCancel?.()
      }
    })
  }
}

设计要点

  1. Builder 与 ComponentContent 解耦 通过 wrapBuilder(AppDialogBuilder) 把 Builder 转成可传入 ComponentContent 的包装,避免 Builder 与页面上下文强绑定。

  2. 自动关闭,业务无感 在 showAppDialog 内部包裹 onCancel / onConfirm,业务回调执行完后自动调用 globalDialog.close()

  3. UIContext 由调用方传入 调用方传入 UIContext。在页面内直接使用 this.getUIContext() 即可。

  4. @BuilderParam 必须用 @Builder 函数初始化DialogContainer 的 content 默认使用 noopBuilder,而不是箭头函数。@BuilderParam 的初始化值必须是 @Builder 装饰的函数。

  5. 阻止内容区点击冒泡到蒙层 用 Column 包裹 this.content() 并设置空的 onClick,避免用户点击弹窗内容时事件向上冒泡触发 Stack 的蒙层关闭逻辑。

六、业务侧用法

// entry/src/main/ets/pages/Index.ets
import { showAppDialog } from '../components/dialog/AppDialogBuilder'

@Entry
@ComponentV2
struct DemoPage {
private handleDelete() {
showAppDialog({
title'确认删除?',
content'删除后数据不可恢复,请谨慎操作。',
confirmText'删除',
onConfirm() => {
console.info('执行删除逻辑')
      }
    }, this.getUIContext())
  }

build() {
Column() {
Button('打开弹窗')
        .onClick(() => this.handleDelete())
    }
    .width('100%')
    .height('100%')
  }
}

七、五个最佳实践

1. 不要混用 V1 和 V2 装饰器

弹窗内容组件统一用 @ComponentV2 + @Param / @Event@Link@Provide@Consume 在 ComponentContent 场景下有使用限制,容易踩坑。

2. 弹窗状态只在调用侧维护

弹窗组件本身不保存「是否显示」状态,只负责展示。是否打开、打开什么内容,由调用方决定。这样弹窗可以脱离页面生命周期存在,也更容易做全局提示。

3. Builder 传引用,不要立即调用

在 bindSheetDialogOverlay 等场景,优先传 this.MyBuilder 引用,避免传 this.MyBuilder() 导致内容在绑定瞬间被求值固化。

4. 关闭后必须 dispose

ComponentContent 不会自动释放,忘记 dispose() 会导致内存泄漏,甚至再次打开同名弹窗时出现异常。建议在 close() 中统一释放。

5. 区分「更新内容」和「更新属性」

  • 更新内容:contentNode.update(params),用于修改弹窗内部文字、图标等。
  • 更新属性:promptAction.updateCustomDialog(node, options),用于修改对齐方式、蒙层颜色、偏移量等。

注意:updateCustomDialog 未设置的属性会恢复为默认值,更新时要传完整配置。

八、常见坑点

现象
原因
解决
弹窗不显示
UIContext
 已销毁或未传入
确保在页面可见后调用,并传入 this.getUIContext()
关闭后再打开无响应
上一个 ComponentContent 未 dispose
close()
 中调用 dispose()
蒙层点击无法关闭
maskCancel
 未开启,或 autoCancel 为 false
检查 BaseDialogOptions 配置
弹窗内部状态不刷新
通过 Builder 参数以值快照传递
使用 ComponentContent.update() 或拆分为独立 V2 组件
同时打开多个弹窗互相覆盖
共用同一个 DialogManager 实例
每个弹窗使用独立实例,或维护弹窗栈

九、参考文档

本文涉及的核心 API 与能力均来自 HarmonyOS NEXT 官方文档,建议进一步阅读:

  • 不依赖UI组件的全局自定义弹出框 (openCustomDialog)
  • ComponentContent
  • PromptAction(openCustomDialog / closeCustomDialog / updateCustomDialog)
  • BaseDialogOptions
  • wrapBuilder:封装全局@Builder
  • @Param:组件外部输入
  • @BuilderParam装饰器:引用@Builder函数
  • 组件内转场 (transition)

十、写在最后

HarmonyOS NEXT 的 openCustomDialog 是一个非常强大的能力,但直接使用容易写出「复制粘贴式」代码。通过 DialogManager + DialogCard + AppDialogBuilder 三层封装,可以把弹窗能力收敛到一处:

  • 业务侧一行调用;
  • 样式、动画、关闭逻辑统一维护;
  • 内存和生命周期风险可控。

如果你也在做 HarmonyOS NEXT 项目,也可以把项目里的弹窗统一收一收。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-05 05:05:27 HTTP/2.0 GET : https://c.mffb.com.cn/a/496749.html
  2. 运行时间 : 0.167570s [ 吞吐率:5.97req/s ] 内存消耗:4,492.21kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=204c04565f61995ea4d71d1835522e50
  1. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/runtime/temp/cefbf809ba1a84190cb04b0cb7abcf79.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/c.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000349s ] mysql:host=127.0.0.1;port=3306;dbname=c_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000596s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000246s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.012822s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000885s ]
  6. SELECT * FROM `set` [ RunTime:0.000478s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000546s ]
  8. SELECT * FROM `article` WHERE `id` = 496749 LIMIT 1 [ RunTime:0.032944s ]
  9. UPDATE `article` SET `lasttime` = 1783199127 WHERE `id` = 496749 [ RunTime:0.010790s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000323s ]
  11. SELECT * FROM `article` WHERE `id` < 496749 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.005048s ]
  12. SELECT * FROM `article` WHERE `id` > 496749 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.003461s ]
  13. SELECT * FROM `article` WHERE `id` < 496749 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.009181s ]
  14. SELECT * FROM `article` WHERE `id` < 496749 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.005856s ]
  15. SELECT * FROM `article` WHERE `id` < 496749 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.013819s ]
0.169036s