| | |
| | | getActivityPage, |
| | | publishActivity, |
| | | } from '#/api/wxcp/activity'; |
| | | import { toAccessibleFileUrl } from '#/utils'; |
| | | |
| | | import { |
| | | ACTIVITY_STATUS, |
| | |
| | | |
| | | function handleCreate() { |
| | | formModalApi.setData({ formType: 'create' }).open(); |
| | | } |
| | | |
| | | /** 列表缩略图取封面附件的第一张,没传封面返回空串 */ |
| | | function coverUrlOf(row: WxCpActivityApi.Activity): string { |
| | | const cover = row.attachmentList?.[0]; |
| | | // 后端返回的是它自己配置域名的绝对地址,需改写成同源路径才能被 <img> 加载 |
| | | return toAccessibleFileUrl(cover?.url || cover?.previewURL); |
| | | } |
| | | |
| | | function handleDetail(row: WxCpActivityApi.Activity) { |
| | |
| | | </template> |
| | | |
| | | <template #title="{ row }"> |
| | | <Button type="link" class="p-0" @click="handleDetail(row)"> |
| | | {{ row.title }} |
| | | </Button> |
| | | <div class="flex items-center gap-2"> |
| | | <!-- 封面来自附件中间表,未上传时不占位 --> |
| | | <img |
| | | v-if="coverUrlOf(row)" |
| | | :src="coverUrlOf(row)" |
| | | alt="封面" |
| | | class="h-9 w-14 shrink-0 rounded object-cover" |
| | | /> |
| | | <Button type="link" class="p-0" @click="handleDetail(row)"> |
| | | {{ row.title }} |
| | | </Button> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #signupCount="{ row }"> |