业务逻辑完善

This commit is contained in:
kron
2026-01-09 14:10:23 +08:00
parent ddf0dafe08
commit 937fce1a35
3 changed files with 19 additions and 11 deletions

View File

@@ -31,6 +31,7 @@ watch(
); );
const onClick = async () => { const onClick = async () => {
if (!user.value.id) return;
if (user.value.id === props.data.id) { if (user.value.id === props.data.id) {
return uni.navigateTo({ return uni.navigateTo({
url: "/pages/my-like-list", url: "/pages/my-like-list",

View File

@@ -7,6 +7,10 @@ import { capsuleHeight } from "@/util";
import { wxShare } from "@/util"; import { wxShare } from "@/util";
import { sharePointData } from "@/canvas"; import { sharePointData } from "@/canvas";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const { user } = storeToRefs(useStore());
const list = ref([]); const list = ref([]);
const mine = ref({ const mine = ref({
averageRing: 0, averageRing: 0,
@@ -28,12 +32,6 @@ const shareImage = async () => {
await wxShare("shareCanvas"); await wxShare("shareCanvas");
loading.value = false; loading.value = false;
}; };
// onMounted(() => {
// setTimeout(() => {
// shareImage();
// }, 1000);
// });
</script> </script>
<template> <template>
@@ -80,7 +78,7 @@ const shareImage = async () => {
<text>本周箭数</text> <text>本周箭数</text>
<text>消耗</text> <text>消耗</text>
</view> </view>
<view class="data-list" :style="{ marginBottom: '20rpx' }"> <view class="data-list" :style="{ marginBottom: '20rpx' }" v-if="user.id">
<PointRankItem :data="mine" :borderWidth="0" /> <PointRankItem :data="mine" :borderWidth="0" />
</view> </view>
<view <view
@@ -95,7 +93,12 @@ const shareImage = async () => {
<PointRankItem v-for="item in list" :key="item.id" :data="item" /> <PointRankItem v-for="item in list" :key="item.id" :data="item" />
</ScrollList> </ScrollList>
</view> </view>
<button hover-class="none" class="share-btn" @click="shareImage"> <button
hover-class="none"
class="share-btn"
@click="shareImage"
v-if="user.id"
>
<image src="../static/share-icon.png" mode="widthFix" /> <image src="../static/share-icon.png" mode="widthFix" />
</button> </button>
<canvas <canvas

View File

@@ -46,9 +46,13 @@ const canvasVisible = ref(false); // 控制canvas显示状态
const strength = ref(0); const strength = ref(0);
const toRecordPage = () => { const toRecordPage = () => {
uni.navigateTo({ if (user.value.id) {
url: "/pages/point-book-list", uni.navigateTo({
}); url: "/pages/point-book-list",
});
} else {
showModal.value = true;
}
}; };
const toRankPage = () => { const toRankPage = () => {