feat(holographic-card): 接入 ManualTiltSlider + 修 touchend 行为
- 与 LenticularCard 对齐的 showSlider / sliderValue / v-model 接口 - 触摸结束不再 emit (0,0) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c3b423cf23
commit
b0dcb82276
@ -32,6 +32,12 @@
|
||||
<text class="holo-hint-text">{{ hintText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<ManualTiltSlider
|
||||
v-if="showSlider"
|
||||
:value="sliderValue"
|
||||
@change="v => emit('update:sliderValue', v)"
|
||||
@reset="emit('sliderReset')"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -39,6 +45,7 @@
|
||||
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue'
|
||||
import { HolographicEngine } from '@/utils/webgl/holographic-engine.js'
|
||||
import { loadTextureImage } from '@/utils/laser-card/laserPreviewWebgl.js'
|
||||
import ManualTiltSlider from './ManualTiltSlider.vue'
|
||||
|
||||
const props = defineProps({
|
||||
baseImageSrc: { type: String, default: '' },
|
||||
@ -62,9 +69,12 @@ const props = defineProps({
|
||||
showHint: { type: Boolean, default: true },
|
||||
maxDPR: { type: Number, default: 2 },
|
||||
skipBuiltInTouch: { type: Boolean, default: false },
|
||||
// 新增:手动滑块接入(与 LenticularCard 对齐)
|
||||
showSlider: { type: Boolean, default: false },
|
||||
sliderValue: { type: Number, default: 0.5 },
|
||||
})
|
||||
|
||||
const emit = defineEmits(['simulate', 'ready', 'error', 'fpsUpdate'])
|
||||
const emit = defineEmits(['simulate', 'update:sliderValue', 'sliderReset', 'ready', 'error', 'fpsUpdate'])
|
||||
|
||||
const webglCanvas = ref(null)
|
||||
const webglReady = ref(false)
|
||||
@ -128,7 +138,8 @@ function onTouchMove(e) {
|
||||
}
|
||||
function onTouchEnd() {
|
||||
if (props.skipBuiltInTouch) return
|
||||
emit('simulate', 0, 0)
|
||||
// 修改前:emit('simulate', 0, 0)
|
||||
// 修改后:触摸结束不再发 (0,0)
|
||||
}
|
||||
|
||||
function syncEngineParams() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user