From d42e21bae779386546fb617c75b67fe410ac67bd Mon Sep 17 00:00:00 2001 From: nquidox Date: Sat, 6 Dec 2025 19:13:22 +0300 Subject: [PATCH 1/3] factor out origins colors --- src/components/ChartBlock.vue | 6 +-- src/services/colors.js | 4 ++ src/views/ZeroPricesView.vue | 77 +++++++---------------------------- 3 files changed, 19 insertions(+), 68 deletions(-) create mode 100644 src/services/colors.js diff --git a/src/components/ChartBlock.vue b/src/components/ChartBlock.vue index 96a5243..11bd874 100644 --- a/src/components/ChartBlock.vue +++ b/src/components/ChartBlock.vue @@ -13,6 +13,7 @@ import { } from 'chart.js' import { Line } from 'vue-chartjs' import 'chartjs-adapter-date-fns' +import { originColors } from '@/services/colors.js' ChartJS.register( Title, @@ -33,11 +34,6 @@ const props = defineProps({ }, }) -const originColors = { - surugaya: '#2d3081', - mandarake: '#924646', -} - const chartData = ref({ datasets: [], }) diff --git a/src/services/colors.js b/src/services/colors.js new file mode 100644 index 0000000..c337f2a --- /dev/null +++ b/src/services/colors.js @@ -0,0 +1,4 @@ +export const originColors = { + surugaya: '#2d3081', + mandarake: '#924646', +}; diff --git a/src/views/ZeroPricesView.vue b/src/views/ZeroPricesView.vue index 6e5820e..82d41a5 100644 --- a/src/views/ZeroPricesView.vue +++ b/src/views/ZeroPricesView.vue @@ -1,69 +1,20 @@ - + From 5639f8031c7a081084756a88034e84239ce8bd23 Mon Sep 17 00:00:00 2001 From: nquidox Date: Sat, 6 Dec 2025 19:13:48 +0300 Subject: [PATCH 2/3] zero prices period select + delete, tabs refactor --- src/api/zeroPrices.js | 15 ++++- src/views/ZeroPricesView/PeriodSelectTab.vue | 54 +++++++++++++++ src/views/ZeroPricesView/TargetZeroesTab.vue | 71 ++++++++++++++++++++ src/views/ZeroPricesView/ZeroPriceCard.vue | 21 +++++- 4 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 src/views/ZeroPricesView/PeriodSelectTab.vue create mode 100644 src/views/ZeroPricesView/TargetZeroesTab.vue diff --git a/src/api/zeroPrices.js b/src/api/zeroPrices.js index c69efd1..a7db41a 100644 --- a/src/api/zeroPrices.js +++ b/src/api/zeroPrices.js @@ -15,13 +15,26 @@ export const useZeroPrices = () => { await apiClient.delete('/merch/zeroprices', list) } catch (error) { - console.log('Delete zero prices error: ', error) + console.log('Delete target zero prices error: ', error) throw error } } + const deleteZeroPricesPeriod = async (start, end) => { + const params = new URLSearchParams({ start, end }).toString() + const url = `/merch/zeroprices/period${params ? `?${params}` : ''}` + const response = await apiClient.delete(url) + + if (response.status === 200) { + return response + } else { + console.log('Delete period select zero prices error: ', response) + } + } + return { getZeroPrices, deleteZeroPrices, + deleteZeroPricesPeriod, } } diff --git a/src/views/ZeroPricesView/PeriodSelectTab.vue b/src/views/ZeroPricesView/PeriodSelectTab.vue new file mode 100644 index 0000000..4239f15 --- /dev/null +++ b/src/views/ZeroPricesView/PeriodSelectTab.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/src/views/ZeroPricesView/TargetZeroesTab.vue b/src/views/ZeroPricesView/TargetZeroesTab.vue new file mode 100644 index 0000000..ba71ba5 --- /dev/null +++ b/src/views/ZeroPricesView/TargetZeroesTab.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/src/views/ZeroPricesView/ZeroPriceCard.vue b/src/views/ZeroPricesView/ZeroPriceCard.vue index 44236ee..32bd31f 100644 --- a/src/views/ZeroPricesView/ZeroPriceCard.vue +++ b/src/views/ZeroPricesView/ZeroPriceCard.vue @@ -1,4 +1,7 @@ @@ -49,4 +61,11 @@ const handleCheckboxChange = (newValue) => { gap: 12px; border: 1px solid #e0e0e0; } + +.bordered { + border: 1px solid; + border-radius: 4px; + padding: 2px; + margin: 3px; +} From 2e9d1d33b7008637d1ba471de93ec8a19918eb58 Mon Sep 17 00:00:00 2001 From: nquidox Date: Mon, 15 Dec 2025 21:03:27 +0300 Subject: [PATCH 3/3] origin added + refactor --- src/components/CopyToClipboard.vue | 2 +- src/main.js | 1 + src/services/colors.js | 1 + src/views/ChartsView.vue | 2 +- src/views/DetailsView.vue | 88 ++------------------------- src/views/DetailsView/EditLink.vue | 17 +++++- src/views/DetailsView/OriginBlock.vue | 62 +++++++++++++++++++ 7 files changed, 86 insertions(+), 87 deletions(-) create mode 100644 src/views/DetailsView/OriginBlock.vue diff --git a/src/components/CopyToClipboard.vue b/src/components/CopyToClipboard.vue index 0100e5f..c8cebd7 100644 --- a/src/components/CopyToClipboard.vue +++ b/src/components/CopyToClipboard.vue @@ -6,7 +6,7 @@ const message = useMessage() const props = defineProps({ text: { type: String, - required: true, + default: '', }, }) diff --git a/src/main.js b/src/main.js index ee40f96..6561fbf 100644 --- a/src/main.js +++ b/src/main.js @@ -11,6 +11,7 @@ export const BASE_URL = 'https://api.nqws.ru/api/v2' // export const BASE_URL = 'http://localhost:9090/api/v2' export const BASE_MANDARAKE_LINK = 'https://order.mandarake.co.jp/order/listPage/list?soldOut=1&keyword=' +export const BASE_AMIAMI_LINK = 'https://slist.amiami.jp/top/search/list?s_cate_tag=1&submit_btn=&s_st_list_preorder_available=1&s_st_list_backorder_available=1&s_st_list_newitem_available=1&s_st_condition_flg=1&pagemax=60&s_keywords=' // export const IMAGE_STORAGE_URL = 'http://localhost:9280' export const IMAGE_STORAGE_URL = 'https://images.nqws.ru' diff --git a/src/services/colors.js b/src/services/colors.js index c337f2a..26e0b5e 100644 --- a/src/services/colors.js +++ b/src/services/colors.js @@ -1,4 +1,5 @@ export const originColors = { surugaya: '#2d3081', mandarake: '#924646', + amiami: '#F27024', }; diff --git a/src/views/ChartsView.vue b/src/views/ChartsView.vue index d86e6d4..9eaa92c 100644 --- a/src/views/ChartsView.vue +++ b/src/views/ChartsView.vue @@ -33,7 +33,7 @@ const fetchPrices = async (days = 7) => { } onMounted(() => { - fetchPrices(7) + fetchPrices() }) function handleSelectDays(days) { diff --git a/src/views/DetailsView.vue b/src/views/DetailsView.vue index 7a2e53d..5d7050b 100644 --- a/src/views/DetailsView.vue +++ b/src/views/DetailsView.vue @@ -5,10 +5,9 @@ import router from '@/router/index.js' import PeriodSelector from '@/components/PeriodSelector.vue' import ChartBlock from '@/components/ChartBlock.vue' import { useChartsApi } from '@/api/charts.js' -import EditLink from '@/views/DetailsView/EditLink.vue' -import CopyToClipboard from '@/components/CopyToClipboard.vue' import DetailsViewImages from '@/views/DetailsView/DetailsViewImages.vue' import AttachLabel from '@/views/DetailsView/AttachLabel.vue' +import OriginBlock from '@/views/DetailsView/OriginBlock.vue' const { getMerchDetails, deleteMerch } = useMerchApi() const { getDistinctPrices } = useChartsApi() @@ -20,11 +19,6 @@ const props = defineProps({ }, }) -const editing = ref({ - surugaya: false, - mandarake: false, -}) - const merchDetails = ref(null) const loading = ref(true) const error = ref(null) @@ -35,7 +29,7 @@ const fetchMerch = async () => { merchDetails.value = response.data if (!response.status === 400) { - router.push({ name: 'collection' }) + await router.push({ name: 'collection' }) } } catch (err) { error.value = err.message @@ -58,7 +52,7 @@ const confirmDelete = async () => { console.log(error) } showModal.value = false - router.push({ name: 'collection' }) + await router.push({ name: 'collection' }) } const prices = ref(null) @@ -72,7 +66,7 @@ const fetchPrices = async (days = 7) => { const response = await getDistinctPrices(props.merch_uuid, days) if (response.status === 400) { - router.push({ name: 'collection' }) + await router.push({ name: 'collection' }) return } @@ -84,11 +78,6 @@ const fetchPrices = async (days = 7) => { } } -function handleLinkUpdate(origin, newLink) { - merchDetails.value[`origin_${origin}`].link = newLink - editing.value[origin] = false -} - function handleSelectDays(days) { fetchPrices(days) } @@ -120,75 +109,10 @@ onMounted(() => { - - - Surugaya - -
- - +
+
- - - - - Mandarake - -
- - -
- -
Not found
diff --git a/src/views/DetailsView/EditLink.vue b/src/views/DetailsView/EditLink.vue index 0053bf0..027d87e 100644 --- a/src/views/DetailsView/EditLink.vue +++ b/src/views/DetailsView/EditLink.vue @@ -1,7 +1,7 @@