Merge branch 'dev' into 'master'

uniapp【新增】:增加webview页面,可以跳转到外部网站

See merge request jianweie/coreshoppro!111
This commit is contained in:
花城
2024-12-25 06:16:09 +00:00
6 changed files with 62 additions and 7 deletions

View File

@@ -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=')) {

View File

@@ -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",

View File

@@ -0,0 +1,13 @@
{
"subPackages": [{
"root": "pages/subpackage/webview",
"pages": [{
"path": "webview",
"style": {
"navigationBarTitleText": "网页详情",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
}]
}

View File

@@ -795,6 +795,16 @@
"navigationStyle": "custom"
}
}]
},{
"root": "pages/subpackage/webview",
"pages": [{
"path": "webview",
"style": {
"navigationBarTitleText": "网页详情",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
}],
"preloadRule": {
"pages/member/member": {

View File

@@ -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 ||

View File

@@ -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>