mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:03:27 +08:00
uniapp【修复】:首页弹框广告点击跳转
This commit is contained in:
@@ -73,3 +73,15 @@ export enum RouteSwitchTabEnum {
|
||||
/** 个人中心 */
|
||||
member = 'member',
|
||||
}
|
||||
|
||||
/** 底部导航栏页面路由 */
|
||||
export enum RouteSwitchNameEnum {
|
||||
/** 首页 */
|
||||
home = '/pages/home/home',
|
||||
/** 商品分类 */
|
||||
classify = '/pages/classify/classify',
|
||||
/** 购物车 */
|
||||
cart = '/pages/cart/cart',
|
||||
/** 个人中心 */
|
||||
member = '/pages/member/member',
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<view class="adpop-box" v-if="state.show">
|
||||
<view class="img-box">
|
||||
<image class="img" :src="shopConfigStore.config.indexPopupWindowImageUrl" mode="widthFix"></image>
|
||||
<image class="img" @click="handleJumpPopupUrl" :src="shopConfigStore.config.indexPopupWindowImageUrl"
|
||||
mode="widthFix"></image>
|
||||
<view class="btn" @click="hanldeCloseAdpop">
|
||||
<image class="icon" :src="handleStaticResources('/static/images/icon/icon-close.png')"></image>
|
||||
</view>
|
||||
@@ -12,9 +13,8 @@
|
||||
import { reactive, onMounted } from 'vue';
|
||||
import type { ShopConfigStoreType } from '@/core/models';
|
||||
import { useShopConfigStore } from '@/core/store';
|
||||
import { ShowPopupWindowEnum } from '@/core/enum';
|
||||
import { handleStaticResources } from '@/core/utils';
|
||||
|
||||
import { ShowPopupWindowEnum, RouteSwitchNameEnum } from '@/core/enum';
|
||||
import { handleStaticResources, handleRouteNavigateTo } from '@/core/utils';
|
||||
// 获取项目配置
|
||||
const shopConfigStore : ShopConfigStoreType = useShopConfigStore();
|
||||
|
||||
@@ -33,6 +33,22 @@
|
||||
state.show = true;
|
||||
}
|
||||
})
|
||||
|
||||
const handleJumpPopupUrl = () => {
|
||||
if(!shopConfigStore.config.indexPopupWindowHrefUrl){
|
||||
return ;
|
||||
}
|
||||
|
||||
if (shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.home ||
|
||||
shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.classify ||
|
||||
shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.cart ||
|
||||
shopConfigStore.config.indexPopupWindowHrefUrl === RouteSwitchNameEnum.member) {
|
||||
uni.switchTab({ url: shopConfigStore.config.indexPopupWindowHrefUrl });
|
||||
return;
|
||||
}
|
||||
|
||||
handleRouteNavigateTo(shopConfigStore.config.indexPopupWindowHrefUrl)
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './home-adpop.scss';
|
||||
|
||||
Reference in New Issue
Block a user