123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <template>
- <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
- <cus-header title='角色详情' bgColor="transparent"></cus-header>
- <div class="box">
- <div class="title adfac">角色形象</div>
- <div class="upload">
- <div class="sc">
- <div class="imgs">
- <image class="img1" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/05/29/44f91a62-29c1-4d1f-8064-0d7579da2fb0.png"></image>
- </div>
- </div>
- </div>
- </div>
- <div class="box adfacjb">
- <div class="title">角色昵称</div>
- <input type="text" v-model="agentDto.agentName" placeholder="请输入角色昵称" placeholder-class="ph" disabled>
- </div>
- <div class="box">
- <div class="top adfacjb">
- <div class="title">设定描述</div>
- </div>
- <div class="desc"><u-textarea v-model="agentDto.systemPrompt" :focus="focus" autoHeight :maxlength="-1" border="none" disabled></u-textarea>
- </div>
- </div>
- <div class="box adfacjb">
- <div class="title">声音</div>
- <div class="right adfac" @tap="show=true">
- <div class="mtext active">{{voiceText}}</div>
- </div>
- </div>
- </view>
- </template>
- <script>
- export default {
- data(){
- return {
- agentId:'',
- deviceId:'',
- voiceText:'',
- agentDto:{
- "agentName": "",
- "asrModelId": "",
- "vadModelId": "",
- "llmModelId": "",
- "ttsModelId": "",
- "ttsVoiceId": "",
- "memModelId": "",
- "intentModelId": "",
- "systemPrompt": "",
- "langCode": "",
- "language": "",
- "deviceId": "",
- "chatHistoryConf": ""
- }
- }
- },
- onLoad(option) {
- if(option.agentId){
- this.agentId = option.agentId;
- this.getDetail();
- }
- },
- methods:{
- getDetail(){
- this.$api.get(`/agent/${this.agentId}`).then(res=>{
- if(res.data.code!==0) return this.$showToast(res.data.msg)
- this.agentDto = {...this.agentDto,...res.data.data};
- this.getModelVoiceList();
- })
- },
- getModelVoiceList(){
- this.$api.get(`/models/${this.agentDto.ttsModelId}/voices`).then(res=>{
- if(res.data.code!==0) return this.$showToast(res.data.msg)
- this.voiceText = res.data.data.find(v=>v.id===this.agentDto.ttsVoiceId)?.name||'未选择音色';
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- ::v-deep .desc .u-textarea{
- padding: 0 !important;
- background-color: transparent !important;
- }
-
- .ph{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #A6A6A6;
- line-height: 40rpx;
- text-align: right;
- }
- .page{
- background: #F7F6F9;
- padding: 0 30rpx 30rpx;
- box-sizing: border-box;
- .box{
- background: #FFFFFF;
- border-radius: 24rpx;
- margin-top: 20rpx;
- width: 100%;
- padding: 40rpx 30rpx;
- box-sizing: border-box;
-
- .title{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 30rpx;
- color: #111111;
- line-height: 32rpx;
- span{
- font-size: 32rpx;
- color: #F31616;
- }
- }
- .upload{
- margin-top: 12rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- .sc{
- width: 188rpx;
- height: 188rpx;
- }
- .text{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: #A6A6A6;
- line-height: 37rpx;
- text-align: center;
- margin-top: 8rpx;
- }
- }
- .right{
- .mtext{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #A6A6A6;
- line-height: 40rpx;
- text-align: right;
- &.active{
- color: #111111;
- }
- }
- image{
- width: 36rpx;
- height: 36rpx;
- margin-left: 10rpx;
- }
- }
- .desc{
- margin-top: 20rpx;
- min-height: 200rpx;
- overflow-y: auto;
- }
- .tip{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #1B50FF;
- line-height: 40rpx;
- text-align: right;
- }
- .imgs{
- width: 188rpx;
- height: 188rpx;
- border-radius: 50%;
- position: relative;
- .img1{
- width: 188rpx;
- height: 188rpx;
- border-radius: 50%;
- position: absolute;
- z-index: 2;
- }
- .img2{
- width: 42rpx;
- height: 42rpx;
- position: absolute;
- right: 0;
- bottom: 0;
- z-index: 3;
- }
- }
- }
- .zt_btn{
- margin-top: 54rpx;
- }
- input{
- border: none;
- text-align: right;
- font-size: 28rpx;
- }
- }
- </style>
|