fix: 新增作品

This commit is contained in:
wam
2022-12-21 11:32:39 +08:00
parent 348f549420
commit 6a05f7b435
5 changed files with 37 additions and 24 deletions

View File

@@ -24,6 +24,7 @@
<div v-for="(row, index) in rows" :key="index" class="page-item">
<div v-if="row" class="page-item-content">
<div class="page-item-logo">
<img v-if="row.cover" :src="row.cover" alt="">
</div>
<div class="page-item-title">
<div class="pit-row" style="color: #262626;">
@@ -178,6 +179,10 @@ watch(
}
.page-item-logo{
flex: 10;
img{
max-width: 100%;
max-height: 100%;
}
}
.page-item-title{
flex: 5;

View File

@@ -23,14 +23,14 @@ export const CREATIVE_TYPE_S = [
const factorys = [
{
type: CREATIVE_TYPE.THREE_D,
build: (data) => {
build: (origin) => {
data = data.data;
const data = origin.data;
var key = new Date().getTime();
return {
origin.data = {
"planetid": `scene-${key}`,
"name": `场景-${key}`,
"name": `${origin.title}`,
"arrangementId": "bsld2da4",
"relShopId": "sllqkj4l",
@@ -46,7 +46,7 @@ const factorys = [
},
"shelves": [
{
"name": `货架-${key}`,
"name": `${data.shelves.find(x => x).material_json.name}`,
"planetid": `shelf-${key}`,
"id": `shelf-${key}`,
@@ -72,7 +72,7 @@ const factorys = [
"wares": data.wares.map((x, i) => ({
"planetid": `ware-${key}-${i}`,
"name": `商品${key}-${i}`,
"name": `${x.material_json.name}`,
"surveyWare": {
"id": `ware-${key}-${i}`,
"type": 1,
@@ -87,15 +87,23 @@ const factorys = [
}))
}
]
}
};
return origin;
}
},
{
type: CREATIVE_TYPE.RING_360,
build: (data) => {
return {
build: (origin) => {
const data = origin.data;
var key = new Date().getTime();
origin = {
imgs: data.data.fileList.map(x => ({name: x.name, url: x.response.url}))
};
return origin;
}
},
{

View File

@@ -115,16 +115,16 @@ const show = (type) => {
const ok = async () => {
if(formData.value.type == CREATIVE_TYPE.THREE_D) {
if(step.value >= 3) {
formData.value.data = buildData(formData.value);
await createMaterialCenter(formData.value);
const data = JSON.parse(JSON.stringify(formData.value));
await createMaterialCenter(buildData(data));
visible.value = false;
emit("complete");
}
}
else {
if(step.value >= 1) {
formData.value.data = buildData(formData.value)
await createMaterialCenter(formData.value);
const data = JSON.parse(JSON.stringify(formData.value));
await createMaterialCenter(buildData(data));
visible.value = false;
emit("complete");
}

View File

@@ -64,7 +64,8 @@ const factorys = [
"urlShelfExr": "",
"rotationY": 0,
"multiply": 3
}
},
cover: url
};
}
},
@@ -96,7 +97,7 @@ const factorys = [
return {
...data,
data: {
"name": "货架1",
"name": `${data.title}`,
"planetid": "shelf1",
"id": "shelf1",
"url": url,
@@ -160,17 +161,15 @@ const factorys = [
{
type: THREE_D_TYPE.WARE,
build(data){
var url = "";
try{
url = data.fileList[0].response.url;
}
catch(e){ }
var url = data.fileList[0].response.url;
var key = new Date().getTime();
return {
...data,
data: {
"planetid": "ware1-1",
"name": "伊利",
"id": "ware1-1",
"planetid": `ware-${key}`,
"name": `${data.title}`,
"id": `ware-${key}`,
"type": 1,
"commodity": {
"url": url

View File

@@ -122,7 +122,8 @@ const onCustomRequest = async (upload) => {
const ok = async () => {
if(step.value >= 1) {
await createMaterialLibrary(buildData(formData.value));
const data = JSON.parse(JSON.stringify(formData.value));
await createMaterialLibrary(buildData(data));
visible.value = false;
emit("complete");
}