feat(recall): 添加补充信息获取和编辑功能
添加获取和编辑补充信息的API接口 在活动历史页面实现补充信息的获取和提交功能
Showing
2 changed files
with
35 additions
and
9 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-12-19 10:43:09 | 2 | * @Date: 2025-12-19 10:43:09 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-12-24 17:19:47 | 4 | + * @LastEditTime: 2025-12-26 11:44:09 |
| 5 | * @FilePath: /mlaj/src/api/recall_users.js | 5 | * @FilePath: /mlaj/src/api/recall_users.js |
| 6 | * @Description: 引入外部接口, 召回旧用户相关接口 | 6 | * @Description: 引入外部接口, 召回旧用户相关接口 |
| 7 | */ | 7 | */ |
| ... | @@ -13,6 +13,8 @@ const Api = { | ... | @@ -13,6 +13,8 @@ const Api = { |
| 13 | USER_SEARCH_OLD_ACTIVITY: '/srv/?a=desk_calendar&t=search_old_activity', | 13 | USER_SEARCH_OLD_ACTIVITY: '/srv/?a=desk_calendar&t=search_old_activity', |
| 14 | USER_GET_POSTER: '/srv/?a=desk_calendar&t=get_poster', | 14 | USER_GET_POSTER: '/srv/?a=desk_calendar&t=get_poster', |
| 15 | USER_EDIT_POSTER: '/srv/?a=desk_calendar&t=edit_poster', | 15 | USER_EDIT_POSTER: '/srv/?a=desk_calendar&t=edit_poster', |
| 16 | + USER_GET_SUPPLEMENT: '/srv/?a=desk_calendar&t=get_supplement', | ||
| 17 | + USER_EDIT_SUPPLEMENT: '/srv/?a=desk_calendar&t=edit_supplement', | ||
| 16 | } | 18 | } |
| 17 | 19 | ||
| 18 | /** | 20 | /** |
| ... | @@ -55,3 +57,15 @@ export const getPosterAPI = (params) => fn(fetch.get(Api.USER_GET_POSTER, params | ... | @@ -55,3 +57,15 @@ export const getPosterAPI = (params) => fn(fetch.get(Api.USER_GET_POSTER, params |
| 55 | * @param: background_image 海报背景图URL | 57 | * @param: background_image 海报背景图URL |
| 56 | */ | 58 | */ |
| 57 | export const editPosterAPI = (params) => fn(fetch.post(Api.USER_EDIT_POSTER, params)); | 59 | export const editPosterAPI = (params) => fn(fetch.post(Api.USER_EDIT_POSTER, params)); |
| 60 | + | ||
| 61 | +/** | ||
| 62 | + * @description: 查询补充信息 | ||
| 63 | + * @return: data: { note 补充说明 } | ||
| 64 | + */ | ||
| 65 | +export const getSupplementAPI = (params) => fn(fetch.get(Api.USER_GET_SUPPLEMENT, params)); | ||
| 66 | + | ||
| 67 | +/** | ||
| 68 | + * @description: 编辑补充信息 | ||
| 69 | + * @param: note 补充说明 | ||
| 70 | + */ | ||
| 71 | +export const editSupplementAPI = (params) => fn(fetch.post(Api.USER_EDIT_SUPPLEMENT, params)); | ... | ... |
| ... | @@ -107,7 +107,7 @@ import { useRouter } from 'vue-router' | ... | @@ -107,7 +107,7 @@ import { useRouter } from 'vue-router' |
| 107 | import { useTitle } from '@vueuse/core' | 107 | import { useTitle } from '@vueuse/core' |
| 108 | import { showToast } from 'vant' | 108 | import { showToast } from 'vant' |
| 109 | 109 | ||
| 110 | -import { userInfoAPI, searchOldActivityAPI } from '@/api/recall_users' | 110 | +import { userInfoAPI, searchOldActivityAPI, getSupplementAPI, editSupplementAPI } from '@/api/recall_users' |
| 111 | import { oldActivityBatchActivityRegistrationAPI } from '@/api/points' | 111 | import { oldActivityBatchActivityRegistrationAPI } from '@/api/points' |
| 112 | 112 | ||
| 113 | const historyBg = 'https://cdn.ipadbiz.cn/mlaj/recall/img/history_bg@2x.png' | 113 | const historyBg = 'https://cdn.ipadbiz.cn/mlaj/recall/img/history_bg@2x.png' |
| ... | @@ -159,19 +159,28 @@ const handleCollectCoins = async () => { | ... | @@ -159,19 +159,28 @@ const handleCollectCoins = async () => { |
| 159 | } | 159 | } |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | -const handleSubmitMissing = () => { | 162 | +const handleSubmitMissing = async () => { |
| 163 | - if (!missingInfo.value.trim()) { | 163 | + if (!missingInfo.value) { |
| 164 | - showToast('请输入活动信息') | 164 | + showToast('请输入补充信息') |
| 165 | return | 165 | return |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | - showToast({ | 168 | + const res = await editSupplementAPI({ |
| 169 | - message: '感谢您为我们找回偏轨的星球活动', | 169 | + note: missingInfo.value |
| 170 | - icon: 'success' | ||
| 171 | }) | 170 | }) |
| 172 | 171 | ||
| 172 | + if (res.code) { | ||
| 173 | + showToast('提交成功') | ||
| 173 | showMissingPopup.value = false | 174 | showMissingPopup.value = false |
| 174 | - missingInfo.value = '' | 175 | + } |
| 176 | +} | ||
| 177 | + | ||
| 178 | +// 获取补充信息 | ||
| 179 | +const fetchSupplementInfo = async () => { | ||
| 180 | + const res = await getSupplementAPI() | ||
| 181 | + if (res.code && res.data && res.data.note) { | ||
| 182 | + missingInfo.value = res.data.note | ||
| 183 | + } | ||
| 175 | } | 184 | } |
| 176 | 185 | ||
| 177 | const userInfo = ref({}); | 186 | const userInfo = ref({}); |
| ... | @@ -182,6 +191,9 @@ const activityInfo = ref({}) | ... | @@ -182,6 +191,9 @@ const activityInfo = ref({}) |
| 182 | const recordDate = ref('') | 191 | const recordDate = ref('') |
| 183 | 192 | ||
| 184 | onMounted(async () => { | 193 | onMounted(async () => { |
| 194 | + // 获取补充信息 | ||
| 195 | + fetchSupplementInfo() | ||
| 196 | + | ||
| 185 | // 从缓存获取用户信息 | 197 | // 从缓存获取用户信息 |
| 186 | const cachedUserInfo = localStorage.getItem('cached_user_info') | 198 | const cachedUserInfo = localStorage.getItem('cached_user_info') |
| 187 | if (cachedUserInfo) { | 199 | if (cachedUserInfo) { | ... | ... |
-
Please register or login to post a comment