提交 c01198e7 编写于 作者: zhaosheng.zhang's avatar zhaosheng.zhang

Merge branch 'feature/vod-list' into 'release'

Feature/vod list

See merge request !299
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
class="upload-demo" class="upload-demo"
:disabled="isDisable" :disabled="isDisable"
:before-upload="beforeMusicUpload" :before-upload="beforeMusicUpload"
:action="actionurl" action="#"
:headers="headers" :headers="headers"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-success="sucess" :on-success="sucess"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
slot="tip" slot="tip"
class="el-upload__tip" class="el-upload__tip"
> >
音频格式:mp3 音频格式:mp3、mp4
</p> </p>
<ul <ul
slot="tip" slot="tip"
...@@ -48,7 +48,9 @@ ...@@ -48,7 +48,9 @@
</template> </template>
<script> <script>
import { getBaseUrl } from '@/utils/index'; import { doUpload, getFilePath } from '@/utils/qiniu-util';
import { openLoading, closeLoading } from '@/utils/utils';
let _this = null;
export default { export default {
props: { props: {
isDisable: { isDisable: {
...@@ -67,24 +69,28 @@ ...@@ -67,24 +69,28 @@
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
musicArr: [], musicArr: [],
actionUrl: '',
headers: { headers: {
token: localStorage.getItem('token'), token: localStorage.getItem('token'),
}, },
loading: false, loading: false,
accept: '.mp3,.mpeg', accept: '.mp3,.mpeg,.mp4',
}; };
}, },
watch: { watch: {
musicList(newv) { musicList(newv) {
console.log(newv); console.log(newv);
this.musicArr = newv || []; const newVideoList = newv?.filter(item => {
const suffixUrl = item?.url.substring(item?.url.lastIndexOf('/') + 1); // 接口不返回name,上传数据列表名称展示为截取url最后“/”后面的内容
item.name = suffixUrl;
return item;
});
this.musicArr = newVideoList || [];
}, },
}, },
created() { created() {
_this = this;
this.musicArr = this.musicList; this.musicArr = this.musicList;
console.log(console.log('this.musicList', this.musicArr)); console.log(console.log('this.musicList', this.musicArr));
this.actionurl = getBaseUrl('/diagnose/illness/audio/upload');
}, },
methods: { methods: {
musicUrl(item) { musicUrl(item) {
...@@ -114,14 +120,32 @@ ...@@ -114,14 +120,32 @@
this.loading = false; this.loading = false;
}, },
// 上传mp3 // 上传mp3
beforeMusicUpload() {}, beforeMusicUpload(file) {
openLoading(_this);
doUpload(
_this,
file,
getFilePath(file, null),
null,
null,
''
).then(function(res) {
closeLoading(_this);
const fileItem = {
name: res.name ? res.name : res.fullPath,
size: res.size,
status: 'success',
url: res.fullPath
};
_this.musicArr.push(fileItem);
_this.$message.success('上传成功');
});
},
setNewArr() { setNewArr() {
const newArr = []; const newArr = [];
if (this.musicArr && this.musicArr.length) { if (this.musicArr && this.musicArr.length) {
this.musicArr.forEach((item) => { this.musicArr.forEach((item) => {
if (item.data) { if (item.url && item.status === 'success') {
newArr.push(item.data.domainPath + item.data.path);
} else if (item.url && item.from) {
newArr.push(item.url); newArr.push(item.url);
} }
}); });
......
...@@ -836,7 +836,10 @@ ...@@ -836,7 +836,10 @@
show-word-limit show-word-limit
/> />
</el-form-item> </el-form-item>
<el-form-item label="系统录音/录像"> <el-form-item
v-if="formData.vodList.length > 0"
label="系统录音/录像"
>
<el-form-item <el-form-item
v-for="item in formData.vodList" v-for="item in formData.vodList"
:key="item.url" :key="item.url"
...@@ -856,6 +859,20 @@ ...@@ -856,6 +859,20 @@
'.mp4' '.mp4'
}} }}
</el-link> </el-link>
<el-popover
trigger="hover"
placement="top"
width="1000"
>
<p>{{ item.text }}</p>
<div
slot="reference"
class="vod"
>
<span class="vod-txt">语音转文字:</span>
<span class="vod-text">{{ item.text }}</span>
</div>
</el-popover>
</el-form-item> </el-form-item>
</el-form-item> </el-form-item>
<el-form-item label="音频"> <el-form-item label="音频">
...@@ -1369,6 +1386,7 @@ export default { ...@@ -1369,6 +1386,7 @@ export default {
vodList: { vodList: {
name: '', name: '',
url: '', url: '',
text: ''
}, },
additionPrice: null, // 诊疗费 additionPrice: null, // 诊疗费
orderTotalPrice: null, orderTotalPrice: null,
...@@ -1546,10 +1564,7 @@ export default { ...@@ -1546,10 +1564,7 @@ export default {
this.formData = res.data; this.formData = res.data;
this.formData.price = this.priceFilter(this.formData.price); this.formData.price = this.priceFilter(this.formData.price);
this.formData.additionPrice = this.priceFilter(this.formData.additionPrice); this.formData.additionPrice = this.priceFilter(this.formData.additionPrice);
console.log('问诊价格=====', this.formData.price);
console.log('诊疗费价格=====', this.formData.additionPrice);
this.formData.orderTotalPrice = this.formData.price + this.formData.additionPrice; this.formData.orderTotalPrice = this.formData.price + this.formData.additionPrice;
console.log('订单总金额=====', this.formData.additionPrice);
this.formData.serviceFee = this.priceFilter( this.formData.serviceFee = this.priceFilter(
this.formData.serviceFee this.formData.serviceFee
); );
...@@ -1806,6 +1821,27 @@ export default { ...@@ -1806,6 +1821,27 @@ export default {
.log-info-pagin { .log-info-pagin {
margin: 0 15px; margin: 0 15px;
} }
.vod {
display: flex;
flex-direction: row;
align-items: center;
&-txt {
width: 90px;
}
&-text {
width: 100%;
background: #ccc;
line-height: 20px;
-webkit-line-clamp: 5;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
white-space: normal;
}
}
} }
.btn-wrap { .btn-wrap {
padding: 40px 0 60px; padding: 40px 0 60px;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册