2025-08-10 16:44:02 +08:00
|
|
|
<template>
|
|
|
|
|
<view class="main">
|
|
|
|
|
<view class="title">{{ props.data.title }}</view>
|
|
|
|
|
<view class="author">
|
|
|
|
|
<view class="name">
|
|
|
|
|
<text class="text">来源:</text>
|
|
|
|
|
<text class="text">{{ props.data.tag }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="name" v-if="props.data.editor">
|
|
|
|
|
<text class="text">编辑:</text>
|
|
|
|
|
<text class="text">{{ props.data.editor }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="time">{{ props.data.publishTime }}</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 摘要 -->
|
|
|
|
|
<view class="desc" v-if="props.data.summary">
|
|
|
|
|
<view class="bill_icon"></view>
|
|
|
|
|
{{ props.data.summary }}
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="thumbnail" v-if="props.data.picture">
|
|
|
|
|
<image :src="props.data.picture" mode="widthFix" />
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-08-17 17:09:04 +08:00
|
|
|
<view
|
|
|
|
|
class="articleDes"
|
|
|
|
|
:class="props?.data?.needpay && 'needpay'"
|
|
|
|
|
v-html="props.data.content"
|
|
|
|
|
>
|
2025-08-10 16:44:02 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
import {
|
|
|
|
|
onLaunch,
|
|
|
|
|
onShow,
|
|
|
|
|
onLoad,
|
|
|
|
|
onShareAppMessage,
|
|
|
|
|
onShareTimeline,
|
|
|
|
|
} from "@dcloudio/uni-app";
|
2025-08-17 17:09:04 +08:00
|
|
|
// import articleMock from "@/mock/article.js";
|
2025-08-10 16:44:02 +08:00
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
data: {
|
|
|
|
|
type: Object,
|
2025-08-17 17:09:04 +08:00
|
|
|
default: () => {},
|
2025-08-10 16:44:02 +08:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
console.log("props.data ===>", props.data);
|
|
|
|
|
|
|
|
|
|
const show = ref(false);
|
|
|
|
|
const type = ref("");
|
|
|
|
|
const handleClick = (value: any) => {
|
|
|
|
|
show.value = value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onLoad((option) => {
|
|
|
|
|
type.value = option?.type || "list";
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const handleSub = () => {
|
|
|
|
|
if (type.value === "list") {
|
|
|
|
|
let mainItemId = uni.getStorageSync("mainItem");
|
|
|
|
|
let arr = uni.getStorageSync("list");
|
|
|
|
|
let subArr = arr.filter((item) => {
|
|
|
|
|
if (item.id == mainItemId.id) {
|
|
|
|
|
item.needpay = false;
|
|
|
|
|
}
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
uni.setStorageSync("list", subArr);
|
|
|
|
|
} else if (type.value === "vipList") {
|
|
|
|
|
let mainItemId = uni.getStorageSync("vipItem");
|
|
|
|
|
// console.log("mainItemId", mainItemId)
|
|
|
|
|
let arr = uni.getStorageSync("vipList");
|
|
|
|
|
let subArr = arr.filter((item) => {
|
|
|
|
|
if (item.id == mainItemId.id) {
|
|
|
|
|
item.needpay = false;
|
|
|
|
|
}
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
uni.setStorageSync("vipList", subArr);
|
|
|
|
|
} else if (type.value === "newsList") {
|
|
|
|
|
let mainItemId = uni.getStorageSync("newsItem");
|
|
|
|
|
let arr = uni.getStorageSync("newsList");
|
|
|
|
|
let subArr = arr.filter((item) => {
|
|
|
|
|
if (item.id == mainItemId.id) {
|
|
|
|
|
item.needpay = false;
|
|
|
|
|
}
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
uni.setStorageSync("newsList", subArr);
|
|
|
|
|
} else if (type.value === "handpickList") {
|
|
|
|
|
let mainItemId = uni.getStorageSync("handpickItem");
|
|
|
|
|
let arr = uni.getStorageSync("handpickList");
|
|
|
|
|
let subArr = arr.filter((item) => {
|
|
|
|
|
if (item.id == mainItemId.id) {
|
|
|
|
|
item.needpay = true;
|
|
|
|
|
}
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
uni.setStorageSync("handpickList", subArr);
|
|
|
|
|
}
|
|
|
|
|
props.data.needpay = false;
|
|
|
|
|
|
|
|
|
|
show.value = false;
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.main {
|
|
|
|
|
position: relative;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
padding-top: 16rpx;
|
|
|
|
|
padding: 0 40rpx;
|
|
|
|
|
// font-size: 40rpx;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
color: #333;
|
|
|
|
|
// font-weight: 700;
|
2025-08-13 12:18:25 +08:00
|
|
|
white-space: normal;
|
|
|
|
|
/* 允许换行 */
|
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
/* 在必要时单词内部断行 */
|
2025-08-10 16:44:02 +08:00
|
|
|
font-family: "SourceHanSansCN-Medium";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.author {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-top: 16rpx;
|
|
|
|
|
padding: 0 40rpx;
|
|
|
|
|
|
|
|
|
|
.text {
|
|
|
|
|
// font-size: 26rpx;
|
|
|
|
|
font-size: var(--h3-font-size);
|
|
|
|
|
color: rgba(51, 51, 51, 0.6);
|
|
|
|
|
margin-right: 12rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.time {
|
|
|
|
|
// font-size: 26rpx;
|
|
|
|
|
font-size: var(--h3-font-size);
|
|
|
|
|
color: rgba(51, 51, 51, 0.6);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-13 12:18:25 +08:00
|
|
|
|
2025-08-10 16:44:02 +08:00
|
|
|
// 摘要
|
|
|
|
|
.desc {
|
|
|
|
|
padding: 12rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
width: 700rpx;
|
|
|
|
|
margin: 30rpx auto;
|
|
|
|
|
color: rgba(51, 51, 51, 0.6);
|
|
|
|
|
// font-size: 28rpx;
|
|
|
|
|
font-size: var(--h2-font-size);
|
|
|
|
|
text-indent: 0.5em;
|
|
|
|
|
white-space: pre-wrap;
|
2025-08-13 12:18:25 +08:00
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
|
|
|
|
|
/* 在必要时单词内部断行 */
|
2025-08-10 16:44:02 +08:00
|
|
|
.bill_icon {
|
|
|
|
|
width: 28rpx;
|
|
|
|
|
height: 28rpx;
|
|
|
|
|
float: left;
|
|
|
|
|
margin-right: 12rpx;
|
|
|
|
|
margin-top: 6rpx;
|
|
|
|
|
background-size: contain;
|
2025-08-13 12:18:25 +08:00
|
|
|
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/static/icon_act_lt.png);
|
2025-08-10 16:44:02 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.thumbnail {
|
|
|
|
|
margin-top: 60rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.articleDes {
|
|
|
|
|
padding: 0 30rpx 30rpx 30rpx;
|
|
|
|
|
box-sizing: border-box;
|
2025-08-13 12:18:25 +08:00
|
|
|
|
2025-08-10 16:44:02 +08:00
|
|
|
::v-deep {
|
|
|
|
|
p {
|
|
|
|
|
margin: 30rpx 0;
|
|
|
|
|
// font-size: 28rpx;
|
|
|
|
|
font-size: var(--h2-font-size);
|
|
|
|
|
color: #333;
|
|
|
|
|
text-indent: 2em;
|
|
|
|
|
line-height: 48rpx;
|
2025-08-13 12:18:25 +08:00
|
|
|
white-space: normal;
|
|
|
|
|
/* 允许换行 */
|
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
/* 在必要时单词内部断行 */
|
2025-08-10 16:44:02 +08:00
|
|
|
}
|
2025-08-13 12:18:25 +08:00
|
|
|
|
2025-08-10 16:44:02 +08:00
|
|
|
img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin-left: -2em;
|
|
|
|
|
// margin: 0 auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-13 12:18:25 +08:00
|
|
|
|
2025-08-10 16:44:02 +08:00
|
|
|
&.needpay {
|
|
|
|
|
height: 730rpx;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|