正面玄関は最初にAPPが開いているかどうかを判断し、vuexが状態を保存します
//判断是否是APP打开
checkApp(){
if(window.plus){
this.plusReady();
}else{
document.addEventListener( "plusready", this.plusReady, false );
}
},
plusReady(){
this.$store.state.isApp = true;
},
クリックしてWebアドレスを入力する具体的なページは次のとおりです。主にplus.webview.create(url、id、{top: '40px'})を使用します。新しいウィンドウは上から40pxで、この40pxで頭を表示できます。 、ヘッド自体セットバックボタン
//点击跳转到新的网络地址
goBanner(){
if (this.isApp) {
//显示跳转到网络地址的专用头部
this.$store.state.showNewWindow = true;
//H5+的API,不懂可以去研究下
this.$store.state.newWindow = plus.webview.create(this.dappDetail.website,this.dappDetail.id,{
top:"40px", //跟自己设置的头部一个高度
});
this.$store.state.newWindow.show();
} else {
//不是APP就直接在新窗口打开跳转页面
window.open(this.dappDetail.website,"_blank")
}
},
戻るボタンに移動して、vuexのnewWindowを閉じます。
//APP跳转到新页面后返回
goBack(){
//隐藏跳转到网络地址的专用头部
this.$store.state.showNewWindow = false;
this.$store.state.newWindow.close();
},