fix: 新增作品
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
<div v-for="(row, index) in rows" :key="index" class="page-item">
|
<div v-for="(row, index) in rows" :key="index" class="page-item">
|
||||||
<div v-if="row" class="page-item-content">
|
<div v-if="row" class="page-item-content">
|
||||||
<div class="page-item-logo">
|
<div class="page-item-logo">
|
||||||
|
<img v-if="row.cover" :src="row.cover" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="page-item-title">
|
<div class="page-item-title">
|
||||||
<div class="pit-row" style="color: #262626;">
|
<div class="pit-row" style="color: #262626;">
|
||||||
@@ -178,6 +179,10 @@ watch(
|
|||||||
}
|
}
|
||||||
.page-item-logo{
|
.page-item-logo{
|
||||||
flex: 10;
|
flex: 10;
|
||||||
|
img{
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.page-item-title{
|
.page-item-title{
|
||||||
flex: 5;
|
flex: 5;
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ export const CREATIVE_TYPE_S = [
|
|||||||
const factorys = [
|
const factorys = [
|
||||||
{
|
{
|
||||||
type: CREATIVE_TYPE.THREE_D,
|
type: CREATIVE_TYPE.THREE_D,
|
||||||
build: (data) => {
|
build: (origin) => {
|
||||||
|
|
||||||
data = data.data;
|
const data = origin.data;
|
||||||
var key = new Date().getTime();
|
var key = new Date().getTime();
|
||||||
|
|
||||||
return {
|
origin.data = {
|
||||||
"planetid": `scene-${key}`,
|
"planetid": `scene-${key}`,
|
||||||
"name": `场景-${key}`,
|
"name": `${origin.title}`,
|
||||||
|
|
||||||
"arrangementId": "bsld2da4",
|
"arrangementId": "bsld2da4",
|
||||||
"relShopId": "sllqkj4l",
|
"relShopId": "sllqkj4l",
|
||||||
@@ -46,7 +46,7 @@ const factorys = [
|
|||||||
},
|
},
|
||||||
"shelves": [
|
"shelves": [
|
||||||
{
|
{
|
||||||
"name": `货架-${key}`,
|
"name": `${data.shelves.find(x => x).material_json.name}`,
|
||||||
"planetid": `shelf-${key}`,
|
"planetid": `shelf-${key}`,
|
||||||
|
|
||||||
"id": `shelf-${key}`,
|
"id": `shelf-${key}`,
|
||||||
@@ -72,7 +72,7 @@ const factorys = [
|
|||||||
|
|
||||||
"wares": data.wares.map((x, i) => ({
|
"wares": data.wares.map((x, i) => ({
|
||||||
"planetid": `ware-${key}-${i}`,
|
"planetid": `ware-${key}-${i}`,
|
||||||
"name": `商品${key}-${i}`,
|
"name": `${x.material_json.name}`,
|
||||||
"surveyWare": {
|
"surveyWare": {
|
||||||
"id": `ware-${key}-${i}`,
|
"id": `ware-${key}-${i}`,
|
||||||
"type": 1,
|
"type": 1,
|
||||||
@@ -87,15 +87,23 @@ const factorys = [
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
|
|
||||||
|
return origin;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: CREATIVE_TYPE.RING_360,
|
type: CREATIVE_TYPE.RING_360,
|
||||||
build: (data) => {
|
build: (origin) => {
|
||||||
return {
|
|
||||||
|
const data = origin.data;
|
||||||
|
var key = new Date().getTime();
|
||||||
|
|
||||||
|
origin = {
|
||||||
imgs: data.data.fileList.map(x => ({name: x.name, url: x.response.url}))
|
imgs: data.data.fileList.map(x => ({name: x.name, url: x.response.url}))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return origin;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -115,16 +115,16 @@ const show = (type) => {
|
|||||||
const ok = async () => {
|
const ok = async () => {
|
||||||
if(formData.value.type == CREATIVE_TYPE.THREE_D) {
|
if(formData.value.type == CREATIVE_TYPE.THREE_D) {
|
||||||
if(step.value >= 3) {
|
if(step.value >= 3) {
|
||||||
formData.value.data = buildData(formData.value);
|
const data = JSON.parse(JSON.stringify(formData.value));
|
||||||
await createMaterialCenter(formData.value);
|
await createMaterialCenter(buildData(data));
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emit("complete");
|
emit("complete");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(step.value >= 1) {
|
if(step.value >= 1) {
|
||||||
formData.value.data = buildData(formData.value)
|
const data = JSON.parse(JSON.stringify(formData.value));
|
||||||
await createMaterialCenter(formData.value);
|
await createMaterialCenter(buildData(data));
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emit("complete");
|
emit("complete");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ const factorys = [
|
|||||||
"urlShelfExr": "",
|
"urlShelfExr": "",
|
||||||
"rotationY": 0,
|
"rotationY": 0,
|
||||||
"multiply": 3
|
"multiply": 3
|
||||||
}
|
},
|
||||||
|
cover: url
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -96,7 +97,7 @@ const factorys = [
|
|||||||
return {
|
return {
|
||||||
...data,
|
...data,
|
||||||
data: {
|
data: {
|
||||||
"name": "货架1",
|
"name": `${data.title}`,
|
||||||
"planetid": "shelf1",
|
"planetid": "shelf1",
|
||||||
"id": "shelf1",
|
"id": "shelf1",
|
||||||
"url": url,
|
"url": url,
|
||||||
@@ -160,17 +161,15 @@ const factorys = [
|
|||||||
{
|
{
|
||||||
type: THREE_D_TYPE.WARE,
|
type: THREE_D_TYPE.WARE,
|
||||||
build(data){
|
build(data){
|
||||||
var url = "";
|
var url = data.fileList[0].response.url;
|
||||||
try{
|
var key = new Date().getTime();
|
||||||
url = data.fileList[0].response.url;
|
|
||||||
}
|
|
||||||
catch(e){ }
|
|
||||||
return {
|
return {
|
||||||
...data,
|
...data,
|
||||||
data: {
|
data: {
|
||||||
"planetid": "ware1-1",
|
"planetid": `ware-${key}`,
|
||||||
"name": "伊利",
|
"name": `${data.title}`,
|
||||||
"id": "ware1-1",
|
"id": `ware-${key}`,
|
||||||
"type": 1,
|
"type": 1,
|
||||||
"commodity": {
|
"commodity": {
|
||||||
"url": url
|
"url": url
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ const onCustomRequest = async (upload) => {
|
|||||||
|
|
||||||
const ok = async () => {
|
const ok = async () => {
|
||||||
if(step.value >= 1) {
|
if(step.value >= 1) {
|
||||||
await createMaterialLibrary(buildData(formData.value));
|
const data = JSON.parse(JSON.stringify(formData.value));
|
||||||
|
await createMaterialLibrary(buildData(data));
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emit("complete");
|
emit("complete");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user