riku
2022-10-10 437144f41c74505d362a5214a18cec3d01b3ce4b
pages/m_consult/consultonline/consultonline.js
@@ -28,7 +28,9 @@
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      userId: app.globalData.accessToken.userId
    })
  },
  clearInput() {
@@ -54,6 +56,9 @@
      type: 0,
      text: this.data.value,
    })
    console.log('-----------chat------------------');
    console.log(record);
    console.log(this.data.userId);
    this.lastKeyword = this.data.value
    this.setData({
      record,
@@ -110,7 +115,7 @@
        userId: 'system',
        userName: '智能客服',
        type: 0,
        text: '不好意思,暂无相关解答,请试试其他关键词'
        text: '抱歉,我还不理解您的意思。请尝试重新咨询。'
      })
    } else {
      record.push({
@@ -119,9 +124,12 @@
        userId: 'system',
        userName: '智能客服',
        type: 0,
        text: '小白给您提供参考如下'
        text: '小白给您提供参考如下:'
      })
      const map = new Map()
      results.sort((a, b) => {
        return b.typeId - a.typeId
      })
      results.forEach(r => {
        if (!map.has(r.typeName)) {
          r.keyword = this.lastKeyword