From f5d9cb64d1c155c10cff4894ffc5076dd21f8766 Mon Sep 17 00:00:00 2001 From: William Chong Date: Mon, 5 Aug 2024 16:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=94=20Default=20enable=20allow=20custo?= =?UTF-8?q?m=20price?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/nft-book-store/collection/new.vue | 4 ++-- .../collection/status/[collectionId]/edit.vue | 4 ++-- pages/nft-book-store/new.vue | 4 ++-- .../nft-book-store/status/[classId]/edit/[editionIndex].vue | 6 +++--- pages/nft-book-store/status/[classId]/edit/new.vue | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pages/nft-book-store/collection/new.vue b/pages/nft-book-store/collection/new.vue index f6c0503bb..e11930d29 100644 --- a/pages/nft-book-store/collection/new.vue +++ b/pages/nft-book-store/collection/new.vue @@ -472,7 +472,7 @@ const price = ref({ stock: Number(route.query.count as string || 1), hasShipping: false, isPhysicalOnly: false, - isAllowCustomPrice: false + isAllowCustomPrice: true }) const shippingRates = ref([]) const moderatorWallets = ref([]) @@ -611,7 +611,7 @@ function formatPrice (price: any) { stock: Number(price.stock), hasShipping: Boolean(price.hasShipping || shippingRates.value.length || false), isPhysicalOnly: Boolean(price.isPhysicalOnly || false), - isAllowCustomPrice: Boolean(price.isAllowCustomPrice || false) + isAllowCustomPrice: Boolean(price.isAllowCustomPrice ?? true) } } diff --git a/pages/nft-book-store/collection/status/[collectionId]/edit.vue b/pages/nft-book-store/collection/status/[collectionId]/edit.vue index 3f0c3b6f2..0e114bdff 100644 --- a/pages/nft-book-store/collection/status/[collectionId]/edit.vue +++ b/pages/nft-book-store/collection/status/[collectionId]/edit.vue @@ -228,7 +228,7 @@ const descriptionEn = ref('') const descriptionZh = ref('') const image = ref('') const hasShipping = ref(false) -const isAllowCustomPrice = ref(false) +const isAllowCustomPrice = ref(true) const isPhysicalOnly = ref(false) const shippingRates = ref([]) const isUpdatingShippingRates = ref(false) @@ -372,7 +372,7 @@ async function handleSubmit () { stock: Number(stock.value), hasShipping: hasShipping.value || false, isPhysicalOnly: isPhysicalOnly.value || false, - isAllowCustomPrice: isAllowCustomPrice.value || false + isAllowCustomPrice: isAllowCustomPrice.value ?? true } if (!editedPrice || editedPrice.price === undefined) { diff --git a/pages/nft-book-store/new.vue b/pages/nft-book-store/new.vue index adc1691c5..f4a2c7201 100644 --- a/pages/nft-book-store/new.vue +++ b/pages/nft-book-store/new.vue @@ -699,7 +699,7 @@ function addMorePrice () { descriptionZh: '', hasShipping: false, isPhysicalOnly: false, - isAllowCustomPrice: false + isAllowCustomPrice: true }) } @@ -755,7 +755,7 @@ function mapPrices (prices: any) { price: Number(p.price), stock: Number(p.stock), isAutoDeliver: !p.isPhysicalOnly && p.deliveryMethod === 'auto', - isAllowCustomPrice: p.isAllowCustomPrice || false, + isAllowCustomPrice: p.isAllowCustomPrice ?? true, autoMemo: p.deliveryMethod === 'auto' ? p.autoMemo || '' : '', hasShipping: p.hasShipping || false, isPhysicalOnly: p.isPhysicalOnly || false diff --git a/pages/nft-book-store/status/[classId]/edit/[editionIndex].vue b/pages/nft-book-store/status/[classId]/edit/[editionIndex].vue index 72095407f..68628c5f6 100644 --- a/pages/nft-book-store/status/[classId]/edit/[editionIndex].vue +++ b/pages/nft-book-store/status/[classId]/edit/[editionIndex].vue @@ -262,7 +262,7 @@ const descriptionEn = ref('') const descriptionZh = ref('') const hasShipping = ref(false) const isPhysicalOnly = ref(false) -const isAllowCustomPrice = ref(false) +const isAllowCustomPrice = ref(true) const shippingRates = ref([]) const isUpdatingShippingRates = ref(false) const oldStock = ref(0) @@ -350,7 +350,7 @@ onMounted(async () => { descriptionZh.value = currentEdition.description?.zh || legacyDescription || ' ' hasShipping.value = !!(currentEdition.hasShipping) || false isPhysicalOnly.value = currentEdition.isPhysicalOnly || false - isAllowCustomPrice.value = currentEdition.isAllowCustomPrice || false + isAllowCustomPrice.value = currentEdition.isAllowCustomPrice ?? true oldStock.value = currentEdition.stock oldIsAutoDeliver.value = currentEdition.isAutoDeliver @@ -443,7 +443,7 @@ async function handleSubmit () { autoMemo: autoMemo.value || '', hasShipping: hasShipping.value || false, isPhysicalOnly: isPhysicalOnly.value || false, - isAllowCustomPrice: isAllowCustomPrice.value || false + isAllowCustomPrice: isAllowCustomPrice.value ?? true } if (!editedPrice || editedPrice.price === undefined) { diff --git a/pages/nft-book-store/status/[classId]/edit/new.vue b/pages/nft-book-store/status/[classId]/edit/new.vue index 0f207fbda..b8d1f3d2d 100644 --- a/pages/nft-book-store/status/[classId]/edit/new.vue +++ b/pages/nft-book-store/status/[classId]/edit/new.vue @@ -267,7 +267,7 @@ const descriptionZh = ref('') const hasShipping = ref(false) const shippingRates = ref([]) const isPhysicalOnly = ref(false) -const isAllowCustomPrice = ref(false) +const isAllowCustomPrice = ref(true) const isUpdatingShippingRates = ref(false) const priceItemLabel = computed(() => hasMultiplePrices.value ? 'edition' : 'book') @@ -410,7 +410,7 @@ async function handleSubmit () { autoMemo: deliveryMethod.value === 'auto' ? (autoMemo.value || '') : '', hasShipping: hasShipping.value || false, isPhysicalOnly: isPhysicalOnly.value || false, - isAllowCustomPrice: isAllowCustomPrice.value || false + isAllowCustomPrice: isAllowCustomPrice.value ?? true } if (!editedPrice || editedPrice.price === undefined) {