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 f105f37b
authored
Apr 26, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
时间修改
1 parent
c5379586
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
mixin/click.js
mixin/click.js
View file @
f105f37
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @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-04-
18 17:29:04
* @LastEditTime: 2024-04-
26 10:04:31
* @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
*/
*/
...
@@ -12,16 +12,16 @@ import upload from "@/utils/ossUploadFile/uploadFile.js";
...
@@ -12,16 +12,16 @@ import upload from "@/utils/ossUploadFile/uploadFile.js";
import
{
mapMutations
,
mapState
}
from
"vuex"
;
import
{
mapMutations
,
mapState
}
from
"vuex"
;
import
utils
from
"@/utils/utils.js"
;
import
utils
from
"@/utils/utils.js"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
voicePath
:
""
,
voicePath
:
""
,
timer
:
null
,
timer
:
null
,
times
:
0
,
times
:
0
,
timeout
:
59
,
timeout
:
240
,
reaction
:
1
,
reaction
:
1
,
};
};
},
},
mounted
()
{
mounted
()
{
this
.
initTime
();
this
.
initTime
();
// this.checkVoice();
// this.checkVoice();
},
},
...
@@ -38,17 +38,17 @@ export default {
...
@@ -38,17 +38,17 @@ export default {
]),
]),
...
mapState
([
"user.customerInfo"
]),
...
mapState
([
"user.customerInfo"
]),
},
},
created
()
{
created
()
{
console
.
log
(
"created"
);
console
.
log
(
"created"
);
},
},
onHide
()
{
onHide
()
{
console
.
log
(
"隐藏"
);
console
.
log
(
"隐藏"
);
// recorderManager.stop();
// recorderManager.stop();
// recorderManager.start({
// recorderManager.start({
// duration: 10000,
// duration: 10000,
// });
// });
},
},
onShow
()
{
onShow
()
{
// console.log(utils.requestAndroidPermission());
// console.log(utils.requestAndroidPermission());
},
},
methods
:
{
methods
:
{
...
@@ -61,7 +61,7 @@ export default {
...
@@ -61,7 +61,7 @@ export default {
"setBooks"
,
"setBooks"
,
]),
]),
//关闭提示
//关闭提示
tipCancel
()
{
tipCancel
()
{
this
.
stopAudio
();
this
.
stopAudio
();
this
.
setReceptionStatus
(
0
);
this
.
setReceptionStatus
(
0
);
this
.
setReasonType
(
1
);
this
.
setReasonType
(
1
);
...
@@ -71,17 +71,17 @@ export default {
...
@@ -71,17 +71,17 @@ export default {
});
});
},
},
//结束提示
//结束提示
tipConfirm
()
{
tipConfirm
()
{
this
.
times
=
0
;
this
.
times
=
0
;
this
.
$refs
.
tipBox
.
close
();
this
.
$refs
.
tipBox
.
close
();
},
},
//检查缓存录音
//检查缓存录音
checkVoice
()
{
checkVoice
()
{
const
file
=
uni
.
$storage
.
get
(
"storageFile"
);
const
file
=
uni
.
$storage
.
get
(
"storageFile"
);
if
(
file
)
this
.
uploadVoice
(
file
);
if
(
file
)
this
.
uploadVoice
(
file
);
},
},
//保存录音记录及其他信息
//保存录音记录及其他信息
async
uploadVoice
(
tempFilePath
)
{
async
uploadVoice
(
tempFilePath
)
{
try
{
try
{
const
{
shopMerchantId
,
phone
}
=
uni
.
$storage
.
get
(
"userInfo"
),
const
{
shopMerchantId
,
phone
}
=
uni
.
$storage
.
get
(
"userInfo"
),
{
customerName
,
phoneNumber
,
salesUuid
,
carModel
,
staffName
}
=
{
customerName
,
phoneNumber
,
salesUuid
,
carModel
,
staffName
}
=
...
@@ -124,7 +124,7 @@ export default {
...
@@ -124,7 +124,7 @@ export default {
}
}
},
},
//开始录音
//开始录音
async
startAudio
()
{
async
startAudio
()
{
if
(
this
.
isStart
)
return
;
if
(
this
.
isStart
)
return
;
this
.
setAudioStart
(
true
);
this
.
setAudioStart
(
true
);
this
.
setAudioList
([]);
this
.
setAudioList
([]);
...
@@ -151,7 +151,7 @@ export default {
...
@@ -151,7 +151,7 @@ export default {
});
});
},
},
//结束录音
//结束录音
async
stopAudio
()
{
async
stopAudio
()
{
const
result
=
await
this
.
$permision
.
requestAndroidPermission
(
const
result
=
await
this
.
$permision
.
requestAndroidPermission
(
"android.permission.RECORD_AUDIO"
"android.permission.RECORD_AUDIO"
);
);
...
@@ -164,10 +164,13 @@ export default {
...
@@ -164,10 +164,13 @@ export default {
}
}
this
.
setAudioStart
(
false
);
this
.
setAudioStart
(
false
);
this
.
setAudioEnd
(
true
);
this
.
setAudioEnd
(
true
);
this
.
times
=
0
;
clearInterval
(
this
.
timer
);
this
.
timer
=
null
;
recorderManager
.
stop
();
recorderManager
.
stop
();
},
},
//监听点击事件
//监听点击事件
initTime
()
{
initTime
()
{
if
(
!
this
.
isStart
)
return
;
if
(
!
this
.
isStart
)
return
;
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
times
++
;
this
.
times
++
;
...
@@ -181,12 +184,11 @@ export default {
...
@@ -181,12 +184,11 @@ export default {
}
}
},
1000
*
10
);
},
1000
*
10
);
},
},
handleTouchStart
:
utils
.
debounce
(
function
()
{
handleTouchStart
()
{
this
.
times
=
0
;
this
.
times
=
0
;
console
.
log
(
1111
);
},
1000
*
10
),
},
},
beforeCreate
()
{
},
beforeCreate
()
{
clearInterval
(
this
.
timer
);
clearInterval
(
this
.
timer
);
this
.
timer
=
null
;
this
.
timer
=
null
;
},
},
...
...
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