![]()
@@ -47,27 +47,29 @@ onMounted(async () => {
\ No newline at end of file
diff --git a/src/views/Creative/components/Create3D.constant.js b/src/views/Creative/components/Create3D.constant.js
index 2b2a15cd..37768470 100644
--- a/src/views/Creative/components/Create3D.constant.js
+++ b/src/views/Creative/components/Create3D.constant.js
@@ -25,25 +25,18 @@ const factorys = [
type: CREATIVE_TYPE.THREE_D,
build: (data) => {
- var pUrl = "";
- var sUrl = "";
+ data = data.data;
var key = new Date().getTime();
- try{
- data = data.data;
- pUrl = data.panorama[0].material_json.url;
- sUrl = data.shelves[0].material_json.url;
- }
- catch(e){}
return {
- "planetid": `${key}-scene`,
+ "planetid": `scene-${key}`,
"name": `场景-${key}`,
"arrangementId": "bsld2da4",
"relShopId": "sllqkj4l",
"panorama": {
- "url": pUrl,
- "urlSmall": pUrl,
+ "url": data.panorama.find(x => x).material_json.url,
+ "urlSmall": data.panorama.find(x => x).material_json.url,
"urlThumb": "",
"urlDepth": "",
"urlShelfExr": "",
@@ -54,863 +47,13 @@ const factorys = [
"shelves": [
{
"name": `货架-${key}`,
- "planetid": `${key}-shelf`,
+ "planetid": `shelf-${key}`,
- "id": `${key}-shelf`,
- "url": sUrl,
+ "id": `shelf-${key}`,
+ "url": data.shelves.find(x => x).material_json.url,
"urlThumb": "",
"hideWhenSurvey": true,
- "cells": [
-
- {
- "name": "0-1",
- "box": {
- "position": {
- "x": -0.6093719155636137,
- "y": 1.1925115714503842,
- "z": 0.45
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "size": {
- "x": 0.3736,
- "y": 0.2259,
- "z": 0.2179
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.006,
- "y": -0.029369916622918046,
- "z": 0.1847
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "0-2",
- "box": {
- "position": {
- "x": -0.18520626992561548,
- "y": 1.1908614160723439,
- "z": 0.45
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "size": {
- "x": 0.3736,
- "y": 0.2259,
- "z": 0.2179
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.006,
- "y": -0.03174731410176801,
- "z": 0.1847
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "0-3",
- "box": {
- "position": {
- "x": 0.2287325535366465,
- "y": 1.1892382329257407,
- "z": 0.45
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "size": {
- "x": 0.3736,
- "y": 0.2259,
- "z": 0.2179
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.006,
- "y": -0.028571714546698213,
- "z": 0.1847
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "0-4",
- "box": {
- "position": {
- "x": 0.661393068886308,
- "y": 1.1909523674363642,
- "z": 0.4537964589333506
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "size": {
- "x": 0.3736,
- "y": 0.2259,
- "z": 0.2179
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.006,
- "y": -0.03136253199426353,
- "z": 0.1847
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "1-1",
- "box": {
- "position": {
- "x": -0.605500512913119,
- "y": 0.8538858659191146,
- "z": 0.45017966628074646
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "size": {
- "x": 0.37358155846595764,
- "y": 0.225911445915699,
- "z": 0.21794167160987854
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.0027324557304382324,
- "y": -0.03184773059511403,
- "z": 0.1743204391002655
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 0.7393795847892761,
- "y": 0.05661093816161156,
- "z": 0.05661093816161156
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.1499999999999999,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "1-2",
- "box": {
- "position": {
- "x": -0.18658027999214435,
- "y": 0.8512643658064176,
- "z": 0.45017966628074646
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "size": {
- "x": 0.37358155846595764,
- "y": 0.225911445915699,
- "z": 0.21794167160987854
- },
- "child": {
- "sign": {
- "position": {
- "x": 0,
- "y": -0.02759083972388149,
- "z": 0.1743204391002655
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 0.7393795847892761,
- "y": 0.05661093816161156,
- "z": 0.05661093816161156
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.1499999999999999,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "1-3",
- "box": {
- "position": {
- "x": 0.2230628973331703,
- "y": 0.8511807287232012,
- "z": 0.45017966628074646
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "size": {
- "x": 0.37358155846595764,
- "y": 0.225911445915699,
- "z": 0.21794167160987854
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.005585700273513794,
- "y": -0.032213962561231047,
- "z": 0.1743204391002655
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 0.7393795847892761,
- "y": 0.05661093816161156,
- "z": 0.05661093816161156
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.1499999999999999,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "1-4",
- "box": {
- "position": {
- "x": 0.6551478924840007,
- "y": 0.8483097259524031,
- "z": 0.45
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "size": {
- "x": 0.3736,
- "y": 0.2259,
- "z": 0.2179
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.006,
- "y": -0.02673691703609271,
- "z": 0.1847
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "2-1",
- "box": {
- "position": {
- "x": -0.60433011332925,
- "y": 0.5125224579062782,
- "z": 0.45017966628074646
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "size": {
- "x": 0.37358155846595764,
- "y": 0.225911445915699,
- "z": 0.21794167160987854
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.0027324557304382324,
- "y": -0.034508354476310954,
- "z": 0.1743204391002655
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 0.7393795847892761,
- "y": 0.05661093816161156,
- "z": 0.05661093816161156
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15000000000000002,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "2-2",
- "box": {
- "position": {
- "x": -0.1914175066620415,
- "y": 0.5095275839341008,
- "z": 0.45017966628074646
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "size": {
- "x": 0.37358155846595764,
- "y": 0.225911445915699,
- "z": 0.21794167160987854
- },
- "child": {
- "sign": {
- "position": {
- "x": 0,
- "y": -0.027170852492222397,
- "z": 0.1743204391002655
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 0.7393795847892761,
- "y": 0.05661093816161156,
- "z": 0.05661093816161156
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15000000000000002,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "2-3",
- "box": {
- "position": {
- "x": 0.22360906333448538,
- "y": 0.5101818344822482,
- "z": 0.45017966628074646
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "size": {
- "x": 0.37358155846595764,
- "y": 0.225911445915699,
- "z": 0.21794167160987854
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.005585700273513794,
- "y": -0.030842453533999448,
- "z": 0.1743204391002655
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 0.7393795847892761,
- "y": 0.05661093816161156,
- "z": 0.05661093816161156
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15000000000000002,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "2-4",
- "box": {
- "position": {
- "x": 0.6482247451401058,
- "y": 0.504394091002413,
- "z": 0.45
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "size": {
- "x": 0.3736,
- "y": 0.2259,
- "z": 0.2179
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.006,
- "y": -0.02471250348374021,
- "z": 0.1847
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "3-1",
- "box": {
- "position": {
- "x": -0.6134215690979794,
- "y": 0.1945505440235138,
- "z": 0.45017966628074646
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "size": {
- "x": 0.37358155846595764,
- "y": 0.225911445915699,
- "z": 0.21794167160987854
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.0027324557304382324,
- "y": -0.024228371171756358,
- "z": 0.1846828854084015
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 0.7393795847892761,
- "y": 0.05661093816161156,
- "z": 0.05661093816161156
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15000000000000002,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "3-2",
- "box": {
- "position": {
- "x": -0.19111044416229633,
- "y": 0.1945505440235138,
- "z": 0.45017966628074646
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "size": {
- "x": 0.37358155846595764,
- "y": 0.225911445915699,
- "z": 0.21794167160987854
- },
- "child": {
- "sign": {
- "position": {
- "x": 0,
- "y": -0.021009267483951266,
- "z": 0.1846828854084015
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 0.7393795847892761,
- "y": 0.05661093816161156,
- "z": 0.05661093816161156
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15000000000000002,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "3-3",
- "box": {
- "position": {
- "x": 0.21581759477578777,
- "y": 0.1945505440235138,
- "z": 0.45017966628074646
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "size": {
- "x": 0.37358155846595764,
- "y": 0.225911445915699,
- "z": 0.21794167160987854
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.005585700273513794,
- "y": -0.020448554878266023,
- "z": 0.1846828854084015
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 0.7393795847892761,
- "y": 0.05661093816161156,
- "z": 0.05661093816161156
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15000000000000002,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- },
- {
- "name": "3-4",
- "box": {
- "position": {
- "x": 0.6432047193626257,
- "y": 0.19147498005043284,
- "z": 0.45
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "size": {
- "x": 0.3736,
- "y": 0.2259,
- "z": 0.2179
- },
- "child": {
- "sign": {
- "position": {
- "x": -0.006,
- "y": -0.013996807328698846,
- "z": 0.1847
- },
- "rotation": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "scale": {
- "x": 1,
- "y": 1,
- "z": 1
- }
- },
- "logo": {
- "position": {
- "x": 0,
- "y": 0.15,
- "z": 0
- }
- }
- }
- },
- "pileNumber": 2,
- "pileRotationY": 0
- }
- ],
+ "cells": data.shelves.find(x => x).material_json.cells,
"position": {
"x": 2.5193034425825944,
"y": -1.0605054800098004,
@@ -927,23 +70,21 @@ const factorys = [
"z": 1
},
- "wares": [
- {
- "planetid": `${key}-ware`,
- "name": `商品${key}`,
- "surveyWare": {
- "id": "ware1-1",
- "type": 1,
- "commodity": {
- "url": "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/shelves/shelves-v3-store/v3.4/ware/milkpowder-can1-lod0.glb"
- },
- "texture": null,
- "urlThumb": "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/shelves/shelves-v3-store/v3.4/ware/milkpowder-can1.png"
+ "wares": data.wares.map((x, i) => ({
+ "planetid": `ware-${key}-${i}`,
+ "name": `商品${key}-${i}`,
+ "surveyWare": {
+ "id": `ware-${key}-${i}`,
+ "type": 1,
+ "commodity": {
+ "url": x.material_json.commodity.url
},
- "surveyLogo": "",
- "surveyPrice": 190
- }
- ]
+ "texture": null,
+ "urlThumb": "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/shelves/shelves-v3-store/v3.4/ware/milkpowder-can1.png"
+ },
+ "surveyLogo": "",
+ "surveyPrice": 190
+ }))
}
]
}
diff --git a/src/views/Creative/components/Create3D.vue b/src/views/Creative/components/Create3D.vue
index ea8ee75b..da834ea2 100644
--- a/src/views/Creative/components/Create3D.vue
+++ b/src/views/Creative/components/Create3D.vue
@@ -113,9 +113,8 @@ const show = (type) => {
}
const ok = async () => {
- step.value++;
if(formData.value.type == CREATIVE_TYPE.THREE_D) {
- if(step.value >= 4) {
+ if(step.value >= 3) {
formData.value.data = buildData(formData.value);
await createMaterialCenter(formData.value);
visible.value = false;
@@ -123,13 +122,14 @@ const ok = async () => {
}
}
else {
- if(step.value >= 2) {
+ if(step.value >= 1) {
formData.value.data = buildData(formData.value)
await createMaterialCenter(formData.value);
visible.value = false;
emit("complete");
}
}
+ step.value++;
}
defineExpose({
diff --git a/src/views/Creative/components/CreateMaterial.constant.js b/src/views/Creative/components/CreateMaterial.constant.js
index 8b7a7fd8..67ea49a3 100644
--- a/src/views/Creative/components/CreateMaterial.constant.js
+++ b/src/views/Creative/components/CreateMaterial.constant.js
@@ -80,8 +80,16 @@ const factorys = [
type: THREE_D_TYPE.SHELF,
build(data){
var url = "";
+ var cells = [];
try{
- url = data.fileList[0].response.url;
+ data.fileList.forEach(file => {
+ if(file.response.url){
+ url = file.response.url;
+ }
+ if(file.response.cells){
+ cells = file.response.cells;
+ }
+ })
}
catch(e){ }
//#region 返回值
@@ -94,7 +102,7 @@ const factorys = [
"url": url,
"urlThumb": "",
"hideWhenSurvey": true,
- "cells": [],
+ "cells": cells,
"position": {
"x": 2.5193034425825946,
"y": -1.0605054800098004,
@@ -170,7 +178,7 @@ const factorys = [
"texture": null,
"urlThumb": "",
"surveyLogo": "",
- "surveyPrice": 190
+ "surveyPrice": 10
},
};
}
diff --git a/src/views/Creative/components/CreateMaterial.vue b/src/views/Creative/components/CreateMaterial.vue
index f83069e0..316ca45d 100644
--- a/src/views/Creative/components/CreateMaterial.vue
+++ b/src/views/Creative/components/CreateMaterial.vue
@@ -64,6 +64,7 @@ import { THREE_D_TYPE_S, THREE_D_TYPE, buildData } from "./CreateMaterial.consta
const { ref, reactive }=require("@vue/reactivity");
import common from "@/api/common.js";
import { createMaterialLibrary } from "../api";
+import { message } from 'ant-design-vue';
const emit = defineEmits(["complete"]);
@@ -81,6 +82,11 @@ const formData = ref({
const show = (type) => {
+ if(type == THREE_D_TYPE.CHARTLET) {
+ message.info("素材库不支持上传贴图");
+ return;
+ }
+
const obj = THREE_D_TYPE_S.find(x => x.type == type);
if(!obj) return;
@@ -95,17 +101,32 @@ const show = (type) => {
}
const onCustomRequest = async (upload) => {
+
+ if(formData.value.type == THREE_D_TYPE.SHELF) {
+ if(upload.file.name.lastIndexOf(".json") >= 0) {
+ var reader = new FileReader();
+ reader.readAsText(upload.file,"utf-8");
+ reader.onload = () => {
+ //读取完成后,数据保存在对象的result属性中
+ upload.onSuccess({
+ cells: JSON.parse(reader.result)
+ });
+ }
+ return;
+ }
+ }
+
const data = await common.cosUpload3D(upload.file);
upload.onSuccess(data);
}
const ok = async () => {
- step.value++;
- if(step.value >= 2) {
+ if(step.value >= 1) {
await createMaterialLibrary(buildData(formData.value));
visible.value = false;
emit("complete");
}
+ step.value++;
}
defineExpose({
diff --git a/src/views/Creative/components/Previewer3D/Index.vue b/src/views/Creative/components/Previewer3D/Index.vue
index eaf07186..c337db72 100644
--- a/src/views/Creative/components/Previewer3D/Index.vue
+++ b/src/views/Creative/components/Previewer3D/Index.vue
@@ -14,6 +14,9 @@ defineExpose({
if(data.type == CREATIVE_TYPE.RING_360) {
ring360PreviewerRef.value.show(data);
}
+ if(data.type == CREATIVE_TYPE.MODEL_3D) {
+ window.open("/#/model3d-preview");
+ }
}
})
diff --git a/src/views/Creative/components/Previewer3D/Ring360Previewer.vue b/src/views/Creative/components/Previewer3D/Ring360Previewer.vue
index a667a33c..52e94f47 100644
--- a/src/views/Creative/components/Previewer3D/Ring360Previewer.vue
+++ b/src/views/Creative/components/Previewer3D/Ring360Previewer.vue
@@ -1,5 +1,5 @@
-
+
@@ -7,7 +7,6 @@