更新记录
1.0.2(2025-10-11)
1.0.2 提交遗漏源码
1.0.1(2025-10-11)
1.0.1更新操作文档
1.0.0(2025-10-11)
1.0.0 安卓初始版本
查看更多平台兼容性
uni-app(3.6.10)
| Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
|---|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | 5.0 | - | - |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | - | - | - | - | - |
uni-app x(3.6.10)
| Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
|---|---|---|---|---|---|
| - | - | 5.0 | - | - | - |
其他
| 多语言 | 暗黑模式 | 宽屏模式 |
|---|---|---|
| √ | √ | √ |
lich-shortcut
开发文档
本插件需要打自定义基座才可以使用
右键快捷方式
该功能需要安卓7.1版本以上支持
添加(修改)
import { setTouchShortcut,addShortcut,removeTouchShortcut,updateShortcuts,disableShortcuts } from '@/uni_modules/lich-shortcut'
const data=[
{
"id":"2", //id
"shortLabel":"点一点", //短描述
"longLabel":"点击点一点",//长描述
"targetPage":"/pages/page/page",//跳转路径
"iconBase64":"图标base64"//图标图片
},
{
"id":"1",
"shortLabel":"***",
"longLabel":"点击***",
"targetPage":"/pages/page/page",
"iconBase64":"图标base64"
}
];
const r=setTouchShortcut(json);
if(r.code==0){
console.log("删除成功");
}else{
console.log("添加失败"+r.error);
}
删除
import { setTouchShortcut,addShortcut,removeTouchShortcut,updateShortcuts,disableShortcuts } from '@/uni_modules/lich-shortcut'
const data=['1'];//添加时的id
const r=removeTouchShortcut(data);
if(r.code==0){
console.log("删除成功");
}else{
console.log("添加失败"+r.error);
}
桌面快捷方式
该功能需要安卓7.0版本以上完全支持 5.0~7.0 部分支持
添加
import { setTouchShortcut,addShortcut,removeTouchShortcut,updateShortcuts,disableShortcuts } from '@/uni_modules/lich-shortcut'
const data={
"id":"5", //id
"shortLabel":"点一点", //短描述
"longLabel":"点击点一点",//长描述
"targetPage":"/pages/page/page",//跳转路径
"iconBase64":"图标base64"//图标图片
};
const r=addShortcut(data);
if(r.code==0){
console.log("添加成功");
}else{
console.log("添加失败"+r.error);
}
修改
import { setTouchShortcut,addShortcut,removeTouchShortcut,updateShortcuts,disableShortcuts } from '@/uni_modules/lich-shortcut'
const data={
"id":"5", //添加时的id
"shortLabel":"点一点", //短描述
"longLabel":"点击点一点",//长描述
"targetPage":"/pages/page/page",//跳转路径
"iconBase64":"图标base64"//图标图片
};
const r=updateShortcuts(data);
if(r.code==0){
console.log("添加成功");
}else{
console.log("添加失败"+r.error);
}
禁用
再高版本安卓中无法删除会显示为灰色图标,低版本会删除
import { setTouchShortcut,addShortcut,removeTouchShortcut,updateShortcuts,disableShortcuts } from '@/uni_modules/lich-shortcut'
const data=['1'];//添加时的id
const r=disableShortcuts(data);
if(r.code==0){
console.log("删除成功");
}else{
console.log("删除失败"+r.error);
}
使用
在项目 onLaunch中添加如下代码完成跳转
import { getShortcutParams as gsp } from '@/uni_modules/lich-shortcut'
export default {
onLaunch: function(options) {
let config= gsp();
if(config.id!='main'){//默认图标进入为main
uni.navigateTo({url:e.page,animationType: 'none'});
}
console.log('App Launch');
}
}

收藏人数:
购买普通授权版(
试用
使用 HBuilderX 导入示例项目
赞赏(0)
下载 392
赞赏 0
下载 11694204
赞赏 1817
赞赏
京公网安备:11010802035340号