|
|
|
@ -1,9 +1,10 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="detail"> |
|
|
|
|
<scroll-view @scroll="handleScroll" scroll-y="true" :scroll-top="scrollTop" :style="{ |
|
|
|
|
<view class="detail" @touchmove="handleTouchMove"> |
|
|
|
|
<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" |
|
|
|
|
@click="clickContent"> |
|
|
|
|
@click="clickContent" |
|
|
|
|
> |
|
|
|
|
<view v-if="!msgList.length" class="helloContent"> |
|
|
|
|
<image :src="$.imgSrc + '/left_user.png'" class="imgLeft" /> |
|
|
|
|
<view class="titleBox"> |
|
|
|
@ -26,7 +27,8 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view :class="['bar', item.answerId == '0' ? 'currAnswer' : '']" v-for="item in msgList" :key="item.id"> |
|
|
|
|
<view :class="['bar', item.answerId == '0' ? 'currAnswer' : '']" v-for="(item,index) in msgList" |
|
|
|
|
:key="item.id"> |
|
|
|
|
<!--<image :src="item.answerId == '0' ? $.imgSrc + '/self.png' : $.imgSrc + '/left_user.png'" class="img" />--> |
|
|
|
|
<image :src=" |
|
|
|
|
item.answerId == '0' |
|
|
|
@ -38,15 +40,13 @@ |
|
|
|
|
<!-- <ua-markdown :source="mdvalue" /> --> |
|
|
|
|
<view class="icon" v-show="item.answerId != '0' && item.isOver && item.isSuccess"> |
|
|
|
|
<uni-icons |
|
|
|
|
:type="iconsType == '' ? 'hand-up' : (iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')" |
|
|
|
|
:color="iconsType == 'handUp' ? '#FFD131' : ''" |
|
|
|
|
size="22" |
|
|
|
|
@click="clickIcon('handUp', item.qaId)"> |
|
|
|
|
:type="item.iconsType == '' ? 'hand-up' : (item.iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')" |
|
|
|
|
:color="item.iconsType == 'handUp' ? '#FFD131' : ''" size="22" |
|
|
|
|
@click="clickIcon('handUp', item.qaId,index)"> |
|
|
|
|
</uni-icons> |
|
|
|
|
<uni-icons |
|
|
|
|
:type="iconsType == '' ? 'hand-down' : (iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')" |
|
|
|
|
size="22" |
|
|
|
|
@click="clickIcon('handDown', item.qaId)"> |
|
|
|
|
:type="item.iconsType == '' ? 'hand-down' : (item.iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')" |
|
|
|
|
size="22" @click="clickIcon('handDown', item.qaId,index)"> |
|
|
|
|
</uni-icons> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -139,6 +139,7 @@ |
|
|
|
|
lastScrollTop: 0, // 记录上一次滚动位置 |
|
|
|
|
temp: 0, |
|
|
|
|
iconsType: '', |
|
|
|
|
isUserScrolling: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
@ -166,27 +167,32 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
async clickIcon(type, qaId) { |
|
|
|
|
if(this.iconsType == '') { |
|
|
|
|
async clickIcon(type, qaId, index) { |
|
|
|
|
if (this.iconsType == '') { |
|
|
|
|
this.iconsType = type |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', type) |
|
|
|
|
} else { |
|
|
|
|
if(this.iconsType == 'handUp') { |
|
|
|
|
if(type == 'handUp') { |
|
|
|
|
if (this.iconsType == 'handUp') { |
|
|
|
|
if (type == 'handUp') { |
|
|
|
|
this.iconsType = '' |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', '') |
|
|
|
|
} else { |
|
|
|
|
this.iconsType = 'handDown' |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', 'handDown') |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if(type == 'handUp') { |
|
|
|
|
if (type == 'handUp') { |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', 'handUp') |
|
|
|
|
this.iconsType = 'handUp' |
|
|
|
|
} else { |
|
|
|
|
this.iconsType = '' |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', '') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
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 => { |
|
|
|
@ -203,57 +209,46 @@ |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.data.result, |
|
|
|
|
// icon: 'success', |
|
|
|
|
duration: 2000 |
|
|
|
|
title: res.data.result, |
|
|
|
|
// icon: 'success', |
|
|
|
|
duration: 2000 |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleTouchStart(e) { |
|
|
|
|
// this.isUserScrolling = true; |
|
|
|
|
// 获取触摸开始时的坐标 |
|
|
|
|
this.startX = e.touches[0].clientX; |
|
|
|
|
this.startY = e.touches[0].clientY; |
|
|
|
|
// this.isScrolling = false; // 重置滑动状态 |
|
|
|
|
// this.startX = e.touches[0].clientX; |
|
|
|
|
// this.startY = e.touches[0].clientY; |
|
|
|
|
// // this.isScrolling = false; // 重置滑动状态 |
|
|
|
|
}, |
|
|
|
|
handleTouchMove(e) { |
|
|
|
|
// 获取触摸移动时的坐标 |
|
|
|
|
let moveX = e.touches[0].clientX; |
|
|
|
|
let moveY = 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('用户正在向上滑动'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 如果需要,可以在这里更新startX和startY为moveX和moveY,以继续追踪滑动 |
|
|
|
|
// 但在这个简单的示例中,我们不需要这样做 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 注意:这里不更新startX和startY,因为我们只关心触摸开始到当前位置的相对变化 |
|
|
|
|
console.log(e) |
|
|
|
|
// this.isUserScrolling = true |
|
|
|
|
this.isHandleScroll = false |
|
|
|
|
// 获取触摸开始时的坐标 |
|
|
|
|
// this.startX = e.touches[0].clientX; |
|
|
|
|
// this.startY = e.touches[0].clientY; |
|
|
|
|
// // this.isScrolling = false; // 重置滑动状态 |
|
|
|
|
}, |
|
|
|
|
handleTouchEnd(e) { |
|
|
|
|
// this.isUserScrolling = true; |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// this.isUserScrolling = false; |
|
|
|
|
// }, 300); // 延迟一段时间后重置 |
|
|
|
|
// 触摸结束时的处理 |
|
|
|
|
// 例如,可以重置startX和startY,或者执行其他清理工作 |
|
|
|
|
// 但在这个示例中,我们不做额外处理 |
|
|
|
|
}, |
|
|
|
|
handleScroll(event) { |
|
|
|
|
console.log(event) |
|
|
|
|
// event.detail 包含了滚动事件的详细信息 |
|
|
|
|
const scrollTop = event.detail.scrollTop; |
|
|
|
|
if (scrollTop > this.lastScrollTop) { |
|
|
|
|
console.log('向下滑动'); |
|
|
|
|
// this.temp=0 |
|
|
|
|
} else { |
|
|
|
|
this.temp++ |
|
|
|
|
if (this.temp == 2) { |
|
|
|
|
if (this.temp == 2&&this.isUserScrolling) { |
|
|
|
|
this.isHandleScroll = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -341,6 +336,7 @@ |
|
|
|
|
} |
|
|
|
|
this.temp = 0 |
|
|
|
|
this.isHandleScroll = true |
|
|
|
|
this.isUserScrolling = false |
|
|
|
|
this.changeMsgList("0", this.inputValue || text); |
|
|
|
|
this.queryChat(this.inputValue || text); |
|
|
|
|
this.inputValue = ""; |
|
|
|
@ -817,6 +813,8 @@ |
|
|
|
|
.titleTwo { |
|
|
|
|
margin: 15rpx 0; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
line-height: 42rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tipItem { |
|
|
|
@ -831,12 +829,13 @@ |
|
|
|
|
|
|
|
|
|
.text { |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
// line-height:50rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.text { |
|
|
|
|
font-size: 32rpx; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1098,11 +1097,13 @@ |
|
|
|
|
color: #999999 !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.icon{ |
|
|
|
|
|
|
|
|
|
.icon { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: flex-end; |
|
|
|
|
margin: 0 15rpx 15rpx 12rpx; |
|
|
|
|
.uni-icons{ |
|
|
|
|
|
|
|
|
|
.uni-icons { |
|
|
|
|
margin-left: 15rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|