|
@@ -29,6 +29,7 @@ const productId = route.query.productId
|
|
|
const isSubscribe=ref(true)
|
|
|
const isFree=ref(true)
|
|
|
const priceNum=ref('')
|
|
|
+const reportCollected = ref(false)
|
|
|
const riskLevelInfo=ref('')
|
|
|
const visible = ref(false);
|
|
|
const subscribeStatus = ref('')//expired --过期 unSubscribe--未订阅 subscribed--订阅中
|
|
@@ -69,6 +70,7 @@ async function getReportInfo() {
|
|
|
reportInfo.value = detail
|
|
|
riskLevelInfo.value = riskLevel
|
|
|
isLogin.value=res.data.login
|
|
|
+ reportCollected.value = res.data.isCollect || false
|
|
|
riskLevelStatus.value=res.data.riskLevelStatus
|
|
|
headImgStyle.value = reportInfo.value.headResource.style ? JSON.parse(reportInfo.value.headResource.style) : []
|
|
|
endImgStyle.value = reportInfo.value.endResource.style ? JSON.parse(reportInfo.value.endResource.style) : []
|
|
@@ -154,6 +156,22 @@ function changeFollowStateList(item) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 点击收藏
|
|
|
+async function handleCollect() {
|
|
|
+ const data = {
|
|
|
+ sourceType: 'report',
|
|
|
+ sourceId: Number(reportId)
|
|
|
+ }
|
|
|
+ const res = reportCollected.value ? await apiReport.reportCollectCancel(data) : await apiReport.reportCollect(data)
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ Message.success(reportCollected.value ? '取消收藏成功' : '收藏成功')
|
|
|
+ reportCollected.value = !reportCollected.value
|
|
|
+ // 通知更新收藏列表
|
|
|
+ wx.miniProgram.postMessage({
|
|
|
+ data: 'refreshCollectList'
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
// 显示免责声明
|
|
|
const isShowMZSM = ref(false)
|
|
@@ -384,6 +402,12 @@ function goDetails(item){
|
|
|
</div>
|
|
|
<!-- 右侧悬浮操作栏 -->
|
|
|
<div class="right-fix-box">
|
|
|
+ <!-- 收藏 -->
|
|
|
+ <svg-icon
|
|
|
+ @click="handleCollect"
|
|
|
+ class="item collect-icon"
|
|
|
+ :name="reportCollected ? 'collected' : 'collect'"
|
|
|
+ />
|
|
|
<!-- 返回顶部 -->
|
|
|
<div class="item back-top-img">
|
|
|
<svg-icon
|
|
@@ -642,6 +666,11 @@ function goDetails(item){
|
|
|
.item {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+ .collect-icon {
|
|
|
+ width: 100px;
|
|
|
+ height: 100px;
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
.back-top-img {
|
|
|
width: 100px;
|
|
|
height: 100px;
|