fix: user deduct point

This commit is contained in:
zzc
2026-03-10 10:21:43 +08:00
parent 210f913aed
commit 14d8e0b349
4 changed files with 14 additions and 10 deletions

View File

@@ -1,4 +1,6 @@
import { request } from "@/utils/request.js"; import { request } from "@/utils/request.js";
import { useUserStore } from "@/stores/user";
const userStore = useUserStore();
export const abilityCheck = async (scene) => { export const abilityCheck = async (scene) => {
return request({ return request({
@@ -23,11 +25,16 @@ export const getPageDetail = async (shareToken) => {
}; };
export const getShareReward = async (data) => { export const getShareReward = async (data) => {
return request({ const res = await request({
url: "/api/reward/share", url: "/api/reward/share",
method: "POST", method: "POST",
data, data,
}); });
console.log("getShareReward res", res);
if (res && res.success) {
userStore.fetchUserAssets();
}
return res;
}; };
export const saveRecord = async (data) => { export const saveRecord = async (data) => {

View File

@@ -8,12 +8,12 @@
<uni-icons type="sun-filled" size="24" color="#ff9800" /> <uni-icons type="sun-filled" size="24" color="#ff9800" />
<text class="header-title">{{ greetingTitle }}</text> <text class="header-title">{{ greetingTitle }}</text>
</view> </view>
<view class="streak-badge"> <!-- <view class="streak-badge">
<text>已连续问候</text> <text>已连续问候</text>
<text class="streak-count">{{ streakDays }}</text> <text class="streak-count">{{ streakDays }}</text>
<text></text> <text></text>
<text class="fire-icon">🔥</text> <text class="fire-icon">🔥</text>
</view> </view> -->
</view> </view>
<!-- Main Card --> <!-- Main Card -->
@@ -86,7 +86,7 @@
</view> </view>
<!-- Hot List --> <!-- Hot List -->
<view class="hot-list-section"> <!-- <view class="hot-list-section">
<view class="section-title-row"> <view class="section-title-row">
<view class="title-bar"></view> <view class="title-bar"></view>
<text class="section-title">今日最热榜单</text> <text class="section-title">今日最热榜单</text>
@@ -125,7 +125,7 @@
<uni-icons type="right" size="16" color="#ccc" /> <uni-icons type="right" size="16" color="#ccc" />
</view> </view>
</view> </view>
</view> </view> -->
<!-- Bottom Actions --> <!-- Bottom Actions -->
<view class="bottom-actions safe-area-bottom"> <view class="bottom-actions safe-area-bottom">

View File

@@ -595,11 +595,7 @@ const handleAdReward = async (token) => {
onShareAppMessage(async () => { onShareAppMessage(async () => {
const shareToken = await getShareToken("index"); const shareToken = await getShareToken("index");
getShareReward().then((res) => { getShareReward();
if (isLoggedIn && res && res.success) {
userStore.fetchUserAssets();
}
});
return { return {
title: "开启你的2026新春好运", title: "开启你的2026新春好运",
path: "/pages/index/index?shareToken=" + shareToken, path: "/pages/index/index?shareToken=" + shareToken,

View File

@@ -57,6 +57,7 @@ export const useUserStore = defineStore("user", {
}, },
async fetchUserAssets() { async fetchUserAssets() {
try { try {
console.log("fetchUserAssets userInfo", this.userInfo);
if (!this?.userInfo?.id) return; if (!this?.userInfo?.id) return;
const res = await getUserAsset(); const res = await getUserAsset();
if (res) { if (res) {