|
@@ -73,6 +73,7 @@
|
|
|
import {
|
|
|
uploadPerson
|
|
|
} from "@/api/system/user"
|
|
|
+ import store from '@/store'
|
|
|
const recorderManager = uni.getRecorderManager();
|
|
|
const innerAudioContext = uni.createInnerAudioContext();
|
|
|
innerAudioContext.autoplay = true;
|
|
@@ -84,19 +85,6 @@
|
|
|
return {
|
|
|
videoName: '',
|
|
|
fileInfo: {},
|
|
|
- // array: [{
|
|
|
- // value: 'ceshi1',
|
|
|
- // text: 'demo1'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // value: 'ceshi2',
|
|
|
- // text: 'demo3'
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // modelIndex: undefined,
|
|
|
- // isModalVisible: false,
|
|
|
- // modalMessage: '',
|
|
|
- // modalImageSrc: '',
|
|
|
videoContent: [{
|
|
|
value: 'text',
|
|
|
text: '文字输入'
|
|
@@ -119,7 +107,7 @@
|
|
|
},
|
|
|
videoText: '',
|
|
|
missingContent: [],
|
|
|
- timbre:'a',
|
|
|
+ timbre: 'a',
|
|
|
timbreContent: [{
|
|
|
value: 'a',
|
|
|
text: 'timbre1'
|
|
@@ -129,6 +117,7 @@
|
|
|
text: 'timbre2'
|
|
|
}
|
|
|
],
|
|
|
+ personPath: ''
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -148,7 +137,6 @@
|
|
|
title: '录音出错',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
- console.error('录音错误:', err);
|
|
|
});
|
|
|
},
|
|
|
onShow() {
|
|
@@ -171,9 +159,9 @@
|
|
|
sourceType: ['album', 'camera'],
|
|
|
success: function(res) {
|
|
|
that.imagePath = res.tempFilePaths[0];
|
|
|
+ that.uploadImagePath()
|
|
|
},
|
|
|
fail: function(err) {
|
|
|
- console.error('图片选择失败:', err);
|
|
|
uni.showToast({
|
|
|
title: '图片选择失败',
|
|
|
icon: 'none'
|
|
@@ -181,19 +169,19 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-/* bindPickerChange(e) {
|
|
|
- const tempOption = this.array.find(item => item.value == e).text;
|
|
|
- this.modalMessage = `您选择的是: ${tempOption}`;
|
|
|
- this.modalImageSrc = '../static/images/xijiao/avator.png';
|
|
|
- this.isModalVisible = true;
|
|
|
- this.modelIndex = e
|
|
|
- },
|
|
|
- onConfirm() {
|
|
|
- this.isModalVisible = false;
|
|
|
- },
|
|
|
- onCancel() {
|
|
|
- this.isModalVisible = false;
|
|
|
- }, */
|
|
|
+ /* bindPickerChange(e) {
|
|
|
+ const tempOption = this.array.find(item => item.value == e).text;
|
|
|
+ this.modalMessage = `您选择的是: ${tempOption}`;
|
|
|
+ this.modalImageSrc = '../static/images/xijiao/avator.png';
|
|
|
+ this.isModalVisible = true;
|
|
|
+ this.modelIndex = e
|
|
|
+ },
|
|
|
+ onConfirm() {
|
|
|
+ this.isModalVisible = false;
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ this.isModalVisible = false;
|
|
|
+ }, */
|
|
|
radioChange(evt) {
|
|
|
for (let i = 0; i < this.videoContent.length; i++) {
|
|
|
if (this.videoContent[i].value === evt.detail.value) {
|
|
@@ -218,7 +206,6 @@
|
|
|
numberOfChannels: 1,
|
|
|
encodeBitRate: 192000,
|
|
|
format: 'wav',
|
|
|
- // frameSize: 50
|
|
|
});
|
|
|
this.isRecording = true;
|
|
|
}
|
|
@@ -236,43 +223,39 @@
|
|
|
// },
|
|
|
uploadImagePath() {
|
|
|
let data = {
|
|
|
- // name: 'personimage',
|
|
|
- // filePath: this.imagePath,
|
|
|
file: this.imagePath
|
|
|
}
|
|
|
uploadPerson(data).then(response => {
|
|
|
- store.commit('SET_PERSON', baseUrl + response.data.url)
|
|
|
- uni.navigateBack()
|
|
|
+ this.personPath = response.data.url
|
|
|
})
|
|
|
},
|
|
|
jumpToList() {
|
|
|
- let missingFields = [];
|
|
|
- if (!this.videoName.trim()) {
|
|
|
- missingFields.push('视频名称');
|
|
|
- }
|
|
|
- // if (!this.fileInfo.path) {
|
|
|
- // missingFields.push('人物形象');
|
|
|
- // }
|
|
|
- if (!this.imagePath) {
|
|
|
- missingFields.push('人物形象');
|
|
|
- }
|
|
|
- // if (!this.modelIndex) {
|
|
|
- // missingFields.push('视频模板');
|
|
|
- // }
|
|
|
- const hasContent = this.videoText.trim() !== '' && this.timbre;
|
|
|
- const hasVoice = this.audioPath;
|
|
|
- if (!hasContent && !hasVoice) {
|
|
|
- missingFields.push('文字内容或语音输入');
|
|
|
- }
|
|
|
- if (missingFields.length > 0) {
|
|
|
- this.missingContent = `请确定:${missingFields.join('、')}是否填写完整!`
|
|
|
- this.$refs.alertDialog.open()
|
|
|
- return;
|
|
|
- }
|
|
|
- // this.uploadImagePath()
|
|
|
- uni.navigateTo({
|
|
|
- url: 'list/creatingVideo/creatingVideo',
|
|
|
- });
|
|
|
+ let missingFields = [];
|
|
|
+ if (!this.videoName.trim()) {
|
|
|
+ missingFields.push('视频名称');
|
|
|
+ }
|
|
|
+ // if (!this.fileInfo.path) {
|
|
|
+ // missingFields.push('人物形象');
|
|
|
+ // }
|
|
|
+ if (!this.imagePath) {
|
|
|
+ missingFields.push('人物形象');
|
|
|
+ }
|
|
|
+ // if (!this.modelIndex) {
|
|
|
+ // missingFields.push('视频模板');
|
|
|
+ // }
|
|
|
+ const hasContent = this.videoText.trim() !== '' && this.timbre;
|
|
|
+ const hasVoice = this.audioPath;
|
|
|
+ if (!hasContent && !hasVoice) {
|
|
|
+ missingFields.push('文字内容或语音输入');
|
|
|
+ }
|
|
|
+ if (missingFields.length > 0) {
|
|
|
+ this.missingContent = `请确定:${missingFields.join('、')}是否填写完整!`
|
|
|
+ this.$refs.alertDialog.open()
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: 'list/creatingVideo/creatingVideo',
|
|
|
+ });
|
|
|
},
|
|
|
dialogClose() {
|
|
|
console.log('点击关闭')
|
|
@@ -379,7 +362,8 @@
|
|
|
display: block;
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
- /deep/ .uni-border-left{
|
|
|
- display:none;
|
|
|
+
|
|
|
+ /deep/ .uni-border-left {
|
|
|
+ display: none;
|
|
|
}
|
|
|
</style>
|