Merge branch 'sit' into 'uat'
Sit See merge request K17_AITS/tra-app!28
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,19 +69,14 @@ const audioObj = uni.createInnerAudioContext()
|
||||
//#ifdef APP-PLUS
|
||||
// app端
|
||||
const recordObjCom = ref({})
|
||||
const IsAndEnv = getPhoneEnvBool('AND')
|
||||
const initRecord = () => {
|
||||
recordObjCom.value = uni.getRecorderManager()
|
||||
// startRecord()
|
||||
// stopRecord()
|
||||
unref(recordObjCom)?.onStop((res, duration)=>{
|
||||
audioPath.value = res.tempFilePath
|
||||
uni.saveFile({
|
||||
tempFilePath:res.tempFilePath,
|
||||
success:(res)=>{
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
unref(recordObjCom).start({format:'mp3'})
|
||||
stopRecord()
|
||||
}
|
||||
const startRecord = () => {
|
||||
unref(recordObjCom).start({format:'mp3'})
|
||||
@@ -96,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
|
||||
})
|
||||
// 录音结束
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, computed, unref, onMounted, onUnmounted, getCurrentInstance, nextTick } from 'vue';
|
||||
import { onLoad,onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import { onLoad,onShow, onUnload,onHide } from '@dcloudio/uni-app';
|
||||
import {
|
||||
previewFile,
|
||||
downloadFile,
|
||||
@@ -233,6 +233,8 @@ const getData = async (flag) => {
|
||||
}
|
||||
}catch{
|
||||
|
||||
}finally{
|
||||
watchFlag.value +=1
|
||||
}
|
||||
};
|
||||
|
||||
@@ -582,9 +584,18 @@ const showTalkingModel = ref(false)
|
||||
// onMounted(()=>{
|
||||
// getData('1');
|
||||
// })
|
||||
// onShow(()=>{
|
||||
// getData('2');
|
||||
// })
|
||||
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?.()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{{item.bbsContent}}
|
||||
</view>
|
||||
<view class="img_div pic-cell">
|
||||
<image-preview v-for="img in item.imgIdList" :imgId="img" class="pic-item"></image-preview>
|
||||
<image-preview v-for="img in item.imgIdList" :imgId="img" class="pic-item" mode="scaleToFill"></image-preview>
|
||||
</view>
|
||||
<view class="time_and_reply">
|
||||
<view class="time">{{item.bbsTm.substr(0,16)}}</view>
|
||||
@@ -42,7 +42,7 @@
|
||||
<view class="message_div" v-for="childrenItem in item.children">
|
||||
<view class="head_div">
|
||||
<image-preview v-if="childrenItem.userIconImgId" class="img-box img"
|
||||
:src="childrenItem.userIconImgId"></image-preview>
|
||||
:src="childrenItem.userIconImgId" ></image-preview>
|
||||
<image v-else src="/static/images/me/default_user_avatar.png" class="img"></image>
|
||||
</view>
|
||||
<view class="msg_content">
|
||||
@@ -197,6 +197,7 @@
|
||||
border-radius: 8rpx;
|
||||
// background-color: red;
|
||||
margin-bottom: 24rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.send_evaluate_div_height {
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-middle font_pf">
|
||||
<view class="fz-30 fw-400 mb-8">发布日期</view>
|
||||
<view class="fz-30 fw-400">{{ common.formatDate2(modelValue.issuTm, 'yyyy-MM-dd HH:mm') }}</view>
|
||||
<view class="fz-30 fw-400 mb-8">更新日期</view>
|
||||
<view class="fz-30 fw-400">{{ common.formatDate2(modelValue.mtTime, 'yyyy-MM-dd HH:mm') }}</view>
|
||||
</view>
|
||||
<view class="info-bottom">
|
||||
<view class="bottom-left">
|
||||
|
||||
Reference in New Issue
Block a user