mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-22 16:17:21 +08:00
uniapp【新增】:增加webview页面,可以跳转到外部网站
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { handleRouteNavigateTo, handleShowToast } from '@/core/utils';
|
import { handleRouteNavigateTo, handleShowToast } from '@/core/utils';
|
||||||
import { NavLinkEnum } from '@/core/enum';
|
import { NavLinkEnum ,RouteSwitchNameEnum} from '@/core/enum';
|
||||||
import { queryReceiveCoupon } from '@/core/api';
|
import { queryReceiveCoupon } from '@/core/api';
|
||||||
|
|
||||||
export const handleAdvertiseDetail = (type : number | string, val : string) => {
|
export const handleAdvertiseDetail = (type : number | string, val : string) => {
|
||||||
@@ -13,10 +13,10 @@ export const handleAdvertiseDetail = (type : number | string, val : string) => {
|
|||||||
// #endif
|
// #endif
|
||||||
} else {
|
} else {
|
||||||
// #ifdef APP-PLUS || APP-PLUS-NVUE || MP
|
// #ifdef APP-PLUS || APP-PLUS-NVUE || MP
|
||||||
if (val == '/pages/home/home' ||
|
if (val == RouteSwitchNameEnum.home ||
|
||||||
val == '/pages/cart/cart' ||
|
val == RouteSwitchNameEnum.cart ||
|
||||||
val == '/pages/classify/classify' ||
|
val == RouteSwitchNameEnum.classify ||
|
||||||
val == '/pages/member/member'
|
val == RouteSwitchNameEnum.member
|
||||||
) {
|
) {
|
||||||
uni.reLaunch({ url: val });
|
uni.reLaunch({ url: val });
|
||||||
} else if (val.includes('/pages/subpackage/coupon/coupon?id=')) {
|
} else if (val.includes('/pages/subpackage/coupon/coupon?id=')) {
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
"pages-config/subpackage-distribution.json",
|
"pages-config/subpackage-distribution.json",
|
||||||
"pages-config/subpackage-agency.json",
|
"pages-config/subpackage-agency.json",
|
||||||
"pages-config/subpackage-merchant.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",
|
"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"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
},{
|
||||||
|
"root": "pages/subpackage/webview",
|
||||||
|
"pages": [{
|
||||||
|
"path": "webview",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "网页详情",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
}]
|
||||||
}],
|
}],
|
||||||
"preloadRule": {
|
"preloadRule": {
|
||||||
"pages/member/member": {
|
"pages/member/member": {
|
||||||
|
|||||||
@@ -38,7 +38,10 @@
|
|||||||
if(!shopConfigStore.config.indexPopupWindowHrefUrl){
|
if(!shopConfigStore.config.indexPopupWindowHrefUrl){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
if(shopConfigStore.config.indexPopupWindowHrefUrl.includes('http')){
|
||||||
|
handleRouteNavigateTo(`/pages/subpackage/webview/webview?src=${shopConfigStore.config.indexPopupWindowHrefUrl}`);
|
||||||
|
return ;
|
||||||
|
}
|
||||||
if (shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.home ||
|
if (shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.home ||
|
||||||
shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.classify ||
|
shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.classify ||
|
||||||
shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.cart ||
|
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