|
@@ -1,29 +1,60 @@
|
|
|
import { YTHeader } from "basic"
|
|
import { YTHeader } from "basic"
|
|
|
|
|
+import { YTChatInput, YTTag } from "../../../../Index"
|
|
|
|
|
+import { YTCard } from "./YTCard"
|
|
|
|
|
|
|
|
@Component
|
|
@Component
|
|
|
export struct YTChat{
|
|
export struct YTChat{
|
|
|
- @BuilderParam card?: () => void
|
|
|
|
|
- @BuilderParam cardTag?: () => void
|
|
|
|
|
- @BuilderParam chatTag?: () => void
|
|
|
|
|
- @BuilderParam chatInput?: () => void
|
|
|
|
|
- @BuilderParam backTop?: () => void
|
|
|
|
|
|
|
+ @State showTag: boolean = false
|
|
|
|
|
+ @State inputValue: string = ''
|
|
|
title:string = ''
|
|
title:string = ''
|
|
|
cardDesc:string = ''
|
|
cardDesc:string = ''
|
|
|
chatInputTips:string = ''
|
|
chatInputTips:string = ''
|
|
|
|
|
+ tagDescArr: string[] = ['高情商','撩女神','幽默风趣','暧昧拉扯','情场高手','土味情话','风度绅士','浪漫情话']
|
|
|
|
|
|
|
|
build() {
|
|
build() {
|
|
|
Column(){
|
|
Column(){
|
|
|
YTHeader({title: this.title})
|
|
YTHeader({title: this.title})
|
|
|
|
|
+ //恋爱导师卡片
|
|
|
Column() {
|
|
Column() {
|
|
|
- this.card?.()
|
|
|
|
|
|
|
+ YTCard({desc: '真情流露,悸动的青春。输入文章框架和主题,一键帮您写出优美的情书。', tagArr: ['我喜欢你','呵呵','我去洗澡了']})
|
|
|
|
|
+ .padding({left:18, right:12})
|
|
|
|
|
+
|
|
|
|
|
+ //聊天消息
|
|
|
|
|
+ Row(){
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ .layoutWeight(1)
|
|
|
|
|
+
|
|
|
|
|
+ //话术选择
|
|
|
|
|
+
|
|
|
Row(){
|
|
Row(){
|
|
|
- this.chatInput?.()
|
|
|
|
|
- this.backTop?.()
|
|
|
|
|
|
|
+ YTChatInput({btnName: '高情商',inputVal: this.inputValue, placeholder: '请输入TA说的话', showTag: this.showTag})
|
|
|
|
|
+ Image("").width(40).height(40).backgroundColor(Color.Pink).margin({left: 50})
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .height(60)
|
|
|
|
|
+ .backgroundColor('#d9efefef')
|
|
|
|
|
+ .flexShrink(0)
|
|
|
|
|
+ .alignSelf(ItemAlign.End)
|
|
|
|
|
+
|
|
|
|
|
+ //话术选择卡片
|
|
|
|
|
+ if (this.showTag){
|
|
|
|
|
+ Grid(){
|
|
|
|
|
+ ForEach(this.tagDescArr, (desc:string)=>{
|
|
|
|
|
+ GridItem(){
|
|
|
|
|
+ YTTag({desc: desc, tagWidth: 79}).padding({top: 5, bottom: 5})
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ .columnsTemplate('1fr 1fr 1fr 1fr')
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .height(154)
|
|
|
|
|
+ .backgroundColor('#d9efefef')
|
|
|
}
|
|
}
|
|
|
- this.chatTag?.()
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ .height('100%')
|
|
|
|
|
+ .layoutWeight(1)
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
- .padding({left:18, right:18})
|
|
|
|
|
}
|
|
}
|
|
|
.height('100%')
|
|
.height('100%')
|
|
|
.width('100%')
|
|
.width('100%')
|