|
@@ -5,18 +5,31 @@
|
|
</view>
|
|
</view>
|
|
<view class="context">
|
|
<view class="context">
|
|
<view class="top" @click="show4=true">
|
|
<view class="top" @click="show4=true">
|
|
- <view class="videoBox1" v-if="bgItem.scale==1&&selBgPic">
|
|
|
|
- <image class="img16" :src="selBgPic" mode=""></image>
|
|
|
|
- </view>
|
|
|
|
- <view class="videoBox2" v-if="bgItem.scale==2&&selBgPic" :style="{}">
|
|
|
|
- <image class="img16" :src="selBgPic" mode=""></image>
|
|
|
|
|
|
+ <view class="top" @click="show4=true">
|
|
|
|
+ <view class="videoBox1" v-if="bgItem.scale==1&&selBgPic">
|
|
|
|
+ <image class="img16" :src="selBgPic" mode=""></image>
|
|
|
|
+ <view class="role">
|
|
|
|
+ <image :src="selRoleItem.url" mode=""></image>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="videoBox2" v-if="bgItem.scale==2&&selBgPic" :style="{}">
|
|
|
|
+ <image class="img16" :src="selBgPic" mode=""></image>
|
|
|
|
+ <view class="role">
|
|
|
|
+ <image :src="selRoleItem.url" mode=""></image>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="videoBox" v-if="!bgItem.scale&&!selBgPic" :style="{minHeight:!selBgPic?'465rpx':''}">
|
|
|
|
+ <view class="emptyVideo" style="background: #ccc;height: 100%;"></view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
+
|
|
<view class="videoBox" v-if="!bgItem.scale&&!selBgPic" :style="{minHeight:!selBgPic?'465rpx':''}">
|
|
<view class="videoBox" v-if="!bgItem.scale&&!selBgPic" :style="{minHeight:!selBgPic?'465rpx':''}">
|
|
<view class="emptyVideo" style="background: #ccc;height: 100%;"></view>
|
|
<view class="emptyVideo" style="background: #ccc;height: 100%;"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="selCon">
|
|
<view class="selCon">
|
|
- <view class="item" @click="show=true">
|
|
|
|
|
|
+ <view class="item" @click="show=true" v-if="!audioUrl">
|
|
<view class="label">
|
|
<view class="label">
|
|
语速:
|
|
语速:
|
|
</view>
|
|
</view>
|
|
@@ -24,7 +37,7 @@
|
|
{{roundRate}}X
|
|
{{roundRate}}X
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="item" @click="show1=true">
|
|
|
|
|
|
+ <view class="item" @click="show1=true" v-if="!audioUrl">
|
|
<view class="label">
|
|
<view class="label">
|
|
声音:{{selVoiceItem.name}}
|
|
声音:{{selVoiceItem.name}}
|
|
</view>
|
|
</view>
|
|
@@ -57,10 +70,22 @@
|
|
<uni-easyinput :inputBorder="true" :clearable="false" v-model="robotName"
|
|
<uni-easyinput :inputBorder="true" :clearable="false" v-model="robotName"
|
|
placeholder="请输入播报标题"></uni-easyinput>
|
|
placeholder="请输入播报标题"></uni-easyinput>
|
|
</view>
|
|
</view>
|
|
- <u--textarea height="" border="none" :autoHeight="true" maxlength="9999" v-model="textAreaValue"
|
|
|
|
- placeholder="请输入播报内容"></u--textarea>
|
|
|
|
|
|
+ <u--textarea height="" :disabled="audioUrl?true:false" border="none" :autoHeight="true" maxlength="9999"
|
|
|
|
+ v-model="textAreaValue" placeholder="请输入播报内容"></u--textarea>
|
|
|
|
|
|
- <!-- <button @click="uploadVideo">上传录音文件</button> -->
|
|
|
|
|
|
+ <button @click="uploadVideo">上传录音文件</button>
|
|
|
|
+ <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>
|
|
|
|
+ </view>
|
|
|
|
|
|
<view class="btnBox">
|
|
<view class="btnBox">
|
|
<view class="btn draft" @click="saveDraft">
|
|
<view class="btn draft" @click="saveDraft">
|
|
@@ -101,7 +126,7 @@
|
|
<u-popup :show="show1" @close="close1" @open="open">
|
|
<u-popup :show="show1" @close="close1" @open="open">
|
|
<view class="contentBox">
|
|
<view class="contentBox">
|
|
<view class="toolBar">
|
|
<view class="toolBar">
|
|
- <view class="cancel" @click="show1=false">
|
|
|
|
|
|
+ <view class="cancel" @click="handleAudioClose">
|
|
<image src="/static/images/closeBtn.png" mode=""></image>
|
|
<image src="/static/images/closeBtn.png" mode=""></image>
|
|
</view>
|
|
</view>
|
|
<view class="center">
|
|
<view class="center">
|
|
@@ -112,30 +137,24 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="content">
|
|
<view class="content">
|
|
- <!-- <view class="filterBox">
|
|
|
|
- <view class="tabList">
|
|
|
|
- <view class="item1" v-for="(item,index) in voiceList"
|
|
|
|
- :class="[currTabIndex==index?'tabActive':'']" @click="currTabIndex=index">
|
|
|
|
- {{item}}
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="filterBtn" @click="handleFilter">
|
|
|
|
- <text class="iconfont icon-shaixuanguolv" style="font-size: 44rpx; color: #26b3a0;"></text>
|
|
|
|
-
|
|
|
|
- </view>
|
|
|
|
- </view> -->
|
|
|
|
-
|
|
|
|
<view class="filterConList" style="max-height: 500rpx;min-height: 500rpx;overflow-y: scroll;">
|
|
<view class="filterConList" style="max-height: 500rpx;min-height: 500rpx;overflow-y: scroll;">
|
|
- <view class="item" v-for="(item,index) in allList" @click="handleVoiceSel(item,index)">
|
|
|
|
- <view class="imgBox">
|
|
|
|
- <image :class="[currTabIndexAll==index?'sel':'']" :src="item.url" mode="">
|
|
|
|
- </view>
|
|
|
|
- </image>
|
|
|
|
- <view class="nameDes">
|
|
|
|
- {{item.title}}
|
|
|
|
|
|
+ <view class="item" v-for="(item,index) in allList">
|
|
|
|
+ <view class="avtarBox" @click="handleVoiceSel(item,index)">
|
|
|
|
+ <view class="imgBox">
|
|
|
|
+ <image :class="[currTabIndexAll==index?'sel':'']" :src="item.url" mode="">
|
|
|
|
+ </view>
|
|
|
|
+ <!-- </image> -->
|
|
|
|
+ <view class="nameDes">
|
|
|
|
+ {{item.title}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="name" :class="[currTabIndexAll==index?'selTxt':'']">
|
|
|
|
+ {{item.name}}
|
|
|
|
+ </view>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
- <view class="name" :class="[currTabIndexAll==index?'selTxt':'']">
|
|
|
|
- {{item.name}}
|
|
|
|
|
|
+
|
|
|
|
+ <view class="playBox" style="" @click="playAudio(item)">
|
|
|
|
+ 试听
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -164,6 +183,9 @@
|
|
<view class="name" :class="[currTabIndexModal==index?'selTxt':'']">
|
|
<view class="name" :class="[currTabIndexModal==index?'selTxt':'']">
|
|
{{item.name}}
|
|
{{item.name}}
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="ratio">
|
|
|
|
+ {{'('+item.proportion+')'}}
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -194,15 +216,59 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</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="filterConList2" style="max-height: 500rpx;min-height: 500rpx;overflow-y: scroll;">
|
|
<view class="pictureBox" v-if="currTabIndex2==0">
|
|
<view class="pictureBox" v-if="currTabIndex2==0">
|
|
- <image :class="[currTabIndexBg==index?'sel':'']" :src="item.url" mode=""
|
|
|
|
- v-for="(item,index) in bgPicList" @click="handleSelBg(item,index)"></image>
|
|
|
|
|
|
+ <view class="bgBox" v-for="(item,index) in bgPicList">
|
|
|
|
+ <image :class="[currTabIndexBg==index?'sel':'']" :src="item.url" mode=""
|
|
|
|
+ @click="handleSelBg(item,index)"></image>
|
|
|
|
+ <view class="ratio">
|
|
|
|
+ {{item.scale==1?'(9:16)':'(16:9)'}}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<view class="pictureBox" v-if="currTabIndex2==1">
|
|
<view class="pictureBox" v-if="currTabIndex2==1">
|
|
- <view class="color" :style="{background:item}" :class="[currTabIndexBgc==index?'sel':'']"
|
|
|
|
- v-for="(item,index) in bgColorList" @click="currTabIndexBgc=index"></view>
|
|
|
|
|
|
+ <!-- <view class="color" :style="{background:item}" :class="[currTabIndexBgc==index?'sel':'']"
|
|
|
|
+ v-for="(item,index) in bgColorList" @click="currTabIndexBgc=index"></view> -->
|
|
|
|
+ <view class="defBox">
|
|
|
|
+ <view class="type1">
|
|
|
|
+ <view class="des">
|
|
|
|
+ <text class="lab">尺寸:9:16</text><br>
|
|
|
|
+ 背景图要求:<br>
|
|
|
|
+ 像素:1080P<br>
|
|
|
|
+ 文件大小:1M以内
|
|
|
|
+ </view>
|
|
|
|
+ <view class="btn" @click="uploadBg1">
|
|
|
|
+ 上传背景图(9:16)
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="type1">
|
|
|
|
+ <view class="des">
|
|
|
|
+ <text class="lab">尺寸:16:9</text><br>
|
|
|
|
+ 背景图要求:<br>
|
|
|
|
+ 像素:1080P<br>
|
|
|
|
+ 文件大小:1M以内
|
|
|
|
+ </view>
|
|
|
|
+ <view class="btn" @click="uploadBg2">
|
|
|
|
+ 上传背景图(16:9)
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+ <view class=""
|
|
|
|
+ style="margin-left: 30rpx;margin-top: 20rpx;word-break: break-all;word-wrap: break-word;">
|
|
|
|
+ 已选择的背景图:<br>
|
|
|
|
+ {{testCusBgImg}}
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -295,6 +361,8 @@
|
|
</view>
|
|
</view>
|
|
</u-popup>
|
|
</u-popup>
|
|
|
|
|
|
|
|
+ <!-- <audio :src="tempAudioUrl" autoplay ref="audioRef" style=""></audio> -->
|
|
|
|
+
|
|
<!-- <wike-tabbar :onTabbar="true" :isShowAnimate="true"></wike-tabbar> -->
|
|
<!-- <wike-tabbar :onTabbar="true" :isShowAnimate="true"></wike-tabbar> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -308,16 +376,26 @@
|
|
backList
|
|
backList
|
|
} from '@/api/robot/index.js'
|
|
} from '@/api/robot/index.js'
|
|
import indexVue from './index.vue';
|
|
import indexVue from './index.vue';
|
|
|
|
+
|
|
|
|
+ import
|
|
|
|
+ uploadImgUrl
|
|
|
|
+ from '@/common/config.js';
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ testCusBgImg: '',
|
|
|
|
+ // tempAudioUrl: 'https://oaigc.oss-cn-chengdu.aliyuncs.com/20230804/90d3618dd8ae5a9ea50b932dba34f295.mp3',
|
|
|
|
+
|
|
|
|
+ audioUrl: '',
|
|
|
|
+
|
|
bgItem: {
|
|
bgItem: {
|
|
|
|
|
|
},
|
|
},
|
|
show5: false,
|
|
show5: false,
|
|
|
|
|
|
show4: false,
|
|
show4: false,
|
|
- bgList: ['图片', '颜色'],
|
|
|
|
|
|
+ // bgList: ['图片', '颜色'],
|
|
|
|
+ bgList: ['预置', '自定义'],
|
|
currTabIndex2: 0,
|
|
currTabIndex2: 0,
|
|
currTabIndexBg: -1,
|
|
currTabIndexBg: -1,
|
|
currTabIndexBgc: -1,
|
|
currTabIndexBgc: -1,
|
|
@@ -395,14 +473,14 @@
|
|
icon: require('@/static/images/audio.png'),
|
|
icon: require('@/static/images/audio.png'),
|
|
name: '声音'
|
|
name: '声音'
|
|
},
|
|
},
|
|
- {
|
|
|
|
- icon: require('@/static/images/role.png'),
|
|
|
|
- name: '角色'
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
icon: require('@/static/images/bg.png'),
|
|
icon: require('@/static/images/bg.png'),
|
|
name: '背景'
|
|
name: '背景'
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ icon: require('@/static/images/role.png'),
|
|
|
|
+ name: '角色'
|
|
|
|
+ },
|
|
],
|
|
],
|
|
videoSrc: '',
|
|
videoSrc: '',
|
|
showMoreMenu: false,
|
|
showMoreMenu: false,
|
|
@@ -422,7 +500,15 @@
|
|
|
|
|
|
roundRate: 1,
|
|
roundRate: 1,
|
|
isGenerate: false,
|
|
isGenerate: false,
|
|
- isCreate: false
|
|
|
|
|
|
+ isCreate: false,
|
|
|
|
+
|
|
|
|
+ roleList2: [],
|
|
|
|
+ bgPicList2: [],
|
|
|
|
+
|
|
|
|
+ newBgItem: {
|
|
|
|
+ id: -1
|
|
|
|
+ },
|
|
|
|
+ music: null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -436,6 +522,8 @@
|
|
|
|
|
|
},
|
|
},
|
|
onLoad(o) {
|
|
onLoad(o) {
|
|
|
|
+
|
|
|
|
+
|
|
if (o.type == 'create') {
|
|
if (o.type == 'create') {
|
|
this.isCreate = true
|
|
this.isCreate = true
|
|
this.selRoleId = 5
|
|
this.selRoleId = 5
|
|
@@ -465,14 +553,23 @@
|
|
this.roundRate = getApp().draftDetail.stage
|
|
this.roundRate = getApp().draftDetail.stage
|
|
this.selVoiceItem = getApp().draftDetail.audios
|
|
this.selVoiceItem = getApp().draftDetail.audios
|
|
this.selRoleItem = getApp().draftDetail.roles
|
|
this.selRoleItem = getApp().draftDetail.roles
|
|
- console.log('传过来的草稿项:', this.detail, this.selBgPic);
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.audioUrl = getApp().draftDetail.audio_url
|
|
|
|
+ console.log('传过来的草稿项:', this.detail);
|
|
},
|
|
},
|
|
async onShow() {
|
|
async onShow() {
|
|
|
|
+
|
|
|
|
+
|
|
let res = await roleList({})
|
|
let res = await roleList({})
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
|
|
|
|
this.roleList = res.msg
|
|
this.roleList = res.msg
|
|
|
|
+
|
|
|
|
+ this.roleList2 = res.msg
|
|
console.log('数字人角色列表返回值:', res);
|
|
console.log('数字人角色列表返回值:', res);
|
|
|
|
+
|
|
|
|
+
|
|
this.currTabIndexModal = res.msg.findIndex((item, index) => {
|
|
this.currTabIndexModal = res.msg.findIndex((item, index) => {
|
|
return item.id == this.selRoleId + 1
|
|
return item.id == this.selRoleId + 1
|
|
})
|
|
})
|
|
@@ -508,12 +605,35 @@
|
|
|
|
|
|
let res3 = await backList({})
|
|
let res3 = await backList({})
|
|
if (res3.code == 0) {
|
|
if (res3.code == 0) {
|
|
- // this.roleList = res.data
|
|
|
|
this.bgPicList = res3.msg
|
|
this.bgPicList = res3.msg
|
|
|
|
+ this.bgPicList2 = res3.msg
|
|
console.log('数字人背景列表返回值:', res3);
|
|
console.log('数字人背景列表返回值:', res3);
|
|
|
|
+
|
|
this.currTabIndexBg = res3.msg.findIndex((item, index) => {
|
|
this.currTabIndexBg = res3.msg.findIndex((item, index) => {
|
|
return item.id == this.selBgId + 1
|
|
return item.id == this.selBgId + 1
|
|
})
|
|
})
|
|
|
|
+ // if (this.detail.backs.scale == 2) {
|
|
|
|
+ // this.bgPicList = res3.msg.filter((item, index) => {
|
|
|
|
+ // return item.scale == 2
|
|
|
|
+ // })
|
|
|
|
+ // this.currTabIndexBg = res3.msg.filter((item, index) => {
|
|
|
|
+ // return item.scale == 2
|
|
|
|
+ // }).findIndex((item, index) => {
|
|
|
|
+ // return item.id == this.selBgId + 1
|
|
|
|
+ // })
|
|
|
|
+ // } else {
|
|
|
|
+ // this.bgPicList = res3.msg.filter((item, index) => {
|
|
|
|
+ // return item.scale == 1
|
|
|
|
+ // })
|
|
|
|
+ // this.currTabIndexBg = res3.msg.filter((item, index) => {
|
|
|
|
+ // return item.scale == 1
|
|
|
|
+ // }).findIndex((item, index) => {
|
|
|
|
+ // return item.id == this.selBgId + 1
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
if (this.isCreate) {
|
|
if (this.isCreate) {
|
|
this.selBgPic = this.bgPicList[0].url
|
|
this.selBgPic = this.bgPicList[0].url
|
|
this.bgItem = this.bgPicList[0]
|
|
this.bgItem = this.bgPicList[0]
|
|
@@ -526,28 +646,135 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ onHide() {
|
|
|
|
+ // this.music.src = ''
|
|
|
|
+ // this.music = null
|
|
|
|
+ if (this.music) this.music.destroy()
|
|
|
|
+ },
|
|
|
|
+ beforeDestroy() {
|
|
|
|
+ console.log('beforeDestroy()');
|
|
|
|
+ if (this.music) this.music.destroy()
|
|
|
|
+ },
|
|
onShareAppMessage: function(res) {
|
|
onShareAppMessage: function(res) {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ uploadBg1() {
|
|
|
|
+ let that = this;
|
|
|
|
+ uni.chooseImage({
|
|
|
|
+ count: 1, //默认9
|
|
|
|
+ sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
|
+ sourceType: ['album', 'camera'], //从相册选择
|
|
|
|
+ success: function(res) {
|
|
|
|
+ const tempFilePaths = res.tempFilePaths;
|
|
|
|
+ //上传服务器将服务器;
|
|
|
|
+ uni.uploadFile({
|
|
|
|
+ url: uploadImgUrl.baseImgUrl,
|
|
|
|
+ filePath: tempFilePaths[0],
|
|
|
|
+ name: 'file',
|
|
|
|
+ formData: {
|
|
|
|
+ accept: 'image',
|
|
|
|
+ upload_type: 'ali-oss'
|
|
|
|
+ },
|
|
|
|
+ success: res2 => {
|
|
|
|
+ let a = JSON.parse(res2.data);
|
|
|
|
+ if (a.code == 0) {
|
|
|
|
+ that.testCusBgImg = a.data.path.trim()
|
|
|
|
+ console.log('上传图片返回值:', that.testCusBgImg);
|
|
|
|
+ // that.ifimg = true
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '上传图片失败',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ // that.ifimg = false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ uploadBg2() {
|
|
|
|
+ let that = this;
|
|
|
|
+ uni.chooseImage({
|
|
|
|
+ count: 1, //默认9
|
|
|
|
+ sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
|
+ sourceType: ['album', 'camera'], //从相册选择
|
|
|
|
+ success: function(res) {
|
|
|
|
+ const tempFilePaths = res.tempFilePaths;
|
|
|
|
+ //上传服务器将服务器;
|
|
|
|
+ uni.uploadFile({
|
|
|
|
+ url: uploadImgUrl.baseImgUrl,
|
|
|
|
+ filePath: tempFilePaths[0],
|
|
|
|
+ name: 'file',
|
|
|
|
+ formData: {
|
|
|
|
+ accept: 'image',
|
|
|
|
+ upload_type: 'ali-oss'
|
|
|
|
+ },
|
|
|
|
+ success: res2 => {
|
|
|
|
+ let a = JSON.parse(res2.data);
|
|
|
|
+ if (a.code == 0) {
|
|
|
|
+ that.testCusBgImg = a.data.path.trim()
|
|
|
|
+ console.log('上传图片返回值:', that.testCusBgImg);
|
|
|
|
+ // that.ifimg = true
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '上传图片失败',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ // that.ifimg = false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ playAudio(item) {
|
|
|
|
+ if (this.music) {
|
|
|
|
+ this.music.destroy()
|
|
|
|
+ }
|
|
|
|
+ this.music = uni.createInnerAudioContext(); //创建播放器对象
|
|
|
|
+ this.music.autoplay = true;
|
|
|
|
+ this.music.src =
|
|
|
|
+ "https://oaigc.oss-cn-chengdu.aliyuncs.com/20230804/90d3618dd8ae5a9ea50b932dba34f295.mp3"; //音频地址
|
|
|
|
+ // this.music.play();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
uploadVideo() {
|
|
uploadVideo() {
|
|
|
|
+ let _this = this
|
|
uni.chooseFile({
|
|
uni.chooseFile({
|
|
count: 1, //默认100
|
|
count: 1, //默认100
|
|
extension: ['.mp3'],
|
|
extension: ['.mp3'],
|
|
success: function(res) {
|
|
success: function(res) {
|
|
- console.log(JSON.stringify(res.tempFilePaths));
|
|
|
|
-
|
|
|
|
|
|
+ let tempFilePaths = res.tempFilePaths;
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: "上传中...",
|
|
|
|
+ });
|
|
|
|
|
|
uni.uploadFile({
|
|
uni.uploadFile({
|
|
- url: 'https://www.example.com/upload', //仅为示例,非真实的接口地址
|
|
|
|
|
|
+ url: uploadImgUrl.baseImgUrl,
|
|
filePath: tempFilePaths[0],
|
|
filePath: tempFilePaths[0],
|
|
|
|
+ // filePath: JSON.stringify(res.tempFilePaths),
|
|
name: 'file',
|
|
name: 'file',
|
|
|
|
+ fileType: "audio",
|
|
formData: {
|
|
formData: {
|
|
- 'user': 'test'
|
|
|
|
|
|
+ accept: 'audio',
|
|
|
|
+ upload_type: 'ali-oss'
|
|
},
|
|
},
|
|
success: (uploadFileRes) => {
|
|
success: (uploadFileRes) => {
|
|
- console.log(uploadFileRes.data);
|
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ const ret = JSON.parse(uploadFileRes.data);
|
|
|
|
+ if (ret.code == 0) {
|
|
|
|
+ _this.audioUrl = ret.data.path
|
|
|
|
+ console.log(ret);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -556,9 +783,16 @@
|
|
|
|
|
|
|
|
|
|
close() {
|
|
close() {
|
|
|
|
+
|
|
this.show = false
|
|
this.show = false
|
|
},
|
|
},
|
|
close1() {
|
|
close1() {
|
|
|
|
+ // this.music.src = ''; //音频地址
|
|
|
|
+ // this.music.stop(); //执行播放
|
|
|
|
+ if (this.music) {
|
|
|
|
+ this.music.destroy()
|
|
|
|
+ }
|
|
|
|
+
|
|
this.show1 = false
|
|
this.show1 = false
|
|
},
|
|
},
|
|
close3() {
|
|
close3() {
|
|
@@ -568,17 +802,50 @@
|
|
this.show4 = false
|
|
this.show4 = false
|
|
},
|
|
},
|
|
handleSelBg(item, index) {
|
|
handleSelBg(item, index) {
|
|
|
|
+
|
|
|
|
+ this.bgItem = item
|
|
|
|
+ this.newBgItem = item
|
|
|
|
+ console.log('111111111', item);
|
|
|
|
+
|
|
|
|
+ // return
|
|
|
|
+ this.selRoleItem = {}
|
|
|
|
+ this.currTabIndexModal = -1
|
|
|
|
+
|
|
|
|
+ if (item.scale == 1) {
|
|
|
|
+ this.roleList = this.roleList2.filter((item, index) => {
|
|
|
|
+ return item.proportion == '9:16'
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.roleList = this.roleList2.filter((item, index) => {
|
|
|
|
+ return item.proportion == '16:9'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
this.bgItem = item
|
|
this.bgItem = item
|
|
this.selBgPic = item.url
|
|
this.selBgPic = item.url
|
|
this.selBgId = item.id - 1
|
|
this.selBgId = item.id - 1
|
|
this.currTabIndexBg = index
|
|
this.currTabIndexBg = index
|
|
},
|
|
},
|
|
handleVoiceSel(item, index) {
|
|
handleVoiceSel(item, index) {
|
|
|
|
+ this.music.src = ''; //音频地址
|
|
|
|
+ this.music.stop(); //执行播放
|
|
|
|
+
|
|
|
|
+
|
|
this.selVoiceItem = item
|
|
this.selVoiceItem = item
|
|
this.selVoiceId = item.id - 1
|
|
this.selVoiceId = item.id - 1
|
|
this.currTabIndexAll = index
|
|
this.currTabIndexAll = index
|
|
},
|
|
},
|
|
handleRoleSel(item, index) {
|
|
handleRoleSel(item, index) {
|
|
|
|
+ if (this.bgItem.id != this.newBgItem.id) {
|
|
|
|
+ return uni.showToast({
|
|
|
|
+ title: '请先选择背景图,再选择角色',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
this.selRoleItem = item
|
|
this.selRoleItem = item
|
|
this.selRoleId = item.id - 1
|
|
this.selRoleId = item.id - 1
|
|
this.currTabIndexModal = index
|
|
this.currTabIndexModal = index
|
|
@@ -591,6 +858,7 @@
|
|
// back: this.selBgId,
|
|
// back: this.selBgId,
|
|
// audio: this.selVoiceId,
|
|
// audio: this.selVoiceId,
|
|
stage: this.roundRate,
|
|
stage: this.roundRate,
|
|
|
|
+ audio_url: this.audioUrl,
|
|
is_draft: 1
|
|
is_draft: 1
|
|
}
|
|
}
|
|
if (this.selRoleId != -1) {
|
|
if (this.selRoleId != -1) {
|
|
@@ -605,6 +873,7 @@
|
|
|
|
|
|
|
|
|
|
console.log('保存数字人草稿参数:', parmas);
|
|
console.log('保存数字人草稿参数:', parmas);
|
|
|
|
+ // return
|
|
let res = await generateWork(parmas)
|
|
let res = await generateWork(parmas)
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -633,13 +902,27 @@
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- let parmas = {
|
|
|
|
- name: this.robotName,
|
|
|
|
- content: this.textAreaValue,
|
|
|
|
- role: this.selRoleId,
|
|
|
|
- back: this.selBgId,
|
|
|
|
- audio: this.selVoiceId,
|
|
|
|
- stage: this.roundRate
|
|
|
|
|
|
+ let parmas = {}
|
|
|
|
+ if (this.audioUrl) {
|
|
|
|
+ parmas = {
|
|
|
|
+ name: this.robotName,
|
|
|
|
+ // content: this.textAreaValue,
|
|
|
|
+ role: this.selRoleId,
|
|
|
|
+ back: this.selBgId,
|
|
|
|
+ // audio: this.selVoiceId,
|
|
|
|
+ // stage: this.roundRate,
|
|
|
|
+ audio_url: this.audioUrl
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ parmas = {
|
|
|
|
+ name: this.robotName,
|
|
|
|
+ content: this.textAreaValue,
|
|
|
|
+ role: this.selRoleId,
|
|
|
|
+ back: this.selBgId,
|
|
|
|
+ audio: this.selVoiceId,
|
|
|
|
+ stage: this.roundRate,
|
|
|
|
+ audio_url: this.audioUrl
|
|
|
|
+ }
|
|
}
|
|
}
|
|
console.log('创建数字人参数:', parmas);
|
|
console.log('创建数字人参数:', parmas);
|
|
// return
|
|
// return
|
|
@@ -670,8 +953,17 @@
|
|
// this.show1 = false
|
|
// this.show1 = false
|
|
this.show2 = true
|
|
this.show2 = true
|
|
},
|
|
},
|
|
|
|
+ handleAudioClose() {
|
|
|
|
+ this.show1 = false
|
|
|
|
+ if (this.music) {
|
|
|
|
+ this.music.destroy()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
handleBtnConfirm1() {
|
|
handleBtnConfirm1() {
|
|
this.show1 = false
|
|
this.show1 = false
|
|
|
|
+ if (this.music) {
|
|
|
|
+ this.music.destroy()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
handleBtnConfirm2() {
|
|
handleBtnConfirm2() {
|
|
this.show3 = false
|
|
this.show3 = false
|
|
@@ -682,10 +974,23 @@
|
|
|
|
|
|
handleSetBox(item) {
|
|
handleSetBox(item) {
|
|
if (item.name == '全局语速') {
|
|
if (item.name == '全局语速') {
|
|
|
|
+ if (this.audioUrl) {
|
|
|
|
+ return uni.showToast({
|
|
|
|
+ title: '上传音频不支持全局语速',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
this.show = true
|
|
this.show = true
|
|
} else if (item.name == '声音') {
|
|
} else if (item.name == '声音') {
|
|
|
|
+ if (this.audioUrl) {
|
|
|
|
+ return uni.showToast({
|
|
|
|
+ title: '上传音频不支持声音选择',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
this.show1 = true
|
|
this.show1 = true
|
|
} else if (item.name == '角色') {
|
|
} else if (item.name == '角色') {
|
|
|
|
+
|
|
this.show3 = true
|
|
this.show3 = true
|
|
} else if (item.name == '背景') {
|
|
} else if (item.name == '背景') {
|
|
this.show4 = true
|
|
this.show4 = true
|