mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:23:25 +08:00
uniapp【新增】:增加webview页面,可以跳转到外部网站
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { handleRouteNavigateTo, handleShowToast } from '@/core/utils';
|
||||
import { NavLinkEnum } from '@/core/enum';
|
||||
import { NavLinkEnum ,RouteSwitchNameEnum} from '@/core/enum';
|
||||
import { queryReceiveCoupon } from '@/core/api';
|
||||
|
||||
export const handleAdvertiseDetail = (type : number | string, val : string) => {
|
||||
@@ -13,10 +13,10 @@ export const handleAdvertiseDetail = (type : number | string, val : string) => {
|
||||
// #endif
|
||||
} else {
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE || MP
|
||||
if (val == '/pages/home/home' ||
|
||||
val == '/pages/cart/cart' ||
|
||||
val == '/pages/classify/classify' ||
|
||||
val == '/pages/member/member'
|
||||
if (val == RouteSwitchNameEnum.home ||
|
||||
val == RouteSwitchNameEnum.cart ||
|
||||
val == RouteSwitchNameEnum.classify ||
|
||||
val == RouteSwitchNameEnum.member
|
||||
) {
|
||||
uni.reLaunch({ url: val });
|
||||
} else if (val.includes('/pages/subpackage/coupon/coupon?id=')) {
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
"pages-config/subpackage-distribution.json",
|
||||
"pages-config/subpackage-agency.json",
|
||||
"pages-config/subpackage-merchant.json",
|
||||
"pages-config/subpackage-custom.json"
|
||||
"pages-config/subpackage-custom.json",
|
||||
"pages-config/subpackage-webview.json"
|
||||
],
|
||||
|
||||
"preloadRule": "pages-config/preloadRule.json",
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"subPackages": [{
|
||||
"root": "pages/subpackage/webview",
|
||||
"pages": [{
|
||||
"path": "webview",
|
||||
"style": {
|
||||
"navigationBarTitleText": "网页详情",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -795,6 +795,16 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}]
|
||||
},{
|
||||
"root": "pages/subpackage/webview",
|
||||
"pages": [{
|
||||
"path": "webview",
|
||||
"style": {
|
||||
"navigationBarTitleText": "网页详情",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}]
|
||||
}],
|
||||
"preloadRule": {
|
||||
"pages/member/member": {
|
||||
|
||||
@@ -38,7 +38,10 @@
|
||||
if(!shopConfigStore.config.indexPopupWindowHrefUrl){
|
||||
return ;
|
||||
}
|
||||
|
||||
if(shopConfigStore.config.indexPopupWindowHrefUrl.includes('http')){
|
||||
handleRouteNavigateTo(`/pages/subpackage/webview/webview?src=${shopConfigStore.config.indexPopupWindowHrefUrl}`);
|
||||
return ;
|
||||
}
|
||||
if (shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.home ||
|
||||
shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.classify ||
|
||||
shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.cart ||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<web-view :src="src"></web-view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { handleShowToast ,handleRouteSwitchTab} from '@/core/utils';
|
||||
import { RouteSwitchTabEnum } from '@/core/enum';
|
||||
|
||||
interface QueryParams {
|
||||
src : string;
|
||||
}
|
||||
const src = ref('');
|
||||
|
||||
onLoad((query : QueryParams) => {
|
||||
if (!query.src) {
|
||||
handleShowToast('网址获取失败','none',()=>{
|
||||
handleRouteSwitchTab(RouteSwitchTabEnum.home)
|
||||
});
|
||||
return;
|
||||
}
|
||||
src.value = query.src;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
Reference in New Issue
Block a user