Feat(云灵AI):对话接口对接完成
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<view
|
||||
:class="{
|
||||
'show': showLayer
|
||||
}"
|
||||
class="history-wrap"
|
||||
>
|
||||
<view class="layer" @click="closeLayer" />
|
||||
<view
|
||||
:style="{
|
||||
'padding-top': statusBarHeight + 'px'
|
||||
}"
|
||||
class="history-container"
|
||||
>
|
||||
<view class="history-type">
|
||||
<view class="title">
|
||||
<view class="txt">30天内</view>
|
||||
<image
|
||||
:src="webUrl + '/aiChat/delete.png'"
|
||||
class="icon"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</view>
|
||||
<view class="list-cont">
|
||||
<view
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
class="item"
|
||||
>
|
||||
<view class="item-txt one-t">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getChatList
|
||||
} from '@/api/chat/index'
|
||||
export default {
|
||||
name: 'AiHistoryList',
|
||||
props: {
|
||||
statusBarHeight: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
showLayer: false,
|
||||
list: [],
|
||||
moreList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showView() {
|
||||
this.showLayer = true
|
||||
getChatList().then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.list = data['今天']
|
||||
this.moreList = data['超过30天']
|
||||
}
|
||||
})
|
||||
},
|
||||
closeLayer() {
|
||||
this.showLayer = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.history-wrap {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 1001;
|
||||
transform: translateX(-100%);
|
||||
opacity: 0;
|
||||
transition: all 0.3s;
|
||||
.layer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 2;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.history-container {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 5;
|
||||
width: 75%;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
border-top-right-radius: 60rpx;
|
||||
border-bottom-right-radius: 60rpx;
|
||||
overflow-y: auto;
|
||||
background-color: #fff;
|
||||
.history-type + .history-type {
|
||||
padding: 40rpx 0 0 0;
|
||||
}
|
||||
.history-type {
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.txt {
|
||||
font-size: 34rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.icon {
|
||||
display: block;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
.list-cont {
|
||||
padding: 24rpx 0 0 0;
|
||||
.item + .item {
|
||||
margin: 12rpx 0 0 0;
|
||||
}
|
||||
.item {
|
||||
.item-txt {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
height: 60rpx;
|
||||
padding: 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 30rpx;
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
line-height: 60rpx;
|
||||
background-color: #F1F2FF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.show {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user