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 d3c28ad7
authored
Dec 31, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
保活
1 parent
f6e02a3a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
120 additions
and
26 deletions
App.vue
components/HomeFrame/components/RecordList.vue
manifest.json
mixin/click.js
mixin/uploader.js
utils/utils.js
App.vue
View file @
d3c28ad
...
@@ -2,12 +2,13 @@
...
@@ -2,12 +2,13 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-07 17:09:53
* @Date: 2024-04-07 17:09:53
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-12-
24 16:06:29
* @LastEditTime: 2024-12-
31 10:50:50
* @FilePath: \gl_tape\App.vue
* @FilePath: \gl_tape\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
-->
<
script
>
<
script
>
const
PATH
=
[
'/pages/common/caseDetail'
]
const
PATH
=
[
'/pages/common/caseDetail'
]
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'
export
default
{
export
default
{
...
@@ -16,6 +17,7 @@ export default {
...
@@ -16,6 +17,7 @@ export default {
},
},
onLoad
()
{},
onLoad
()
{},
onLaunch
:
async
function
()
{
onLaunch
:
async
function
()
{
this
.
onKeep
()
// this.init()
// this.init()
this
.
setAPPVersion
()
this
.
setAPPVersion
()
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -28,6 +30,17 @@ export default {
...
@@ -28,6 +30,17 @@ export default {
new
Ws
().
connect
()
new
Ws
().
connect
()
},
},
methods
:
{
methods
:
{
onKeep
()
{
keepAlive
.
onKeep
(
{
title
:
'接待'
,
content
:
'接待通知'
},
res
=>
{
console
.
log
(
res
)
}
)
},
init
()
{
init
()
{
uni
.
addInterceptor
(
'navigateTo'
,
{
uni
.
addInterceptor
(
'navigateTo'
,
{
//监听跳转
//监听跳转
...
...
components/HomeFrame/components/RecordList.vue
View file @
d3c28ad
...
@@ -169,11 +169,10 @@ export default {
...
@@ -169,11 +169,10 @@ export default {
this
.
getPreRecordNum
()
this
.
getPreRecordNum
()
}
,
}
,
methods
:
{
methods
:
{
formatValue
(
val
,
k
)
{
formatValue
(
val
,
k
)
{
if
(
!
val
)
return
if
(
!
val
)
return
if
(
k
==
'phoneNumber'
)
{
if
(
k
==
'phoneNumber'
)
{
val
=
val
.
toString
()
return
val
.
slice
(
0
,
3
)
+
" "
+
val
.
slice
(
3
,
7
)
+
" "
+
val
.
slice
(
7
)
return
val
.
slice
(
0
,
3
)
+
" "
+
val
.
slice
(
3
,
7
)
+
" "
+
val
.
slice
(
7
)
}
}
return
val
return
val
}
,
}
,
...
@@ -182,8 +181,7 @@ export default {
...
@@ -182,8 +181,7 @@ export default {
}
,
}
,
async
handleSubmit
(
val
)
{
async
handleSubmit
(
val
)
{
this
.
showRecord
=
true
;
this
.
showRecord
=
true
;
// uni.$recordManager.addRecord(val)
uni
.
$recordManager
.
addRecord
(
val
)
await
uni
.
$dbManager
.
addRecord
(
val
)
uni
.
$logger
.
local
.
info
(
`添加记录${JSON.stringify(val)
}
`
)
uni
.
$logger
.
local
.
info
(
`添加记录${JSON.stringify(val)
}
`
)
interruptRecord
.
removePreRecord
(
val
.
id
)
interruptRecord
.
removePreRecord
(
val
.
id
)
this
.
getRecordNum
()
this
.
getRecordNum
()
...
@@ -224,9 +222,8 @@ export default {
...
@@ -224,9 +222,8 @@ export default {
scroll
(
e
)
{
scroll
(
e
)
{
this
.
sticky
=
e
.
detail
.
scrollTop
>=
148
this
.
sticky
=
e
.
detail
.
scrollTop
>=
148
}
,
}
,
async
getRecordNum
()
{
getRecordNum
()
{
// let recordFailListAll = uni.$recordManager.getRecords();
let
recordFailListAll
=
uni
.
$recordManager
.
getRecords
();
let
recordFailListAll
=
await
uni
.
$dbManager
.
getRecords
();
if
(
typeof
recordFailListAll
==
'string'
)
{
if
(
typeof
recordFailListAll
==
'string'
)
{
recordFailListAll
=
JSON
.
parse
(
recordFailListAll
||
'[]'
)
recordFailListAll
=
JSON
.
parse
(
recordFailListAll
||
'[]'
)
}
}
...
...
manifest.json
View file @
d3c28ad
...
@@ -65,6 +65,22 @@
...
@@ -65,6 +65,22 @@
"xxhdpi"
:
"static/144.png"
"xxhdpi"
:
"static/144.png"
}
}
}
}
},
"nativePlugins"
:
{
"Ba-KeepAliveSuit"
:
{
"__plugin_info__"
:
{
"name"
:
"安卓保活套装(通用、常驻通知、电池优化、自启管理、后台运行等)"
,
"description"
:
"在Ba-KeepAlive的基础上,新增了忽略电池优化、自启管理、常驻通知。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航(**注意:**不保证支持所有机型和场景,建议先试用再购买)"
,
"platforms"
:
"Android"
,
"url"
:
"https://ext.dcloud.net.cn/plugin?id=11765"
,
"android_package_name"
:
"uni.gltap"
,
"ios_bundle_id"
:
""
,
"isCloud"
:
true
,
"bought"
:
1
,
"pid"
:
"11765"
,
"parameters"
:
{}
}
}
}
}
},
},
/*
快应用特有相关
*/
/*
快应用特有相关
*/
...
...
mixin/click.js
View file @
d3c28ad
/*
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-11-22 15:07:59
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-12-30 20:17:43
* @FilePath: \gl-tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48
* @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-1
1-28 10:03:22
* @LastEditTime: 2024-1
2-30 20:57:30
* @FilePath: \gl_tape\mixin\click.js
* @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -43,6 +35,7 @@ export default {
...
@@ -43,6 +35,7 @@ export default {
},
},
async
mounted
()
{
async
mounted
()
{
uni
.
$logger
.
local
.
info
(
`进入接待首页!`
)
uni
.
$logger
.
local
.
info
(
`进入接待首页!`
)
// this.checkPackage() //检查安装包
this
.
handleCheck
()
// 检查更新
this
.
handleCheck
()
// 检查更新
this
.
handleSave
(
false
)
this
.
handleSave
(
false
)
// 获取当前页面栈数组
// 获取当前页面栈数组
...
@@ -81,6 +74,66 @@ export default {
...
@@ -81,6 +74,66 @@ export default {
},
},
methods
:
{
methods
:
{
...
mapMutations
(
'audio'
,
[
'setReceptionStatus'
,
'setBooks'
,
'setAudioInfo'
]),
...
mapMutations
(
'audio'
,
[
'setReceptionStatus'
,
'setBooks'
,
'setAudioInfo'
]),
checkPackage
()
{
const
{
deviceId
:
tabletSerialNumber
}
=
uni
.
getDeviceInfo
()
uni
.
$api
.
commonApi
.
checkAppUpload
({
tabletSerialNumber
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
getAllApply
()
}
})
// this.getAllApply()
},
getAllApply
()
{
// #ifdef APP-PLUS
const
main
=
plus
.
android
.
runtimeMainActivity
()
const
pManager
=
plus
.
android
.
invoke
(
main
,
'getPackageManager'
)
const
ApplicationInfo
=
plus
.
android
.
importClass
(
'android.content.pm.ApplicationInfo'
)
const
packages
=
plus
.
android
.
invoke
(
pManager
,
'getInstalledPackages'
,
0
)
const
total
=
plus
.
android
.
invoke
(
packages
,
'size'
)
let
appInfoList
=
[]
for
(
let
i
=
0
;
i
<
total
;
i
++
)
{
try
{
const
packageInfo
=
plus
.
android
.
invoke
(
packages
,
'get'
,
i
)
// 获取包名
const
packName
=
plus
.
android
.
getAttribute
(
packageInfo
,
'packageName'
)
const
versionName
=
plus
.
android
.
getAttribute
(
packageInfo
,
'versionName'
)
const
versionCode
=
plus
.
android
.
getAttribute
(
packageInfo
,
'versionCode'
)
const
appInfo
=
plus
.
android
.
invoke
(
pManager
,
'getApplicationInfo'
,
packName
,
0
)
const
appName
=
plus
.
android
.
invoke
(
pManager
,
'getApplicationLabel'
,
appInfo
)
// 是否是系统软件
const
isSystem
=
packageInfo
.
plusGetAttribute
(
'applicationInfo'
).
plusGetAttribute
(
'flags'
)
&
(
ApplicationInfo
.
FLAG_SYSTEM
!=
0
)
?
true
:
false
// 判断是否是系统文件
if
(
!
isSystem
)
{
appInfoList
.
push
({
packName
,
versionName
,
versionCode
,
appName
})
}
}
catch
(
e
)
{
appInfoList
=
[]
}
}
plus
.
android
.
autoCollection
(
main
)
const
{
deviceId
:
tabletSerialNumber
}
=
uni
.
getDeviceInfo
()
if
(
appInfoList
.
length
<
2
)
{
appInfoList
=
[]
}
console
.
log
(
appInfoList
)
uni
.
$api
.
commonApi
.
saveOrUpdateEmployeeAppUsage
({
tabletSerialNumber
,
appVersion
:
plus
.
runtime
.
version
,
gameAppList
:
JSON
.
stringify
(
appInfoList
)
})
.
then
(
res
=>
{
console
.
log
(
res
)
})
.
catch
(
err
=>
{
console
.
log
(
err
)
})
// #endif
},
handleCheck
()
{
handleCheck
()
{
const
{
textList
,
tempFileURL
,
version
}
=
uni
.
$storage
.
get
(
'mock_data'
)
const
{
textList
,
tempFileURL
,
version
}
=
uni
.
$storage
.
get
(
'mock_data'
)
const
res
=
utils
.
compareVersions
(
plus
?.
runtime
?.
version
,
version
)
const
res
=
utils
.
compareVersions
(
plus
?.
runtime
?.
version
,
version
)
...
@@ -148,7 +201,9 @@ export default {
...
@@ -148,7 +201,9 @@ export default {
staffName
:
name
staffName
:
name
})
})
})
})
let
version
=
plus
.
runtime
.
version
let
params
=
{
let
params
=
{
// appVersion: version,
staffUuid
:
uuid
,
staffUuid
:
uuid
,
staffName
:
name
,
staffName
:
name
,
serviceMerchantId
:
merchantId
,
serviceMerchantId
:
merchantId
,
...
@@ -210,6 +265,7 @@ export default {
...
@@ -210,6 +265,7 @@ export default {
)
)
})
})
},
},
//开始录音
//开始录音
startAudio
:
utils
.
throttle
(
async
function
()
{
startAudio
:
utils
.
throttle
(
async
function
()
{
if
(
this
.
audioInfo
.
audioStatus
==
AUDIO_STATUS
.
START
)
return
if
(
this
.
audioInfo
.
audioStatus
==
AUDIO_STATUS
.
START
)
return
...
@@ -312,6 +368,7 @@ export default {
...
@@ -312,6 +368,7 @@ export default {
}
}
})
})
},
},
/**
/**
* 删除待提交记录
* 删除待提交记录
* @returns {void}
* @returns {void}
...
@@ -329,7 +386,7 @@ export default {
...
@@ -329,7 +386,7 @@ export default {
uni
.
$logger
.
local
.
info
(
`添加记录
${
JSON
.
stringify
(
record
)}
`
)
uni
.
$logger
.
local
.
info
(
`添加记录
${
JSON
.
stringify
(
record
)}
`
)
const
unlock
=
await
uni
.
$recordManager
.
lock
()
const
unlock
=
await
uni
.
$recordManager
.
lock
()
console
.
log
(
'record'
,
record
)
console
.
log
(
'record'
,
record
)
await
uni
.
$db
Manager
.
addRecord
(
record
)
uni
.
$record
Manager
.
addRecord
(
record
)
interruptRecord
.
removePreRecord
(
record
.
id
)
interruptRecord
.
removePreRecord
(
record
.
id
)
unlock
()
unlock
()
},
},
...
...
mixin/uploader.js
View file @
d3c28ad
...
@@ -22,6 +22,7 @@ export default {
...
@@ -22,6 +22,7 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
mergeRecord
()
this
.
init
()
this
.
init
()
this
.
subscribe
()
this
.
subscribe
()
// uni.$dbManager.updateRecord({"recordUrlList": [
// uni.$dbManager.updateRecord({"recordUrlList": [
...
@@ -81,6 +82,15 @@ export default {
...
@@ -81,6 +82,15 @@ export default {
handlerMessage
(
data
)
{
handlerMessage
(
data
)
{
this
.
save
(
data
)
this
.
save
(
data
)
},
},
async
mergeRecord
()
{
const
unlock
=
await
uni
.
$recordManager
.
lock
()
const
records
=
uni
.
$recordManager
.
getRecords
()
for
(
let
i
=
0
;
i
<
records
.
length
;
i
++
)
{
await
uni
.
$dbManager
.
addRecord
(
records
[
i
])
uni
.
$recordManager
.
removeRecord
(
records
[
i
].
id
)
}
unlock
()
},
async
checkDB
()
{
async
checkDB
()
{
try
{
try
{
const
isSuccess
=
uni
.
$dbManager
.
init
()
const
isSuccess
=
uni
.
$dbManager
.
init
()
...
...
utils/utils.js
View file @
d3c28ad
/*
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 17:16:46
* @Date: 2024-04-08 17:16:46
* @LastEditors:
limi
n
* @LastEditors:
前端 qianduan01@didihu.com.c
n
* @LastEditTime: 2024-1
1-07 15:56:0
5
* @LastEditTime: 2024-1
2-31 14:28:3
5
* @FilePath: \gl_tape\utils\utils.js
* @FilePath: \gl_tape\utils\utils.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -151,6 +151,7 @@ function getFilePath() {
...
@@ -151,6 +151,7 @@ function getFilePath() {
/** 比较版本号的大小
/** 比较版本号的大小
**/
**/
function
compareVersions
(
version1
,
version2
)
{
function
compareVersions
(
version1
,
version2
)
{
if
(
!
version1
||
!
version2
)
return
0
const
v1
=
version1
.
split
(
'.'
).
map
(
v
=>
+
v
)
// 转化成数字数组
const
v1
=
version1
.
split
(
'.'
).
map
(
v
=>
+
v
)
// 转化成数字数组
const
v2
=
version2
.
split
(
'.'
).
map
(
v
=>
+
v
)
const
v2
=
version2
.
split
(
'.'
).
map
(
v
=>
+
v
)
const
b1
=
v1
.
every
(
v
=>
!
isNaN
(
v
))
// 判断数组的每一项是否是数字
const
b1
=
v1
.
every
(
v
=>
!
isNaN
(
v
))
// 判断数组的每一项是否是数字
...
@@ -179,11 +180,11 @@ export function serializeIfObject(msg) {
...
@@ -179,11 +180,11 @@ export function serializeIfObject(msg) {
}
}
export
function
isInteger
(
value
)
{
export
function
isInteger
(
value
)
{
if
(
typeof
value
===
'number'
)
{
if
(
typeof
value
===
'number'
)
{
return
Number
.
isInteger
(
value
)
;
return
Number
.
isInteger
(
value
)
}
else
if
(
typeof
value
===
'string'
)
{
}
else
if
(
typeof
value
===
'string'
)
{
return
/^-
?\d
+$/
.
test
(
value
)
;
return
/^-
?\d
+$/
.
test
(
value
)
}
}
return
false
;
return
false
}
}
export
default
{
export
default
{
compareVersions
,
compareVersions
,
...
...
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