From b264a8cabd95ea575db2de97a8089b4c82ce739e Mon Sep 17 00:00:00 2001 From: JinWen Date: Wed, 9 Dec 2020 20:29:58 +0800 Subject: [PATCH 1/3] [Fix] Detail page add photo place at first --- src/components/FactoryDetailPage.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/FactoryDetailPage.vue b/src/components/FactoryDetailPage.vue index 7d2c0a8..21a61e1 100644 --- a/src/components/FactoryDetailPage.vue +++ b/src/components/FactoryDetailPage.vue @@ -48,15 +48,15 @@ - - -
mdi-camera-plus 補充照片
+ + +
From 4473b3b36d98b39607e7382c8a7e976d9067a150 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Wed, 16 Dec 2020 20:18:46 +0800 Subject: [PATCH 2/3] Add landcode to factory detail --- src/components/FactoryDetailPage.vue | 13 ++++++++++--- src/types.ts | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/FactoryDetailPage.vue b/src/components/FactoryDetailPage.vue index 21a61e1..91e6447 100644 --- a/src/components/FactoryDetailPage.vue +++ b/src/components/FactoryDetailPage.vue @@ -60,10 +60,8 @@
- +

{{ factoryAddressAndLandcode }}

經緯度

@@ -181,6 +179,14 @@ export default createComponent({ return appState.factoryData?.name }) + const factoryAddressAndLandcode = computed(() => { + if (appState.factoryData) { + const { townname, sectname, sectcode, landcode } = appState.factoryData + // 白鷺段(1005)817地號 + return `${townname} ${sectname} (${sectcode}) ${landcode}地號` + } + }) + const full = computed(() => appState.factoryDetailsExpanded) const longitude = computed(() => appState.factoryData?.lng.toFixed(7)) @@ -273,6 +279,7 @@ export default createComponent({ factoryId, factoryType, factoryName, + factoryAddressAndLandcode, pastDescriptions, longitude, latitude, diff --git a/src/types.ts b/src/types.ts index d96b3dd..b35ded2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -104,6 +104,9 @@ export type FactoryData = { lng: number, name: string, landcode: string, + townname: string, + sectname: string, + sectcode: string, type: FactoryType, images: FactoryImage[], // TODO: can be one of https://docs.djangoproject.com/en/2.2/ref/settings/#datetime-input-formats From db880ff7599e8e6d37d8dc396cbe2f7278db2523 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Wed, 16 Dec 2020 20:26:04 +0800 Subject: [PATCH 3/3] Fix default value for landcode --- src/components/FactoryDetailPage.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/FactoryDetailPage.vue b/src/components/FactoryDetailPage.vue index 91e6447..3b7f783 100644 --- a/src/components/FactoryDetailPage.vue +++ b/src/components/FactoryDetailPage.vue @@ -172,11 +172,13 @@ export default createComponent({ const factoryType = computed(() => { if (appState.factoryData) { return getFactoryTypeText(appState.factoryData) + } else { + return null } }) const factoryName = computed(() => { - return appState.factoryData?.name + return appState.factoryData?.name || '' }) const factoryAddressAndLandcode = computed(() => { @@ -184,6 +186,8 @@ export default createComponent({ const { townname, sectname, sectcode, landcode } = appState.factoryData // 白鷺段(1005)817地號 return `${townname} ${sectname} (${sectcode}) ${landcode}地號` + } else { + return '' } })