fix add-point-card invalid

This commit is contained in:
Timi
2026-09-19 13:08:44 +08:00
parent ef22e2bc6c
commit e998b0c06e
5 changed files with 64 additions and 36 deletions
+12 -2
View File
@@ -81,10 +81,9 @@
:add-actions="photoAddActions"
:loading="isPhotoUploading"
@add="openPhotoPicker('OTHER')"
@action="handlePhotoAction"
@capture-photo="capturePhoto"
@capture-video="captureVideo"
@add-point-card="capturePointCard"
@add-other="openPhotoPicker('OTHER')"
/>
<div class="tips orange" v-if="!hasCustomerDeletePermission">当前账户权限编辑客户需要上传照片和积分卡</div>
</div>
@@ -232,6 +231,7 @@ import CodeScanner from "@/components/CodeScanner.vue";
import CustomerProfileCard from "@/components/CustomerProfileCard.vue";
import CustomerSelector from "@/components/CustomerSelector.vue";
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
import type { MediaSelectorAddAction } from "@/components/mediaSelector/types";
import TagSelector from "@/components/TagSelector.vue";
import CustomerTagCard from "@/pages/customer/component/CustomerTagCard.vue";
import { useCurrentStoreStore } from "@/store/currentStoreStore";
@@ -484,6 +484,16 @@ function captureVideo(): void {
videoInputRef.value?.click();
}
function handlePhotoAction(action: MediaSelectorAddAction): void {
if (action.emit === "add-point-card") {
capturePointCard();
return;
}
if (action.emit === "add-other") {
openPhotoPicker("OTHER");
}
}
watch(isCustomerBound, (value) => {
navBarStore.setRightDisabled(value);
if (!value) {