|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view class="detail"> |
|
|
|
<view class="detail" @touchmove="handleTouchMove" @touchstart="handleTouchStart"> |
|
|
|
<scroll-view @scroll="handleScroll" scroll-y="true" :scroll-top="scrollTop" :style="{ |
|
|
|
<scroll-view scroll-y="true" :scroll-top="scrollTop" :style="{ |
|
|
|
height: isExpanded ? 'calc(100% - 1rpx)' : 'calc(100% - 1rpx)', |
|
|
|
height: isExpanded ? 'calc(100% - 1rpx)' : 'calc(100% - 1rpx)', |
|
|
|
}" class="chatlist" :class="{ 'chatlist-wrapper-expanded': isExpanded }" id="scrollView" ref="scrollView" |
|
|
|
}" class="chatlist" :class="{ 'chatlist-wrapper-expanded': isExpanded }" id="scrollView" ref="scrollView" |
|
|
|
@click="clickContent"> |
|
|
|
@click="clickContent"> |
|
|
@ -39,14 +39,12 @@ |
|
|
|
<view class="icon" v-show="item.answerId != '0' && item.isOver && item.isSuccess"> |
|
|
|
<view class="icon" v-show="item.answerId != '0' && item.isOver && item.isSuccess"> |
|
|
|
<uni-icons |
|
|
|
<uni-icons |
|
|
|
:type="item.iconsType == '' ? 'hand-up' : (item.iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')" |
|
|
|
:type="item.iconsType == '' ? 'hand-up' : (item.iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')" |
|
|
|
:color="item.iconsType == 'handUp' ? '#FFD131' : ''" |
|
|
|
:color="item.iconsType == 'handUp' ? '#FFD131' : ''" size="22" |
|
|
|
size="22" |
|
|
|
|
|
|
|
@click="clickIcon('handUp', item.qaId)"> |
|
|
|
@click="clickIcon('handUp', item.qaId)"> |
|
|
|
</uni-icons> |
|
|
|
</uni-icons> |
|
|
|
<uni-icons |
|
|
|
<uni-icons |
|
|
|
:type="item.iconsType == '' ? 'hand-down' : (item.iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')" |
|
|
|
:type="item.iconsType == '' ? 'hand-down' : (item.iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')" |
|
|
|
size="22" |
|
|
|
size="22" @click="clickIcon('handDown', item.qaId)"> |
|
|
|
@click="clickIcon('handDown', item.qaId)"> |
|
|
|
|
|
|
|
</uni-icons> |
|
|
|
</uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -56,14 +54,18 @@ |
|
|
|
<view class="bounce-dot"></view> |
|
|
|
<view class="bounce-dot"></view> |
|
|
|
<view class="bounce-dot"></view> |
|
|
|
<view class="bounce-dot"></view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="loading-animation2" v-if="loading"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</scroll-view> |
|
|
|
<view class="con" :class="{ 'con-wrapper-expanded': isExpanded }"></view> |
|
|
|
<view class="con" :class="{ 'con-wrapper-expanded': isExpanded }"></view> |
|
|
|
<view class="input-wrapper" :class="{ 'input-wrapper-expanded': isExpanded }"> |
|
|
|
<view class="input-wrapper" :class="{ 'input-wrapper-expanded': isExpanded }"> |
|
|
|
<view class="topContent"> |
|
|
|
<view class="topContent"> |
|
|
|
<input class="uni-input" :placeholder="loading ? '请等待回复结束' : '请输入内容'" :value="inputValue" @confirm="handleSend" :disabled="loading" |
|
|
|
<input class="uni-input" :placeholder="loading ? '请等待回复结束' : '请输入内容'" :value="inputValue" |
|
|
|
@input="onKeyInput" /> |
|
|
|
@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> |
|
|
|
<view v-if="isExpanded" class="expanded"> |
|
|
|
<view v-if="isExpanded" class="expanded"> |
|
|
|
<view @click="chooseImage" class="expandedItem"> |
|
|
|
<view @click="chooseImage" class="expandedItem"> |
|
|
@ -169,13 +171,13 @@ |
|
|
|
async clickIcon(type, qaId) { |
|
|
|
async clickIcon(type, qaId) { |
|
|
|
console.log(this.msgList) |
|
|
|
console.log(this.msgList) |
|
|
|
this.msgList.forEach(item => { |
|
|
|
this.msgList.forEach(item => { |
|
|
|
if(item.qaId == qaId) { |
|
|
|
if (item.qaId == qaId) { |
|
|
|
if(item.iconsType == '' || !item.hasOwnProperty('iconsType')) { |
|
|
|
if (item.iconsType == '' || !item.hasOwnProperty('iconsType')) { |
|
|
|
this.iconsType = type |
|
|
|
this.iconsType = type |
|
|
|
this.$set(item, 'iconsType', type) |
|
|
|
this.$set(item, 'iconsType', type) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if(item.iconsType == 'handUp') { |
|
|
|
if (item.iconsType == 'handUp') { |
|
|
|
if(type == 'handUp') { |
|
|
|
if (type == 'handUp') { |
|
|
|
this.iconsType = '' |
|
|
|
this.iconsType = '' |
|
|
|
this.$set(item, 'iconsType', '') |
|
|
|
this.$set(item, 'iconsType', '') |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -183,7 +185,7 @@ |
|
|
|
this.$set(item, 'iconsType', 'handDown') |
|
|
|
this.$set(item, 'iconsType', 'handDown') |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if(type == 'handUp') { |
|
|
|
if (type == 'handUp') { |
|
|
|
this.iconsType = 'handUp' |
|
|
|
this.iconsType = 'handUp' |
|
|
|
this.$set(item, 'iconsType', 'handUp') |
|
|
|
this.$set(item, 'iconsType', 'handUp') |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -194,14 +196,14 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const params = { |
|
|
|
const params = { |
|
|
|
qaId, |
|
|
|
qaId, |
|
|
|
feedbackStatus : this.iconsType == '' ? 0 : (this.iconsType == 'handUp' ? 1 : 2), |
|
|
|
feedbackStatus: this.iconsType == '' ? 0 : (this.iconsType == 'handUp' ? 1 : 2), |
|
|
|
feedbackInfo: '' |
|
|
|
feedbackInfo: '' |
|
|
|
} |
|
|
|
} |
|
|
|
// this.$request.globalRequest('/hitap/feadBack', params, 'POST').then(res => { |
|
|
|
// this.$request.globalRequest('/hitap/feadBack', params, 'POST').then(res => { |
|
|
|
|
|
|
|
|
|
|
|
// }) |
|
|
|
// }) |
|
|
|
const [err, res] = await uni.request({ |
|
|
|
const [err, res] = await uni.request({ |
|
|
|
url: this.$.chatUrl + "/feadBack", |
|
|
|
url: this.$.chatUrl + "/feadBack", |
|
|
@ -219,44 +221,31 @@ |
|
|
|
// duration: 2000 |
|
|
|
// duration: 2000 |
|
|
|
// }); |
|
|
|
// }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 处理触摸开始事件 |
|
|
|
handleTouchStart(e) { |
|
|
|
handleTouchStart(e) { |
|
|
|
// 获取触摸开始时的坐标 |
|
|
|
// 获取触摸点坐标 |
|
|
|
this.startX = e.touches[0].clientX; |
|
|
|
this.startX = e.touches[0].clientX; |
|
|
|
this.startY = e.touches[0].clientY; |
|
|
|
this.startY = e.touches[0].clientY; |
|
|
|
// this.isScrolling = false; // 重置滑动状态 |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
handleTouchMove(e) { |
|
|
|
handleTouchMove(e) { // 获取当前触摸点坐标 |
|
|
|
// 获取触摸移动时的坐标 |
|
|
|
// this.isHandleScroll = false |
|
|
|
let moveX = e.touches[0].clientX; |
|
|
|
let currentX = e.touches[0].clientX; |
|
|
|
let moveY = e.touches[0].clientY; |
|
|
|
let currentY = e.touches[0].clientY; |
|
|
|
|
|
|
|
|
|
|
|
// 计算坐标变化量 |
|
|
|
|
|
|
|
let deltaX = moveX - this.startX; |
|
|
|
|
|
|
|
let deltaY = moveY - this.startY; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 判断是否发生了足够的滑动(这里以5px为例) |
|
|
|
|
|
|
|
if (Math.abs(deltaX) > 5 || Math.abs(deltaY) > 5) { |
|
|
|
|
|
|
|
// this.isScrolling = true; // 标记为正在滑动 |
|
|
|
|
|
|
|
this.isHandleScroll = false |
|
|
|
|
|
|
|
// 根据deltaY的正负判断滑动方向 |
|
|
|
|
|
|
|
if (deltaY > 0) { |
|
|
|
|
|
|
|
console.log('用户正在向下滑动'); |
|
|
|
|
|
|
|
} else if (deltaY < 0) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('用户正在向上滑动'); |
|
|
|
// 计算Y轴上的移动距离 |
|
|
|
} |
|
|
|
let moveY = currentY - this.startY; |
|
|
|
|
|
|
|
|
|
|
|
// 如果需要,可以在这里更新startX和startY为moveX和moveY,以继续追踪滑动 |
|
|
|
// 判断是否往上滑动 |
|
|
|
// 但在这个简单的示例中,我们不需要这样做 |
|
|
|
if (moveY < 0) { |
|
|
|
|
|
|
|
this.isHandleScroll = false |
|
|
|
|
|
|
|
// 在这里执行你需要的操作 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 注意:这里不更新startX和startY,因为我们只关心触摸开始到当前位置的相对变化 |
|
|
|
// 如果需要,可以更新startX和startY为当前位置,以便连续滑动判断 |
|
|
|
}, |
|
|
|
// 但通常对于单次滑动判断,不需要更新 |
|
|
|
handleTouchEnd(e) { |
|
|
|
|
|
|
|
// 触摸结束时的处理 |
|
|
|
|
|
|
|
// 例如,可以重置startX和startY,或者执行其他清理工作 |
|
|
|
|
|
|
|
// 但在这个示例中,我们不做额外处理 |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleScroll(event) { |
|
|
|
handleScroll(event) { |
|
|
|
// event.detail 包含了滚动事件的详细信息 |
|
|
|
// event.detail 包含了滚动事件的详细信息 |
|
|
|
const scrollTop = event.detail.scrollTop; |
|
|
|
const scrollTop = event.detail.scrollTop; |
|
|
@ -282,6 +271,7 @@ |
|
|
|
// console.log(voiceText,"voiceText"); |
|
|
|
// console.log(voiceText,"voiceText"); |
|
|
|
clearInterval(this.timer) |
|
|
|
clearInterval(this.timer) |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
this.scrollTop = Number(this.scrollTop) + 100; |
|
|
|
const [err, res] = await uni.request({ |
|
|
|
const [err, res] = await uni.request({ |
|
|
|
// url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', |
|
|
|
// url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', |
|
|
|
url: this.$.chatUrl + "/chat", |
|
|
|
url: this.$.chatUrl + "/chat", |
|
|
@ -336,6 +326,7 @@ |
|
|
|
// 快捷回复 |
|
|
|
// 快捷回复 |
|
|
|
handleBtn(text) { |
|
|
|
handleBtn(text) { |
|
|
|
this.handleSend(text); |
|
|
|
this.handleSend(text); |
|
|
|
|
|
|
|
this.isHandleScroll = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 输入框 |
|
|
|
// 输入框 |
|
|
|
onKeyInput(event) { |
|
|
|
onKeyInput(event) { |
|
|
@ -828,6 +819,7 @@ |
|
|
|
.titleTwo { |
|
|
|
.titleTwo { |
|
|
|
margin: 15rpx 0; |
|
|
|
margin: 15rpx 0; |
|
|
|
font-size: 28rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
|
|
|
|
line-height: 42rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.tipItem { |
|
|
|
.tipItem { |
|
|
@ -1042,6 +1034,11 @@ |
|
|
|
margin: 0 10rpx; |
|
|
|
margin: 0 10rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.loading-animation2 { |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
height: 120rpx; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.loading-animation { |
|
|
|
.loading-animation { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
justify-content: center; |
|
|
@ -1109,12 +1106,14 @@ |
|
|
|
color: #999999 !important; |
|
|
|
color: #999999 !important; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.icon{ |
|
|
|
|
|
|
|
|
|
|
|
.icon { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: flex-end; |
|
|
|
justify-content: flex-end; |
|
|
|
margin: 0 15rpx 15rpx 12rpx; |
|
|
|
margin: 0 15rpx 15rpx 12rpx; |
|
|
|
.uni-icons{ |
|
|
|
|
|
|
|
|
|
|
|
.uni-icons { |
|
|
|
margin-left: 15rpx; |
|
|
|
margin-left: 15rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |