feat(article): 添加access参数支持H5入口判断

添加access属性用于区分H5和其他入口,H5入口需要判断账号是否为正式或试用类型
This commit is contained in:
傅光孟 2026-02-25 17:36:53 +08:00
parent ee1c73babe
commit 627d0b006a
13 changed files with 58 additions and 27 deletions

View File

@ -6,9 +6,9 @@
<view class="name" :class="{ mohu: isMask }">
<text class="text">来源:</text>
<text class="text" v-if="intoType === 'etf'">中国证券报</text>
<text class="text" v-else>{{
props.data.tag ? props.data.tag : "中国证券报"
}}</text>
<text class="text" v-else>
{{ props.data.tag ? props.data.tag : "中国证券报" }}
</text>
</view>
<!-- <view class="name" v-if="props.data.editor">
@ -199,6 +199,10 @@ const props = defineProps({
type: Array,
default: () => [],
},
access: {
type: String,
default: () => "",
},
});
const tagList1 = ref([
{
@ -215,7 +219,11 @@ const tagList1 = ref([
const userStore = useUserStore();
// |
const isMask = computed(() => {
return !userStore.isLogin || !userStore.isUserType;
return !userStore.isLogin || !isUserType.value;
});
// h5h5|
const isUserType = computed(() => {
return props.access === "h5" ? userStore.isUserType : true;
});
//
@ -324,9 +332,15 @@ const handleSub = () => {
//
const goNewsDetail = (item: any) => {
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
});
if (props.access === "h5") {
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
});
} else {
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
});
}
};
//

View File

@ -120,7 +120,7 @@ function goDetail(item: any) {
}
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
});
}

View File

@ -14,6 +14,7 @@
<Article
:data="data"
:furtherReadData="furtherReadData"
:access="access"
@getFurtherReadData="getFurtherReadData"
/>
@ -213,7 +214,13 @@ const getFurtherReadData = () => {
});
};
// h5h5|
const access = ref("");
onLoad(async (option: any) => {
// h5h5|
access.value = option.access || '';
news_id.value = option.id;
aplus_queue.push({
action: "aplus.sendPV",

View File

@ -148,7 +148,7 @@ function goDetail(item: any) {
}
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
});
}

View File

@ -120,7 +120,7 @@ function goDetail(item: any) {
}
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
});
}

View File

@ -112,7 +112,7 @@ function goDetail(item: any) {
}
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
});
}

View File

@ -51,7 +51,7 @@ const userStore = useUserStore();
function goDetail(item: any) {
if (userStore.isLogin) {
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
});
} else {
emit("onShow");

View File

@ -70,7 +70,7 @@ function goDetail(item: any) {
}
if (!item.id) return;
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
});
}

View File

@ -75,7 +75,7 @@ function goDetail(item: any) {
}
if (!item.id) return;
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
});
}

View File

@ -51,9 +51,11 @@ import TodayNewsView from "./components/TodayNewsView/index.vue";
import FooterView from "./components/FooterView/index.vue";
import LoginDialog from "@/pages/realtimeInfo/components/LoginPopup/index.vue";
import { useUserStore } from "@/stores/user";
import { Session } from "@/utils/storage";
const userStore = useUserStore();
//
const LoginShow = ref(false);
@ -76,6 +78,12 @@ const handleLoginError = () => {
};
onMounted(async () => {
console.log('output >>>>> Session.get("userInfos")',Session.get("userInfos"));
if(!Session.get("userInfos")) {
Session.clear()
}
if (!userStore.isLogin) {
handleShowLogin();
}

View File

@ -92,19 +92,20 @@
v-show="selectKeys.includes(news.id)"
:class="['events-list', { mask: isMask }]"
>
<view
class="events-item"
v-for="further in news.furtherReadings"
<template
v-for="(further, index) in news.furtherReadings"
:key="further.id"
>
<view class="events-item-line"></view>
<view class="events-item-content">
<view class="events-content-date">{{ further.timeStr }}</view>
<view class="events-content-text">
{{ further.title }}
<view class="events-item" v-if="index < 3">
<view class="events-item-line"></view>
<view class="events-item-content">
<view class="events-content-date">{{ further.timeStr }}</view>
<view class="events-content-text">
{{ further.title }}
</view>
</view>
</view>
</view>
</template>
</view>
</view>
</view>
@ -198,7 +199,7 @@ function goDetail(item: any) {
}
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
});
}
@ -217,6 +218,7 @@ const getList = async () => {
keyword: keyword.value,
page: pages.page,
size: pages.size,
start: 3,
});
loading.value = false;
if (result.code === 200) {

View File

@ -250,7 +250,7 @@ async function getNewsList() {
function goDetail(item: any) {
if (userStore.isLogin) {
uni.navigateTo({
url: `/pages/detail/indexNewsInfo?id=${item.news_id}`,
url: `/pages/detail/indexNewsInfo?id=${item.news_id}&access=h5`,
});
} else {
handleShowLogin();

View File

@ -53,10 +53,10 @@ const storeSetup = () => {
// 试用 | 正式
const isUserType = computed(() => {
// 0:测试 1:正式 判断账号类型
// return getUserInfos().accountType === 1 ? true : false;
return getUserInfos()?.accountType === 1 ? true : false;
// 为了兼容之前的版本,暂时不区分账号类型,先放开正式账号和测试账号的限制
return true;
// return true;
});
// 登录