Compare commits
13 Commits
develop
...
c856fe3da6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c856fe3da6 | ||
|
|
b276c74be1 | ||
|
|
9262eeea35 | ||
|
|
da98464e1a | ||
|
|
5e281672a3 | ||
|
|
aae8e6fb50 | ||
|
|
f44108a486 | ||
|
|
b2a53d04aa | ||
|
|
2514b279b6 | ||
|
|
d40d8e1e91 | ||
|
|
96a9932e70 | ||
|
|
2ad389e2f0 | ||
|
|
a0f2fab6bf |
@@ -118,7 +118,7 @@ const handleConfirm = ()=>{
|
|||||||
// margin-top:290rpx;
|
// margin-top:290rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size:36rpx;
|
font-size:36rpx;
|
||||||
color:#393939;
|
color:#333333;
|
||||||
.font-green{
|
.font-green{
|
||||||
color:#05A3F4;
|
color:#05A3F4;
|
||||||
font-size: 42rpx;
|
font-size: 42rpx;
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ export const AGREEWELCOME_KEY="agreewelcome";
|
|||||||
// clientId 默认写2
|
// clientId 默认写2
|
||||||
export const CLIENT_ID="2";
|
export const CLIENT_ID="2";
|
||||||
// #区分内外网 //1-内网,2-外网
|
// #区分内外网 //1-内网,2-外网
|
||||||
export const NETWORK_ENV=2;
|
export const NETWORK_ENV=1;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { createSSRApp } from "vue";
|
import { createSSRApp } from "vue";
|
||||||
import App from "./App.vue";
|
import App from "./App.vue";
|
||||||
|
|
||||||
import { CLIENT_ID,NETWORK_ENV } from '@/enums/cacheEnums';
|
import { CLIENT_ID,NETWORK_ENV } from '@/enums/cacheEnums';
|
||||||
import '@/static/font/iconfont.css'
|
import '@/static/font/iconfont.css'
|
||||||
|
|
||||||
@@ -11,10 +12,13 @@ import { createPinia } from 'pinia'
|
|||||||
const pinia = createPinia()
|
const pinia = createPinia()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
|
|
||||||
const app = createSSRApp(App);
|
const app = createSSRApp(App);
|
||||||
|
|
||||||
|
|
||||||
// 全局变量
|
// 全局变量
|
||||||
app.config.globalProperties.$CLIENT_ID = CLIENT_ID;
|
app.config.globalProperties.$CLIENT_ID = CLIENT_ID;
|
||||||
app.config.globalProperties.$NETWORK_ENV = NETWORK_ENV;
|
app.config.globalProperties.$NETWORK_ENV = NETWORK_ENV;
|
||||||
|
|||||||
@@ -1,39 +1,50 @@
|
|||||||
<template>
|
<template>
|
||||||
<view id="test">
|
<view id="test">
|
||||||
<!-- #ifdef h5 -->
|
<!-- #ifdef H5 -->
|
||||||
<web-view :src="url"></web-view>
|
<web-view :src="url"></web-view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref,onMounted,getCurrentInstance } from 'vue';
|
import { ref,getCurrentInstance } from 'vue';
|
||||||
import { onLoad,onReady,onBackPress } from '@dcloudio/uni-app';
|
import { onLoad,onBackPress } from '@dcloudio/uni-app';
|
||||||
const { proxy } = getCurrentInstance();
|
|
||||||
|
|
||||||
let windowInfo = ref(null);
|
|
||||||
let url = ref('');
|
let url = ref('');
|
||||||
let title = ref('');
|
let title = ref('');
|
||||||
onLoad(async(opt) => {
|
onLoad(async(opt) => {
|
||||||
console.log(opt)
|
// console.log(opt)
|
||||||
url.value = opt.url;
|
url.value = opt.url ;
|
||||||
title.value = opt.title;
|
title.value = opt.title;
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
titleNViewWebview(url.value,title.value);
|
titleNViewWebview(url.value,title.value);
|
||||||
// #endif
|
// #endif
|
||||||
// uni.getSystemInfo({
|
|
||||||
// success: (res)=> {
|
|
||||||
// windowInfo.value = res;
|
|
||||||
// createWvAndLoadUrl(url.value,title.value);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onBackPress((e)=> {//响应返回事件
|
||||||
|
console.log("onBackPress=>",e)
|
||||||
|
if (e.from === 'navigateBack') { //这个地方必须要有的,否则会死循环
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
console.log('点击返回....');
|
||||||
|
let pages = getCurrentPages()
|
||||||
|
let page = pages[pages.length - 1];
|
||||||
|
let currentPages = page.$getAppWebview()
|
||||||
|
currentPages.close()
|
||||||
|
uni.navigateBack({delta:2})
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
|
||||||
// 带标题栏控件的Webview窗口
|
// 带标题栏控件的Webview窗口
|
||||||
let webview = null;
|
let webview = null;
|
||||||
function titleNViewWebview(url,title) {
|
function titleNViewWebview(url,title) {
|
||||||
|
console.log("titleNViewWebview=>",url,title)
|
||||||
|
|
||||||
|
let nwating = plus.nativeUI.showWaiting("loading...",{
|
||||||
|
width:'110px',
|
||||||
|
padding:'10px'
|
||||||
|
})
|
||||||
|
|
||||||
webview = plus.webview.create(url, 'test', {
|
webview = plus.webview.create(url, 'test', {
|
||||||
titleNView: {
|
titleNView: {
|
||||||
backgroundColor: '#307AF5',
|
backgroundColor: '#307AF5',
|
||||||
@@ -41,32 +52,21 @@ function titleNViewWebview(url,title) {
|
|||||||
titleColor: '#ffffff',
|
titleColor: '#ffffff',
|
||||||
autoBackButton: true,
|
autoBackButton: true,
|
||||||
backgroundImage:'./../../static/images/bg-Blue-header.png',
|
backgroundImage:'./../../static/images/bg-Blue-header.png',
|
||||||
buttons:[{onclick:clickButton}]
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
webview.addEventListener('close', function(){
|
|
||||||
webview=null;
|
webview.addEventListener('loaded', function() {
|
||||||
});
|
nwating.close();
|
||||||
webview.addEventListener('titleUpdate', function(){
|
|
||||||
webview.show();
|
webview.show();
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
webview.addEventListener('close', function(){
|
||||||
|
console.log("close=>")
|
||||||
|
webview=null;
|
||||||
|
uni.navigateBack();
|
||||||
});
|
});
|
||||||
webview.addEventListener('loading', () => {
|
|
||||||
plus.nativeUI.showWaiting("loading...",{
|
|
||||||
width:'110px',
|
|
||||||
padding:'10px'
|
|
||||||
})
|
|
||||||
}, false);
|
|
||||||
//plus.nativeUI.showWaiting()
|
|
||||||
webview.addEventListener('loaded', () => {
|
|
||||||
plus.nativeUI.closeWaiting();
|
|
||||||
}, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 左侧按钮返回
|
|
||||||
function clickButton(){
|
|
||||||
// plus.nativeUI.alert('clicked!');
|
|
||||||
webview=null;
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user