22import UseCommonStore from ' @h5/stores/commonStore.js'
33import UseSettingStore from ' @h5/stores/settingStore.js'
44import * as api from ' @h5/api/index.js'
5- import { vibrate } from ' @h5/utils/index.js'
65import { showImagePreview , showNotify , showConfirmDialog } from ' vant'
76import { useTranslation } from ' i18next-vue'
87
@@ -495,7 +494,7 @@ const handleFavoriteTouchStart = (event) => {
495494 // 添加最大值限制
496495 if (favoriteHold .count < 100 ) {
497496 favoriteHold .count ++
498- vibrate () // 每次计数增加时震动反馈
497+ settingStore . vibrate () // 每次计数增加时震动反馈
499498 } else {
500499 // 达到最大值时停止计数并提示用户
501500 clearInterval (favoriteHold .interval )
@@ -604,7 +603,7 @@ const onAddToFavorites = async () => {
604603 const res = await api .addToFavorites (currentImage .id )
605604 if (res .success ) {
606605 currentImage .isFavorite = true
607- vibrate ()
606+ settingStore . vibrate ()
608607 }
609608}
610609
@@ -617,7 +616,7 @@ const onRemoveFavorites = async () => {
617616 const res = await api .removeFavorites (currentImage .id )
618617 if (res .success ) {
619618 currentImage .isFavorite = false
620- vibrate ()
619+ settingStore . vibrate ()
621620 }
622621}
623622
@@ -657,7 +656,6 @@ const onPreviewImage = async (index) => {
657656 maxZoom: 100 ,
658657 minZoom: 1 / 3
659658 })
660- vibrate ()
661659}
662660
663661// 图片项触摸相关状态
@@ -678,7 +676,6 @@ const handleImageTouchStart = (index, event) => {
678676 longPress .timer = setTimeout (() => {
679677 longPress .selectedIndex = index
680678 flags .showActionPopup = true
681- vibrate () // 触发震动反馈
682679 }, 500 ) // 500毫秒长按触发
683680}
684681
@@ -774,7 +771,7 @@ const saveImage = async () => {
774771 type: ' success' ,
775772 message: t (' messages.saveSuccess' )
776773 })
777- vibrate ()
774+ settingStore . vibrate ()
778775 } catch (error) {
779776 showNotify ({
780777 type: ' danger' ,
@@ -830,7 +827,7 @@ const deleteImage = async () => {
830827 type: ' success' ,
831828 message: t (' messages.deleteSuccess' )
832829 })
833- vibrate ()
830+ settingStore . vibrate ()
834831 } else {
835832 showNotify ({
836833 type: ' danger' ,
0 commit comments