fix: 修复文章分享功能

This commit is contained in:
小莫唐尼 2024-10-22 16:30:30 +08:00
parent 26ce84b950
commit 115aea2580
3 changed files with 1579 additions and 1558 deletions

View File

@ -28,17 +28,20 @@
@on-click="fnOnBannerClick"></e-swiper> @on-click="fnOnBannerClick"></e-swiper>
</view> </view>
</view> </view>
<view v-if="!haloConfigs.basicConfig.auditModeEnabled" class="flex flex-between mt-16 mb-24 pl-24 pr-24"> <!-- 精品分类 -->
<block v-if="haloConfigs.pageConfig.homeConfig.useCategory">
<view class="flex flex-between mt-16 mb-24 pl-24 pr-24">
<view class="page-item_title text-weight-b ">精品分类</view> <view class="page-item_title text-weight-b ">精品分类</view>
<view class="show-more flex flex-center bg-white round-3" @click="fnToCategoryPage"> <view class="show-more flex flex-center bg-white round-3" @click="fnToCategoryPage">
<text class="iconfont icon-angle-right text-size-s text-grey-darken-1"></text> <text class="iconfont icon-angle-right text-size-s text-grey-darken-1"></text>
</view> </view>
<view v-if="false" class="flex flex-center text-size-s text-grey-darken-1" @click="fnToCategoryPage"> <view v-if="false" class="flex flex-center text-size-s text-grey-darken-1"
@click="fnToCategoryPage">
<text class=" text-size-m">查看更多</text> <text class=" text-size-m">查看更多</text>
<text class="iconfont icon-angle-right text-size-s "></text> <text class="iconfont icon-angle-right text-size-s "></text>
</view> </view>
</view> </view>
<scroll-view v-if="!haloConfigs.basicConfig.auditModeEnabled" class="category" scroll-x="true"> <scroll-view class="category" scroll-x="true">
<view v-if="categoryList.length == 0" class="cate-empty round-3 mr-5 flex flex-center text-grey"> <view v-if="categoryList.length == 0" class="cate-empty round-3 mr-5 flex flex-center text-grey">
还没有任何分类~ 还没有任何分类~
</view> </view>
@ -49,9 +52,10 @@
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
</block>
<!-- 最新文章 --> <!-- 最新文章 -->
<view class="flex flex-between mt-24 mb-24 pl-24 pr-24"> <view v-if="!haloConfigs.basicConfig.auditModeEnabled" class="flex flex-between mt-24 mb-24 pl-24 pr-24">
<view class="page-item_title text-weight-b">最新列表</view> <view class="page-item_title text-weight-b">最新列表</view>
<view class="show-more flex flex-center bg-white round-3" @click="fnToArticlesPage"> <view class="show-more flex flex-center bg-white round-3" @click="fnToArticlesPage">
<text class="iconfont icon-angle-right text-size-s text-grey-darken-1"></text> <text class="iconfont icon-angle-right text-size-s text-grey-darken-1"></text>
@ -146,7 +150,6 @@ export default {
this.queryParams.page = 1; this.queryParams.page = 1;
this.fnQuery(); this.fnQuery();
}, },
onReachBottom(e) { onReachBottom(e) {
if (this.result.hasNext) { if (this.result.hasNext) {
this.queryParams.page += 1; this.queryParams.page += 1;
@ -167,7 +170,7 @@ export default {
}, },
fnGetCategoryList() { fnGetCategoryList() {
if (this.haloConfigs.basicConfig.auditModeEnabled) { if (this.haloConfigs.pageConfig.homeConfig.useCategory) {
return; return;
} }
this.$httpApi.v2 this.$httpApi.v2
@ -194,7 +197,9 @@ export default {
}, },
// //
fnGetBanner() { fnGetBanner() {
if (this.haloConfigs.basicConfig.auditModeEnabled) {
return;
}
const _this = this; const _this = this;
const _format = function(list) { const _format = function(list) {
return list.map((item, index) => { return list.map((item, index) => {
@ -225,8 +230,7 @@ export default {
success: (res) => { success: (res) => {
this.bannerList = _format(res.data.items); this.bannerList = _format(res.data.items);
}, },
fail: (err) => { fail: (err) => {}
}
}) })
}, },
@ -378,11 +382,9 @@ export default {
margin-right: 24rpx; margin-right: 24rpx;
/* #endif */ /* #endif */
&_icon { &_icon {}
}
&_text { &_text {}
}
} }
.show-more { .show-more {

View File

@ -232,7 +232,9 @@ import commentModal from '@/components/comment-modal/comment-modal.vue';
import rCanvas from '@/components/r-canvas/r-canvas.vue'; import rCanvas from '@/components/r-canvas/r-canvas.vue';
import barrage from '@/components/barrage/barrage.vue'; import barrage from '@/components/barrage/barrage.vue';
import {getAppConfigs} from '@/config/index.js' import {
getAppConfigs
} from '@/config/index.js'
export default { export default {
components: { components: {
@ -344,6 +346,24 @@ export default {
onPullDownRefresh() { onPullDownRefresh() {
this.fnGetData(); this.fnGetData();
}, },
onShareAppMessage() {
const cover = this.result.spec.cover ? this.calcUrl(this.result.spec.cover) : ""
return {
path: '/pagesA/article-detail/article-detail?name=' + this.result.metadata.name,
title: this.result.spec.title,
imageUrl: cover
}
},
onShareTimeline() {
const cover = this.result.spec.cover ? this.calcUrl(this.result.spec.cover) : ""
return {
title: this.result.spec.title,
query: {
name: this.result.metadata.name
},
imageUrl: cover
}
},
methods: { methods: {
fnGetData() { fnGetData() {
this.loading = 'loading'; this.loading = 'loading';
@ -997,8 +1017,7 @@ export default {
font-size: 24rpx; font-size: 24rpx;
color: #666; color: #666;
&-name { &-name {}
}
&-time { &-time {
margin-left: 36rpx; margin-left: 36rpx;