|
|
|
|
@ -124,19 +124,52 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- <template v-slot:file_ids>
|
|
|
|
|
<template v-slot:file_ids>
|
|
|
|
|
<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>Files:
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Pictures:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-upload :action="action" class='upload-demo' multiple :file-list="filesList" ref="pictureUpload"
|
|
|
|
|
<el-upload :action="action" class='upload-demo' list-type="picture-card" multiple :file-list="filesList" ref="pictureUpload"
|
|
|
|
|
accept=".PNG,.jpg,.jpeg,.bmp,.svg"
|
|
|
|
|
:auto-upload="true" :data="uploadOther" :on-success="handlesuccess" :on-remove="handleRemove">
|
|
|
|
|
<el-button size="small" type="primary">upload</el-button>
|
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template> -->
|
|
|
|
|
</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:product_details>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
@ -221,8 +254,12 @@
|
|
|
|
|
uploadOther: {
|
|
|
|
|
token: ""
|
|
|
|
|
},
|
|
|
|
|
action: `${process.env.VUE_APP_UPLOAD_API}`,
|
|
|
|
|
filesList: [],
|
|
|
|
|
action: `${process.env.VUE_APP_UPLOAD_API}`,
|
|
|
|
|
showProgress:false,
|
|
|
|
|
uploadProgress:0,
|
|
|
|
|
filesList: [],
|
|
|
|
|
videoPosterList:[],
|
|
|
|
|
videoList:[],
|
|
|
|
|
categoryList: [],
|
|
|
|
|
showWang: false,
|
|
|
|
|
detail_item: [{
|
|
|
|
|
@ -247,7 +284,9 @@
|
|
|
|
|
is_visible: 1,
|
|
|
|
|
is_sell: 1,
|
|
|
|
|
show_price: 0,
|
|
|
|
|
// file_ids: '',
|
|
|
|
|
file_ids: '',
|
|
|
|
|
video_image_id:'',
|
|
|
|
|
video_id:'',
|
|
|
|
|
product_details: [],
|
|
|
|
|
// content: '',
|
|
|
|
|
},
|
|
|
|
|
@ -281,6 +320,39 @@
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.filesList = fileList
|
|
|
|
|
},
|
|
|
|
|
handleProgress(event, file, fileList) {
|
|
|
|
|
this.showProgress = true;
|
|
|
|
|
this.uploadProgress = event.percent;
|
|
|
|
|
},
|
|
|
|
|
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,type) {
|
|
|
|
|
if (response && response.hasOwnProperty('errcode')) {
|
|
|
|
|
this.$Message.warning(response.errmsg || '')
|
|
|
|
|
if(type=='video_image_id'){
|
|
|
|
|
this.videoPosterList = []
|
|
|
|
|
}else if(type=='video_id'){
|
|
|
|
|
this.videoList = []
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(type=='video_image_id'){
|
|
|
|
|
this.videoPosterList = fileList
|
|
|
|
|
}else if(type=='video_id'){
|
|
|
|
|
this.videoList = fileList
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
changeEditor(e) {
|
|
|
|
|
this.form.content = e
|
|
|
|
|
@ -342,6 +414,33 @@
|
|
|
|
|
this.form.file_ids = _files
|
|
|
|
|
} else {
|
|
|
|
|
this.form.file_ids = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 = ''
|
|
|
|
|
}
|
|
|
|
|
console.log("this.form", this.form)
|
|
|
|
|
if (this.form.product_details.length > 0) {
|
|
|
|
|
@ -382,7 +481,7 @@
|
|
|
|
|
getDetail() {
|
|
|
|
|
show({
|
|
|
|
|
id: this.id,
|
|
|
|
|
show_relation: ['productDetails']
|
|
|
|
|
show_relation: ['productDetails','videoImage','video']
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.form = this.base.requestToForm(res, this.form)
|
|
|
|
|
// this.form.content = res.content ? res.content : ''
|
|
|
|
|
@ -410,16 +509,32 @@
|
|
|
|
|
this.form.product_details = res.product_details
|
|
|
|
|
|
|
|
|
|
// this.showWang = true
|
|
|
|
|
// if (res.files && res.files.length > 0) {
|
|
|
|
|
// this.filesList = []
|
|
|
|
|
// res.files.map(item => {
|
|
|
|
|
// this.filesList.push({
|
|
|
|
|
// name: item.original_name,
|
|
|
|
|
// id: item.id,
|
|
|
|
|
// url: item.url
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
if (res.files && res.files.length > 0) {
|
|
|
|
|
this.filesList = []
|
|
|
|
|
res.files.map(item => {
|
|
|
|
|
this.filesList.push({
|
|
|
|
|
name: item.original_name,
|
|
|
|
|
id: item.id,
|
|
|
|
|
url: item.url
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (res.video_image) {
|
|
|
|
|
this.videoPosterList = []
|
|
|
|
|
this.videoPosterList.push({
|
|
|
|
|
name: res.video_image.original_name,
|
|
|
|
|
id: res.video_image.id,
|
|
|
|
|
url: res.video_image.url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (res.video) {
|
|
|
|
|
this.videoList = []
|
|
|
|
|
this.videoList.push({
|
|
|
|
|
name: res.video.original_name,
|
|
|
|
|
id: res.video.id,
|
|
|
|
|
url: res.video.url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -445,9 +560,13 @@
|
|
|
|
|
this.showWang = true
|
|
|
|
|
} else {
|
|
|
|
|
this.id = ''
|
|
|
|
|
// this.filesList = []
|
|
|
|
|
this.filesList = []
|
|
|
|
|
this.showWang = false
|
|
|
|
|
this.subPhaseList = []
|
|
|
|
|
this.subPhaseList = []
|
|
|
|
|
this.videoPosterList = []
|
|
|
|
|
this.videoList = []
|
|
|
|
|
this.showProgress = false
|
|
|
|
|
this.uploadProgress = 0
|
|
|
|
|
this.form = {
|
|
|
|
|
name: "",
|
|
|
|
|
number: '',
|
|
|
|
|
@ -459,7 +578,9 @@
|
|
|
|
|
is_visible: 1,
|
|
|
|
|
is_sell: 1,
|
|
|
|
|
show_price: 0,
|
|
|
|
|
file_ids: '',
|
|
|
|
|
file_ids: [],
|
|
|
|
|
video_image_id:'',
|
|
|
|
|
video_id:'',
|
|
|
|
|
product_details: [],
|
|
|
|
|
content: '',
|
|
|
|
|
}
|
|
|
|
|
|