|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="detail" @touchmove="handleTouchMove"> |
|
|
|
|
<view class="detail" @touchmove="handleTouchMove" @touchstart="handleTouchStart"> |
|
|
|
|
<scroll-view scroll-y="true" :scroll-top="scrollTop" :style="{ |
|
|
|
|
height: isExpanded ? 'calc(100% - 1rpx)' : 'calc(100% - 1rpx)', |
|
|
|
|
}" class="chatlist" :class="{ 'chatlist-wrapper-expanded': isExpanded }" id="scrollView" ref="scrollView" |
|
|
|
@ -39,14 +39,12 @@ |
|
|
|
|
<view class="icon" v-show="item.answerId != '0' && item.isOver && item.isSuccess"> |
|
|
|
|
<uni-icons |
|
|
|
|
:type="item.iconsType == '' ? 'hand-up' : (item.iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')" |
|
|
|
|
:color="item.iconsType == 'handUp' ? '#FFD131' : ''" |
|
|
|
|
size="22" |
|
|
|
|
:color="item.iconsType == 'handUp' ? '#FFD131' : ''" size="22" |
|
|
|
|
@click="clickIcon('handUp', item.qaId)"> |
|
|
|
|
</uni-icons> |
|
|
|
|
<uni-icons |
|
|
|
|
:type="item.iconsType == '' ? 'hand-down' : (item.iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')" |
|
|
|
|
size="22" |
|
|
|
|
@click="clickIcon('handDown', item.qaId)"> |
|
|
|
|
size="22" @click="clickIcon('handDown', item.qaId)"> |
|
|
|
|
</uni-icons> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -56,14 +54,18 @@ |
|
|
|
|
<view class="bounce-dot"></view> |
|
|
|
|
<view class="bounce-dot"></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="loading-animation2" v-if="loading"> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</scroll-view> |
|
|
|
|
<view class="con" :class="{ 'con-wrapper-expanded': isExpanded }"></view> |
|
|
|
|
<view class="input-wrapper" :class="{ 'input-wrapper-expanded': isExpanded }"> |
|
|
|
|
<view class="topContent"> |
|
|
|
|
<input class="uni-input" :placeholder="loading ? '请等待回复结束' : '请输入内容'" :value="inputValue" @confirm="handleSend" :disabled="loading" |
|
|
|
|
@input="onKeyInput" /> |
|
|
|
|
<input class="uni-input" :placeholder="loading ? '请等待回复结束' : '请输入内容'" :value="inputValue" |
|
|
|
|
@confirm="handleSend" :disabled="loading" @input="onKeyInput" /> |
|
|
|
|
|
|
|
|
|
<uni-icons class="uni-icon" type="plus" size="30" @click="handlePlus" color='#cccccc' :disabled="loading"></uni-icons> |
|
|
|
|
<uni-icons class="uni-icon" type="plus" size="30" @click="handlePlus" color='#cccccc' |
|
|
|
|
:disabled="loading"></uni-icons> |
|
|
|
|
</view> |
|
|
|
|
<view v-if="isExpanded" class="expanded"> |
|
|
|
|
<view @click="chooseImage" class="expandedItem"> |
|
|
|
@ -169,13 +171,13 @@ |
|
|
|
|
async clickIcon(type, qaId) { |
|
|
|
|
console.log(this.msgList) |
|
|
|
|
this.msgList.forEach(item => { |
|
|
|
|
if(item.qaId == qaId) { |
|
|
|
|
if(item.iconsType == '' || !item.hasOwnProperty('iconsType')) { |
|
|
|
|
if (item.qaId == qaId) { |
|
|
|
|
if (item.iconsType == '' || !item.hasOwnProperty('iconsType')) { |
|
|
|
|
this.iconsType = type |
|
|
|
|
this.$set(item, 'iconsType', type) |
|
|
|
|
} else { |
|
|
|
|
if(item.iconsType == 'handUp') { |
|
|
|
|
if(type == 'handUp') { |
|
|
|
|
if (item.iconsType == 'handUp') { |
|
|
|
|
if (type == 'handUp') { |
|
|
|
|
this.iconsType = '' |
|
|
|
|
this.$set(item, 'iconsType', '') |
|
|
|
|
} else { |
|
|
|
@ -183,7 +185,7 @@ |
|
|
|
|
this.$set(item, 'iconsType', 'handDown') |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if(type == 'handUp') { |
|
|
|
|
if (type == 'handUp') { |
|
|
|
|
this.iconsType = 'handUp' |
|
|
|
|
this.$set(item, 'iconsType', 'handUp') |
|
|
|
|
} else { |
|
|
|
@ -197,7 +199,7 @@ |
|
|
|
|
|
|
|
|
|
const params = { |
|
|
|
|
qaId, |
|
|
|
|
feedbackStatus : this.iconsType == '' ? 0 : (this.iconsType == 'handUp' ? 1 : 2), |
|
|
|
|
feedbackStatus: this.iconsType == '' ? 0 : (this.iconsType == 'handUp' ? 1 : 2), |
|
|
|
|
feedbackInfo: '' |
|
|
|
|
} |
|
|
|
|
// this.$request.globalRequest('/hitap/feadBack', params, 'POST').then(res => { |
|
|
|
@ -219,9 +221,29 @@ |
|
|
|
|
// duration: 2000 |
|
|
|
|
// }); |
|
|
|
|
}, |
|
|
|
|
// 处理触摸开始事件 |
|
|
|
|
handleTouchStart(e) { |
|
|
|
|
// 获取触摸点坐标 |
|
|
|
|
this.startX = e.touches[0].clientX; |
|
|
|
|
this.startY = e.touches[0].clientY; |
|
|
|
|
}, |
|
|
|
|
handleTouchMove(e) { // 获取当前触摸点坐标 |
|
|
|
|
// this.isHandleScroll = false |
|
|
|
|
let currentX = e.touches[0].clientX; |
|
|
|
|
let currentY = e.touches[0].clientY; |
|
|
|
|
|
|
|
|
|
// 计算Y轴上的移动距离 |
|
|
|
|
let moveY = currentY - this.startY; |
|
|
|
|
|
|
|
|
|
handleTouchMove(e) { |
|
|
|
|
// 判断是否往上滑动 |
|
|
|
|
if (moveY < 0) { |
|
|
|
|
this.isHandleScroll = false |
|
|
|
|
// 在这里执行你需要的操作 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 如果需要,可以更新startX和startY为当前位置,以便连续滑动判断 |
|
|
|
|
// 但通常对于单次滑动判断,不需要更新 |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
handleScroll(event) { |
|
|
|
@ -249,6 +271,7 @@ |
|
|
|
|
// console.log(voiceText,"voiceText"); |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
this.loading = true; |
|
|
|
|
this.scrollTop = Number(this.scrollTop) + 100; |
|
|
|
|
const [err, res] = await uni.request({ |
|
|
|
|
// url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', |
|
|
|
|
url: this.$.chatUrl + "/chat", |
|
|
|
@ -303,6 +326,7 @@ |
|
|
|
|
// 快捷回复 |
|
|
|
|
handleBtn(text) { |
|
|
|
|
this.handleSend(text); |
|
|
|
|
this.isHandleScroll = true |
|
|
|
|
}, |
|
|
|
|
// 输入框 |
|
|
|
|
onKeyInput(event) { |
|
|
|
@ -1010,6 +1034,11 @@ |
|
|
|
|
margin: 0 10rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.loading-animation2 { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 120rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.loading-animation { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
@ -1077,11 +1106,13 @@ |
|
|
|
|
color: #999999 !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.icon{ |
|
|
|
|
|
|
|
|
|
.icon { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: flex-end; |
|
|
|
|
margin: 0 15rpx 15rpx 12rpx; |
|
|
|
|
.uni-icons{ |
|
|
|
|
|
|
|
|
|
.uni-icons { |
|
|
|
|
margin-left: 15rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|