"webviewParameter": {
// "pullToRefresh": true,
"titleNView": {
"autoBackButton": false,
"backgroundColor": "#ffffff", //导航栏背景色
"titleColor": "#000000", //标题颜色
"padding-right": "12px",
//"padding-left": "0px",
"titleSize": "15px",//标题字体大小
// "type":"transparent",//透明渐变样式
"titleText": "互享社区",
"buttons": [
{
"float": "left",
"fontSrc": "_www/fonts/iconfont.ttf", // 引用本地字体文件
"fontSize": "23px",
"text": "\ue649"
},
// {
// "float": "left",
// "fontSrc": "_www/fonts/iconfont.ttf", // 引用本地字体文件
// "fontSize": "14.8px",
// "text": "\ue603"
// },{
// "float": "left",
// "fontSrc": "_www/fonts/iconfont.ttf", // 引用本地字体文件
// "fontSize": "18px",
// "text": "\ue604"
// },
{
"float": "right",
"fontSrc": "_www/fonts/iconfont.ttf", // 引用本地字体文件
"fontSize": "18px",
"text": "\ue607",
"onclick": "javascript:plus.webview.getWebviewById('menu').evalJS('menu()');"
}
]
},
function menu() {
plus.webview.currentWebview().show();
}
mui("#topPopover").popover('toggle');
document.addEventListener('plusready', function() {
mui("body").on('tap', 'a', function() {
var id = this.getAttribute('id');
if (id == "appshare") {
plus.webview.getWebviewById('share').evalJS('sharepage.showShareBox()');
}else if (id == "appscan") {
if (checkCameraPermission()) {
openScanner();
} else {
// 请求权限的同时弹出提示
requestCameraPermissionWithPrompt();
}
} else if (id == "fx") {
plus.webview.getWebviewById('share').evalJS('sharepage.showShareBox()');
}else if (id == "hc") {
plus.nativeUI.toast("正在清理缓存");
setTimeout(function() {
plus.cache.clear(function() {
plus.nativeUI.toast("清理完成");
plus.runtime.restart();
});
}, 300);
} else if (id == "applet") {
plus.runtime.openWeb('https://apps.ekeji.wang/xcx.html');
plus.key.addEventListener('backbutton', function() {
plus.webview.currentWebview().close();
})
} else if (id == "gg") {
var href = 'https://www.baidu.com/';
var content = plus.webview.create('browse.html', 'browse', {
scrollIndicator: "none",
bounce: "vertical",
statusbar: {
background: "#06c1ae"
},
titleNView: {
autoBackButton: true,
backgroundColor: '#06c1ae',
titletext: "公告",
titleColor: '#ffffff'
},
cachemode: 'default'
}, {
href: href
});
content.addEventListener('loaded', function() {
content.show('slide-in-right', 300);
});
plus.key.addEventListener('backbutton', function() {
plus.webview.currentWebview().close();
})
} else {
plus.runtime.quit();
}
});
plus.webview.currentWebview().addEventListener("maskClick", function(){
plus.webview.currentWebview().setStyle({mask:"none"});
plus.webview.getWebviewById("menu").hide();
}, false);
plus.key.addEventListener("backbutton", function() {
plus.webview.currentWebview().setStyle({mask:"none"});
plus.webview.getWebviewById("menu").hide();
return false;
});
window.addEventListener('tap', function() {
plus.webview.getWebviewById("menu").hide();
});