@@ -179,9 +180,15 @@ watch(
}
.page-item-logo{
flex: 10;
+ text-align: center;
+ overflow: hidden;
+ span{
+ display: block;
+ margin-top: 3vw;
+ }
img{
- max-width: 100%;
- max-height: 100%;
+ width: 100%;
+ height: 100%;
}
}
.page-item-title{
diff --git a/src/views/Creative/MyCreation.vue b/src/views/Creative/MyCreation.vue
index 72cd9679..ed3dead8 100644
--- a/src/views/Creative/MyCreation.vue
+++ b/src/views/Creative/MyCreation.vue
@@ -24,6 +24,8 @@
+
暂无图片
+
@@ -236,6 +238,16 @@ watch(
}
.page-item-logo{
flex: 10;
+ text-align: center;
+ overflow: hidden;
+ span{
+ display: block;
+ margin-top: 3vw;
+ }
+ img{
+ width: 100%;
+ height: 100%;
+ }
}
.page-item-title{
flex: 5;
diff --git a/src/views/Creative/components/CreateMaterial.vue b/src/views/Creative/components/CreateMaterial.vue
index afed737a..a93cee4a 100644
--- a/src/views/Creative/components/CreateMaterial.vue
+++ b/src/views/Creative/components/CreateMaterial.vue
@@ -35,6 +35,7 @@
支持上传glb格式的模型,模型素材包小于500M,建议上传10M以内素材包效果更佳
+
@@ -65,6 +66,7 @@ const { ref, reactive }=require("@vue/reactivity");
import common from "@/api/common.js";
import { createMaterialLibrary } from "../api";
import { message } from 'ant-design-vue';
+import WareViewer from "@/views/planetDesign/Design/components/config/Viewer3D/WareViewer.vue";
const emit = defineEmits(["complete"]);
@@ -100,6 +102,11 @@ const show = (type) => {
visible.value = true;
}
+
+const model = ref(null);
+
+const viewerRef = ref();
+
const onCustomRequest = async (upload) => {
if(formData.value.type == THREE_D_TYPE.SHELF) {
@@ -118,10 +125,34 @@ const onCustomRequest = async (upload) => {
const data = await common.cosUpload3D(upload.file);
upload.onSuccess(data);
+
+ if([THREE_D_TYPE.ENV_3D, THREE_D_TYPE.SHELF, THREE_D_TYPE.EXHIBITION_BOOTH, THREE_D_TYPE.WARE].includes(formData.value.type)){
+
+ let reader = new FileReader();
+ reader.addEventListener(
+ "load",
+ (e) => {
+ model.value = {
+ file: {},
+ result: e.target.result,
+ };
+ },
+ false
+ );
+
+ reader.readAsArrayBuffer(upload.file);
+ }
}
const ok = async () => {
if(step.value >= 1) {
+
+ if([THREE_D_TYPE.ENV_3D, THREE_D_TYPE.SHELF, THREE_D_TYPE.EXHIBITION_BOOTH, THREE_D_TYPE.WARE].includes(formData.value.type)){
+ var blob = await viewerRef.value.snapshot();
+ const data = await common.cosUpload(blob, blob.name, "", () => {});
+ formData.value.cover = data.url;
+ }
+
const data = JSON.parse(JSON.stringify(formData.value));
await createMaterialLibrary(buildData(data));
visible.value = false;