feat(海报签到): 添加获取海报详情API并清理无用代码
- 在map.js中添加GET_POSTER_DETAIL API接口 - 移除PosterCheckin页面中未使用的switchPoster方法和注释掉的previewPoster代码 - 调整样式代码位置以保持代码结构一致性
Showing
2 changed files
with
53 additions
and
38 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-09-04 17:23:17 | 2 | * @Date: 2025-09-04 17:23:17 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-09-04 17:23:43 | 4 | + * @LastEditTime: 2025-09-17 11:35:23 |
| 5 | * @FilePath: /lls_program/src/api/map.js | 5 | * @FilePath: /lls_program/src/api/map.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -9,6 +9,7 @@ import { fn, fetch } from './fn'; | ... | @@ -9,6 +9,7 @@ import { fn, fetch } from './fn'; |
| 9 | 9 | ||
| 10 | const Api = { | 10 | const Api = { |
| 11 | GET_MAP_URL: '/srv/?a=map&t=get_map_url', | 11 | GET_MAP_URL: '/srv/?a=map&t=get_map_url', |
| 12 | + GET_POSTER_DETAIL: '/srv/?a=map&t=poster', | ||
| 12 | } | 13 | } |
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| ... | @@ -20,3 +21,26 @@ const Api = { | ... | @@ -20,3 +21,26 @@ const Api = { |
| 20 | * @returns {string} response.data.url - 地图URL | 21 | * @returns {string} response.data.url - 地图URL |
| 21 | */ | 22 | */ |
| 22 | export const getMapUrlAPI = (params) => fn(fetch.get(Api.GET_MAP_URL, params)); | 23 | export const getMapUrlAPI = (params) => fn(fetch.get(Api.GET_MAP_URL, params)); |
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * @description: 获取海报详情 | ||
| 27 | + * @param {Object} params - 请求参数 | ||
| 28 | + * @returns {number} response.code - 响应状态码 | ||
| 29 | + * @returns {string} response.msg - 响应消息 | ||
| 30 | + * @returns {Object} response.data - 响应数据 | ||
| 31 | + * @returns {string} response.data.title - 海报标题 | ||
| 32 | + * @returns {string} response.data.end_date - 活动截止时间 | ||
| 33 | + * @returns {Array} response.data.details - 关卡列表 | ||
| 34 | + * @returns {Object} response.data.details[].id - 关卡ID | ||
| 35 | + * @returns {string} response.data.details[].name - 关卡名称 | ||
| 36 | + * @returns {string} response.data.details[].background_url - 关卡背景图URL | ||
| 37 | + * @returns {string} response.data.details[].main_slogan - 关卡主 slogan | ||
| 38 | + * @returns {string} response.data.details[].sub_slogan - 关卡子 slogan | ||
| 39 | + * @returns {integer} response.data.show_detail_index - 当前应该显示第几个关卡,从 0 开始计数 | ||
| 40 | + * @returns {object} response.data.family - 用户的当前家庭 | ||
| 41 | + * @returns {string} response.data.family.id - 家庭ID | ||
| 42 | + * @returns {string} response.data.family.name - 家庭名称 | ||
| 43 | + * @returns {string} response.data.family.avatar_url - 家庭头像URL | ||
| 44 | + * @returns {string} response.data.qrcode_url - 小程序码 | ||
| 45 | + */ | ||
| 46 | +export const getPosterDetailAPI = (params) => fn(fetch.get(Api.GET_POSTER_DETAIL, params)); | ... | ... |
| ... | @@ -116,36 +116,17 @@ | ... | @@ -116,36 +116,17 @@ |
| 116 | @close="closePreview" | 116 | @close="closePreview" |
| 117 | /> | 117 | /> |
| 118 | 118 | ||
| 119 | - | ||
| 120 | </view> | 119 | </view> |
| 121 | </template> | 120 | </template> |
| 122 | 121 | ||
| 123 | -<style scoped> | ||
| 124 | -.safe-area-bottom { | ||
| 125 | - padding-bottom: env(safe-area-inset-bottom); | ||
| 126 | -} | ||
| 127 | - | ||
| 128 | -@keyframes spin { | ||
| 129 | - from { | ||
| 130 | - transform: rotate(0deg); | ||
| 131 | - } | ||
| 132 | - to { | ||
| 133 | - transform: rotate(360deg); | ||
| 134 | - } | ||
| 135 | -} | ||
| 136 | - | ||
| 137 | -.animate-spin { | ||
| 138 | - animation: spin 1s linear infinite; | ||
| 139 | -} | ||
| 140 | -</style> | ||
| 141 | - | ||
| 142 | <script setup> | 122 | <script setup> |
| 143 | import { ref, onMounted, computed, watch } from 'vue' | 123 | import { ref, onMounted, computed, watch } from 'vue' |
| 144 | import Taro from '@tarojs/taro' | 124 | import Taro from '@tarojs/taro' |
| 145 | import { Left, Right } from '@nutui/icons-vue-taro' | 125 | import { Left, Right } from '@nutui/icons-vue-taro' |
| 146 | import PosterBuilder from '@/components/PosterBuilder/index.vue' | 126 | import PosterBuilder from '@/components/PosterBuilder/index.vue' |
| 147 | import BASE_URL from '@/utils/config' | 127 | import BASE_URL from '@/utils/config' |
| 148 | - | 128 | +// 导入获取海报详情的API |
| 129 | +import { getPosterDetailAPI } from '@/api/map' | ||
| 149 | // 默认背景图 | 130 | // 默认背景图 |
| 150 | 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' | 131 | 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' |
| 151 | 132 | ||
| ... | @@ -558,15 +539,6 @@ const generateCurrentPoster = () => { | ... | @@ -558,15 +539,6 @@ const generateCurrentPoster = () => { |
| 558 | } | 539 | } |
| 559 | 540 | ||
| 560 | /** | 541 | /** |
| 561 | - * 切换海报 | ||
| 562 | - */ | ||
| 563 | -const switchPoster = (index) => { | ||
| 564 | - if (index >= 0 && index < posterList.value.length) { | ||
| 565 | - currentPosterIndex.value = index | ||
| 566 | - } | ||
| 567 | -} | ||
| 568 | - | ||
| 569 | -/** | ||
| 570 | * 切换到上一张海报 | 542 | * 切换到上一张海报 |
| 571 | */ | 543 | */ |
| 572 | const previousPoster = () => { | 544 | const previousPoster = () => { |
| ... | @@ -701,14 +673,14 @@ const onPosterFail = (error) => { | ... | @@ -701,14 +673,14 @@ const onPosterFail = (error) => { |
| 701 | /** | 673 | /** |
| 702 | * 预览海报 | 674 | * 预览海报 |
| 703 | */ | 675 | */ |
| 704 | -const previewPoster = () => { | 676 | +// const previewPoster = () => { |
| 705 | - const currentPath = currentPoster.value.path | 677 | +// const currentPath = currentPoster.value.path |
| 706 | - console.warn('预览海报', currentPath) | 678 | +// console.warn('预览海报', currentPath) |
| 707 | - if (!currentPath) return | 679 | +// if (!currentPath) return |
| 708 | 680 | ||
| 709 | - previewImages.value = [{ src: currentPath }] | 681 | +// previewImages.value = [{ src: currentPath }] |
| 710 | - previewVisible.value = true | 682 | +// previewVisible.value = true |
| 711 | -} | 683 | +// } |
| 712 | 684 | ||
| 713 | /** | 685 | /** |
| 714 | * 关闭预览 | 686 | * 关闭预览 |
| ... | @@ -801,6 +773,25 @@ onMounted(() => { | ... | @@ -801,6 +773,25 @@ onMounted(() => { |
| 801 | }) | 773 | }) |
| 802 | </script> | 774 | </script> |
| 803 | 775 | ||
| 776 | +<style scoped> | ||
| 777 | +.safe-area-bottom { | ||
| 778 | + padding-bottom: env(safe-area-inset-bottom); | ||
| 779 | +} | ||
| 780 | + | ||
| 781 | +@keyframes spin { | ||
| 782 | + from { | ||
| 783 | + transform: rotate(0deg); | ||
| 784 | + } | ||
| 785 | + to { | ||
| 786 | + transform: rotate(360deg); | ||
| 787 | + } | ||
| 788 | +} | ||
| 789 | + | ||
| 790 | +.animate-spin { | ||
| 791 | + animation: spin 1s linear infinite; | ||
| 792 | +} | ||
| 793 | +</style> | ||
| 794 | + | ||
| 804 | <style lang="less"> | 795 | <style lang="less"> |
| 805 | .poster-checkin-page { | 796 | .poster-checkin-page { |
| 806 | .aspect-\[3\/4\] { | 797 | .aspect-\[3\/4\] { | ... | ... |
-
Please register or login to post a comment