Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7f6dcaee
authored
Jul 22, 2026
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'hotfix_v5.8.3.2' into 'master'
上线合并 See merge request
!98
2 parents
cbb6d660
c3b20e54
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
139 additions
and
123 deletions
App.vue
env.js
init.js
manifest.json
pages/common/dailyNewspaper/index.vue
utils/recordManager/PathUtils.js
utils/recordManager/RecordSaveService.js
utils/recordManager/RecordService.js
App.vue
View file @
7f6dcae
<
script
>
<
script
>
const
PATH
=
[
'/pages/common/caseDetail'
]
const
PATH
=
[
'/pages/common/caseDetail'
]
const
keepAlive
=
uni
.
requireNativePlugin
(
'Ba-KeepAliveSuit'
)
const
keepAlive
=
uni
.
requireNativePlugin
(
'Ba-KeepAliveSuit'
)
import
{
mapState
}
from
'vuex'
import
{
mapState
}
from
'vuex'
import
{
Ws
}
from
'@/ws/Ws.js'
import
{
Ws
}
from
'@/ws/Ws.js'
import
{
RecordSaveService
,
UploadService
}
from
'@/utils/recordManager/index.js'
import
{
RecordSaveService
,
UploadService
}
from
'@/utils/recordManager/index.js'
import
appCacheApi
from
'@/utils/clearAppCache.js'
export
default
{
import
FloatLogConfig
from
'@/utils/logger/FloatLogConfig.js'
// #ifdef APP-PLUS
import
StoragePathMerge
from
'@/utils/storageMerge/StoragePathMerge.js'
import
{
logStep
as
mergeLogStep
,
logStepFail
as
mergeLogStepFail
}
from
'@/utils/storageMerge/log.js'
// #endif
export
default
{
computed
:
{
computed
:
{
...
mapState
(
'audio'
,
[
'isEnd'
,
'isStart'
])
...
mapState
(
'audio'
,
[
'isEnd'
,
'isStart'
])
},
},
...
@@ -18,29 +12,8 @@
...
@@ -18,29 +12,8 @@
userInfo
:
uni
.
getStorageSync
(
'release_userInfo'
)
userInfo
:
uni
.
getStorageSync
(
'release_userInfo'
)
},
},
onLaunch
:
async
function
()
{
onLaunch
:
async
function
()
{
// 先拉取/应用悬浮窗配置并 install,再合并,避免启动日志丢失
try
{
await
FloatLogConfig
.
refreshFromServer
(
true
)
}
catch
(
_
)
{
/* ignore */
}
// #ifdef APP-PLUS
try
{
await
uni
.
$dbRecord
.
init
()
mergeLogStep
(
'归并·启动'
,
'App onLaunch:主库 init 完成,调用 StoragePathMerge.run()'
)
await
StoragePathMerge
.
run
()
}
catch
(
e
)
{
mergeLogStepFail
(
'归并·启动'
,
'启动数据库/合并异常'
,
{
错误
:
e
?.
message
||
String
(
e
)
})
}
finally
{
uni
.
$resolveStorageMerge
?.()
mergeLogStep
(
'归并·启动'
,
'App onLaunch:归并流程结束(uni.$resolveStorageMerge 已触发)'
)
}
// #endif
// #ifndef APP-PLUS
uni
.
$resolveStorageMerge
?.()
// #endif
this
.
onKeep
()
this
.
onKeep
()
//
this.setAPPVersion()
this
.
setAPPVersion
()
setTimeout
(()
=>
{
setTimeout
(()
=>
{
plus
.
screen
.
unlockOrientation
()
//解除锁定屏幕方向
plus
.
screen
.
unlockOrientation
()
//解除锁定屏幕方向
plus
.
screen
.
lockOrientation
(
'landscape-primary'
)
plus
.
screen
.
lockOrientation
(
'landscape-primary'
)
...
@@ -75,13 +48,23 @@
...
@@ -75,13 +48,23 @@
}
}
},
},
onShow
:
async
function
()
{
onShow
:
async
function
()
{
appCacheApi
.
clearAppCache
()
this
.
$store
.
dispatch
(
'setBackgroundState'
,
false
)
this
.
$store
.
dispatch
(
'setBackgroundState'
,
false
)
this
.
$store
.
dispatch
(
'setActivityWindowPopCount'
,
1
)
//冷启动重置活动弹框次数
this
.
$store
.
dispatch
(
'setActivityWindowPopCount'
,
1
)
//冷启动重置活动弹框次数
// 触发轮询开始事件,通知上传管理重新开始轮询
// UploadService.startPolling()
RecordSaveService
.
startPolling
()
RecordSaveService
.
startPolling
()
uni
.
onMemoryWarning
(
function
()
{
uni
.
onMemoryWarning
(
function
()
{
console
.
log
(
'onMemoryWarningReceive'
)
console
.
log
(
'onMemoryWarningReceive'
)
})
})
// const systemInfo = await uni.$api.systemApi.getMockData();
// if (systemInfo.isCheckedUpdate) {
// checkUpdate();
// }
// let version = plus.runtime.version;
// uni.$api.commonApi.getAPPVersion().then((res) => {
// if (res != version && !systemInfo.isCheckedUpdate)
// this.$store.dispatch("openUpdateModal");
// });
},
},
onHide
:
function
()
{
onHide
:
function
()
{
this
.
$store
.
dispatch
(
'setBackgroundState'
,
true
)
this
.
$store
.
dispatch
(
'setBackgroundState'
,
true
)
...
@@ -119,47 +102,47 @@
...
@@ -119,47 +102,47 @@
console
.
error
(
'Promise 异常上报失败:'
,
error
)
console
.
error
(
'Promise 异常上报失败:'
,
error
)
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
page
{
page
{
font-size
:
28
rpx
;
font-size
:
28
rpx
;
height
:
100%
;
height
:
100%
;
min-height
:
100%
;
min-height
:
100%
;
}
}
view
,
view
,
navigator
,
navigator
,
image
,
image
,
text
,
text
,
scroll-view
,
scroll-view
,
swiper
,
swiper
,
swiper-item
,
swiper-item
,
input
,
input
,
textarea
,
textarea
,
button
{
button
{
box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
}
/* 文字避头尾法则 */
/* 文字避头尾法则 */
.btw
{
.btw
{
table-layout
:
fixed
;
table-layout
:
fixed
;
word-wrap
:
break-word
;
word-wrap
:
break-word
;
word-break
:
normal
;
word-break
:
normal
;
text-align
:
justify
;
text-align
:
justify
;
text-justify
:
inter-ideograph
;
text-justify
:
inter-ideograph
;
}
}
.bg-white
{
.bg-white
{
background
:
#fff
;
background
:
#fff
;
}
}
.font-weight
{
.font-weight
{
font-weight
:
bold
;
font-weight
:
bold
;
}
}
.u-flex-center
{
.u-flex-center
{
display
:
flex
;
display
:
flex
;
flex-direction
:
row
;
flex-direction
:
row
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
}
}
button
{
button
{
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
line-height
:
1.5
;
line-height
:
1.5
;
...
@@ -167,19 +150,19 @@
...
@@ -167,19 +150,19 @@
background-color
:
transparent
;
background-color
:
transparent
;
border-radius
:
0
;
border-radius
:
0
;
position
:
relative
;
position
:
relative
;
}
}
button
::after
{
button
::after
{
border
:
none
;
border
:
none
;
}
}
//
指定按钮按下去的样式类
//
指定按钮按下去的样式类
.button-hover
{
.button-hover
{
transform
:
translate
(
1
rpx
,
1
rpx
);
transform
:
translate
(
1
rpx
,
1
rpx
);
}
}
.webview-container
{
.webview-container
{
position
:
absolute
;
position
:
absolute
;
width
:
100
rpx
;
width
:
100
rpx
;
height
:
100
rpx
;
height
:
100
rpx
;
top
:
0
rpx
;
top
:
0
rpx
;
left
:
0
rpx
;
left
:
0
rpx
;
}
}
</
style
>
</
style
>
env.js
View file @
7f6dcae
const
target
=
[
'ip'
,
'dev'
,
'uat'
,
'prod'
,
'beta'
]
const
target
=
[
'ip'
,
'dev'
,
'uat'
,
'prod'
,
'beta'
]
const
index
=
2
const
index
=
3
/**
/**
*
*
0本地
0本地
...
...
init.js
View file @
7f6dcae
...
@@ -75,12 +75,12 @@ uni.signHttpConfig = {
...
@@ -75,12 +75,12 @@ uni.signHttpConfig = {
if
(
error
&&
error
.
errMsg
==
'request:fail'
)
{
if
(
error
&&
error
.
errMsg
==
'request:fail'
)
{
return
uni
.
showToast
({
return
uni
.
showToast
({
title
:
'网络异常'
,
title
:
'网络异常'
,
icon
:
'none'
,
icon
:
'none'
})
})
}
}
uni
.
showToast
({
uni
.
showToast
({
title
:
error
.
msg
||
'业务异常'
,
title
:
error
.
msg
||
'业务异常'
,
icon
:
'none'
,
icon
:
'none'
})
})
},
},
logout
:
config
=>
{
logout
:
config
=>
{
...
@@ -103,15 +103,15 @@ uni.signHttpConfig = {
...
@@ -103,15 +103,15 @@ uni.signHttpConfig = {
if
(
!
uni
.
$dbRecord
)
{
if
(
!
uni
.
$dbRecord
)
{
uni
.
$dbRecord
=
new
DBRecord
()
uni
.
$dbRecord
=
new
DBRecord
()
}
}
uni
.
$storageMergeDone
=
new
Promise
(
resolve
=>
{
//
uni.$storageMergeDone = new Promise(resolve => {
uni
.
$resolveStorageMerge
=
resolve
//
uni.$resolveStorageMerge = resolve
})
//
})
// 导出数据库初始化 Promise,供其他模块等待
// 导出数据库初始化 Promise,供其他模块等待
if
(
!
uni
.
$dbReady
)
{
if
(
!
uni
.
$dbReady
)
{
uni
.
$dbReady
=
(
async
_
=>
{
uni
.
$dbReady
=
(
async
_
=>
{
try
{
try
{
await
uni
.
$dbRecord
.
init
()
await
uni
.
$dbRecord
.
init
()
await
uni
.
$storageMergeDone
//
await uni.$storageMergeDone
uni
.
$logger
.
local
.
info
(
'数据库初始化与路径合并已完成'
)
uni
.
$logger
.
local
.
info
(
'数据库初始化与路径合并已完成'
)
return
true
return
true
}
catch
(
e
)
{
}
catch
(
e
)
{
...
...
manifest.json
View file @
7f6dcae
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
"name"
:
"展业助手"
,
"name"
:
"展业助手"
,
"appid"
:
"__UNI__D3BD3DF"
,
"appid"
:
"__UNI__D3BD3DF"
,
"description"
:
""
,
"description"
:
""
,
"versionName"
:
"2.26.
0
"
,
"versionName"
:
"2.26.
2
"
,
"versionCode"
:
226
0
,
"versionCode"
:
226
2
,
"transformPx"
:
false
,
"transformPx"
:
false
,
"sassImplementationName"
:
"node-sass"
,
"sassImplementationName"
:
"node-sass"
,
/*
5
+App特有相关
*/
/*
5
+App特有相关
*/
...
...
pages/common/dailyNewspaper/index.vue
View file @
7f6dcae
...
@@ -412,12 +412,12 @@ export default {
...
@@ -412,12 +412,12 @@ export default {
if
(
this
.
templateType
==
2
&&
!
skip
)
{
if
(
this
.
templateType
==
2
&&
!
skip
)
{
uni
.
hideLoading
()
uni
.
hideLoading
()
this
.
noticeObj
=
{
this
.
noticeObj
=
{
title
:
'
重要提示
'
,
title
:
'
确定提交门店日报?
'
,
text
:
'
确认提交后将不可再编辑,确认继续?
'
,
text
:
'
请确认驻店人员在当前场景下已完成所有个人的驻店日报及洽谈明细。门店日报提交后,将立即发送相关门店经营统计数据到指定消息群。
'
,
type
:
'warning'
,
type
:
'warning'
,
buttons
:
[
buttons
:
[
{
{
text
:
'
取消
'
,
text
:
'
我再想想
'
,
type
:
'default'
,
type
:
'default'
,
callback
:
_
=>
{
callback
:
_
=>
{
this
.
$refs
.
notice
.
close
()
this
.
$refs
.
notice
.
close
()
...
...
utils/recordManager/PathUtils.js
View file @
7f6dcae
...
@@ -28,7 +28,8 @@ class PathUtils {
...
@@ -28,7 +28,8 @@ class PathUtils {
*/
*/
static
join
(...
args
)
{
static
join
(...
args
)
{
if
(
args
.
length
===
0
)
return
''
if
(
args
.
length
===
0
)
return
''
const
parts
=
args
.
map
((
part
,
index
)
=>
{
const
parts
=
args
.
map
((
part
,
index
)
=>
{
if
(
!
part
)
return
''
if
(
!
part
)
return
''
let
str
=
String
(
part
)
let
str
=
String
(
part
)
if
(
index
!==
0
)
{
if
(
index
!==
0
)
{
...
@@ -38,7 +39,8 @@ class PathUtils {
...
@@ -38,7 +39,8 @@ class PathUtils {
str
=
str
.
replace
(
/
\/
+$/
,
''
)
// 去除结尾的斜杠
str
=
str
.
replace
(
/
\/
+$/
,
''
)
// 去除结尾的斜杠
}
}
return
str
return
str
}).
filter
(
p
=>
p
.
length
>
0
)
})
.
filter
(
p
=>
p
.
length
>
0
)
return
parts
.
join
(
'/'
)
return
parts
.
join
(
'/'
)
}
}
...
@@ -58,8 +60,8 @@ class PathUtils {
...
@@ -58,8 +60,8 @@ class PathUtils {
static
getFilePath
()
{
static
getFilePath
()
{
// 1. 优先使用内存缓存,性能最高
// 1. 优先使用内存缓存,性能最高
if
(
this
.
CACHED_ROOT_PATH
)
{
if
(
this
.
CACHED_ROOT_PATH
)
{
uni
.
$logger
?.
local
?.
info
(
`[PathUtils] 命中内存缓存,根路径:
${
this
.
CACHED_ROOT_PATH
}
`
)
;
uni
.
$logger
?.
local
?.
info
(
`[PathUtils] 命中内存缓存,根路径:
${
this
.
CACHED_ROOT_PATH
}
`
)
return
Promise
.
resolve
(
this
.
CACHED_ROOT_PATH
)
;
return
Promise
.
resolve
(
this
.
CACHED_ROOT_PATH
)
}
}
// 2. 尝试读取持久化缓存
// 2. 尝试读取持久化缓存
...
@@ -74,24 +76,38 @@ class PathUtils {
...
@@ -74,24 +76,38 @@ class PathUtils {
// 3. 无缓存,请求原生文件系统API
// 3. 无缓存,请求原生文件系统API
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
plus
)
{
if
(
!
plus
)
{
reject
(
new
Error
(
'plus runtime 未初始化'
))
;
reject
(
new
Error
(
'plus runtime 未初始化'
))
return
;
return
}
}
plus
.
io
.
requestFileSystem
(
plus
.
io
.
requestFileSystem
(
plus
.
io
.
PRIVATE_DOC
,
plus
.
io
.
PRIVATE_DOC
,
(
fs
)
=>
{
fs
=>
{
const
fullPath
=
fs
.
root
.
fullPath
;
const
fullPath
=
fs
.
root
.
fullPath
uni
.
$logger
?.
local
?.
info
(
`[PathUtils] 请求原生API获取根路径:
${
fullPath
}
`
)
;
uni
.
$logger
?.
local
?.
info
(
`[PathUtils] 请求原生API获取根路径:
${
fullPath
}
`
)
// 写入两级缓存
// 写入两级缓存
this
.
CACHED_ROOT_PATH
=
fullPath
;
this
.
CACHED_ROOT_PATH
=
fullPath
uni
.
setStorageSync
(
this
.
ROOT_PATH_CACHE_KEY
,
fullPath
)
;
uni
.
setStorageSync
(
this
.
ROOT_PATH_CACHE_KEY
,
fullPath
)
resolve
(
fullPath
)
;
resolve
(
fullPath
)
},
},
(
error
)
=>
{
error
=>
{
reject
(
new
Error
(
`[PathUtils] 获取文件系统失败:
${
JSON
.
stringify
(
error
)}
`
))
;
reject
(
new
Error
(
`[PathUtils] 获取文件系统失败:
${
JSON
.
stringify
(
error
)}
`
))
}
}
);
)
});
})
}
/**
* 规范化本地文件路径
* - 去掉前后空白
* - 绝对路径优先转成 file:// 形式
* - 已经是 file:// / http(s):// 的路径保持不变
* @param {string} filePath
* @returns {string}
*/
static
normalizeLocalFilePath
(
filePath
)
{
const
rawPath
=
String
(
filePath
||
''
).
trim
()
if
(
!
rawPath
)
return
''
return
rawPath
.
startsWith
(
'/'
)
?
`file://
${
rawPath
}
`
:
rawPath
}
}
/**
/**
...
@@ -139,12 +155,17 @@ class PathUtils {
...
@@ -139,12 +155,17 @@ class PathUtils {
static
ensureDir
(
dirPath
)
{
static
ensureDir
(
dirPath
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// #ifdef APP-PLUS
// #ifdef APP-PLUS
plus
.
io
.
resolveLocalFileSystemURL
(
dirPath
,
entry
=>
{
plus
.
io
.
resolveLocalFileSystemURL
(
dirPath
,
entry
=>
{
resolve
(
entry
.
fullPath
)
resolve
(
entry
.
fullPath
)
},
()
=>
{
},
()
=>
{
// 目录不存在,尝试创建
// 目录不存在,尝试创建
// NativeRecorder 传的是 "_doc/uniapp_save/"
// NativeRecorder 传的是 "_doc/uniapp_save/"
plus
.
io
.
requestFileSystem
(
plus
.
io
.
PRIVATE_DOC
,
fs
=>
{
plus
.
io
.
requestFileSystem
(
plus
.
io
.
PRIVATE_DOC
,
fs
=>
{
const
root
=
fs
.
root
const
root
=
fs
.
root
let
path
=
dirPath
let
path
=
dirPath
if
(
path
.
startsWith
(
'_doc/'
))
path
=
path
.
substring
(
5
)
if
(
path
.
startsWith
(
'_doc/'
))
path
=
path
.
substring
(
5
)
...
@@ -154,16 +175,27 @@ class PathUtils {
...
@@ -154,16 +175,27 @@ class PathUtils {
resolve
(
entry
.
fullPath
)
resolve
(
entry
.
fullPath
)
return
return
}
}
entry
.
getDirectory
(
folders
[
0
],
{
create
:
true
},
dirEntry
=>
{
entry
.
getDirectory
(
folders
[
0
],
{
create
:
true
},
dirEntry
=>
{
createDir
(
dirEntry
,
folders
.
slice
(
1
))
createDir
(
dirEntry
,
folders
.
slice
(
1
))
},
err
=>
{
},
err
=>
{
reject
(
new
Error
(
'创建目录失败: '
+
err
.
message
))
reject
(
new
Error
(
'创建目录失败: '
+
err
.
message
))
})
}
)
}
}
createDir
(
root
,
path
.
split
(
'/'
).
filter
(
p
=>
p
))
createDir
(
},
err
=>
reject
(
err
))
root
,
})
path
.
split
(
'/'
).
filter
(
p
=>
p
)
)
},
err
=>
reject
(
err
)
)
}
)
// #endif
// #endif
// #ifndef APP-PLUS
// #ifndef APP-PLUS
resolve
(
dirPath
)
resolve
(
dirPath
)
...
...
utils/recordManager/RecordSaveService.js
View file @
7f6dcae
...
@@ -14,6 +14,7 @@ import dayjs from 'dayjs'
...
@@ -14,6 +14,7 @@ import dayjs from 'dayjs'
import
store
from
'@/store'
import
store
from
'@/store'
import
FileUploadManager
from
'./FileUploadManager.js'
import
FileUploadManager
from
'./FileUploadManager.js'
import
{
Command
}
from
'../../ws/constants'
import
{
Command
}
from
'../../ws/constants'
import
PathUtils
from
'./PathUtils.js'
const
UPLOAD_INTERVAL
=
0.5
*
60
*
1000
const
UPLOAD_INTERVAL
=
0.5
*
60
*
1000
/**
/**
...
@@ -49,7 +50,7 @@ class RecordSaveService {
...
@@ -49,7 +50,7 @@ class RecordSaveService {
this
.
stopPolling
=
this
.
stopPolling
.
bind
(
this
)
this
.
stopPolling
=
this
.
stopPolling
.
bind
(
this
)
this
.
startPolling
=
this
.
startPolling
.
bind
(
this
)
this
.
startPolling
=
this
.
startPolling
.
bind
(
this
)
this
.
setInterval
=
this
.
setInterval
.
bind
(
this
)
this
.
setInterval
=
this
.
setInterval
.
bind
(
this
)
this
.
_onStartPolling
=
(
isForce
)
=>
this
.
startPolling
(
!!
isForce
)
this
.
_onStartPolling
=
isForce
=>
this
.
startPolling
(
!!
isForce
)
uni
.
$on
(
Command
.
StartPolling
,
this
.
_onStartPolling
)
uni
.
$on
(
Command
.
StartPolling
,
this
.
_onStartPolling
)
}
}
...
@@ -166,12 +167,7 @@ class RecordSaveService {
...
@@ -166,12 +167,7 @@ class RecordSaveService {
const
{
data
:
d
,
...
o
}
=
payload
const
{
data
:
d
,
...
o
}
=
payload
const
input
=
serializeIfObject
(
o
)
const
input
=
serializeIfObject
(
o
)
uni
.
$logger
.
local
.
warn
(
`【接待记录保存服务】 == 开始文件信息解析->
${
input
}
`
)
uni
.
$logger
.
local
.
warn
(
`【接待记录保存服务】 == 开始文件信息解析->
${
input
}
`
)
if
(
if
(
payload
.
code
===
0
&&
(
payload
.
message
===
'no file'
||
payload
.
status
===
FileStatus
.
NoFile
||
payload
.
status
===
FileStatus
.
NotExist
))
{
payload
.
code
===
0
&&
(
payload
.
message
===
'no file'
||
payload
.
status
===
FileStatus
.
NoFile
||
payload
.
status
===
FileStatus
.
NotExist
)
)
{
return
this
.
_parseNoFileStatus
({
return
this
.
_parseNoFileStatus
({
recordId
:
payload
.
recordId
,
recordId
:
payload
.
recordId
,
fileName
:
payload
.
fileName
,
fileName
:
payload
.
fileName
,
...
@@ -323,7 +319,7 @@ class RecordSaveService {
...
@@ -323,7 +319,7 @@ class RecordSaveService {
try
{
try
{
// 使用 FileUploadManager 上传文件
// 使用 FileUploadManager 上传文件
await
FileUploadManager
.
uploadRecord
(
record
,
(
result
)
=>
{
await
FileUploadManager
.
uploadRecord
(
record
,
result
=>
{
// 处理上传结果
// 处理上传结果
this
.
handleUploadResult
(
result
)
this
.
handleUploadResult
(
result
)
})
})
...
@@ -333,13 +329,15 @@ class RecordSaveService {
...
@@ -333,13 +329,15 @@ class RecordSaveService {
// 构造错误结果
// 构造错误结果
const
errorResult
=
{
const
errorResult
=
{
detail
:
{
detail
:
{
data
:
[{
data
:
[
{
code
:
-
1
,
code
:
-
1
,
message
:
error
.
message
,
message
:
error
.
message
,
recordId
:
record
.
recordId
,
recordId
:
record
.
recordId
,
fileName
:
record
.
fileName
,
fileName
:
record
.
fileName
,
filePath
:
record
.
filePath
filePath
:
record
.
filePath
}]
}
]
}
}
}
}
...
@@ -480,6 +478,7 @@ class RecordSaveService {
...
@@ -480,6 +478,7 @@ class RecordSaveService {
}
}
for
(
const
file
of
recordUrlList
)
{
for
(
const
file
of
recordUrlList
)
{
try
{
try
{
file
.
file
=
PathUtils
.
normalizeLocalFilePath
(
file
.
file
)
if
(
file
.
status
===
FileStatus
.
Uploaded
||
file
.
status
===
FileStatus
.
Completed
)
continue
if
(
file
.
status
===
FileStatus
.
Uploaded
||
file
.
status
===
FileStatus
.
Completed
)
continue
const
aFullPath
=
file
.
file
.
split
(
'/'
)
const
aFullPath
=
file
.
file
.
split
(
'/'
)
const
fileName
=
aFullPath
.
pop
()
const
fileName
=
aFullPath
.
pop
()
...
@@ -510,7 +509,9 @@ class RecordSaveService {
...
@@ -510,7 +509,9 @@ class RecordSaveService {
urlList
=
[]
urlList
=
[]
}
}
// const __list = urlList.filter(item => item?.file)
// const __list = urlList.filter(item => item?.file)
const
__list
=
urlList
.
filter
(
item
=>
item
?.
file
).
map
(
item
=>
{
const
__list
=
urlList
.
filter
(
item
=>
item
?.
file
)
.
map
(
item
=>
{
if
(
/^https
?
:
\/\/
/i
.
test
(
item
.
file
))
{
if
(
/^https
?
:
\/\/
/i
.
test
(
item
.
file
))
{
item
.
status
=
FileStatus
.
Uploaded
item
.
status
=
FileStatus
.
Uploaded
}
}
...
...
utils/recordManager/RecordService.js
View file @
7f6dcae
...
@@ -43,7 +43,9 @@ class RecordService {
...
@@ -43,7 +43,9 @@ class RecordService {
async
init
()
{
async
init
()
{
try
{
try
{
uni
.
$logger
.
local
.
info
(
'【录音服务RecordService】 == 初始化'
)
uni
.
$logger
.
local
.
info
(
'【录音服务RecordService】 == 初始化'
)
const
saveDir
=
await
PathUtils
.
getFilePath
()
const
saveDir
=
await
PathUtils
.
getFilePath
()
// const saveDir = ''
uni
.
$logger
.
local
.
info
(
`【接待录音】初始化: saveDir=
${
saveDir
}
`
)
uni
.
$logger
.
local
.
info
(
`【接待录音】初始化: saveDir=
${
saveDir
}
`
)
this
.
audioManager
=
new
AudioManager
(
this
.
onAudioStart
.
bind
(
this
),
this
.
onAudioStop
.
bind
(
this
),
this
.
onAudioError
.
bind
(
this
),
this
.
onFrameRecorded
.
bind
(
this
),
this
.
onFrameRecordedEnd
.
bind
(
this
),
saveDir
)
this
.
audioManager
=
new
AudioManager
(
this
.
onAudioStart
.
bind
(
this
),
this
.
onAudioStop
.
bind
(
this
),
this
.
onAudioError
.
bind
(
this
),
this
.
onFrameRecorded
.
bind
(
this
),
this
.
onFrameRecordedEnd
.
bind
(
this
),
saveDir
)
this
.
initDto
()
this
.
initDto
()
...
@@ -216,10 +218,10 @@ class RecordService {
...
@@ -216,10 +218,10 @@ class RecordService {
* @param {number} [seconds=30] - 截取最近多少秒,默认 30 秒
* @param {number} [seconds=30] - 截取最近多少秒,默认 30 秒
* @returns {ArrayBuffer|null} PCM / WAV 格式的 ArrayBuffer,失败返回 null
* @returns {ArrayBuffer|null} PCM / WAV 格式的 ArrayBuffer,失败返回 null
*/
*/
captureRecentAudio(seconds = 30,format = 'pcm') {
captureRecentAudio(seconds = 30,
format = 'pcm') {
const status = this.framePool.getStatus()
const status = this.framePool.getStatus()
uni.$logger.local.info(`
【录音服务
RecordService
】
==
截取音频
:
缓冲池状态
$
{
JSON
.
stringify
(
status
)}
`)
uni.$logger.local.info(`
【录音服务
RecordService
】
==
截取音频
:
缓冲池状态
$
{
JSON
.
stringify
(
status
)}
`)
return this.framePool.capture(seconds,
format)
return this.framePool.capture(seconds,
format)
}
}
/**
/**
...
@@ -311,9 +313,7 @@ class RecordService {
...
@@ -311,9 +313,7 @@ class RecordService {
// HTTP 服务端固定为 /health(可在 AiAssistantBall 内按需覆盖)
// HTTP 服务端固定为 /health(可在 AiAssistantBall 内按需覆盖)
const httpBaseUrl = 'https://lightmodification.glsx.com.cn'
const httpBaseUrl = 'https://lightmodification.glsx.com.cn'
const client = new NativeChannelClient(
const client = new NativeChannelClient(useWs ? { transport } : { transport, baseUrl: httpBaseUrl })
useWs ? { transport } : { transport, baseUrl: httpBaseUrl }
)
this._aiClient = client
this._aiClient = client
if (useWs) {
if (useWs) {
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment