Commit a1c0dca7 by 前端

退出关掉语音

1 parent 3f4f25d8
...@@ -6,10 +6,7 @@ ...@@ -6,10 +6,7 @@
* @LastEditTime: 2024-04-16 18:31:54 * @LastEditTime: 2024-04-16 18:31:54
--> -->
<template> <template>
<view <view class="container" @click="handleTouchStart()">
class="container"
@click="handleTouchStart()"
>
<view :class="['home', { show: !id }]"> <view :class="['home', { show: !id }]">
<view class="left-side"> <view class="left-side">
<!-- 左侧内容 --> <!-- 左侧内容 -->
...@@ -20,17 +17,11 @@ ...@@ -20,17 +17,11 @@
<view class="user-position">延保专员</view> <view class="user-position">延保专员</view>
</view> </view>
<view class="left-footer"> <view class="left-footer">
<view <view class="logout" @click="$refs.kfRef.open()">
class="logout"
@click="$refs.kfRef.open()"
>
<view class="icon-logout sprite-icon icon-feedback"></view> <view class="icon-logout sprite-icon icon-feedback"></view>
<view>反馈</view> <view>反馈</view>
</view> </view>
<view <view class="logout" @click="logout">
class="logout"
@click="logout"
>
<view class="icon-logout sprite-icon icon-icon-logout"></view> <view class="icon-logout sprite-icon icon-icon-logout"></view>
<view>退出</view> <view>退出</view>
</view> </view>
...@@ -57,11 +48,7 @@ ...@@ -57,11 +48,7 @@
</view> </view>
</template> </template>
<view class="home-title">客户接待</view> <view class="home-title">客户接待</view>
<button <button class="start" @click="start" hover-class="hover-class">
class="start"
@click="start"
hover-class="hover-class"
>
<view class="icon-start sprite-icon icon-icon-handshake"></view> <view class="icon-start sprite-icon icon-icon-handshake"></view>
<view class="start-text">开始接待</view> <view class="start-text">开始接待</view>
...@@ -126,27 +113,17 @@ ...@@ -126,27 +113,17 @@
:isFooter="false" :isFooter="false"
> >
<view class="footer"> <view class="footer">
<view <view class="footer-btn confirm flex" @click="openStep">
class="footer-btn confirm flex"
@click="openStep"
>
完成接待<text>(推荐)</text> 完成接待<text>(推荐)</text>
</view> </view>
<view <view class="footer-btn cancel flex" @click="backHome">
class="footer-btn cancel flex"
@click="backHome"
>
仍要退出<text>(不推荐)</text> 仍要退出<text>(不推荐)</text>
</view> </view>
</view> </view>
</MessageBox> </MessageBox>
<update-box /> <update-box />
<kf-box ref="kfRef" /> <kf-box ref="kfRef" />
<novice-guide <novice-guide @nextStep="nextStep" @back="back" />
@nextStep="nextStep"
@back="back"
/>
</view> </view>
</template> </template>
<script> <script>
...@@ -158,7 +135,7 @@ import NoviceGuide from "@/components/NoviceGuide.vue"; ...@@ -158,7 +135,7 @@ import NoviceGuide from "@/components/NoviceGuide.vue";
export default { export default {
mixins: [myClick], mixins: [myClick],
components: { detail, KfBox, NoviceGuide }, components: { detail, KfBox, NoviceGuide },
data () { data() {
return { return {
moduleList: [], moduleList: [],
userInfo: {}, userInfo: {},
...@@ -169,7 +146,7 @@ export default { ...@@ -169,7 +146,7 @@ export default {
thumbnailFulfillList: [], thumbnailFulfillList: [],
}; };
}, },
mounted () { mounted() {
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo; { shopMerchantId } = userInfo;
this.userInfo = userInfo; this.userInfo = userInfo;
...@@ -196,7 +173,7 @@ export default { ...@@ -196,7 +173,7 @@ export default {
this.$store.dispatch("setEmployeeList", res); this.$store.dispatch("setEmployeeList", res);
}); });
}, },
onBackPress (options) { onBackPress(options) {
if (options.from === "backbutton") { if (options.from === "backbutton") {
// 物理返回按钮触发 // 物理返回按钮触发
// 阻止默认行为,即不执行页面返回 // 阻止默认行为,即不执行页面返回
...@@ -206,22 +183,21 @@ export default { ...@@ -206,22 +183,21 @@ export default {
// 其他情况允许正常返回 // 其他情况允许正常返回
return false; return false;
}, },
onShow () { onShow() {
this.getSoure(); this.getSoure();
}, },
async onReachBottom () { async onReachBottom() {
this.$refs.detail?.pageonReachBottom(); this.$refs.detail?.pageonReachBottom();
}, },
methods: { methods: {
...mapMutations("audio", ["setReceptionStatus"]), ...mapMutations("audio", ["setReceptionStatus"]),
// 查询素材 // 查询素材
async getSoure () { async getSoure() {
const moduleList = await uni.$api.commonApi.findSoureList(); const moduleList = await uni.$api.commonApi.findSoureList();
this.moduleList = moduleList; this.moduleList = moduleList;
// this.skeletonStatus = false // this.skeletonStatus = false
}, },
async start () { async start() {
const result = await this.$permision.requestAndroidPermission( const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO" "android.permission.RECORD_AUDIO"
); );
...@@ -232,13 +208,13 @@ export default { ...@@ -232,13 +208,13 @@ export default {
}); });
return; return;
} }
this.clearHistory() this.clearHistory();
this.startAudio(); this.startAudio();
this.id = this.moduleList[0].id; this.id = this.moduleList[0].id;
this.type = "edit"; this.type = "edit";
}, },
// 退出 // 退出
logout () { logout() {
uni.$storage.rm("userInfo"); uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId"); uni.$storage.rm("sessionId");
uni.$storage.rm("noSignInUuid"); uni.$storage.rm("noSignInUuid");
...@@ -247,22 +223,22 @@ export default { ...@@ -247,22 +223,22 @@ export default {
url: "/pages/common/login", url: "/pages/common/login",
}); });
}, },
toDetail (item) { toDetail(item) {
this.chooseItem = item; this.chooseItem = item;
this.$refs.previewRef.open(); this.$refs.previewRef.open();
}, },
cancel () { cancel() {
this.$refs.previewRef.close(); this.$refs.previewRef.close();
}, },
preview () { preview() {
let { id } = this.chooseItem; let { id } = this.chooseItem;
this.type = "preview"; this.type = "preview";
this.id = id; this.id = id;
this.$refs.previewRef.close(); this.$refs.previewRef.close();
}, },
// 完成接待 // 完成接待
done (e) { done(e) {
this.$refs.finish.close() this.$refs.finish.close();
this.stopAudio(); this.stopAudio();
// uni.navigateBack(); // uni.navigateBack();
setTimeout(() => { setTimeout(() => {
...@@ -271,39 +247,39 @@ export default { ...@@ -271,39 +247,39 @@ export default {
this.setReceptionStatus(e); this.setReceptionStatus(e);
}, 1500); }, 1500);
}, },
back () { back() {
if (!this.id) return uni.navigateBack(); if (!this.id) return uni.navigateBack();
if (this.type != "preview") return this.$refs.finish.open(); if (this.type != "preview") return this.$refs.finish.open();
this.backHome() this.backHome();
}, },
backHome () { backHome() {
this.$refs.finish.close() this.stopAudio();
this.$refs.finish.close();
this.id = ""; this.id = "";
this.type = ""; this.type = "";
this.clearHistory() this.clearHistory();
}, },
thumbnailLoad (id) { thumbnailLoad(id) {
this.thumbnailFulfillList.push(id); this.thumbnailFulfillList.push(id);
if (this.thumbnailFulfillList.length == this.moduleList.length) if (this.thumbnailFulfillList.length == this.moduleList.length)
this.skeletonStatus = false; this.skeletonStatus = false;
}, },
openKf () { openKf() {
this.$refs.kfRef.open(); this.$refs.kfRef.open();
}, },
nextStep () { nextStep() {
let { id } = this.moduleList[0]; let { id } = this.moduleList[0];
this.type = "preview"; this.type = "preview";
this.id = id; this.id = id;
}, },
clearHistory(){ clearHistory() {
this.$store.dispatch("clearCustomerInfo"); this.$store.dispatch("clearCustomerInfo");
this.$store.dispatch("clearHistory"); this.$store.dispatch("clearHistory");
}, },
openStep () { openStep() {
this.$refs.finish.close() this.$refs.finish.close();
this.$refs.detail.open() this.$refs.detail.open();
} },
}, },
}; };
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!