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 d1dd7eae
authored
Apr 11, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
缓存
1 parent
79d5dc1a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
21 deletions
App.vue
main.js
mixin/click.js
store/modules/audio.js
store/modules/user.js
App.vue
View file @
d1dd7ea
...
@@ -2,12 +2,11 @@
...
@@ -2,12 +2,11 @@
* @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-04-11
17:33:00
* @LastEditTime: 2024-04-11
21:55:29
* @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
>
import
{
mapState
}
from
"vuex"
;
import
{
mapState
}
from
"vuex"
;
export
default
{
export
default
{
computed
:
{
computed
:
{
...
@@ -25,23 +24,26 @@ export default {
...
@@ -25,23 +24,26 @@ export default {
});
});
},
},
onShow
:
function
()
{
onShow
:
function
()
{
const
userInfo
=
uni
.
$storage
.
get
(
'userInfo'
)
||
{}
const
userInfo
=
uni
.
$storage
.
get
(
"userInfo"
)
||
{};
if
(
!
userInfo
.
shopMerchantId
||
!
userInfo
.
shopMerchantName
)
{
if
(
!
userInfo
.
shopMerchantId
||
!
userInfo
.
shopMerchantName
)
{
uni
.
$storage
.
rm
(
"userInfo"
);
uni
.
$storage
.
rm
(
"userInfo"
);
uni
.
$storage
.
rm
(
"sessionId"
);
uni
.
$storage
.
rm
(
"sessionId"
);
uni
.
reLaunch
({
uni
.
reLaunch
({
url
:
"/pages/common/login"
,
url
:
"/pages/common/login"
,
})
})
;
}
}
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// if (this.isStart && !this.isEnd) {
const
recorderManager
=
uni
.
getRecorderManager
();
// const recorderManager = uni.getRecorderManager();
if
(
this
.
isStart
&&
!
this
.
isEnd
)
{
// recorderManager.stop();
recorderManager
.
stop
();
// recorderManager.start({
recorderManager
.
start
({
// duration: 600000,
duration
:
600000
,
// });
});
// }
setTimeout
(()
=>
{
recorderManager
.
stop
();
},
600000
);
}
},
},
onError
:
function
(
e
)
{
onError
:
function
(
e
)
{
// sentry.captureException(e);
// sentry.captureException(e);
...
...
main.js
View file @
d1dd7ea
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @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-04-11 1
7:32:28
* @LastEditTime: 2024-04-11 1
6:47:29
* @FilePath: \gl_tape\main.js
* @FilePath: \gl_tape\main.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
*/
*/
...
...
mixin/click.js
View file @
d1dd7ea
...
@@ -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-11
16:37:4
2
* @LastEditTime: 2024-04-11
22:13:2
2
* @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
*/
*/
...
@@ -23,7 +23,7 @@ export default {
...
@@ -23,7 +23,7 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
initTime
();
this
.
initTime
();
this
.
checkVoice
();
//
this.checkVoice();
},
},
computed
:
{
computed
:
{
...
mapState
(
"audio"
,
[
...
mapState
(
"audio"
,
[
...
@@ -106,12 +106,11 @@ export default {
...
@@ -106,12 +106,11 @@ export default {
receptionCustomerPaySourceList
,
//1.付款凭证文件路径 2.客户购车发票文件路径 3.客户延保合同文件路径
receptionCustomerPaySourceList
,
//1.付款凭证文件路径 2.客户购车发票文件路径 3.客户延保合同文件路径
merchantId
:
shopMerchantId
,
merchantId
:
shopMerchantId
,
};
};
this
.
setBooks
([]);
console
.
log
(
params
);
if
(
customerName
&&
phoneNumber
&&
salesUuid
&&
carModel
)
if
(
customerName
&&
phoneNumber
&&
salesUuid
&&
carModel
)
uni
.
$api
.
commonApi
.
saveRecCustomer
(
params
).
then
((
res
)
=>
{
uni
.
$api
.
commonApi
.
saveRecCustomer
(
params
).
then
((
res
)
=>
{
console
.
log
(
res
);
console
.
log
(
res
,
params
);
});
});
this
.
setBooks
([]);
this
.
$store
.
dispatch
(
"clearCustomerInfo"
);
this
.
$store
.
dispatch
(
"clearCustomerInfo"
);
this
.
setReceptionStatus
(
1
);
this
.
setReceptionStatus
(
1
);
this
.
setReasonType
(
0
);
this
.
setReasonType
(
0
);
...
@@ -124,14 +123,12 @@ export default {
...
@@ -124,14 +123,12 @@ export default {
this
.
setAudioList
([]);
this
.
setAudioList
([]);
this
.
setAudioEnd
(
false
);
this
.
setAudioEnd
(
false
);
recorderManager
.
start
({
recorderManager
.
start
({
format
:
"aac"
,
duration
:
600000
,
duration
:
600000
,
});
});
recorderManager
.
onStop
(
async
(
res
)
=>
{
recorderManager
.
onStop
(
async
(
res
)
=>
{
console
.
log
(
"结束录音"
);
console
.
log
(
"结束录音"
);
if
(
!
this
.
isEnd
)
{
if
(
!
this
.
isEnd
)
{
uni
.
getRecorderManager
().
start
({
uni
.
getRecorderManager
().
start
({
format
:
"aac"
,
duration
:
600000
,
duration
:
600000
,
});
});
}
}
...
@@ -139,6 +136,8 @@ export default {
...
@@ -139,6 +136,8 @@ export default {
const
storageFile
=
[...
this
.
audioList
,
result
];
const
storageFile
=
[...
this
.
audioList
,
result
];
uni
.
$storage
.
set
(
"storageFile"
,
storageFile
);
uni
.
$storage
.
set
(
"storageFile"
,
storageFile
);
this
.
setAudioList
(
storageFile
);
this
.
setAudioList
(
storageFile
);
console
.
log
(
storageFile
,
this
.
isEnd
,
"this.isEnd"
);
if
(
!
this
.
isEnd
)
return
true
;
if
(
this
.
isEnd
)
this
.
uploadVoice
(
storageFile
);
if
(
this
.
isEnd
)
this
.
uploadVoice
(
storageFile
);
return
true
;
return
true
;
});
});
...
...
store/modules/audio.js
View file @
d1dd7ea
...
@@ -3,10 +3,13 @@
...
@@ -3,10 +3,13 @@
* @Author: huyue
* @Author: huyue
* @Date: 2024-04-07 18:15:11
* @Date: 2024-04-07 18:15:11
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-1
0 10:02:00
* @LastEditTime: 2024-04-1
1 21:22:55
*/
*/
// import { setToken, getToken, removeToken } from '@/utils/token';;
// import { setToken, getToken, removeToken } from '@/utils/token';;
import
utils
from
"@/utils/utils"
;
import
utils
from
"@/utils/utils"
;
// const recorderManager = uni.getRecorderManager();
import
upload
from
"@/utils/ossUploadFile/uploadFile.js"
;
import
store
from
"../index"
;
export
default
{
export
default
{
namespaced
:
true
,
namespaced
:
true
,
state
()
{
state
()
{
...
@@ -45,4 +48,74 @@ export default {
...
@@ -45,4 +48,74 @@ export default {
state
.
receptionEndTime
=
utils
.
convertDateTimeFormat
(
new
Date
(),
"/"
);
state
.
receptionEndTime
=
utils
.
convertDateTimeFormat
(
new
Date
(),
"/"
);
},
},
},
},
actions
:
{
// startAudio({ commit, state, dispatch }) {
// if (state.isStart) return;
// commit("setAudioStart", true);
// commit("setAudioList", []);
// commit("setAudioEnd", false);
// recorderManager.start({
// duration: 20000,
// });
// recorderManager.onStop(async (res) => {
// console.log("结束录音");
// console.log(state.isEnd, "this.isEnd");
// if (!state.isEnd) {
// uni.getRecorderManager().start({
// duration: 20000,
// });
// }
// const result = await upload(res.tempFilePath);
// const storageFile = [...state.audioList, result];
// uni.$storage.set("storageFile", storageFile);
// commit("setAudioList", storageFile);
// if (state.isEnd) {
// console.log("上传语音");
// dispatch("uploadVoice", storageFile);
// }
// return true;
// });
// },
// stopAudio({ commit, state }) {
// commit("setAudioStart", false);
// commit("setAudioEnd", true);
// recorderManager.stop();
// },
// async uploadVoice({ commit, state }, tempFilePath) {
// const { shopMerchantId, phone } = uni.$storage.get("userInfo"),
// { customerName, phoneNumber, salesUuid, carModel } =
// store.state.user.customerInfo,
// receptionCustomerPaySourceList = state.booksList.map((item) => {
// return {
// id: item.id,
// sourceType: item.id,
// sourceUrl: item.imgUrl,
// };
// }),
// params = {
// carModel,
// endReasonType: state.endReasonType, //原因 1.异常 0.正常
// customerName,
// phoneNumber,
// loginPhone: phone,
// salesUuid,
// receptionStatus: state.receptionStatus, //接待结果 1.成交 0.战败
// recordUrlList: tempFilePath,
// receptionStartTime: state.receptionStartTime,
// receptionEndTime: state.receptionEndTime,
// receptionCustomerPaySourceList, //1.付款凭证文件路径 2.客户购车发票文件路径 3.客户延保合同文件路径
// merchantId: shopMerchantId,
// };
// commit("setBooks", []);
// console.log(params);
// if (customerName && phoneNumber && salesUuid && carModel)
// uni.$api.commonApi.saveRecCustomer(params).then((res) => {
// console.log(res);
// });
// store.dispatch("clearCustomerInfo");
// commit("setReceptionStatus", 1);
// commit("setReceptionStatus", 0);
// uni.$storage.set("storageFile", "");
// },
},
};
};
store/modules/user.js
View file @
d1dd7ea
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2024-04-07 18:15:11
* @Date: 2024-04-07 18:15:11
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-
09 19:49:48
* @LastEditTime: 2024-04-
11 21:19:09
*/
*/
// import { setToken, getToken, removeToken } from '@/utils/token';;
// import { setToken, getToken, removeToken } from '@/utils/token';;
...
...
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