个人资料,简历

This commit is contained in:
2026-07-08 18:58:27 +08:00
parent 851310a901
commit c94a96d14e
19 changed files with 1142 additions and 183 deletions
+23 -7
View File
@@ -61,13 +61,14 @@
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ref, computed, watch } from 'vue'
import { useStore } from 'vuex'
import { ElMessage } from 'element-plus'
import MemberDialog from './MemberDialog.vue'
import { fetchInviteStats } from '@/api/member'
/** 组件 Props */
defineProps<{ modelValue: boolean }>()
const props = defineProps<{ modelValue: boolean }>()
/** 组件 Emits */
defineEmits<{
@@ -79,17 +80,32 @@ const store = useStore()
/** 会员弹窗显示状态 */
const showMemberDialog = ref(false)
/** 累计获得会员天数(暂用模拟数据) */
const totalDays = ref(7)
/** 累计获得会员天数 */
const totalDays = ref(0)
/** 累计邀请好友数(暂用模拟数据) */
const totalFriends = ref(1)
/** 累计邀请好友数 */
const totalFriends = ref(0)
/**
* 弹窗打开时请求邀请统计接口
*/
watch(() => props.modelValue, async (val) => {
if (val) {
try {
const res = await fetchInviteStats()
totalFriends.value = res.data?.inviteCount ?? 0
totalDays.value = res.data?.rewardDays ?? 0
} catch (e) {
console.error('获取邀请统计失败', e)
}
}
})
/** 用户邀请码 — 从全局 store 读取 */
const inviteCode = computed(() => store.state.userInfo?.inviteCode || 'NOVA2026')
/** 邀请链接地址 */
const inviteUrl = computed(() => `https://offerpai.com/invite?code=${inviteCode.value}`)
const inviteUrl = computed(() => `https://www.offerpai.com.cn/invite?code=${inviteCode.value}`)
/** 复制链接到剪贴板 */
async function handleCopy() {