This commit is contained in:
yanghang
2025-07-22 15:44:14 +08:00
parent 18e6dff263
commit 1eabaea209
7 changed files with 36 additions and 24 deletions
+20 -11
View File
@@ -9,13 +9,16 @@
>按住说话
</view>
<view class="touch-btn" v-if="keyboardIsShow">
<uv-input class="input-box" ref="inputRef" v-model.trim="answerValue" maxlength="500"
<uv-input class="input-box" ref="inputRef" v-model="answerValue" maxlength="500"
placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入文字">
</uv-input>
</view>
<view class="talk-btn-box" @click.stop="showKeyboard" v-show="!onlyVoice">
<image class="talk-btn-icon" v-show="!keyboardIsShow" src="/src/static/images/course/jianpan.png" mode=""></image>
<image class="talk-btn-icon" v-show="keyboardIsShow" src="/src/static/images/course/send.png" mode=""></image>
<view class="talk-btn-box" v-show="!onlyVoice">
<image class="talk-btn-icon" v-show="!keyboardIsShow" src="/src/static/images/course/jianpan.png" mode="" @click="changeBtn"></image>
<image class="talk-btn-icon" v-show="keyboardIsShow && !answerValue" src="/src/static/images/course/record.png" mode="" @click="changeBtn"></image>
<image class="talk-btn-icon" v-show="keyboardIsShow && !!answerValue" src="/src/static/images/course/send.png" mode=""
@click.stop="showKeyboard"
></image>
</view>
<uv-overlay :show="showTalkingModel" opacity=".9" @click="showTalkingModel = false">
<view class="overlay-box">
@@ -83,6 +86,8 @@ watch(()=>props.onlyVoice,()=>{},{
})
const showTalkingModel = ref(false)
const keyboardIsShow = ref(false)
const answerValue = ref('')
const talkBtnRef = ref()
// 录音
@@ -267,17 +272,15 @@ const showKeyboard = () => {
}
if(!isDisabled.value){
if(keyboardIsShow.value){
if(answerValue.value){
if(answerValue.value.trim()){
emit(
'submitAnswer',
answerValue.value,
() => {
keyboardIsShow.value = !keyboardIsShow.value
answerValue.value = ''
}
changeBtn
)
}else{
keyboardIsShow.value = !keyboardIsShow.value
// keyboardIsShow.value = !keyboardIsShow.value
common.msg("不能发送空白消息!")
}
}else{
keyboardIsShow.value = !keyboardIsShow.value
@@ -290,6 +293,10 @@ const showKeyboard = () => {
})
}
}
const changeBtn = () => {
keyboardIsShow.value = !keyboardIsShow.value
answerValue.value = ''
}
</script>
<style lang="scss" scoped>
@@ -425,5 +432,7 @@ const showKeyboard = () => {
}
}
}
::v-deep .uv-input__content__field-wrapper__field{
padding-right: 60rpx;
}
</style>
+10 -6
View File
@@ -32,11 +32,11 @@
<view class="filter-type" v-for="item in tagsTree" :key="item.value">
<!-- .filter(t=>(t.children||[]).length>0) -->
<view class="filter-type-title">{{item.label}}</view>
<view class="filter-type-list">
<scroll-view :scroll-x="true" class="filter-type-list">
<view :class="['filter-type-item', activeTag===itemT.value?'is-active':'']" v-for="itemT in (item.children||[])" @click="chooseTag(itemT)">
{{itemT.label}}
</view>
</view>
</scroll-view>
</view>
</view>
<uv-scroll-list class="tags-view" :indicator="false">
@@ -284,6 +284,9 @@ import { onShow } from "@dcloudio/uni-app"
getPrdLineTypeListApi().then(res=>{
coursePrdlineList.value = res.body||[]
})
getTraTagListApi().then(res=>{
tagsTree.value = res.body||[]
})
changeTab({name:'全部'})
})
onActivated(() => {
@@ -369,8 +372,8 @@ import { onShow } from "@dcloudio/uni-app"
overflow-y: auto;
z-index: 2;
background-color: #f9f9f9;
box-shadow: 0rpx 19rpx 19rpx rgba(160,160,160,.5);
border-radius: 0 0 20rpx 20rpx;
box-shadow: 0rpx 12rpx 20rpx rgba(160,160,160,.25);
border-radius: 0 0 0rpx 0rpx;
padding: 0rpx 25rpx;
box-sizing: border-box;
.filter-type{
@@ -385,7 +388,8 @@ import { onShow } from "@dcloudio/uni-app"
.filter-type-list{
overflow: hidden;
.filter-type-item{
width: calc(25% - 18rpx);
// width: calc(25% - 18rpx);
display: inline-block;
font-size: 29rpx;
box-sizing: border-box;
padding:0 20rpx;
@@ -401,7 +405,7 @@ import { onShow } from "@dcloudio/uni-app"
border-radius: 6rpx;
margin-bottom: 20rpx;
&:nth-child(4n){
margin-right: 0;
margin-right: 24rpx;
}
&.is-active{
color: #06f;
+1 -1
View File
@@ -49,7 +49,7 @@
<style scoped lang="scss">
.talking-item{
overflow: hidden;
margin-top: 30rpx;
margin-top: 0rpx;
&+.talking-item{
margin-top: 30rpx;
}
+3 -4
View File
@@ -380,7 +380,6 @@
isLoading: true
})
scrollToBottomNow()
console.log(voicePath,111111111)
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {}).then(res=>{
let _res = JSON.parse(res.data)
if(_res.rtnCode === '0000'){
@@ -486,8 +485,8 @@
position: absolute;
overflow: hidden;
left:0;
top: 1%;
height: 102%;
top: 0%;
height: 100%;
width: 100%;
padding: 0;
box-sizing: border-box;
@@ -665,7 +664,7 @@
}
.talking-list{
height: calc(100% - 834rpx);
height: calc(100% - 832rpx);
padding: 12rpx 24rpx;
box-sizing: border-box;
.talking-scroll-list{