feat(article): 添加access参数支持H5入口判断
添加access属性用于区分H5和其他入口,H5入口需要判断账号是否为正式或试用类型
This commit is contained in:
parent
ee1c73babe
commit
627d0b006a
|
|
@ -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;
|
||||
});
|
||||
// 判断入口是h5还是其他,h5入口需要判断账号是试用|正式
|
||||
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}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 拓展阅读更多
|
||||
|
|
|
|||
|
|
@ -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`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<Article
|
||||
:data="data"
|
||||
:furtherReadData="furtherReadData"
|
||||
:access="access"
|
||||
@getFurtherReadData="getFurtherReadData"
|
||||
/>
|
||||
|
||||
|
|
@ -213,7 +214,13 @@ const getFurtherReadData = () => {
|
|||
});
|
||||
};
|
||||
|
||||
// 判断区分入口是h5和其他,h5入口需要判断账号是否【正式|试用】
|
||||
const access = ref("");
|
||||
|
||||
onLoad(async (option: any) => {
|
||||
// 判断区分入口是h5和其他,h5入口需要判断账号是否【正式|试用】
|
||||
access.value = option.access || '';
|
||||
|
||||
news_id.value = option.id;
|
||||
aplus_queue.push({
|
||||
action: "aplus.sendPV",
|
||||
|
|
|
|||
|
|
@ -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`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
});
|
||||
|
||||
// 登录
|
||||
|
|
|
|||
Loading…
Reference in New Issue