diff --git a/src/api/zeroPrices.js b/src/api/zeroPrices.js
index a7db41a..c69efd1 100644
--- a/src/api/zeroPrices.js
+++ b/src/api/zeroPrices.js
@@ -15,26 +15,13 @@ export const useZeroPrices = () => {
await apiClient.delete('/merch/zeroprices', list)
}
catch (error) {
- console.log('Delete target zero prices error: ', error)
+ console.log('Delete 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/components/ChartBlock.vue b/src/components/ChartBlock.vue
index 11bd874..96a5243 100644
--- a/src/components/ChartBlock.vue
+++ b/src/components/ChartBlock.vue
@@ -13,7 +13,6 @@ import {
} from 'chart.js'
import { Line } from 'vue-chartjs'
import 'chartjs-adapter-date-fns'
-import { originColors } from '@/services/colors.js'
ChartJS.register(
Title,
@@ -34,6 +33,11 @@ const props = defineProps({
},
})
+const originColors = {
+ surugaya: '#2d3081',
+ mandarake: '#924646',
+}
+
const chartData = ref({
datasets: [],
})
diff --git a/src/components/CopyToClipboard.vue b/src/components/CopyToClipboard.vue
index c8cebd7..0100e5f 100644
--- a/src/components/CopyToClipboard.vue
+++ b/src/components/CopyToClipboard.vue
@@ -6,7 +6,7 @@ const message = useMessage()
const props = defineProps({
text: {
type: String,
- default: '',
+ required: true,
},
})
diff --git a/src/main.js b/src/main.js
index 6561fbf..ee40f96 100644
--- a/src/main.js
+++ b/src/main.js
@@ -11,7 +11,6 @@ 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
deleted file mode 100644
index 26e0b5e..0000000
--- a/src/services/colors.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export const originColors = {
- surugaya: '#2d3081',
- mandarake: '#924646',
- amiami: '#F27024',
-};
diff --git a/src/views/ChartsView.vue b/src/views/ChartsView.vue
index 9eaa92c..d86e6d4 100644
--- a/src/views/ChartsView.vue
+++ b/src/views/ChartsView.vue
@@ -33,7 +33,7 @@ const fetchPrices = async (days = 7) => {
}
onMounted(() => {
- fetchPrices()
+ fetchPrices(7)
})
function handleSelectDays(days) {
diff --git a/src/views/DetailsView.vue b/src/views/DetailsView.vue
index 5d7050b..7a2e53d 100644
--- a/src/views/DetailsView.vue
+++ b/src/views/DetailsView.vue
@@ -5,9 +5,10 @@ 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()
@@ -19,6 +20,11 @@ const props = defineProps({
},
})
+const editing = ref({
+ surugaya: false,
+ mandarake: false,
+})
+
const merchDetails = ref(null)
const loading = ref(true)
const error = ref(null)
@@ -29,7 +35,7 @@ const fetchMerch = async () => {
merchDetails.value = response.data
if (!response.status === 400) {
- await router.push({ name: 'collection' })
+ router.push({ name: 'collection' })
}
} catch (err) {
error.value = err.message
@@ -52,7 +58,7 @@ const confirmDelete = async () => {
console.log(error)
}
showModal.value = false
- await router.push({ name: 'collection' })
+ router.push({ name: 'collection' })
}
const prices = ref(null)
@@ -66,7 +72,7 @@ const fetchPrices = async (days = 7) => {
const response = await getDistinctPrices(props.merch_uuid, days)
if (response.status === 400) {
- await router.push({ name: 'collection' })
+ router.push({ name: 'collection' })
return
}
@@ -78,6 +84,11 @@ const fetchPrices = async (days = 7) => {
}
}
+function handleLinkUpdate(origin, newLink) {
+ merchDetails.value[`origin_${origin}`].link = newLink
+ editing.value[origin] = false
+}
+
function handleSelectDays(days) {
fetchPrices(days)
}
@@ -109,10 +120,75 @@ onMounted(() => {