chat-edit.js 1.1 KB

1
  1. import{emotionslist}from"../../common/chat/emotions";Component({properties:{isAsk:{type:Boolean,value:!1},showSendImg:{type:Boolean,value:!1},showBulletin:{type:Boolean,value:!1},skin:{type:String,value:"black",observer(t){"black"!==t&&"white"!==t&&this.setData({skin:"black"})}},iPhoneX:{type:Boolean,value:!1}},data:{showMore:!1,emotionslist:emotionslist,isOnlyHost:!1,showEmotionList:!1,chatTitle:""},methods:{tapOnlyHost(){const t=!this.data.isOnlyHost;this.setData({isOnlyHost:t}),this.triggerEvent("onlyhost",{isOnlyHost:t})},tapEmoji(){this.setData({showEmotionList:!this.data.showEmotionList,showMore:!1})},tapMore(){this.setData({showMore:!this.data.showMore,showEmotionList:!1})},chatInputChange(t){const s=t.detail.value;this.setData({chatTitle:s})},tapSend(){const{chatTitle:t}=this.data;t&&t.replace(/\s/g,"")&&(this.triggerEvent("sengmsg",{chatTitle:t}),this.setData({chatTitle:"",showEmotionList:!1}))},tapEmotionIcon(t){const s=t.currentTarget.dataset.title;this.setData({chatTitle:`${this.data.chatTitle}[${s}]`})},tapBulletin(){this.triggerEvent("showbulletin")}}});