hookehuyr

feat(recall): 添加补充信息获取和编辑功能

添加获取和编辑补充信息的API接口
在活动历史页面实现补充信息的获取和提交功能
/*
* @Date: 2025-12-19 10:43:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-24 17:19:47
* @LastEditTime: 2025-12-26 11:44:09
* @FilePath: /mlaj/src/api/recall_users.js
* @Description: 引入外部接口, 召回旧用户相关接口
*/
......@@ -13,6 +13,8 @@ const Api = {
USER_SEARCH_OLD_ACTIVITY: '/srv/?a=desk_calendar&t=search_old_activity',
USER_GET_POSTER: '/srv/?a=desk_calendar&t=get_poster',
USER_EDIT_POSTER: '/srv/?a=desk_calendar&t=edit_poster',
USER_GET_SUPPLEMENT: '/srv/?a=desk_calendar&t=get_supplement',
USER_EDIT_SUPPLEMENT: '/srv/?a=desk_calendar&t=edit_supplement',
}
/**
......@@ -55,3 +57,15 @@ export const getPosterAPI = (params) => fn(fetch.get(Api.USER_GET_POSTER, params
* @param: background_image 海报背景图URL
*/
export const editPosterAPI = (params) => fn(fetch.post(Api.USER_EDIT_POSTER, params));
/**
* @description: 查询补充信息
* @return: data: { note 补充说明 }
*/
export const getSupplementAPI = (params) => fn(fetch.get(Api.USER_GET_SUPPLEMENT, params));
/**
* @description: 编辑补充信息
* @param: note 补充说明
*/
export const editSupplementAPI = (params) => fn(fetch.post(Api.USER_EDIT_SUPPLEMENT, params));
......
......@@ -107,7 +107,7 @@ import { useRouter } from 'vue-router'
import { useTitle } from '@vueuse/core'
import { showToast } from 'vant'
import { userInfoAPI, searchOldActivityAPI } from '@/api/recall_users'
import { userInfoAPI, searchOldActivityAPI, getSupplementAPI, editSupplementAPI } from '@/api/recall_users'
import { oldActivityBatchActivityRegistrationAPI } from '@/api/points'
const historyBg = 'https://cdn.ipadbiz.cn/mlaj/recall/img/history_bg@2x.png'
......@@ -159,19 +159,28 @@ const handleCollectCoins = async () => {
}
}
const handleSubmitMissing = () => {
if (!missingInfo.value.trim()) {
showToast('请输入活动信息')
const handleSubmitMissing = async () => {
if (!missingInfo.value) {
showToast('请输入补充信息')
return
}
showToast({
message: '感谢您为我们找回偏轨的星球活动',
icon: 'success'
const res = await editSupplementAPI({
note: missingInfo.value
})
showMissingPopup.value = false
missingInfo.value = ''
if (res.code) {
showToast('提交成功')
showMissingPopup.value = false
}
}
// 获取补充信息
const fetchSupplementInfo = async () => {
const res = await getSupplementAPI()
if (res.code && res.data && res.data.note) {
missingInfo.value = res.data.note
}
}
const userInfo = ref({});
......@@ -182,6 +191,9 @@ const activityInfo = ref({})
const recordDate = ref('')
onMounted(async () => {
// 获取补充信息
fetchSupplementInfo()
// 从缓存获取用户信息
const cachedUserInfo = localStorage.getItem('cached_user_info')
if (cachedUserInfo) {
......