fix: 小修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
1b9fb3069d
commit
2ba65eee32
|
|
@ -27,6 +27,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|||
|
||||
const emit = defineEmits<{
|
||||
'layer-ready': [layerManager: ReturnType<typeof useSimpleDomLayer>]
|
||||
'preview': []
|
||||
}>()
|
||||
|
||||
// 图片的自然尺寸
|
||||
|
|
@ -360,6 +361,19 @@ onMounted(async () => {
|
|||
}"
|
||||
/>
|
||||
|
||||
<!-- 预览按钮 -->
|
||||
<view
|
||||
class="absolute right-2 top-2 z-20 flex items-center justify-center rounded-full bg-black/50"
|
||||
:style="{
|
||||
width: '32px',
|
||||
height: '32px',
|
||||
pointerEvents: 'auto',
|
||||
}"
|
||||
@click.stop="emit('preview')"
|
||||
>
|
||||
<text class="text-white" :style="{ fontSize: '16px' }">🔍</text>
|
||||
</view>
|
||||
|
||||
<!-- 标记层容器 -->
|
||||
<view
|
||||
class="absolute left-0 top-0"
|
||||
|
|
|
|||
|
|
@ -182,6 +182,19 @@ function handleScoreDelete(value: number) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理图片预览
|
||||
*/
|
||||
function handlePreview(imageIndex: number) {
|
||||
const urls = props.question.imageUrls
|
||||
if (!urls?.length) return
|
||||
|
||||
uni.previewImage({
|
||||
urls,
|
||||
current: urls[imageIndex],
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理文本输入
|
||||
*/
|
||||
|
|
@ -358,6 +371,7 @@ defineExpose({
|
|||
:on-score-delete="handleScoreDelete"
|
||||
@layer-ready="(manager) => handleLayerReady(imageIndex, manager)"
|
||||
@quick-score="handleQuickScore"
|
||||
@preview="handlePreview(imageIndex)"
|
||||
/>
|
||||
|
||||
<!-- 第一个图片显示分数 -->
|
||||
|
|
|
|||
|
|
@ -69,6 +69,16 @@ onLoad(() => {
|
|||
},
|
||||
})
|
||||
})
|
||||
|
||||
// 每次页面显示时,根据当前路径自动同步 tabbar 选中状态
|
||||
onShow(() => {
|
||||
const pages = getCurrentPages()
|
||||
const currentPage = pages[pages.length - 1]
|
||||
if (currentPage?.route) {
|
||||
// route 不带前导斜杠,与 pagePath 格式一致
|
||||
tabbarStore.setAutoCurIdx(currentPage.route)
|
||||
}
|
||||
})
|
||||
const activeColor = '#1890ff'
|
||||
const inactiveColor = '#666'
|
||||
function getColorByIndex(index: number) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue