1
This commit is contained in:
parent
4b765b63f3
commit
65d698df3a
@ -4,7 +4,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref,onShow ,onHide} from 'vue'
|
||||||
import config from "../../config";
|
import config from "../../config";
|
||||||
import {sendWebWiew,receiveWebView} from "@/utils/communicate";
|
import {sendWebWiew,receiveWebView} from "@/utils/communicate";
|
||||||
const webViewRef=ref(null)
|
const webViewRef=ref(null)
|
||||||
@ -20,6 +20,27 @@ permissionListener.onComplete((e) => {
|
|||||||
sendWebWiew(webViewRef.value,{auth:e,open:false})
|
sendWebWiew(webViewRef.value,{auth:e,open:false})
|
||||||
}); */
|
}); */
|
||||||
// #endif
|
// #endif
|
||||||
|
//解决ios的h5问题,获取网络权限之后,重新加载
|
||||||
|
const networkStatusChange=(res)=>{
|
||||||
|
if(res.isConnected) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '网络无连接',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const webViewObj=ref(null)
|
||||||
|
onShow(()=>{
|
||||||
|
uni.onNetworkStatusChange(networkStatusChange);
|
||||||
|
})
|
||||||
|
|
||||||
|
onHide(()=>{
|
||||||
|
uni.offNetworkStatusChange(networkStatusChange)
|
||||||
|
})
|
||||||
const webLoad=(e)=>{
|
const webLoad=(e)=>{
|
||||||
const m=receiveWebView(e)
|
const m=receiveWebView(e)
|
||||||
switch (m.action) {
|
switch (m.action) {
|
||||||
|
Loading…
Reference in New Issue
Block a user