hookehuyr

feat(海报签到): 添加获取海报详情API并清理无用代码

- 在map.js中添加GET_POSTER_DETAIL API接口
- 移除PosterCheckin页面中未使用的switchPoster方法和注释掉的previewPoster代码
- 调整样式代码位置以保持代码结构一致性
/*
* @Date: 2025-09-04 17:23:17
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-04 17:23:43
* @LastEditTime: 2025-09-17 11:35:23
* @FilePath: /lls_program/src/api/map.js
* @Description: 文件描述
*/
......@@ -9,6 +9,7 @@ import { fn, fetch } from './fn';
const Api = {
GET_MAP_URL: '/srv/?a=map&t=get_map_url',
GET_POSTER_DETAIL: '/srv/?a=map&t=poster',
}
/**
......@@ -20,3 +21,26 @@ const Api = {
* @returns {string} response.data.url - 地图URL
*/
export const getMapUrlAPI = (params) => fn(fetch.get(Api.GET_MAP_URL, params));
/**
* @description: 获取海报详情
* @param {Object} params - 请求参数
* @returns {number} response.code - 响应状态码
* @returns {string} response.msg - 响应消息
* @returns {Object} response.data - 响应数据
* @returns {string} response.data.title - 海报标题
* @returns {string} response.data.end_date - 活动截止时间
* @returns {Array} response.data.details - 关卡列表
* @returns {Object} response.data.details[].id - 关卡ID
* @returns {string} response.data.details[].name - 关卡名称
* @returns {string} response.data.details[].background_url - 关卡背景图URL
* @returns {string} response.data.details[].main_slogan - 关卡主 slogan
* @returns {string} response.data.details[].sub_slogan - 关卡子 slogan
* @returns {integer} response.data.show_detail_index - 当前应该显示第几个关卡,从 0 开始计数
* @returns {object} response.data.family - 用户的当前家庭
* @returns {string} response.data.family.id - 家庭ID
* @returns {string} response.data.family.name - 家庭名称
* @returns {string} response.data.family.avatar_url - 家庭头像URL
* @returns {string} response.data.qrcode_url - 小程序码
*/
export const getPosterDetailAPI = (params) => fn(fetch.get(Api.GET_POSTER_DETAIL, params));
......
......@@ -116,36 +116,17 @@
@close="closePreview"
/>
</view>
</template>
<style scoped>
.safe-area-bottom {
padding-bottom: env(safe-area-inset-bottom);
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.animate-spin {
animation: spin 1s linear infinite;
}
</style>
<script setup>
import { ref, onMounted, computed, watch } from 'vue'
import Taro from '@tarojs/taro'
import { Left, Right } from '@nutui/icons-vue-taro'
import PosterBuilder from '@/components/PosterBuilder/index.vue'
import BASE_URL from '@/utils/config'
// 导入获取海报详情的API
import { getPosterDetailAPI } from '@/api/map'
// 默认背景图
const defaultBackground = 'https://cdn.ipadbiz.cn/lls_prog/images/%E6%B5%B7%E6%8A%A5%E9%BB%98%E8%AE%A4%E8%83%8C%E6%99%AF%E5%9B%BE1.png'
......@@ -558,15 +539,6 @@ const generateCurrentPoster = () => {
}
/**
* 切换海报
*/
const switchPoster = (index) => {
if (index >= 0 && index < posterList.value.length) {
currentPosterIndex.value = index
}
}
/**
* 切换到上一张海报
*/
const previousPoster = () => {
......@@ -701,14 +673,14 @@ const onPosterFail = (error) => {
/**
* 预览海报
*/
const previewPoster = () => {
const currentPath = currentPoster.value.path
console.warn('预览海报', currentPath)
if (!currentPath) return
// const previewPoster = () => {
// const currentPath = currentPoster.value.path
// console.warn('预览海报', currentPath)
// if (!currentPath) return
previewImages.value = [{ src: currentPath }]
previewVisible.value = true
}
// previewImages.value = [{ src: currentPath }]
// previewVisible.value = true
// }
/**
* 关闭预览
......@@ -801,6 +773,25 @@ onMounted(() => {
})
</script>
<style scoped>
.safe-area-bottom {
padding-bottom: env(safe-area-inset-bottom);
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.animate-spin {
animation: spin 1s linear infinite;
}
</style>
<style lang="less">
.poster-checkin-page {
.aspect-\[3\/4\] {
......