réplica de
https://github.com/ialley-workshop-open/uni-halo.git
sincronizado 2026-06-12 13:19:31 +08:00
新增:文章详情原文链接、访问密码功能
Este cometimento está contido em:
@@ -153,3 +153,22 @@
|
|||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 文本省略样式 开始 */
|
||||||
|
.text-sub-one {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 多行文本省略 */
|
||||||
|
@for $i from 2 through 30 {
|
||||||
|
.text-sub-more-#{$i} {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: $i;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 文本省略样式 结束 */
|
||||||
|
|||||||
@@ -3,22 +3,14 @@
|
|||||||
<view v-if="loadStatus == 'loading'" class="img-loading" :style="[imgStyle, loadStyle]">
|
<view v-if="loadStatus == 'loading'" class="img-loading" :style="[imgStyle, loadStyle]">
|
||||||
<!-- <text class="img-load-icon iconfont icon-loading"></text>
|
<!-- <text class="img-load-icon iconfont icon-loading"></text>
|
||||||
<text class="img-load-text">{{ loadText }}</text> -->
|
<text class="img-load-text">{{ loadText }}</text> -->
|
||||||
<image :src="loadingImgSrc" :style="[imgStyle]" mode="aspectFit"></image>
|
<image :src="loadingImgSrc" :style="[loadingImgStyle]" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="loadStatus == 'error'" class="img-error" :style="[imgStyle, loadErrStyle]">
|
<view v-if="loadStatus == 'error'" class="img-error" :style="[imgStyle, loadErrStyle]">
|
||||||
<text class="img-err-icon iconfont icon-exclamation-circle"></text>
|
<!-- <text class="img-err-icon iconfont icon-exclamation-circle"></text>
|
||||||
<text class="img-load-text">{{ loadErrText }}</text>
|
<text class="img-load-text">{{ loadErrText }}</text> -->
|
||||||
|
<image class="img-error-img" :src="loadingErrorImageSrc" mode="scaleToFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image v-show="loadStatus == 'success'" :src="src" @load="fnOnLoad" @error="fnOnError" :lazy-load="lazyLoad" :style="[imgStyle]" :mode="mode" @click="$emit('on-click', url)"></image>
|
||||||
v-show="loadStatus == 'success'"
|
|
||||||
:src="src"
|
|
||||||
@load="fnOnLoad"
|
|
||||||
@error="fnOnError"
|
|
||||||
:lazy-load="lazyLoad"
|
|
||||||
:style="[imgStyle]"
|
|
||||||
:mode="mode"
|
|
||||||
@click="$emit('on-click', url)"
|
|
||||||
></image>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -91,6 +83,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
imgStyle: {},
|
imgStyle: {},
|
||||||
|
loadingImgStyle: {
|
||||||
|
width: '120rpx',
|
||||||
|
},
|
||||||
src: '', // 图片地址
|
src: '', // 图片地址
|
||||||
loadStatus: 'loading'
|
loadStatus: 'loading'
|
||||||
};
|
};
|
||||||
@@ -98,6 +93,9 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
loadingImgSrc() {
|
loadingImgSrc() {
|
||||||
return getApp().globalData.loadingGifUrl;
|
return getApp().globalData.loadingGifUrl;
|
||||||
|
},
|
||||||
|
loadingErrorImageSrc() {
|
||||||
|
return getApp().globalData.loadingErrUrl
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -137,7 +135,7 @@ export default {
|
|||||||
fnOnLoad() {
|
fnOnLoad() {
|
||||||
this.loadStatus = 'success';
|
this.loadStatus = 'success';
|
||||||
},
|
},
|
||||||
fnOnError() {
|
fnOnError(e) {
|
||||||
this.loadStatus = 'error';
|
this.loadStatus = 'error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,6 +147,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img-loading,
|
.img-loading,
|
||||||
.img-error {
|
.img-error {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -158,21 +157,31 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #f2f2f2;
|
background-color: #f2f2f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img-load-icon {
|
.img-load-icon {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
animation: xhRote 0.8s infinite linear;
|
animation: xhRote 0.8s infinite linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img-load-text {
|
.img-load-text {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img-error {
|
.img-error {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
&-img {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 12rpx;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.img-err-icon {
|
.img-err-icon {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes xhRote {
|
@keyframes xhRote {
|
||||||
0% {
|
0% {
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
|
|||||||
+1
-1
@@ -550,7 +550,7 @@
|
|||||||
},
|
},
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"backgroundColor": "#fff",
|
"backgroundColor": "#fff",
|
||||||
"borderStyle": "#fff",
|
"borderStyle": "white",
|
||||||
"color": "#303133",
|
"color": "#303133",
|
||||||
"selectedColor": "#03a9f4",
|
"selectedColor": "#03a9f4",
|
||||||
"list": [{
|
"list": [{
|
||||||
|
|||||||
@@ -46,12 +46,7 @@
|
|||||||
<text class="text-weight-b">分类:</text>
|
<text class="text-weight-b">分类:</text>
|
||||||
<text v-if="result.categories.length == 0" class="category-tag is-empty">未选择分类</text>
|
<text v-if="result.categories.length == 0" class="category-tag is-empty">未选择分类</text>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<text
|
<text class="category-tag" v-for="(item, index) in result.categories" :key="index" @click="fnToCate(item)">
|
||||||
class="category-tag"
|
|
||||||
v-for="(item, index) in result.categories"
|
|
||||||
:key="index"
|
|
||||||
@click="fnToCate(item)"
|
|
||||||
>
|
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</text>
|
</text>
|
||||||
</block>
|
</block>
|
||||||
@@ -60,23 +55,21 @@
|
|||||||
<text class="text-weight-b">标签:</text>
|
<text class="text-weight-b">标签:</text>
|
||||||
<text v-if="result.tags.length == 0" class="category-tag is-empty">未选择标签</text>
|
<text v-if="result.tags.length == 0" class="category-tag is-empty">未选择标签</text>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<text
|
<text class="category-tag" :style="{ backgroundColor: item.color }" v-for="(item, index) in result.tags" :key="index" @click="fnToTag(item)">
|
||||||
class="category-tag"
|
|
||||||
:style="{ backgroundColor: item.color }"
|
|
||||||
v-for="(item, index) in result.tags"
|
|
||||||
:key="index"
|
|
||||||
@click="fnToTag(item)"
|
|
||||||
>
|
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</text>
|
</text>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="originalURL" class="mt-18 category-type original-url">
|
||||||
|
<view class="original-url_left text-weight-b">原文:</view>
|
||||||
|
<view class="original-url_right text-grey">
|
||||||
|
<text class="original-url_right__link" @click.stop="fnToOriginal(originalURL)">{{ originalURL }}</text>
|
||||||
|
<text class="original-url_right__btn" @click.stop="fnToOriginal(originalURL)">阅读原文<text class="iconfont icon-angle-right ml-5 text-size-s"></text> </text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 广告区域 -->
|
<!-- 广告区域 -->
|
||||||
<view
|
<view v-if="haloAdConfig.articleDetail.use && (haloAdConfig.unitId || haloAdConfig.adpid)" class="ad-wrap ma-24 mb-0">
|
||||||
v-if="haloAdConfig.articleDetail.use && (haloAdConfig.unitId || haloAdConfig.adpid)"
|
|
||||||
class="ad-wrap ma-24 mb-0"
|
|
||||||
>
|
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<ad v-if="haloAdConfig.unitId" :unit-id="haloAdConfig.unitId"></ad>
|
<ad v-if="haloAdConfig.unitId" :unit-id="haloAdConfig.unitId"></ad>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
@@ -87,27 +80,19 @@
|
|||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<view class="content ml-24 mr-24">
|
<view class="content ml-24 mr-24">
|
||||||
<!-- markdown渲染 -->
|
<!-- markdown渲染 -->
|
||||||
<mp-html
|
<view class="markdown-wrap">
|
||||||
class="evan-markdown"
|
<tm-more :disabled="true" :maxHeight="1500" :isRemovBar="true" :open="showValidVisitMore" @click="fnOnShowValidVisitMore">
|
||||||
lazy-load
|
<mp-html class="evan-markdown" lazy-load :domain="markdownConfig.domain" :loading-img="markdownConfig.loadingGif" :scroll-table="true" :selectable="true" :tag-style="markdownConfig.tagStyle" :container-style="markdownConfig.containStyle" :content="result.content || result.formatContent" :markdown="true" :showLineNumber="true" :showLanguageName="true" :copyByLongPress="true" />
|
||||||
:domain="markdownConfig.domain"
|
<template v-slot:more="{ data }">
|
||||||
:loading-img="markdownConfig.loadingGif"
|
<view class="">
|
||||||
:scroll-table="true"
|
<text class="text-blue text-size-m text-weight-b">文章部分内容已加密点击解锁</text>
|
||||||
:selectable="true"
|
<text class="text-blue iconfont icon-lock-fill text-size-s ml-5"></text>
|
||||||
:tag-style="markdownConfig.tagStyle"
|
</view>
|
||||||
:container-style="markdownConfig.containStyle"
|
</template>
|
||||||
:content="result.content || result.formatContent"
|
</tm-more>
|
||||||
:markdown="true"
|
</view>
|
||||||
:showLineNumber="true"
|
|
||||||
:showLanguageName="true"
|
|
||||||
:copyByLongPress="true"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 广告区域:微信/decloud申请 -->
|
<!-- 广告区域:微信/decloud申请 -->
|
||||||
<view
|
<view v-if="haloAdConfig.articleDetail.use && (haloAdConfig.unitId || haloAdConfig.adpid)" class="ad-wrap mt-24 mb-24 ">
|
||||||
v-if="haloAdConfig.articleDetail.use && (haloAdConfig.unitId || haloAdConfig.adpid)"
|
|
||||||
class="ad-wrap mt-24 mb-24 "
|
|
||||||
>
|
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<ad v-if="haloAdConfig.unitId" :unit-id="haloAdConfig.unitId"></ad>
|
<ad v-if="haloAdConfig.unitId" :unit-id="haloAdConfig.unitId"></ad>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
@@ -117,21 +102,13 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 广告区域:自定义广告位 -->
|
<!-- 广告区域:自定义广告位 -->
|
||||||
<view class="ad-card" v-if="haloAdConfig.articleDetail.custom.use">
|
<view class="ad-card mt-24" v-if="haloAdConfig.articleDetail.custom.use">
|
||||||
<text class="ad-card_tip">广告</text>
|
<text class="ad-card_tip">广告</text>
|
||||||
<image
|
<image class="ad-card_cover" :src="haloAdConfig.articleDetail.custom.cover" mode="scaleToFill"></image>
|
||||||
class="ad-card_cover"
|
|
||||||
:src="haloAdConfig.articleDetail.custom.cover"
|
|
||||||
mode="scaleToFill"
|
|
||||||
></image>
|
|
||||||
<view class="ad-card_info">
|
<view class="ad-card_info">
|
||||||
<view class="ad-card_info-title">{{ haloAdConfig.articleDetail.custom.title }}</view>
|
<view class="ad-card_info-title">{{ haloAdConfig.articleDetail.custom.title }}</view>
|
||||||
<view class="ad-card_info-desc">{{ haloAdConfig.articleDetail.custom.content }}</view>
|
<view class="ad-card_info-desc">{{ haloAdConfig.articleDetail.custom.content }}</view>
|
||||||
<view
|
<view v-if="haloAdConfig.articleDetail.custom.url" class="ad-card_info-link" @click="fnToWebview(haloAdConfig.articleDetail.custom)">
|
||||||
v-if="haloAdConfig.articleDetail.custom.url"
|
|
||||||
class="ad-card_info-link"
|
|
||||||
@click="fnToWebview(haloAdConfig.articleDetail.custom)"
|
|
||||||
>
|
|
||||||
立即查看
|
立即查看
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -140,9 +117,7 @@
|
|||||||
<!-- 版权声明 -->
|
<!-- 版权声明 -->
|
||||||
<view v-if="copyright.use" class="copyright-wrap bg-white mt-24 pa-24 round-4">
|
<view v-if="copyright.use" class="copyright-wrap bg-white mt-24 pa-24 round-4">
|
||||||
<view class="copyright-title text-weight-b">版权声明</view>
|
<view class="copyright-title text-weight-b">版权声明</view>
|
||||||
<view
|
<view class="copyright-content mt-12 grey-lighten-5 text-grey-darken-2 round-4 pt-12 pb-12 pl-24 pr-24 ">
|
||||||
class="copyright-content mt-12 grey-lighten-5 text-grey-darken-2 round-4 pt-12 pb-12 pl-24 pr-24 "
|
|
||||||
>
|
|
||||||
<view v-if="copyright.author" class="copyright-text text-size-s ">
|
<view v-if="copyright.author" class="copyright-text text-size-s ">
|
||||||
版权归属:{{ copyright.author }}
|
版权归属:{{ copyright.author }}
|
||||||
</view>
|
</view>
|
||||||
@@ -157,32 +132,15 @@
|
|||||||
|
|
||||||
<!-- 评论展示区域 -->
|
<!-- 评论展示区域 -->
|
||||||
<view class="comment-wrap bg-white mt-24 pa-24 round-4">
|
<view class="comment-wrap bg-white mt-24 pa-24 round-4">
|
||||||
<commentList
|
<commentList :disallowComment="result.disallowComment" :postId="result.id" :post="result" @on-comment-detail="fnOnShowCommentDetail" @on-loaded="fnOnCommentLoaded"></commentList>
|
||||||
:disallowComment="result.disallowComment"
|
|
||||||
:postId="result.id"
|
|
||||||
:post="result"
|
|
||||||
@on-comment-detail="fnOnShowCommentDetail"
|
|
||||||
@on-loaded="fnOnCommentLoaded"
|
|
||||||
></commentList>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 弹幕效果 -->
|
<!-- 弹幕效果 -->
|
||||||
<barrage ref="barrage" :maxTop="240" :type="globalAppSettings.barrage.type"></barrage>
|
<barrage ref="barrage" :maxTop="240" :type="globalAppSettings.barrage.type"></barrage>
|
||||||
<!-- 返回顶部 -->
|
<!-- 返回顶部 -->
|
||||||
<tm-flotbutton
|
<tm-flotbutton :offset="[16, 80]" icon="icon-angle-up" color="bg-gradient-light-blue-accent" @click="fnToTopPage()"></tm-flotbutton>
|
||||||
:offset="[16, 80]"
|
<tm-flotbutton :actions="btnOption.actions" actions-pos="left" :show-text="true" color="bg-gradient-orange-accent" @change="fnOnFlotButtonChange"></tm-flotbutton>
|
||||||
icon="icon-angle-up"
|
|
||||||
color="bg-gradient-light-blue-accent"
|
|
||||||
@click="fnToTopPage()"
|
|
||||||
></tm-flotbutton>
|
|
||||||
<tm-flotbutton
|
|
||||||
:actions="btnOption.actions"
|
|
||||||
actions-pos="left"
|
|
||||||
:show-text="true"
|
|
||||||
color="bg-gradient-orange-accent"
|
|
||||||
@change="fnOnFlotButtonChange"
|
|
||||||
></tm-flotbutton>
|
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<!-- 评论详情 -->
|
<!-- 评论详情 -->
|
||||||
@@ -190,13 +148,7 @@
|
|||||||
<view class="pa-24">
|
<view class="pa-24">
|
||||||
<view class="poup-head pb-24">
|
<view class="poup-head pb-24">
|
||||||
<view class="poup-title text-align-center text-size-g text-weight-b mb-32">评论详情</view>
|
<view class="poup-title text-align-center text-size-g text-weight-b mb-32">评论详情</view>
|
||||||
<comment-item
|
<comment-item :useContentBg="false" :useActions="false" :isChild="false" :comment="commentDetail.comment" :postId="result.id"></comment-item>
|
||||||
:useContentBg="false"
|
|
||||||
:useActions="false"
|
|
||||||
:isChild="false"
|
|
||||||
:comment="commentDetail.comment"
|
|
||||||
:postId="result.id"
|
|
||||||
></comment-item>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view :scroll-y="true" class="poup-body">
|
<scroll-view :scroll-y="true" class="poup-body">
|
||||||
@@ -207,12 +159,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else-if="commentDetail.loading == 'error'" class="error">
|
<view v-else-if="commentDetail.loading == 'error'" class="error">
|
||||||
<tm-empty icon="icon-wind-cry" label="加载失败">
|
<tm-empty icon="icon-wind-cry" label="加载失败">
|
||||||
<tm-button
|
<tm-button theme="bg-gradient-light-blue-accent" size="m" v-if="!disallowComment" @click="fnGetChildComments()">
|
||||||
theme="bg-gradient-light-blue-accent"
|
|
||||||
size="m"
|
|
||||||
v-if="!disallowComment"
|
|
||||||
@click="fnGetChildComments()"
|
|
||||||
>
|
|
||||||
刷新试试
|
刷新试试
|
||||||
</tm-button>
|
</tm-button>
|
||||||
</tm-empty>
|
</tm-empty>
|
||||||
@@ -224,16 +171,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<comment-item
|
<comment-item v-for="(comment, index) in commentDetail.list" :useContentBg="false" :useSolid="false" :useActions="false" :key="index" :isChild="false" :comment="comment" :postId="result.id"></comment-item>
|
||||||
v-for="(comment, index) in commentDetail.list"
|
|
||||||
:useContentBg="false"
|
|
||||||
:useSolid="false"
|
|
||||||
:useActions="false"
|
|
||||||
:key="index"
|
|
||||||
:isChild="false"
|
|
||||||
:comment="comment"
|
|
||||||
:postId="result.id"
|
|
||||||
></comment-item>
|
|
||||||
</block>
|
</block>
|
||||||
</block>
|
</block>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -263,6 +201,10 @@
|
|||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</tm-poup>
|
</tm-poup>
|
||||||
|
|
||||||
|
<!-- 密码访问解密弹窗 -->
|
||||||
|
<tm-dialog :disabled="true" :input-val.sync="validVisitModal.value" title="验证提示" confirmText="立即验证" :showCancel="validVisitModal.useCancel" model="confirm" v-model="validVisitModal.show" content="博主设置了需要密码才能查看该文章内容,请输入文章密码进行验证" theme="split" confirmColor="blue shadow-blue-0" @cancel="fnOnValidVisitCancel" @confirm="fnOnValidVisitConfirm"></tm-dialog>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -274,6 +216,8 @@ import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
|||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
|
import tmDialog from '@/tm-vuetify/components/tm-dialog/tm-dialog.vue';
|
||||||
|
import tmMore from '@/tm-vuetify/components/tm-more/tm-more.vue';
|
||||||
|
|
||||||
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
||||||
import commentList from '@/components/comment-list/comment-list.vue';
|
import commentList from '@/components/comment-list/comment-list.vue';
|
||||||
@@ -290,6 +234,8 @@ export default {
|
|||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmButton,
|
tmButton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
|
tmDialog,
|
||||||
|
tmMore,
|
||||||
mpHtml,
|
mpHtml,
|
||||||
commentList,
|
commentList,
|
||||||
commentItem,
|
commentItem,
|
||||||
@@ -302,8 +248,7 @@ export default {
|
|||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
markdownConfig: MarkdownConfig,
|
markdownConfig: MarkdownConfig,
|
||||||
btnOption: {
|
btnOption: {
|
||||||
actions: [
|
actions: [{
|
||||||
{
|
|
||||||
icon: 'icon-like',
|
icon: 'icon-like',
|
||||||
color: 'bg-gradient-orange-accent'
|
color: 'bg-gradient-orange-accent'
|
||||||
},
|
},
|
||||||
@@ -334,7 +279,16 @@ export default {
|
|||||||
showCanvas: false,
|
showCanvas: false,
|
||||||
loading: true,
|
loading: true,
|
||||||
res: null
|
res: null
|
||||||
}
|
},
|
||||||
|
|
||||||
|
metas: [], // 自定义元数据
|
||||||
|
// 文章加密(弹窗输入密码解密)
|
||||||
|
validVisitModal: {
|
||||||
|
show: false,
|
||||||
|
useCancel: false,
|
||||||
|
value: undefined
|
||||||
|
},
|
||||||
|
showValidVisitMore: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -354,6 +308,48 @@ export default {
|
|||||||
let blogger = this.$tm.vx.getters().getBlogger;
|
let blogger = this.$tm.vx.getters().getBlogger;
|
||||||
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
||||||
return blogger;
|
return blogger;
|
||||||
|
},
|
||||||
|
// 原文链接:个人资质=可以打开公众号文章;非个人:任意链接地址(需在小程序后台配置)
|
||||||
|
originalURL() {
|
||||||
|
const target = this.metas.find(x => x.key == 'unihalo_originalURL');
|
||||||
|
if (!target) return '';
|
||||||
|
return target.value || '';
|
||||||
|
},
|
||||||
|
// 是否使用文章密码功能,如果值不为空,则优先于 useVisitMore:unihalo_useVisitPwd
|
||||||
|
useVisitPwd() {
|
||||||
|
const target = this.metas.find(x => x.key == 'unihalo_useVisitPwd');
|
||||||
|
if (!target) return false;
|
||||||
|
return target.value || false;
|
||||||
|
},
|
||||||
|
// 是否启用查看完整文章的功能的密码:unihalo_useVisitMorePwd
|
||||||
|
useVisitMorePwd() {
|
||||||
|
const target = this.metas.find(x => x.key == 'unihalo_useVisitMorePwd');
|
||||||
|
if (!target) return false;
|
||||||
|
return target.value || false;
|
||||||
|
},
|
||||||
|
// 当前是使用哪一种类型的密码验证 0=不使用任何 1=默认弹窗密码 2=查看部分内容
|
||||||
|
useVisitMode() {
|
||||||
|
if (this.useVisitPwd != false) {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
if (this.useVisitMorePwd != false) {
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
useVisitPwd(val) {
|
||||||
|
if (val) {
|
||||||
|
this.validVisitModal.show = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
useVisitMode(val) {
|
||||||
|
if (val != 2) {
|
||||||
|
this.showValidVisitMore = true
|
||||||
|
} else {
|
||||||
|
this.showValidVisitMore = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
@@ -375,7 +371,9 @@ export default {
|
|||||||
this.$httpApi
|
this.$httpApi
|
||||||
.getArticleDetail(this.queryParams.articleId)
|
.getArticleDetail(this.queryParams.articleId)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
this.result = res.data;
|
this.result = res.data;
|
||||||
|
this.metas = res.data.metas;
|
||||||
this.fnSetPageTitle('文章详情');
|
this.fnSetPageTitle('文章详情');
|
||||||
this.loading = 'success';
|
this.loading = 'success';
|
||||||
this.fnSetWxShareConfig({
|
this.fnSetWxShareConfig({
|
||||||
@@ -386,6 +384,9 @@ export default {
|
|||||||
copyLink: this.$haloConfig.apiUrl,
|
copyLink: this.$haloConfig.apiUrl,
|
||||||
query: {}
|
query: {}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.loading = 'error';
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.loading = 'error';
|
this.loading = 'error';
|
||||||
@@ -599,7 +600,6 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.drawDashedLine(this.$refs.rCanvas.ctx, 14, 356, 332, 0.5, [8, 5, 5, 5], '#999');
|
this.drawDashedLine(this.$refs.rCanvas.ctx, 14, 356, 332, 0.5, [8, 5, 5, 5], '#999');
|
||||||
|
|
||||||
// 小程序信息
|
// 小程序信息
|
||||||
await this.$refs.rCanvas
|
await this.$refs.rCanvas
|
||||||
.drawImage({
|
.drawImage({
|
||||||
@@ -748,7 +748,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
const _handleRemove = () => {
|
const _handleRemove = () => {
|
||||||
this.$refs['barrage'].remove({
|
this.$refs['barrage'] && this.$refs['barrage'].remove({
|
||||||
duration: 5000, // 延迟关闭的时间
|
duration: 5000, // 延迟关闭的时间
|
||||||
speed: 600 // 弹幕消失的速度
|
speed: 600 // 弹幕消失的速度
|
||||||
});
|
});
|
||||||
@@ -756,7 +756,7 @@ export default {
|
|||||||
let index = 0;
|
let index = 0;
|
||||||
const _handleAddBarrage = () => {
|
const _handleAddBarrage = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$refs['barrage'].add(_list[index]);
|
this.$refs['barrage'] && this.$refs['barrage'].add(_list[index]);
|
||||||
index += 1;
|
index += 1;
|
||||||
if (index < _list.length - 1) {
|
if (index < _list.length - 1) {
|
||||||
_handleAddBarrage();
|
_handleAddBarrage();
|
||||||
@@ -768,13 +768,42 @@ export default {
|
|||||||
},
|
},
|
||||||
fnToWebview(data) {
|
fnToWebview(data) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:
|
url: '/pagesC/website/website?data=' +
|
||||||
'/pagesC/website/website?data=' +
|
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
title: data.title,
|
title: data.title,
|
||||||
url: data.url
|
url: data.url
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
fnToOriginal(originalURL) {
|
||||||
|
this.fnToWebview({ title: this.result.title, url: originalURL });
|
||||||
|
},
|
||||||
|
// 查看密码验证确认
|
||||||
|
fnOnValidVisitConfirm() {
|
||||||
|
if (this.useVisitMode == 1) {
|
||||||
|
if (this.validVisitModal.value === this.useVisitPwd) {
|
||||||
|
this.validVisitModal.show = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (this.useVisitMode == 2) {
|
||||||
|
if (this.validVisitModal.value === this.useVisitMorePwd) {
|
||||||
|
this.showValidVisitMore = true;
|
||||||
|
this.validVisitModal.show = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uni.$tm.toast("验证密码不正确!")
|
||||||
|
},
|
||||||
|
fnOnValidVisitCancel() {
|
||||||
|
this.validVisitModal.show = false;
|
||||||
|
this.validVisitModal.useCancel = true;
|
||||||
|
this.validVisitModal.value = undefined;
|
||||||
|
},
|
||||||
|
// 点击解锁弹出密码输入框
|
||||||
|
fnOnShowValidVisitMore() {
|
||||||
|
this.validVisitModal.useCancel = true;
|
||||||
|
this.validVisitModal.value = undefined;
|
||||||
|
this.validVisitModal.show = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -788,7 +817,20 @@ export default {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fafafd;
|
background-color: #fafafd;
|
||||||
|
padding-bottom: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-image {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.loading-wrap {
|
.loading-wrap {
|
||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
height: inherit;
|
height: inherit;
|
||||||
@@ -804,24 +846,26 @@ export default {
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
// box-shadow: 0rpx 6rpx 30rpx rgba(182, 223, 255, 0.3);
|
// box-shadow: 0rpx 6rpx 30rpx rgba(182, 223, 255, 0.3);
|
||||||
|
border-radius: 12rpx;
|
||||||
|
|
||||||
border-radius: 24rpx;
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail {
|
.detail {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|
||||||
.author {
|
.author {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
|
||||||
&-name {
|
&-name {}
|
||||||
}
|
|
||||||
&-time {
|
&-time {
|
||||||
margin-left: 36rpx;
|
margin-left: 36rpx;
|
||||||
}
|
}
|
||||||
@@ -831,22 +875,27 @@ export default {
|
|||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 280rpx;
|
height: 280rpx;
|
||||||
|
|
||||||
&-img {
|
&-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.count {
|
.count {
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
&.no-thumbnail {
|
&.no-thumbnail {
|
||||||
border-top: 2rpx solid #f2f2f2;
|
border-top: 2rpx solid #f2f2f2;
|
||||||
padding-top: 12rpx;
|
padding-top: 12rpx;
|
||||||
|
|
||||||
.count-item {
|
.count-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -855,6 +904,7 @@ export default {
|
|||||||
width: 2rpx;
|
width: 2rpx;
|
||||||
height: 32rpx;
|
height: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
&::after {
|
&::after {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -862,16 +912,19 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-item {
|
&-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
padding-left: 8rpx;
|
padding-left: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
@@ -879,6 +932,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.category {
|
.category {
|
||||||
margin: 0 24rpx;
|
margin: 0 24rpx;
|
||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
@@ -888,37 +942,51 @@ export default {
|
|||||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
// border: 2rpx solid #f8f8f8;
|
// border: 2rpx solid #f8f8f8;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|
||||||
&-type {
|
&-type {
|
||||||
line-height: 55rpx;
|
line-height: 55rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-tag {
|
&-tag {
|
||||||
background-color: #5bb8fa;
|
background-color: #5bb8fa;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 6rpx 12rpx;
|
padding: 6rpx 12rpx;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
|
||||||
&.is-empty {
|
&.is-empty {
|
||||||
background-color: #607d8b;
|
background-color: #607d8b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.category-tag+.category-tag {
|
.category-tag+.category-tag {
|
||||||
margin-left: 12rpx;
|
margin-left: 12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.markdown-wrap,
|
||||||
.evan-markdown,
|
.evan-markdown,
|
||||||
.ad-wrap,
|
.ad-wrap,
|
||||||
.copyright-wrap,
|
.copyright-wrap,
|
||||||
.comment-wrap {
|
.comment-wrap {
|
||||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.03);
|
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.markdown-wrap {
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.copyright-title {
|
.copyright-title {
|
||||||
position: relative;
|
position: relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-left: 24rpx;
|
padding-left: 24rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -930,16 +998,20 @@ export default {
|
|||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.poup-head {
|
.poup-head {
|
||||||
border-bottom: 2rpx solid #f5f5f5;
|
border-bottom: 2rpx solid #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poup-body {
|
.poup-body {
|
||||||
height: 50vh;
|
height: 50vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poup-empty {
|
.poup-empty {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40vh;
|
height: 40vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poup-loading-wrap {
|
.poup-loading-wrap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40vh;
|
height: 40vh;
|
||||||
@@ -948,14 +1020,17 @@ export default {
|
|||||||
font-size: 80rpx;
|
font-size: 80rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.poster-content {
|
.poster-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 60vh;
|
min-height: 60vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copyright-text {
|
.copyright-text {
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poster-loading {
|
.poster-loading {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -966,8 +1041,39 @@ export default {
|
|||||||
// background-color: rgba(0, 0, 0, 0.1);
|
// background-color: rgba(0, 0, 0, 0.1);
|
||||||
z-index: 666;
|
z-index: 666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poster-save {
|
.poster-save {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-top: 2rpx dashed #eee;
|
border-top: 2rpx dashed #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.original-url {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
&_left {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 84rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&_right {
|
||||||
|
flex-grow: 1;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&__link {
|
||||||
|
width: 410rpx;
|
||||||
|
display: inline-block;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__btn {
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: block;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Criar uma nova questão referindo esta
Bloquear um utilizador