小助理

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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,8 +1,7 @@
<template>
<div class="AppMy">
<u-navbar title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar" :is-back="false"></u-navbar>
<div class="my-bg"></div>
<div class="my-content">
<div class="my-bg">
<div class="user-info">
<div class="user-left">
<img :src="user.avatarUrl" alt="" class="user-img" v-if="user.avatarUrl">
@@ -13,6 +12,9 @@
<div>{{user.departmentName || ''}}</div>
</div>
</div>
</div>
<div class="my-content">
<!-- <div class="app-list">
<div class="item">
<div class="item-left">
@@ -51,7 +53,7 @@
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',
},
}
@@ -98,12 +100,43 @@
.my-bg {
width: 100%;
height: 420px;
background-image: url("https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/content-top-bg.png");
position: fixed;
left: 0;
z-index: 1;
background-size: 100vw;
background-image: url("https://cdn.sinoecare.com/i/2024/08/22/66c6d43eac5c0.png");
// position: fixed;
// left: 0;
// z-index: 1;
background-size: 100% 100%;
background-repeat: no-repeat;
.user-info {
display: flex;
padding: 76px 0 56px 48px;
.user-left {
.user-img {
display: inline-block;
width: 96px;
height: 96px;
border: 4px solid #FFF;
border-radius: 50%;
margin-right: 26px;
}
}
.user-right {
padding-top: 4px;
p {
height: 48px;
font-family: PingFangSC-SNaNpxibold;
font-weight: 600;
font-size: 34px;
color: #333;
margin-bottom: 4px;
}
div {
height: 36px;
font-family: PingFangSC-Regular;
font-size: 26px;
color: #8A929F;
}
}
}
}
.my-content {
.user-info {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -2,12 +2,12 @@
<div class="AppRecord">
<u-navbar title="Copilot小助理" title-color="#000" title-width="300" title-size="32" :title-bold="true"
:background="backgroundNavbar" :is-back="false" :is-fixed="true" height="44"></u-navbar>
<div class="list-bg"></div>
<div class="search-content">
<u-search v-model="searchVal" :clearabled="true" placeholder="请输入搜索关键词…" :show-action="false"
bg-color="#fff" search-icon-color="#E2E8F1" color="#666" height="72" @search="getSearchList" @clear="handerClear">
bg-color="#fff" search-icon-color="#E2E8F1" color="#666" height="68" @search="getSearchList" @clear="handerClear">
</u-search>
</div>
<div class="list-bg"></div>
<div class="list-content" :style="{'top': `${statusBarHeight+118}px`}">
<div class="item" v-for="(item, index) in messageList" :key="index">
<p class="item-text">{{item.content}}</p>
@@ -23,6 +23,7 @@
</div>
<AiEmpty v-if="!messageList.length"/>
</div>
<img src="https://cdn.sinoecare.com/i/2024/08/22/66c69f4d33eb1.png" alt="" class="bg-center">
</div>
</template>
@@ -38,7 +39,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',
},
searchVal: '',
@@ -58,6 +59,7 @@ export default {
...mapState(['user', 'token']),
},
onShow() {
this.current == 1
this.getHistoryList()
},
methods: {
@@ -66,29 +68,20 @@ export default {
if(!this.token) {
return this.$u.toast("请先进行登录")
}
if(this.current > this.pages) return
this.$loading()
this.$instance.post(`/app/appaicopilotinfo/listHistory?current=${this.current}&size=10&content=${this.searchVal}`).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
}
})
this.messageList = this.current == 1 ? res.data.records : [...this.messageList, ...res.data.records]
var idPage = res.data.records.length-1
this.$nextTick(() => {
uni.pageScrollTo({
duration: 300,
selector: this.current == 1 ? `.item${this.messageList.length-1}` : `.item${idPage}`
});
})
this.pages = res.data.pages
this.$hideLoading()
}else {
if(this.current == 1) {
this.messageList = []
}
this.$store.commit('logout', true)
}
})
},
@@ -136,27 +129,27 @@ page {
height: 100vh;
// background-color: #fff;
position: relative;
.list-bg {
width: 100%;
height: 420px;
background-image: url("https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/content-top-bg.png");
background-size: 100vw;
background-repeat: no-repeat;
position: fixed;
left: 0;
}
.search-content {
padding: 32px;
padding: 32px 32px 0 32px;
width: 100%;
// background: linear-gradient(to bottom, #D7EDFE, #EAF5FE);
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;
box-sizing: border-box;
position: fixed;
left: 0;
z-index: 99;
}
.list-bg {
width: 100%;
height: 320px;
background-image: url("https://cdn.sinoecare.com/i/2024/08/22/66c6b4384635e.jpg");
position: fixed;
left: 0;
background-size: 100% 100%;
background-repeat: no-repeat;
margin-top: 100px;
}
.list-content {
width: 100%;
box-sizing: border-box;
@@ -215,5 +208,13 @@ page {
}
}
}
.bg-center {
position: fixed;
top: 50%;
left: 50%;
width: 306px;
height: 364px;
margin: -182px 0 0 -153px;
}
}
</style>

View File

@@ -1,13 +1,13 @@
<template>
<div class="Detail">
<u-navbar title="Copilot小助理" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar" :height="44"></u-navbar>
<div class="list-bg">
<div class="search-content">
<u-search v-model="searchVal" :clearabled="true" placeholder="请输入搜索关键词…" :show-action="false"
bg-color="#fff" search-icon-color="#E2E8F1" color="#666" height="72" @search="getSearchList" @clear="handerClear">
</u-search>
</div>
<div class="search-content">
<p>已切换至{{messageList[0].aiConfigName}}</p>
<u-search v-model="searchVal" :clearabled="true" placeholder="请输入搜索关键词…" :show-action="false"
bg-color="#fff" search-icon-color="#E2E8F1" color="#666" height="72" @search="getSearchList" @clear="handerClear">
</u-search>
</div>
<div class="list-bg"></div>
<div class="list-content">
<div v-for="(item, index) in messageList" :key="index">
<div class="send-time">{{item.createTime.substring(5, 16)}}</div>
@@ -28,6 +28,7 @@
</div>
<AiEmpty v-if="!messageList.length"/>
</div>
<img src="https://cdn.sinoecare.com/i/2024/08/22/66c69f4d33eb1.png" alt="" class="bg-center">
</div>
</template>
@@ -36,12 +37,11 @@
import {mapActions, mapState} from "vuex";
export default {
customNavigation: true,
enablePullDownRefresh: true,
name: 'Detail',
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',
},
searchVal: '',
@@ -161,25 +161,38 @@ page {
height: 100vh;
background-color: #fff;
position: relative;
.list-bg {
.search-content {
padding: 28px 32px;
width: 100%;
height: 420px;
background-image: url("https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/content-top-bg.png");
box-sizing: border-box;
position: fixed;
left: 0;
z-index: 1;
background-size: 100vw;
z-index: 9;
background-image: url("https://cdn.sinoecare.com/i/2024/08/22/66c6d690aa312.jpg");
background-size: 100% 100%;
background-repeat: no-repeat;
.search-content {
padding: 32px;
width: 100%;
box-sizing: border-box;
position: fixed;
left: 0;
z-index: 99;
background: linear-gradient(to bottom, #D7EDFE, #EAF5FE);
p {
line-height: 34px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 24px;
color: #999;
text-align: center;
padding-bottom: 28px;
}
}
.list-bg {
width: 100%;
height: 230px;
position: fixed;
left: 0;
margin-top: 190px;
background-image: url("https://cdn.sinoecare.com/i/2024/08/22/66c6d69041e25.jpg");
background-size: 100% 100%;
background-repeat: no-repeat;
}
.list-content {
width: 100%;
box-sizing: border-box;
@@ -261,5 +274,13 @@ page {
}
}
}
.bg-center {
position: fixed;
top: 50%;
left: 50%;
width: 306px;
height: 364px;
margin: -182px 0 0 -153px;
}
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 B

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

After

Width:  |  Height:  |  Size: 1014 B