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 }">
|
<view class="name" :class="{ mohu: isMask }">
|
||||||
<text class="text">来源:</text>
|
<text class="text">来源:</text>
|
||||||
<text class="text" v-if="intoType === 'etf'">中国证券报</text>
|
<text class="text" v-if="intoType === 'etf'">中国证券报</text>
|
||||||
<text class="text" v-else>{{
|
<text class="text" v-else>
|
||||||
props.data.tag ? props.data.tag : "中国证券报"
|
{{ props.data.tag ? props.data.tag : "中国证券报" }}
|
||||||
}}</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view class="name" v-if="props.data.editor">
|
<!-- <view class="name" v-if="props.data.editor">
|
||||||
|
|
@ -199,6 +199,10 @@ const props = defineProps({
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
access: {
|
||||||
|
type: String,
|
||||||
|
default: () => "",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const tagList1 = ref([
|
const tagList1 = ref([
|
||||||
{
|
{
|
||||||
|
|
@ -215,7 +219,11 @@ const tagList1 = ref([
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
// 未登录|试用,显示蒙层
|
// 未登录|试用,显示蒙层
|
||||||
const isMask = computed(() => {
|
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) => {
|
const goNewsDetail = (item: any) => {
|
||||||
uni.navigateTo({
|
if (props.access === "h5") {
|
||||||
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
|
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({
|
uni.navigateTo({
|
||||||
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
|
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
<Article
|
<Article
|
||||||
:data="data"
|
:data="data"
|
||||||
:furtherReadData="furtherReadData"
|
:furtherReadData="furtherReadData"
|
||||||
|
:access="access"
|
||||||
@getFurtherReadData="getFurtherReadData"
|
@getFurtherReadData="getFurtherReadData"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
@ -213,7 +214,13 @@ const getFurtherReadData = () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 判断区分入口是h5和其他,h5入口需要判断账号是否【正式|试用】
|
||||||
|
const access = ref("");
|
||||||
|
|
||||||
onLoad(async (option: any) => {
|
onLoad(async (option: any) => {
|
||||||
|
// 判断区分入口是h5和其他,h5入口需要判断账号是否【正式|试用】
|
||||||
|
access.value = option.access || '';
|
||||||
|
|
||||||
news_id.value = option.id;
|
news_id.value = option.id;
|
||||||
aplus_queue.push({
|
aplus_queue.push({
|
||||||
action: "aplus.sendPV",
|
action: "aplus.sendPV",
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ function goDetail(item: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.navigateTo({
|
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({
|
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({
|
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) {
|
function goDetail(item: any) {
|
||||||
if (userStore.isLogin) {
|
if (userStore.isLogin) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/detail/indexNewsInfo?id=${item.id}`,
|
url: `/pages/detail/indexNewsInfo?id=${item.id}&access=h5`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
emit("onShow");
|
emit("onShow");
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ function goDetail(item: any) {
|
||||||
}
|
}
|
||||||
if (!item.id) return;
|
if (!item.id) return;
|
||||||
uni.navigateTo({
|
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;
|
if (!item.id) return;
|
||||||
uni.navigateTo({
|
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 FooterView from "./components/FooterView/index.vue";
|
||||||
import LoginDialog from "@/pages/realtimeInfo/components/LoginPopup/index.vue";
|
import LoginDialog from "@/pages/realtimeInfo/components/LoginPopup/index.vue";
|
||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
|
import { Session } from "@/utils/storage";
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
|
|
||||||
// 登录弹框
|
// 登录弹框
|
||||||
const LoginShow = ref(false);
|
const LoginShow = ref(false);
|
||||||
|
|
||||||
|
|
@ -76,6 +78,12 @@ const handleLoginError = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
console.log('output >>>>> Session.get("userInfos")',Session.get("userInfos"));
|
||||||
|
|
||||||
|
if(!Session.get("userInfos")) {
|
||||||
|
Session.clear()
|
||||||
|
}
|
||||||
|
|
||||||
if (!userStore.isLogin) {
|
if (!userStore.isLogin) {
|
||||||
handleShowLogin();
|
handleShowLogin();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,19 +92,20 @@
|
||||||
v-show="selectKeys.includes(news.id)"
|
v-show="selectKeys.includes(news.id)"
|
||||||
:class="['events-list', { mask: isMask }]"
|
:class="['events-list', { mask: isMask }]"
|
||||||
>
|
>
|
||||||
<view
|
<template
|
||||||
class="events-item"
|
v-for="(further, index) in news.furtherReadings"
|
||||||
v-for="further in news.furtherReadings"
|
|
||||||
:key="further.id"
|
:key="further.id"
|
||||||
>
|
>
|
||||||
<view class="events-item-line"></view>
|
<view class="events-item" v-if="index < 3">
|
||||||
<view class="events-item-content">
|
<view class="events-item-line"></view>
|
||||||
<view class="events-content-date">{{ further.timeStr }}</view>
|
<view class="events-item-content">
|
||||||
<view class="events-content-text">
|
<view class="events-content-date">{{ further.timeStr }}</view>
|
||||||
{{ further.title }}
|
<view class="events-content-text">
|
||||||
|
{{ further.title }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -198,7 +199,7 @@ function goDetail(item: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.navigateTo({
|
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,
|
keyword: keyword.value,
|
||||||
page: pages.page,
|
page: pages.page,
|
||||||
size: pages.size,
|
size: pages.size,
|
||||||
|
start: 3,
|
||||||
});
|
});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ async function getNewsList() {
|
||||||
function goDetail(item: any) {
|
function goDetail(item: any) {
|
||||||
if (userStore.isLogin) {
|
if (userStore.isLogin) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/detail/indexNewsInfo?id=${item.news_id}`,
|
url: `/pages/detail/indexNewsInfo?id=${item.news_id}&access=h5`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
handleShowLogin();
|
handleShowLogin();
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,10 @@ const storeSetup = () => {
|
||||||
// 试用 | 正式
|
// 试用 | 正式
|
||||||
const isUserType = computed(() => {
|
const isUserType = computed(() => {
|
||||||
// 0:测试 ,1:正式 判断账号类型
|
// 0:测试 ,1:正式 判断账号类型
|
||||||
// return getUserInfos().accountType === 1 ? true : false;
|
return getUserInfos()?.accountType === 1 ? true : false;
|
||||||
|
|
||||||
// 为了兼容之前的版本,暂时不区分账号类型,先放开正式账号和测试账号的限制
|
// 为了兼容之前的版本,暂时不区分账号类型,先放开正式账号和测试账号的限制
|
||||||
return true;
|
// return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 登录
|
// 登录
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue