Commit 9132599b by 前端

直接退出

1 parent c768fdb2
...@@ -293,7 +293,7 @@ export default { ...@@ -293,7 +293,7 @@ export default {
return new Error(errorMsg); return new Error(errorMsg);
}, },
//结束接待 //结束接待
stopAudio: utils.throttle(async function () { stopAudio: utils.throttle(async function (status) {
// const result = await this.$permision.requestAndroidPermission( // const result = await this.$permision.requestAndroidPermission(
// "android.permission.RECORD_AUDIO" // "android.permission.RECORD_AUDIO"
// ); // );
...@@ -304,22 +304,32 @@ export default { ...@@ -304,22 +304,32 @@ export default {
// }); // });
// return; // return;
// } // }
if (this.audioInfo.audioStatus != "start") {
return;
}
//直接退出
if (!status) {
uni.showLoading({ uni.showLoading({
mask: true, mask: true,
title: "处理中请稍后...", title: "处理中请稍后...",
}); });
}
let finish_timer = null; let finish_timer = null;
this.setAudioInfo({ audioStatus: "end" }); this.setAudioInfo({ audioStatus: "end" });
this.times = 0; this.times = 0;
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
recorderManager.stop(); recorderManager.stop();
if (status) {
return;
}
finish_timer = setInterval(() => { finish_timer = setInterval(() => {
if (this.audioInfo.audioStatus == "finish") { if (this.audioInfo.audioStatus == "finish") {
uni.hideLoading(); uni.hideLoading();
clearInterval(finish_timer); clearInterval(finish_timer);
} }
}, 1000); }, 300);
}, 1500), }, 1500),
//监听点击事件 //监听点击事件
initTime() { initTime() {
......
...@@ -8,23 +8,15 @@ ...@@ -8,23 +8,15 @@
@backHome="backHome" @backHome="backHome"
@changeTab="changeTab" @changeTab="changeTab"
> >
<view <view class="module-box" slot="module" :key="moduleKey">
class="module-box" <template v-for="(i, index) in moduleList">
slot="module"
:key="moduleKey"
>
<template v-for="(i,index) in moduleList">
<view <view
:key="index" :key="index"
:class="['item',i.class]" :class="['item', i.class]"
:style="i.style" :style="i.style"
@click="toDetail(i)" @click="toDetail(i)"
> >
<image <image class="item-img" :src="i.thumbnail" mode="scaleToFill" />
class="item-img"
:src="i.thumbnail"
mode="scaleToFill"
/>
</view> </view>
</template> </template>
</view> </view>
...@@ -45,15 +37,12 @@ ...@@ -45,15 +37,12 @@
/> />
</template> </template>
<template slot="content"> <template slot="content">
<customer-type <customer-type ref="customerTypeRef" @choose="chooseCustomerType" />
ref="customerTypeRef"
@choose="chooseCustomerType"
/>
</template> </template>
</home-frame> </home-frame>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
import myClick from "@/mixin/click"; import myClick from "@/mixin/click";
import HomeFrame from '../../components/HomeFrame/index.vue' import HomeFrame from '../../components/HomeFrame/index.vue'
import RecordList from '../home/components/RecordList.vue'; import RecordList from '../home/components/RecordList.vue';
...@@ -169,7 +158,7 @@ export default { ...@@ -169,7 +158,7 @@ export default {
this.backHome(); this.backHome();
}, },
backHome () { backHome () {
if (this.recording) this.stopAudio(); if (this.recording) this.stopAudio(true);
this.$refs.home.finishRef.close(); this.$refs.home.finishRef.close();
this.id = ""; this.id = "";
this.type = ""; this.type = "";
...@@ -242,7 +231,7 @@ export default { ...@@ -242,7 +231,7 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.module-box { .module-box {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
......
...@@ -323,7 +323,7 @@ export default { ...@@ -323,7 +323,7 @@ export default {
this.backHome(); this.backHome();
}, },
backHome() { backHome() {
if (this.recording) this.stopAudio(); if (this.recording) this.stopAudio(true);
this.recording = false; this.recording = false;
this.$refs.finish.close(); this.$refs.finish.close();
this.id = ""; this.id = "";
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!