fix: rating
This commit is contained in:
@@ -150,6 +150,10 @@ const switchCategory = (categoryId) => {
|
|||||||
|
|
||||||
const topicList = ref([]);
|
const topicList = ref([]);
|
||||||
|
|
||||||
|
const getCurrentCategoryTitle = () => {
|
||||||
|
return categories.value.find((category) => category.id === currentCategoryId.value)?.title || "推荐";
|
||||||
|
};
|
||||||
|
|
||||||
const goToRating = (topicId, itemId) => {
|
const goToRating = (topicId, itemId) => {
|
||||||
uni.$trackRecord({
|
uni.$trackRecord({
|
||||||
eventName: 'jumpto_rating',
|
eventName: 'jumpto_rating',
|
||||||
@@ -216,8 +220,9 @@ onReachBottom(() => {
|
|||||||
onShareAppMessage(async () => {
|
onShareAppMessage(async () => {
|
||||||
const shareToken = await getShareToken("index");
|
const shareToken = await getShareToken("index");
|
||||||
getShareReward();
|
getShareReward();
|
||||||
|
const categoryTitle = getCurrentCategoryTitle();
|
||||||
return {
|
return {
|
||||||
title: "夯拉评分",
|
title: `夯拉评分 | ${categoryTitle}榜单正在热议`,
|
||||||
path: "/pages/index/index?shareToken=" + shareToken,
|
path: "/pages/index/index?shareToken=" + shareToken,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -225,8 +230,9 @@ onShareAppMessage(async () => {
|
|||||||
onShareTimeline(async () => {
|
onShareTimeline(async () => {
|
||||||
const shareToken = await getShareToken("index");
|
const shareToken = await getShareToken("index");
|
||||||
getShareReward();
|
getShareReward();
|
||||||
|
const categoryTitle = getCurrentCategoryTitle();
|
||||||
return {
|
return {
|
||||||
title: "夯拉评分",
|
title: `${categoryTitle}圈都在玩夯拉评分,来看看谁最夯`,
|
||||||
query: `shareToken=${shareToken}`,
|
query: `shareToken=${shareToken}`,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
import { onShareAppMessage, onLoad, onShow } from "@dcloudio/uni-app";
|
import { onShareAppMessage, onShareTimeline, onLoad, onShow } from "@dcloudio/uni-app";
|
||||||
import { getShareToken } from "@/utils/common";
|
import { getShareToken } from "@/utils/common";
|
||||||
import { getShareReward } from "@/api/system";
|
import { getShareReward } from "@/api/system";
|
||||||
import { fetchUserNums } from "@/api/mine";
|
import { fetchUserNums } from "@/api/mine";
|
||||||
@@ -154,13 +154,25 @@ onShow(() => {
|
|||||||
onShareAppMessage(async () => {
|
onShareAppMessage(async () => {
|
||||||
const shareToken = await getShareToken("mine");
|
const shareToken = await getShareToken("mine");
|
||||||
getShareReward({ scene: "mine" });
|
getShareReward({ scene: "mine" });
|
||||||
|
const nickName = isLoggedIn.value ? userInfo.value.nickName : "我";
|
||||||
return {
|
return {
|
||||||
title: "分享",
|
title: `${nickName}也在玩夯拉评分,来看看TA的主页`,
|
||||||
path: "/pages/index/index?shareToken=" + shareToken,
|
path: "/pages/mine/mine?shareToken=" + shareToken,
|
||||||
imageUrl: "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
|
imageUrl: "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onShareTimeline(async () => {
|
||||||
|
const shareToken = await getShareToken("mine");
|
||||||
|
getShareReward({ scene: "mine_timeline" });
|
||||||
|
const nickName = isLoggedIn.value ? userInfo.value.nickName : "我";
|
||||||
|
const participant = userStats.value.participant || 0;
|
||||||
|
return {
|
||||||
|
title: `${nickName}已参与 ${participant} 个话题,来夯拉评分一起围观`,
|
||||||
|
query: `shareToken=${shareToken}`,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
const handleUserClick = () => {
|
const handleUserClick = () => {
|
||||||
if (!isLoggedIn.value) {
|
if (!isLoggedIn.value) {
|
||||||
loginPopupRef.value.open();
|
loginPopupRef.value.open();
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { getStatusBarHeight } from "@/utils/system";
|
import { getStatusBarHeight } from "@/utils/system";
|
||||||
import { onLoad, onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
|
import { onLoad, onPullDownRefresh, onReachBottom, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
|
||||||
import AttitudePanel from "@/components/AttitudePanel/AttitudePanel.vue";
|
import AttitudePanel from "@/components/AttitudePanel/AttitudePanel.vue";
|
||||||
import SuccessPopup from "@/components/SuccessPopup/SuccessPopup.vue";
|
import SuccessPopup from "@/components/SuccessPopup/SuccessPopup.vue";
|
||||||
import ActionBadge from "@/components/ActionBadge/ActionBadge.vue";
|
import ActionBadge from "@/components/ActionBadge/ActionBadge.vue";
|
||||||
@@ -117,6 +117,8 @@ import CommentItem from "@/components/CommentItem/CommentItem.vue";
|
|||||||
import { FILE_BASE_URL } from "@/utils/constants";
|
import { FILE_BASE_URL } from "@/utils/constants";
|
||||||
import { fetchTopicRatingItems, topicItemScore, topicItemComment, topicItemCommentList } from "@/api/topicItem";
|
import { fetchTopicRatingItems, topicItemScore, topicItemComment, topicItemCommentList } from "@/api/topicItem";
|
||||||
import { formatDate } from "@/utils/date";
|
import { formatDate } from "@/utils/date";
|
||||||
|
import { getShareToken } from "@/utils/common";
|
||||||
|
import { getShareReward } from "@/api/system";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -337,6 +339,27 @@ onLoad((options) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onShareAppMessage(async () => {
|
||||||
|
const shareToken = await getShareToken("rating_item");
|
||||||
|
getShareReward({ scene: "rating_item" });
|
||||||
|
const itemName = detailData.value.name || "这个评分对象";
|
||||||
|
return {
|
||||||
|
title: `「${itemName}」在夯拉评分里是什么段位?`,
|
||||||
|
path: `/pages/rating/detail?itemId=${itemId.value}&topicId=${detailData.value.topicId}&shareToken=${shareToken}`,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
onShareTimeline(async () => {
|
||||||
|
const shareToken = await getShareToken("rating_item");
|
||||||
|
getShareReward({ scene: "rating_item_timeline" });
|
||||||
|
const itemName = detailData.value.name || "这个评分对象";
|
||||||
|
const score = detailData.value.score || "0.0";
|
||||||
|
return {
|
||||||
|
title: `${itemName}当前评分 ${score},来看看大家怎么评`,
|
||||||
|
query: `itemId=${itemId.value}&topicId=${detailData.value.topicId}&shareToken=${shareToken}`,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
onPullDownRefresh(() => {
|
onPullDownRefresh(() => {
|
||||||
currentPage.value = 1;
|
currentPage.value = 1;
|
||||||
hasMore.value = true;
|
hasMore.value = true;
|
||||||
|
|||||||
@@ -156,13 +156,15 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { getStatusBarHeight } from "@/utils/system";
|
import { getStatusBarHeight } from "@/utils/system";
|
||||||
import { onPullDownRefresh, onReachBottom, onLoad } from "@dcloudio/uni-app";
|
import { onPullDownRefresh, onReachBottom, onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
|
||||||
import { fetchTopicDetail, fetchTopicRatingItems } from "@/api/topic";
|
import { fetchTopicDetail, fetchTopicRatingItems } from "@/api/topic";
|
||||||
import { FILE_BASE_URL } from "@/utils/constants";
|
import { FILE_BASE_URL } from "@/utils/constants";
|
||||||
import RatingCard from "@/components/RatingCard/RatingCard.vue";
|
import RatingCard from "@/components/RatingCard/RatingCard.vue";
|
||||||
import SuccessPopup from "@/components/SuccessPopup/SuccessPopup.vue";
|
import SuccessPopup from "@/components/SuccessPopup/SuccessPopup.vue";
|
||||||
import { topicItemScore, topicItemAdd } from "@/api/topicItem";
|
import { topicItemScore, topicItemAdd } from "@/api/topicItem";
|
||||||
import { uploadImage } from "@/utils/common";
|
import { uploadImage } from "@/utils/common";
|
||||||
|
import { getShareToken } from "@/utils/common";
|
||||||
|
import { getShareReward } from "@/api/system";
|
||||||
// 状态栏高度处理
|
// 状态栏高度处理
|
||||||
const statusBarHeight = ref(getStatusBarHeight() || 44);
|
const statusBarHeight = ref(getStatusBarHeight() || 44);
|
||||||
|
|
||||||
@@ -361,6 +363,30 @@ const goToDetail = (itemId) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onShareAppMessage(async () => {
|
||||||
|
const shareToken = await getShareToken("rating_topic");
|
||||||
|
getShareReward({ scene: "rating_topic" });
|
||||||
|
const topName = ratingItems.value?.[0]?.name;
|
||||||
|
return {
|
||||||
|
title: topName
|
||||||
|
? `「${topicData.value.title || "夯拉评分"}」正在热评,${topName}暂时领先`
|
||||||
|
: `「${topicData.value.title || "夯拉评分"}」正在热评,快来参与打分`,
|
||||||
|
path: `/pages/rating/index?topicId=${currentTopicId.value}&shareToken=${shareToken}`,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
onShareTimeline(async () => {
|
||||||
|
const shareToken = await getShareToken("rating_topic");
|
||||||
|
getShareReward({ scene: "rating_topic_timeline" });
|
||||||
|
const topName = ratingItems.value?.[0]?.name;
|
||||||
|
return {
|
||||||
|
title: topName
|
||||||
|
? `${topName}在「${topicData.value.title || "夯拉评分"}」里冲到第一了`
|
||||||
|
: `「${topicData.value.title || "夯拉评分"}」榜单已开启,来看看大家怎么评`,
|
||||||
|
query: `topicId=${currentTopicId.value}&shareToken=${shareToken}`,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
// 下拉刷新
|
// 下拉刷新
|
||||||
onPullDownRefresh(async () => {
|
onPullDownRefresh(async () => {
|
||||||
if (currentTopicId.value) {
|
if (currentTopicId.value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user