You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< template >
< view >
<!-- greeting card -- >
< view class = "greet-card" >
< image class = "ai-image" src = "@/static/ai.webp" mode = "widthFix" style = "width: 60px; margin-right: 10px" > < / image >
< view class = "greet-text" >
< view class = "hi" > HI , { { timeOfDayText } } < / view >
< view class = "sub" > 我是萃星科技智能体 < / view >
< / view >
< / view >
<!-- welcome sentence -- >
< view class = "welcome" >
您好 ! 非常高兴与您交流 , 今天有什么可以帮到您 ?
< / view >
<!-- suggestions -- >
< view class = "guess-panel" >
< view class = "guess-title" > 猜你想问 < / view >
< view class = "guess-list" >
< view class = "guess-item" @tap ="onSuggestionTap(item.label)" v-for ="item in guessData" :key="item.id">
<text>{{ item.label }}</text>
<text class="arrow" > › < / text >
< / view >
< / view >
< / view >
< / view >
< / template >
< script >
export default {
data ( ) {
return {
guessData : [ {
id : 1 ,
label : "今日出入库数据" ,
} ,
{
id : 2 ,
label : "今日销售数据" ,
} ,
{
id : 3 ,
label : "今日生产数据" ,
} ,
] ,
aiLogoMsg : null
}
} ,
computed : {
timeOfDayText ( ) {
const h = new Date ( ) . getHours ( ) ;
if ( h < 6 ) return "凌晨好" ;
if ( h < 12 ) return "上午好" ;
if ( h < 18 ) return "下午好" ;
return "晚上好" ;
} ,
} ,
mounted ( ) {
let self = this ;
uni . createSelectorQuery ( ) . select ( ".ai-image" ) . boundingClientRect ( ( rect ) => {
self . aiLogoMsg = rect
} ) . exec ( ) ;
} ,
methods : {
onSuggestionTap ( text ) {
this . $emit ( 'onSuggestionTap' , text )
} ,
getAiLogoMsg ( ) {
return this . aiLogoMsg ;
}
}
}
< / script >
< style scoped >
. greet - card {
display : flex ;
align - items : center ;
background - image : linear - gradient ( to right , # EFF6FF , # EEF2FF ) ;
border - radius : 14 px ;
padding : 12 px ;
margin - bottom : 10 px ;
}
. greet - text . hi {
font - size : 16 px ;
font - weight : 700 ;
color : # 0 b56ff ;
}
. greet - text . sub {
font - size : 12 px ;
color : # 4 a76b1 ;
margin - top : 4 px ;
}
. welcome {
font - size : 13 px ;
color : # 333 ;
background : # F3F7F9 ;
border - radius : 12 px ;
padding : 10 px 12 px ;
margin : 12 px 0 ;
max - width : 80 % ;
}
. guess - panel {
background - image : linear - gradient ( to right , # EFF6FF , # EEF2FF ) ;
border - radius : 14 px ;
padding : 10 px ;
margin - bottom : 16 px ;
}
. guess - title {
color : # 5 f6fff ;
font - size : 14 px ;
margin - bottom : 8 px ;
}
. guess - list {
display : flex ;
flex - direction : column ;
}
. guess - item {
background : # FFFFFF ;
border - radius : 10 px ;
padding : 12 px ;
display : flex ;
align - items : center ;
justify - content : space - between ;
margin - bottom : 10 px ;
box - sizing : border - box ;
}
. guess - item : last - child {
margin - bottom : 0 ;
}
. guess - item . arrow {
color : # 9 aa3b2 ;
font - size : 18 px ;
}
< / style >