Commit f105f37b by 前端

时间修改

1 parent c5379586
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48
* @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
* @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";
import { mapMutations, mapState } from "vuex";
import utils from "@/utils/utils.js";
export default {
data () {
data() {
return {
voicePath: "",
timer: null,
times: 0,
timeout: 59,
timeout: 240,
reaction: 1,
};
},
mounted () {
mounted() {
this.initTime();
// this.checkVoice();
},
......@@ -38,17 +38,17 @@ export default {
]),
...mapState(["user.customerInfo"]),
},
created () {
created() {
console.log("created");
},
onHide () {
onHide() {
console.log("隐藏");
// recorderManager.stop();
// recorderManager.start({
// duration: 10000,
// });
},
onShow () {
onShow() {
// console.log(utils.requestAndroidPermission());
},
methods: {
......@@ -61,7 +61,7 @@ export default {
"setBooks",
]),
//关闭提示
tipCancel () {
tipCancel() {
this.stopAudio();
this.setReceptionStatus(0);
this.setReasonType(1);
......@@ -71,17 +71,17 @@ export default {
});
},
//结束提示
tipConfirm () {
tipConfirm() {
this.times = 0;
this.$refs.tipBox.close();
},
//检查缓存录音
checkVoice () {
checkVoice() {
const file = uni.$storage.get("storageFile");
if (file) this.uploadVoice(file);
},
//保存录音记录及其他信息
async uploadVoice (tempFilePath) {
async uploadVoice(tempFilePath) {
try {
const { shopMerchantId, phone } = uni.$storage.get("userInfo"),
{ customerName, phoneNumber, salesUuid, carModel, staffName } =
......@@ -124,7 +124,7 @@ export default {
}
},
//开始录音
async startAudio () {
async startAudio() {
if (this.isStart) return;
this.setAudioStart(true);
this.setAudioList([]);
......@@ -151,7 +151,7 @@ export default {
});
},
//结束录音
async stopAudio () {
async stopAudio() {
const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO"
);
......@@ -164,10 +164,13 @@ export default {
}
this.setAudioStart(false);
this.setAudioEnd(true);
this.times = 0;
clearInterval(this.timer);
this.timer = null;
recorderManager.stop();
},
//监听点击事件
initTime () {
initTime() {
if (!this.isStart) return;
this.timer = setInterval(() => {
this.times++;
......@@ -181,12 +184,11 @@ export default {
}
}, 1000 * 10);
},
handleTouchStart: utils.debounce(function () {
handleTouchStart() {
this.times = 0;
console.log(1111);
}, 1000 * 10),
},
},
beforeCreate () {
beforeCreate() {
clearInterval(this.timer);
this.timer = null;
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!