|
|
|
|
@ -85,12 +85,63 @@
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card"
|
|
|
|
|
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="pictureList" ref="pictureUpload" :auto-upload="true"
|
|
|
|
|
:on-success="handlesuccessP" :on-remove="handleRemoveP">
|
|
|
|
|
:on-success="(response, file, fileList)=>{return handlesuccessP(response, file, fileList,'picture_id')}"
|
|
|
|
|
:on-remove="(file, fileList)=>{return handleRemoveP(file, fileList,'picture_id')}">
|
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:picture_id_2>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Second Poster:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card"
|
|
|
|
|
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="pictureList2" ref="pictureUpload" :auto-upload="true"
|
|
|
|
|
:on-success="(response, file, fileList)=>{return handlesuccessP(response, file, fileList,'picture_id_2')}"
|
|
|
|
|
:on-remove="(file, fileList)=>{return handleRemoveP(file, fileList,'picture_id_2')}">
|
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:video_image_id>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Video Poster:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card"
|
|
|
|
|
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="videoPosterList" ref="pictureUpload" :auto-upload="true"
|
|
|
|
|
:on-success="(response, file, fileList)=>{return handlesuccessP(response, file, fileList,'video_image_id')}"
|
|
|
|
|
:on-remove="(file, fileList)=>{return handleRemoveP(file, fileList,'video_image_id')}">
|
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:video_id>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Video:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-upload :action="action" :limit='1' class='upload-demo' :file-list="videoList"
|
|
|
|
|
accept=".mp4,.ogg,.flv,.avi,.wmv,.rmvb,.mov"
|
|
|
|
|
ref="pictureUpload" :auto-upload="true" :on-progress="handleProgress"
|
|
|
|
|
:on-success="(response, file, fileList)=>{return handlesuccessP(response, file, fileList,'video_id')}"
|
|
|
|
|
:on-remove="(file, fileList)=>{return handleRemoveP(file, fileList,'video_id')}">
|
|
|
|
|
<el-button size="small" type="primary">upload</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
<el-progress v-if="showProgress" :percentage="uploadProgress"></el-progress>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:description>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
@ -308,10 +359,15 @@
|
|
|
|
|
uploadOther: {
|
|
|
|
|
token: ""
|
|
|
|
|
},
|
|
|
|
|
action: `${process.env.VUE_APP_UPLOAD_API}`,
|
|
|
|
|
action: `${process.env.VUE_APP_UPLOAD_API}`,
|
|
|
|
|
showProgress:false,
|
|
|
|
|
uploadProgress:0,
|
|
|
|
|
pcSubList: [], // 存储多选的category id
|
|
|
|
|
categoryList: [],
|
|
|
|
|
pictureList: [],
|
|
|
|
|
pictureList: [],
|
|
|
|
|
pictureList2: [],
|
|
|
|
|
videoPosterList:[],
|
|
|
|
|
videoList:[],
|
|
|
|
|
downloadsList: [],
|
|
|
|
|
applicationsList: [],
|
|
|
|
|
selectList: [],
|
|
|
|
|
@ -354,7 +410,10 @@
|
|
|
|
|
sort: 0,
|
|
|
|
|
is_recommend: 0,
|
|
|
|
|
is_sample: 0,
|
|
|
|
|
picture_id: '',
|
|
|
|
|
picture_id: '',
|
|
|
|
|
picture_id_2:'',
|
|
|
|
|
video_image_id:'',
|
|
|
|
|
video_id:'',
|
|
|
|
|
description: '',
|
|
|
|
|
|
|
|
|
|
product_category_phase: [],
|
|
|
|
|
@ -400,17 +459,47 @@
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.downloadsList = fileList
|
|
|
|
|
},
|
|
|
|
|
handleProgress(event, file, fileList) {
|
|
|
|
|
this.showProgress = true;
|
|
|
|
|
this.uploadProgress = event.percent;
|
|
|
|
|
},
|
|
|
|
|
handleRemoveP(file, fileList) {
|
|
|
|
|
this.pictureList = fileList
|
|
|
|
|
handleRemoveP(file, fileList,type) {
|
|
|
|
|
if(type=='picture_id'){
|
|
|
|
|
this.pictureList = fileList
|
|
|
|
|
}else if(type=='picture_id_2'){
|
|
|
|
|
this.pictureList2 = fileList
|
|
|
|
|
}else if(type=='video_image_id'){
|
|
|
|
|
this.videoPosterList = fileList
|
|
|
|
|
}else if(type=='video_id'){
|
|
|
|
|
this.videoList = fileList
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handlesuccessP(response, file, fileList) {
|
|
|
|
|
handlesuccessP(response, file, fileList,type) {
|
|
|
|
|
if (response && response.hasOwnProperty('errcode')) {
|
|
|
|
|
this.$Message.warning(response.errmsg || '')
|
|
|
|
|
this.pictureList = []
|
|
|
|
|
this.$Message.warning(response.errmsg || '')
|
|
|
|
|
if(type=='picture_id'){
|
|
|
|
|
this.pictureList = []
|
|
|
|
|
}else if(type=='picture_id_2'){
|
|
|
|
|
this.pictureList2 = []
|
|
|
|
|
}else if(type=='video_image_id'){
|
|
|
|
|
this.videoPosterList = []
|
|
|
|
|
}else if(type=='video_id'){
|
|
|
|
|
this.videoList = []
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.pictureList = fileList
|
|
|
|
|
}
|
|
|
|
|
if(type=='picture_id'){
|
|
|
|
|
this.pictureList = fileList
|
|
|
|
|
}else if(type=='picture_id_2'){
|
|
|
|
|
this.pictureList2 = fileList
|
|
|
|
|
}else if(type=='video_image_id'){
|
|
|
|
|
this.videoPosterList = fileList
|
|
|
|
|
}else if(type=='video_id'){
|
|
|
|
|
this.videoList = fileList
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getCategoryList() {
|
|
|
|
|
@ -612,7 +701,49 @@
|
|
|
|
|
this.form.picture_id = p_files[0]
|
|
|
|
|
} else {
|
|
|
|
|
this.form.picture_id = ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let p2_files = []
|
|
|
|
|
if (this.pictureList2.length > 0) {
|
|
|
|
|
for (var h of this.pictureList2) {
|
|
|
|
|
if (h.response) {
|
|
|
|
|
p2_files.push(h.response.id)
|
|
|
|
|
} else {
|
|
|
|
|
p2_files.push(h.id)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.form.picture_id_2 = p_files[0]
|
|
|
|
|
} else {
|
|
|
|
|
this.form.picture_id_2 = ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let v_files = []
|
|
|
|
|
if (this.videoPosterList.length > 0) {
|
|
|
|
|
for (var h of this.videoPosterList) {
|
|
|
|
|
if (h.response) {
|
|
|
|
|
v_files.push(h.response.id)
|
|
|
|
|
} else {
|
|
|
|
|
v_files.push(h.id)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.form.video_image_id = v_files[0]
|
|
|
|
|
} else {
|
|
|
|
|
this.form.video_image_id = ''
|
|
|
|
|
}
|
|
|
|
|
let v2_files = []
|
|
|
|
|
if (this.videoList.length > 0) {
|
|
|
|
|
for (var h of this.videoList) {
|
|
|
|
|
if (h.response) {
|
|
|
|
|
v2_files.push(h.response.id)
|
|
|
|
|
} else {
|
|
|
|
|
v2_files.push(h.id)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.form.video_id = v2_files[0]
|
|
|
|
|
} else {
|
|
|
|
|
this.form.video_id = ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// application
|
|
|
|
|
let a_ids = []
|
|
|
|
|
if (this.applicationsList.length > 0) {
|
|
|
|
|
@ -710,6 +841,27 @@
|
|
|
|
|
id: res.picture.id,
|
|
|
|
|
url: res.picture.url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (res.picture_id2) {
|
|
|
|
|
this.pictureList2.push({
|
|
|
|
|
name: res.picture_id2.original_name,
|
|
|
|
|
id: res.picture_id2.id,
|
|
|
|
|
url: res.picture_id2.url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (res.video_image) {
|
|
|
|
|
this.videoPosterList.push({
|
|
|
|
|
name: res.video_image.original_name,
|
|
|
|
|
id: res.video_image.id,
|
|
|
|
|
url: res.video_image.url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (res.video) {
|
|
|
|
|
this.videoList.push({
|
|
|
|
|
name: res.video.original_name,
|
|
|
|
|
id: res.video.id,
|
|
|
|
|
url: res.video.url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
@ -747,10 +899,15 @@
|
|
|
|
|
this.showWang = false
|
|
|
|
|
this.showPacking = false
|
|
|
|
|
this.downloadsList = []
|
|
|
|
|
this.pictureList = []
|
|
|
|
|
this.pictureList = []
|
|
|
|
|
this.pictureList2 = []
|
|
|
|
|
this.videoPosterList = []
|
|
|
|
|
this.videoList = []
|
|
|
|
|
this.applicationsList = []
|
|
|
|
|
this.selectList = []
|
|
|
|
|
this.pcSubList = []
|
|
|
|
|
this.pcSubList = []
|
|
|
|
|
this.showProgress = false
|
|
|
|
|
this.uploadProgress = 0
|
|
|
|
|
this.form = {
|
|
|
|
|
product_category_links_by_sub: [],
|
|
|
|
|
name: '',
|
|
|
|
|
@ -758,7 +915,10 @@
|
|
|
|
|
sort: 0,
|
|
|
|
|
is_recommend: 0,
|
|
|
|
|
is_sample: 0,
|
|
|
|
|
picture_id: '',
|
|
|
|
|
picture_id: '',
|
|
|
|
|
picture_id_2:'',
|
|
|
|
|
video_image_id:'',
|
|
|
|
|
video_id:'',
|
|
|
|
|
description: '',
|
|
|
|
|
product_category_phase: [],
|
|
|
|
|
product_category_details: [],
|
|
|
|
|
@ -790,7 +950,11 @@
|
|
|
|
|
{
|
|
|
|
|
flex-basis: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .picture_id,
|
|
|
|
|
::v-deep .picture_id_2,
|
|
|
|
|
::v-deep .video_image_id{
|
|
|
|
|
flex-basis: 50%;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .sort,
|
|
|
|
|
::v-deep .time,
|
|
|
|
|
::v-deep .is_recommend,
|
|
|
|
|
|