| xqd
@@ -29,7 +29,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="selCon">
|
|
|
- <view class="item" @click="show=true" v-if="!audioUrl">
|
|
|
+ <view class="item" @click="show=true" v-if="curBobaoIndex==0">
|
|
|
<view class="label">
|
|
|
语速:
|
|
|
</view>
|
| xqd
@@ -37,7 +37,7 @@
|
|
|
{{roundRate}}X
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="item" @click="show1=true" v-if="!audioUrl">
|
|
|
+ <view class="item" @click="show1=true" v-if="curBobaoIndex==0">
|
|
|
<view class="label">
|
|
|
声音:{{selVoiceItem.name}}
|
|
|
</view>
|
| xqd
@@ -64,26 +64,34 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="robotNameBox">
|
|
|
- <!-- <view class="name">
|
|
|
- 播报标题:
|
|
|
- </view> -->
|
|
|
<uni-easyinput :inputBorder="true" :clearable="false" v-model="robotName"
|
|
|
placeholder="请输入播报标题"></uni-easyinput>
|
|
|
</view>
|
|
|
- <u--textarea height="" :disabled="audioUrl?true:false" border="none" :autoHeight="true" maxlength="9999"
|
|
|
- v-model="textAreaValue" placeholder="请输入播报内容"></u--textarea>
|
|
|
|
|
|
- <button @click="uploadVideo">上传录音文件</button>
|
|
|
- <view class="audioList" v-if="audioUrl">
|
|
|
- <view class="">
|
|
|
- 已上传的音频:
|
|
|
+ <view class="audioOrTxtChange">
|
|
|
+ <view class="item " :class="[index==curBobaoIndex?'item1':'item2']"
|
|
|
+ v-for="(item,index) in bobaoMenuList" @click="handleChangeBobao(index)">
|
|
|
+ {{item}}
|
|
|
</view>
|
|
|
- <view class="audioListBox">
|
|
|
- <view class="con">
|
|
|
- {{audioUrl}}
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="" v-if="curBobaoIndex==0">
|
|
|
+ <u--textarea height="" :disabled="false" border="none" :autoHeight="true" maxlength="9999"
|
|
|
+ v-model="textAreaValue" placeholder="请输入播报内容"></u--textarea>
|
|
|
+ </view>
|
|
|
+ <view class="" v-else style="height: 400rpx;">
|
|
|
+ <view class="uploadVideoBtn" @click="uploadVideo">上传录音文件</view>
|
|
|
+ <view class="audioList" v-if="audioUrl">
|
|
|
+ <view class="">
|
|
|
+ 已上传的音频:
|
|
|
+ </view>
|
|
|
+ <view class="audioListBox">
|
|
|
+ <view class="con">
|
|
|
+ {{audioUrl}}
|
|
|
+ </view>
|
|
|
+ <text @click="audioUrl=''" class="iconfont icon-shanchu rightIcon"
|
|
|
+ :style="{fontSize:isPc?'64rpx':'32rpx'}"></text>
|
|
|
</view>
|
|
|
- <text @click="audioUrl=''" class="iconfont icon-shanchu rightIcon"
|
|
|
- :style="{fontSize:isPc?'64rpx':'32rpx'}"></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
| xqd
@@ -175,7 +183,7 @@
|
|
|
<image src="/static/images/selected.png" mode=""></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="content">
|
|
|
+ <view class="content" style="padding: 0 20rpx;">
|
|
|
<view class="filterConList">
|
|
|
<view class="item" v-for="(item,index) in roleList" @click="handleRoleSel(item,index)">
|
|
|
<image :class="[currTabIndexModal==index?'sel':'']" :src="item.url" mode="">
|
| xqd
@@ -216,16 +224,6 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- <view class="filterBox">
|
|
|
- <view class="tabList">
|
|
|
- <view class="item1" style="padding-left: 40rpx;padding-right: 40rpx;"
|
|
|
- v-for="(item,index) in bgList" :class="[currTabIndex2==index?'tabActive':'']"
|
|
|
- @click="currTabIndex2=index">
|
|
|
- {{item}}
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
-
|
|
|
<view class="filterConList2" style="max-height: 500rpx;min-height: 500rpx;overflow-y: scroll;">
|
|
|
<view class="pictureBox" v-if="currTabIndex2==0">
|
|
|
<view class="bgBox" v-for="(item,index) in bgPicList">
|
| xqd
@@ -281,6 +279,7 @@
|
|
|
<view class=""
|
|
|
style="margin-left: 30rpx;margin-top: 20rpx;word-break: break-all;word-wrap: break-word;">
|
|
|
已选择的背景图:<br>
|
|
|
+ <!-- {{testCusBgImg1}} -->
|
|
|
{{testCusBgImg}}
|
|
|
</view>
|
|
|
</view>
|
| xqd
@@ -399,11 +398,16 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ bobaoMenuList: ['输入播报文本', '上传播报录音文件'],
|
|
|
+ curBobaoIndex: 0,
|
|
|
+
|
|
|
+ localBgPicName: '',
|
|
|
refImg1: '',
|
|
|
refImg2: '',
|
|
|
|
|
|
|
|
|
testCusBgImg: '',
|
|
|
+ testCusBgImg1: '',
|
|
|
// tempAudioUrl: 'https://oaigc.oss-cn-chengdu.aliyuncs.com/20230804/90d3618dd8ae5a9ea50b932dba34f295.mp3',
|
|
|
|
|
|
audioUrl: '',
|
| xqd
@@ -585,6 +589,11 @@
|
|
|
this.testCusBgImg = getApp().draftDetail.back_url
|
|
|
this.selBgPic = getApp().draftDetail.back_url
|
|
|
this.bgItem.scale = getApp().draftDetail.scale
|
|
|
+ this.currTabIndex2 = 1
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.audioUrl && !this.textAreaValue) {
|
|
|
+ this.curBobaoIndex = 1
|
|
|
}
|
|
|
console.log('传过来的草稿项:', this.detail);
|
|
|
},
|
| xqd
@@ -683,6 +692,13 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ handleChangeBobao(index) {
|
|
|
+ this.curBobaoIndex = index
|
|
|
+ // if (index == 0) {
|
|
|
+ // this.audioUrl = ''
|
|
|
+ // }
|
|
|
+ },
|
|
|
+
|
|
|
previewImg(url) {
|
|
|
uni.previewImage({
|
|
|
urls: [url],
|
| xqd
@@ -702,6 +718,16 @@
|
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album', 'camera'], //从相册选择
|
|
|
success: function(res) {
|
|
|
+ that.localBgPicName = res.tempFiles[0].name
|
|
|
+ console.log('选择图片返回值:', res, res.tempFiles[0].size, that.localBgPicName);
|
|
|
+ if (res.tempFiles[0].size >
|
|
|
+ 5242880) {
|
|
|
+ return uni.showToast({
|
|
|
+ title: '图片大小最大不能超过5M',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
const tempFilePaths = res.tempFilePaths;
|
|
|
//上传服务器将服务器;
|
|
|
uni.uploadFile({
|
| xqd
@@ -716,11 +742,16 @@
|
|
|
let a = JSON.parse(res2.data);
|
|
|
if (a.code == 0) {
|
|
|
that.testCusBgImg = a.data.path.trim()
|
|
|
+ that.testCusBgImg1 = that.localBgPicName
|
|
|
console.log('上传图片返回值----1:', that.testCusBgImg);
|
|
|
|
|
|
- that.selRoleItem = {}
|
|
|
- that.currTabIndexModal = -1
|
|
|
- that.roleList = that.roleList2.filter((item, index) => {
|
|
|
+ if (that.selRoleItem.proportion != '9:16') {
|
|
|
+ that.selRoleItem = {}
|
|
|
+ that.currTabIndexModal = -1
|
|
|
+ }
|
|
|
+
|
|
|
+ that.roleList = that.roleList2.filter((item,
|
|
|
+ index) => {
|
|
|
return item.proportion == '9:16'
|
|
|
|
|
|
})
|
| xqd
@@ -754,6 +785,16 @@
|
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album', 'camera'], //从相册选择
|
|
|
success: function(res) {
|
|
|
+ that.localBgPicName = res.tempFiles[0].name
|
|
|
+ // console.log('选择图片返回值:', res, res.tempFiles[0].size, that.localBgPicName);
|
|
|
+ if (res.tempFiles[0].size >
|
|
|
+ 5242880) {
|
|
|
+ return uni.showToast({
|
|
|
+ title: '图片大小最大不能超过5M',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
const tempFilePaths = res.tempFilePaths;
|
|
|
//上传服务器将服务器;
|
|
|
uni.uploadFile({
|
| xqd
@@ -768,11 +809,15 @@
|
|
|
let a = JSON.parse(res2.data);
|
|
|
if (a.code == 0) {
|
|
|
that.testCusBgImg = a.data.path.trim()
|
|
|
+ that.testCusBgImg1 = that.localBgPicName
|
|
|
console.log('上传图片返回值---2:', that.testCusBgImg);
|
|
|
|
|
|
- that.selRoleItem = {}
|
|
|
- that.currTabIndexModal = -1
|
|
|
- that.roleList = that.roleList2.filter((item, index) => {
|
|
|
+ if (that.selRoleItem.proportion != '16:9') {
|
|
|
+ that.selRoleItem = {}
|
|
|
+ that.currTabIndexModal = -1
|
|
|
+ }
|
|
|
+ that.roleList = that.roleList2.filter((item,
|
|
|
+ index) => {
|
|
|
return item.proportion == '16:9'
|
|
|
})
|
|
|
that.bgItem = {
|
| xqd
@@ -819,6 +864,14 @@
|
|
|
extension: ['.mp3'],
|
|
|
success: function(res) {
|
|
|
let tempFilePaths = res.tempFilePaths;
|
|
|
+
|
|
|
+ console.log('选择的音频文件返回值', res);
|
|
|
+ if (!res.tempFiles[0].name.endsWith('.mp3')) {
|
|
|
+ return uni.showToast({
|
|
|
+ title: "请上传mp3音频文件",
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
uni.showLoading({
|
|
|
title: "上传中...",
|
|
|
});
|
| xqd
@@ -872,14 +925,25 @@
|
|
|
if (this.testCusBgImg) {
|
|
|
this.testCusBgImg = ''
|
|
|
}
|
|
|
+ if (this.testCusBgImg1) {
|
|
|
+ this.testCusBgImg1 = ''
|
|
|
+ }
|
|
|
|
|
|
this.bgItem = item
|
|
|
this.newBgItem = item
|
|
|
console.log('111111111', item);
|
|
|
|
|
|
- // return
|
|
|
- this.selRoleItem = {}
|
|
|
- this.currTabIndexModal = -1
|
|
|
+ if (this.selRoleItem.proportion == '9:16') {
|
|
|
+ if (item.scale != 1) {
|
|
|
+ this.selRoleItem = {}
|
|
|
+ this.currTabIndexModal = -1
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (item.scale != 2) {
|
|
|
+ this.selRoleItem = {}
|
|
|
+ this.currTabIndexModal = -1
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (item.scale == 1) {
|
|
|
this.roleList = this.roleList2.filter((item, index) => {
|
| xqd
@@ -919,12 +983,12 @@
|
|
|
backId: this.bgItem.id
|
|
|
});
|
|
|
} else {
|
|
|
- if (this.bgItem.id != this.newBgItem.id) {
|
|
|
- return uni.showToast({
|
|
|
- title: '请先选择背景图,再选择角色',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- }
|
|
|
+ // if (this.bgItem.id != this.newBgItem.id) {
|
|
|
+ // return uni.showToast({
|
|
|
+ // title: '请先选择背景图,再选择角色',
|
|
|
+ // icon: 'none'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
this.selRoleItem = item
|
|
|
this.selRoleId = item.id - 1
|
|
|
this.currTabIndexModal = index
|
| xqd
@@ -994,7 +1058,7 @@
|
|
|
|
|
|
|
|
|
let parmas = {}
|
|
|
- if (this.audioUrl && !this.testCusBgImg) {
|
|
|
+ if (this.audioUrl && !this.testCusBgImg && this.curBobaoIndex == 1) {
|
|
|
parmas = {
|
|
|
name: this.robotName,
|
|
|
// content: this.textAreaValue,
|
| xqd
@@ -1004,12 +1068,12 @@
|
|
|
// stage: this.roundRate,
|
|
|
audio_url: this.audioUrl
|
|
|
}
|
|
|
- } else if (this.audioUrl && this.testCusBgImg) {
|
|
|
+ } else if (this.audioUrl && this.testCusBgImg && this.curBobaoIndex == 1) {
|
|
|
parmas = {
|
|
|
name: this.robotName,
|
|
|
// content: this.textAreaValue,
|
|
|
role: this.selRoleId,
|
|
|
- back: this.selBgId,
|
|
|
+ // back: this.selBgId,
|
|
|
// audio: this.selVoiceId,
|
|
|
// stage: this.roundRate,
|
|
|
audio_url: this.audioUrl,
|
| xqd
@@ -1026,6 +1090,24 @@
|
|
|
stage: this.roundRate,
|
|
|
// audio_url: this.audioUrl
|
|
|
}
|
|
|
+ } else if (!this.audioUrl && this.curBobaoIndex == 1) {
|
|
|
+ return uni.showToast({
|
|
|
+ title: '请上传录音播报文件',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+
|
|
|
+ } else if (this.audioUrl && !this.textAreaValue) {
|
|
|
+ parmas = {
|
|
|
+ name: this.robotName,
|
|
|
+ content: this.textAreaValue,
|
|
|
+ role: this.selRoleId,
|
|
|
+ // back: this.selBgId,
|
|
|
+ back_url: this.testCusBgImg,
|
|
|
+ audio: this.selVoiceId,
|
|
|
+ stage: this.roundRate,
|
|
|
+ // audio_url: this.audioUrl
|
|
|
+ }
|
|
|
} else {
|
|
|
parmas = {
|
|
|
name: this.robotName,
|
| xqd
@@ -1087,7 +1169,7 @@
|
|
|
|
|
|
handleSetBox(item) {
|
|
|
if (item.name == '全局语速') {
|
|
|
- if (this.audioUrl) {
|
|
|
+ if (this.curBobaoIndex == 1) {
|
|
|
return uni.showToast({
|
|
|
title: '上传音频不支持全局语速',
|
|
|
icon: 'none'
|
| xqd
@@ -1095,7 +1177,7 @@
|
|
|
}
|
|
|
this.show = true
|
|
|
} else if (item.name == '声音') {
|
|
|
- if (this.audioUrl) {
|
|
|
+ if (this.curBobaoIndex == 1) {
|
|
|
return uni.showToast({
|
|
|
title: '上传音频不支持声音选择',
|
|
|
icon: 'none'
|