Commit 84b51067 authored by verestrasz's avatar verestrasz

音频

parent dfedd56d
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
:size="iconSize" :size="iconSize"
></Icon> ></Icon>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<Progress <Progress
...@@ -64,6 +65,7 @@ ...@@ -64,6 +65,7 @@
footer-hide footer-hide
class="upload-detail-modal" class="upload-detail-modal"
class-name="vertical-center-modal" class-name="vertical-center-modal"
:class="{'audioModal':type==='audio'}"
:width="50" :width="50"
> >
<img :src="detailSrc" alt v-if="type == 'image'" style="height: 100%;width: 100%;object-fit: contain;" /> <img :src="detailSrc" alt v-if="type == 'image'" style="height: 100%;width: 100%;object-fit: contain;" />
...@@ -76,6 +78,10 @@ ...@@ -76,6 +78,10 @@
controls="controls" controls="controls"
style="width: 100%;height: 100%" style="width: 100%;height: 100%"
/> />
<audio controls v-if="detailModal &&type == 'audio'">
<source :src="detailSrc" >
您的浏览器不支持 audio 元素。
</audio>
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -84,6 +90,7 @@ import { uploadImgUrl, uploadVideoUrl, uploadApkUrl } from '@/api/apiConfig' ...@@ -84,6 +90,7 @@ import { uploadImgUrl, uploadVideoUrl, uploadApkUrl } from '@/api/apiConfig'
import { apiVerify } from '@/api/apiVerify' import { apiVerify } from '@/api/apiVerify'
import { getNameFromUrl, getPosterFromVideoUrl } from '@/libs/tools' import { getNameFromUrl, getPosterFromVideoUrl } from '@/libs/tools'
import AndroidBg from '@/assets/images/android-bg.jpg' import AndroidBg from '@/assets/images/android-bg.jpg'
import AudioBg from "@/assets/images/audio.png"
import ThreeD from '@/assets/images/3D.png' import ThreeD from '@/assets/images/3D.png'
import { put, formatTime, getFileNameUUID } from '@/libs/ali-oss' import { put, formatTime, getFileNameUUID } from '@/libs/ali-oss'
export default { export default {
...@@ -141,9 +148,11 @@ export default { ...@@ -141,9 +148,11 @@ export default {
} else if (this.type === 'video') { } else if (this.type === 'video') {
return '.mp4,.mkv' return '.mp4,.mkv'
} else if (this.type === 'apk') { } else if (this.type === 'apk') {
return '.apk, .xlsx, ' return '.apk, .xlsx'
} else if (this.type === '3d') { } else if (this.type === '3d') {
return '.jm2, .fbx, .gltf,' return '.jm2, .fbx, .gltf,'
}else if (this.type === 'audio') {
return '.mp3, .wav, .ogg'
} }
}, },
fileFormat () { fileFormat () {
...@@ -155,6 +164,8 @@ export default { ...@@ -155,6 +164,8 @@ export default {
return ['apk', 'xlsx'] return ['apk', 'xlsx']
} else if (this.type === '3d') { } else if (this.type === '3d') {
return ['jm2', 'fbx', 'gltf'] return ['jm2', 'fbx', 'gltf']
}else if (this.type === 'audio') {
return ['mp3','wav','ogg']
} }
}, },
uploadUrl () { uploadUrl () {
...@@ -162,8 +173,10 @@ export default { ...@@ -162,8 +173,10 @@ export default {
return uploadImgUrl return uploadImgUrl
} else if (this.type === 'video') { } else if (this.type === 'video') {
return uploadVideoUrl return uploadVideoUrl
} else if (this.type === 'apk' || this.type==='3d') { } else if (this.type === 'apk' || this.type === '3d') {
return uploadApkUrl return uploadApkUrl
}else if (this.type === 'audio') {
return uploadVideoUrl
} }
}, },
...@@ -231,13 +244,15 @@ export default { ...@@ -231,13 +244,15 @@ export default {
methods: { methods: {
getImgUrl (item) { getImgUrl (item) {
if (this.type === 'image') { if (this.type === 'image') {
return this.imgCompression(item.url,150) return this.imgCompression(item.url, 150)
} else if (this.type === 'video') { } else if (this.type === 'video') {
return getPosterFromVideoUrl(item.url) return getPosterFromVideoUrl(item.url)
} else if (this.type === 'apk') { } else if (this.type === 'apk') {
return AndroidBg return AndroidBg
} else if (this.type === '3d') { } else if (this.type === '3d') {
return ThreeD return ThreeD
}else if (this.type === 'audio') {
return AudioBg
} }
}, },
handleRemove (index) { handleRemove (index) {
...@@ -357,6 +372,11 @@ export default { ...@@ -357,6 +372,11 @@ export default {
.ivu-modal-body{ .ivu-modal-body{
height: 700px; height: 700px;
} }
&.audioModal{
.ivu-modal-body{
height: 100px;
}
}
} }
.vertical-center-modal { .vertical-center-modal {
display: flex; display: flex;
......
...@@ -79,8 +79,8 @@ export default { ...@@ -79,8 +79,8 @@ export default {
vKey: '' vKey: ''
}, },
codeSrc: '', codeSrc: '',
appid: '2094772907', // appid: '2094772907',
// appid: '2031161403', appid: '2031161403',
loginLoading: false loginLoading: false
} }
}, },
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
:readonly="isDetail " :readonly="isDetail "
showWatch showWatch
/> />
<div class="tip" v-if="!isDetail">提示:最多可上传5张,建议尺寸375 * 365,大小不得超过6MB。</div> <div class="tip" v-if="!isDetail">提示:最多可上传5张,建议尺寸375 * 365,大小不得超过6MB,格式.jpg,.jpeg,.png,.gif</div>
</div> </div>
</div> </div>
<div class="item" v-show="(!isDetail&&!isEdit) || !!data.video"> <div class="item" v-show="!isDetail">
<label class="label">商品视频:</label> <label class="label">商品视频:</label>
<div class="upload-con"> <div class="upload-con">
<file-upload <file-upload
...@@ -33,6 +33,38 @@ ...@@ -33,6 +33,38 @@
<div class="tip" v-if="!isDetail">提示:仅可上传一张,商品宣传视频,用于详情页展示,建议尺寸375 * 365,大小不得超过50MB(非必传)。</div> <div class="tip" v-if="!isDetail">提示:仅可上传一张,商品宣传视频,用于详情页展示,建议尺寸375 * 365,大小不得超过50MB(非必传)。</div>
</div> </div>
</div> </div>
<div class="item" v-show="isDetail&&data.video">
<label class="label">商品视频:</label>
<div class="upload-con">
<video controls :src="data.video" style="width:150px;height:150px"></video>
</div>
</div>
<div class="item" v-show="!isDetail">
<label class="label">商品音频:</label>
<div class="upload-con">
<file-upload
type="audio"
:width="150"
:iconSize="26"
:maxNum="1"
:maxSize="50"
v-model="data.audioList"
:defaultList="data.defaultAudioList"
:readonly="isDetail"
showWatch
/>
<div class="tip" v-if="!isDetail">提示:仅可上一个,商品宣传音频,用于详情页展示,建议格式(mp3,ogg,wav),大小不得超过50MB(非必传)。</div>
</div>
</div>
<div class="item" v-show="isDetail&&data.audio">
<label class="label">商品音频:</label>
<div class="upload-con">
<audio controls>
<source :src="data.audio" >
您的浏览器不支持 audio 元素。
</audio>
</div>
</div>
<div class="item"> <div class="item">
<label class="label">商品缩略图:</label> <label class="label">商品缩略图:</label>
<div class="upload-con"> <div class="upload-con">
...@@ -46,7 +78,7 @@ ...@@ -46,7 +78,7 @@
:readonly="isDetail " :readonly="isDetail "
showWatch showWatch
/> />
<div class="tip" v-if="!isDetail">提示:仅可上传一张,建议尺寸100 * 100,大小不得超过6MB。</div> <div class="tip" v-if="!isDetail">提示:仅可上传一张,建议尺寸100 * 100,大小不得超过6MB,格式.jpg,.jpeg,.png,.gif</div>
<!-- {{data.thumbList}} --> <!-- {{data.thumbList}} -->
</div> </div>
</div> </div>
...@@ -139,7 +171,10 @@ export default { ...@@ -139,7 +171,10 @@ export default {
defaultVideoList: [], defaultVideoList: [],
defaultVideoThumbList: [], defaultVideoThumbList: [],
defaultThumbList: [], defaultThumbList: [],
threeDUrl:[] threeDUrl:[],
audio:"",
audioList:[],
defaultAudioList:[],
} }
}, },
isDetail: { isDetail: {
......
...@@ -176,6 +176,9 @@ export default { ...@@ -176,6 +176,9 @@ export default {
video: '', video: '',
videoList: [], videoList: [],
videoThumb: '', videoThumb: '',
audio:"",
audioList:[],
defaultAudioList:[],
thumb: '', thumb: '',
thumbList: [], thumbList: [],
detailPictures: [], detailPictures: [],
...@@ -254,6 +257,7 @@ export default { ...@@ -254,6 +257,7 @@ export default {
imgList, imgList,
video, video,
videoThumb, videoThumb,
audio,
thumb, thumb,
detail, detail,
type, type,
...@@ -343,6 +347,9 @@ export default { ...@@ -343,6 +347,9 @@ export default {
defaultVideoList: [video], defaultVideoList: [video],
defaultThumbList: thumb ? [thumb] : [], defaultThumbList: thumb ? [thumb] : [],
defaultthreeDUrl: threeDUrl? [threeDUrl] : [], defaultthreeDUrl: threeDUrl? [threeDUrl] : [],
audio:audio,
audioList: audio?[audio]:[],
defaultAudioList: audio?[audio]:[],
} }
if (!video) { if (!video) {
this.form.deciptInfo.video = '' this.form.deciptInfo.video = ''
...@@ -596,6 +603,9 @@ export default { ...@@ -596,6 +603,9 @@ export default {
form.video = deciptInfo.videoList[0] form.video = deciptInfo.videoList[0]
form.videoPoster = getPosterFromVideoUrl(form.video) form.videoPoster = getPosterFromVideoUrl(form.video)
} }
if (deciptInfo.audioList && deciptInfo.audioList.length !== 0) {
form.audio = deciptInfo.audioList[0];
}
if(deciptInfo.threeDUrl&&deciptInfo.threeDUrl.length>0){ if(deciptInfo.threeDUrl&&deciptInfo.threeDUrl.length>0){
form.threeDUrl=deciptInfo.threeDUrl[0] form.threeDUrl=deciptInfo.threeDUrl[0]
}else{ }else{
...@@ -787,6 +797,14 @@ export default { ...@@ -787,6 +797,14 @@ export default {
form.video = deciptInfo.videoList[0] form.video = deciptInfo.videoList[0]
form.videoPoster = getPosterFromVideoUrl(form.video) form.videoPoster = getPosterFromVideoUrl(form.video)
} }
if(deciptInfo.threeDUrl&&deciptInfo.threeDUrl.length>0){
form.threeDUrl=deciptInfo.threeDUrl[0]
}else{
form.threeDUrl=''
}
if (deciptInfo.audioList && deciptInfo.audioList.length !== 0) {
form.audio = deciptInfo.audioList[0];
}
if (this.backType == 1) { if (this.backType == 1) {
form.returnType = 0 form.returnType = 0
} else if (this.backType == 2) { } else if (this.backType == 2) {
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
:readonly="isDetail" :readonly="isDetail"
showWatch showWatch
/> />
<div class="tip" v-if="!isDetail">提示:最多可上传5张,建议尺寸375 * 365,大小不得超过6MB。</div> <div class="tip" v-if="!isDetail">提示:最多可上传5张,建议尺寸375 * 365,大小不得超过6MB,格式.jpg,.jpeg,.png,.gif</div>
</div> </div>
</div> </div>
<div class="item" v-show="(!isDetail&&!isEdit && shopStatus!=4) || !!data.video"> <div class="item" v-show="!isDetail">
<label class="label">商品视频:</label> <label class="label">商品视频:</label>
<div class="upload-con"> <div class="upload-con">
<file-upload <file-upload
...@@ -33,6 +33,39 @@ ...@@ -33,6 +33,39 @@
<div class="tip" v-if="!isDetail">提示:仅可上传一张,商品宣传视频,用于详情页展示,建议尺寸375 * 365,大小不得超过50MB(非必传)。</div> <div class="tip" v-if="!isDetail">提示:仅可上传一张,商品宣传视频,用于详情页展示,建议尺寸375 * 365,大小不得超过50MB(非必传)。</div>
</div> </div>
</div> </div>
<div class="item" v-show="isDetail&&data.video">
<label class="label">商品视频:</label>
<div class="upload-con">
<video :src="data.video" controls style="width:150px;height:150px"></video>
</div>
</div>
<div class="item" v-show="!isDetail">
<label class="label">商品音频:</label>
<div class="upload-con">
<file-upload
type="audio"
:width="150"
:iconSize="26"
:maxNum="1"
:maxSize="50"
v-model="data.audioList"
:defaultList="data.defaultAudioList"
:readonly="isDetail"
showWatch
/>
<div class="tip" v-if="!isDetail">提示:仅可上一个,商品宣传音频,用于详情页展示,建议格式(mp3,ogg,wav),大小不得超过50MB(非必传)。</div>
</div>
</div>
<div class="item" v-show="isDetail&&data.audio">
<label class="label">商品音频:</label>
<div class="upload-con">
<audio controls>
<source :src="data.audio" >
您的浏览器不支持 audio 元素。
</audio>
</div>
</div>
<div class="item"> <div class="item">
<label class="label">商品缩略图:</label> <label class="label">商品缩略图:</label>
<div class="upload-con"> <div class="upload-con">
...@@ -46,11 +79,9 @@ ...@@ -46,11 +79,9 @@
:readonly="isDetail" :readonly="isDetail"
showWatch showWatch
/> />
<div class="tip" v-if="!isDetail">提示:仅可上传一张,建议尺寸100 * 100,大小不得超过6MB。</div> <div class="tip" v-if="!isDetail">提示:仅可上传一张,建议尺寸100 * 100,大小不得超过6MB,格式.jpg,.jpeg,.png,.gif。</div>
<!-- {{data.thumbList}} -->
</div> </div>
</div> </div>
<!-- {{data.threeDUrl}} -->
<div class="item"> <div class="item">
<label class="label">商品3D展示:</label> <label class="label">商品3D展示:</label>
...@@ -141,7 +172,10 @@ export default { ...@@ -141,7 +172,10 @@ export default {
defaultVideoList: [], defaultVideoList: [],
defaultVideoThumbList: [], defaultVideoThumbList: [],
defaultThumbList: [], defaultThumbList: [],
threeDUrl:[] threeDUrl:[],
audio:"",
audioList:[],
defaultAudioList:[],
} }
}, },
isDetail: { isDetail: {
......
...@@ -226,6 +226,9 @@ export default { ...@@ -226,6 +226,9 @@ export default {
video: "", video: "",
videoList: [], videoList: [],
videoThumb: "", videoThumb: "",
audio:"",
audioList:[],
defaultAudioList:[],
thumb: "", thumb: "",
thumbList: [], thumbList: [],
detailPictures: [], detailPictures: [],
...@@ -319,6 +322,9 @@ export default { ...@@ -319,6 +322,9 @@ export default {
this.form.deciptInfo.video = ""; this.form.deciptInfo.video = "";
this.form.deciptInfo.videoList = []; this.form.deciptInfo.videoList = [];
this.form.deciptInfo.videoThumb = ""; this.form.deciptInfo.videoThumb = "";
this.form.deciptInfo.audio = "";
this.form.deciptInfo.audioList = [];
this.form.deciptInfo.defaultAudioList = [];
this.form.deciptInfo.thumb = ""; this.form.deciptInfo.thumb = "";
this.form.deciptInfo.thumbList = []; this.form.deciptInfo.thumbList = [];
this.form.deciptInfo.detailPictures = []; this.form.deciptInfo.detailPictures = [];
...@@ -407,6 +413,7 @@ export default { ...@@ -407,6 +413,7 @@ export default {
difficulty, difficulty,
blindBoxRule, blindBoxRule,
videoThumb, videoThumb,
audio,
thumb, thumb,
detail, detail,
type, type,
...@@ -529,6 +536,9 @@ export default { ...@@ -529,6 +536,9 @@ export default {
defaultDetailPicture: JSON.parse(imgList), defaultDetailPicture: JSON.parse(imgList),
defaultVideoList: [video], defaultVideoList: [video],
defaultThumbList: thumb ? [thumb] : [], defaultThumbList: thumb ? [thumb] : [],
audio:audio,
audioList: audio?[audio]:[],
defaultAudioList: audio?[audio]:[],
}; };
if (!video) { if (!video) {
this.form.deciptInfo.video = ""; this.form.deciptInfo.video = "";
...@@ -1020,6 +1030,9 @@ export default { ...@@ -1020,6 +1030,9 @@ export default {
form.video = deciptInfo.videoList[0]; form.video = deciptInfo.videoList[0];
form.videoPoster = getPosterFromVideoUrl(form.video); form.videoPoster = getPosterFromVideoUrl(form.video);
} }
if (deciptInfo.audioList && deciptInfo.audioList.length !== 0) {
form.audio = deciptInfo.audioList[0];
}
if(deciptInfo.threeDUrl&&deciptInfo.threeDUrl.length>0){ if(deciptInfo.threeDUrl&&deciptInfo.threeDUrl.length>0){
form.threeDUrl=deciptInfo.threeDUrl[0] form.threeDUrl=deciptInfo.threeDUrl[0]
}else{ }else{
...@@ -1258,6 +1271,14 @@ export default { ...@@ -1258,6 +1271,14 @@ export default {
form.video = deciptInfo.videoList[0]; form.video = deciptInfo.videoList[0];
form.videoPoster = getPosterFromVideoUrl(form.video); form.videoPoster = getPosterFromVideoUrl(form.video);
} }
if (deciptInfo.audioList && deciptInfo.audioList.length !== 0) {
form.audio = deciptInfo.audioList[0];
}
if(deciptInfo.threeDUrl&&deciptInfo.threeDUrl.length>0){
form.threeDUrl=deciptInfo.threeDUrl[0]
}else{
form.threeDUrl=''
}
if (this.backType == 1) { if (this.backType == 1) {
form.returnType = 0; form.returnType = 0;
} else if (this.backType == 2) { } else if (this.backType == 2) {
......
...@@ -49,7 +49,9 @@ module.exports = { ...@@ -49,7 +49,9 @@ module.exports = {
// target: 'http://172.22.17.174:8088' // target: 'http://172.22.17.174:8088'
// target: 'http://172.22.17.108:8088' // target: 'http://172.22.17.108:8088'
target: 'https://testadminslg.8n.cn/root' // target: 'https://testadminnewapp.8n.cn/root'
target: 'https://testadminnewapp.8n.cn/root'
// target: 'https://malladmin.inmvo.com/root'
}, },
'/contact': { '/contact': {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment