Commit a1c0dca7 by 前端

退出关掉语音

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