小助理

This commit is contained in:
liuye
2024-08-22 14:27:07 +08:00
parent 59d9cbeb10
commit 5b5f87afc3
10 changed files with 190 additions and 108 deletions

View File

@@ -4,18 +4,18 @@
<!-- <scroll-view scroll-y="true" class="scroll-Y" @scroll="scroll"> -->
<div class="top-fixed">
<div class="top-select" @click="showType=true">
{{aiConfigName || '选择应用'}} <u-icon name="arrow-down" color="#fff" size="28"></u-icon>
{{aiConfigName || '选择应用'}} <u-icon name="arrow-down" color="#0052F5" size="28"></u-icon>
</div>
<p>已切换至{{aiConfigName}}大模型</p>
<!-- <p>已切换至{{aiConfigName}}大模型</p> -->
</div>
<div class="service-content" v-if="!messageList.length">
<div class="text-content">
<div class="text-left">
<div>你好呀</div>
<p>我是您的<span>Copilot小助理</span></p>
<p>有什么问题都可以问我哟~</p>
<div>我是忠小卫</div>
<p>你最忠诚的AI搭档</p>
<p>说出你的诉求我们一起想办法</p>
</div>
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/service.png" alt="" class="service-img">
<!-- <img src="https://cdn.sinoecare.com/i/2024/08/22/66c69f4ea77c5.png" alt="" class="service-img"> -->
</div>
</div>
<div class="list-bg" v-if="messageList.length"></div>
@@ -63,7 +63,7 @@
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/question-icon.png" alt="">登录
</div> -->
<button class="login-btn" open-type="getPhoneNumber" @getphonenumber="handleAdminLogin" v-if="!token">
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/question-icon.png" alt="">登录
<img src="https://cdn.sinoecare.com/i/2024/08/22/66c69f4e2a281.png" alt="">登录
</button>
<u-select v-model="showType" :list="typeList" value-name="dictValue"
label-name="dictName" @confirm="confirmType"></u-select>
@@ -87,6 +87,7 @@
<div class="load-content" v-if="showLoad">
<img src="https://cdn.sinoecare.com/i/2024/08/07/66b2cfd4d220d.gif" alt="">
</div>
<img src="https://cdn.sinoecare.com/i/2024/08/22/66c69f4d33eb1.png" alt="" class="bg-center">
</div>
</template>
<script>
@@ -105,7 +106,7 @@ export default {
data() {
return {
backgroundNavbar: {
background: 'url(https://cdn.sinoecare.com/i/2024/08/06/66b1c9696650b.png) no-repeat',
background: 'url(https://cdn.sinoecare.com/i/2024/08/22/66c6b43796377.jpg) no-repeat',
backgroundSize: 'cover',
},
recorderManager: null,
@@ -257,7 +258,14 @@ export default {
}
// this.$loading()
this.showLoad = true
this.$instance.post("/app/appaicopilotinfo/add", {sdkFileUrl: this.voiceUrl, fileId: this.voiceId, appType: 0, aiConfigId: this.aiConfigId}).then(res => {
this.$instance.post("/app/appaicopilotinfo/add", {
sdkFileUrl: this.voiceUrl,
fileId: this.voiceId,
appType: 0,
aiConfigId: this.aiConfigId,
supplementContent:
this.latLng
}).then(res => {
if(res.code == 0) {
this.voiceUrl = ''
this.voiceId = ''
@@ -286,7 +294,7 @@ export default {
// this.$loading()
this.showLoad = true
this.$instance.post(`/app/appaicopilotinfo/list?current=${this.current}&size=10&aiConfigId=${this.aiConfigId}`).then(res => {
if(res.code == 0 && res.data.records.length) {
if(res?.code == 0) {
res.data.records.map((item) => {
if(item.sdkFileUrl) {
item.isPlay = false
@@ -300,10 +308,10 @@ export default {
selector: this.current == 1 ? `.item${this.messageList.length-1}` : `.item${idPage}`
});
})
this.pages = res.data.pages
// this.$hideLoading()
this.showLoad = false
return this.pages = res.data.pages
}
}).finally(()=> {
this.showLoad = false
})
},
play(src, index) {
@@ -361,7 +369,7 @@ export default {
},
getAiTypeList() {
this.$instance.post(`/app/appaiconfiginfo/list?status=1`).then(res => {
if(res.code == 0) {
if(res?.code == 0) {
res.data.records.map((item) => {
item.dictName = item.appName
item.dictValue = item.id
@@ -375,6 +383,8 @@ export default {
this.latLng = ''
}
// this.getHistoryList()
}else{
this.$store.commit('logout', true)
}
})
},
@@ -431,10 +441,10 @@ page {
position: fixed;
left: 0;
z-index: 9;
background-image: url('https://cdn.sinoecare.com/i/2024/07/15/6694f173557c9.png');
background-size: 100vw;
background-image: url('https://cdn.sinoecare.com/i/2024/08/22/66c6b37f1c07d.jpg');
background-size: 100% 100%;
background-repeat: no-repeat;
padding-left: 28px;
padding: 16px 0 16px 28px;
box-sizing: border-box;
p {
font-family: PingFangSC-Regular;
@@ -448,60 +458,69 @@ page {
}
.top-select {
display: inline-block;
line-height: 64px;
background: #026AF2;
border-radius: 32px;
text-align: center;
padding: 0 24px;
font-family: PingFangSC-Medium;
font-weight: 500;
// line-height: 64px;
// background: #026AF2;
// border-radius: 32px;
// text-align: center;
// padding: 0 24px;
// font-family: PingFangSC-Medium;
// font-weight: 500;
// font-size: 28px;
// color: #FFF;
line-height: 66px;
height: 68px;
background: #fff;
border: 1px solid #528CFF;
border-radius: 34px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28px;
color: #FFF;
color: #0052F5;
padding: 0 24px;
box-sizing: border-box;
u-icon {
margin-left: 8px;
margin-left: 4px;
}
}
.service-content {
width: 100%;
height: 420px;
background-image: url("https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/content-top-bg.png");
background-size: 100vw;
background-image: url("https://cdn.sinoecare.com/i/2024/08/22/66c6b4384635e.jpg");
background-size: 100% 100%;
background-repeat: no-repeat;
padding-top: 138px;
margin-top: 100px;
box-sizing: border-box;
padding-top: 12px;
.text-content {
margin: 0 0 0 32px;
width: 686px;
height: 260px;
background-image: url("https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/service-content-bg.png");
background-size: 100vw;
background-image: url("https://cdn.sinoecare.com/i/2024/08/22/66c69f4ea77c5.png");
background-size: 100% 100%;;
background-repeat: no-repeat;
padding: 32px;
box-sizing: border-box;
border-radius: 32px;
display: flex;
justify-content: space-between;
.text-left {
width: calc(100% - 192px);
div {
line-height: 54px;
font-family: SourceHanSansCN-Bold;
font-weight: 700;
font-size: 36px;
// background: linear-gradient(to bottom, #2A6EE9, #58A5F7);
// -webkit-background-clip: text;
// -webkit-text-fill-color: transparent;
margin-bottom: 16px;
line-height: 56px;
font-family: PingFangSC-SNaNpxibold;
font-weight: 600;
font-size: 40px;
background-image: linear-gradient(to right, #F57A00, #FFAA00);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 12px;
}
p {
color: #222;
height: 44px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28px;
font-family: SourceHanSansCN;
line-height: 44px;
span {
display: inline-block;
font-weight: 700;
}
color: #222;
}
}
.service-img {
@@ -514,13 +533,13 @@ page {
}
.list-bg {
width: 100%;
height: 420px;
background-image: url("https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/content-top-bg.png");
height: 320px;
background-image: url("https://cdn.sinoecare.com/i/2024/08/22/66c6b4384635e.jpg");
position: fixed;
left: 0;
z-index: 1;
background-size: 100vw;
background-size: 100% 100%;
background-repeat: no-repeat;
margin-top: 100px;
}
.list-content {
width: 100%;
@@ -767,5 +786,13 @@ page {
}
}
.bg-center {
position: fixed;
top: 50%;
left: 50%;
width: 306px;
height: 364px;
margin: -182px 0 0 -153px;
}
}
</style>