|
本帖最后由 jy 于 2018-5-31 15:57 编辑
不清楚你说的网页指代的是快应用ux页面还是快应用里面打开的webview?
如果是快应用ux页面的话,用下面的代码- import shortcut from '@system.shortcut'
- shortcut.hasInstalled({
- success: function (ret) {
- if (ret) {
- console.log('桌面图标已经存在!')
- } else {
- //在这里可以增加弹窗,提示用户是否创建桌面图标
- shortcut.install({
- success: function () {
- console.log('成功创建桌面图标!')
- },
- fail: function (errmsg, errcode) {
- console.log('桌面图标创建失败\r\n错误信息: ' + errcode + '---' + errmsg);
- }
- })
- }
- }
- })
复制代码
如果是webview的话,可以点击后调用system.go(path),跳转到指定页面,在该指定页面中执行上述代码创建,创建完成后按需决定是否再次打开创建前的webview
|
|