浏览代码

8.15自定义背景图

李万涛 1 年之前
父节点
当前提交
4edd64a5a7

+ 5 - 1
api/robot/index.js

xqd
@@ -30,4 +30,8 @@ export const draftList = (params, config = {}) => http.post('index.php/api.Digit
 export const register = (params, config = {}) => http.post('index.php/api.Digit/register', params, config)
 
 //登录
-export const login = (params, config = {}) => http.post('index.php/api.Digit/login', params, config)
+export const login = (params, config = {}) => http.post('index.php/api.Digit/login', params, config)
+
+
+//获取数字人合成背景
+export const getBg = (params, config = {}) => http.post('index.php/api.Digit/getBackImageByRole', params, config)

+ 54 - 0
components/empty/empty.vue

xqd
@@ -0,0 +1,54 @@
+<template>
+	<!-- <view class="box" :style="{'background':bcolor,'paddingTop':pt}"> -->
+	<view class="box" :style="{'background':bcolor}">
+		<image src="../../static/empty.png" mode=""></image>
+		<view class="" style="font-size: 26rpx;color:#aaa">
+			{{tipTxt}}~
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "empty",
+		data() {
+			return {
+
+			};
+		},
+		props: {
+			bcolor: {
+				type: String,
+				default: ''
+			},
+			pt: {
+				type: String,
+				default: '50%'
+			},
+			tipTxt: {
+				type: String,
+				default: '暂无数据'
+			}
+		},
+
+		onLoad() {
+			console.log(this.bcolor, '132423325');
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	image {
+		width: 200rpx;
+		height: 200rpx;
+	}
+
+	.box {
+		display: flex;
+		justify-content: center;
+		flex-direction: column;
+		align-items: center;
+		// background: red;
+		height: 300rpx;
+	}
+</style>

+ 1 - 1
pages.json

xqd
@@ -10,7 +10,7 @@
 			"path": "pages/robot/index",
 			"aliasPath": "/",
 			"style": {
-				"navigationBarTitleText": "数字人",
+				"navigationBarTitleText": "凡云AI人工智能内容生成软件",
 				"navigationBarBackgroundColor": "#F5FFFD",
 				// #ifdef H5
 				"navigationStyle": "custom",

+ 112 - 0
pages/painting/painting.scss

xqd
@@ -0,0 +1,112 @@
+.subsection {
+		margin: 0rpx 25rpx 0;
+		position: fixed;
+		width: 93.8%;
+		top: 30rpx;
+		// top: 30rpx;
+		z-index: 9999;
+	}
+
+	/* 瀑布流*/
+	.product__item {
+		background-color: #FFFFFF;
+		overflow: hidden;
+		margin: 0 10rpx;
+		margin-bottom: 20rpx;
+		// box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
+
+		.item {
+
+			/* 图片 start */
+			&__image {
+				width: 100%;
+				height: auto;
+				background-color: #FFFFFF;
+				border: 1rpx solid #F8F7F8;
+				// border-radius: 20rpx;
+				overflow: hidden;
+			}
+
+			/* 图片 end */
+
+			/* 内容 start */
+			&__data {
+				padding: 14rpx 0rpx;
+			}
+
+			/* 标题 start */
+			&__title-container {
+				text-align: justify;
+				line-height: 38rpx;
+				vertical-align: middle;
+			}
+
+			&__store-type {
+				height: 28rpx;
+				font-size: 20rpx;
+				position: relative;
+				display: inline-flex;
+				align-items: center;
+				justify-content: center;
+				padding: 4rpx;
+				border-radius: 6rpx;
+				white-space: nowrap;
+				text-align: center;
+				top: -2rpx;
+				margin-right: 6rpx;
+			}
+
+			&__title {
+				font-size: 30rpx;
+			}
+
+			/* 标题 end */
+
+			/* 标签 start */
+			&__tags-container {
+				display: flex;
+				flex-direction: row;
+				flex-wrap: nowrap;
+				align-items: center;
+				justify-content: flex-start;
+			}
+
+			&__tag {
+				margin: 10rpx;
+				color: #7C8191;
+				background-color: #F3F2F7;
+				padding: 4rpx 14rpx 6rpx;
+				border-radius: 10rpx;
+				font-size: 20rpx;
+
+				&:first-child {
+					margin-left: 0rpx !important;
+				}
+			}
+
+			/* 标签 end */
+			/* 内容 end */
+		}
+	}
+
+	.suspension {
+		background: linear-gradient(to right, #00ca88, #00BCD4);
+		color: #fff;
+		width: 132rpx;
+		height: 130rpx;
+		border-radius: 50%;
+		position: fixed;
+		right: 30rpx;
+		bottom: 220rpx;
+		font-weight: bold;
+		font-size: 30rpx;
+
+	}
+
+	.wike_ad {
+		margin: 0 6px 11px;
+	}
+
+	.db {
+		height: 83px;
+	}

+ 56 - 156
pages/painting/painting.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -9,45 +9,52 @@
 		<z-paging ref="paging" refresher-complete-delay="200" v-model="drawList" @query="queryList">
 			<!-- <view slot="top" class="z_tabs" :style="{ marginTop: 66 + 'px' ,background: 'none'}"></view> -->
 			<view class="subsection">
-				<tn-subsection :list="subsectionlist" mode="button" :borderRadius="50"
-					animationType="cubic-bezier" bold :height="90" @change="getsubsection"></tn-subsection>
+				<tn-subsection :list="subsectionlist" mode="button" :borderRadius="50" animationType="cubic-bezier" bold
+					:height="90" @change="getsubsection"></tn-subsection>
 			</view>
-			
-		<view style="padding: 150rpx 15rpx 30rpx 15rpx;">
-			<view v-if="homeTemplate&&homeTemplate.banner&&homeTemplate.banner.length>0" class="wike_ad">
-				<wike-ad></wike-ad>
-			</view>
-			
-			<tn-waterfall v-if="drawList.length>0" ref="waterfall" v-model="drawList" @finish="handleWaterFallFinish">
-				<template v-slot:left="{ leftList }">
-					<view v-for="(item, index) in leftList" :key="item.id" class="product__item" @click="tnproduct(item.id)">
-						<view class="item__image">
-							<tn-lazy-load :threshold="6000" height="100%" :image="item.imgs_file[0]?item.imgs_file[0]:item.origin_url" :index="item.id"
-								imgMode="widthFix"></tn-lazy-load>
+
+			<view style="padding: 150rpx 15rpx 30rpx 15rpx;">
+				<view v-if="homeTemplate&&homeTemplate.banner&&homeTemplate.banner.length>0" class="wike_ad">
+					<wike-ad></wike-ad>
+				</view>
+
+				<tn-waterfall v-if="drawList.length>0" ref="waterfall" v-model="drawList"
+					@finish="handleWaterFallFinish">
+					<template v-slot:left="{ leftList }">
+						<view v-for="(item, index) in leftList" :key="item.id" class="product__item"
+							@click="tnproduct(item.id)">
+							<view class="item__image">
+								<tn-lazy-load :threshold="6000" height="100%"
+									:image="item.imgs_file[0]?item.imgs_file[0]:item.origin_url" :index="item.id"
+									imgMode="widthFix"></tn-lazy-load>
+							</view>
 						</view>
-					</view>
-				</template>
-				<template v-slot:right="{ rightList }">
-					<view v-for="(item, index) in rightList" :key="item.id" class="product__item" @click="tnproduct(item.id)">
-						<view class="item__image">
-							<tn-lazy-load :threshold="6000" height="100%" :image="item.imgs_file[0]?item.imgs_file[0]:item.origin_url" :index="item.id"
-								imgMode="widthFix"></tn-lazy-load>
+					</template>
+					<template v-slot:right="{ rightList }">
+						<view v-for="(item, index) in rightList" :key="item.id" class="product__item"
+							@click="tnproduct(item.id)">
+							<view class="item__image">
+								<tn-lazy-load :threshold="6000" height="100%"
+									:image="item.imgs_file[0]?item.imgs_file[0]:item.origin_url" :index="item.id"
+									imgMode="widthFix"></tn-lazy-load>
+							</view>
 						</view>
-					</view>
-				</template>
-			</tn-waterfall>
-			<!-- <wike-waterfall :dataList="data" :column="columns" @click="click" :radius="20" :margin="10"></wike-waterfall> -->
-		</view>
-		<view slot="bottom" class="z_tabs" :style="{ marginBottom: 72 + 'px' }"></view>
+					</template>
+				</tn-waterfall>
+				<!-- <wike-waterfall :dataList="data" :column="columns" @click="click" :radius="20" :margin="10"></wike-waterfall> -->
+			</view>
+			<view slot="bottom" class="z_tabs" :style="{ marginBottom: 72 + 'px' }"></view>
 		</z-paging>
-		
+
 		<view @click="getcreate" class="suspension u-flex align-center justify-center">
 			AI创作
 		</view>
 
-		
-		<wike-tabbar2 v-if="appInfo.page_template == 3" :is_aipainting="appInfo.is_aipainting" :onTabbar="true" :isShowAnimate="true" :appInfos="appInfo.page_template"></wike-tabbar2>
-		<wike-tabbar v-else :onTabbar="true" :is_aipainting="appInfo.is_aipainting" :isShowAnimate="true" :appInfos="appInfo.page_template"></wike-tabbar>
+
+		<wike-tabbar2 v-if="appInfo.page_template == 3" :is_aipainting="appInfo.is_aipainting" :onTabbar="true"
+			:isShowAnimate="true" :appInfos="appInfo.page_template"></wike-tabbar2>
+		<wike-tabbar v-else :onTabbar="true" :is_aipainting="appInfo.is_aipainting" :isShowAnimate="true"
+			:appInfos="appInfo.page_template"></wike-tabbar>
 	</view>
 </template>
 
@@ -70,16 +77,16 @@
 			return {
 				list: [],
 				drawList: [],
-				subsectionlist:['StableDiffusion绘图','MidJourney绘图'],
-				engine:'sd',
-				showskeleton:true
-				
+				subsectionlist: ['StableDiffusion绘图', 'MidJourney绘图'],
+				engine: 'sd',
+				showskeleton: true
+
 			};
 		},
 		computed: {
-			...mapGetters(['appInfo', 'userInfo','homeTemplate'])
+			...mapGetters(['appInfo', 'userInfo', 'homeTemplate'])
 		},
-		
+
 		onLoad() {
 			// this.getRandomData()
 		},
@@ -87,7 +94,7 @@
 			// 网络变化检测
 			uni.onNetworkStatusChange(res => {
 				this.isConnected = res.isConnected;
-				
+
 			});
 		},
 		onReady() {
@@ -133,7 +140,7 @@
 							title: this.appInfo.site_name
 						});
 						this.showskeleton = false
-						if(pageNo == 1){
+						if (pageNo == 1) {
 							this.drawList = []
 						}
 						this.$refs.paging.complete(res.data.data);
@@ -141,15 +148,15 @@
 					}
 				});
 			},
-			getsubsection(e){
+			getsubsection(e) {
 				// console.log(e);
-				this.engine = e.index == 1?'mj':'sd'
+				this.engine = e.index == 1 ? 'mj' : 'sd'
 				this.drawList = []
 				this.$refs.paging.reload(true);
 			},
-			getcreate(){
+			getcreate() {
 				uni.navigateTo({
-					url:'/pages/painting/draw'
+					url: '/pages/painting/draw'
 				})
 			},
 			/* 瀑布流*/
@@ -159,7 +166,7 @@
 				// this.loadStatus = 'loading'
 				for (let i = 0; i < 10; i++) {
 					let index = this.$t.number.randomInt(0, this.data.length - 1)
-					
+
 					let item = JSON.parse(JSON.stringify(this.data[index]))
 					item.id = this.$t.uuid()
 					this.list.push(item)
@@ -170,123 +177,16 @@
 			handleWaterFallFinish() {
 				// this.loadStatus = 'loadmore'
 			},
-			tnproduct(id){
-				
+			tnproduct(id) {
+
 				uni.navigateTo({
-					url:'/pages/painting/details?urls='+id
+					url: '/pages/painting/details?urls=' + id
 				})
 			}
 		}
 	};
 </script>
 
-<style lang="scss">
-	.subsection{
-		margin: 0rpx 25rpx 0;
-		position: fixed;
-		width: 93.8%;
-		top: 30rpx;
-		// top: 30rpx;
-		z-index: 9999;
-	}
-	/* 瀑布流*/
-	.product__item {
-		background-color: #FFFFFF;
-		overflow: hidden;
-		margin: 0 10rpx;
-		margin-bottom: 20rpx;
-		// box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
-
-		.item {
-
-			/* 图片 start */
-			&__image {
-				width: 100%;
-				height: auto;
-				background-color: #FFFFFF;
-				border: 1rpx solid #F8F7F8;
-				// border-radius: 20rpx;
-				overflow: hidden;
-			}
-
-			/* 图片 end */
-
-			/* 内容 start */
-			&__data {
-				padding: 14rpx 0rpx;
-			}
-
-			/* 标题 start */
-			&__title-container {
-				text-align: justify;
-				line-height: 38rpx;
-				vertical-align: middle;
-			}
-
-			&__store-type {
-				height: 28rpx;
-				font-size: 20rpx;
-				position: relative;
-				display: inline-flex;
-				align-items: center;
-				justify-content: center;
-				padding: 4rpx;
-				border-radius: 6rpx;
-				white-space: nowrap;
-				text-align: center;
-				top: -2rpx;
-				margin-right: 6rpx;
-			}
-
-			&__title {
-				font-size: 30rpx;
-			}
-
-			/* 标题 end */
-
-			/* 标签 start */
-			&__tags-container {
-				display: flex;
-				flex-direction: row;
-				flex-wrap: nowrap;
-				align-items: center;
-				justify-content: flex-start;
-			}
-
-			&__tag {
-				margin: 10rpx;
-				color: #7C8191;
-				background-color: #F3F2F7;
-				padding: 4rpx 14rpx 6rpx;
-				border-radius: 10rpx;
-				font-size: 20rpx;
-
-				&:first-child {
-					margin-left: 0rpx !important;
-				}
-			}
-
-			/* 标签 end */
-			/* 内容 end */
-		}
-	}
-	.suspension{
-		background: linear-gradient(to right, #00ca88, #00BCD4);
-		color: #fff;
-		width: 132rpx;
-		height: 130rpx;
-		border-radius: 50%;
-		position: fixed;
-		right: 30rpx;
-		bottom: 220rpx;
-		font-weight: bold;
-		font-size: 30rpx;
-		
-	}
-	.wike_ad{
-		margin: 0 6px 11px;
-	}
-	.db{
-		height: 83px;
-	}
+<style lang="scss" scoped>
+	@import './painting.scss';
 </style>

+ 18 - 2
pages/robot/generate/index.scss

xqd xqd xqd
@@ -33,7 +33,7 @@ page {
 								}
 								.role{
 									position: absolute;
-									z-index: 9;
+									z-index: 2;
 									height: 100%;
 									width:100%;
 									margin-left: 50%;
@@ -741,6 +741,22 @@ page {
 			display: flex;
 			flex-direction: column;
 			align-items: center;
+			.referImg{
+				display: flex;
+				// flex-direction: column;
+				align-items: center;
+				justify-content: center;
+				width: 100%;
+				height: 50%;
+				// .ig1{
+					
+				// }
+				// .ig2{
+				// 	width: 100rpx;
+				// }
+			}
+			
+			
 			.des{
 				line-height: 40rpx;
 				.lab{
@@ -754,7 +770,7 @@ page {
 				justify-content: center;
 				align-items: center;
 				width: 80%;
-				height:80rpx;
+				height:100rpx;
 				background: #06C68E;
 				color: white;
 				border-radius: 15rpx;

+ 188 - 73
pages/robot/generate/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -14,7 +14,7 @@
 					</view>
 					<view class="videoBox2" v-if="bgItem.scale==2&&selBgPic" :style="{}">
 						<image class="img16" :src="selBgPic" mode=""></image>
-						<view class="role">
+						<view class="role" style="z-index: 2;">
 							<image :src="selRoleItem.url" mode=""></image>
 						</view>
 					</view>
@@ -153,7 +153,7 @@
 
 							</view>
 
-							<view class="playBox" style="" @click="playAudio(item)">
+							<view class="playBox" style="" @click="playAudio(item.audio_url)">
 								试听
 							</view>
 						</view>
@@ -207,16 +207,16 @@
 					</view>
 				</view>
 				<view class="content">
-					<!-- 	<view class="filterBox">
+					<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">
+								@click="handleBgTabChange(item,index)">
 								{{item}}
 							</view>
 						</view>
-					</view> -->
-					<!-- 		<view class="filterBox">
+					</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':'']"
@@ -244,9 +244,16 @@
 									<view class="des">
 										<text class="lab">尺寸:9:16</text><br>
 										背景图要求:<br>
-										像素:1080P<br>
-										文件大小:1M以内
+										像素:最高3800 × 3800px<br>
+										文件大小:5M以内
 									</view>
+									<!-- 	<view class="" style="color: #06C68E;">
+										参考图
+									</view>
+									<view class="referImg" @click="previewImg(refImg1)">
+										<image class="ig1" :src="refImg1" mode="scaleToFill"
+											style="width: 40%;height: 250rpx;"></image>
+									</view> -->
 									<view class="btn" @click="uploadBg1">
 										上传背景图(9:16)
 									</view>
@@ -255,9 +262,16 @@
 									<view class="des">
 										<text class="lab">尺寸:16:9</text><br>
 										背景图要求:<br>
-										像素:1080P<br>
-										文件大小:1M以内
+										像素:最高3800 × 3800px<br>
+										文件大小:5M以内
+									</view>
+									<!-- <view class="" style="color: #06C68E;">
+										参考图
 									</view>
+									<view class="referImg" @click="previewImg(refImg2)">
+										<image class="ig2" style="width: 70%;height: 130rpx;" :src="refImg2"
+											mode="scaleToFill"></image>
+									</view> -->
 									<view class="btn" @click="uploadBg2">
 										上传背景图(16:9)
 									</view>
@@ -361,10 +375,10 @@
 			</view>
 		</u-popup>
 
-		<!-- <audio :src="tempAudioUrl" autoplay ref="audioRef" style=""></audio> -->
-
-		<!-- <wike-tabbar :onTabbar="true" :isShowAnimate="true"></wike-tabbar> -->
+		<!-- <view class="" style="height: 500rpx;width:300rpx !important;" :style='genResBgImg'>
+		</view> -->
 	</view>
+
 	</view>
 </template>
 
@@ -373,7 +387,9 @@
 		generateWork,
 		roleList,
 		voiceList,
-		backList
+		backList,
+		getBg
+
 	} from '@/api/robot/index.js'
 	import indexVue from './index.vue';
 
@@ -383,6 +399,10 @@
 	export default {
 		data() {
 			return {
+				refImg1: '',
+				refImg2: '',
+
+
 				testCusBgImg: '',
 				// tempAudioUrl: 'https://oaigc.oss-cn-chengdu.aliyuncs.com/20230804/90d3618dd8ae5a9ea50b932dba34f295.mp3',
 
@@ -508,7 +528,14 @@
 				newBgItem: {
 					id: -1
 				},
-				music: null
+				music: null,
+
+				genResBgImg: "",
+
+				// hasFirstSeledRole: false,
+				isFirstSelRole: true,
+
+				testCusBgScale: 1
 			};
 		},
 		computed: {
@@ -522,8 +549,6 @@
 
 		},
 		onLoad(o) {
-
-
 			if (o.type == 'create') {
 				this.isCreate = true
 				this.selRoleId = 5
@@ -543,10 +568,10 @@
 			this.robotName = getApp().draftDetail.name
 			this.textAreaValue = getApp().draftDetail.content
 			this.selRoleId = getApp().draftDetail.role - 1
-			this.selBgId = getApp().draftDetail.back - 1
 			this.selVoiceId = getApp().draftDetail.audio - 1
 			this.voiceRate = getApp().draftDetail.stage
 
+			this.selBgId = getApp().draftDetail.back - 1
 			this.selBgPic = getApp().draftDetail.backs.url
 			this.bgItem = getApp().draftDetail.backs
 
@@ -555,27 +580,43 @@
 			this.selRoleItem = getApp().draftDetail.roles
 
 
-			this.audioUrl = getApp().draftDetail.audio_url
+			this.audioUrl = getApp().draftDetail.audio_url || ''
+			if (getApp().draftDetail.back_url) {
+				this.testCusBgImg = getApp().draftDetail.back_url
+				this.selBgPic = getApp().draftDetail.back_url
+				this.bgItem.scale = getApp().draftDetail.scale
+			}
 			console.log('传过来的草稿项:', this.detail);
 		},
 		async onShow() {
-
-
 			let res = await roleList({})
 			if (res.code == 0) {
-
-				this.roleList = res.msg
-
+				// this.roleList = res.msg
 				this.roleList2 = res.msg
 				console.log('数字人角色列表返回值:', res);
 
-
-				this.currTabIndexModal = res.msg.findIndex((item, index) => {
-					return item.id == this.selRoleId + 1
-				})
-
 				if (this.isCreate) {
-					this.selRoleItem = this.roleList[5]
+					this.roleList = this.roleList2.filter((item, index) => {
+						return item.proportion == '9:16'
+					})
+					this.selRoleItem = this.roleList2[5]
+					this.currTabIndexModal = 3
+				} else {
+					if (this.detail.backs.scale == 1) {
+						this.roleList = this.roleList2.filter((item, index) => {
+							return item.proportion == '9:16'
+						})
+						this.currTabIndexModal = this.roleList.findIndex((item, index) => {
+							return item.id == this.selRoleId + 1
+						})
+					} else {
+						this.roleList = this.roleList2.filter((item, index) => {
+							return item.proportion == '16:9'
+						})
+						this.currTabIndexModal = this.roleList.findIndex((item, index) => {
+							return item.id == this.selRoleId + 1
+						})
+					}
 				}
 			} else {
 				uni.showToast({
@@ -607,33 +648,15 @@
 			if (res3.code == 0) {
 				this.bgPicList = res3.msg
 				this.bgPicList2 = res3.msg
-				console.log('数字人背景列表返回值:', res3);
-
-				this.currTabIndexBg = res3.msg.findIndex((item, index) => {
-					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
-				// 	})
-				// }
-
-
 
+				this.refImg1 = res3.msg[0].url
+				this.refImg2 = res3.msg[3].url
+				console.log('数字人背景列表返回值:', res3);
+				if (!this.testCusBgImg) {
+					this.currTabIndexBg = res3.msg.findIndex((item, index) => {
+						return item.id == this.selBgId + 1
+					})
+				}
 				if (this.isCreate) {
 					this.selBgPic = this.bgPicList[0].url
 					this.bgItem = this.bgPicList[0]
@@ -660,6 +683,18 @@
 		},
 
 		methods: {
+			previewImg(url) {
+				uni.previewImage({
+					urls: [url],
+					// current:[0]
+				});
+			},
+
+			handleBgTabChange(item, index) {
+				this.currTabIndex2 = index
+				console.log('12122', index);
+				if (index == 1) {} else {}
+			},
 			uploadBg1() {
 				let that = this;
 				uni.chooseImage({
@@ -681,7 +716,24 @@
 								let a = JSON.parse(res2.data);
 								if (a.code == 0) {
 									that.testCusBgImg = a.data.path.trim()
-									console.log('上传图片返回值:', that.testCusBgImg);
+									console.log('上传图片返回值----1:', that.testCusBgImg);
+
+									that.selRoleItem = {}
+									that.currTabIndexModal = -1
+									that.roleList = that.roleList2.filter((item, index) => {
+										return item.proportion == '9:16'
+
+									})
+									that.bgItem = {
+										id: 9999,
+										scale: 1,
+										url: a.data.path.trim()
+									}
+									that.selBgPic = a.data.path.trim()
+
+									that.currTabIndexBg = -1
+
+									that.testCusBgScale = 1
 									// that.ifimg = true
 								} else {
 									uni.showToast({
@@ -716,8 +768,22 @@
 								let a = JSON.parse(res2.data);
 								if (a.code == 0) {
 									that.testCusBgImg = a.data.path.trim()
-									console.log('上传图片返回值:', that.testCusBgImg);
-									// that.ifimg = true
+									console.log('上传图片返回值---2:', that.testCusBgImg);
+
+									that.selRoleItem = {}
+									that.currTabIndexModal = -1
+									that.roleList = that.roleList2.filter((item, index) => {
+										return item.proportion == '16:9'
+									})
+									that.bgItem = {
+										id: 9999,
+										scale: 2,
+										url: a.data.path.trim()
+									}
+									that.selBgPic = a.data.path.trim()
+									that.currTabIndexBg = -1
+
+									that.testCusBgScale = 2
 								} else {
 									uni.showToast({
 										title: '上传图片失败',
@@ -741,7 +807,7 @@
 				this.music = uni.createInnerAudioContext(); //创建播放器对象
 				this.music.autoplay = true;
 				this.music.src =
-					"https://oaigc.oss-cn-chengdu.aliyuncs.com/20230804/90d3618dd8ae5a9ea50b932dba34f295.mp3"; //音频地址
+					item; //音频地址
 				// this.music.play();
 			},
 
@@ -802,6 +868,10 @@
 				this.show4 = false
 			},
 			handleSelBg(item, index) {
+				this.isFirstSelRole = false
+				if (this.testCusBgImg) {
+					this.testCusBgImg = ''
+				}
 
 				this.bgItem = item
 				this.newBgItem = item
@@ -838,17 +908,32 @@
 				this.selVoiceId = item.id - 1
 				this.currTabIndexAll = index
 			},
-			handleRoleSel(item, index) {
-				if (this.bgItem.id != this.newBgItem.id) {
-					return uni.showToast({
-						title: '请先选择背景图,再选择角色',
-						icon: 'none'
-					})
+			async handleRoleSel(item, index) {
+				if (this.isFirstSelRole) {
+					this.selRoleItem = item
+					this.selRoleId = item.id - 1
+					this.currTabIndexModal = index
+
+					console.log('获取合成背景参数:', {
+						roleId: item.id,
+						backId: this.bgItem.id
+					});
+				} else {
+					if (this.bgItem.id != this.newBgItem.id) {
+						return uni.showToast({
+							title: '请先选择背景图,再选择角色',
+							icon: 'none'
+						})
+					}
+					this.selRoleItem = item
+					this.selRoleId = item.id - 1
+					this.currTabIndexModal = index
+
+					console.log('获取合成背景参数:', {
+						roleId: item.id,
+						backId: this.bgItem.id
+					});
 				}
-
-				this.selRoleItem = item
-				this.selRoleId = item.id - 1
-				this.currTabIndexModal = index
 			},
 			async saveDraft() {
 				let parmas = {
@@ -865,13 +950,19 @@
 					parmas['role'] = this.selRoleId
 				}
 				if (this.selBgId != -1) {
-					parmas['back'] = this.selBgId
+					if (this.testCusBgImg) {
+						parmas['back_url'] = this.testCusBgImg
+						parmas['scale'] = this.testCusBgScale
+					} else {
+						parmas['back'] = this.selBgId
+					}
 				}
 				if (this.selVoiceId != -1) {
 					parmas['audio'] = this.selVoiceId
 				}
 
 
+
 				console.log('保存数字人草稿参数:', parmas);
 				// return
 				let res = await generateWork(parmas)
@@ -903,7 +994,7 @@
 
 
 				let parmas = {}
-				if (this.audioUrl) {
+				if (this.audioUrl && !this.testCusBgImg) {
 					parmas = {
 						name: this.robotName,
 						// content: this.textAreaValue,
@@ -913,6 +1004,28 @@
 						// stage: this.roundRate,
 						audio_url: this.audioUrl
 					}
+				} else if (this.audioUrl && this.testCusBgImg) {
+					parmas = {
+						name: this.robotName,
+						// content: this.textAreaValue,
+						role: this.selRoleId,
+						back: this.selBgId,
+						// audio: this.selVoiceId,
+						// stage: this.roundRate,
+						audio_url: this.audioUrl,
+						back_url: this.testCusBgImg
+					}
+				} else if (!this.audioUrl && this.testCusBgImg) {
+					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,
@@ -921,7 +1034,7 @@
 						back: this.selBgId,
 						audio: this.selVoiceId,
 						stage: this.roundRate,
-						audio_url: this.audioUrl
+						// audio_url: this.audioUrl
 					}
 				}
 				console.log('创建数字人参数:', parmas);
@@ -988,6 +1101,8 @@
 							icon: 'none'
 						})
 					}
+					this.music = uni.createInnerAudioContext(); //创建播放器对象
+					this.music.autoplay = true;
 					this.show1 = true
 				} else if (item.name == '角色') {
 

+ 7 - 5
pages/robot/index.vue

xqd xqd xqd
@@ -16,11 +16,12 @@
 					</view>
 				</view>
 			</view>
-			<view class="draft" v-if="draftList.length!=0">
+			<view class="draft">
 				<view class="draftLabel">
 					草稿
 				</view>
-				<view class="draftList">
+				<empty v-if="draftList.length==0" tipTxt="暂无草稿"></empty>
+				<view class="draftList" v-else>
 					<view class="itemBox" v-for="(item,index) in draftList" @click="toCreateDetail(item)">
 						<view class="top"
 							style="display: flex;justify-content: center;align-items: center;aspect-ratio: 4/3;">
@@ -39,11 +40,13 @@
 				</view>
 			</view>
 
+
 			<view class="draft">
 				<view class="draftLabel">
 					数字人作品
 				</view>
-				<view class="draftList">
+				<empty v-if="workList.length==0" tipTxt="暂无作品"></empty>
+				<view class="draftList" v-else>
 					<view class="itemBox" v-for="(item,index) in workList" @click="goWorkDetail(item)">
 						<view class="top" :style="{minHeight:isPc?'rpx':'470rpx'}">
 							<image :src="item.cover" mode="aspectFit" v-if="item.state">
@@ -102,14 +105,13 @@
 			<u-picker :defaultIndex='[0]' :closeOnClickOverlay="true" :showIcon="true" :show="showMoreMenu"
 				:columns="columns" title="更多" confirmColor="" @cancel="showMoreMenu=false" @confirm="handleConfirm"
 				@close="handleClosePicker"></u-picker>
-
-
 			<wike-tabbar :onTabbar="true" :isShowAnimate="true"></wike-tabbar>
 		</view>
 	</view>
 </template>
 
 <script>
+	import empty from '@/components/empty/empty.vue'
 	import {
 		workList,
 		delWork,

+ 1 - 1
pages/user/signin.vue

xqd
@@ -109,7 +109,7 @@
 				showlogon: true,
 				route: '',
 				appInfo1: {
-					site_name: '数字人系统'
+					site_name: '凡云AI人工智能内容生成软件'
 				}
 
 				// register:0

二进制
static/empty.png


+ 2 - 2
tuniao-ui/components/tn-nav-bar/tn-nav-bar.vue

xqd xqd
@@ -1,5 +1,5 @@
 <template>
-	<view class="tn-custom-nav-bar-class tn-custom-nav-bar" :style="[navBarStyle]">
+	<view class="tn-custom-nav-bar-class tn-custom-nav-bar" :style="[navBarStyle]" style="z-index: 9;">
 		<view class="tn-custom-nav-bar__bar" :class="[barClass]" :style="[barStyle]">
 			<view v-if="isBack">
 				<view v-if="customBack">
@@ -95,7 +95,7 @@
 				if (this.fixed) {
 					style.position = 'fixed'
 				}
-				style.zIndex = this.elZIndex
+				// style.zIndex = this.elZIndex
 
 				return style
 			},