| | |
| | | roleImageMap |
| | | } from "@/model/chat/types"; |
| | | import { |
| | | CHAT_GROUP_DATA, |
| | | TEST_DATA |
| | | } from "./testData"; |
| | | import { |
| | | TAB_BAR_HEIGHT |
| | | } from "@/custom-tab-bar/constants"; |
| | | import { |
| | |
| | | import { ErrorCode } from "@/utils/http"; |
| | | import { ComponentWithComputed, } from "miniprogram-computed"; |
| | | import { uuid } from "@/utils/uuid"; |
| | | import { getStorage } from "@/utils/storage"; |
| | | import { getCurrentUrl } from "@/utils/common"; |
| | | import { SHARE_CONFIG } from "@/config/constants"; |
| | | |
| | | const app = getApp(); |
| | | // pages/question/question.js |
| | |
| | | displaySampleList: [], |
| | | section_a_id: '', |
| | | sample_id: '', |
| | | }, |
| | | userName: getStorage('username'), |
| | | keyboardHeight: 0, |
| | | |
| | | }, |
| | | onClickClear() { |
| | | console.log('clear'); |
| | | |
| | | this.setData({ |
| | | sendText: '' |
| | | }) |
| | | }, |
| | | inputFocus(e) { |
| | | if (e.detail.height > 0) { |
| | | this.setData({ |
| | | keyboardHeight: e.detail.height - 55 |
| | | }) |
| | | } |
| | | }, |
| | | changeInputBlur(e) { |
| | | this.setData({ |
| | | keyboardHeight: 0 |
| | | }) |
| | | }, |
| | | async getSampleList() { |
| | | const res = await getSelectSample({ |
| | | section_b_id: '', |
| | |
| | | }) |
| | | |
| | | }, |
| | | async getHistoryDetail( ) { |
| | | async getHistoryDetail() { |
| | | |
| | | const res = await QueryHistoryDetail({ |
| | | history_group_id: this.data.activeChatRoom.id, |
| | |
| | | i++; |
| | | }); |
| | | |
| | | // 过滤为null的结果 |
| | | this.setData({ |
| | | chatHistory: this.data.chatHistory |
| | | chatHistory: this.data.chatHistory.filter(item => !!item) |
| | | }) |
| | | this.scrollToBottom() |
| | | |
| | |
| | | if (!isPassed) return; |
| | | this.getHistoryGroupData(); |
| | | this.getSampleList(); |
| | | |
| | | }, |
| | | onShow() { |
| | | this.setData({ |
| | | userName: getStorage('username') |
| | | }) |
| | | }, |
| | | |
| | | async onRouteDone() { |
| | |
| | | } |
| | | this.setData( |
| | | { |
| | | section_a_id:sectionAId |
| | | section_a_id: sectionAId |
| | | } |
| | | ) |
| | | if (!this.data.activeChatRoom.isInitial) { |
| | | try { |
| | | |
| | | |
| | | await this.newChatRoomClick(false) |
| | | } finally { |
| | | wx.hideLoading(); |
| | |
| | | this.sendText(); |
| | | app.globalData.sectionAId = ''; |
| | | app.globalData.sectionB = null; |
| | | }, |
| | | onShareAppMessage() { |
| | | return wx.$_.defaults(SHARE_CONFIG, { |
| | | // path: getCurrentUrl(), |
| | | }) |
| | | } |
| | | |
| | | |
| | | // pageLifetimes: { |
| | | // show() { |
| | | // if (typeof this.getTabBar === 'function' && |