index.vue
2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!--
* @Date: 2026-05-19 14:40:21
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-05-19 15:03:23
* @FilePath: /lls_program/src/pages/ScanCheckinList/index.vue
* @Description: 文件描述
-->
<template>
<view class="scan-checkin-list-page">
<view class="scan-checkin-list-header">
<text class="scan-checkin-list-subtitle">请选择一个打卡点,进入详情后完成扫码打卡</text>
</view>
<view v-for="point in pointList" :key="point.id" class="scan-checkin-list-card">
<view class="scan-checkin-list-leading">
<IconFont size="30" name="https://cdn.ipadbiz.cn/lls_prog/icon/check_list_logo.png" />
</view>
<view class="scan-checkin-list-content">
<text class="scan-checkin-list-name">{{ point.title }}</text>
</view>
<view class="scan-checkin-list-action" @click="goToDetail(point)">
<Scan2 size="20" />
</view>
</view>
<view class="scan-checkin-list-floating-button" @click="handleShowBoothMap">
<IconFont
class="scan-checkin-list-floating-icon"
size="20"
name="https://cdn.ipadbiz.cn/lls_prog/icon/%E5%B1%95%E4%BD%8D%E5%9B%BE@2x.png"
/>
<text class="scan-checkin-list-floating-text">展位图</text>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import Taro, { useLoad } from '@tarojs/taro'
import { IconFont, Scan2 } from '@nutui/icons-vue-taro'
import './index.less'
import { getScanStageListAPI } from '@/api/map'
const pointList = ref([])
const activityId = ref('')
const goToDetail = point => {
const params = new URLSearchParams({
activityId: activityId.value,
detailId: point.id,
title: point.title,
})
Taro.navigateTo({
url: `/pages/ScanCheckinDetail/index?${params.toString()}`,
})
}
const handleShowBoothMap = () => {
const params = new URLSearchParams({
activityId: activityId.value,
})
Taro.navigateTo({
url: `/pages/BoothMapGallery/index?${params.toString()}`,
})
}
useLoad(options => {
activityId.value = options.activityId || options.id || ''
loadStageList()
})
const loadStageList = async () => {
const result = await getScanStageListAPI({
activity_id: activityId.value,
})
if (result?.code !== 1) {
Taro.showToast({
title: result?.msg || '获取关卡列表失败',
icon: 'none',
})
return
}
pointList.value = (result?.data?.stages || []).map(stage => ({
id: stage.id,
title: stage.title,
isChecked: stage.is_checked,
}))
}
</script>
<script>
export default {
name: 'ScanCheckinList',
}
</script>