c978a5bf64
- 添加 touch-action: manipulation 禁用双击缩放 - 添加 -webkit-tap-highlight-color: transparent 移除点击高亮 - 在全局样式和修改评分页面按钮上应用 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
1.1 KiB
Vue
46 lines
1.1 KiB
Vue
<script>
|
|
export default {
|
|
onLaunch: function() {
|
|
console.log('App Launch')
|
|
// 禁用 iOS Safari 双击缩放
|
|
this.disableDoubleTapZoom()
|
|
},
|
|
onShow: function() {
|
|
console.log('App Show')
|
|
},
|
|
onHide: function() {
|
|
console.log('App Hide')
|
|
},
|
|
methods: {
|
|
disableDoubleTapZoom() {
|
|
// #ifdef H5
|
|
let lastTouchEnd = 0
|
|
document.documentElement.addEventListener('touchstart', function(event) {
|
|
if (event.touches.length > 1) {
|
|
event.preventDefault()
|
|
}
|
|
}, { passive: false })
|
|
|
|
document.documentElement.addEventListener('touchend', function(event) {
|
|
const now = Date.now()
|
|
if (now - lastTouchEnd <= 300) {
|
|
event.preventDefault()
|
|
}
|
|
lastTouchEnd = now
|
|
}, { passive: false })
|
|
|
|
// 禁用手势缩放
|
|
document.documentElement.addEventListener('gesturestart', function(event) {
|
|
event.preventDefault()
|
|
}, { passive: false })
|
|
// #endif
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
/* 注意要写在第一行,同时给style标签加入lang=scss属性 */
|
|
@import common/common.css;
|
|
</style>
|