hookehuyr

fix(api): 修正积分接口路径参数错误

修复积分相关接口路径中错误的参数名称,将'a=points'改为'a=point'以匹配后端接口
同时优化ActivityHistoryPage中的活动数据处理逻辑,增加activityInfo变量存储活动数据
1 /* 1 /*
2 * @Date: 2025-12-24 12:26:27 2 * @Date: 2025-12-24 12:26:27
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-12-24 18:36:29 4 + * @LastEditTime: 2025-12-26 11:15:29
5 * @FilePath: /mlaj/src/api/points.js 5 * @FilePath: /mlaj/src/api/points.js
6 * @Description: 积分相关接口 6 * @Description: 积分相关接口
7 */ 7 */
8 import { fn, fetch } from './fn'; 8 import { fn, fetch } from './fn';
9 9
10 const Api = { 10 const Api = {
11 - POINTS_LIST: '/srv/?a=points&t=list', 11 + POINTS_LIST: '/srv/?a=point&t=list',
12 - OLD_ACTIVITY_BATCH_ACTIVITY_REGISTRATION: '/srv/?a=points&t=old_activity_batch_activity_registration', 12 + OLD_ACTIVITY_BATCH_ACTIVITY_REGISTRATION: '/srv/?a=point&t=old_activity_batch_activity_registration',
13 } 13 }
14 14
15 /** 15 /**
......
...@@ -142,7 +142,7 @@ const handleCollectCoins = async () => { ...@@ -142,7 +142,7 @@ const handleCollectCoins = async () => {
142 name: userInfo.name || '', 142 name: userInfo.name || '',
143 mobile: userInfo.phone || '', 143 mobile: userInfo.phone || '',
144 idcard: userInfo.idCard || '', 144 idcard: userInfo.idCard || '',
145 - old_activity_data: campaign_info.value 145 + old_activity_data: activityInfo.value
146 }) 146 })
147 if (res.code) { 147 if (res.code) {
148 showToast({ 148 showToast({
...@@ -176,6 +176,7 @@ const handleSubmitMissing = () => { ...@@ -176,6 +176,7 @@ const handleSubmitMissing = () => {
176 176
177 const userInfo = ref({}); 177 const userInfo = ref({});
178 const campaign_info = ref([]); 178 const campaign_info = ref([]);
179 +const activityInfo = ref({})
179 180
180 // 记录日期 181 // 记录日期
181 const recordDate = ref('') 182 const recordDate = ref('')
...@@ -193,11 +194,11 @@ onMounted(async () => { ...@@ -193,11 +194,11 @@ onMounted(async () => {
193 idcard: userInfo.idCard 194 idcard: userInfo.idCard
194 }) 195 })
195 if (activityRes.code) { 196 if (activityRes.code) {
197 + activityInfo.value = activityRes.data || {}
196 // 获取历史列表数据 198 // 获取历史列表数据
197 - const campaign_info = activityRes.data?.campaign_info || [] 199 + campaign_info.value = activityRes.data?.campaign_info || []
198 - if (campaign_info.length) { 200 + if (campaign_info.value.length) {
199 - campaign_info.value = campaign_info; 201 + activities.value = campaign_info.value.map(item => ({
200 - activities.value = campaign_info.map(item => ({
201 id: item.campaign_id || 0, 202 id: item.campaign_id || 0,
202 stu_uid: item.stu_uid || '', 203 stu_uid: item.stu_uid || '',
203 title: item.campaign_name || '', 204 title: item.campaign_name || '',
...@@ -221,9 +222,9 @@ onMounted(async () => { ...@@ -221,9 +222,9 @@ onMounted(async () => {
221 const activityRes = await searchOldActivityAPI() 222 const activityRes = await searchOldActivityAPI()
222 if (activityRes.code) { 223 if (activityRes.code) {
223 // 获取历史列表数据 224 // 获取历史列表数据
224 - const campaign_info = activityRes.data?.campaign_info || [] 225 + campaign_info.value = activityRes.data?.campaign_info || []
225 - if (campaign_info.length) { 226 + if (campaign_info.value.length) {
226 - activities.value = campaign_info.map(item => ({ 227 + activities.value = campaign_info.value.map(item => ({
227 id: item.campaign_id || 0, 228 id: item.campaign_id || 0,
228 stu_uid: item.stu_uid || '', 229 stu_uid: item.stu_uid || '',
229 title: item.campaign_name || '', 230 title: item.campaign_name || '',
......