Browse Source

fix: 🧩 相关优化

pull/5/head
liyongle 3 years ago
parent
commit
3124473236
  1. 2
      public/static/offline/JSON/getArtWorkList.json
  2. 7
      public/static/qm/MainMap_QM.js
  3. 8
      src/components/Map/Map.vue
  4. 6
      src/components/PlateKeyboard/PlateKeyboard.vue
  5. 3
      src/components/PublicComponent/PublicComponent.vue
  6. 10
      src/components/Recommend/Recommend.vue
  7. 6
      src/composables/useInitMap.ts
  8. 4
      src/store/root/actions.ts
  9. 4
      src/store/root/state.ts
  10. 2
      src/views/Guide/FloorPicList.vue
  11. 10
      src/views/Guide/Guide.vue
  12. 17
      src/views/Nav/Nav.vue

2
public/static/offline/JSON/getArtWorkList.json

@ -9,7 +9,7 @@
"name": "猩猩的太空漫步",
"nameEn": "dddd",
"file_code": [
"/iotFile/project-ey_fpaur6s6fkgvszywana/20230713/vwcYXFrhK1CbEB6uFy76R.png"
"/iotFile/project-ey_fpaur6s6fkgvszywana/20230711/i5NJjQ-h_RKrWqWza7g79.jpg"
],
"point": "0_3_4",
"content": "vnasfkvl",

7
public/static/qm/MainMap_QM.js

@ -78,7 +78,7 @@ QMUtil = function () {
//debug 参数 相机坐标/ 镜头方向
this.guiOptions = { cameraX: 0, cameraY: 220, cameraZ: 220, targatX: 0, targatY: 0, targatZ: 0 }; //this.button = function() {};
this.sceneGap = { x: 0, y: 0, z: 0, scale: dir ? 0.15 : 0.055 }; //改变地图位置,大小
this.sceneGap = { x: 0, y: 0, z: 0, scale: dir ? 0.15 : 0.06 }; //改变地图位置,大小
this.selectBuild = 0;
this.selectFloor = 0;
@ -4845,7 +4845,7 @@ MainMap_QM.prototype = {
}
let zo = 2, tz = 2, boxT = 0, boxZ = 0;
let add = Map_QM.util.options.showStyle ? 80 : 40;
let add = Map_QM.util.options.showStyle ? 120 : 40;
Map_QM.util._indexPathFloor++;
let toFloor = parseInt(Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor);
Map_QM.util.selectFloor = toFloor;
@ -4861,6 +4861,7 @@ MainMap_QM.prototype = {
document.getElementById('moveFloor').style.bottom = zo + "px";
document.getElementById('moveFloor').style.width = add + "px";
document.getElementById('moveFloor').style.height = add + "px";
document.getElementById('moveFloor').style.left = "4px";
Map_QM.moveFloorbg.element.style.visibility = "visible";
Map_QM.moveFloorbg.element.style.width = (add + 8) + "px";
Map_QM.moveFloorbg.element.style.height = (floorArr.length * add) + "px";
@ -5341,7 +5342,7 @@ FloorMap_QM.prototype = {
alphaTest: 0.1
});
let sprite = new MySprite_QM(spriteMaterial);
sprite.scale.set(64, 64, 1);
sprite.scale.set(128, 128, 1);
sprite.imgUrl = url;
sprite.center = new THREE.Vector2(0.5, 0);
sprite.userData = item;

8
src/components/Map/Map.vue

@ -116,8 +116,6 @@ function handleDetail() {
font-family: 'font_bold';
color: #fff;
font-weight: 700;
@include no-wrap;
}
.go-button {
width: 125px;
@ -143,7 +141,7 @@ function handleDetail() {
}
#moveFloorBG {
position: absolute;
width: 48px;
width: 128px;
background-color: #fff;
border-radius: 5px;
visibility: hidden;
@ -151,9 +149,9 @@ function handleDetail() {
#moveFloor {
position: absolute;
bottom: 2px;
left: 2px;
left: 4px;
z-index: -1;
width: 48px;
width: 120px;
height: 48px;
background-color: #dbb186;
border-radius: 5px;

6
src/components/PlateKeyboard/PlateKeyboard.vue

@ -109,6 +109,12 @@ onBeforeUnmount(() => {
}
&.space {
width: 88px;
&[data-key='F'],
&[data-key='M'],
&[data-key='T'],
&[data-key='Z'] {
margin-right: 24px;
}
&.del {
width: 184px;
}

3
src/components/PublicComponent/PublicComponent.vue

@ -77,6 +77,9 @@ onBeforeUnmount(() => {
watch(route, to => {
if (to.fullPath === '/' || to.fullPath === '/nav') {
window?.Map_QM?.startRender()
if (to.fullPath === '/') {
window?.Map_QM?.showFloor(6)
}
} else {
window?.Map_QM?.cancelRender()
}

10
src/components/Recommend/Recommend.vue

@ -21,7 +21,7 @@
<div class="shopName">{{ switchLanguage(shopMap[item.content.shopCode], 'shopName') }}</div>
<div class="number">
<img src="@/assets/images/art/poi.svg" alt="" />
<div>{{ shopMap[item.content.shopCode].houseNumber }}</div>
<div class="numbers">{{ shopMap[item.content.shopCode].houseNumber }}</div>
</div>
</div>
</div>
@ -202,14 +202,16 @@ getColumnList().then(({ data }) => {
}
.number {
@include fl();
@include no-wrap;
max-width: 80px;
img {
width: 16px;
height: 16px;
margin-right: 8px;
}
.numbers {
@include no-wrap;
max-width: 80px;
}
}
}
}

6
src/composables/useInitMap.ts

@ -49,12 +49,13 @@ export const useInitMap = async function () {
//点击地图店铺box
function onClickShop(event: any) {
const store = useRootStore()
if (event.data) {
showMapDialog()
hideMapDialog()
!window.shopInfo && document.getElementById('shopInfo')
window.Map_QM.addElementLabel(window.shopInfo, event.data.xaxis, event.data.yaxis)
store.SET_SHOP(event.data.shopData)
store.SET_CURRENT_ART_NAME('')
showMapDialog()
}
// else {
// hideMapDialog()
@ -80,6 +81,7 @@ function onClickArt(event: any) {
logoUrl: '',
yaxis: Number(poi[2])
}
store.SET_CURRENT_ART_NAME(event.data.artData.content.name)
store.SET_SHOP(shop)
}
}

4
src/store/root/actions.ts

@ -26,6 +26,7 @@ export interface Actions {
SET_ART_PLACE_LIST(list: ArtPlace[]): void
SET_MAP_PARK_LIST(list: string[]): void
SET_SPECIAL_LIST(list: SpecialIndustry[]): void
SET_CURRENT_ART_NAME(name: string): void
}
export type GenActions = CreateActions<Root, State, Actions>
@ -96,5 +97,8 @@ export const actions: GenActions = {
},
SET_SPECIAL_LIST(list) {
this.specialIndustryList = list
},
SET_CURRENT_ART_NAME(name) {
this.currentArtName = name
}
}

4
src/store/root/state.ts

@ -22,6 +22,7 @@ export interface State {
artPlaceList: ArtPlace[] // 艺术装置集合
mapParkList: string[] // 停车位列表
specialIndustryList: SpecialIndustry[] // 特殊业态列表
currentArtName: string // 当前选中艺术装置
}
export const state = (): State => ({
@ -45,5 +46,6 @@ export const state = (): State => ({
shopMap: {} as ShopMap,
artPlaceList: [],
mapParkList: [],
specialIndustryList: []
specialIndustryList: [],
currentArtName: ''
})

2
src/views/Guide/FloorPicList.vue

@ -46,7 +46,7 @@ getFloorPicList().then(({ data }) => {
border: 2px solid #fff;
border-radius: 0 24px 24px 0;
img {
width: 200px;
width: 208px;
height: 80px;
}
}

10
src/views/Guide/Guide.vue

@ -105,7 +105,7 @@ import ArtList from './ArtList.vue'
import FloorPicList from './FloorPicList.vue'
const store = useRootStore()
const { switchLanguage } = useSwitchLanguage()
const { language, facilityList, artPlaceList } = toRefs(store)
const { language, facilityList, artPlaceList, currentArtName } = toRefs(store)
const { floorIdx, areaName, selectedShopList, changeFloor, changeArea, changeFoodShopList } = useGuideFilterShop() //
const { handleMapIcon, list, mapIdx } = useGuideMapOperation(changeFloor, changeFoodShopList) //
const { handleFacility } = useFacilityNav() //
@ -122,22 +122,21 @@ getAreaPicList().then(({ data }) => {
function changeFloors(floorOrder: number) {
changeFloor(floorOrder)
mapIdx.value = -1
currentArtName.value = ''
currentArtName.value && store.SET_CURRENT_ART_NAME('')
}
//
function changeAreas(name: string) {
changeArea(name)
mapIdx.value = -1
currentArtName.value = ''
currentArtName.value && store.SET_CURRENT_ART_NAME('')
}
const currentArtName = ref('')
//
function show(item: ArtPlace) {
currentArtName.value = item.content.name
//
const poi = item.content.point.split('_')
changeFloors(Number(poi[1]))
hideMapDialog()
window.Map_QM.addElementByNode(document.getElementById('artWorkInfo'), Number(poi[2]))
const art: any = document.getElementById('artWorkInfo')
@ -154,6 +153,7 @@ function show(item: ArtPlace) {
yaxis: Number(poi[2]),
doorMaterialList: item.content.file_code
}
store.SET_CURRENT_ART_NAME(item.content.name)
store.SET_SHOP(shop)
}
</script>

17
src/views/Nav/Nav.vue

@ -147,7 +147,7 @@
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
import { onUnmounted, ref, watch } from 'vue'
import { storeToRefs } from 'pinia'
import { useRootStore } from '@/store/root'
import { useMapNavControl } from '@/composables/useMapNavControl'
@ -215,6 +215,21 @@ if (showSearch.value) {
watch(shop, newVal => {
startNavi({ ...newVal })
})
onUnmounted(() => {
const art: any = document.getElementById('mapContainer')
art.style.width = '2244px'
art.style.height = '1352px'
art.style.right = '690px'
art.style.top = '304px'
window.Map_QM.changeWindowResize(2244, 1352)
})
const art: any = document.getElementById('mapContainer')
art.style.width = '2528px'
art.style.height = '1896px'
art.style.right = '0'
art.style.top = '0'
window.Map_QM.changeWindowResize(2528, 1896)
</script>
<style lang="scss" scoped>

Loading…
Cancel
Save