Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukaii committed Dec 30, 2020
2 parents 415b8a1 + 357a9b3 commit e3ff647
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/components/FactoryDetailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,20 @@
</v-card-text>

<v-slide-group :show-arrows="images > 0 ? 'desktop' : false" ref="slideGroup">
<v-slide-item v-for="(image, index) in images" class="mr-4" :key="image.id" :class="{ 'ml-4': index === 0 }">
<img :src="image.url" class="factory-slide-image" />
</v-slide-item>
<v-slide-item>
<div class='update-image-button d-flex flex-column justify-center align-items-center' @click="pageTransition.startUpdateFactoryImages">
<v-icon color="white" class='mb-1'>mdi-camera-plus</v-icon>
補充照片
</div>
</v-slide-item>
<v-slide-item v-for="(image, index) in images" class="mr-4" :key="image.id" :class="{ 'ml-4': index === 0 }">
<img :src="image.url" class="factory-slide-image" />
</v-slide-item>
</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 e3ff647

Please sign in to comment.