|
|
|
@ -3,8 +3,7 @@ |
|
|
|
|
<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"> |
|
|
|
@ -27,8 +26,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view :class="['bar', item.answerId == '0' ? 'currAnswer' : '']" v-for="(item,index) in msgList" |
|
|
|
|
:key="item.id"> |
|
|
|
|
<view :class="['bar', item.answerId == '0' ? 'currAnswer' : '']" v-for="item in msgList" :key="item.id"> |
|
|
|
|
<!--<image :src="item.answerId == '0' ? $.imgSrc + '/self.png' : $.imgSrc + '/left_user.png'" class="img" />--> |
|
|
|
|
<image :src=" |
|
|
|
|
item.answerId == '0' |
|
|
|
@ -41,12 +39,14 @@ |
|
|
|
|
<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" |
|
|
|
|
@click="clickIcon('handUp', item.qaId,index)"> |
|
|
|
|
: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,index)"> |
|
|
|
|
size="22" |
|
|
|
|
@click="clickIcon('handDown', item.qaId)"> |
|
|
|
|
</uni-icons> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -60,10 +60,10 @@ |
|
|
|
|
<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="请输入内容" :value="inputValue" @confirm="handleSend" |
|
|
|
|
<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'></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"> |
|
|
|
@ -139,7 +139,6 @@ |
|
|
|
|
lastScrollTop: 0, // 记录上一次滚动位置 |
|
|
|
|
temp: 0, |
|
|
|
|
iconsType: '', |
|
|
|
|
isUserScrolling: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
@ -167,29 +166,35 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
async clickIcon(type, qaId, index) { |
|
|
|
|
if (this.iconsType == '') { |
|
|
|
|
async clickIcon(type, qaId) { |
|
|
|
|
console.log(this.msgList) |
|
|
|
|
this.msgList.forEach(item => { |
|
|
|
|
if(item.qaId == qaId) { |
|
|
|
|
if(item.iconsType == '' || !item.hasOwnProperty('iconsType')) { |
|
|
|
|
this.iconsType = type |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', type) |
|
|
|
|
this.$set(item, 'iconsType', type) |
|
|
|
|
} else { |
|
|
|
|
if (this.iconsType == 'handUp') { |
|
|
|
|
if(item.iconsType == 'handUp') { |
|
|
|
|
if(type == 'handUp') { |
|
|
|
|
this.iconsType = '' |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', '') |
|
|
|
|
this.$set(item, 'iconsType', '') |
|
|
|
|
} else { |
|
|
|
|
this.iconsType = 'handDown' |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', 'handDown') |
|
|
|
|
this.$set(item, 'iconsType', 'handDown') |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if(type == 'handUp') { |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', 'handUp') |
|
|
|
|
this.iconsType = 'handUp' |
|
|
|
|
this.$set(item, 'iconsType', 'handUp') |
|
|
|
|
} else { |
|
|
|
|
this.iconsType = '' |
|
|
|
|
this.$set(this.msgList[index], 'iconsType', '') |
|
|
|
|
this.$set(item, 'iconsType', '') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const params = { |
|
|
|
|
qaId, |
|
|
|
|
feedbackStatus : this.iconsType == '' ? 0 : (this.iconsType == 'handUp' ? 1 : 2), |
|
|
|
@ -207,48 +212,26 @@ |
|
|
|
|
}, |
|
|
|
|
data: params |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
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.$.toast(res.data.result); |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: res.data.result, |
|
|
|
|
// // icon: 'success', |
|
|
|
|
// duration: 2000 |
|
|
|
|
// }); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
handleTouchMove(e) { |
|
|
|
|
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&&this.isUserScrolling) { |
|
|
|
|
if (this.temp == 2) { |
|
|
|
|
this.isHandleScroll = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -336,7 +319,6 @@ |
|
|
|
|
} |
|
|
|
|
this.temp = 0 |
|
|
|
|
this.isHandleScroll = true |
|
|
|
|
this.isUserScrolling = false |
|
|
|
|
this.changeMsgList("0", this.inputValue || text); |
|
|
|
|
this.queryChat(this.inputValue || text); |
|
|
|
|
this.inputValue = ""; |
|
|
|
@ -813,7 +795,6 @@ |
|
|
|
|
.titleTwo { |
|
|
|
|
margin: 15rpx 0; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
line-height: 42rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -829,7 +810,6 @@ |
|
|
|
|
|
|
|
|
|
.text { |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
// line-height:50rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1097,12 +1077,10 @@ |
|
|
|
|
color: #999999 !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.icon{ |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: flex-end; |
|
|
|
|
margin: 0 15rpx 15rpx 12rpx; |
|
|
|
|
|
|
|
|
|
.uni-icons{ |
|
|
|
|
margin-left: 15rpx; |
|
|
|
|
} |
|
|
|
|