fix: user deduct point
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { request } from "@/utils/request.js";
|
||||
import { useUserStore } from "@/stores/user";
|
||||
const userStore = useUserStore();
|
||||
|
||||
export const abilityCheck = async (scene) => {
|
||||
return request({
|
||||
@@ -23,11 +25,16 @@ export const getPageDetail = async (shareToken) => {
|
||||
};
|
||||
|
||||
export const getShareReward = async (data) => {
|
||||
return request({
|
||||
const res = await request({
|
||||
url: "/api/reward/share",
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
console.log("getShareReward res", res);
|
||||
if (res && res.success) {
|
||||
userStore.fetchUserAssets();
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
export const saveRecord = async (data) => {
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
<uni-icons type="sun-filled" size="24" color="#ff9800" />
|
||||
<text class="header-title">{{ greetingTitle }}</text>
|
||||
</view>
|
||||
<view class="streak-badge">
|
||||
<!-- <view class="streak-badge">
|
||||
<text>已连续问候</text>
|
||||
<text class="streak-count">{{ streakDays }}</text>
|
||||
<text>天</text>
|
||||
<text class="fire-icon">🔥</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- Main Card -->
|
||||
@@ -86,7 +86,7 @@
|
||||
</view>
|
||||
|
||||
<!-- Hot List -->
|
||||
<view class="hot-list-section">
|
||||
<!-- <view class="hot-list-section">
|
||||
<view class="section-title-row">
|
||||
<view class="title-bar"></view>
|
||||
<text class="section-title">今日最热榜单</text>
|
||||
@@ -125,7 +125,7 @@
|
||||
<uni-icons type="right" size="16" color="#ccc" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- Bottom Actions -->
|
||||
<view class="bottom-actions safe-area-bottom">
|
||||
|
||||
@@ -595,11 +595,7 @@ const handleAdReward = async (token) => {
|
||||
|
||||
onShareAppMessage(async () => {
|
||||
const shareToken = await getShareToken("index");
|
||||
getShareReward().then((res) => {
|
||||
if (isLoggedIn && res && res.success) {
|
||||
userStore.fetchUserAssets();
|
||||
}
|
||||
});
|
||||
getShareReward();
|
||||
return {
|
||||
title: "开启你的2026新春好运!",
|
||||
path: "/pages/index/index?shareToken=" + shareToken,
|
||||
|
||||
@@ -57,6 +57,7 @@ export const useUserStore = defineStore("user", {
|
||||
},
|
||||
async fetchUserAssets() {
|
||||
try {
|
||||
console.log("fetchUserAssets userInfo", this.userInfo);
|
||||
if (!this?.userInfo?.id) return;
|
||||
const res = await getUserAsset();
|
||||
if (res) {
|
||||
|
||||
Reference in New Issue
Block a user