样式调整
This commit is contained in:
@@ -153,22 +153,24 @@ const initRecord = () => {
|
||||
})
|
||||
}
|
||||
const startFlag = ref(1)
|
||||
const canStart = ref(true)
|
||||
const startRecord = () => {
|
||||
unref(recordObjCom).start({format:'mp3'})
|
||||
}
|
||||
|
||||
const stopRecord = () => {
|
||||
// setTimeout(() => {
|
||||
try{
|
||||
if(unref(recordObjCom).stop){
|
||||
unref(recordObjCom).stop()
|
||||
}else{
|
||||
closeModel()
|
||||
}
|
||||
}catch{
|
||||
try{
|
||||
if(unref(recordObjCom).stop){
|
||||
unref(recordObjCom).stop()
|
||||
}else{
|
||||
closeModel()
|
||||
}
|
||||
// }, 500)
|
||||
}catch{
|
||||
closeModel()
|
||||
}
|
||||
setTimeout(() => {
|
||||
canStart.value = true
|
||||
}, 1000)
|
||||
}
|
||||
const closeModel = (cb = () => {}) => {
|
||||
setTimeout(() => {
|
||||
@@ -258,6 +260,9 @@ const showOverlayTalking = (obj) => {
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!canStart.value){
|
||||
return
|
||||
}
|
||||
isMoving.value = true
|
||||
emit('startRecord')
|
||||
recNum.value += 1
|
||||
@@ -266,6 +271,7 @@ const showOverlayTalking = (obj) => {
|
||||
touchY.value = obj.changedTouches[0].pageY
|
||||
baseY.value = obj.currentTarget.offsetTop
|
||||
//#ifdef APP-PLUS
|
||||
canStart.value = false
|
||||
startRecord()
|
||||
// #endif
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
<view class="talking-cont">
|
||||
<MarkdownPreview :mdString="mdText"/>
|
||||
</view>
|
||||
<view class="btns-cont" v-if="false">
|
||||
<view class="btns-cont" v-if="!props.isAnswering">
|
||||
<view class="replay-btn" @click="reAnswer">
|
||||
<image class="icon" src="@/static/images/dialog/answer-restart.png" style="width: 100%;height: 100%;"></image>
|
||||
</view>
|
||||
<view class="replay-btn" @click="stopAnswer">
|
||||
<!-- <view class="replay-btn" @click="stopAnswer">
|
||||
<image class="icon" src="@/static/images/dialog/answer-stop.png" style="width: 100%;height: 100%;"></image>
|
||||
</view>
|
||||
<!-- <view class="replay-btn" @click="zanAnswer">
|
||||
</view> -->
|
||||
<view class="replay-btn" @click="zanAnswer">
|
||||
<image
|
||||
class="icon"
|
||||
src="@/static/images/dialog/answer-zan.png"
|
||||
@@ -39,7 +39,7 @@
|
||||
src="@/static/images/dialog/answer-yifankui.png"
|
||||
style="width: 100%;height: 100%;"
|
||||
></image>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -57,6 +57,10 @@
|
||||
isLoading:{
|
||||
default: false,
|
||||
type:Boolean
|
||||
},
|
||||
isAnswering: {
|
||||
default: false,
|
||||
type: Boolean
|
||||
}
|
||||
})
|
||||
|
||||
@@ -89,95 +93,96 @@
|
||||
.talking-cont{
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.btns-cont{
|
||||
.btns-cont{
|
||||
overflow: hidden;
|
||||
border-top: 3rpx solid #eee;
|
||||
padding-bottom: 10rpx;
|
||||
.replay-btn{
|
||||
float: left;
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
overflow: hidden;
|
||||
border-top: 3rpx solid #eee;
|
||||
.replay-btn{
|
||||
float: left;
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 16rpx;
|
||||
margin-top: 25rpx;
|
||||
}
|
||||
.play-btn{
|
||||
float: left;
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 16rpx;
|
||||
margin-top: 25rpx;
|
||||
}
|
||||
.next-learn-btn{
|
||||
float: left;
|
||||
padding: 0 60rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
line-height: 62rpx;
|
||||
font-size: 30rpx;
|
||||
background-color: #06f;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
margin-right: 16rpx;
|
||||
position: relative;
|
||||
&.replay-study-btn{
|
||||
float: right;
|
||||
}
|
||||
&.restart{
|
||||
background-color: #eaf2ff;
|
||||
color: #06f;
|
||||
}
|
||||
.icon-iamge{
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 50%;
|
||||
margin-top: -12rpx;
|
||||
}
|
||||
}
|
||||
.replay-learn-btn{
|
||||
float: left;
|
||||
padding: 0 60rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
line-height: 62rpx;
|
||||
font-size: 30rpx;
|
||||
color: #06f;
|
||||
background-color: #eaf2ff;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
margin-right: 16rpx;
|
||||
position: relative;
|
||||
.icon-iamge{
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 50%;
|
||||
margin-top: -12rpx;
|
||||
}
|
||||
}
|
||||
.next-btn{
|
||||
margin-right: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.play-btn{
|
||||
float: left;
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.next-learn-btn{
|
||||
float: left;
|
||||
padding: 0 60rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
line-height: 62rpx;
|
||||
font-size: 30rpx;
|
||||
background-color: #06f;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
margin-right: 16rpx;
|
||||
position: relative;
|
||||
&.replay-study-btn{
|
||||
float: right;
|
||||
padding: 0 60rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
line-height: 62rpx;
|
||||
font-size: 30rpx;
|
||||
background-color: #06f;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
position: relative;
|
||||
.icon-iamge{
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 50%;
|
||||
margin-top: -12rpx;
|
||||
}
|
||||
}
|
||||
&.restart{
|
||||
background-color: #eaf2ff;
|
||||
color: #06f;
|
||||
}
|
||||
.icon-iamge{
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 50%;
|
||||
margin-top: -12rpx;
|
||||
}
|
||||
}
|
||||
.replay-learn-btn{
|
||||
float: left;
|
||||
padding: 0 60rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
line-height: 62rpx;
|
||||
font-size: 30rpx;
|
||||
color: #06f;
|
||||
background-color: #eaf2ff;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
margin-right: 16rpx;
|
||||
position: relative;
|
||||
.icon-iamge{
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 50%;
|
||||
margin-top: -12rpx;
|
||||
}
|
||||
}
|
||||
.next-btn{
|
||||
float: right;
|
||||
padding: 0 60rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
line-height: 62rpx;
|
||||
font-size: 30rpx;
|
||||
background-color: #06f;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
position: relative;
|
||||
.icon-iamge{
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 50%;
|
||||
margin-top: -12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -10,6 +10,7 @@
|
||||
v-else-if="talkingType === 'answer'"
|
||||
:dataInfo="props.talkingInfo"
|
||||
:isLoading="!!props.talkingInfo.isLoading"
|
||||
:isAnswering="props.isAnswering"
|
||||
@handleEvents="handleEvents"
|
||||
></answerVue>
|
||||
<view v-else></view>
|
||||
@@ -34,6 +35,10 @@
|
||||
activeVoiceId:{
|
||||
default:'',
|
||||
type: String
|
||||
},
|
||||
isAnswering: {
|
||||
default: false,
|
||||
type: Boolean
|
||||
}
|
||||
})
|
||||
watch(() => props.activeVoiceId, () => {},{deep: true,immediate: true})
|
||||
|
||||
+21
-16
@@ -44,7 +44,7 @@
|
||||
<view class="talking-list">
|
||||
<scroll-view class="talking-scroll-list" :scroll-y="true" :scroll-top="scrollTop"
|
||||
:show-scrollbar="false" :scroll-with-animation="false">
|
||||
<TalkingItem v-for="item in talkingList" :talkingType="item.type" :talkingInfo="item"
|
||||
<TalkingItem v-for="item in talkingList" :talkingType="item.type" :talkingInfo="item" :isAnswering="!answerIsOver"
|
||||
:activeVoiceId="activeVoiceTalkingItemId" @handleEvents="talkItemEvents">
|
||||
</TalkingItem>
|
||||
</scroll-view>
|
||||
@@ -287,7 +287,8 @@
|
||||
talkingText: answerText.value,
|
||||
isLoading: false,
|
||||
id: _id,
|
||||
...body
|
||||
...body,
|
||||
askData: {...askData.value}
|
||||
})
|
||||
} else if (body.event === 'token') {
|
||||
answerIsOver.value = false
|
||||
@@ -350,22 +351,26 @@
|
||||
const talkItemEvents = (type, data, id = '') => {
|
||||
switch (type) {
|
||||
case 'reAnswer':
|
||||
console.log('重新获取数据')
|
||||
// 设置停止回调
|
||||
stopAnswerCallBack.value = ($data) => {
|
||||
sendMessage({
|
||||
"commond": 'ASK',
|
||||
"body": $data
|
||||
})
|
||||
}
|
||||
// 停止获取
|
||||
console.log('重新提问回答')
|
||||
sendMessage({
|
||||
"commond": 'ASK-STOP',
|
||||
"body": {
|
||||
reqBatch: reqBatch.value,
|
||||
seqNo: seqNo.value,
|
||||
}
|
||||
"commond": 'ASK',
|
||||
"body": data.askData
|
||||
})
|
||||
// // 设置停止回调
|
||||
// stopAnswerCallBack.value = ($data) => {
|
||||
// sendMessage({
|
||||
// "commond": 'ASK',
|
||||
// "body": $data
|
||||
// })
|
||||
// }
|
||||
// // 停止获取
|
||||
// sendMessage({
|
||||
// "commond": 'ASK-STOP',
|
||||
// "body": {
|
||||
// reqBatch: reqBatch.value,
|
||||
// seqNo: seqNo.value,
|
||||
// }
|
||||
// })
|
||||
break;
|
||||
case 'stop':
|
||||
console.log('停止获取数据')
|
||||
|
||||
Reference in New Issue
Block a user