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) {
+8 -1
View File
@@ -32,9 +32,9 @@
:show-viewer-actions="false"
:add-actions="attachmentAddActions"
@add="openAttachmentPicker('OTHER')"
@action="handleAttachmentAction"
@capture-photo="capturePhoto"
@capture-video="captureVideo"
@add-other="openAttachmentPicker('OTHER')"
/>
</t-form-item>
<t-form-item label="纯色封面" label-width="8rem" content-align="right">
@@ -214,6 +214,7 @@ import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
import ProductSkuEditor from "@/pages/product/component/ProductSkuEditor.vue";
import ProductSkuUnitEditor from "@/pages/product/component/ProductSkuUnitEditor.vue";
import ProductSkuUnitBatchEditor from "@/pages/product/component/ProductSkuUnitBatchEditor.vue";
import type { MediaSelectorAddAction } from "@/components/mediaSelector/types";
import { useNavBarStore } from "@/store/navBarStore";
import type { PhotoItem } from "@/types/Photo";
import type { Product, ProductAttachmentType, ProductCategory, ProductSku, ProductSkuUnit, ProductSpec, ProductType } from "@/types/Product";
@@ -567,6 +568,12 @@ function captureVideo(): void {
videoInputRef.value?.click();
}
function handleAttachmentAction(action: MediaSelectorAddAction): void {
if (action.emit === "add-other") {
openAttachmentPicker("OTHER");
}
}
function openCoverColorPicker(): void {
coverColorDraft.value = solidColorCoverColor.value || DEFAULT_COVER_COLOR;
coverColorPickerVisible.value = true;