fix: 联调3D版本

This commit is contained in:
wanganmao
2023-02-01 11:23:37 +08:00
parent e06b8df440
commit 6d0764fcbb
16 changed files with 316 additions and 66 deletions

View File

@@ -40,5 +40,51 @@ export const panoramas = reactive({
rotationY: 0,
multiply: 3, // #20221223 2 to 3
},
// #20230129, v5 shop1 - 大卖场->商超 shop3 - 便利店
// shop1 - env1 shelf -> v3.5
// shop1 - env1 empty
// shop1 - env2 freezer
// shop1 - env2 empty
// shop3 - env1 shelf
{
id: 'UoKkcO',
url: `${api.storePrefix}/v5/panorama/shop3/env1-shelf-4k.jpg`,
urlSmall: `${api.storePrefix}/v5/panorama/shop3/env1-shelf-4k.jpg`,
urlThumb: `${api.storePrefix}/v5/panorama/shop3/env1-shelf-thumb.jpg`,
rotationY: 0,
multiply: 3,
enterZoom: .75,
},
// {
// id: 'x3e7Ev',
// url: `${api.storePrefix}/v5/panorama/shop3/env1-empty-4k.jpg`,
// urlSmall: `${api.storePrefix}/v5/panorama/shop3/env1-empty-4k.jpg`,
// urlThumb: `${api.storePrefix}/v5/panorama/shop3/env1-empty-thumb.jpg`,
// rotationY: 0,
// multiply: 3,
// enterZoom: .75,
// },
{
id: 'd7BLLe',
url: `${api.storePrefix}/v5/panorama/shop3/env2-freezer-4k.jpg`,
urlSmall: `${api.storePrefix}/v5/panorama/shop3/env2-freezer-4k.jpg`,
urlThumb: `${api.storePrefix}/v5/panorama/shop3/env2-freezer-thumb.jpg`,
rotationY: 0,
multiply: 3,
enterZoom: .75,
},
// {
// id: 'VGLCzs',
// url: `${api.storePrefix}/v5/panorama/shop3/env2-empty-4k.jpg`,
// urlSmall: `${api.storePrefix}/v5/panorama/shop3/env2-empty-4k.jpg`,
// urlThumb: `${api.storePrefix}/v5/panorama/shop3/env2-empty-thumb.png`,
// rotationY: 0,
// multiply: 3,
// enterZoom: .75,
// },
],
})

View File

@@ -1,33 +1,35 @@
import { reactive } from 'vue'
import { api } from '../../../shelves-vue/api/baseApi'
export const rotSpritesList = [
{
id: 'fRwV2h',
name: "c-ada6l",
url: `${api.storePrefix}/rotSprite/fRwV2h/c-ada61/pano_$2.webp`,
urlSmall: `${api.storePrefix}/rotSprite/fRwV2h/c-ada61/pano_$2.webp`,
urlThumb: `${api.storePrefix}/rotSprite/fRwV2h/c-ada61/pano_00.webp`,
rsFrames: 36,
rsClockwise: true,
rsFirstRotY: -30,
rsWidth: 5.8, // 5m*1200/1034
rsHeight: 3.8, // 800/1200
rsCenterY: .26, // 214/800
},
{
id: 'LR2fN8',
name: "c-bca",
url: `${api.storePrefix}/rotSprite/LR2fN8/c-bca/pano_$2.webp`,
urlSmall: `${api.storePrefix}/rotSprite/LR2fN8/c-bca/pano_$2.webp`,
urlThumb: `${api.storePrefix}/rotSprite/LR2fN8/c-bca/pano_00.webp`,
rsFrames: 36,
rsClockwise: true,
rsFirstRotY: -30,
rsWidth: 4.78, // 4.6m*1200/1155
rsHeight: 3.19, // 800/1200
rsCenterY: .27, // 218/800
},
]
export const rotSprites = reactive({
list: [
{
id: 'fRwV2h',
name: "c-ada6l",
url: `${api.storePrefix}/rotSprite/fRwV2h/c-ada61/pano_$2.webp`,
urlSmall: `${api.storePrefix}/rotSprite/fRwV2h/c-ada61/pano_$2.webp`,
urlThumb: `${api.storePrefix}/rotSprie/fRwV2h/c-ada61/pano_00.webp`,
rsFrames: 36,
rsClockwise: true,
rsFirstRotY: -30,
rsWidth: 5.8, // 5m*1200/1034
rsHeight: 3.8, // 800/1200
rsCenterY: .26, // 214/800
},
{
id: 'LR2fN8',
name: "c-cba",
url: `${api.storePrefix}/rotSprite/LR2fN8/c-cba/pano_$2.webp`,
urlSmall: `${api.storePrefix}/rotSprite/LR2fN8/c-cba/pano_$2.webp`,
urlThumb: `${api.storePrefix}/rotSprie/LR2fN8/c-cba/pano_00.webp`,
rsFrames: 36,
rsClockwise: true,
rsFirstRotY: -30,
rsWidth: 4.78, // 4.6m*1200/1155
rsHeight: 3.19, // 800/1200
rsCenterY: .27, // 218/800
},
]
list: rotSpritesList
})

View File

@@ -13,7 +13,9 @@ export const shelves = reactive({
// cols: 3,
url: `${api.storePrefix}/shelf/cpIvDZ/shelf-1.glb`,
urlThumb: `${api.storePrefix}/shelf/cpIvDZ/shelf-1.png`,
cells: shelf1_cells
// cells: shelf1_cells, // #20230117
cells: [],
originCells: shelf1_cells,
},
{
id: 'Ik40of',
@@ -21,7 +23,9 @@ export const shelves = reactive({
// cols: 3,
url: `${api.storePrefix}/shelf/Sl28gs/shelf-2.glb`,
urlThumb: `${api.storePrefix}/shelf/Sl28gs/shelf-2.png`,
cells: shelf2_cells
// cells: shelf2_cells, // #20230117
cells: [],
originCells: shelf2_cells,
},
// #20220912, v3.5
@@ -29,7 +33,9 @@ export const shelves = reactive({
id: 'ULDcMg',
url: `${api.storePrefix}/v3.5/shelf/shelf-ghost-1.glb`,
urlThumb: `${api.storePrefix}/v3.5/shelf/shelf-ghost-1.png`,
cells: shelf3_cells,
// cells: shelf3_cells, // #20230117
cells: [],
originCells: shelf3_cells,
hideWhenSurvey: true,
},

View File

@@ -53,6 +53,12 @@ export const wares_v3_5_ = [
// #20220716, 增加 type
// type := 0, 由 commodity + texture 构成
// type := 1, 由内嵌的commodity构成, 模型可以自己带有texture, 简化整个流程
// #20230129,
// type := 21, rotSprite
import { rotSpritesList } from './rotSprites-mock-data'
rotSpritesList.forEach(itm=>{
itm.type = 21
})
let list = [
{
@@ -161,5 +167,8 @@ let list = [
// #20220912, v3.5 for v3.4
list = list.concat(wares_v3_5_)
// #20230129, wares + rotSprites
list = list.concat(rotSpritesList)
export const wares = reactive({ list })

View File

@@ -3,6 +3,8 @@
// export const DATA_VERSION = 3.5
import shopPanoData1 from './mock-data/data/shop-pano-data-1.json'
// import shopPanoData1 from './mock-data/data/shop-pano-data-230112bug.json' // <20>и<EFBFBD>͹<EFBFBD><CDB9><EFBFBD><EFBFBD>λ<EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ
import shopHallData1 from './mock-data/data/shop-hall-data-1.json'
// surveyId:5z3ouolx

View File

@@ -25,7 +25,7 @@ body {
/* font-family: "Microsoft YaHei"; */
/* font-family: monospace; */
font-family: "Microsoft YaHei";
font-family: "PingFang SC", "Microsoft Yahei";
}
/* Works on Firefox */
@@ -397,6 +397,65 @@ body {
background: none;
}
.ant-tree {
font-size: 13px;
font-weight: 600;
letter-spacing: 2px;
color: #434343;
/* direction: rtl;
text-align: left; */
}
.ant-tree>li:last-child {
padding-bottom: 0;
}
.ant-tree>li:first-child {
padding-top: 0;
}
.ant-tree-child-tree>li:first-child {
padding-top: 16px;
}
.ant-tree-child-tree .ant-tree-title {
padding-left: 10px;
}
.ant-tree li {
padding: 8px 0;
}
.ant-tree li .ant-tree-node-content-wrapper {
font-size: 13px;
font-weight: 600;
letter-spacing: 2px;
color: #434343;
/* padding: 0; */
}
.ant-tree li ul {
margin: 0;
padding: 0;
}
.ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected {
background-color: #DFF4D0;
}
.ant-tree li span.ant-tree-switcher {
float: right;
}
.ant-tree li span.ant-tree-switcher span {
font-size: 14px !important;
color: #434343;
}
.ant-tree li span.ant-tree-iconEle img {
width: 100%;
height: 100%;
}
.ant-divider {
color: #F5F5F5;
margin: 0;

View File

@@ -65,6 +65,8 @@
@remove="removeShelf" />
<TabListWare v-if="activeTabName == 'ware'" @clickThumb="clickThumbWare" @add="addWare"
@remove="removeWare" />
<TabListSchema v-if="activeTabName == 'schema'" :shopData="shopData"
@clickSchemaItem="clickSchemaItem" />
</div>
<div class="yo-main">
<SceneShopEditor v-if="shopData" ref="se" :shopData="shopData" :updateAction0="updateAction0"
@@ -80,7 +82,6 @@
@updateAction="updateAction = $event" />
<TabPropCellWare v-if="shopData && activePropName == 'ware'" :cell="selectedCell"
@updateAction="updateAction = $event" />
<TabPropSchema v-if="shopData && activePropName == 'schema'" />
</div>
</div>
</div>
@@ -104,7 +105,7 @@ import TabPropPanorama from "../../shelves-vue/components/editor/TabPropPanorama
import TabPropHall from "../../shelves-vue/components/editor/TabPropHall.vue"
import TabPropShelf from "../../shelves-vue/components/editor/TabPropShelf.vue"
import TabPropCellWare from '../../shelves-vue/components/editor/TabPropCellWare.vue'
import TabPropSchema from '../../shelves-vue/components/editor/TabPropSchema.vue'
import TabListSchema from '../../shelves-vue/components/editor/TabListSchema.vue'
// import PanoramaUploader from '../../shelves-vue/view/PanoramaUploader.vue'
// import ShelfUploader from '../../shelves-vue/view/ShelfUploader.vue'
@@ -349,7 +350,21 @@ export default {
wareAddSuccess(data) {
this.clickThumbWare(data)
},
//
clickSchemaItem(d) {
if (d) {
if (d.hasOwnProperty('cell')) {
this.selectedCell = d.cell
this.activePropName = 'ware'
} else if (d.env0) {
this.activePropName = this.isHall ? 'hall' : 'panorama'
}
} else {
this.activePropName = null
}
},
},
};
</script>

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generator: Adobe Illustrator 26.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve">
<style type="text/css">
.st0{fill:#767676;}
</style>
<g id="_x23_767676ff">
<path fill="#767676" d="M12.54,15.51c3.64-2.72,7.52-5.17,11.55-7.3c3.8,2.59,7.75,4.93,11.48,7.62c0.06,4.08,0.11,8.17-0.13,12.24
c-3.8,2.58-7.72,4.98-11.5,7.57c-3.92-2.34-7.72-4.88-11.55-7.37C12.27,24.03,11.74,19.7,12.54,15.51 M17.1,16.91
c2.16,1.42,4.25,3.4,6.87,3.83c2.81-0.7,4.96-2.85,7.17-4.6c-2.46-1.46-4.87-2.99-7.19-4.68C21.78,13.3,17.92,13.97,17.1,16.91
M15.38,19.09c-0.11,2.54-0.49,5.15,0.11,7.65c2.01,1.83,4.5,2.96,6.87,4.22c0.04-2.35,0.04-4.7,0.04-7.06
C20.06,22.3,17.71,20.7,15.38,19.09 M25.41,23.65c-0.01,2.46,0,4.91,0.05,7.37c2.4-1.49,5.1-2.65,7.05-4.74
c0.21-2.39,0.08-4.8-0.02-7.19C30.13,20.6,27.77,22.13,25.41,23.65z"/>
<path fill="#767676" d="M7.23,31.52c1.82-0.43,3.45,0.09,4.65,1.52c5.14,5.08,13.68,6.34,19.95,2.69c2.59-1.35,4.77-3.95,7.96-3.59
c-0.03,2.17-0.01,4.36-0.47,6.49c-1.98,0.47-2.98-0.35-3-2.46c-5.61,4.7-13.87,6.01-20.53,2.84C12.37,37.34,8.75,35.21,7.23,31.52z
"/>
<path class="st0" d="M12.5,14.5c3.6-2.7,7.5-5.2,11.6-7.3c3.8,2.6,7.8,4.9,11.5,7.6c0.1,4.1,0.1,8.2-0.1,12.2
c-3.8,2.6-7.7,5-11.5,7.6c-3.9-2.3-7.7-4.9-11.6-7.4C12.3,23,11.7,18.7,12.5,14.5 M17.1,15.9c2.2,1.4,4.2,3.4,6.9,3.8
c2.8-0.7,5-2.9,7.2-4.6c-2.5-1.5-4.9-3-7.2-4.7C21.8,12.3,17.9,13,17.1,15.9 M15.4,18.1c-0.1,2.5-0.5,5.1,0.1,7.6
c2,1.8,4.5,3,6.9,4.2c0-2.4,0-4.7,0-7.1C20.1,21.3,17.7,19.7,15.4,18.1 M25.4,22.6c0,2.5,0,4.9,0,7.4c2.4-1.5,5.1-2.6,7-4.7
c0.2-2.4,0.1-4.8,0-7.2C30.1,19.6,27.8,21.1,25.4,22.6z"/>
<path class="st0" d="M7.2,30.5c1.8-0.4,3.5,0.1,4.7,1.5c5.1,5.1,13.7,6.3,20,2.7c2.6-1.3,4.8-4,8-3.6c0,2.2,0,4.4-0.5,6.5
c-2,0.5-3-0.3-3-2.5c-5.6,4.7-13.9,6-20.5,2.8C12.4,36.3,8.8,34.2,7.2,30.5z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -110,7 +110,7 @@ div.container-previewer-1-:focus {
outline: none;
}
div.container-previewer-1->>>canvas:focus {
div.container-previewer-1-:deep()canvas:focus {
outline: none;
}
</style>

View File

@@ -104,7 +104,7 @@ div.container-previewer-1-:focus {
outline: none;
}
div.container-previewer-1->>>canvas:focus {
div.container-previewer-1-:deep()canvas:focus {
outline: none;
}
</style>

View File

@@ -167,7 +167,7 @@ div.container-viewer-1-:focus {
outline: none;
}
div.container-viewer-1->>>canvas:focus {
div.container-viewer-1-:deep()canvas:focus {
outline: none;
}
</style>

View File

@@ -304,7 +304,7 @@ div.container-editor-1-:focus {
outline: none;
}
div.container-editor-1->>>canvas:focus {
div.container-editor-1-:deep()canvas:focus {
outline: none;
}

View File

@@ -0,0 +1,121 @@
<template>
<div class="yo-scrollbar" style="max-height: calc(100vh - 155px)">
<div class="yo-title-s16">元素列表</div>
<a-input placeholder="请输入元素名" v-model:value="searchText">
<template #prefix>
<img :src="SearchSvg" />
</template>
</a-input>
<div v-for="(shelf, idx) in schema.shelves">
<a-tree :tree-data="to_tree_(shelf, idx, cache_)" @select="onSelect" show-icon default-expand-all>
<template #icon-a>
<img :src="cubeSvg" />
</template>
</a-tree>
<a-divider />
</div>
<!-- v-model:selectedKeys="selectedKeys" -->
<a-tree :tree-data="schema_env" @select="onSelect" show-icon default-expand-all>
<!-- <template #icon-a>
<img :src="cubeSvg" />
</template> -->
</a-tree>
</div>
</template>
<script setup>
import SearchSvg from '../../asset/icon2/search.svg'
import cubeSvg from '../../asset/icon2/cube.svg'
</script>
<script>
import { DownOutlined, SmileOutlined, FrownOutlined, FrownFilled } from '@ant-design/icons-vue'
import { ref } from 'vue'
const cell_name_ = cell => {
return cell.surveyLogo ? cell.surveyLogo : '[未设置品牌]'
}
const to_tree_ = (shelf, idx, cache) => [{
title: `货架${idx + 1}`,
key: `s${idx}`,
children: shelf.cells.map((cell, c_idx) => {
if (cell.surveyWare) {
// console.log(cell.surveyWare)
let key = `s${idx}-c${c_idx}`
cache[key] = { cell }
return {
title: cell_name_(cell), // `c${c_idx + 1}`,
key,
slots: { icon: 'icon-a' },
data_: {
cell,
}
}
} else {
return null
}
}).filter(itm => itm).sort((a, b) => a.data_.cell.name.localeCompare(b.data_.cell.name))
}]
export default {
components: {
SmileOutlined
},
props: ['shopData'],
data() {
return {
searchText: '',
// selectedKeys: ref([]),
cache_: {},
schema: {}, // { shelves:[], xx:.}
schema_env: [{
title: '环境',
key: 'e0',
children: [
{
title: '环境',
key: 'e0-0',
}
]
}],
}
},
watch: {
shopData(newV) {
this.init_(newV)
}
},
mounted() {
if (this.shopData) {
// console.log('MOUNTED', this.shopData)
this.init_(this.shopData)
}
},
methods: {
init_(shopData) {
this.cache_ = {
'e0-0': {
env0: true
}
}
let shelves = shopData.shelves
this.schema = {
shelves
}
},
onSelect(key) {
let d = this.cache_[key]
this.$emit('clickSchemaItem', d)
}
},
}
</script>
<style scoped>
</style>

View File

@@ -10,10 +10,10 @@
<a-divider />
<div class="yo-title-s14">视觉距离
<a-input-number class="yo-input-number-small" v-model:value="enterZoom" :min="1" :max="2" :step=".1"
<a-input-number class="yo-input-number-small" v-model:value="enterZoom" :min=".75" :max="2" :step=".05"
controls-position="right" style="float: right;" />
</div>
<a-slider v-model:value="enterZoom" :min="1" :max="2" :step=".1" />
<a-slider v-model:value="enterZoom" :min=".75" :max="2" :step=".05" />
<a-divider />
<div class="yo-title-s14">光源样式</div>

View File

@@ -13,6 +13,7 @@
.crossyo > :slotted(.ui){
/* Works on Firefox */
* {
font-family: "PingFang SC", "Microsoft Yahei";
scrollbar-width: thin;
scrollbar-color: #ECECEC rgba(0, 0, 0, 0);
}

File diff suppressed because one or more lines are too long