新增语音输入功能权限校验及未授权处理;正式环境开放2个账号用于测试
This commit is contained in:
parent
3719c162c3
commit
079db90021
11
env/.env.test
vendored
11
env/.env.test
vendored
@ -4,9 +4,16 @@ NODE_ENV = 'test'
|
|||||||
VITE_SHOW_CONSOLE = true
|
VITE_SHOW_CONSOLE = true
|
||||||
# 是否开启sourcemap
|
# 是否开启sourcemap
|
||||||
VITE_SHOW_SOURCEMAP = true
|
VITE_SHOW_SOURCEMAP = true
|
||||||
# baseUrl
|
|
||||||
|
# # baseUrl
|
||||||
VITE_BASEURL = 'http://172.16.100.93:8503'
|
VITE_BASEURL = 'http://172.16.100.93:8503'
|
||||||
#VITE_SOCKET_API
|
# #VITE_SOCKET_API
|
||||||
VITE_SOCKET_API = 'ws://172.16.100.93:8504'
|
VITE_SOCKET_API = 'ws://172.16.100.93:8504'
|
||||||
|
|
||||||
|
# baseUrl
|
||||||
|
# VITE_BASEURL = 'http://192.168.88.21:9503'
|
||||||
|
#VITE_SOCKET_API
|
||||||
|
# VITE_SOCKET_API = 'ws://192.168.88.21:9504'
|
||||||
|
|
||||||
# EPRAPI baseUrl
|
# EPRAPI baseUrl
|
||||||
VITE_EPR_BASEURL = 'http://114.218.158.24:9020'
|
VITE_EPR_BASEURL = 'http://114.218.158.24:9020'
|
||||||
|
@ -219,7 +219,14 @@
|
|||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex;" :class="item.user_id === talkParams.uid?'justify-end':'justify-start'">
|
<div
|
||||||
|
style="display: flex;"
|
||||||
|
:class="
|
||||||
|
item.user_id === talkParams.uid
|
||||||
|
? 'justify-end'
|
||||||
|
: 'justify-start'
|
||||||
|
"
|
||||||
|
>
|
||||||
<div class="talk-tools voice-content" v-if="item.voiceContent">
|
<div class="talk-tools voice-content" v-if="item.voiceContent">
|
||||||
<span>{{ item.voiceContent }}</span>
|
<span>{{ item.voiceContent }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -290,13 +297,17 @@
|
|||||||
<div
|
<div
|
||||||
class="pt-[16rpx] ml-[32rpx] mr-[32rpx] flex items-start justify-between"
|
class="pt-[16rpx] ml-[32rpx] mr-[32rpx] flex items-start justify-between"
|
||||||
>
|
>
|
||||||
<!-- <tm-image
|
<tm-image
|
||||||
:width="52"
|
:width="52"
|
||||||
:height="52"
|
:height="52"
|
||||||
style="margin: 10rpx 10rpx 0 0 "
|
style="margin: 10rpx 10rpx 0 0;"
|
||||||
:src="state.isUseSpeech ? keyboardIcon : microphoneIcon"
|
:src="state.isUseSpeech ? keyboardIcon : microphoneIcon"
|
||||||
@click="changeEditorMode"
|
@click="changeEditorMode"
|
||||||
></tm-image> -->
|
v-if="
|
||||||
|
userStore.mobile === '13580848136' ||
|
||||||
|
userStore.mobile === '18100591363'
|
||||||
|
"
|
||||||
|
></tm-image>
|
||||||
<div class="flex-1 quillBox" style="">
|
<div class="flex-1 quillBox" style="">
|
||||||
<QuillEditor
|
<QuillEditor
|
||||||
ref="editor"
|
ref="editor"
|
||||||
@ -948,7 +959,7 @@ const handleHidePanel = () => {
|
|||||||
//切换键盘输入/语音输入
|
//切换键盘输入/语音输入
|
||||||
const changeEditorMode = () => {
|
const changeEditorMode = () => {
|
||||||
state.value.isUseSpeech = !state.value.isUseSpeech
|
state.value.isUseSpeech = !state.value.isUseSpeech
|
||||||
if(state.value.isUseSpeech){
|
if (state.value.isUseSpeech) {
|
||||||
//如果切换为语音输入,则删除引用
|
//如果切换为语音输入,则删除引用
|
||||||
state.value.quoteInfo = null
|
state.value.quoteInfo = null
|
||||||
}
|
}
|
||||||
@ -1449,7 +1460,7 @@ const multipleChoose = (item) => {
|
|||||||
|
|
||||||
const actionCite = (item) => {
|
const actionCite = (item) => {
|
||||||
console.log('引用')
|
console.log('引用')
|
||||||
if(state.value.isUseSpeech){
|
if (state.value.isUseSpeech) {
|
||||||
state.value.isUseSpeech = false
|
state.value.isUseSpeech = false
|
||||||
}
|
}
|
||||||
state.value.quoteInfo = item
|
state.value.quoteInfo = item
|
||||||
|
@ -105,7 +105,11 @@
|
|||||||
src="@/static/image/record/chat-voice-cancel-blue.png"
|
src="@/static/image/record/chat-voice-cancel-blue.png"
|
||||||
></image>
|
></image>
|
||||||
<text v-if="recording" class="font-36 font-regular"></text>
|
<text v-if="recording" class="font-36 font-regular"></text>
|
||||||
<text v-if="!recording" class="font-36 font-regular" style="margin:20rpx 0 0;">
|
<text
|
||||||
|
v-if="!recording"
|
||||||
|
class="font-36 font-regular"
|
||||||
|
style="margin: 20rpx 0 0;"
|
||||||
|
>
|
||||||
{{ $t('release_hand_to_cancel') }}
|
{{ $t('release_hand_to_cancel') }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
@ -271,13 +275,14 @@ export default {
|
|||||||
startTouchData: {},
|
startTouchData: {},
|
||||||
popupHeight: '0px', // 这是初始的高度
|
popupHeight: '0px', // 这是初始的高度
|
||||||
recording: true, // 录音中
|
recording: true, // 录音中
|
||||||
recordPopupShow: false,//是否显示录音弹窗
|
recordPopupShow: false, //是否显示录音弹窗
|
||||||
recordTimeout: null, // 录音定时器
|
recordTimeout: null, // 录音定时器
|
||||||
recordAnimationAreaCancelBg: recordCancelBg, //录音动画区域取消时背景
|
recordAnimationAreaCancelBg: recordCancelBg, //录音动画区域取消时背景
|
||||||
permissionInfo: '', //当前请求的权限
|
permissionInfo: '', //当前请求的权限
|
||||||
nearTimeLimit: false, //是否录音将超时
|
nearTimeLimit: false, //是否录音将超时
|
||||||
autoStopRecordCountDown: 0, //自动停止录音倒计时
|
autoStopRecordCountDown: 0, //自动停止录音倒计时
|
||||||
autoStopRecordInterval: null, //自动停止录音技术定时器
|
autoStopRecordInterval: null, //自动停止录音技术定时器
|
||||||
|
permisionState: false, //权限授权状态
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -330,12 +335,32 @@ export default {
|
|||||||
upx2px(upx) {
|
upx2px(upx) {
|
||||||
return uni.upx2px(upx) + 'px'
|
return uni.upx2px(upx) + 'px'
|
||||||
},
|
},
|
||||||
handleAppMicro() {
|
handleAppMicro(permissionStatus) {
|
||||||
let that = this
|
let that = this
|
||||||
setTimeout(function () {
|
// setTimeout(function () {
|
||||||
that.$refs.requestPer.hideCustomPermission()
|
// that.$refs.requestPer.hideCustomPermission()
|
||||||
}, 1000)
|
// }, 1000)
|
||||||
that.continueAppMicro()
|
if (Number(permissionStatus) === 1) {
|
||||||
|
that.continueAppMicro()
|
||||||
|
} else if (Number(permissionStatus) === -1) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '检测到您还未授权麦克风哦',
|
||||||
|
showCancel: true,
|
||||||
|
confirmText: '去授权',
|
||||||
|
cancelText: '保持拒绝',
|
||||||
|
success: ({ confirm, cancel }) => {
|
||||||
|
if (confirm) {
|
||||||
|
let OAWebView = plus.webview.all()
|
||||||
|
OAWebView.forEach((webview, index) => {
|
||||||
|
if (webview.id === 'webviewId1') {
|
||||||
|
webview.evalJS(`handleRequestAndroidPermission('settings')`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleRequestPer(permissionInfo, permissionID) {
|
handleRequestPer(permissionInfo, permissionID) {
|
||||||
console.log(permissionInfo)
|
console.log(permissionInfo)
|
||||||
@ -365,8 +390,6 @@ export default {
|
|||||||
if (isUserNotAllow) {
|
if (isUserNotAllow) {
|
||||||
//用户拒绝了录音权限
|
//用户拒绝了录音权限
|
||||||
//这里你应当编写代码进行引导用户给录音权限,不同平台分别进行编写
|
//这里你应当编写代码进行引导用户给录音权限,不同平台分别进行编写
|
||||||
} else {
|
|
||||||
message.error('似乎没检测到您的麦克风哦')
|
|
||||||
}
|
}
|
||||||
console.error('请求录音权限失败:' + msg)
|
console.error('请求录音权限失败:' + msg)
|
||||||
},
|
},
|
||||||
@ -410,14 +433,11 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if (typeof plus !== 'undefined') {
|
if (typeof plus !== 'undefined') {
|
||||||
webUni.postMessage({
|
let OAWebView = plus.webview.all()
|
||||||
data: {
|
OAWebView.forEach((webview, index) => {
|
||||||
action: 'handleRequestAndroidPermission',
|
if (webview.id === 'webviewId1') {
|
||||||
params: {
|
webview.evalJS(`handleRequestAndroidPermission('micro')`)
|
||||||
type: 'micro',
|
}
|
||||||
key: that.field,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
that.continueAppMicro()
|
that.continueAppMicro()
|
||||||
@ -622,7 +642,7 @@ export default {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #1a1a1a;
|
color: #1a1a1a;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text{
|
text {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user