fix: share token

This commit is contained in:
zzc
2026-02-09 22:31:01 +08:00
parent 87a2383d0f
commit 85bbf9d8ac
11 changed files with 282 additions and 133 deletions

View File

@@ -128,7 +128,7 @@ import { ref, onMounted } from "vue";
import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app"; import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
import { getPageDetail } from "@/api/system.js"; import { getPageDetail } from "@/api/system.js";
import { getAvatarRecommendList } from "@/api/avatar.js"; import { getAvatarRecommendList } from "@/api/avatar.js";
import { saveViewRequest } from "@/utils/common.js"; import { getShareToken, saveViewRequest } from "@/utils/common.js";
import NavBar from "@/components/NavBar/NavBar.vue"; import NavBar from "@/components/NavBar/NavBar.vue";
const defaultAvatar = const defaultAvatar =
@@ -145,20 +145,22 @@ onLoad((options) => {
fetchFrames(); fetchFrames();
}); });
onShareAppMessage(() => { onShareAppMessage(async () => {
const token = await getShareToken("avatar_detail", detailData.value?.id);
return { return {
title: "快来看看我刚领到的新年专属头像 🎊", title: "快来看看我刚领到的新年专属头像 🎊",
path: `/pages/avatar/detail?shareToken=${shareToken.value}`, path: `/pages/avatar/detail?shareToken=${token}`,
imageUrl: imageUrl:
detailData.value?.imageUrl || detailData.value?.imageUrl ||
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };
}); });
onShareTimeline(() => { onShareTimeline(async () => {
const token = await getShareToken("avatar_timeline", detailData.value?.id);
return { return {
title: "快来看看我刚领到的新年专属头像 🎊", title: "快来看看我刚领到的新年专属头像 🎊",
query: `shareToken=${shareToken.value}`, query: `shareToken=${token}`,
imageUrl: imageUrl:
detailData.value?.imageUrl || detailData.value?.imageUrl ||
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -169,7 +171,7 @@ const fetchDetail = async () => {
try { try {
// uni.showLoading({ title: "加载中..." }); // uni.showLoading({ title: "加载中..." });
const res = await getPageDetail(shareToken.value); const res = await getPageDetail(shareToken.value);
saveViewRequest(shareToken.value, "avatar_download", res.id); saveViewRequest(shareToken.value, "avatar_detail", res.id);
if (res) { if (res) {
detailData.value = res; detailData.value = res;
} }

View File

@@ -195,6 +195,7 @@ import {
getShareToken, getShareToken,
generateObjectId, generateObjectId,
uploadImage, uploadImage,
saveViewRequest,
} from "@/utils/common.js"; } from "@/utils/common.js";
import NavBar from "@/components/NavBar/NavBar.vue"; import NavBar from "@/components/NavBar/NavBar.vue";
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue"; import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
@@ -348,6 +349,10 @@ onLoad((options) => {
currentAvatar.value = recommendItem; currentAvatar.value = recommendItem;
} }
} }
if (options.shareToken) {
saveViewRequest("avatar_download", options.shareToken);
}
}); });
onReachBottom(() => { onReachBottom(() => {
@@ -718,9 +723,11 @@ onShareAppMessage(async () => {
}; };
}); });
onShareTimeline(() => { onShareTimeline(async () => {
const shareToken = await getShareToken("avatar_timeline");
return { return {
title: "快来定制你的新年专属头像 🎊", title: "快来定制你的新年专属头像 🎊",
query: `shareToken=${shareToken}`,
imageUrl: imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };

View File

@@ -117,7 +117,7 @@
import { ref } from "vue"; import { ref } from "vue";
import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app"; import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
import { getPageDetail } from "@/api/system.js"; import { getPageDetail } from "@/api/system.js";
import { saveViewRequest } from "@/utils/common.js"; import { getShareToken, saveViewRequest } from "@/utils/common.js";
import NavBar from "@/components/NavBar/NavBar.vue"; import NavBar from "@/components/NavBar/NavBar.vue";
const cardId = ref(""); const cardId = ref("");
@@ -132,20 +132,22 @@ onLoad(async (options) => {
} }
}); });
onShareAppMessage(() => { onShareAppMessage(async () => {
const token = await getShareToken("card_detail", cardDetail.value?.id);
return { return {
title: "送你一张精美的新春祝福卡片 🎊", title: "送你一张精美的新春祝福卡片 🎊",
path: `/pages/detail/index?shareToken=${cardDetail.value?.shareToken || ""}`, path: `/pages/detail/index?shareToken=${token || ""}`,
imageUrl: imageUrl:
cardDetail.value?.imageUrl || cardDetail.value?.imageUrl ||
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };
}); });
onShareTimeline(() => { onShareTimeline(async () => {
const token = await getShareToken("card_timeline", cardDetail.value?.id);
return { return {
title: "送你一张精美的新春祝福卡片 🎊", title: "送你一张精美的新春祝福卡片 🎊",
query: `shareToken=${cardDetail.value?.shareToken || ""}`, query: `shareToken=${token}`,
imageUrl: imageUrl:
cardDetail.value?.imageUrl || cardDetail.value?.imageUrl ||
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",

View File

@@ -130,6 +130,7 @@ import {
getShareToken, getShareToken,
saveRemoteImageToLocal, saveRemoteImageToLocal,
saveRecordRequest, saveRecordRequest,
saveViewRequest,
} from "@/utils/common.js"; } from "@/utils/common.js";
import NavBar from "@/components/NavBar/NavBar.vue"; import NavBar from "@/components/NavBar/NavBar.vue";
@@ -155,7 +156,11 @@ audioContext.onEnded(() => {
} }
}); });
onLoad(() => {}); onLoad((options) => {
if (options.shareToken) {
saveViewRequest(options.shareToken, "fortune_draw");
}
});
onShow(() => { onShow(() => {
checkDrawStatus(); checkDrawStatus();
@@ -176,9 +181,11 @@ onShareAppMessage(async () => {
}; };
}); });
onShareTimeline(() => { onShareTimeline(async () => {
const shareToken = await getShareToken("fortune_timeline");
return { return {
title: "新春到,抽灵签!快来测测你的新年运势 🏮", title: "新春到,抽灵签!快来测测你的新年运势 🏮",
query: `shareToken=${shareToken}`,
imageUrl: imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };

View File

@@ -31,7 +31,9 @@
class="notice-swiper-item" class="notice-swiper-item"
@tap="onNoticeTap(tip)" @tap="onNoticeTap(tip)"
> >
<text v-if="tip.tag" class="notice-tag">{{ getTagText(tip.tag) }}</text> <text v-if="tip.tag" class="notice-tag">{{
getTagText(tip.tag)
}}</text>
<text class="notice-text">{{ tip.text }}</text> <text class="notice-text">{{ tip.text }}</text>
</swiper-item> </swiper-item>
</swiper> </swiper>
@@ -209,15 +211,16 @@ onShareAppMessage(async () => {
}; };
}); });
onShareTimeline(() => { onShareTimeline(async () => {
const shareToken = await getShareToken("index_timeline");
return { return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸", title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
query: `shareToken=${shareToken}`,
imageUrl: imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };
}); });
const getIndexTips = async () => { const getIndexTips = async () => {
const res = await getTipsList(); const res = await getTipsList();
noticeList.value = res || []; noticeList.value = res || [];

View File

@@ -1015,9 +1015,11 @@ onShareAppMessage(async (options) => {
} }
}); });
onShareTimeline(() => { onShareTimeline(async () => {
const shareToken = await getShareToken("card_timeline");
return { return {
title: "送你一张精美的新春祝福卡片 🎊", title: "送你一张精美的新春祝福卡片 🎊",
query: `shareToken=${shareToken}`,
imageUrl: imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };

View File

@@ -99,7 +99,6 @@ import {
onPullDownRefresh, onPullDownRefresh,
onReachBottom, onReachBottom,
onShareAppMessage, onShareAppMessage,
onShareTimeline,
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
import { getMyCard } from "@/api/mine.js"; import { getMyCard } from "@/api/mine.js";
import NavBar from "@/components/NavBar/NavBar.vue"; import NavBar from "@/components/NavBar/NavBar.vue";
@@ -148,14 +147,6 @@ onShareAppMessage(async (options) => {
} }
}); });
onShareTimeline(() => {
return {
title: "送你一张精美的新春祝福卡片 🎊",
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
};
});
const fetchList = async (reset = false) => { const fetchList = async (reset = false) => {
if (loading.value) return; if (loading.value) return;
if (reset) { if (reset) {

View File

@@ -136,7 +136,8 @@
<script setup> <script setup>
import { ref, computed, onMounted } from "vue"; import { ref, computed, onMounted } from "vue";
import { useUserStore } from "@/stores/user"; import { useUserStore } from "@/stores/user";
import { onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app"; import { onShareAppMessage } from "@dcloudio/uni-app";
import { getShareToken } from "@/utils/common";
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue"; import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
const userStore = useUserStore(); const userStore = useUserStore();
@@ -167,18 +168,11 @@ onMounted(() => {
navBarHeight.value = 44; navBarHeight.value = 44;
}); });
onShareAppMessage(() => { onShareAppMessage(async () => {
return { const shareToken = await getShareToken("mine");
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
path: "/pages/index/index",
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
};
});
onShareTimeline(() => {
return { return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸", title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
path: "/pages/index/index?shareToken=" + shareToken,
imageUrl: imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };

View File

@@ -11,7 +11,11 @@
<text class="main">新春祝福</text> <text class="main">新春祝福</text>
</view> </view>
<text class="hero-sub">新年快乐万事如意</text> <text class="hero-sub">新年快乐万事如意</text>
<image class="hero-decor" src="https://file.lihailezzc.com/resource/58c8d19e5f2d9c958a7b8b9f44b8c3e3.png" mode="aspectFill" /> <image
class="hero-decor"
src="https://file.lihailezzc.com/resource/58c8d19e5f2d9c958a7b8b9f44b8c3e3.png"
mode="aspectFill"
/>
</view> </view>
<!-- 功能入口宫格 --> <!-- 功能入口宫格 -->
@@ -39,7 +43,12 @@
</view> </view>
<scroll-view scroll-x class="cards-scroll" show-scrollbar="false"> <scroll-view scroll-x class="cards-scroll" show-scrollbar="false">
<view class="cards-wrap"> <view class="cards-wrap">
<view v-for="(card, i) in popularCards" :key="i" class="use-card" @tap="previewCard(card)"> <view
v-for="(card, i) in popularCards"
:key="i"
class="use-card"
@tap="previewCard(card)"
>
<image :src="card.cover" class="use-cover" mode="aspectFill" /> <image :src="card.cover" class="use-cover" mode="aspectFill" />
<view class="use-info"> <view class="use-info">
<text class="use-title">{{ card.title }}</text> <text class="use-title">{{ card.title }}</text>
@@ -68,7 +77,12 @@
</view> </view>
<view class="feed-content"> <view class="feed-content">
<text class="feed-text">{{ post.text }}</text> <text class="feed-text">{{ post.text }}</text>
<image v-if="post.image" :src="post.image" class="feed-image" mode="aspectFill" /> <image
v-if="post.image"
:src="post.image"
class="feed-image"
mode="aspectFill"
/>
</view> </view>
<view class="feed-actions"> <view class="feed-actions">
<view class="action" @tap="like(i)"> <view class="action" @tap="like(i)">
@@ -98,78 +112,123 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { ref } from "vue";
import { onPullDownRefresh, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app' import {
import { getBavBarHeight } from '@/utils/system' onPullDownRefresh,
onShareAppMessage,
onShareTimeline,
} from "@dcloudio/uni-app";
import { getBavBarHeight } from "@/utils/system";
import { getShareToken } from "@/utils/common";
const features = ref([ const features = ref([
{ title: '新春祝福卡片', subtitle: '龙年贺卡', icon: 'https://file.lihailezzc.com/resource/6b6cb83abf3a9c9b78a4744238b5b851.png', type: 'card' }, {
{ title: '视频拜年', subtitle: 'AI合成短视频', icon: 'https://file.lihailezzc.com/resource/1a7b4b9d2b9b4bcb88f14c9f1ef4413a.png', type: 'video' }, title: "新春祝福卡片",
{ title: '新春头像装饰', subtitle: '锦上添花', icon: 'https://file.lihailezzc.com/resource/5e7d2b8d1c34c22f9c4f4f4cb4cba70d.png', type: 'avatar_decor' }, subtitle: "龙年贺卡",
{ title: '马年主题头像框', subtitle: '2026限定', icon: 'https://file.lihailezzc.com/resource/9f80ab295b7e0a7a5f62c3b0f2d7a11c.png', type: 'avatar_frame' }, icon: "https://file.lihailezzc.com/resource/6b6cb83abf3a9c9b78a4744238b5b851.png",
]) type: "card",
},
{
title: "视频拜年",
subtitle: "AI合成短视频",
icon: "https://file.lihailezzc.com/resource/1a7b4b9d2b9b4bcb88f14c9f1ef4413a.png",
type: "video",
},
{
title: "新春头像装饰",
subtitle: "锦上添花",
icon: "https://file.lihailezzc.com/resource/5e7d2b8d1c34c22f9c4f4f4cb4cba70d.png",
type: "avatar_decor",
},
{
title: "马年主题头像框",
subtitle: "2026限定",
icon: "https://file.lihailezzc.com/resource/9f80ab295b7e0a7a5f62c3b0f2d7a11c.png",
type: "avatar_frame",
},
]);
const popularCards = ref([ const popularCards = ref([
{ title: '极简祝福金框', sub: '极简风格', cover: 'https://file.lihailezzc.com/resource/7a5b2f2f5d6c42b5b21b8b1c9b28a3a1.jpg' }, {
{ title: '红包封面', sub: '新春限定', cover: 'https://file.lihailezzc.com/resource/9b3d2a1a4c7b4a4a9e3b94c4a2b9c3e2.jpg' }, title: "极简祝福金框",
{ title: '新春大拜年卡', sub: '全家福', cover: 'https://file.lihailezzc.com/resource/3a2b1c9d7e6f5a4b3c2d1e0f9a8b7c6d.jpg' } sub: "极简风格",
]) cover:
"https://file.lihailezzc.com/resource/7a5b2f2f5d6c42b5b21b8b1c9b28a3a1.jpg",
},
{
title: "红包封面",
sub: "新春限定",
cover:
"https://file.lihailezzc.com/resource/9b3d2a1a4c7b4a4a9e3b94c4a2b9c3e2.jpg",
},
{
title: "新春大拜年卡",
sub: "全家福",
cover:
"https://file.lihailezzc.com/resource/3a2b1c9d7e6f5a4b3c2d1e0f9a8b7c6d.jpg",
},
]);
const feeds = ref([ const feeds = ref([
{ {
name: '陈小明', name: "陈小明",
time: '刚刚', time: "刚刚",
avatar: 'https://file.lihailezzc.com/resource/1463f294244c11cf274a5eaae115872a.jpeg', avatar:
text: '祝大家新的一年万事如意,阖家幸福!龙年行大运,喜气满满~✨', "https://file.lihailezzc.com/resource/1463f294244c11cf274a5eaae115872a.jpeg",
image: 'https://file.lihailezzc.com/resource/02b7d1f8a9c34f2b8a2a7d4e9b1a5c8d.jpg', text: "祝大家新的一年万事如意,阖家幸福!龙年行大运,喜气满满~✨",
image:
"https://file.lihailezzc.com/resource/02b7d1f8a9c34f2b8a2a7d4e9b1a5c8d.jpg",
likes: 12, likes: 12,
comments: 3 comments: 3,
}, },
{ {
name: '李华', name: "李华",
time: '5分钟前', time: "5分钟前",
avatar: 'https://file.lihailezzc.com/resource/1463f294244c11cf274a5eaae115872a.jpeg', avatar:
text: '新年快乐祝朋友们身体健康、工作顺利2026马到成功', "https://file.lihailezzc.com/resource/1463f294244c11cf274a5eaae115872a.jpeg",
image: '', text: "新年快乐祝朋友们身体健康、工作顺利2026马到成功",
image: "",
likes: 8, likes: 8,
comments: 2 comments: 2,
}, },
{ {
name: '王伟', name: "王伟",
time: '10分钟前', time: "10分钟前",
avatar: 'https://file.lihailezzc.com/resource/1463f294244c11cf274a5eaae115872a.jpeg', avatar:
text: '给你们拜年啦!', "https://file.lihailezzc.com/resource/1463f294244c11cf274a5eaae115872a.jpeg",
image: 'https://file.lihailezzc.com/resource/1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f.jpg', text: "给你们拜年啦!",
image:
"https://file.lihailezzc.com/resource/1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f.jpg",
likes: 6, likes: 6,
comments: 1 comments: 1,
} },
]) ]);
const onFeatureTap = (item) => { const onFeatureTap = (item) => {
uni.showToast({ title: `进入:${item.title}`, icon: 'none' }) uni.showToast({ title: `进入:${item.title}`, icon: "none" });
// 可跳转到对应功能页面 // 可跳转到对应功能页面
// uni.navigateTo({ url: `/pages/${item.type}/index` }) // uni.navigateTo({ url: `/pages/${item.type}/index` })
} };
const previewCard = (card) => { const previewCard = (card) => {
uni.previewImage({ urls: [card.cover] }) uni.previewImage({ urls: [card.cover] });
} };
const onMore = (type) => { const onMore = (type) => {
uni.showToast({ title: '即将开放~', icon: 'none' }) uni.showToast({ title: "即将开放~", icon: "none" });
} };
const like = (index) => { const like = (index) => {
feeds.value[index].likes += 1 feeds.value[index].likes += 1;
} };
const comment = (index) => { const comment = (index) => {
uni.showToast({ title: '评论功能开发中~', icon: 'none' }) uni.showToast({ title: "评论功能开发中~", icon: "none" });
} };
const share = () => { const share = () => {
uni.showShareMenu && uni.showShareMenu() uni.showShareMenu && uni.showShareMenu();
} };
onShareAppMessage(() => { onShareAppMessage(() => {
return { return {
@@ -180,24 +239,26 @@ onShareAppMessage(() => {
}; };
}); });
onShareTimeline(() => { onShareTimeline(async () => {
const shareToken = await getShareToken("spring_timeline");
return { return {
title: "2026 丙午马年,送你一份新春祝福 🎊", title: "2026 丙午马年,送你一份新春祝福 🎊",
query: `shareToken=${shareToken}`,
imageUrl: imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };
}); });
const createGreeting = () => { const createGreeting = () => {
uni.showToast({ title: '去发布祝福~', icon: 'none' }) uni.showToast({ title: "去发布祝福~", icon: "none" });
} };
onPullDownRefresh(() => { onPullDownRefresh(() => {
setTimeout(() => { setTimeout(() => {
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
uni.showToast({ title: '已为你更新内容', icon: 'success' }) uni.showToast({ title: "已为你更新内容", icon: "success" });
}, 600) }, 600);
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -224,7 +285,9 @@ onPullDownRefresh(() => {
border-radius: 999rpx; border-radius: 999rpx;
padding: 8rpx 16rpx; padding: 8rpx 16rpx;
font-size: 22rpx; font-size: 22rpx;
.badge-dot { margin-right: 8rpx; } .badge-dot {
margin-right: 8rpx;
}
} }
.hero-title { .hero-title {
margin-top: 24rpx; margin-top: 24rpx;
@@ -283,10 +346,14 @@ onPullDownRefresh(() => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.feature-title { .feature-title {
font-size: 28rpx; color: #222; font-weight: 600; font-size: 28rpx;
color: #222;
font-weight: 600;
} }
.feature-sub { .feature-sub {
font-size: 22rpx; color: #888; margin-top: 8rpx; font-size: 22rpx;
color: #888;
margin-top: 8rpx;
} }
} }
} }
@@ -300,10 +367,22 @@ onPullDownRefresh(() => {
align-items: center; align-items: center;
padding: 0 24rpx; padding: 0 24rpx;
.section-bar { .section-bar {
width: 10rpx; height: 30rpx; border-radius: 6rpx; background: #ff3b30; margin-right: 12rpx; width: 10rpx;
height: 30rpx;
border-radius: 6rpx;
background: #ff3b30;
margin-right: 12rpx;
}
.section-title {
font-size: 28rpx;
color: #222;
flex: 1;
font-weight: 600;
}
.section-more {
font-size: 24rpx;
color: #999;
} }
.section-title { font-size: 28rpx; color: #222; flex: 1; font-weight: 600; }
.section-more { font-size: 24rpx; color: #999; }
} }
} }
@@ -312,7 +391,9 @@ onPullDownRefresh(() => {
margin-top: 16rpx; margin-top: 16rpx;
padding-left: 24rpx; padding-left: 24rpx;
} }
.cards-wrap { display: flex; } .cards-wrap {
display: flex;
}
.use-card { .use-card {
width: 260rpx; width: 260rpx;
flex-shrink: 0; flex-shrink: 0;
@@ -322,28 +403,72 @@ onPullDownRefresh(() => {
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.06); box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.06);
overflow: hidden; overflow: hidden;
.use-cover { width: 100%; height: 200rpx; } .use-cover {
.use-info { padding: 16rpx; } width: 100%;
.use-title { font-size: 26rpx; color: #333; font-weight: 600; } height: 200rpx;
.use-sub { font-size: 22rpx; color: #999; margin-top: 6rpx; } }
.use-info {
padding: 16rpx;
}
.use-title {
font-size: 26rpx;
color: #333;
font-weight: 600;
}
.use-sub {
font-size: 22rpx;
color: #999;
margin-top: 6rpx;
}
} }
/* 已移除:.cards-scroll、feed-list、feed-item、feed-header、feed-avatar、feed-user、feed-name、feed-time、feed-content、feed-text、feed-image、feed-actions、.see-more */ /* 已移除:.cards-scroll、feed-list、feed-item、feed-header、feed-avatar、feed-user、feed-name、feed-time、feed-content、feed-text、feed-image、feed-actions、.see-more */
.feed-list { padding: 0 24rpx; } .feed-list {
padding: 0 24rpx;
}
.feed-item { .feed-item {
padding: 22rpx 0; padding: 22rpx 0;
border-bottom: 1rpx solid #f0f0f0; border-bottom: 1rpx solid #f0f0f0;
} }
.feed-header { display: flex; align-items: center; } .feed-header {
.feed-avatar { display: flex;
width: 64rpx; height: 64rpx; border-radius: 50%; margin-right: 16rpx; align-items: center;
}
.feed-avatar {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
margin-right: 16rpx;
}
.feed-user {
display: flex;
flex-direction: column;
}
.feed-name {
font-size: 26rpx;
color: #333;
font-weight: 600;
}
.feed-time {
font-size: 22rpx;
color: #999;
margin-top: 6rpx;
}
.feed-content {
margin-top: 12rpx;
}
.feed-text {
font-size: 26rpx;
color: #333;
line-height: 1.6;
}
.feed-image {
width: 100%;
height: 280rpx;
border-radius: 12rpx;
margin-top: 12rpx;
background: #f6f6f6;
} }
.feed-user { display: flex; flex-direction: column; }
.feed-name { font-size: 26rpx; color: #333; font-weight: 600; }
.feed-time { font-size: 22rpx; color: #999; margin-top: 6rpx; }
.feed-content { margin-top: 12rpx; }
.feed-text { font-size: 26rpx; color: #333; line-height: 1.6; }
.feed-image { width: 100%; height: 280rpx; border-radius: 12rpx; margin-top: 12rpx; background: #f6f6f6; }
.feed-actions { .feed-actions {
margin-top: 12rpx; margin-top: 12rpx;
display: flex; display: flex;
@@ -352,26 +477,38 @@ onPullDownRefresh(() => {
align-items: center; align-items: center;
margin-right: 24rpx; margin-right: 24rpx;
color: #666; color: #666;
.icon { margin-right: 8rpx; } .icon {
margin-right: 8rpx;
}
} }
} }
.see-more { .see-more {
margin: 24rpx; padding: 18rpx 0; text-align: center; margin: 24rpx;
color: #999; font-size: 24rpx; padding: 18rpx 0;
text-align: center;
color: #999;
font-size: 24rpx;
} }
/* 发布悬浮按钮 */ /* 发布悬浮按钮 */
.fab { .fab {
position: fixed; position: fixed;
left: 50%; transform: translateX(-50%); left: 50%;
transform: translateX(-50%);
bottom: 60rpx; bottom: 60rpx;
width: 100rpx; height: 100rpx; width: 100rpx;
height: 100rpx;
border-radius: 50%; border-radius: 50%;
background: #ff3b30; background: #ff3b30;
color: #fff; color: #fff;
display: flex; align-items: center; justify-content: center; display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 12rpx 24rpx rgba(255, 59, 48, 0.4); box-shadow: 0 12rpx 24rpx rgba(255, 59, 48, 0.4);
.fab-plus { font-size: 48rpx; line-height: 1; } .fab-plus {
font-size: 48rpx;
line-height: 1;
}
} }
</style> </style>

View File

@@ -129,7 +129,7 @@ import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
import { getBavBarHeight } from "@/utils/system"; import { getBavBarHeight } from "@/utils/system";
import { getPageDetail } from "@/api/system"; import { getPageDetail } from "@/api/system";
import { getWallpaperRecommendList } from "@/api/wallpaper"; import { getWallpaperRecommendList } from "@/api/wallpaper";
import { saveViewRequest } from "@/utils/common.js"; import { getShareToken, saveViewRequest } from "@/utils/common.js";
const navHeight = getBavBarHeight(); const navHeight = getBavBarHeight();
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight; const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
@@ -148,20 +148,22 @@ onLoad(async (options) => {
fetchRecommend(); fetchRecommend();
}); });
onShareAppMessage(() => { onShareAppMessage(async () => {
const token = await getShareToken("wallpaper_detail", detailData.value?.id);
return { return {
title: "快来看看我刚领到的新年精美壁纸 🖼", title: "快来看看我刚领到的新年精美壁纸 🖼",
path: `/pages/wallpaper/detail?shareToken=${shareToken.value}`, path: `/pages/wallpaper/detail?shareToken=${token || ""}`,
imageUrl: imageUrl:
detailData.value?.imageUrl || detailData.value?.imageUrl ||
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };
}); });
onShareTimeline(() => { onShareTimeline(async () => {
const token = await getShareToken("wallpaper_timeline", detailData.value?.id);
return { return {
title: "快来看看我刚领到的新年精美壁纸 🖼", title: "快来看看我刚领到的新年精美壁纸 🖼",
query: `shareToken=${shareToken.value}`, query: `shareToken=${token}`,
imageUrl: imageUrl:
detailData.value?.imageUrl || detailData.value?.imageUrl ||
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -171,7 +173,7 @@ onShareTimeline(() => {
const fetchDetail = async () => { const fetchDetail = async () => {
try { try {
const res = await getPageDetail(shareToken.value); const res = await getPageDetail(shareToken.value);
saveViewRequest(shareToken.value, "wallpaper_download", res.id); saveViewRequest(shareToken.value, "wallpaper_detail", res.id);
if (res) { if (res) {
detailData.value = res; detailData.value = res;
} }

View File

@@ -134,9 +134,11 @@ onShareAppMessage(async (options) => {
} }
}); });
onShareTimeline(() => { onShareTimeline(async () => {
const shareToken = await getShareToken("wallpaper_timeline");
return { return {
title: "精选新年壁纸,让手机也过年 🖼", title: "精选新年壁纸,让手机也过年 🖼",
query: `shareToken=${shareToken}`,
imageUrl: imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png", "https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
}; };