Merge branch 'develop' of http://25.13.9.101:9000/K17_AITS/tra-app into develop
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
ENV = 'development'
|
||||
# 'development'
|
||||
|
||||
VITE_APP_ENV = 'AND'
|
||||
|
||||
# base api
|
||||
|
||||
# 苗扬
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# 生产环境
|
||||
ENV = 'production'
|
||||
|
||||
VITE_APP_ENV = 'AND'
|
||||
|
||||
# base api
|
||||
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# SIT环境
|
||||
ENV = 'sit'
|
||||
|
||||
VITE_APP_ENV = 'AND'
|
||||
|
||||
# base api
|
||||
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# SIT环境
|
||||
ENV = 'sit'
|
||||
|
||||
VITE_APP_ENV = 'IOS'
|
||||
|
||||
# base api
|
||||
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
@@ -1,6 +1,8 @@
|
||||
# UAT环境
|
||||
ENV = 'uat'
|
||||
|
||||
VITE_APP_ENV = 'AND'
|
||||
|
||||
# base api
|
||||
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7003'
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# UAT环境
|
||||
ENV = 'uat'
|
||||
|
||||
VITE_APP_ENV = 'IOS'
|
||||
|
||||
# base api
|
||||
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7003'
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
const _ENV = import.meta.env
|
||||
|
||||
function msg(title, duration = 1000) {
|
||||
uni.showToast({
|
||||
title: title,
|
||||
@@ -114,7 +116,7 @@ export const getUserInfo = (key = '') => {
|
||||
const userInfo = uni.getStorageSync('userInfo')
|
||||
return '' === key ? userInfo : userInfo[key];
|
||||
}
|
||||
|
||||
export const getPhoneEnvBool = (flag) => _ENV.VITE_APP_ENV === flag
|
||||
|
||||
|
||||
// 将对象和字符串相互转换
|
||||
|
||||
@@ -38,9 +38,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { toRefs, ref, computed, unref, onMounted, onUnmounted, nextTick, watch } from 'vue';
|
||||
import { toRefs, ref, computed, unref, onMounted, onUnmounted, nextTick, watch, getCurrentInstance } from 'vue';
|
||||
import common from '../../../common/common';
|
||||
import permission from '@/common/permission.js'
|
||||
import { getPhoneEnvBool } from '@/common/common.js'
|
||||
const proxy = getCurrentInstance()
|
||||
const emit = defineEmits(['uploadVoice', 'submitAnswer','startRecord'])
|
||||
const props = defineProps({
|
||||
isDisabled:{
|
||||
@@ -67,10 +69,11 @@ const audioObj = uni.createInnerAudioContext()
|
||||
//#ifdef APP-PLUS
|
||||
// app端
|
||||
const recordObjCom = ref({})
|
||||
const IsAndEnv = getPhoneEnvBool('AND')
|
||||
const initRecord = () => {
|
||||
recordObjCom.value = uni.getRecorderManager()
|
||||
startRecord()
|
||||
stopRecord()
|
||||
// startRecord()
|
||||
// stopRecord()
|
||||
unref(recordObjCom)?.onStop((res, duration)=>{
|
||||
audioPath.value = res.tempFilePath
|
||||
})
|
||||
@@ -90,22 +93,36 @@ const initRecord = () => {}
|
||||
// #endif
|
||||
onMounted(async ()=>{
|
||||
initRecord?.()
|
||||
// //#ifdef APP-PLUS
|
||||
// //#ifdef __IOS__
|
||||
// // ios端
|
||||
// let _recordPerm = permission.judgeIosPermission('record')
|
||||
// if(!_recordPerm){
|
||||
// permission.gotoAppPermissionSetting()
|
||||
// }
|
||||
// // #endif
|
||||
// // #endif
|
||||
// //#ifdef APP-PLUS
|
||||
// // 安卓端
|
||||
// let _recordPerm = await permission.requestAndroidPermission('android.permission.RECORD_AUDIO')
|
||||
// if(_recordPerm !== 1){
|
||||
// permission.gotoAppPermissionSetting()
|
||||
// }
|
||||
// // #endif
|
||||
//#ifdef APP-PLUS
|
||||
// 安卓端
|
||||
if(IsAndEnv){
|
||||
let _recordPerm = await permission.requestAndroidPermission('android.permission.RECORD_AUDIO')
|
||||
if(_recordPerm !== 1){
|
||||
common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?',true, '取消','确定').then((res) => {
|
||||
if(res) {
|
||||
// 去开启权限
|
||||
permission.gotoAppPermissionSetting()
|
||||
}else{
|
||||
// 取消
|
||||
common.redirectTo('/pages/index/index')
|
||||
}
|
||||
})
|
||||
}
|
||||
}else{
|
||||
let _recordPerm = permission.judgeIosPermission('record')
|
||||
if(!_recordPerm){
|
||||
common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?',true, '取消','确定').then((res) => {
|
||||
if(res) {
|
||||
// 去开启权限
|
||||
permission.gotoAppPermissionSetting()
|
||||
}else{
|
||||
// 取消
|
||||
common.redirectTo('/pages/index/index')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
// 录音结束
|
||||
|
||||
|
||||
@@ -233,6 +233,8 @@ const getData = async (flag) => {
|
||||
}
|
||||
}catch{
|
||||
|
||||
}finally{
|
||||
watchFlag.value +=1
|
||||
}
|
||||
};
|
||||
|
||||
@@ -583,14 +585,17 @@ const showTalkingModel = ref(false)
|
||||
// getData('1');
|
||||
// })
|
||||
onHide(()=>{
|
||||
if(watchFlag.value === 1) return
|
||||
socketStore.closeSocket()
|
||||
common.show('提示信息', '检测到您已离开,即将退出学习页面。',false, '','确认').then((res) => {
|
||||
common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
|
||||
}).finally(() => {})
|
||||
})
|
||||
onShow(()=>{
|
||||
if(watchFlag.value === 1) return
|
||||
socketStore.createSocket()
|
||||
})
|
||||
const watchFlag = ref(1)
|
||||
onUnload(()=>{
|
||||
changePlayItemId()
|
||||
teacherVoiceObj?.stop?.()
|
||||
|
||||
Reference in New Issue
Block a user