hookehuyr

fix(recall): 修复志愿者数量字段名不一致问题并调整活动历史页面显示

修正timeline.vue中volunteer_qty字段名为volunteers_qty以保持一致性
调整ActivityHistoryPage.vue的日期显示格式和金额显示逻辑
优化海报生成路由参数使用campaign_id为id
...@@ -44,12 +44,13 @@ ...@@ -44,12 +44,13 @@
44 44
45 <div class="flex justify-between items-center text-xs text-[#666] mb-2"> 45 <div class="flex justify-between items-center text-xs text-[#666] mb-2">
46 <span>单价: ¥{{ item.price.toFixed(2) }}/人</span> 46 <span>单价: ¥{{ item.price.toFixed(2) }}/人</span>
47 - <span>人数: {{ item.count }}</span> 47 + <!-- <span>人数: {{ item.count }}</span> -->
48 + <span class="text-[#FF3B30] font-bold">实付金额: ¥{{ item.price.toFixed(2) }}</span>
48 </div> 49 </div>
49 50
50 <div class="flex justify-between items-center text-xs text-[#666] mb-4"> 51 <div class="flex justify-between items-center text-xs text-[#666] mb-4">
51 - <span>下单时间: {{ item.date }}</span> 52 + <!-- <span>下单时间: {{ item.date }}</span> -->
52 - <span class="text-[#FF3B30] font-bold">实付金额: ¥{{ item.total.toFixed(0) }}</span> 53 + <!-- <span class="text-[#FF3B30] font-bold">实付金额: ¥{{ item.total.toFixed(0) }}</span> -->
53 </div> 54 </div>
54 55
55 <div class="flex justify-end"> 56 <div class="flex justify-end">
...@@ -123,7 +124,12 @@ const missingInfo = ref('') ...@@ -123,7 +124,12 @@ const missingInfo = ref('')
123 124
124 // 处理生成海报 125 // 处理生成海报
125 const handleGeneratePoster = (item) => { 126 const handleGeneratePoster = (item) => {
126 - router.push({ path: '/recall/poster', query: { title: item.title, stu_uid: item.stu_uid, campaign_id: item.campaign_id } }) 127 + router.push({
128 + path: '/recall/poster',
129 + query: {
130 + title: item.title, stu_uid: item.stu_uid, campaign_id: item.id
131 + }
132 + })
127 } 133 }
128 134
129 const handleCollectCoins = async () => { 135 const handleCollectCoins = async () => {
...@@ -197,12 +203,16 @@ onMounted(async () => { ...@@ -197,12 +203,16 @@ onMounted(async () => {
197 title: item.campaign_name || '', 203 title: item.campaign_name || '',
198 price: item.fee_stu || 0, 204 price: item.fee_stu || 0,
199 count: item.stu_cnt || 0, 205 count: item.stu_cnt || 0,
200 - date: item.create_time?.substring(0, 10) || '', 206 + date: item.campaign_year|| '',
201 total: item.fee_stu * item.stu_cnt || 0 207 total: item.fee_stu * item.stu_cnt || 0
202 })) 208 }))
203 // 遍历日期把列表date字段从小到大排序, 获取到其中日期段 比如 2020-2025 209 // 遍历日期把列表date字段从小到大排序, 获取到其中日期段 比如 2020-2025
204 const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b)) 210 const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b))
205 - recordDate.value = sortedDates[0]?.substring(0, 4) + '-' + sortedDates[sortedDates.length - 1]?.substring(0, 4) || '' 211 + if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) {
212 + recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || ''
213 + } else {
214 + recordDate.value = sortedDates[0] || ''
215 + }
206 } 216 }
207 } 217 }
208 } 218 }
...@@ -219,11 +229,15 @@ onMounted(async () => { ...@@ -219,11 +229,15 @@ onMounted(async () => {
219 title: item.campaign_name || '', 229 title: item.campaign_name || '',
220 price: item.fee_stu || 0, 230 price: item.fee_stu || 0,
221 count: item.stu_cnt || 0, 231 count: item.stu_cnt || 0,
222 - date: item.create_time?.substring(0, 10) || '', 232 + date: item.campaign_year || '',
223 total: item.fee_stu * item.stu_cnt || 0 233 total: item.fee_stu * item.stu_cnt || 0
224 })); 234 }));
225 const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b)) 235 const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b))
226 - recordDate.value = sortedDates[0]?.substring(0, 4) + '-' + sortedDates[sortedDates.length - 1]?.substring(0, 4) || '' 236 + if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) {
237 + recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || ''
238 + } else {
239 + recordDate.value = sortedDates[0] || ''
240 + }
227 } 241 }
228 } 242 }
229 } 243 }
......
...@@ -178,7 +178,7 @@ onMounted(async () => { ...@@ -178,7 +178,7 @@ onMounted(async () => {
178 }) 178 })
179 if (res.code) { 179 if (res.code) {
180 activityCount.value = res.data?.payment_qty || 0 180 activityCount.value = res.data?.payment_qty || 0
181 - volunteerCount.value = res.data?.volunteer_qty || 0 181 + volunteerCount.value = res.data?.volunteers_qty || 0
182 recordDate.value = res.data?.record_date || '' 182 recordDate.value = res.data?.record_date || ''
183 lastActivityDate.value = res.data?.last_activity_date || '' 183 lastActivityDate.value = res.data?.last_activity_date || ''
184 } 184 }
...@@ -188,7 +188,7 @@ onMounted(async () => { ...@@ -188,7 +188,7 @@ onMounted(async () => {
188 const res = await searchOldActivityAPI() 188 const res = await searchOldActivityAPI()
189 if (res.code) { 189 if (res.code) {
190 activityCount.value = res.data?.payment_qty || 0 190 activityCount.value = res.data?.payment_qty || 0
191 - volunteerCount.value = res.data?.volunteer_qty || 0 191 + volunteerCount.value = res.data?.volunteers_qty || 0
192 recordDate.value = res.data?.record_date || '' 192 recordDate.value = res.data?.record_date || ''
193 lastActivityDate.value = res.data?.last_activity_date || '' 193 lastActivityDate.value = res.data?.last_activity_date || ''
194 } 194 }
......