@qispace/vue3-player 0.0.15 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-components/config/vite.config.d.ts +2 -0
- package/dist/vue-components/config/vite.config.dev.d.ts +2 -0
- package/dist/vue-components/config/vite.config.web-components.d.ts +2 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooser.vue.d.ts +129 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooserNavigation.vue.d.ts +46 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooserRaster.vue.d.ts +77 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooserRotator.vue.d.ts +43 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooserSvg.vue.d.ts +77 -0
- package/dist/vue-components/src/components/apartmentChooser/index.d.ts +5 -0
- package/dist/vue-components/src/components/apartmentChooser/types.d.ts +13 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooser.vue.d.ts +93 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserRaster.vue.d.ts +97 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserRasterOverlay.vue.d.ts +46 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserSceneImageStack.vue.d.ts +27 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserSunSimControl.vue.d.ts +37 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserSvg.vue.d.ts +102 -0
- package/dist/vue-components/src/components/buildingPicker/index.d.ts +6 -0
- package/dist/vue-components/src/components/buildingPicker/types.d.ts +11 -0
- package/dist/{components → vue-components/src/components}/index.d.ts +1 -1
- package/dist/vue-components/src/components/shared/VFloatingCard.vue.d.ts +30 -0
- package/dist/vue-components/src/components/shared/VHoverProbe.vue.d.ts +4 -0
- package/dist/vue-components/src/components/shared/VNorthDirection.vue.d.ts +15 -0
- package/dist/vue-components/src/components/shared/VZoomBox.vue.d.ts +60 -0
- package/dist/vue-components/src/components/shared/index.d.ts +4 -0
- package/dist/vue-components/src/components/virtualTour/VCompass.vue.d.ts +15 -0
- package/dist/vue-components/src/components/virtualTour/VDisclaimer.vue.d.ts +2 -0
- package/dist/vue-components/src/components/virtualTour/VFloorLevel.vue.d.ts +38 -0
- package/dist/vue-components/src/components/virtualTour/VFullScreenButton.vue.d.ts +19 -0
- package/dist/vue-components/src/components/virtualTour/VInteriorSelector.vue.d.ts +21 -0
- package/dist/vue-components/src/components/virtualTour/VPlayer.vue.d.ts +74 -0
- package/dist/vue-components/src/components/virtualTour/VSettingsUI.vue.d.ts +23 -0
- package/dist/vue-components/src/components/virtualTour/VSingleImage.vue.d.ts +31 -0
- package/dist/vue-components/src/components/virtualTour/VSocialShare.vue.d.ts +2 -0
- package/dist/vue-components/src/components/virtualTour/VTimeOfDay.vue.d.ts +34 -0
- package/dist/vue-components/src/components/virtualTour/VTutorial.vue.d.ts +19 -0
- package/dist/vue-components/src/components/virtualTour/VViewModeToggle.vue.d.ts +19 -0
- package/dist/vue-components/src/components/virtualTour/VVirtualTour.vue.d.ts +156 -0
- package/dist/vue-components/src/components/virtualTour/VWaypointCarousel.vue.d.ts +25 -0
- package/dist/vue-components/src/components/virtualTour/index.d.ts +1 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VMiniMap.vue.d.ts +35 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VMiniMapMap.vue.d.ts +25 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VMinimapCompass.vue.d.ts +19 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VMoveable.vue.d.ts +18 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VRotationMarker.vue.d.ts +15 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VSunSimulationSlider.vue.d.ts +23 -0
- package/dist/vue-components/src/components/virtualTour/minimap/index.d.ts +1 -0
- package/dist/vue-components/src/lib/apartmentChooser/BuildingViewerModel.d.ts +18 -0
- package/dist/vue-components/src/lib/apartmentChooser/RotationStep.d.ts +10 -0
- package/dist/vue-components/src/lib/apartmentChooser/SceneRotator.d.ts +10 -0
- package/dist/vue-components/src/lib/apartmentChooser/index.d.ts +3 -0
- package/dist/vue-components/src/lib/buildingPicker/BuildingMap.d.ts +7 -0
- package/dist/vue-components/src/lib/buildingPicker/BuildingPickerResourceProvider.d.ts +27 -0
- package/dist/vue-components/src/lib/buildingPicker/CanvasRaster.d.ts +8 -0
- package/dist/vue-components/src/lib/buildingPicker/DayOfYearSelector.d.ts +12 -0
- package/dist/vue-components/src/lib/buildingPicker/SampleRaster.d.ts +5 -0
- package/dist/vue-components/src/lib/buildingPicker/index.d.ts +5 -0
- package/dist/vue-components/src/lib/shared/BatchLoadTracker.d.ts +17 -0
- package/dist/vue-components/src/lib/shared/I18N.d.ts +7 -0
- package/dist/vue-components/src/lib/shared/ResourceLoader.d.ts +5 -0
- package/dist/vue-components/src/lib/shared/index.d.ts +3 -0
- package/dist/vue-components/src/lib/virtualTour/CameraSnapshot.d.ts +5 -0
- package/dist/vue-components/src/lib/virtualTour/FullscreenModel.d.ts +13 -0
- package/dist/vue-components/src/vue-components.d.ts +2 -0
- package/dist/vue-components/src/vue-components.esm.d.ts +4 -0
- package/dist/vue-components/src/web-components.d.ts +11 -0
- package/dist/vue-components/style.css +1 -0
- package/dist/vue-components/vue3-player.js +4744 -0
- package/dist/vue-components/vue3-player.umd.cjs +1 -0
- package/package.json +25 -15
- package/dist/components/apartmentChooser/QiApartmentChooser.vue.d.ts +0 -2
- package/dist/components/apartmentChooser/QiApartmentChooserNavigation.vue.d.ts +0 -51
- package/dist/components/apartmentChooser/QiApartmentChooserRaster.vue.d.ts +0 -2
- package/dist/components/apartmentChooser/QiApartmentChooserRotator.vue.d.ts +0 -65
- package/dist/components/apartmentChooser/QiApartmentChooserSvg.vue.d.ts +0 -2
- package/dist/components/buildingPicker/QiBuildingChooser.vue.d.ts +0 -121
- package/dist/components/buildingPicker/QiBuildingChooserRaster.vue.d.ts +0 -2
- package/dist/components/buildingPicker/QiBuildingChooserRasterOverlay.vue.d.ts +0 -53
- package/dist/components/buildingPicker/QiBuildingChooserSceneImageStack.vue.d.ts +0 -32
- package/dist/components/buildingPicker/QiBuildingChooserSunSimControl.vue.d.ts +0 -42
- package/dist/components/buildingPicker/QiBuildingChooserSvg.vue.d.ts +0 -2
- package/dist/components/shared/QiFloatingCard.vue.d.ts +0 -18
- package/dist/components/shared/QiHoverProbe.vue.d.ts +0 -4
- package/dist/components/shared/QiNorthDirection.vue.d.ts +0 -21
- package/dist/components/shared/QiZoomBox.vue.d.ts +0 -83
- package/dist/components/virtualTourV2/Compass.vue.d.ts +0 -22
- package/dist/components/virtualTourV2/Disclaimer.vue.d.ts +0 -4
- package/dist/components/virtualTourV2/FloorLevel.vue.d.ts +0 -27
- package/dist/components/virtualTourV2/FullScreenButton.vue.d.ts +0 -14
- package/dist/components/virtualTourV2/InteriorSelector.vue.d.ts +0 -24
- package/dist/components/virtualTourV2/Player.vue.d.ts +0 -82
- package/dist/components/virtualTourV2/SettingsUI.vue.d.ts +0 -105
- package/dist/components/virtualTourV2/SingleImage.vue.d.ts +0 -26
- package/dist/components/virtualTourV2/SocialShare.vue.d.ts +0 -10
- package/dist/components/virtualTourV2/TimeOfDay.vue.d.ts +0 -27
- package/dist/components/virtualTourV2/Tutorial.vue.d.ts +0 -23
- package/dist/components/virtualTourV2/ViewModeToggle.vue.d.ts +0 -16
- package/dist/components/virtualTourV2/VirtualTourV2.vue.d.ts +0 -322
- package/dist/components/virtualTourV2/WaypointCarousel.vue.d.ts +0 -31
- package/dist/components/virtualTourV2/index.d.ts +0 -1
- package/dist/components/virtualTourV2/minimapv2/MiniMapMap.vue.d.ts +0 -82
- package/dist/components/virtualTourV2/minimapv2/MiniMapV2.vue.d.ts +0 -78
- package/dist/components/virtualTourV2/minimapv2/MinimapCompass.vue.d.ts +0 -30
- package/dist/components/virtualTourV2/minimapv2/Moveable.vue.d.ts +0 -8
- package/dist/components/virtualTourV2/minimapv2/RotationMarkerV2.vue.d.ts +0 -12
- package/dist/components/virtualTourV2/minimapv2/SunsimulationSlider.vue.d.ts +0 -48
- package/dist/components/virtualTourV2/minimapv2/index.d.ts +0 -1
- package/dist/style.css +0 -1
- package/dist/vue3-player.js +0 -5414
- package/dist/vue3-player.umd.cjs +0 -1
- package/src/components/apartmentChooser/QiApartmentChooser.vue +0 -319
- package/src/components/apartmentChooser/QiApartmentChooserNavigation.vue +0 -88
- package/src/components/apartmentChooser/QiApartmentChooserRaster.vue +0 -408
- package/src/components/apartmentChooser/QiApartmentChooserRotator.vue +0 -202
- package/src/components/apartmentChooser/QiApartmentChooserSvg.vue +0 -257
- package/src/components/apartmentChooser/index.js +0 -5
- package/src/components/buildingPicker/QiBuildingChooser.vue +0 -61
- package/src/components/buildingPicker/QiBuildingChooserRaster.vue +0 -312
- package/src/components/buildingPicker/QiBuildingChooserRasterOverlay.vue +0 -96
- package/src/components/buildingPicker/QiBuildingChooserSceneImageStack.vue +0 -89
- package/src/components/buildingPicker/QiBuildingChooserSunSimControl.vue +0 -257
- package/src/components/buildingPicker/QiBuildingChooserSvg.vue +0 -414
- package/src/components/buildingPicker/index.js +0 -6
- package/src/components/index.ts +0 -4
- package/src/components/shared/QiFloatingCard.vue +0 -76
- package/src/components/shared/QiHoverProbe.vue +0 -22
- package/src/components/shared/QiNorthDirection.vue +0 -27
- package/src/components/shared/QiZoomBox.vue +0 -322
- package/src/components/shared/index.js +0 -4
- package/src/components/virtualTourV2/Compass.vue +0 -37
- package/src/components/virtualTourV2/Disclaimer.vue +0 -41
- package/src/components/virtualTourV2/FloorLevel.vue +0 -73
- package/src/components/virtualTourV2/FullScreenButton.vue +0 -23
- package/src/components/virtualTourV2/InteriorSelector.vue +0 -90
- package/src/components/virtualTourV2/ManualSlideShow.vue +0 -198
- package/src/components/virtualTourV2/ManualSlideShowPlayer.vue +0 -159
- package/src/components/virtualTourV2/Player.vue +0 -300
- package/src/components/virtualTourV2/ScrollHelper.vue +0 -74
- package/src/components/virtualTourV2/SettingsUI.vue +0 -355
- package/src/components/virtualTourV2/SingleImage.vue +0 -36
- package/src/components/virtualTourV2/SocialShare.vue +0 -163
- package/src/components/virtualTourV2/TimeOfDay.vue +0 -50
- package/src/components/virtualTourV2/Tutorial.vue +0 -690
- package/src/components/virtualTourV2/ViewModeToggle.vue +0 -24
- package/src/components/virtualTourV2/VirtualTourV2.vue +0 -875
- package/src/components/virtualTourV2/WaypointCarousel.vue +0 -162
- package/src/components/virtualTourV2/index.ts +0 -20
- package/src/components/virtualTourV2/minimapv2/MiniMapMap.vue +0 -262
- package/src/components/virtualTourV2/minimapv2/MiniMapV2.vue +0 -110
- package/src/components/virtualTourV2/minimapv2/MinimapCompass.vue +0 -39
- package/src/components/virtualTourV2/minimapv2/Moveable.vue +0 -208
- package/src/components/virtualTourV2/minimapv2/RotationMarkerV2.vue +0 -79
- package/src/components/virtualTourV2/minimapv2/SunsimulationSlider.vue +0 -203
- package/src/components/virtualTourV2/minimapv2/index.ts +0 -1
- /package/dist/{lib → vue-components/src/lib}/index.d.ts +0 -0
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="viewModel">
|
|
3
|
-
<div class="interactive-viewer">
|
|
4
|
-
<div class="fill-parent">
|
|
5
|
-
<qi-zoom-box
|
|
6
|
-
:desktop="loadState.isReady && interactiveDesktop"
|
|
7
|
-
:mobile="loadState.isReady && interactiveMobile"
|
|
8
|
-
>
|
|
9
|
-
<qi-apartment-chooser-rotator
|
|
10
|
-
:cdn-file-resolver="cdnFileResolver"
|
|
11
|
-
:view-model="viewModel"
|
|
12
|
-
:cardinal-frames="scenes"
|
|
13
|
-
:build="build"
|
|
14
|
-
@progress="loadState.progress = $event"
|
|
15
|
-
@loaded="loadState.isReady = true"
|
|
16
|
-
@error="loadState.isError = true"
|
|
17
|
-
/>
|
|
18
|
-
<template v-if="loadState.isReady">
|
|
19
|
-
<div>
|
|
20
|
-
<component
|
|
21
|
-
:is="overlayComponent"
|
|
22
|
-
:cdn-file-resolver="cdnFileResolver"
|
|
23
|
-
:view-model="viewModel"
|
|
24
|
-
:selected-unit-id="selectedUnitId"
|
|
25
|
-
:scene-data="sceneData"
|
|
26
|
-
:color-callback="colorCallback"
|
|
27
|
-
:unit-callback="unitCallback"
|
|
28
|
-
:can-go-to-unit-callback="canGoToUnitCallback"
|
|
29
|
-
:draw-observer="drawObserver"
|
|
30
|
-
@select-unit="$emit('select-unit', $event)"
|
|
31
|
-
@go-to-unit="$emit('go-to-unit', $event)"
|
|
32
|
-
@hover-over="hoverOver"
|
|
33
|
-
@hover-out="hoverOut"
|
|
34
|
-
@pos="onPos"
|
|
35
|
-
>
|
|
36
|
-
<template #default="props">
|
|
37
|
-
<slot v-bind="props" />
|
|
38
|
-
</template>
|
|
39
|
-
</component>
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
|
42
|
-
</qi-zoom-box>
|
|
43
|
-
<qi-floating-card
|
|
44
|
-
v-if="hoverApartment && showCards"
|
|
45
|
-
:is-hoverable="isHoverable"
|
|
46
|
-
:pos="pos"
|
|
47
|
-
@outside="closeHandler"
|
|
48
|
-
>
|
|
49
|
-
<slot
|
|
50
|
-
:unit="hoverApartment"
|
|
51
|
-
:can-go-to-unit="canGoToUnitCallback(hoverApartment)"
|
|
52
|
-
:go-to-unit="
|
|
53
|
-
() =>
|
|
54
|
-
canGoToUnitCallback(hoverApartment) &&
|
|
55
|
-
$emit('go-to-unit', hoverApartment)
|
|
56
|
-
"
|
|
57
|
-
:pos="pos"
|
|
58
|
-
:is-hoverable="isHoverable"
|
|
59
|
-
:close="closeHandler"
|
|
60
|
-
/>
|
|
61
|
-
</qi-floating-card>
|
|
62
|
-
<template v-if="loadState.isReady">
|
|
63
|
-
<div class="navigation">
|
|
64
|
-
<qi-apartment-chooser-navigation
|
|
65
|
-
:can-go-to-unit-callback="canGoToUnitCallback"
|
|
66
|
-
:selected-unit="selectedUnit"
|
|
67
|
-
:prev-unit="prevUnit"
|
|
68
|
-
:next-unit="nextUnit"
|
|
69
|
-
:view-model="viewModel"
|
|
70
|
-
@go-to-unit="$emit('go-to-unit', $event)"
|
|
71
|
-
@prev-unit="$emit('nav-unit', prevUnit)"
|
|
72
|
-
@next-unit="$emit('nav-unit', nextUnit)"
|
|
73
|
-
/>
|
|
74
|
-
</div>
|
|
75
|
-
</template>
|
|
76
|
-
<div v-else-if="!loadState.isError">
|
|
77
|
-
<v-progress-linear
|
|
78
|
-
:indeterminate="!loadState.progress"
|
|
79
|
-
:value="loadState.progress"
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
<qi-hover-probe ref="hoverProbe" />
|
|
85
|
-
</div>
|
|
86
|
-
</template>
|
|
87
|
-
|
|
88
|
-
<script>
|
|
89
|
-
import QiApartmentChooserRaster from "./QiApartmentChooserRaster.vue";
|
|
90
|
-
import QiApartmentChooserSvg from "./QiApartmentChooserSvg.vue";
|
|
91
|
-
import QiApartmentChooserNavigation from "./QiApartmentChooserNavigation.vue";
|
|
92
|
-
import QiApartmentChooserRotator from "./QiApartmentChooserRotator.vue";
|
|
93
|
-
import QiFloatingCard from "@/components/shared/QiFloatingCard.vue";
|
|
94
|
-
import QiHoverProbe from "@/components/shared/QiHoverProbe.vue";
|
|
95
|
-
import QiZoomBox from "@/components/shared/QiZoomBox.vue";
|
|
96
|
-
import { ResourceLoader } from "@/lib/shared/ResourceLoader";
|
|
97
|
-
import {
|
|
98
|
-
SCENE_COUNT,
|
|
99
|
-
nextScene,
|
|
100
|
-
BuildingViewerModel,
|
|
101
|
-
} from "@/lib/apartmentChooser/BuildingViewerModel";
|
|
102
|
-
import { I18N } from "@/lib/shared/I18N";
|
|
103
|
-
|
|
104
|
-
const DEFAULT_SCENE = 4;
|
|
105
|
-
const DEFAULT_CARDINAL_FRAMES = [0, 16, 32, 48];
|
|
106
|
-
|
|
107
|
-
export default {
|
|
108
|
-
name: "QiApartmentChooser",
|
|
109
|
-
components: {
|
|
110
|
-
QiApartmentChooserRaster,
|
|
111
|
-
QiApartmentChooserSvg,
|
|
112
|
-
QiApartmentChooserNavigation,
|
|
113
|
-
QiApartmentChooserRotator,
|
|
114
|
-
QiFloatingCard,
|
|
115
|
-
QiHoverProbe,
|
|
116
|
-
QiZoomBox,
|
|
117
|
-
},
|
|
118
|
-
provide() {
|
|
119
|
-
const localizer = this.i18n
|
|
120
|
-
? new I18N(this.i18n.labels, this.i18n.language)
|
|
121
|
-
: new I18N();
|
|
122
|
-
return {
|
|
123
|
-
i18n: localizer,
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
emits: [
|
|
127
|
-
"select-unit",
|
|
128
|
-
"go-to-unit",
|
|
129
|
-
"nav-unit",
|
|
130
|
-
"hover-over-unit",
|
|
131
|
-
"hover-out-unit",
|
|
132
|
-
"initialized",
|
|
133
|
-
],
|
|
134
|
-
props: {
|
|
135
|
-
i18n: { type: Object, default: undefined },
|
|
136
|
-
showCards: { type: Boolean, default: true },
|
|
137
|
-
build: { type: String, default: "" },
|
|
138
|
-
buildingSceneDataResolver: { type: Function, default: null },
|
|
139
|
-
buildingScenesByApartmentResolver: { type: Function, default: null },
|
|
140
|
-
cdnFileResolver: { type: Function, required: true },
|
|
141
|
-
colorCallback: {
|
|
142
|
-
type: Function,
|
|
143
|
-
default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 }),
|
|
144
|
-
},
|
|
145
|
-
unitCallback: { type: Function, default: (unitId) => unitId },
|
|
146
|
-
canGoToUnitCallback: { type: Function, default: () => true },
|
|
147
|
-
selectedUnitId: { type: String, default: null },
|
|
148
|
-
nextUnit: { type: Object, default: null },
|
|
149
|
-
prevUnit: { type: Object, default: null },
|
|
150
|
-
drawObserver: {
|
|
151
|
-
type: [Object, Array, String, Number, Boolean],
|
|
152
|
-
default: null,
|
|
153
|
-
},
|
|
154
|
-
interactiveDesktop: { type: Boolean, default: true },
|
|
155
|
-
interactiveMobile: { type: Boolean, default: true },
|
|
156
|
-
useSvg: { type: Boolean, default: false },
|
|
157
|
-
},
|
|
158
|
-
data() {
|
|
159
|
-
return {
|
|
160
|
-
loadState: { isReady: false, isError: false, progress: undefined },
|
|
161
|
-
scenesByApartment: null,
|
|
162
|
-
sceneData: null,
|
|
163
|
-
scenes: null,
|
|
164
|
-
viewModel: undefined,
|
|
165
|
-
resourceLoader: new ResourceLoader(),
|
|
166
|
-
pos: { x: 0, y: 0, width: 0, height: 0 },
|
|
167
|
-
closeHandler: undefined,
|
|
168
|
-
hoverApartment: undefined,
|
|
169
|
-
};
|
|
170
|
-
},
|
|
171
|
-
computed: {
|
|
172
|
-
isHoverable() {
|
|
173
|
-
return this.$refs.hoverProbe.isHoverEnabled;
|
|
174
|
-
},
|
|
175
|
-
selectedUnit() {
|
|
176
|
-
return this.unitCallback
|
|
177
|
-
? this.unitCallback(this.selectedUnitId)
|
|
178
|
-
: this.selectedUnitId;
|
|
179
|
-
},
|
|
180
|
-
overlayComponent() {
|
|
181
|
-
return this.useSvg ? QiApartmentChooserSvg : QiApartmentChooserRaster;
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
watch: {
|
|
185
|
-
selectedUnitId: {
|
|
186
|
-
handler() {
|
|
187
|
-
if (this.selectedUnitId && this.viewModel) {
|
|
188
|
-
const scene = this.scenesByApartment[this.selectedUnitId];
|
|
189
|
-
if (scene) {
|
|
190
|
-
this.viewModel.currentScene = scene;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
immediate: true,
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
async mounted() {
|
|
198
|
-
let sceneConfig = null;
|
|
199
|
-
try {
|
|
200
|
-
sceneConfig = await this.resourceLoader.loadJson(
|
|
201
|
-
this.cdnFileResolver("/apartmentChooser.json")
|
|
202
|
-
);
|
|
203
|
-
} catch {
|
|
204
|
-
console.info("apartmentChooser.json not found");
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const scene =
|
|
208
|
-
sceneConfig && sceneConfig.startScene !== undefined
|
|
209
|
-
? sceneConfig.startScene
|
|
210
|
-
: DEFAULT_SCENE;
|
|
211
|
-
this.scenes =
|
|
212
|
-
sceneConfig && sceneConfig.scenes !== undefined
|
|
213
|
-
? sceneConfig.scenes
|
|
214
|
-
: DEFAULT_CARDINAL_FRAMES;
|
|
215
|
-
this.sceneData =
|
|
216
|
-
sceneConfig && sceneConfig.sceneData !== undefined
|
|
217
|
-
? sceneConfig.sceneData.map((it) => ({
|
|
218
|
-
apartmentId: it.apartmentID,
|
|
219
|
-
index: it.index,
|
|
220
|
-
}))
|
|
221
|
-
: this.buildingSceneDataResolver
|
|
222
|
-
? await this.buildingSceneDataResolver()
|
|
223
|
-
: [];
|
|
224
|
-
this.scenesByApartment =
|
|
225
|
-
sceneConfig && sceneConfig.sceneData !== undefined
|
|
226
|
-
? sceneConfig.sceneData
|
|
227
|
-
.map((it) => {
|
|
228
|
-
// Weird conversion to assure back compatibility, needs to be examined and cleaned up
|
|
229
|
-
const bestScene = it.bestScene === 0 ? 4 : it.bestScene;
|
|
230
|
-
return { unitId: it.apartmentID, scene: bestScene };
|
|
231
|
-
})
|
|
232
|
-
.reduce((acc, it) => ({ ...acc, [it.unitId]: it.scene }), {})
|
|
233
|
-
: this.buildingScenesByApartmentResolver
|
|
234
|
-
? await this.buildingScenesByApartmentResolver()
|
|
235
|
-
: [];
|
|
236
|
-
|
|
237
|
-
const unitsSceneSort = (units, key = "unitId") => {
|
|
238
|
-
let startScene = scene;
|
|
239
|
-
let sceneArray = [];
|
|
240
|
-
for (let count = 0; count < SCENE_COUNT; count++) {
|
|
241
|
-
sceneArray.push(startScene);
|
|
242
|
-
startScene = nextScene(startScene);
|
|
243
|
-
}
|
|
244
|
-
units.sort((a, b) => {
|
|
245
|
-
const sceneAIndex = sceneArray.findIndex(
|
|
246
|
-
(s) => s === this.scenesByApartment[a[key]]
|
|
247
|
-
);
|
|
248
|
-
const sceneBIndex = sceneArray.findIndex(
|
|
249
|
-
(s) => s === this.scenesByApartment[b[key]]
|
|
250
|
-
);
|
|
251
|
-
if (sceneAIndex < sceneBIndex) {
|
|
252
|
-
return -1;
|
|
253
|
-
} else if (sceneAIndex > sceneBIndex) {
|
|
254
|
-
return 1;
|
|
255
|
-
} else {
|
|
256
|
-
return 0;
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
return units;
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
const initialize = (s) => {
|
|
263
|
-
this.viewModel = new BuildingViewerModel(s);
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
this.$emit("initialized", {
|
|
267
|
-
scene,
|
|
268
|
-
scenes: this.scenes,
|
|
269
|
-
sceneData: this.sceneData,
|
|
270
|
-
scenesByApartment: this.scenesByApartment,
|
|
271
|
-
unitsSceneSort,
|
|
272
|
-
initialize,
|
|
273
|
-
});
|
|
274
|
-
},
|
|
275
|
-
methods: {
|
|
276
|
-
onPos(pos) {
|
|
277
|
-
this.pos = pos;
|
|
278
|
-
},
|
|
279
|
-
hoverOver({ hoverApartment, closeHandler }) {
|
|
280
|
-
this.hoverApartment = hoverApartment;
|
|
281
|
-
this.closeHandler = closeHandler;
|
|
282
|
-
this.$emit("hover-over-unit", hoverApartment);
|
|
283
|
-
},
|
|
284
|
-
hoverOut({ hoverApartment, closeHandler }) {
|
|
285
|
-
this.hoverApartment = null;
|
|
286
|
-
this.closeHandler = closeHandler;
|
|
287
|
-
this.$emit("hover-out-unit", hoverApartment);
|
|
288
|
-
},
|
|
289
|
-
},
|
|
290
|
-
};
|
|
291
|
-
</script>
|
|
292
|
-
|
|
293
|
-
<style scoped>
|
|
294
|
-
.interactive-viewer {
|
|
295
|
-
padding-top: 56.65%;
|
|
296
|
-
position: relative;
|
|
297
|
-
}
|
|
298
|
-
.fill-parent {
|
|
299
|
-
position: absolute;
|
|
300
|
-
top: 0;
|
|
301
|
-
bottom: 0;
|
|
302
|
-
left: 0;
|
|
303
|
-
right: 0;
|
|
304
|
-
}
|
|
305
|
-
.navigation {
|
|
306
|
-
position: absolute;
|
|
307
|
-
width: 100%;
|
|
308
|
-
bottom: 32px;
|
|
309
|
-
z-index: 99;
|
|
310
|
-
padding: 0 20px;
|
|
311
|
-
display: flex;
|
|
312
|
-
justify-content: center;
|
|
313
|
-
}
|
|
314
|
-
@media only screen and (max-width: 600px) {
|
|
315
|
-
.navigation {
|
|
316
|
-
bottom: 12px;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
</style>
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-btn
|
|
4
|
-
elevation="1"
|
|
5
|
-
icon="mdi-rotate-right"
|
|
6
|
-
class="black darken-1"
|
|
7
|
-
@click="viewModel.rotateClockwise()"
|
|
8
|
-
>
|
|
9
|
-
</v-btn>
|
|
10
|
-
<v-btn
|
|
11
|
-
elevation="1"
|
|
12
|
-
plain
|
|
13
|
-
icon="mdi-chevron-left"
|
|
14
|
-
class="mr-sm-4 ml-sm-8 mr-3 ml-3 black darken-1"
|
|
15
|
-
:disabled="!prevUnit"
|
|
16
|
-
@click="$emit('prev-unit')"
|
|
17
|
-
>
|
|
18
|
-
</v-btn>
|
|
19
|
-
<v-btn
|
|
20
|
-
color="success darken-2"
|
|
21
|
-
elevation="1"
|
|
22
|
-
rounded
|
|
23
|
-
plain
|
|
24
|
-
:disabled="!selectedUnit || !canGoToUnitCallback(selectedUnit)"
|
|
25
|
-
@click="$emit('go-to-unit', selectedUnit)"
|
|
26
|
-
>
|
|
27
|
-
<span
|
|
28
|
-
v-if="selectedUnit && canGoToUnitCallback(selectedUnit)"
|
|
29
|
-
class="d-none d-md-flex"
|
|
30
|
-
>
|
|
31
|
-
{{ i18n.getLabel("see-apartment") }}
|
|
32
|
-
</span>
|
|
33
|
-
<span>
|
|
34
|
-
{{ selectedUnit && "title" in selectedUnit ? selectedUnit.title : "-" }}
|
|
35
|
-
</span>
|
|
36
|
-
</v-btn>
|
|
37
|
-
<v-btn
|
|
38
|
-
elevation="1"
|
|
39
|
-
plain
|
|
40
|
-
icon="mdi-chevron-right"
|
|
41
|
-
class="mr-sm-8 ml-sm-4 mr-3 ml-3 black darken-1"
|
|
42
|
-
:disabled="!nextUnit"
|
|
43
|
-
@click="$emit('next-unit')"
|
|
44
|
-
>
|
|
45
|
-
</v-btn>
|
|
46
|
-
<v-btn
|
|
47
|
-
elevation="1"
|
|
48
|
-
plain
|
|
49
|
-
icon="mdi-rotate-left"
|
|
50
|
-
class="black darken-1"
|
|
51
|
-
@click="viewModel.rotateCounterClockwise()"
|
|
52
|
-
>
|
|
53
|
-
</v-btn>
|
|
54
|
-
</div>
|
|
55
|
-
</template>
|
|
56
|
-
<script>
|
|
57
|
-
export default {
|
|
58
|
-
name: "QiApartmentChooserNavigation",
|
|
59
|
-
inject: ["i18n"],
|
|
60
|
-
props: {
|
|
61
|
-
canGoToUnitCallback: { type: Function, default: () => true },
|
|
62
|
-
selectedUnit: { type: Object, default: null },
|
|
63
|
-
prevUnit: { type: Object, default: null },
|
|
64
|
-
nextUnit: { type: Object, default: null },
|
|
65
|
-
viewModel: { type: Object, required: true },
|
|
66
|
-
},
|
|
67
|
-
mounted() {
|
|
68
|
-
window.addEventListener("keydown", this.keyNavigate);
|
|
69
|
-
},
|
|
70
|
-
beforeUnmount() {
|
|
71
|
-
window.removeEventListener("keydown", this.keyNavigate);
|
|
72
|
-
},
|
|
73
|
-
methods: {
|
|
74
|
-
keyNavigate(e) {
|
|
75
|
-
if (e.keyCode === 37) {
|
|
76
|
-
this.prevUnit && this.$emit("prev-unit");
|
|
77
|
-
} else if (e.keyCode === 39) {
|
|
78
|
-
this.nextUnit && this.$emit("next-unit");
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
</script>
|
|
84
|
-
<style scoped>
|
|
85
|
-
.v-btn {
|
|
86
|
-
background-color: #fff;
|
|
87
|
-
}
|
|
88
|
-
</style>
|