Commit 01ea895b by 李伟康

commit 修复

1 parent e6fba62e
......@@ -71,7 +71,7 @@
class="customer-info flex"
@click="pageParams.showDetail = !pageParams.showDetail"
>
<view class="text text-hide"> {{customerInfo.customerName}} | {{customerInfo.carModel}}</view>
<view class="text text-hide"> {{customerInfo.customerName}} | {{customerInfo.carModel || '-'}}</view>
<view class="sprite-icon icon-customer-detail"></view>
</view>
<view
......@@ -89,7 +89,7 @@
{{i.format(customerInfo)}}
</template>
<template v-else>
{{customerInfo[i.key]}}
{{customerInfo[i.key] || '-'}}
</template>
</view>
</view>
......@@ -407,7 +407,7 @@ export default {
this.$refs.qrbox.close()
}, 3e3)
}
}, 1e3)
}, 2e3)
} catch (error) {
if (error) uni.showToast({
title: error,
......
......@@ -126,7 +126,7 @@ export default {
/**切换素材 */
choose (e) {
if (this.id == 7) this.$refs.media7[0].closeAllPopup();
this.jumpPage(e.id)
this.jumpPage({ id: e.id })
},
back () {
if (this.historyId) {
......
<template>
<home-frame
@preview="preview"
@start="start"
@start="$refs.customerTypeRef.open()"
ref="home"
:id="id"
@openStep="openStep"
......@@ -47,7 +47,6 @@
<customer-type
ref="customerTypeRef"
@choose="chooseCustomerType"
@cancel="stopAudio"
/>
</template>
</home-frame>
......@@ -71,7 +70,8 @@ export default {
chooseItem: {},
id: '',
type: '',
customerType: -1
customerType: -1,
recording: false
}
},
onBackPress (options) {
......@@ -94,7 +94,7 @@ export default {
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
init () {
this.customerType = 0
this.customerType = -1
this.getSoure()
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
......@@ -162,12 +162,14 @@ export default {
this.backHome();
},
backHome () {
this.stopAudio();
if (this.recording) this.stopAudio();
this.$refs.home.finishRef.close();
this.id = "";
this.type = "";
this.customerType = -1
this.clearHistory();
this.init();
this.recording = false
},
async start (before = true) {
const result = await this.$permision.requestAndroidPermission(
......@@ -180,12 +182,9 @@ export default {
});
return;
}
if (before) {
this.clearHistory();
this.$refs.customerTypeRef.open()
}
if (before) this.clearHistory();
this.startAudio();
this.recording = true
},
jumpPage (id) {
this.id = id ? id : this.moduleList[0].id
......@@ -202,6 +201,7 @@ export default {
chooseCustomerType (index) {
const { moduleList } = this
this.customerType = index
this.start()
if (index == 0) {
const { id } = moduleList[moduleList.length - 1]
this.jumpPage(id)
......@@ -210,10 +210,11 @@ export default {
},
done (e) {
this.$refs.home.finishRef.close();
this.stopAudio();
if (this.recording) this.stopAudio();
setTimeout(() => {
this.id = "";
this.type = "";
this.recording = false
this.setReceptionStatus(e);
}, 1500);
},
......@@ -222,7 +223,6 @@ export default {
},
/**客户邀约接待 */
reception () {
console.log('?')
let { customerType } = this
if (customerType == -1) this.start(false) //开始接待
this.customerType = 0
......
......@@ -6,16 +6,31 @@
* @LastEditTime: 2024-04-18 17:08:12
-->
<template>
<view class="container" @click="handleTouchStart()">
<view
class="container"
@click="handleTouchStart()"
>
<view :class="['home', { show: !id }]">
<view class="bg">
<view class="top">
<view class="top-one" :style="randomize"></view>
<view
class="top-one"
:style="randomize"
></view>
</view>
<view class="bottom">
<view class="bottom-one" :style="randomize"></view>
<view class="bottom-two" :style="randomize"></view>
<view class="bottom-three" :style="randomize"></view>
<view
class="bottom-one"
:style="randomize"
></view>
<view
class="bottom-two"
:style="randomize"
></view>
<view
class="bottom-three"
:style="randomize"
></view>
</view>
</view>
<!-- <template v-if="false"> -->
......@@ -35,23 +50,27 @@
@click="changeIndex(index)"
>
<view class="icon-box">
<view
:class="[
<view :class="[
'sprite-icon',
`icon-${i.icon}${tabIndex == index ? '-active' : ''}`,
]"
></view>
]"></view>
</view>
{{ i.label }}
</view>
</template>
</view>
<view class="left-footer">
<view class="btn" @click="$refs.kfRef.open()">
<view
class="btn"
@click="$refs.kfRef.open()"
>
<view class="sprite-icon icon-feedback"></view>
<view>反馈</view>
</view>
<view class="btn" @click="$refs.settingRef.open()">
<view
class="btn"
@click="$refs.settingRef.open()"
>
<view class="sprite-icon icon-setting"></view>
<view>设置</view>
</view>
......@@ -80,7 +99,11 @@
</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>
......@@ -152,17 +175,26 @@
: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"
/>
<setting-box ref="settingRef" />
</view>
</template>
......@@ -177,7 +209,7 @@ import SettingBox from "@/components/HomeFrame/components/SettingBox";
export default {
mixins: [myClick],
components: { detail, KfBox, NoviceGuide, RecordList, SettingBox },
data() {
data () {
return {
moduleList: [],
userInfo: {},
......@@ -198,15 +230,16 @@ export default {
],
tabIndex: 0,
dateKey: null,
recording: false
};
},
mounted() {
mounted () {
setInterval(() => {
this.dateKey = Date.now();
}, 5e3);
},
computed: {
randomize() {
randomize () {
let { dateKey } = this;
const maxX = uni.getSystemInfoSync().windowWidth - 300,
maxY = uni.getSystemInfoSync().windowHeight - 100,
......@@ -215,7 +248,7 @@ export default {
return `transform:translate(${x}px,${y}px);${dateKey};`;
},
},
onBackPress(options) {
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
......@@ -225,16 +258,16 @@ export default {
// 其他情况允许正常返回
return false;
},
onShow() {
onShow () {
this.init();
},
async onReachBottom() {
async onReachBottom () {
const { tabIndex } = this;
if (tabIndex == 0) this.$refs.detail?.pageonReachBottom();
// else this.$refs.recordRef?.pageonReachBottom()
},
methods: {
init() {
init () {
this.getSoure();
this.findPayInfo();
const userInfo = uni.$storage.get("userInfo"),
......@@ -265,7 +298,7 @@ export default {
},
...mapMutations("audio", ["setReceptionStatus"]),
// 查询素材
async getSoure() {
async getSoure () {
const moduleList = await uni.$api.commonApi.findSoureList();
moduleList.map((e) => {
e.top_bg = require(`@/assets/images/media/bg-${e.id}.webp`);
......@@ -274,7 +307,7 @@ export default {
this.moduleList = moduleList;
// this.skeletonStatus = false
},
async start() {
async start () {
const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO"
);
......@@ -289,64 +322,67 @@ export default {
this.startAudio();
this.id = this.moduleList[0].id;
this.type = "edit";
this.recording = true
},
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) {
done (e) {
this.$refs.finish.close();
this.stopAudio();
if (this.recording) this.stopAudio();
this.recording = false
setTimeout(() => {
this.id = "";
this.type = "";
this.setReceptionStatus(e);
}, 1500);
},
back() {
back () {
if (!this.id) return uni.navigateBack();
if (this.type != "preview") return this.$refs.finish.open();
this.backHome();
},
backHome() {
this.stopAudio();
backHome () {
if (this.recording) this.stopAudio();
this.recording = false
this.$refs.finish.close();
this.id = "";
this.type = "";
this.clearHistory();
this.init();
},
thumbnailLoad(id) {
thumbnailLoad (id) {
this.thumbnailFulfillList.push(id);
if (this.thumbnailFulfillList.length == this.moduleList.length)
this.skeletonStatus = false;
},
nextStep() {
nextStep () {
let { id } = this.moduleList[0];
this.type = "preview";
this.id = id;
},
clearHistory() {
clearHistory () {
this.$store.dispatch("clearCustomerInfo");
this.$store.dispatch("clearHistory");
},
openStep() {
openStep () {
this.$refs.finish.close();
this.$refs.detail.open();
},
// 查询门店支付配置
async findPayInfo() {
async findPayInfo () {
const { shopMerchantId } = uni.$storage.get("userInfo");
const data = await uni.$api.commonApi.findPayInfo({
merchantId: shopMerchantId,
......@@ -370,7 +406,7 @@ export default {
});
this.$store.dispatch("setPaymentType", paymentType);
},
changeIndex(index) {
changeIndex (index) {
this.tabIndex = index;
if (index == 0) this.init();
},
......@@ -767,7 +803,7 @@ export default {
}
}
}
.pl-20{
.pl-20 {
padding-left: 40rpx;
box-sizing: border-box;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!