Skip to content

Commit

Permalink
Merge pull request #60 from Disfactory/feature/add-landcode-to-detail…
Browse files Browse the repository at this point in the history
…-page

Add landcode to factory detail
  • Loading branch information
Yukaii authored Dec 16, 2020
2 parents 22df964 + db880ff commit 357a9b3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/components/FactoryDetailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@
</v-slide-group>

<div class="mt-4 mx-3 mb-2">
<!--
<h3 class="mb-1">地段 / 地址</h3>
<p class="mb-5">台中市大雅區自強段(701)7 地號</p>
-->
<p class="mb-5" style="line-height: 1.3;">{{ factoryAddressAndLandcode }}</p>

<div v-if="full || $vuetify.breakpoint.mdAndUp" class="mb-5">
<h3 class="mb-1">經緯度</h3>
Expand Down Expand Up @@ -174,11 +172,23 @@ 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(() => {
if (appState.factoryData) {
const { townname, sectname, sectcode, landcode } = appState.factoryData
// 白鷺段(1005)817地號
return `${townname} ${sectname} (${sectcode}) ${landcode}地號`
} else {
return ''
}
})
const full = computed(() => appState.factoryDetailsExpanded)
Expand Down Expand Up @@ -273,6 +283,7 @@ export default createComponent({
factoryId,
factoryType,
factoryName,
factoryAddressAndLandcode,
pastDescriptions,
longitude,
latitude,
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 357a9b3

Please sign in to comment.