李万涛 1 год назад
Родитель
Сommit
a6ed7e143f

+ 26 - 26
pages/digitalMen/generate/index.scss

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -78,7 +78,7 @@ page {
 				display: flex;
 				justify-content: space-between;
 				height: 96rpx;
-				background: linear-gradient(to right,#06C68E,#02BCCD);
+				background: linear-gradient(to right,#549DFF,#207CF7);
 				margin-top: 30rpx;
 				padding-left: 40rpx;
 				padding-right: 40rpx;
@@ -113,7 +113,7 @@ page {
 			width: 100%;
 			border-top: 1px solid #ccc;
 				.btn{
-					background: #26b3a0;
+					background: #207CF7;
 					color: #fff;
 					width: 45%;
 					height: 94rpx;
@@ -125,8 +125,8 @@ page {
 				}
 				.draft{
 					background: #fff;
-					border:2rpx solid  #26b3a0;
-					color: #26b3a0;
+					border:2rpx solid  #207CF7;
+					color: #207CF7;
 				}
 			}
 		}
@@ -245,7 +245,7 @@ page {
 						background:#ccc ;
 					}
 					.tabActive{
-						background:#26b3a0 ;
+						background:#207CF7;
 						color: white;
 					}
 
@@ -271,7 +271,7 @@ page {
 					display: flex;
 					flex-wrap: wrap;
 					.sel{
-						border:6rpx solid #26b3a0;
+						border:6rpx solid #207CF7;
 						padding: 5rpx;
 					}
 					image{
@@ -314,14 +314,14 @@ page {
 						}
 				}
 				.sel{
-					border:6rpx solid #26b3a0;
+					border:6rpx solid #207CF7;
 					padding: 5rpx;
 				}
 			}
 			
 			
 			.scenList{
-				// background: #26b3a0;
+				// background: #207CF7;
 				display: flex;
 				flex-wrap: wrap;
 				padding:0 40rpx;
@@ -335,7 +335,7 @@ page {
 				}
 			}
 			.sexList{
-				// background: #26b3a0;
+				// background: #207CF7;
 				display: flex;
 				flex-wrap: wrap;
 				padding:0 40rpx;
@@ -362,13 +362,13 @@ page {
 				}
 			}
 			.active{
-				background: #26b3a0!important;
+				background: #207CF7!important;
 				color:white;
 			}
 			
 			.filterBtn2{
 				color: white;
-				background: #26b3a0;
+				background: #207CF7;
 				height: 94rpx;
 				display: flex;
 				justify-content: center;
@@ -493,7 +493,7 @@ page {
 						background:#ccc ;
 					}
 					.tabActive{
-						background:#26b3a0 ;
+						background:#207CF7 ;
 						color: white;
 					}
 	
@@ -519,7 +519,7 @@ page {
 					display: flex;
 					flex-wrap: wrap;
 					.sel{
-						border:6rpx solid #26b3a0;
+						border:6rpx solid #207CF7;
 						padding: 5rpx;
 					}
 					image{
@@ -575,14 +575,14 @@ page {
 					}
 				}
 				.sel{
-					border:6rpx solid #26b3a0;
+					border:6rpx solid #207CF7;
 					padding: 5rpx;
 				}
 			}
 			
 			
 			.scenList{
-				// background: #26b3a0;
+				// background: #207CF7;
 				display: flex;
 				flex-wrap: wrap;
 				padding:0 40rpx;
@@ -596,7 +596,7 @@ page {
 				}
 			}
 			.sexList{
-				// background: #26b3a0;
+				// background: #207CF7;
 				display: flex;
 				flex-wrap: wrap;
 				padding:0 40rpx;
@@ -623,13 +623,13 @@ page {
 				}
 			}
 			.active{
-				background: #26b3a0!important;
+				background: #207CF7!important;
 				color:white;
 			}
 			
 			.filterBtn2{
 				color: white;
-				background: #26b3a0;
+				background: #207CF7;
 				height: 94rpx;
 				display: flex;
 				justify-content: center;
@@ -662,7 +662,7 @@ page {
 	}
 	
 	::v-deep .is-focused{
-		border-color: #26b3a0!important;
+		border-color: #207CF7!important;
 	}
 	
 	.selCon{
@@ -708,7 +708,7 @@ page {
 	}
 	
 	.selTxt{
-		color:#26b3a0 !important;
+		color:#207CF7 !important;
 		font-weight: 600;
 	}
 	
@@ -772,7 +772,7 @@ page {
 				align-items: center;
 				width: 80%;
 				height:100rpx;
-				background: #06C68E;
+				background: #207CF7;
 				color: white;
 				border-radius: 15rpx;
 			}
@@ -799,10 +799,10 @@ page {
 			align-items: center;
 		}
 		.item1{
-			border: 1rpx solid #26b3a0;
+			border: 1rpx solid #207CF7;
 			border-radius: 10rpx;
-			color:#26b3a0;
-			background: #26b3a0;
+			color:#207CF7;
+			background: #207CF7;
 			color: white;
 		}
 		.item2{
@@ -819,14 +819,14 @@ page {
 		margin-top: 50rpx;
 		margin-bottom: 10rpx;
 		width: 70%;
-		border:1rpx solid #26b3a0;
+		border:1rpx solid #207CF7;
 		
 		height: 100rpx;
 		display: flex;
 		justify-content: center;
 		align-items: center;
 		border-radius: 15rpx;
-		color: #26b3a0;
+		color: #207CF7;
 		margin-left: 50%;
 		
 		transform: translateX(-50%);

+ 6 - 5
pages/digitalMen/generate/index.vue

xqd xqd xqd
@@ -99,7 +99,7 @@
 				<view class="btn draft" @click="saveDraft">
 					存草稿
 				</view>
-				<view class="btn" @click="genRobot" style="background: linear-gradient(to right,#06C68E,#02BCCD);">
+				<view class="btn" @click="genRobot" style="background: linear-gradient(to right,#549DFF,#207CF7);">
 					合成
 				</view>
 			</view>
@@ -123,7 +123,7 @@
 				</view>
 				<view class="content" style="min-height: 300rpx;">
 					<u-slider height="50" min="0.7" max="1.3" step="0.1" class="slider" :showValue='false'
-						@change="handleChange" activeColor="#26b3a0" v-model="voiceRate"></u-slider>
+						@change="handleChange" activeColor="#207CF7" v-model="voiceRate"></u-slider>
 					<view class="sliderValue">
 						{{roundRate}}X
 					</view>
@@ -967,9 +967,10 @@
 				this.currTabIndexBg = index
 			},
 			handleVoiceSel(item, index) {
-				this.music.src = ''; //音频地址
-				this.music.stop(); //执行播放  
-
+				if (this.music) {
+					this.music.src = ''; //音频地址
+					this.music.stop(); //执行播放  
+				}
 
 				this.selVoiceItem = item
 				this.selVoiceId = item.id - 1

+ 1285 - 0
pages/digitalMen/generate/index1.vue

xqd
@@ -0,0 +1,1285 @@
+<template>
+	<view class="container">
+		<tn-nav-bar :isBack="true" backgroundColor="#fff" :bottomShadow="false">数字人创建</tn-nav-bar>
+		<view class="pos">
+		</view>
+		<view class="context">
+			<view class="top" @click="">
+				<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="" @click.stop="show3=true"></image>
+						</view>
+					</view>
+					<view class="videoBox2" v-if="bgItem.scale==2&&selBgPic" :style="{}">
+						<image class="img16" :src="selBgPic" mode=""></image>
+						<view class="role" style="z-index: 2;">
+							<image :src="selRoleItem.url" mode="" @click.stop="show3=true"></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 class="videoBox" v-if="!bgItem.scale&&!selBgPic" :style="{minHeight:!selBgPic?'465rpx':''}">
+					<view class="emptyVideo" style="background: #ccc;height: 100%;"></view>
+				</view>
+			</view>
+			<view class="selCon">
+				<view class="item" @click="show=true" v-if="curBobaoIndex==0">
+					<view class="label">
+						语速:
+					</view>
+					<view class="con">
+						{{roundRate}}X
+					</view>
+				</view>
+				<view class="item" @click="show1=true" v-if="curBobaoIndex==0">
+					<view class="label">
+						声音:{{selVoiceItem.name}}
+					</view>
+					<image class="conImg" :src="selVoiceItem.url">
+					</image>
+				</view>
+				<view class="item" @click="show3=true">
+					<view class="label">
+						角色:{{selRoleItem.name}}
+					</view>
+					<image class="conImg" :src="selRoleItem.url">
+					</image>
+				</view>
+			</view>
+			<view class="centerMenuBar">
+				<view class="barItem" v-for="(item,index) in menuList" @click="handleSetBox(item)">
+					<view class="left" style="display: flex;justify-content: flex-end;align-items: center;">
+						<!-- <text class="iconfont " :class="[item.icon]" style="color: #26b3a0;font-weight: 600;"></text> -->
+						<image :src="item.icon" mode=""></image>
+					</view>
+					<view class="right">
+						{{item.name}}
+					</view>
+				</view>
+			</view>
+			<view class="robotNameBox">
+				<uni-easyinput :inputBorder="true" :clearable="false" v-model="robotName"
+					placeholder="请输入播报标题"></uni-easyinput>
+			</view>
+
+			<view class="audioOrTxtChange">
+				<view class="item " :class="[index==curBobaoIndex?'item1':'item2']"
+					v-for="(item,index) in bobaoMenuList" @click="handleChangeBobao(index)">
+					{{item}}
+				</view>
+			</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>
+				</view>
+			</view>
+
+			<view class="btnBox">
+				<view class="btn draft" @click="saveDraft">
+					存草稿
+				</view>
+				<view class="btn" @click="genRobot" style="background: linear-gradient(to right,#06C68E,#02BCCD);">
+					合成
+				</view>
+			</view>
+
+		</view>
+		<u-picker :showIcon="true" :show="showMoreMenu" :columns="columns" title="更多" confirmColor=""
+			@cancel="showMoreMenu=false" @confirm="handleConfirm"></u-picker>
+
+		<u-popup :show="show" @close="close" @open="open">
+			<view class="contentBox">
+				<view class="toolBar">
+					<view class="cancel" @click="show=false">
+						<image src="/static/images/closeBtn.png" mode=""></image>
+					</view>
+					<view class="center">
+						全局语速
+					</view>
+					<view class="confirm" @click="handleBtnConfirm">
+						<image src="/static/images/selected.png" mode=""></image>
+					</view>
+				</view>
+				<view class="content" style="min-height: 300rpx;">
+					<u-slider height="50" min="0.7" max="1.3" step="0.1" class="slider" :showValue='false'
+						@change="handleChange" activeColor="#26b3a0" v-model="voiceRate"></u-slider>
+					<view class="sliderValue">
+						{{roundRate}}X
+					</view>
+				</view>
+			</view>
+		</u-popup>
+		<!-- 声音 -->
+		<u-popup :show="show1" @close="close1" @open="open">
+			<view class="contentBox">
+				<view class="toolBar">
+					<view class="cancel" @click="handleAudioClose">
+						<image src="/static/images/closeBtn.png" mode=""></image>
+					</view>
+					<view class="center">
+						声音
+					</view>
+					<view class="confirm" @click="handleBtnConfirm1">
+						<image src="/static/images/selected.png" mode=""></image>
+					</view>
+				</view>
+				<view class="content">
+					<view class="filterConList" style="max-height: 500rpx;min-height: 500rpx;overflow-y: scroll;">
+						<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 class="playBox" style="" @click="playAudio(item.audio_url)">
+								试听
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</u-popup>
+		<!-- 模型 -->
+		<u-popup :show="show3" @close="close3" @open="open">
+			<view class="contentBox2">
+				<view class="toolBar">
+					<view class="cancel" @click="show3=false">
+						<image src="/static/images/closeBtn.png" mode=""></image>
+					</view>
+					<view class="center">
+						角色
+					</view>
+					<view class="confirm" @click="handleBtnConfirm2">
+						<image src="/static/images/selected.png" mode=""></image>
+					</view>
+				</view>
+				<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="">
+							</image>
+							<view class="name" :class="[currTabIndexModal==index?'selTxt':'']">
+								{{item.name}}
+							</view>
+							<view class="ratio">
+								{{'('+item.proportion+')'}}
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</u-popup>
+
+		<!-- 背景 -->
+		<u-popup :show="show4" @close="close4" @open="open">
+			<view class="contentBox2">
+				<view class="toolBar">
+					<view class="cancel" @click="show4=false">
+						<image src="/static/images/closeBtn.png" mode=""></image>
+					</view>
+					<view class="center">
+						背景
+					</view>
+					<view class="confirm" @click="handleBtnConfirm3">
+						<image src="/static/images/selected.png" mode=""></image>
+					</view>
+				</view>
+				<view class="content">
+					<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="handleBgTabChange(item,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">
+								<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 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="defBox">
+								<view class="type1">
+									<view class="des">
+										<text class="lab">尺寸:9:16</text><br>
+										背景图要求:<br>
+										像素:最高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>
+								</view>
+								<view class="type1">
+									<view class="des">
+										<text class="lab">尺寸:16:9</text><br>
+										背景图要求:<br>
+										像素:最高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>
+								</view>
+
+							</view>
+							<view class=""
+								style="margin-left: 30rpx;margin-top: 20rpx;word-break: break-all;word-wrap: break-word;">
+								已选择的背景图:<br>
+								<!-- {{testCusBgImg1}} -->
+								{{testCusBgImg}}
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</u-popup>
+
+		<!-- 声音筛选弹框 -->
+		<u-popup :show="show2" @close="close" @open="open">
+			<view class="contentBox">
+				<view class="toolBar2">
+					<view class="closeBtn" @click="show2=false">
+						<!-- <image src="/static/images/selected.png" mode=""></image> -->
+						X
+					</view>
+				</view>
+				<view class="content">
+					<!-- 场景 -->
+					<view class="scenList">
+						<view class="item " v-for="(item, index) in scenList"
+							:class="[currScenIndex==index?'active':'']" @click="currScenIndex=index">
+							{{item}}
+						</view>
+					</view>
+					<!-- 性别-->
+					<view class="sexList">
+						<view class="item " v-for="(item, index) in sexList" :class="[currSexIndex==index?'active':'']"
+							@click="currSexIndex=index">
+							{{item}}
+						</view>
+					</view>
+					<!-- 年龄-->
+					<view class="ageList">
+						<view class="item " v-for="(item, index) in ageList" :class="[currAgeIndex==index?'active':'']"
+							@click="currAgeIndex=index">
+							{{item}}
+						</view>
+					</view>
+
+					<view class="filterBtn2" @click="filter">
+						确认
+					</view>
+				</view>
+			</view>
+		</u-popup>
+
+		<!-- 备用-视频尺寸 -->
+		<u-popup :show="show5" @close="close" @open="open">
+			<view class="contentBox">
+				<!-- 	<view class="toolBar2">
+					<view class="closeBtn" @click="show5=false">
+						X
+					</view>
+				</view> -->
+				<view class="toolBar toolBar2">
+					<view class="cancel">
+					</view>
+					<view class="center">
+						视频尺寸
+					</view>
+					<view class="confirm" @click="handleBtnConfirm2">
+						<!-- <image src="/static/images/selected.png" mode=""></image> -->
+						<view class="closeBtn" @click="show5=false">
+							X
+						</view>
+					</view>
+				</view>
+				<view class="content">
+					<view class="videoRatioBox">
+						<view class="item">
+							<view class="top">
+								竖版视频
+							</view>
+							<view class="bottom">
+								9:16
+							</view>
+						</view>
+						<view class="item">
+							<view class="top">
+								横版视频
+							</view>
+							<view class="bottom">
+								16:9
+							</view>
+						</view>
+					</view>
+					<view class="filterBtn2" @click="show5=false">
+						确认
+					</view>
+				</view>
+			</view>
+		</u-popup>
+
+		<!-- <view class="" style="height: 500rpx;width:300rpx !important;" :style='genResBgImg'>
+		</view> -->
+	</view>
+
+	</view>
+</template>
+
+<script>
+	import {
+		generateWork,
+		roleList,
+		voiceList,
+		backList,
+		getBg
+
+	} from '@/api/robot/index.js'
+	import indexVue from './index.vue';
+
+	import
+	uploadImgUrl
+	from '@/common/config.js';
+	export default {
+		data() {
+			return {
+				bobaoMenuList: ['输入播报文本', '上传播报录音文件'],
+				curBobaoIndex: 0,
+
+				localBgPicName: '',
+				refImg1: '',
+				refImg2: '',
+
+
+				testCusBgImg: '',
+				testCusBgImg1: '',
+				// tempAudioUrl: 'https://oaigc.oss-cn-chengdu.aliyuncs.com/20230804/90d3618dd8ae5a9ea50b932dba34f295.mp3',
+
+				audioUrl: '',
+
+				bgItem: {
+
+				},
+				show5: false,
+
+				show4: false,
+				// bgList: ['图片', '颜色'],
+				bgList: ['预置', '自定义'],
+				currTabIndex2: 0,
+				currTabIndexBg: -1,
+				currTabIndexBgc: -1,
+				bgPicList: [],
+				bgColorList: ['red', 'green', 'blue', 'orange', 'green', 'blue', 'orange'],
+
+				show3: false,
+				viewList: ['2D', '3D'],
+				currTabIndex1: 0,
+				currTabIndexModal: -1,
+				modalList: [{
+						img: '',
+						name: '模型名称'
+					},
+					{
+						img: '',
+						name: '模型名称'
+					},
+					{
+						img: '',
+						name: '模型名称'
+					},
+					{
+						img: '',
+						name: '模型名称'
+					},
+					{
+						img: '',
+						name: '模型名称'
+					},
+					{
+						img: '',
+						name: '模型名称'
+					},
+					{
+						img: '',
+						name: '模型名称'
+					},
+				],
+
+				show2: false,
+				currTabIndexAll: -1,
+
+				scenList: ['全部场景', '热门', '新闻咨询', '影视咨询', '热门', '新闻咨询', '影视咨询'],
+				currScenIndex: 0,
+
+				sexList: ['全部性别', '男声', '女声'],
+				currSexIndex: 0,
+
+				ageList: ['全部年龄', '儿童', '少年', '青年', '中年', '老年'],
+				currAgeIndex: 0,
+
+				allList: [],
+				// voiceList: ['全部', '热门', '新闻咨询', '影视综艺', '其他'],
+				show1: false,
+				currTabIndex: 0,
+
+				robotName: '',
+				textAreaValue: '',
+				voiceRate: 1,
+				selRoleId: -1,
+				selVoiceId: -1,
+				selBgId: -1,
+				selBgPic: '',
+
+				roleList: [],
+
+				value: 1,
+				show: false,
+				menuList: [{
+						icon: require('@/static/images/yusu.png'),
+						name: '全局语速'
+					},
+					{
+						icon: require('@/static/images/audio.png'),
+						name: '声音'
+					},
+					{
+						icon: require('@/static/images/bg_d.png'),
+						name: '背景'
+					},
+					{
+						icon: require('@/static/images/role.png'),
+						name: '角色'
+					},
+				],
+				videoSrc: '',
+				showMoreMenu: false,
+				columns: [
+					[]
+				],
+				selVoiceItem: {
+					name: '',
+					url: ''
+				},
+				selRoleItem: {
+					name: '',
+					url: ''
+				},
+
+				detail: {},
+
+				roundRate: 1,
+				isGenerate: false,
+				isCreate: false,
+
+				roleList2: [],
+				bgPicList2: [],
+
+				newBgItem: {
+					id: -1
+				},
+				music: null,
+
+				genResBgImg: "",
+
+				// hasFirstSeledRole: false,
+				isFirstSelRole: true,
+
+				testCusBgScale: 1
+			};
+		},
+		computed: {
+
+		},
+
+		onReady() {
+
+		},
+		onUnload() {
+
+		},
+		onLoad(o) {
+			if (o.type == 'create') {
+				this.isCreate = true
+				this.selRoleId = 5
+				this.selBgId = 0
+				this.selVoiceId = 9
+				this.roundRate = 1
+				this.voiceRate = 1
+				return
+				console.log('create')
+			}
+
+
+
+
+			this.detail = getApp().draftDetail
+
+			this.robotName = getApp().draftDetail.name
+			this.textAreaValue = getApp().draftDetail.content
+			this.selRoleId = getApp().draftDetail.role - 1
+			// this.selVoiceId = getApp().draftDetail.audio - 1
+			this.selVoiceId = getApp().draftDetail.audio - 2
+			this.voiceRate = getApp().draftDetail.stage
+
+			this.selBgId = getApp().draftDetail.back - 1
+			this.selBgPic = getApp().draftDetail.backs.url
+			this.bgItem = getApp().draftDetail.backs
+
+			this.roundRate = getApp().draftDetail.stage
+			this.selVoiceItem = getApp().draftDetail.audios
+
+			console.log('getApp().draftDetail.audios-----this.selVoiceItem', this.selVoiceItem);
+			this.selRoleItem = getApp().draftDetail.roles
+
+
+			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
+				this.currTabIndex2 = 1
+			}
+
+			if (this.audioUrl && !this.textAreaValue) {
+				this.curBobaoIndex = 1
+			}
+			console.log('传过来的草稿项:', this.detail);
+		},
+		async onShow() {
+			// let res = await roleList({})
+			let res = await this.$http('digitalMen.roleList', {})
+			if (res.code == 0) {
+				// this.roleList = res.msg
+				this.roleList2 = res.msg
+				console.log('数字人角色列表返回值:', res);
+
+				if (this.isCreate) {
+					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({
+					title: res.msg,
+					icon: 'none'
+				})
+			}
+
+			// let res1 = await voiceList({})
+			let res1 = await this.$http('digitalMen.voiceList', {})
+			if (res1.code == 0) {
+				// this.roleList = res.data
+				this.allList = res1.msg
+				console.log('数字人声音列表返回值:', res1);
+				this.currTabIndexAll = res1.msg.findIndex((item, index) => {
+					// return item.id == this.selVoiceId + 1
+					return item.id == this.selVoiceId
+				})
+				if (this.isCreate) {
+					this.selVoiceItem = this.allList[9]
+
+					console.log('this.isCreate-------this.selVoiceItem', this.selVoiceItem);
+				}
+
+			} else {
+				uni.showToast({
+					title: res1.msg,
+					icon: 'none'
+				})
+			}
+
+			// let res3 = await backList({})
+			let res3 = await this.$http('digitalMen.backList', {})
+			if (res3.code == 0) {
+				this.bgPicList = res3.msg
+				this.bgPicList2 = res3.msg
+
+				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]
+				}
+				console.log('index3', this.currTabIndexBgc);
+			} else {
+				uni.showToast({
+					title: res3.msg,
+					icon: 'none'
+				})
+			}
+		},
+		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) {
+
+		},
+
+		methods: {
+			handleChangeBobao(index) {
+				this.curBobaoIndex = index
+				// if (index == 0) {
+				// 	this.audioUrl = ''
+				// }
+			},
+
+			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({
+					count: 1, //默认9
+					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({
+							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()
+									that.testCusBgImg1 = that.localBgPicName
+									console.log('上传图片返回值----1:', that.testCusBgImg);
+
+									if (that.selRoleItem.proportion != '9:16') {
+										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({
+										title: '上传图片失败',
+										icon: 'none'
+									})
+									// that.ifimg = false
+								}
+							}
+						});
+					}
+				});
+			},
+			uploadBg2() {
+				let that = this;
+				uni.chooseImage({
+					count: 1, //默认9
+					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({
+							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()
+									that.testCusBgImg1 = that.localBgPicName
+									console.log('上传图片返回值---2:', that.testCusBgImg);
+
+									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 = {
+										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: '上传图片失败',
+										icon: 'none'
+									})
+									// that.ifimg = false
+								}
+							}
+						});
+					}
+				});
+			},
+
+
+
+
+			playAudio(item) {
+				if (this.music) {
+					this.music.destroy()
+				}
+				this.music = uni.createInnerAudioContext(); //创建播放器对象
+				this.music.autoplay = true;
+				this.music.src =
+					item; //音频地址
+				// this.music.play();
+			},
+
+
+			uploadVideo() {
+				let _this = this
+				uni.chooseFile({
+					count: 1, //默认100
+					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: "上传中...",
+						});
+
+						uni.uploadFile({
+							url: uploadImgUrl.baseImgUrl,
+							filePath: tempFilePaths[0],
+							// filePath: JSON.stringify(res.tempFilePaths),
+							name: 'file',
+							fileType: "audio",
+							formData: {
+								accept: 'audio',
+								upload_type: 'ali-oss'
+							},
+							success: (uploadFileRes) => {
+								uni.hideLoading();
+								const ret = JSON.parse(uploadFileRes.data);
+								if (ret.code == 0) {
+									_this.audioUrl = ret.data.path
+									console.log(ret);
+								}
+
+							}
+						});
+					}
+				});
+			},
+
+
+			close() {
+
+				this.show = false
+			},
+			close1() {
+				// this.music.src = ''; //音频地址
+				// this.music.stop(); //执行播放  
+				if (this.music) {
+					this.music.destroy()
+				}
+
+				this.show1 = false
+			},
+			close3() {
+				this.show3 = false
+			},
+			close4() {
+				this.show4 = false
+			},
+			handleSelBg(item, index) {
+				this.isFirstSelRole = false
+				if (this.testCusBgImg) {
+					this.testCusBgImg = ''
+				}
+				if (this.testCusBgImg1) {
+					this.testCusBgImg1 = ''
+				}
+
+				this.bgItem = item
+				this.newBgItem = item
+				console.log('111111111', item);
+
+				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) => {
+						return item.proportion == '9:16'
+
+					})
+				} else {
+					this.roleList = this.roleList2.filter((item, index) => {
+						return item.proportion == '16:9'
+					})
+				}
+
+
+
+				this.bgItem = item
+				this.selBgPic = item.url
+				this.selBgId = item.id - 1
+				this.currTabIndexBg = index
+			},
+			handleVoiceSel(item, index) {
+				if (this.music) {
+					this.music.src = ''; //音频地址
+					this.music.stop(); //执行播放  
+				}
+
+				this.selVoiceItem = item
+
+				console.log('this.selVoiceItem-----', this.selVoiceItem);
+				// this.selVoiceId = item.id - 1
+				this.selVoiceId = item.id
+				this.currTabIndexAll = index
+			},
+			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
+					});
+				}
+			},
+			async saveDraft() {
+				if (!this.robotName) {
+					return uni.showToast({
+						title: '请输入播报标题',
+						icon: 'none'
+					})
+				}
+
+				let parmas = {
+					name: this.robotName,
+					content: this.textAreaValue,
+					// role: this.selRoleId,
+					// back: this.selBgId,
+					// audio: this.selVoiceId,
+					stage: this.roundRate,
+					audio_url: this.audioUrl,
+					is_draft: 1
+				}
+				if (this.selRoleId != -1) {
+					parmas['role'] = this.selRoleId
+				}
+				if (this.selBgId != -1) {
+					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)
+
+				let res = await this.$http('digitalMen.generateWork', parmas)
+				if (res.code == 0) {
+					uni.showToast({
+						title: '保存成功!',
+						icon: 'success'
+					})
+					setTimeout(() => {
+						uni.navigateBack()
+					}, 1500)
+				} else {
+					uni.showToast({
+						title: res.msg,
+						icon: 'none'
+					})
+				}
+				console.log('保存数字人草稿返回值:', res);
+			},
+			async genRobot() {
+				// 生成参数校验
+				if (!this.robotName) {
+					return uni.showToast({
+						title: '请输入播报标题',
+						icon: 'none'
+					})
+
+				}
+				if (this.curBobaoIndex == 0 && !this.textAreaValue) {
+					return uni.showToast({
+						title: '请输入播报文本',
+						icon: 'none'
+					})
+				}
+				if (this.curBobaoIndex == 0 && this.textAreaValue.trim().length < 10) {
+					return uni.showToast({
+						title: '播报文本最少10个字',
+						icon: 'none'
+					})
+				}
+
+				if (this.curBobaoIndex == 1 && !this.audioUrl) {
+					return uni.showToast({
+						title: '请上传播报录音文件',
+						icon: 'none'
+					})
+				}
+				// return
+				// 生成参数校验
+
+				if (this.isGenerate) {
+					uni.showToast({
+						title: '请等待上一次生成完成后提交!',
+						icon: 'none'
+					})
+					return
+				}
+
+
+				let parmas = {}
+				if (this.audioUrl && !this.testCusBgImg && this.curBobaoIndex == 1) {
+					parmas = {
+						name: this.robotName,
+						// content: this.textAreaValue,
+						role: this.selRoleId,
+						back: this.selBgId,
+						// audio: this.selVoiceId,
+						// stage: this.roundRate,
+						audio_url: this.audioUrl
+					}
+				} else if (this.audioUrl && this.testCusBgImg && this.curBobaoIndex == 1) {
+					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 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,
+						content: this.textAreaValue,
+						role: this.selRoleId,
+						back: this.selBgId,
+						audio: this.selVoiceId,
+						stage: this.roundRate,
+						// audio_url: this.audioUrl
+					}
+				}
+				console.log('创建数字人参数:', parmas);
+				// return
+
+				this.isGenerate = true
+				this.robotName = ''
+				this.textAreaValue = ""
+				this.audioUrl = ''
+				// let res = await generateWork(parmas)
+				let res = await this.$http('digitalMen.generateWork', parmas)
+				if (res.code == 0) {
+					uni.showToast({
+						title: '创建数字人成功!',
+						icon: 'success'
+					})
+					getApp().from = 'create'
+					setTimeout(() => {
+						uni.navigateBack()
+					}, 1500)
+					this.isGenerate = false
+				} else {
+					uni.showToast({
+						title: res.msg,
+						icon: 'none'
+					})
+					this.isGenerate = false
+				}
+				console.log('生成数字人返回值:', res);
+			},
+
+			filter() {
+				this.show2 = false
+			},
+			handleFilter() {
+				// this.show1 = false
+				this.show2 = true
+			},
+			handleAudioClose() {
+				this.show1 = false
+				if (this.music) {
+					this.music.destroy()
+				}
+			},
+			handleBtnConfirm1() {
+				this.show1 = false
+				if (this.music) {
+					this.music.destroy()
+				}
+			},
+			handleBtnConfirm2() {
+				this.show3 = false
+			},
+			handleBtnConfirm3() {
+				this.show4 = false
+			},
+
+			handleSetBox(item) {
+				if (item.name == '全局语速') {
+					if (this.curBobaoIndex == 1) {
+						return uni.showToast({
+							title: '上传音频不支持全局语速',
+							icon: 'none'
+						})
+					}
+					this.show = true
+				} else if (item.name == '声音') {
+					if (this.curBobaoIndex == 1) {
+						return uni.showToast({
+							title: '上传音频不支持声音选择',
+							icon: 'none'
+						})
+					}
+					this.music = uni.createInnerAudioContext(); //创建播放器对象
+					this.music.autoplay = true;
+					this.show1 = true
+
+					// console.log('是否创建好this.music', this.music);
+				} else if (item.name == '角色') {
+
+					this.show3 = true
+				} else if (item.name == '背景') {
+					this.show4 = true
+				}
+			},
+			handleChange(e) {
+				console.log(e);
+				this.roundRate = e.toFixed(1)
+			},
+
+			handleBtnConfirm() {
+				this.show = false
+			},
+
+			handleCreatePro() {
+				uni.navigateTo({
+					url: ''
+				})
+			},
+			handleShowMoreMenu() {
+				this.showMoreMenu = true
+			},
+			handleConfirm(e) {
+				this.showMoreMenu = false
+			},
+			open() {
+				// console.log('open() ');
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	@import './index.scss';
+</style>

+ 3 - 3
pages/digitalMen/index.vue

xqd xqd xqd
@@ -284,7 +284,7 @@
 				let _this = this
 				uni.showModal({
 					title: '提示',
-					confirmColor: '#26b3a0',
+					confirmColor: '#207CF7',
 					content: '是否确认删除:' + item.name + '?',
 					success: async (res1) => {
 						if (res1.confirm) {
@@ -458,7 +458,7 @@
 					// }
 					uni.showModal({
 						title: '提示',
-						confirmColor: '#26b3a0',
+						confirmColor: '#207CF7',
 						content: '是否确认删除:' + _this.delItem.name + '?',
 						success: async (res1) => {
 							if (res1.confirm) {
@@ -529,7 +529,7 @@
 							title: '温馨提示',
 							content: '微信内置浏览器不支持视频文件下载,请复制视频链接至手机浏览器打开',
 							confirmText: '复制',
-							confirmColor: '#26B3A0',
+							confirmColor: '#207CF7',
 							success: function(res) {
 								if (res.confirm) {
 									uni.setClipboardData({

+ 13 - 0
pages/user/user.vue

xqd xqd
@@ -123,6 +123,13 @@
 						</view>
 						<u-icon name="arrow-right" color="#9e9e9e" size="18"></u-icon>
 					</view>
+					<view class="cell" @click="toRenwu">
+						<view class="cell-left">
+							<u-icon :isJianBian="true" name="coupon-fill" color="#e83a30" size="22"></u-icon>
+							<view class="cell-text">任务中心</view>
+						</view>
+						<u-icon name="arrow-right" color="#9e9e9e" size="18"></u-icon>
+					</view>
 
 					<navigator v-for="(item, index) in userList" :key="index"
 						:url="isLogin ? item.url : item.url=='custom'?'': '/pages/user/signin'" @click="getroute">
@@ -704,6 +711,12 @@
 		methods: {
 			...mapActions(['getUserInfo', 'showAuthModal', 'getUserData', 'logout']),
 
+			toRenwu() {
+				uni.navigateTo({
+					url: '/pages/signin/signin'
+				})
+			},
+
 			getFreeScore() {
 				// console.log('getFreeScore()');
 				window.location = 'https://vwhjk.xet.tech/s/3WYb0z'

BIN
static/images/selected.png


+ 103 - 0
uni_modules/uni-easyinput/changelog.md

xqd
@@ -0,0 +1,103 @@
+## 1.1.12(2024-01-29)
+- 补充 adjust-position文档属性补充
+## 1.1.11(2024-01-29)
+- 补充 adjust-position属性传递值:(Boolean)当键盘弹起时,是否自动上推页面
+## 1.1.10(2024-01-22)
+- 去除 移除无用的log输出
+## 1.1.9(2023-04-11)
+- 修复 vue3 下 keyboardheightchange 事件报错的bug
+## 1.1.8(2023-03-29)
+- 优化 trim 属性默认值
+## 1.1.7(2023-03-29)
+- 新增 cursor-spacing 属性
+## 1.1.6(2023-01-28)
+- 新增 keyboardheightchange 事件,可监听键盘高度变化
+## 1.1.5(2022-11-29)
+- 优化 主题样式
+## 1.1.4(2022-10-27)
+- 修复 props 中背景颜色无默认值的bug
+## 1.1.0(2022-06-30)
+
+- 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容
+- 新增 clear 事件,点击右侧叉号图标触发
+- 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发
+- 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等
+
+## 1.0.5(2022-06-07)
+
+- 优化 clearable 显示策略
+
+## 1.0.4(2022-06-07)
+
+- 优化 clearable 显示策略
+
+## 1.0.3(2022-05-20)
+
+- 修复 关闭图标某些情况下无法取消的 bug
+
+## 1.0.2(2022-04-12)
+
+- 修复 默认值不生效的 bug
+
+## 1.0.1(2022-04-02)
+
+- 修复 value 不能为 0 的 bug
+
+## 1.0.0(2021-11-19)
+
+- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-easyinput](https://uniapp.dcloud.io/component/uniui/uni-easyinput)
+
+## 0.1.4(2021-08-20)
+
+- 修复 在 uni-forms 的动态表单中默认值校验不通过的 bug
+
+## 0.1.3(2021-08-11)
+
+- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题
+
+## 0.1.2(2021-07-30)
+
+- 优化 vue3 下事件警告的问题
+
+## 0.1.1
+
+- 优化 errorMessage 属性支持 Boolean 类型
+
+## 0.1.0(2021-07-13)
+
+- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+
+## 0.0.16(2021-06-29)
+
+- 修复 confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug
+
+## 0.0.15(2021-06-21)
+
+- 修复 passwordIcon 属性拼写错误的 bug
+
+## 0.0.14(2021-06-18)
+
+- 新增 passwordIcon 属性,当 type=password 时是否显示小眼睛图标
+- 修复 confirmType 属性不生效的问题
+
+## 0.0.13(2021-06-04)
+
+- 修复 disabled 状态可清出内容的 bug
+
+## 0.0.12(2021-05-12)
+
+- 新增 组件示例地址
+
+## 0.0.11(2021-05-07)
+
+- 修复 input-border 属性不生效的问题
+
+## 0.0.10(2021-04-30)
+
+- 修复 ios 遮挡文字、显示一半的问题
+
+## 0.0.9(2021-02-05)
+
+- 调整为 uni_modules 目录规范
+- 优化 兼容 nvue 页面

+ 54 - 0
uni_modules/uni-easyinput/components/uni-easyinput/common.js

xqd
@@ -0,0 +1,54 @@
+/**
+ * @desc 函数防抖
+ * @param func 目标函数
+ * @param wait 延迟执行毫秒数
+ * @param immediate true - 立即执行, false - 延迟执行
+ */
+export const debounce = function(func, wait = 1000, immediate = true) {
+	let timer;
+	return function() {
+		let context = this,
+			args = arguments;
+		if (timer) clearTimeout(timer);
+		if (immediate) {
+			let callNow = !timer;
+			timer = setTimeout(() => {
+				timer = null;
+			}, wait);
+			if (callNow) func.apply(context, args);
+		} else {
+			timer = setTimeout(() => {
+				func.apply(context, args);
+			}, wait)
+		}
+	}
+}
+/**
+ * @desc 函数节流
+ * @param func 函数
+ * @param wait 延迟执行毫秒数
+ * @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发
+ */
+export const throttle = (func, wait = 1000, type = 1) => {
+	let previous = 0;
+	let timeout;
+	return function() {
+		let context = this;
+		let args = arguments;
+		if (type === 1) {
+			let now = Date.now();
+
+			if (now - previous > wait) {
+				func.apply(context, args);
+				previous = now;
+			}
+		} else if (type === 2) {
+			if (!timeout) {
+				timeout = setTimeout(() => {
+					timeout = null;
+					func.apply(context, args)
+				}, wait)
+			}
+		}
+	}
+}

+ 664 - 0
uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue

xqd
@@ -0,0 +1,664 @@
+<template>
+	<view class="uni-easyinput" :class="{ 'uni-easyinput-error': msg }" :style="boxStyle">
+		<view class="uni-easyinput__content" :class="inputContentClass" :style="inputContentStyle">
+			<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')" size="22"></uni-icons>
+			<textarea
+				v-if="type === 'textarea'"
+				class="uni-easyinput__content-textarea"
+				:class="{ 'input-padding': inputBorder }"
+				:name="name"
+				:value="val"
+				:placeholder="placeholder"
+				:placeholderStyle="placeholderStyle"
+				:disabled="disabled"
+				placeholder-class="uni-easyinput__placeholder-class"
+				:maxlength="inputMaxlength"
+				:focus="focused"
+				:autoHeight="autoHeight"
+				:cursor-spacing="cursorSpacing"
+				:adjust-position="adjustPosition"
+				@input="onInput"
+				@blur="_Blur"
+				@focus="_Focus"
+				@confirm="onConfirm"
+        @keyboardheightchange="onkeyboardheightchange"
+			></textarea>
+			<input
+				v-else
+				:type="type === 'password' ? 'text' : type"
+				class="uni-easyinput__content-input"
+				:style="inputStyle"
+				:name="name"
+				:value="val"
+				:password="!showPassword && type === 'password'"
+				:placeholder="placeholder"
+				:placeholderStyle="placeholderStyle"
+				placeholder-class="uni-easyinput__placeholder-class"
+				:disabled="disabled"
+				:maxlength="inputMaxlength"
+				:focus="focused"
+				:confirmType="confirmType"
+				:cursor-spacing="cursorSpacing"
+				:adjust-position="adjustPosition"
+				@focus="_Focus"
+				@blur="_Blur"
+				@input="onInput"
+				@confirm="onConfirm"
+        @keyboardheightchange="onkeyboardheightchange"
+			/>
+			<template v-if="type === 'password' && passwordIcon">
+				<!-- 开启密码时显示小眼睛 -->
+				<uni-icons
+					v-if="isVal"
+					class="content-clear-icon"
+					:class="{ 'is-textarea-icon': type === 'textarea' }"
+					:type="showPassword ? 'eye-slash-filled' : 'eye-filled'"
+					:size="22"
+					:color="focusShow ? primaryColor : '#c0c4cc'"
+					@click="onEyes"
+				></uni-icons>
+			</template>
+			<template v-else-if="suffixIcon">
+				<uni-icons v-if="suffixIcon" class="content-clear-icon" :type="suffixIcon" color="#c0c4cc" @click="onClickIcon('suffix')" size="22"></uni-icons>
+			</template>
+			<template v-else>
+				<uni-icons
+					v-if="clearable && isVal && !disabled && type !== 'textarea'"
+					class="content-clear-icon"
+					:class="{ 'is-textarea-icon': type === 'textarea' }"
+					type="clear"
+					:size="clearSize"
+					:color="msg ? '#dd524d' : focusShow ? primaryColor : '#c0c4cc'"
+					@click="onClear"
+				></uni-icons>
+			</template>
+			<slot name="right"></slot>
+		</view>
+	</view>
+</template>
+
+<script>
+/**
+ * Easyinput 输入框
+ * @description 此组件可以实现表单的输入与校验,包括 "text" 和 "textarea" 类型。
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=3455
+ * @property {String}	value	输入内容
+ * @property {String }	type	输入框的类型(默认text) password/text/textarea/..
+ * 	@value text			文本输入键盘
+ * 	@value textarea	多行文本输入键盘
+ * 	@value password	密码输入键盘
+ * 	@value number		数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式
+ * 	@value idcard		身份证输入键盘,信、支付宝、百度、QQ小程序
+ * 	@value digit		带小数点的数字键盘	,App的nvue页面、微信、支付宝、百度、头条、QQ小程序支持
+ * @property {Boolean}	clearable	是否显示右侧清空内容的图标控件,点击可清空输入框内容(默认true)
+ * @property {Boolean}	autoHeight	是否自动增高输入区域,type为textarea时有效(默认true)
+ * @property {String }	placeholder	输入框的提示文字
+ * @property {String }	placeholderStyle	placeholder的样式(内联样式,字符串),如"color: #ddd"
+ * @property {Boolean}	focus	是否自动获得焦点(默认false)
+ * @property {Boolean}	disabled	是否禁用(默认false)
+ * @property {Number }	maxlength	最大输入长度,设置为 -1 的时候不限制最大长度(默认140)
+ * @property {String }	confirmType	设置键盘右下角按钮的文字,仅在type="text"时生效(默认done)
+ * @property {Number }	clearSize	清除图标的大小,单位px(默认15)
+ * @property {String}	prefixIcon	输入框头部图标
+ * @property {String}	suffixIcon	输入框尾部图标
+ * @property {String}	primaryColor	设置主题色(默认#2979ff)
+ * @property {Boolean}	trim	是否自动去除两端的空格
+ * @property {Boolean}	cursorSpacing	指定光标与键盘的距离,单位 px
+ * @property {Boolean}  ajust-position 当键盘弹起时,是否上推内容,默认值:true
+ * @value both	去除两端空格
+ * @value left	去除左侧空格
+ * @value right	去除右侧空格
+ * @value start	去除左侧空格
+ * @value end		去除右侧空格
+ * @value all		去除全部空格
+ * @value none	不去除空格
+ * @property {Boolean}	inputBorder	是否显示input输入框的边框(默认true)
+ * @property {Boolean}	passwordIcon	type=password时是否显示小眼睛图标
+ * @property {Object}	styles	自定义颜色
+ * @event {Function}	input	输入框内容发生变化时触发
+ * @event {Function}	focus	输入框获得焦点时触发
+ * @event {Function}	blur	输入框失去焦点时触发
+ * @event {Function}	confirm	点击完成按钮时触发
+ * @event {Function}	iconClick	点击图标时触发
+ * @example <uni-easyinput v-model="mobile"></uni-easyinput>
+ */
+function obj2strClass(obj) {
+	let classess = '';
+	for (let key in obj) {
+		const val = obj[key];
+		if (val) {
+			classess += `${key} `;
+		}
+	}
+	return classess;
+}
+
+function obj2strStyle(obj) {
+	let style = '';
+	for (let key in obj) {
+		const val = obj[key];
+		style += `${key}:${val};`;
+	}
+	return style;
+}
+export default {
+	name: 'uni-easyinput',
+	emits: ['click', 'iconClick', 'update:modelValue', 'input', 'focus', 'blur', 'confirm', 'clear', 'eyes', 'change', 'keyboardheightchange'],
+	model: {
+		prop: 'modelValue',
+		event: 'update:modelValue'
+	},
+	options: {
+		virtualHost: true
+	},
+	inject: {
+		form: {
+			from: 'uniForm',
+			default: null
+		},
+		formItem: {
+			from: 'uniFormItem',
+			default: null
+		}
+	},
+	props: {
+		name: String,
+		value: [Number, String],
+		modelValue: [Number, String],
+		type: {
+			type: String,
+			default: 'text'
+		},
+		clearable: {
+			type: Boolean,
+			default: true
+		},
+		autoHeight: {
+			type: Boolean,
+			default: false
+		},
+		placeholder: {
+			type: String,
+			default: ' '
+		},
+		placeholderStyle: String,
+		focus: {
+			type: Boolean,
+			default: false
+		},
+		disabled: {
+			type: Boolean,
+			default: false
+		},
+		maxlength: {
+			type: [Number, String],
+			default: 140
+		},
+		confirmType: {
+			type: String,
+			default: 'done'
+		},
+		clearSize: {
+			type: [Number, String],
+			default: 24
+		},
+		inputBorder: {
+			type: Boolean,
+			default: true
+		},
+		prefixIcon: {
+			type: String,
+			default: ''
+		},
+		suffixIcon: {
+			type: String,
+			default: ''
+		},
+		trim: {
+			type: [Boolean, String],
+			default: false
+		},
+		cursorSpacing: {
+			type: Number,
+			default: 0
+		},
+		passwordIcon: {
+			type: Boolean,
+			default: true
+		},
+		adjustPosition:{
+			type: Boolean,
+			default: true
+		},
+		primaryColor: {
+			type: String,
+			default: '#2979ff'
+		},
+		styles: {
+			type: Object,
+			default() {
+				return {
+					color: '#333',
+					backgroundColor: '#fff',
+					disableColor: '#F7F6F6',
+					borderColor: '#e5e5e5'
+				};
+			}
+		},
+		errorMessage: {
+			type: [String, Boolean],
+			default: ''
+		}
+	},
+	data() {
+		return {
+			focused: false,
+			val: '',
+			showMsg: '',
+			border: false,
+			isFirstBorder: false,
+			showClearIcon: false,
+			showPassword: false,
+			focusShow: false,
+			localMsg: '',
+			isEnter: false // 用于判断当前是否是使用回车操作
+		};
+	},
+	computed: {
+		// 输入框内是否有值
+		isVal() {
+			const val = this.val;
+			// fixed by mehaotian 处理值为0的情况,字符串0不在处理范围
+			if (val || val === 0) {
+				return true;
+			}
+			return false;
+		},
+
+		msg() {
+			// console.log('computed', this.form, this.formItem);
+			// if (this.form) {
+			// 	return this.errorMessage || this.formItem.errMsg;
+			// }
+			// TODO 处理头条 formItem 中 errMsg 不更新的问题
+			return this.localMsg || this.errorMessage;
+		},
+		// 因为uniapp的input组件的maxlength组件必须要数值,这里转为数值,用户可以传入字符串数值
+		inputMaxlength() {
+			return Number(this.maxlength);
+		},
+
+		// 处理外层样式的style
+		boxStyle() {
+			return `color:${this.inputBorder && this.msg ? '#e43d33' : this.styles.color};`;
+		},
+		// input 内容的类和样式处理
+		inputContentClass() {
+			return obj2strClass({
+				'is-input-border': this.inputBorder,
+				'is-input-error-border': this.inputBorder && this.msg,
+				'is-textarea': this.type === 'textarea',
+				'is-disabled': this.disabled,
+				'is-focused': this.focusShow
+			});
+		},
+		inputContentStyle() {
+			const focusColor = this.focusShow ? this.primaryColor : this.styles.borderColor;
+			const borderColor = this.inputBorder && this.msg ? '#dd524d' : focusColor;
+			return obj2strStyle({
+				'border-color': borderColor || '#e5e5e5',
+				'background-color': this.disabled ? this.styles.disableColor : this.styles.backgroundColor
+			});
+		},
+		// input右侧样式
+		inputStyle() {
+			const paddingRight = this.type === 'password' || this.clearable || this.prefixIcon ? '' : '10px';
+			return obj2strStyle({
+				'padding-right': paddingRight,
+				'padding-left': this.prefixIcon ? '' : '10px'
+			});
+		}
+	},
+	watch: {
+		value(newVal) {
+			this.val = newVal;
+		},
+		modelValue(newVal) {
+			this.val = newVal;
+		},
+		focus(newVal) {
+			this.$nextTick(() => {
+				this.focused = this.focus;
+				this.focusShow = this.focus;
+			});
+		}
+	},
+	created() {
+		this.init();
+		// TODO 处理头条vue3 computed 不监听 inject 更改的问题(formItem.errMsg)
+		if (this.form && this.formItem) {
+			this.$watch('formItem.errMsg', newVal => {
+				this.localMsg = newVal;
+			});
+		}
+	},
+	mounted() {
+		this.$nextTick(() => {
+			this.focused = this.focus;
+			this.focusShow = this.focus;
+		});
+	},
+	methods: {
+		/**
+		 * 初始化变量值
+		 */
+		init() {
+			if (this.value || this.value === 0) {
+				this.val = this.value;
+			} else if (this.modelValue || this.modelValue === 0 || this.modelValue === '') {
+				this.val = this.modelValue;
+			} else {
+				this.val = null;
+			}
+		},
+
+		/**
+		 * 点击图标时触发
+		 * @param {Object} type
+		 */
+		onClickIcon(type) {
+			this.$emit('iconClick', type);
+		},
+
+		/**
+		 * 显示隐藏内容,密码框时生效
+		 */
+		onEyes() {
+			this.showPassword = !this.showPassword;
+			this.$emit('eyes', this.showPassword);
+		},
+
+		/**
+		 * 输入时触发
+		 * @param {Object} event
+		 */
+		onInput(event) {
+			let value = event.detail.value;
+			// 判断是否去除空格
+			if (this.trim) {
+				if (typeof this.trim === 'boolean' && this.trim) {
+					value = this.trimStr(value);
+				}
+				if (typeof this.trim === 'string') {
+					value = this.trimStr(value, this.trim);
+				}
+			}
+			if (this.errMsg) this.errMsg = '';
+			this.val = value;
+			// TODO 兼容 vue2
+			this.$emit('input', value);
+			// TODO 兼容 vue3
+			this.$emit('update:modelValue', value);
+		},
+
+		/**
+		 * 外部调用方法
+		 * 获取焦点时触发
+		 * @param {Object} event
+		 */
+		onFocus() {
+			this.$nextTick(() => {
+				this.focused = true;
+			});
+			this.$emit('focus', null);
+		},
+
+		_Focus(event) {
+			this.focusShow = true;
+			this.$emit('focus', event);
+		},
+
+		/**
+		 * 外部调用方法
+		 * 失去焦点时触发
+		 * @param {Object} event
+		 */
+		onBlur() {
+			this.focused = false;
+			this.$emit('focus', null);
+		},
+		_Blur(event) {
+			let value = event.detail.value;
+			this.focusShow = false;
+			this.$emit('blur', event);
+			// 根据类型返回值,在event中获取的值理论上讲都是string
+			if (this.isEnter === false) {
+				this.$emit('change', this.val);
+			}
+			// 失去焦点时参与表单校验
+			if (this.form && this.formItem) {
+				const { validateTrigger } = this.form;
+				if (validateTrigger === 'blur') {
+					this.formItem.onFieldChange();
+				}
+			}
+		},
+
+		/**
+		 * 按下键盘的发送键
+		 * @param {Object} e
+		 */
+		onConfirm(e) {
+			this.$emit('confirm', this.val);
+			this.isEnter = true;
+			this.$emit('change', this.val);
+			this.$nextTick(() => {
+				this.isEnter = false;
+			});
+		},
+
+		/**
+		 * 清理内容
+		 * @param {Object} event
+		 */
+		onClear(event) {
+			this.val = '';
+			// TODO 兼容 vue2
+			this.$emit('input', '');
+			// TODO 兼容 vue2
+			// TODO 兼容 vue3
+			this.$emit('update:modelValue', '');
+			// 点击叉号触发
+			this.$emit('clear');
+		},
+
+    /**
+     * 键盘高度发生变化的时候触发此事件
+     * 兼容性:微信小程序2.7.0+、App 3.1.0+
+     * @param {Object} event
+     */
+    onkeyboardheightchange(event) {
+      this.$emit("keyboardheightchange",event);
+    },
+
+		/**
+		 * 去除空格
+		 */
+		trimStr(str, pos = 'both') {
+			if (pos === 'both') {
+				return str.trim();
+			} else if (pos === 'left') {
+				return str.trimLeft();
+			} else if (pos === 'right') {
+				return str.trimRight();
+			} else if (pos === 'start') {
+				return str.trimStart();
+			} else if (pos === 'end') {
+				return str.trimEnd();
+			} else if (pos === 'all') {
+				return str.replace(/\s+/g, '');
+			} else if (pos === 'none') {
+				return str;
+			}
+			return str;
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+$uni-error: #e43d33;
+$uni-border-1: #dcdfe6 !default;
+
+.uni-easyinput {
+	/* #ifndef APP-NVUE */
+	width: 100%;
+	/* #endif */
+	flex: 1;
+	position: relative;
+	text-align: left;
+	color: #333;
+	font-size: 14px;
+}
+
+.uni-easyinput__content {
+	flex: 1;
+	/* #ifndef APP-NVUE */
+	width: 100%;
+	display: flex;
+	box-sizing: border-box;
+	// min-height: 36px;
+	/* #endif */
+	flex-direction: row;
+	align-items: center;
+	// 处理border动画刚开始显示黑色的问题
+	border-color: #fff;
+	transition-property: border-color;
+	transition-duration: 0.3s;
+}
+
+.uni-easyinput__content-input {
+	/* #ifndef APP-NVUE */
+	width: auto;
+	/* #endif */
+	position: relative;
+	overflow: hidden;
+	flex: 1;
+	line-height: 1;
+	font-size: 14px;
+	height: 35px;
+	// min-height: 36px;
+}
+
+.uni-easyinput__placeholder-class {
+	color: #999;
+	font-size: 12px;
+	// font-weight: 200;
+}
+
+.is-textarea {
+	align-items: flex-start;
+}
+
+.is-textarea-icon {
+	margin-top: 5px;
+}
+
+.uni-easyinput__content-textarea {
+	position: relative;
+	overflow: hidden;
+	flex: 1;
+	line-height: 1.5;
+	font-size: 14px;
+	margin: 6px;
+	margin-left: 0;
+	height: 80px;
+	min-height: 80px;
+	/* #ifndef APP-NVUE */
+	min-height: 80px;
+	width: auto;
+	/* #endif */
+}
+
+.input-padding {
+	padding-left: 10px;
+}
+
+.content-clear-icon {
+	padding: 0 5px;
+}
+
+.label-icon {
+	margin-right: 5px;
+	margin-top: -1px;
+}
+
+// 显示边框
+.is-input-border {
+	/* #ifndef APP-NVUE */
+	display: flex;
+	box-sizing: border-box;
+	/* #endif */
+	flex-direction: row;
+	align-items: center;
+	border: 1px solid $uni-border-1;
+	border-radius: 4px;
+	/* #ifdef MP-ALIPAY */
+	overflow: hidden;
+	/* #endif */
+}
+
+.uni-error-message {
+	position: absolute;
+	bottom: -17px;
+	left: 0;
+	line-height: 12px;
+	color: $uni-error;
+	font-size: 12px;
+	text-align: left;
+}
+
+.uni-error-msg--boeder {
+	position: relative;
+	bottom: 0;
+	line-height: 22px;
+}
+
+.is-input-error-border {
+	border-color: $uni-error;
+
+	.uni-easyinput__placeholder-class {
+		color: mix(#fff, $uni-error, 50%);
+	}
+}
+
+.uni-easyinput--border {
+	margin-bottom: 0;
+	padding: 10px 15px;
+	// padding-bottom: 0;
+	border-top: 1px #eee solid;
+}
+
+.uni-easyinput-error {
+	padding-bottom: 0;
+}
+
+.is-first-border {
+	/* #ifndef APP-NVUE */
+	border: none;
+	/* #endif */
+	/* #ifdef APP-NVUE */
+	border-width: 0;
+	/* #endif */
+}
+
+.is-disabled {
+	background-color: #f7f6f6;
+	color: #d5d5d5;
+
+	.uni-easyinput__placeholder-class {
+		color: #d5d5d5;
+		font-size: 12px;
+	}
+}
+</style>

+ 87 - 0
uni_modules/uni-easyinput/package.json

xqd
@@ -0,0 +1,87 @@
+{
+  "id": "uni-easyinput",
+  "displayName": "uni-easyinput 增强输入框",
+  "version": "1.1.12",
+  "description": "Easyinput 组件是对原生input组件的增强",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "input",
+    "uni-easyinput",
+    "输入框"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+"dcloudext": {
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+    "type": "component-vue"
+  },
+  "uni_modules": {
+    "dependencies": [
+			"uni-scss",
+      "uni-icons"
+    ],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

+ 11 - 0
uni_modules/uni-easyinput/readme.md

xqd
@@ -0,0 +1,11 @@
+
+
+### Easyinput 增强输入框
+> **组件名:uni-easyinput**
+> 代码块: `uEasyinput`
+
+
+easyinput 组件是对原生input组件的增强 ,是专门为配合表单组件[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)而设计的,easyinput 内置了边框,图标等,同时包含 input 所有功能
+
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-easyinput)
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 

+ 18 - 0
uni_modules/uni-icons/changelog.md

xqd
@@ -1,3 +1,21 @@
+## 2.0.9(2024-01-12)
+fix: 修复图标大小默认值错误的问题
+## 2.0.8(2023-12-14)
+- 修复 项目未使用 ts 情况下,打包报错的bug
+## 2.0.7(2023-12-14)
+- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
+## 2.0.6(2023-12-11)
+- 优化 兼容老版本icon类型,如 top ,bottom 等
+## 2.0.5(2023-12-11)
+- 优化 兼容老版本icon类型,如 top ,bottom 等
+## 2.0.4(2023-12-06)
+- 优化 uni-app x 下示例项目图标排序
+## 2.0.3(2023-12-06)
+- 修复 nvue下引入组件报错的bug
+## 2.0.2(2023-12-05)
+-优化 size 属性支持单位
+## 2.0.1(2023-12-05)
+- 新增 uni-app x 支持定义图标
 ## 1.3.5(2022-01-24)
 - 优化 size 属性可以传入不带单位的字符串数值
 ## 1.3.4(2022-01-24)

+ 91 - 0
uni_modules/uni-icons/components/uni-icons/uni-icons.uvue

xqd
@@ -0,0 +1,91 @@
+<template>
+	<text class="uni-icons" :style="styleObj">
+		<slot>{{unicode}}</slot>
+	</text>
+</template>
+
+<script>
+	import { fontData, IconsDataItem } from './uniicons_file'
+
+	/**
+	 * Icons 图标
+	 * @description 用于展示 icon 图标
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=28
+	 * @property {Number} size 图标大小
+	 * @property {String} type 图标图案,参考示例
+	 * @property {String} color 图标颜色
+	 * @property {String} customPrefix 自定义图标
+	 * @event {Function} click 点击 Icon 触发事件
+	 */
+	export default {
+		name: "uni-icons",
+		props: {
+			type: {
+				type: String,
+				default: ''
+			},
+			color: {
+				type: String,
+				default: '#333333'
+			},
+			size: {
+				type: Object,
+				default: 16
+			},
+			fontFamily: {
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {};
+		},
+		computed: {
+			unicode() : string {
+				let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
+				if (codes !== null) {
+					return codes.unicode
+				}
+				return ''
+			},
+			iconSize() : string {
+				const size = this.size
+				if (typeof size == 'string') {
+					const reg = /^[0-9]*$/g
+					return reg.test(size as string) ? '' + size + 'px' : '' + size;
+					// return '' + this.size
+				}
+				return this.getFontSize(size as number)
+			},
+			styleObj() : UTSJSONObject {
+				if (this.fontFamily !== '') {
+					return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
+				}
+				return { color: this.color, fontSize: this.iconSize }
+			}
+		},
+		created() { },
+		methods: {
+			/**
+			 * 字体大小
+			 */
+			getFontSize(size : number) : string {
+				return size + 'px';
+			},
+		},
+	}
+</script>
+
+<style scoped>
+	@font-face {
+		font-family: UniIconsFontFamily;
+		src: url('./uniicons.ttf');
+	}
+
+	.uni-icons {
+		font-family: UniIconsFontFamily;
+		font-size: 18px;
+		font-style: normal;
+		color: #333;
+	}
+</style>

+ 31 - 17
uni_modules/uni-icons/components/uni-icons/uni-icons.vue

xqd xqd xqd xqd xqd
@@ -1,24 +1,28 @@
 <template>
 	<!-- #ifdef APP-NVUE -->
-	<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
+	<text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
 	<!-- #endif -->
 	<!-- #ifndef APP-NVUE -->
-	<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
+	<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
+		<slot></slot>
+	</text>
 	<!-- #endif -->
 </template>
 
 <script>
-	import icons from './icons.js';
+	import { fontData } from './uniicons_file_vue.js';
+
 	const getVal = (val) => {
 		const reg = /^[0-9]*$/g
-		return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
-	} 
+		return (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;
+	}
+
 	// #ifdef APP-NVUE
 	var domModule = weex.requireModule('dom');
 	import iconUrl from './uniicons.ttf'
 	domModule.addRule('fontFace', {
 		'fontFamily': "uniicons",
-		'src': "url('"+iconUrl+"')"
+		'src': "url('" + iconUrl + "')"
 	});
 	// #endif
 
@@ -34,7 +38,7 @@
 	 */
 	export default {
 		name: 'UniIcons',
-		emits:['click'],
+		emits: ['click'],
 		props: {
 			type: {
 				type: String,
@@ -48,26 +52,36 @@
 				type: [Number, String],
 				default: 16
 			},
-			customPrefix:{
+			customPrefix: {
+				type: String,
+				default: ''
+			},
+			fontFamily: {
 				type: String,
 				default: ''
 			}
 		},
 		data() {
 			return {
-				icons: icons.glyphs
+				icons: fontData
 			}
 		},
-		computed:{
-			unicode(){
-				let code = this.icons.find(v=>v.font_class === this.type)
-				if(code){
-					return unescape(`%u${code.unicode}`)
+		computed: {
+			unicode() {
+				let code = this.icons.find(v => v.font_class === this.type)
+				if (code) {
+					return code.unicode
 				}
 				return ''
 			},
-			iconSize(){
+			iconSize() {
 				return getVal(this.size)
+			},
+			styleObj() {
+				if (this.fontFamily !== '') {
+					return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`
+				}
+				return `color: ${this.color}; font-size: ${this.iconSize};`
 			}
 		},
 		methods: {
@@ -81,9 +95,10 @@
 <style lang="scss">
 	/* #ifndef APP-NVUE */
 	@import './uniicons.css';
+
 	@font-face {
 		font-family: uniicons;
-		src: url('./uniicons.ttf') format('truetype');
+		src: url('./uniicons.ttf');
 	}
 
 	/* #endif */
@@ -92,5 +107,4 @@
 		text-decoration: none;
 		text-align: center;
 	}
-
 </style>

+ 32 - 31
uni_modules/uni-icons/components/uni-icons/uniicons.css

xqd xqd xqd xqd xqd xqd
@@ -1,3 +1,12 @@
+
+.uniui-cart-filled:before {
+  content: "\e6d0";
+}
+
+.uniui-gift-filled:before {
+  content: "\e6c4";
+}
+
 .uniui-color:before {
   content: "\e6cf";
 }
@@ -58,10 +67,6 @@
   content: "\e6c3";
 }
 
-.uniui-gift-filled:before {
-  content: "\e6c4";
-}
-
 .uniui-fire-filled:before {
   content: "\e6c5";
 }
@@ -82,6 +87,18 @@
   content: "\e698";
 }
 
+.uniui-arrowthinleft:before {
+  content: "\e6d2";
+}
+
+.uniui-arrowthinup:before {
+  content: "\e6d3";
+}
+
+.uniui-arrowthindown:before {
+  content: "\e6d4";
+}
+
 .uniui-back:before {
   content: "\e6b9";
 }
@@ -94,55 +111,43 @@
   content: "\e6bb";
 }
 
-.uniui-arrowthinright:before {
-  content: "\e6bb";
-}
-
 .uniui-arrow-left:before {
   content: "\e6bc";
 }
 
-.uniui-arrowthinleft:before {
-  content: "\e6bc";
-}
-
 .uniui-arrow-up:before {
   content: "\e6bd";
 }
 
-.uniui-arrowthinup:before {
-  content: "\e6bd";
-}
-
 .uniui-arrow-down:before {
   content: "\e6be";
 }
 
-.uniui-arrowthindown:before {
-  content: "\e6be";
+.uniui-arrowthinright:before {
+  content: "\e6d1";
 }
 
-.uniui-bottom:before {
+.uniui-down:before {
   content: "\e6b8";
 }
 
-.uniui-arrowdown:before {
+.uniui-bottom:before {
   content: "\e6b8";
 }
 
-.uniui-right:before {
-  content: "\e6b5";
+.uniui-arrowright:before {
+  content: "\e6d5";
 }
 
-.uniui-arrowright:before {
+.uniui-right:before {
   content: "\e6b5";
 }
 
-.uniui-top:before {
+.uniui-up:before {
   content: "\e6b6";
 }
 
-.uniui-arrowup:before {
+.uniui-top:before {
   content: "\e6b6";
 }
 
@@ -150,8 +155,8 @@
   content: "\e6b7";
 }
 
-.uniui-arrowleft:before {
-  content: "\e6b7";
+.uniui-arrowup:before {
+  content: "\e6d6";
 }
 
 .uniui-eye:before {
@@ -638,10 +643,6 @@
   content: "\e627";
 }
 
-.uniui-cart-filled:before {
-  content: "\e629";
-}
-
 .uniui-checkbox:before {
   content: "\e62b";
 }

BIN
uni_modules/uni-icons/components/uni-icons/uniicons.ttf


+ 664 - 0
uni_modules/uni-icons/components/uni-icons/uniicons_file.ts

xqd
@@ -0,0 +1,664 @@
+
+export type IconsData = {
+	id : string
+	name : string
+	font_family : string
+	css_prefix_text : string
+	description : string
+	glyphs : Array<IconsDataItem>
+}
+
+export type IconsDataItem = {
+	font_class : string
+	unicode : string
+}
+
+
+export const fontData = [
+  {
+    "font_class": "arrow-down",
+    "unicode": "\ue6be"
+  },
+  {
+    "font_class": "arrow-left",
+    "unicode": "\ue6bc"
+  },
+  {
+    "font_class": "arrow-right",
+    "unicode": "\ue6bb"
+  },
+  {
+    "font_class": "arrow-up",
+    "unicode": "\ue6bd"
+  },
+  {
+    "font_class": "auth",
+    "unicode": "\ue6ab"
+  },
+  {
+    "font_class": "auth-filled",
+    "unicode": "\ue6cc"
+  },
+  {
+    "font_class": "back",
+    "unicode": "\ue6b9"
+  },
+  {
+    "font_class": "bars",
+    "unicode": "\ue627"
+  },
+  {
+    "font_class": "calendar",
+    "unicode": "\ue6a0"
+  },
+  {
+    "font_class": "calendar-filled",
+    "unicode": "\ue6c0"
+  },
+  {
+    "font_class": "camera",
+    "unicode": "\ue65a"
+  },
+  {
+    "font_class": "camera-filled",
+    "unicode": "\ue658"
+  },
+  {
+    "font_class": "cart",
+    "unicode": "\ue631"
+  },
+  {
+    "font_class": "cart-filled",
+    "unicode": "\ue6d0"
+  },
+  {
+    "font_class": "chat",
+    "unicode": "\ue65d"
+  },
+  {
+    "font_class": "chat-filled",
+    "unicode": "\ue659"
+  },
+  {
+    "font_class": "chatboxes",
+    "unicode": "\ue696"
+  },
+  {
+    "font_class": "chatboxes-filled",
+    "unicode": "\ue692"
+  },
+  {
+    "font_class": "chatbubble",
+    "unicode": "\ue697"
+  },
+  {
+    "font_class": "chatbubble-filled",
+    "unicode": "\ue694"
+  },
+  {
+    "font_class": "checkbox",
+    "unicode": "\ue62b"
+  },
+  {
+    "font_class": "checkbox-filled",
+    "unicode": "\ue62c"
+  },
+  {
+    "font_class": "checkmarkempty",
+    "unicode": "\ue65c"
+  },
+  {
+    "font_class": "circle",
+    "unicode": "\ue65b"
+  },
+  {
+    "font_class": "circle-filled",
+    "unicode": "\ue65e"
+  },
+  {
+    "font_class": "clear",
+    "unicode": "\ue66d"
+  },
+  {
+    "font_class": "close",
+    "unicode": "\ue673"
+  },
+  {
+    "font_class": "closeempty",
+    "unicode": "\ue66c"
+  },
+  {
+    "font_class": "cloud-download",
+    "unicode": "\ue647"
+  },
+  {
+    "font_class": "cloud-download-filled",
+    "unicode": "\ue646"
+  },
+  {
+    "font_class": "cloud-upload",
+    "unicode": "\ue645"
+  },
+  {
+    "font_class": "cloud-upload-filled",
+    "unicode": "\ue648"
+  },
+  {
+    "font_class": "color",
+    "unicode": "\ue6cf"
+  },
+  {
+    "font_class": "color-filled",
+    "unicode": "\ue6c9"
+  },
+  {
+    "font_class": "compose",
+    "unicode": "\ue67f"
+  },
+  {
+    "font_class": "contact",
+    "unicode": "\ue693"
+  },
+  {
+    "font_class": "contact-filled",
+    "unicode": "\ue695"
+  },
+  {
+    "font_class": "down",
+    "unicode": "\ue6b8"
+  },
+	{
+	  "font_class": "bottom",
+	  "unicode": "\ue6b8"
+	},
+  {
+    "font_class": "download",
+    "unicode": "\ue68d"
+  },
+  {
+    "font_class": "download-filled",
+    "unicode": "\ue681"
+  },
+  {
+    "font_class": "email",
+    "unicode": "\ue69e"
+  },
+  {
+    "font_class": "email-filled",
+    "unicode": "\ue69a"
+  },
+  {
+    "font_class": "eye",
+    "unicode": "\ue651"
+  },
+  {
+    "font_class": "eye-filled",
+    "unicode": "\ue66a"
+  },
+  {
+    "font_class": "eye-slash",
+    "unicode": "\ue6b3"
+  },
+  {
+    "font_class": "eye-slash-filled",
+    "unicode": "\ue6b4"
+  },
+  {
+    "font_class": "fire",
+    "unicode": "\ue6a1"
+  },
+  {
+    "font_class": "fire-filled",
+    "unicode": "\ue6c5"
+  },
+  {
+    "font_class": "flag",
+    "unicode": "\ue65f"
+  },
+  {
+    "font_class": "flag-filled",
+    "unicode": "\ue660"
+  },
+  {
+    "font_class": "folder-add",
+    "unicode": "\ue6a9"
+  },
+  {
+    "font_class": "folder-add-filled",
+    "unicode": "\ue6c8"
+  },
+  {
+    "font_class": "font",
+    "unicode": "\ue6a3"
+  },
+  {
+    "font_class": "forward",
+    "unicode": "\ue6ba"
+  },
+  {
+    "font_class": "gear",
+    "unicode": "\ue664"
+  },
+  {
+    "font_class": "gear-filled",
+    "unicode": "\ue661"
+  },
+  {
+    "font_class": "gift",
+    "unicode": "\ue6a4"
+  },
+  {
+    "font_class": "gift-filled",
+    "unicode": "\ue6c4"
+  },
+  {
+    "font_class": "hand-down",
+    "unicode": "\ue63d"
+  },
+  {
+    "font_class": "hand-down-filled",
+    "unicode": "\ue63c"
+  },
+  {
+    "font_class": "hand-up",
+    "unicode": "\ue63f"
+  },
+  {
+    "font_class": "hand-up-filled",
+    "unicode": "\ue63e"
+  },
+  {
+    "font_class": "headphones",
+    "unicode": "\ue630"
+  },
+  {
+    "font_class": "heart",
+    "unicode": "\ue639"
+  },
+  {
+    "font_class": "heart-filled",
+    "unicode": "\ue641"
+  },
+  {
+    "font_class": "help",
+    "unicode": "\ue679"
+  },
+  {
+    "font_class": "help-filled",
+    "unicode": "\ue674"
+  },
+  {
+    "font_class": "home",
+    "unicode": "\ue662"
+  },
+  {
+    "font_class": "home-filled",
+    "unicode": "\ue663"
+  },
+  {
+    "font_class": "image",
+    "unicode": "\ue670"
+  },
+  {
+    "font_class": "image-filled",
+    "unicode": "\ue678"
+  },
+  {
+    "font_class": "images",
+    "unicode": "\ue650"
+  },
+  {
+    "font_class": "images-filled",
+    "unicode": "\ue64b"
+  },
+  {
+    "font_class": "info",
+    "unicode": "\ue669"
+  },
+  {
+    "font_class": "info-filled",
+    "unicode": "\ue649"
+  },
+  {
+    "font_class": "left",
+    "unicode": "\ue6b7"
+  },
+  {
+    "font_class": "link",
+    "unicode": "\ue6a5"
+  },
+  {
+    "font_class": "list",
+    "unicode": "\ue644"
+  },
+  {
+    "font_class": "location",
+    "unicode": "\ue6ae"
+  },
+  {
+    "font_class": "location-filled",
+    "unicode": "\ue6af"
+  },
+  {
+    "font_class": "locked",
+    "unicode": "\ue66b"
+  },
+  {
+    "font_class": "locked-filled",
+    "unicode": "\ue668"
+  },
+  {
+    "font_class": "loop",
+    "unicode": "\ue633"
+  },
+  {
+    "font_class": "mail-open",
+    "unicode": "\ue643"
+  },
+  {
+    "font_class": "mail-open-filled",
+    "unicode": "\ue63a"
+  },
+  {
+    "font_class": "map",
+    "unicode": "\ue667"
+  },
+  {
+    "font_class": "map-filled",
+    "unicode": "\ue666"
+  },
+  {
+    "font_class": "map-pin",
+    "unicode": "\ue6ad"
+  },
+  {
+    "font_class": "map-pin-ellipse",
+    "unicode": "\ue6ac"
+  },
+  {
+    "font_class": "medal",
+    "unicode": "\ue6a2"
+  },
+  {
+    "font_class": "medal-filled",
+    "unicode": "\ue6c3"
+  },
+  {
+    "font_class": "mic",
+    "unicode": "\ue671"
+  },
+  {
+    "font_class": "mic-filled",
+    "unicode": "\ue677"
+  },
+  {
+    "font_class": "micoff",
+    "unicode": "\ue67e"
+  },
+  {
+    "font_class": "micoff-filled",
+    "unicode": "\ue6b0"
+  },
+  {
+    "font_class": "minus",
+    "unicode": "\ue66f"
+  },
+  {
+    "font_class": "minus-filled",
+    "unicode": "\ue67d"
+  },
+  {
+    "font_class": "more",
+    "unicode": "\ue64d"
+  },
+  {
+    "font_class": "more-filled",
+    "unicode": "\ue64e"
+  },
+  {
+    "font_class": "navigate",
+    "unicode": "\ue66e"
+  },
+  {
+    "font_class": "navigate-filled",
+    "unicode": "\ue67a"
+  },
+  {
+    "font_class": "notification",
+    "unicode": "\ue6a6"
+  },
+  {
+    "font_class": "notification-filled",
+    "unicode": "\ue6c1"
+  },
+  {
+    "font_class": "paperclip",
+    "unicode": "\ue652"
+  },
+  {
+    "font_class": "paperplane",
+    "unicode": "\ue672"
+  },
+  {
+    "font_class": "paperplane-filled",
+    "unicode": "\ue675"
+  },
+  {
+    "font_class": "person",
+    "unicode": "\ue699"
+  },
+  {
+    "font_class": "person-filled",
+    "unicode": "\ue69d"
+  },
+  {
+    "font_class": "personadd",
+    "unicode": "\ue69f"
+  },
+  {
+    "font_class": "personadd-filled",
+    "unicode": "\ue698"
+  },
+  {
+    "font_class": "personadd-filled-copy",
+    "unicode": "\ue6d1"
+  },
+  {
+    "font_class": "phone",
+    "unicode": "\ue69c"
+  },
+  {
+    "font_class": "phone-filled",
+    "unicode": "\ue69b"
+  },
+  {
+    "font_class": "plus",
+    "unicode": "\ue676"
+  },
+  {
+    "font_class": "plus-filled",
+    "unicode": "\ue6c7"
+  },
+  {
+    "font_class": "plusempty",
+    "unicode": "\ue67b"
+  },
+  {
+    "font_class": "pulldown",
+    "unicode": "\ue632"
+  },
+  {
+    "font_class": "pyq",
+    "unicode": "\ue682"
+  },
+  {
+    "font_class": "qq",
+    "unicode": "\ue680"
+  },
+  {
+    "font_class": "redo",
+    "unicode": "\ue64a"
+  },
+  {
+    "font_class": "redo-filled",
+    "unicode": "\ue655"
+  },
+  {
+    "font_class": "refresh",
+    "unicode": "\ue657"
+  },
+  {
+    "font_class": "refresh-filled",
+    "unicode": "\ue656"
+  },
+  {
+    "font_class": "refreshempty",
+    "unicode": "\ue6bf"
+  },
+  {
+    "font_class": "reload",
+    "unicode": "\ue6b2"
+  },
+  {
+    "font_class": "right",
+    "unicode": "\ue6b5"
+  },
+  {
+    "font_class": "scan",
+    "unicode": "\ue62a"
+  },
+  {
+    "font_class": "search",
+    "unicode": "\ue654"
+  },
+  {
+    "font_class": "settings",
+    "unicode": "\ue653"
+  },
+  {
+    "font_class": "settings-filled",
+    "unicode": "\ue6ce"
+  },
+  {
+    "font_class": "shop",
+    "unicode": "\ue62f"
+  },
+  {
+    "font_class": "shop-filled",
+    "unicode": "\ue6cd"
+  },
+  {
+    "font_class": "smallcircle",
+    "unicode": "\ue67c"
+  },
+  {
+    "font_class": "smallcircle-filled",
+    "unicode": "\ue665"
+  },
+  {
+    "font_class": "sound",
+    "unicode": "\ue684"
+  },
+  {
+    "font_class": "sound-filled",
+    "unicode": "\ue686"
+  },
+  {
+    "font_class": "spinner-cycle",
+    "unicode": "\ue68a"
+  },
+  {
+    "font_class": "staff",
+    "unicode": "\ue6a7"
+  },
+  {
+    "font_class": "staff-filled",
+    "unicode": "\ue6cb"
+  },
+  {
+    "font_class": "star",
+    "unicode": "\ue688"
+  },
+  {
+    "font_class": "star-filled",
+    "unicode": "\ue68f"
+  },
+  {
+    "font_class": "starhalf",
+    "unicode": "\ue683"
+  },
+  {
+    "font_class": "trash",
+    "unicode": "\ue687"
+  },
+  {
+    "font_class": "trash-filled",
+    "unicode": "\ue685"
+  },
+  {
+    "font_class": "tune",
+    "unicode": "\ue6aa"
+  },
+  {
+    "font_class": "tune-filled",
+    "unicode": "\ue6ca"
+  },
+  {
+    "font_class": "undo",
+    "unicode": "\ue64f"
+  },
+  {
+    "font_class": "undo-filled",
+    "unicode": "\ue64c"
+  },
+  {
+    "font_class": "up",
+    "unicode": "\ue6b6"
+  },
+	{
+	  "font_class": "top",
+	  "unicode": "\ue6b6"
+	},
+  {
+    "font_class": "upload",
+    "unicode": "\ue690"
+  },
+  {
+    "font_class": "upload-filled",
+    "unicode": "\ue68e"
+  },
+  {
+    "font_class": "videocam",
+    "unicode": "\ue68c"
+  },
+  {
+    "font_class": "videocam-filled",
+    "unicode": "\ue689"
+  },
+  {
+    "font_class": "vip",
+    "unicode": "\ue6a8"
+  },
+  {
+    "font_class": "vip-filled",
+    "unicode": "\ue6c6"
+  },
+  {
+    "font_class": "wallet",
+    "unicode": "\ue6b1"
+  },
+  {
+    "font_class": "wallet-filled",
+    "unicode": "\ue6c2"
+  },
+  {
+    "font_class": "weibo",
+    "unicode": "\ue68b"
+  },
+  {
+    "font_class": "weixin",
+    "unicode": "\ue691"
+  }
+] as IconsDataItem[]
+
+// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)

+ 649 - 0
uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js

xqd
@@ -0,0 +1,649 @@
+
+export const fontData = [
+  {
+    "font_class": "arrow-down",
+    "unicode": "\ue6be"
+  },
+  {
+    "font_class": "arrow-left",
+    "unicode": "\ue6bc"
+  },
+  {
+    "font_class": "arrow-right",
+    "unicode": "\ue6bb"
+  },
+  {
+    "font_class": "arrow-up",
+    "unicode": "\ue6bd"
+  },
+  {
+    "font_class": "auth",
+    "unicode": "\ue6ab"
+  },
+  {
+    "font_class": "auth-filled",
+    "unicode": "\ue6cc"
+  },
+  {
+    "font_class": "back",
+    "unicode": "\ue6b9"
+  },
+  {
+    "font_class": "bars",
+    "unicode": "\ue627"
+  },
+  {
+    "font_class": "calendar",
+    "unicode": "\ue6a0"
+  },
+  {
+    "font_class": "calendar-filled",
+    "unicode": "\ue6c0"
+  },
+  {
+    "font_class": "camera",
+    "unicode": "\ue65a"
+  },
+  {
+    "font_class": "camera-filled",
+    "unicode": "\ue658"
+  },
+  {
+    "font_class": "cart",
+    "unicode": "\ue631"
+  },
+  {
+    "font_class": "cart-filled",
+    "unicode": "\ue6d0"
+  },
+  {
+    "font_class": "chat",
+    "unicode": "\ue65d"
+  },
+  {
+    "font_class": "chat-filled",
+    "unicode": "\ue659"
+  },
+  {
+    "font_class": "chatboxes",
+    "unicode": "\ue696"
+  },
+  {
+    "font_class": "chatboxes-filled",
+    "unicode": "\ue692"
+  },
+  {
+    "font_class": "chatbubble",
+    "unicode": "\ue697"
+  },
+  {
+    "font_class": "chatbubble-filled",
+    "unicode": "\ue694"
+  },
+  {
+    "font_class": "checkbox",
+    "unicode": "\ue62b"
+  },
+  {
+    "font_class": "checkbox-filled",
+    "unicode": "\ue62c"
+  },
+  {
+    "font_class": "checkmarkempty",
+    "unicode": "\ue65c"
+  },
+  {
+    "font_class": "circle",
+    "unicode": "\ue65b"
+  },
+  {
+    "font_class": "circle-filled",
+    "unicode": "\ue65e"
+  },
+  {
+    "font_class": "clear",
+    "unicode": "\ue66d"
+  },
+  {
+    "font_class": "close",
+    "unicode": "\ue673"
+  },
+  {
+    "font_class": "closeempty",
+    "unicode": "\ue66c"
+  },
+  {
+    "font_class": "cloud-download",
+    "unicode": "\ue647"
+  },
+  {
+    "font_class": "cloud-download-filled",
+    "unicode": "\ue646"
+  },
+  {
+    "font_class": "cloud-upload",
+    "unicode": "\ue645"
+  },
+  {
+    "font_class": "cloud-upload-filled",
+    "unicode": "\ue648"
+  },
+  {
+    "font_class": "color",
+    "unicode": "\ue6cf"
+  },
+  {
+    "font_class": "color-filled",
+    "unicode": "\ue6c9"
+  },
+  {
+    "font_class": "compose",
+    "unicode": "\ue67f"
+  },
+  {
+    "font_class": "contact",
+    "unicode": "\ue693"
+  },
+  {
+    "font_class": "contact-filled",
+    "unicode": "\ue695"
+  },
+  {
+    "font_class": "down",
+    "unicode": "\ue6b8"
+  },
+	{
+	  "font_class": "bottom",
+	  "unicode": "\ue6b8"
+	},
+  {
+    "font_class": "download",
+    "unicode": "\ue68d"
+  },
+  {
+    "font_class": "download-filled",
+    "unicode": "\ue681"
+  },
+  {
+    "font_class": "email",
+    "unicode": "\ue69e"
+  },
+  {
+    "font_class": "email-filled",
+    "unicode": "\ue69a"
+  },
+  {
+    "font_class": "eye",
+    "unicode": "\ue651"
+  },
+  {
+    "font_class": "eye-filled",
+    "unicode": "\ue66a"
+  },
+  {
+    "font_class": "eye-slash",
+    "unicode": "\ue6b3"
+  },
+  {
+    "font_class": "eye-slash-filled",
+    "unicode": "\ue6b4"
+  },
+  {
+    "font_class": "fire",
+    "unicode": "\ue6a1"
+  },
+  {
+    "font_class": "fire-filled",
+    "unicode": "\ue6c5"
+  },
+  {
+    "font_class": "flag",
+    "unicode": "\ue65f"
+  },
+  {
+    "font_class": "flag-filled",
+    "unicode": "\ue660"
+  },
+  {
+    "font_class": "folder-add",
+    "unicode": "\ue6a9"
+  },
+  {
+    "font_class": "folder-add-filled",
+    "unicode": "\ue6c8"
+  },
+  {
+    "font_class": "font",
+    "unicode": "\ue6a3"
+  },
+  {
+    "font_class": "forward",
+    "unicode": "\ue6ba"
+  },
+  {
+    "font_class": "gear",
+    "unicode": "\ue664"
+  },
+  {
+    "font_class": "gear-filled",
+    "unicode": "\ue661"
+  },
+  {
+    "font_class": "gift",
+    "unicode": "\ue6a4"
+  },
+  {
+    "font_class": "gift-filled",
+    "unicode": "\ue6c4"
+  },
+  {
+    "font_class": "hand-down",
+    "unicode": "\ue63d"
+  },
+  {
+    "font_class": "hand-down-filled",
+    "unicode": "\ue63c"
+  },
+  {
+    "font_class": "hand-up",
+    "unicode": "\ue63f"
+  },
+  {
+    "font_class": "hand-up-filled",
+    "unicode": "\ue63e"
+  },
+  {
+    "font_class": "headphones",
+    "unicode": "\ue630"
+  },
+  {
+    "font_class": "heart",
+    "unicode": "\ue639"
+  },
+  {
+    "font_class": "heart-filled",
+    "unicode": "\ue641"
+  },
+  {
+    "font_class": "help",
+    "unicode": "\ue679"
+  },
+  {
+    "font_class": "help-filled",
+    "unicode": "\ue674"
+  },
+  {
+    "font_class": "home",
+    "unicode": "\ue662"
+  },
+  {
+    "font_class": "home-filled",
+    "unicode": "\ue663"
+  },
+  {
+    "font_class": "image",
+    "unicode": "\ue670"
+  },
+  {
+    "font_class": "image-filled",
+    "unicode": "\ue678"
+  },
+  {
+    "font_class": "images",
+    "unicode": "\ue650"
+  },
+  {
+    "font_class": "images-filled",
+    "unicode": "\ue64b"
+  },
+  {
+    "font_class": "info",
+    "unicode": "\ue669"
+  },
+  {
+    "font_class": "info-filled",
+    "unicode": "\ue649"
+  },
+  {
+    "font_class": "left",
+    "unicode": "\ue6b7"
+  },
+  {
+    "font_class": "link",
+    "unicode": "\ue6a5"
+  },
+  {
+    "font_class": "list",
+    "unicode": "\ue644"
+  },
+  {
+    "font_class": "location",
+    "unicode": "\ue6ae"
+  },
+  {
+    "font_class": "location-filled",
+    "unicode": "\ue6af"
+  },
+  {
+    "font_class": "locked",
+    "unicode": "\ue66b"
+  },
+  {
+    "font_class": "locked-filled",
+    "unicode": "\ue668"
+  },
+  {
+    "font_class": "loop",
+    "unicode": "\ue633"
+  },
+  {
+    "font_class": "mail-open",
+    "unicode": "\ue643"
+  },
+  {
+    "font_class": "mail-open-filled",
+    "unicode": "\ue63a"
+  },
+  {
+    "font_class": "map",
+    "unicode": "\ue667"
+  },
+  {
+    "font_class": "map-filled",
+    "unicode": "\ue666"
+  },
+  {
+    "font_class": "map-pin",
+    "unicode": "\ue6ad"
+  },
+  {
+    "font_class": "map-pin-ellipse",
+    "unicode": "\ue6ac"
+  },
+  {
+    "font_class": "medal",
+    "unicode": "\ue6a2"
+  },
+  {
+    "font_class": "medal-filled",
+    "unicode": "\ue6c3"
+  },
+  {
+    "font_class": "mic",
+    "unicode": "\ue671"
+  },
+  {
+    "font_class": "mic-filled",
+    "unicode": "\ue677"
+  },
+  {
+    "font_class": "micoff",
+    "unicode": "\ue67e"
+  },
+  {
+    "font_class": "micoff-filled",
+    "unicode": "\ue6b0"
+  },
+  {
+    "font_class": "minus",
+    "unicode": "\ue66f"
+  },
+  {
+    "font_class": "minus-filled",
+    "unicode": "\ue67d"
+  },
+  {
+    "font_class": "more",
+    "unicode": "\ue64d"
+  },
+  {
+    "font_class": "more-filled",
+    "unicode": "\ue64e"
+  },
+  {
+    "font_class": "navigate",
+    "unicode": "\ue66e"
+  },
+  {
+    "font_class": "navigate-filled",
+    "unicode": "\ue67a"
+  },
+  {
+    "font_class": "notification",
+    "unicode": "\ue6a6"
+  },
+  {
+    "font_class": "notification-filled",
+    "unicode": "\ue6c1"
+  },
+  {
+    "font_class": "paperclip",
+    "unicode": "\ue652"
+  },
+  {
+    "font_class": "paperplane",
+    "unicode": "\ue672"
+  },
+  {
+    "font_class": "paperplane-filled",
+    "unicode": "\ue675"
+  },
+  {
+    "font_class": "person",
+    "unicode": "\ue699"
+  },
+  {
+    "font_class": "person-filled",
+    "unicode": "\ue69d"
+  },
+  {
+    "font_class": "personadd",
+    "unicode": "\ue69f"
+  },
+  {
+    "font_class": "personadd-filled",
+    "unicode": "\ue698"
+  },
+  {
+    "font_class": "personadd-filled-copy",
+    "unicode": "\ue6d1"
+  },
+  {
+    "font_class": "phone",
+    "unicode": "\ue69c"
+  },
+  {
+    "font_class": "phone-filled",
+    "unicode": "\ue69b"
+  },
+  {
+    "font_class": "plus",
+    "unicode": "\ue676"
+  },
+  {
+    "font_class": "plus-filled",
+    "unicode": "\ue6c7"
+  },
+  {
+    "font_class": "plusempty",
+    "unicode": "\ue67b"
+  },
+  {
+    "font_class": "pulldown",
+    "unicode": "\ue632"
+  },
+  {
+    "font_class": "pyq",
+    "unicode": "\ue682"
+  },
+  {
+    "font_class": "qq",
+    "unicode": "\ue680"
+  },
+  {
+    "font_class": "redo",
+    "unicode": "\ue64a"
+  },
+  {
+    "font_class": "redo-filled",
+    "unicode": "\ue655"
+  },
+  {
+    "font_class": "refresh",
+    "unicode": "\ue657"
+  },
+  {
+    "font_class": "refresh-filled",
+    "unicode": "\ue656"
+  },
+  {
+    "font_class": "refreshempty",
+    "unicode": "\ue6bf"
+  },
+  {
+    "font_class": "reload",
+    "unicode": "\ue6b2"
+  },
+  {
+    "font_class": "right",
+    "unicode": "\ue6b5"
+  },
+  {
+    "font_class": "scan",
+    "unicode": "\ue62a"
+  },
+  {
+    "font_class": "search",
+    "unicode": "\ue654"
+  },
+  {
+    "font_class": "settings",
+    "unicode": "\ue653"
+  },
+  {
+    "font_class": "settings-filled",
+    "unicode": "\ue6ce"
+  },
+  {
+    "font_class": "shop",
+    "unicode": "\ue62f"
+  },
+  {
+    "font_class": "shop-filled",
+    "unicode": "\ue6cd"
+  },
+  {
+    "font_class": "smallcircle",
+    "unicode": "\ue67c"
+  },
+  {
+    "font_class": "smallcircle-filled",
+    "unicode": "\ue665"
+  },
+  {
+    "font_class": "sound",
+    "unicode": "\ue684"
+  },
+  {
+    "font_class": "sound-filled",
+    "unicode": "\ue686"
+  },
+  {
+    "font_class": "spinner-cycle",
+    "unicode": "\ue68a"
+  },
+  {
+    "font_class": "staff",
+    "unicode": "\ue6a7"
+  },
+  {
+    "font_class": "staff-filled",
+    "unicode": "\ue6cb"
+  },
+  {
+    "font_class": "star",
+    "unicode": "\ue688"
+  },
+  {
+    "font_class": "star-filled",
+    "unicode": "\ue68f"
+  },
+  {
+    "font_class": "starhalf",
+    "unicode": "\ue683"
+  },
+  {
+    "font_class": "trash",
+    "unicode": "\ue687"
+  },
+  {
+    "font_class": "trash-filled",
+    "unicode": "\ue685"
+  },
+  {
+    "font_class": "tune",
+    "unicode": "\ue6aa"
+  },
+  {
+    "font_class": "tune-filled",
+    "unicode": "\ue6ca"
+  },
+  {
+    "font_class": "undo",
+    "unicode": "\ue64f"
+  },
+  {
+    "font_class": "undo-filled",
+    "unicode": "\ue64c"
+  },
+  {
+    "font_class": "up",
+    "unicode": "\ue6b6"
+  },
+	{
+	  "font_class": "top",
+	  "unicode": "\ue6b6"
+	},
+  {
+    "font_class": "upload",
+    "unicode": "\ue690"
+  },
+  {
+    "font_class": "upload-filled",
+    "unicode": "\ue68e"
+  },
+  {
+    "font_class": "videocam",
+    "unicode": "\ue68c"
+  },
+  {
+    "font_class": "videocam-filled",
+    "unicode": "\ue689"
+  },
+  {
+    "font_class": "vip",
+    "unicode": "\ue6a8"
+  },
+  {
+    "font_class": "vip-filled",
+    "unicode": "\ue6c6"
+  },
+  {
+    "font_class": "wallet",
+    "unicode": "\ue6b1"
+  },
+  {
+    "font_class": "wallet-filled",
+    "unicode": "\ue6c2"
+  },
+  {
+    "font_class": "weibo",
+    "unicode": "\ue68b"
+  },
+  {
+    "font_class": "weixin",
+    "unicode": "\ue691"
+  }
+]
+
+// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)

+ 14 - 12
uni_modules/uni-icons/package.json

xqd xqd xqd xqd xqd xqd
@@ -1,7 +1,7 @@
 {
   "id": "uni-icons",
   "displayName": "uni-icons 图标",
-  "version": "1.3.5",
+  "version": "2.0.9",
   "description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
   "keywords": [
     "uni-ui",
@@ -16,11 +16,7 @@
   "directories": {
     "example": "../../temps/example_temps"
   },
-  "dcloudext": {
-    "category": [
-      "前端组件",
-      "通用组件"
-    ],
+"dcloudext": {
     "sale": {
       "regular": {
         "price": "0.00"
@@ -37,7 +33,8 @@
       "data": "无",
       "permissions": "无"
     },
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+    "type": "component-vue"
   },
   "uni_modules": {
     "dependencies": ["uni-scss"],
@@ -50,7 +47,8 @@
       "client": {
         "App": {
           "app-vue": "y",
-          "app-nvue": "y"
+          "app-nvue": "y",
+          "app-uvue": "y"
         },
         "H5-mobile": {
           "Safari": "y",
@@ -70,11 +68,15 @@
           "阿里": "y",
           "百度": "y",
           "字节跳动": "y",
-          "QQ": "y"
+          "QQ": "y",
+					"钉钉": "y",
+					"快手": "y",
+					"飞书": "y",
+					"京东": "y"
         },
         "快应用": {
-          "华为": "u",
-          "联盟": "u"
+          "华为": "y",
+          "联盟": "y"
         },
         "Vue": {
             "vue2": "y",
@@ -83,4 +85,4 @@
       }
     }
   }
-}
+}