更新记录

1.1.1(2022-09-18)

解决本地库问题

1.1.0(2022-09-14)

Tag:1.1.0(Stable Release)

1.0.4(2022-09-06)

解决偶尔云打包失败情况

查看更多

平台兼容性

Android Android CPU类型 iOS
适用版本区间:5.0 - 11.0 armeabi-v7a:未测试,arm64-v8a:未测试,x86:未测试 适用版本区间:9 - 14

原生插件通用使用流程:

  1. 购买插件,选择该插件绑定的项目。
  2. 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
  3. 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
  4. 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
  5. 开发完毕后正式云打包

付费原生插件目前不支持离线打包。
Android 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/android
iOS 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios

注意事项:使用HBuilderX2.7.14以下版本,如果同一插件且同一appid下购买并绑定了多个包名,提交云打包界面提示包名绑定不一致时,需要在HBuilderX项目中manifest.json->“App原生插件配置”->”云端插件“列表中删除该插件重新选择


DialogPlugin

简介

一个实用好看又可高度定制的模态弹窗,动效体验感爆棚,还新增加了主题及风格等功能,后续还会实现更多的功能以满足更多场景。

引用

const dialogModule = uni.requireNativePlugin("Chen-Dialog")

showModal(OBJECT,CACLLBACK)

显示模态弹窗 OBJECT参数说明

参数 类型 必填 说明 平台差异说明
theme String 否 弹窗主题(auto、light、dark),默认为 auto 跟随系统主题 iOS暂不可跟随系统主题,默认为light
style String 否 弹窗风格(Material、iOS),默认为Material风格 iOS仅有iOS风格
title String 否 提示的标题
content String 否 提示的内容
showCancel Boolean 否 是否显示取消按钮,默认为 true
cancelText String 否 取消按钮的文字,默认为"取消"
cancelColor HexColor 否 取消按钮的文字颜色,默认为"#007aff"
confirmText String 否 确定按钮的文字,默认为"确定"
confirmColor HexColor 否 确定按钮的文字颜色,默认为"#007aff"
CACLLBACK参数说明
参数 类型 说明
confirm Boolean 为 true 时,表示用户点击了确定按钮
cancel Boolean 为 true 时,表示用户点击了取消
示例
let options = {
  title: "标题",
  content: "提示内容",
  confirmText: "确认",
  confirmColor: "#007aff",
  showCancel: true,
  cancelText: "取消",
  cancelColor:"#007aff",
  style: "Material",
  theme: "light"
}
dialogModule.showModal(options,(result) => {
  dialogModule.showToast({title:JSON.stringify(result)})
})

showToast(OBJECT)

显示消息提示框 OBJECT参数说明

参数 类型 必填 说明 平台差异说明
theme String 否 弹窗主题(auto、light、dark),默认为 auto 跟随系统主题 iOS暂不可跟随系统主题,默认为light
style String 否 弹窗风格(Material、iOS),默认为Material风格 iOS仅有iOS风格
title String 否 提示的内容
icon String 否 图标,有效值详见下方说明。
duration Number 否 提示的延迟时间,单位毫秒,默认:1500

icon 值说明

值 说明 平台差异说明
success 显示成功图标
error 显示错误图标
warning 显示警告图标
loading 显示加载图标(需手动调用hideLoading方法关闭加载弹窗)
none 不显示图标
示例
let options = {
  title: val,
  icon: val,
  duration: 1500,
  style: "Material",
  theme: "light"
}
dialogModule.showToast(options)
if (val === "loading"){
  setTimeout(() => {
    dialogModule.hideLoading()
  },1500)
}

showActionSheet(OBJECT,CACLLBACK)

从底部向上弹出操作菜单 OBJECT参数说明

参数 类型 必填 说明 平台差异说明
theme String 否 弹窗主题(auto、light、dark),默认为 auto 跟随系统主题 iOS暂不可跟随系统主题,默认为light
style String 否 弹窗风格(Material、iOS),默认为Material风格 iOS仅有iOS风格
title String 否 提示的标题
content String 否 提示的内容
itemList Array 是 按钮的文字数组

CACLLBACK参数说明

参数 类型 说明
index Number 用户点击的按钮,从上到下的顺序,从0开始
value String 用户点击的按钮文字

示例

let options = {
  title: "标题",
  content: "提示内容",
  itemList: ["选项1","选择2","选项3"],
  style: "Material",
  theme: "light"
}
dialogModule.showActionSheet(options,(result) => {
  dialogModule.showToast({title:JSON.stringify(result)})
})

showInputModal(OBJECT,CACLLBACK)

显示模态输入弹窗 OBJECT参数说明

参数 类型 必填 说明 平台差异说明
theme String 否 弹窗主题(auto、light、dark),默认为 auto 跟随系统主题 iOS暂不可跟随系统主题,默认为light
style String 否 弹窗风格(Material、iOS),默认为Material风格 iOS仅有iOS风格
title String 否 提示的标题
content String 否 提示的内容
inputText String 否 输入框现有文本,默认为空
showCancel Boolean 否 是否显示取消按钮,默认为 true
cancelText String 否 取消按钮的文字,默认为"取消"
cancelColor HexColor 否 取消按钮的文字颜色,默认为"#007aff"
confirmText String 否 确定按钮的文字,默认为"确定"
confirmColor HexColor 否 确定按钮的文字颜色,默认为"#007aff"

CACLLBACK参数说明

参数 类型 说明
confirm Boolean 为 true 时,表示用户点击了确定按钮
cancel Boolean 为 true 时,表示用户点击了取消
value String 输入的文本内容

示例

let options = {
  title: "标题",
  content: "提示内容",
  inputText: "继续编辑",
  confirmText: "确认",
  confirmColor: "#007aff",
  showCancel: true,
  cancelText: "取消",
  cancelColor:"#007aff",
  style: "Material",
  theme: "light"
}
dialogModule.showInputModal(options,(result) => {
  dialogModule.showToast({title:JSON.stringify(result)})
})

隐私、权限声明

1. 本插件需要申请的系统权限列表:

无

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

无