Commit cf03a5b1 by 前端

Merge branch 'v1.0.5' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.5

2 parents dad42445 8bdcbea1
...@@ -489,11 +489,11 @@ export default { ...@@ -489,11 +489,11 @@ export default {
border-radius: 100%; border-radius: 100%;
} }
.user-name { .user-name {
max-width: 80%;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #292d33; color: #292d33;
margin-top: 16rpx; margin-top: 16rpx;
padding: 0 24rpx;
} }
.user-position { .user-position {
font-size: 20rpx; font-size: 20rpx;
......
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
carModel, carModel,
tempFilePath tempFilePath
); );
if (customerName && phoneNumber && salesUuid && carModel) if (customerName && phoneNumber && salesUuid)
uni.$api.commonApi.saveRecCustomer(params).then((res) => { uni.$api.commonApi.saveRecCustomer(params).then((res) => {
console.log(res, params); console.log(res, params);
}); });
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
<scroll-view <scroll-view
class="record-box" class="record-box"
scroll-y scroll-y
@scrolltolower="pageonReachBottom"
@scroll="scroll"
> >
<view class="list"> <view class="list">
<template v-if="list.length"> <template v-if="list.length">
......
...@@ -71,7 +71,11 @@ ...@@ -71,7 +71,11 @@
class="customer-info flex" class="customer-info flex"
@click="pageParams.showDetail = !pageParams.showDetail" @click="pageParams.showDetail = !pageParams.showDetail"
> >
<view class="text text-hide"> {{customerInfo.customerName}} | {{customerInfo.carModel}}</view> <view class="text text-hide flex">
<view class="text-hide">{{customerInfo.customerName}}</view>
<view class="line">|</view>
<view class="text-hide">{{customerInfo.carModel || '-'}}</view>
</view>
<view class="sprite-icon icon-customer-detail"></view> <view class="sprite-icon icon-customer-detail"></view>
</view> </view>
<view <view
...@@ -89,7 +93,7 @@ ...@@ -89,7 +93,7 @@
{{i.format(customerInfo)}} {{i.format(customerInfo)}}
</template> </template>
<template v-else> <template v-else>
{{customerInfo[i.key]}} {{customerInfo[i.key] || '-'}}
</template> </template>
</view> </view>
</view> </view>
...@@ -143,7 +147,7 @@ ...@@ -143,7 +147,7 @@
</MessageBox> </MessageBox>
<MessageBox <MessageBox
ref="couponTips" ref="couponTips"
content="该门店礼券已使用完,请联系管理员配置。" :content="couponErrorTips"
:showCancelBtn="false" :showCancelBtn="false"
confirmBtnText="知道了" confirmBtnText="知道了"
></MessageBox> ></MessageBox>
...@@ -243,14 +247,15 @@ export default { ...@@ -243,14 +247,15 @@ export default {
carInfo: {}, carInfo: {},
QRURL: '', QRURL: '',
showDetail: false showDetail: false
} },
couponErrorTips: ''
} }
}, },
watch: { watch: {
watchCustomerInfo: { watchCustomerInfo: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
if (this.show) this.customerInfo = newval this.customerInfo = newval
} }
}, },
show (n) { show (n) {
...@@ -262,6 +267,7 @@ export default { ...@@ -262,6 +267,7 @@ export default {
this.pageParams = this.$options.data.call(this).pageParams this.pageParams = this.$options.data.call(this).pageParams
this.resetFocusIndex() this.resetFocusIndex()
this.customerInfo = {} this.customerInfo = {}
this.$refs.qrbox.close()
} }
} }
}, },
...@@ -303,7 +309,7 @@ export default { ...@@ -303,7 +309,7 @@ export default {
else if (item2) this.chooseCoupon(item) //次选填入「精品」类型 else if (item2) this.chooseCoupon(item) //次选填入「精品」类型
else this.chooseCoupon(arr[0]) // 无此两种类型情况默认带入任意类型礼券 else this.chooseCoupon(arr[0]) // 无此两种类型情况默认带入任意类型礼券
} }
} else this.$refs.couponTips.open() }
this.couponList = arr this.couponList = arr
}, },
inputCustomer () { inputCustomer () {
...@@ -347,8 +353,9 @@ export default { ...@@ -347,8 +353,9 @@ export default {
async createCoupon () { async createCoupon () {
try { try {
const { pageParams: { couponId, carInfo }, customerInfo } = this, { const { pageParams: { couponId, carInfo }, customerInfo } = this, {
shopMerchantId } = uni.$storage.get("userInfo") shopMerchantId } = uni.$storage.get("userInfo"),
await this.validate() validateStatus = await this.validate()
if (!validateStatus) return
uni.showLoading() uni.showLoading()
let { staffName, salesUuid } = customerInfo, let { staffName, salesUuid } = customerInfo,
scene = `id=${couponId}&userId=${salesUuid}&employName=${staffName}&merchantId=${shopMerchantId}&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`, scene = `id=${couponId}&userId=${salesUuid}&employName=${staffName}&merchantId=${shopMerchantId}&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
...@@ -375,20 +382,29 @@ export default { ...@@ -375,20 +382,29 @@ export default {
else throw '生成小程序码失败,请重试!' else throw '生成小程序码失败,请重试!'
} else throw message } else throw message
} catch (error) { } catch (error) {
console.log(error) if (error) {
this.couponErrorTips = error
this.$refs.couponTips.open()
}
}
},
async validate () {
let flag = true
try {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this.pageParams
// 检查车主姓名
if (!customerName || !phoneNumber || !carModel || !staffName) throw '请输入客户信息'
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
if (!couponId) throw '请选择礼券类型'
} catch (error) {
uni.showToast({ uni.showToast({
title: error, title: error,
icon: 'none', icon: 'none',
}) })
flag = false
} }
}, return flag
async validate () {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this.pageParams
// 检查车主姓名
if (!customerName || !phoneNumber || !carModel || !staffName) throw '请输入客户信息'
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
if (!couponId) throw '请选择礼券类型'
}, },
checkCustomerReceivedStatus (receiveCouponStartTime) { checkCustomerReceivedStatus (receiveCouponStartTime) {
try { try {
...@@ -407,7 +423,7 @@ export default { ...@@ -407,7 +423,7 @@ export default {
this.$refs.qrbox.close() this.$refs.qrbox.close()
}, 3e3) }, 3e3)
} }
}, 1e3) }, 2e3)
} catch (error) { } catch (error) {
if (error) uni.showToast({ if (error) uni.showToast({
title: error, title: error,
...@@ -416,7 +432,7 @@ export default { ...@@ -416,7 +432,7 @@ export default {
} }
}, },
closeQr () { closeQr () {
clearInterval(this.pageParams.qrTimer) if (this.pageParams.qrTimer) clearInterval(this.pageParams.qrTimer)
this.pageParams.qrTimer = null this.pageParams.qrTimer = null
}, },
...@@ -537,6 +553,16 @@ export default { ...@@ -537,6 +553,16 @@ export default {
border-radius: 16rpx; border-radius: 16rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 24rpx; padding: 0 24rpx;
.text {
flex: 1;
.text-hide {
max-width: calc(50% - 10rpx);
}
}
.line {
margin: 0 6rpx;
flex-shrink: 0;
}
.sprite-icon { .sprite-icon {
flex-shrink: 0; flex-shrink: 0;
margin-left: auto; margin-left: auto;
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
> >
<uni-icons <uni-icons
type="left" type="left"
:size="24" :size="20"
color="#000"
></uni-icons> ></uni-icons>
</view> </view>
<view class="title">{{ title }}</view> <view class="title">{{ title }}</view>
...@@ -84,10 +85,10 @@ export default { ...@@ -84,10 +85,10 @@ export default {
default: "preview", default: "preview",
}, },
customerType: Number, customerType: Number,
historyId: [Number, String]
}, },
data () { data () {
return { return {
historyId: ''
}; };
}, },
computed: { computed: {
...@@ -100,11 +101,6 @@ export default { ...@@ -100,11 +101,6 @@ export default {
return this.$store.state.user.historyStatus; return this.$store.state.user.historyStatus;
}, },
}, },
watch: {
watchStatus () {
this.historyId = ''
}
},
mounted () { }, mounted () { },
methods: { methods: {
...mapMutations("audio", ["setReceptionStatus"]), ...mapMutations("audio", ["setReceptionStatus"]),
...@@ -126,12 +122,12 @@ export default { ...@@ -126,12 +122,12 @@ export default {
/**切换素材 */ /**切换素材 */
choose (e) { choose (e) {
if (this.id == 7) this.$refs.media7[0].closeAllPopup(); if (this.id == 7) this.$refs.media7[0].closeAllPopup();
this.jumpPage(e.id) this.jumpPage({ id: e.id })
}, },
back () { back () {
if (this.historyId) { if (this.historyId) {
this.jumpPage({ id: this.historyId }) this.jumpPage({ id: this.historyId })
this.historyId = '' this.$emit('update:historyId', '')
return return
} }
this.$refs?.toolRef?.hide(); this.$refs?.toolRef?.hide();
...@@ -143,7 +139,7 @@ export default { ...@@ -143,7 +139,7 @@ export default {
this.$emit("done", e); this.$emit("done", e);
}, },
jumpPage ({ id, historyId }) { jumpPage ({ id, historyId }) {
if (historyId) this.historyId = historyId if (historyId) this.$emit('update:historyId', historyId)
this.$emit("update:id", Number(id)); this.$emit("update:id", Number(id));
}, },
/**回店客户 */ /**回店客户 */
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
class="record-box" class="record-box"
scroll-y scroll-y
@scrolltolower="pageonReachBottom" @scrolltolower="pageonReachBottom"
@scroll="scroll"
> >
<view class="list"> <view class="list">
<template v-if="flag"> <template v-if="flag">
......
<template> <template>
<home-frame <home-frame
@preview="preview" @preview="preview"
@start="start" @start="$refs.customerTypeRef.open()"
ref="home" ref="home"
:id="id" :id="id"
@openStep="openStep" @openStep="openStep"
...@@ -41,13 +41,13 @@ ...@@ -41,13 +41,13 @@
ref="detail" ref="detail"
:customerType.sync="customerType" :customerType.sync="customerType"
@reception="reception" @reception="reception"
:historyId.sync="historyId"
/> />
</template> </template>
<template slot="content"> <template slot="content">
<customer-type <customer-type
ref="customerTypeRef" ref="customerTypeRef"
@choose="chooseCustomerType" @choose="chooseCustomerType"
@cancel="stopAudio"
/> />
</template> </template>
</home-frame> </home-frame>
...@@ -71,7 +71,9 @@ export default { ...@@ -71,7 +71,9 @@ export default {
chooseItem: {}, chooseItem: {},
id: '', id: '',
type: '', type: '',
customerType: -1 customerType: -1,
recording: false,
historyId: ''
} }
}, },
onBackPress (options) { onBackPress (options) {
...@@ -94,7 +96,7 @@ export default { ...@@ -94,7 +96,7 @@ export default {
methods: { methods: {
...mapMutations("audio", ["setReceptionStatus"]), ...mapMutations("audio", ["setReceptionStatus"]),
init () { init () {
this.customerType = 0 this.customerType = -1
this.getSoure() this.getSoure()
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo; { shopMerchantId } = userInfo;
...@@ -157,17 +159,24 @@ export default { ...@@ -157,17 +159,24 @@ export default {
this.cancel() this.cancel()
}, },
back () { back () {
if (this.historyId) {
this.id = this.historyId
this.historyId = ''
return
}
if (!this.id) return uni.navigateBack(); if (!this.id) return uni.navigateBack();
if (this.type != "preview") return this.$refs.home.finishRef.open(); if (this.type != "preview") return this.$refs.home.finishRef.open();
this.backHome(); this.backHome();
}, },
backHome () { backHome () {
this.stopAudio(); if (this.recording) this.stopAudio();
this.$refs.home.finishRef.close(); this.$refs.home.finishRef.close();
this.id = ""; this.id = "";
this.type = ""; this.type = "";
this.customerType = -1
this.clearHistory(); this.clearHistory();
this.init(); this.init();
this.recording = false
}, },
async start (before = true) { async start (before = true) {
const result = await this.$permision.requestAndroidPermission( const result = await this.$permision.requestAndroidPermission(
...@@ -180,12 +189,9 @@ export default { ...@@ -180,12 +189,9 @@ export default {
}); });
return; return;
} }
if (before) this.clearHistory();
if (before) {
this.clearHistory();
this.$refs.customerTypeRef.open()
}
this.startAudio(); this.startAudio();
this.recording = true
}, },
jumpPage (id) { jumpPage (id) {
this.id = id ? id : this.moduleList[0].id this.id = id ? id : this.moduleList[0].id
...@@ -202,6 +208,7 @@ export default { ...@@ -202,6 +208,7 @@ export default {
chooseCustomerType (index) { chooseCustomerType (index) {
const { moduleList } = this const { moduleList } = this
this.customerType = index this.customerType = index
this.start()
if (index == 0) { if (index == 0) {
const { id } = moduleList[moduleList.length - 1] const { id } = moduleList[moduleList.length - 1]
this.jumpPage(id) this.jumpPage(id)
...@@ -210,10 +217,11 @@ export default { ...@@ -210,10 +217,11 @@ export default {
}, },
done (e) { done (e) {
this.$refs.home.finishRef.close(); this.$refs.home.finishRef.close();
this.stopAudio(); if (this.recording) this.stopAudio();
setTimeout(() => { setTimeout(() => {
this.id = ""; this.id = "";
this.type = ""; this.type = "";
this.recording = false
this.setReceptionStatus(e); this.setReceptionStatus(e);
}, 1500); }, 1500);
}, },
...@@ -222,7 +230,6 @@ export default { ...@@ -222,7 +230,6 @@ export default {
}, },
/**客户邀约接待 */ /**客户邀约接待 */
reception () { reception () {
console.log('?')
let { customerType } = this let { customerType } = this
if (customerType == -1) this.start(false) //开始接待 if (customerType == -1) this.start(false) //开始接待
this.customerType = 0 this.customerType = 0
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="popup-box"> <view class="popup-box">
<view class="nav-bar"> <view class="nav-bar">
<view class="back" @click="back"> <view class="back" @click="back">
<uni-icons type="left" :size="24" color="#fff"></uni-icons> <uni-icons type="left" :size="20" color="#fff"></uni-icons>
</view> </view>
<view class="title">{{ title }}</view> <view class="title">{{ title }}</view>
</view> </view>
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
> >
<uni-icons <uni-icons
type="left" type="left"
:size="24" :size="20"
color="#000"
></uni-icons> ></uni-icons>
</view> </view>
</view> </view>
...@@ -62,6 +63,7 @@ ...@@ -62,6 +63,7 @@
class="list" class="list"
scroll-y scroll-y
enable-flex enable-flex
:show-scrollbar="true"
> >
<account-list <account-list
v-show="stepIndex == 0" v-show="stepIndex == 0"
...@@ -129,11 +131,11 @@ export default { ...@@ -129,11 +131,11 @@ export default {
this.stepIndex = 2 this.stepIndex = 2
this.$refs.scene.init(userInfo) this.$refs.scene.init(userInfo)
}, },
setStep(index){ setStep (index) {
let {stepIndex} = this let { stepIndex } = this
if(index == 2) return if (index == 2) return
if(stepIndex > index) this.stepIndex = index if (stepIndex > index) this.stepIndex = index
} }
} }
} }
...@@ -288,6 +290,14 @@ export default { ...@@ -288,6 +290,14 @@ export default {
position: relative; position: relative;
z-index: 2; z-index: 2;
height: calc(100% - 176rpx); height: calc(100% - 176rpx);
& ::-webkit-scrollbar{
background-color: #ffffff59 !important;
}
& ::-webkit-scrollbar-thumb {
width: 8rpx;
background-color: #fff !important;
border-radius: 4rpx;
}
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
> >
<uni-icons <uni-icons
type="left" type="left"
:size="24" :size="20"
color="#000"
></uni-icons> ></uni-icons>
</view> </view>
</view> </view>
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<view class="name"> <view class="name">
{{ item.customerName }} {{ item.customerName }}
</view> </view>
<view class="goods-name">{{ item.carModel }}</view> <view class="goods-name">{{ item.carModel || '-'}}</view>
<template v-for="(k, ind) in itemObject"> <template v-for="(k, ind) in itemObject">
<view <view
class="info flex" class="info flex"
...@@ -257,6 +257,7 @@ export default { ...@@ -257,6 +257,7 @@ export default {
this.pageNum = 1 this.pageNum = 1
this.dateIndex = index this.dateIndex = index
this.getReceptionList() this.getReceptionList()
this.getReceptionStatistics(0)
}, },
pageonReachBottom () { pageonReachBottom () {
let { pageNum, total, nothing, pageSize } = this let { pageNum, total, nothing, pageSize } = this
......
...@@ -6,16 +6,31 @@ ...@@ -6,16 +6,31 @@
* @LastEditTime: 2024-04-18 17:08:12 * @LastEditTime: 2024-04-18 17:08:12
--> -->
<template> <template>
<view class="container" @click="handleTouchStart()"> <view
class="container"
@click="handleTouchStart()"
>
<view :class="['home', { show: !id }]"> <view :class="['home', { show: !id }]">
<view class="bg"> <view class="bg">
<view class="top"> <view class="top">
<view class="top-one" :style="randomize"></view> <view
class="top-one"
:style="randomize"
></view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="bottom-one" :style="randomize"></view> <view
<view class="bottom-two" :style="randomize"></view> class="bottom-one"
<view class="bottom-three" :style="randomize"></view> :style="randomize"
></view>
<view
class="bottom-two"
:style="randomize"
></view>
<view
class="bottom-three"
:style="randomize"
></view>
</view> </view>
</view> </view>
<!-- <template v-if="false"> --> <!-- <template v-if="false"> -->
...@@ -35,23 +50,27 @@ ...@@ -35,23 +50,27 @@
@click="changeIndex(index)" @click="changeIndex(index)"
> >
<view class="icon-box"> <view class="icon-box">
<view <view :class="[
:class="[
'sprite-icon', 'sprite-icon',
`icon-${i.icon}${tabIndex == index ? '-active' : ''}`, `icon-${i.icon}${tabIndex == index ? '-active' : ''}`,
]" ]"></view>
></view>
</view> </view>
{{ i.label }} {{ i.label }}
</view> </view>
</template> </template>
</view> </view>
<view class="left-footer"> <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 class="sprite-icon icon-feedback"></view>
<view>反馈</view> <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 class="sprite-icon icon-setting"></view>
<view>设置</view> <view>设置</view>
</view> </view>
...@@ -80,7 +99,11 @@ ...@@ -80,7 +99,11 @@
</view> </view>
</template> </template>
<view class="home-title"></view> <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="icon-start sprite-icon icon-icon-handshake"></view>
<view class="start-text">开始接待</view> <view class="start-text">开始接待</view>
...@@ -152,17 +175,26 @@ ...@@ -152,17 +175,26 @@
:isFooter="false" :isFooter="false"
> >
<view class="footer"> <view class="footer">
<view class="footer-btn confirm flex" @click="openStep"> <view
class="footer-btn confirm flex"
@click="openStep"
>
完成接待<text>(推荐)</text> 完成接待<text>(推荐)</text>
</view> </view>
<view class="footer-btn cancel flex" @click="backHome"> <view
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 @nextStep="nextStep" @back="back" /> <novice-guide
@nextStep="nextStep"
@back="back"
/>
<setting-box ref="settingRef" /> <setting-box ref="settingRef" />
</view> </view>
</template> </template>
...@@ -177,7 +209,7 @@ import SettingBox from "@/components/HomeFrame/components/SettingBox"; ...@@ -177,7 +209,7 @@ import SettingBox from "@/components/HomeFrame/components/SettingBox";
export default { export default {
mixins: [myClick], mixins: [myClick],
components: { detail, KfBox, NoviceGuide, RecordList, SettingBox }, components: { detail, KfBox, NoviceGuide, RecordList, SettingBox },
data() { data () {
return { return {
moduleList: [], moduleList: [],
userInfo: {}, userInfo: {},
...@@ -198,15 +230,16 @@ export default { ...@@ -198,15 +230,16 @@ export default {
], ],
tabIndex: 0, tabIndex: 0,
dateKey: null, dateKey: null,
recording: false
}; };
}, },
mounted() { mounted () {
setInterval(() => { setInterval(() => {
this.dateKey = Date.now(); this.dateKey = Date.now();
}, 5e3); }, 5e3);
}, },
computed: { computed: {
randomize() { randomize () {
let { dateKey } = this; let { dateKey } = this;
const maxX = uni.getSystemInfoSync().windowWidth - 300, const maxX = uni.getSystemInfoSync().windowWidth - 300,
maxY = uni.getSystemInfoSync().windowHeight - 100, maxY = uni.getSystemInfoSync().windowHeight - 100,
...@@ -215,7 +248,7 @@ export default { ...@@ -215,7 +248,7 @@ export default {
return `transform:translate(${x}px,${y}px);${dateKey};`; return `transform:translate(${x}px,${y}px);${dateKey};`;
}, },
}, },
onBackPress(options) { onBackPress (options) {
if (options.from === "backbutton") { if (options.from === "backbutton") {
// 物理返回按钮触发 // 物理返回按钮触发
// 阻止默认行为,即不执行页面返回 // 阻止默认行为,即不执行页面返回
...@@ -225,16 +258,16 @@ export default { ...@@ -225,16 +258,16 @@ export default {
// 其他情况允许正常返回 // 其他情况允许正常返回
return false; return false;
}, },
onShow() { onShow () {
this.init(); this.init();
}, },
async onReachBottom() { async onReachBottom () {
const { tabIndex } = this; const { tabIndex } = this;
if (tabIndex == 0) this.$refs.detail?.pageonReachBottom(); if (tabIndex == 0) this.$refs.detail?.pageonReachBottom();
// else this.$refs.recordRef?.pageonReachBottom() // else this.$refs.recordRef?.pageonReachBottom()
}, },
methods: { methods: {
init() { init () {
this.getSoure(); this.getSoure();
this.findPayInfo(); this.findPayInfo();
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
...@@ -265,7 +298,7 @@ export default { ...@@ -265,7 +298,7 @@ export default {
}, },
...mapMutations("audio", ["setReceptionStatus"]), ...mapMutations("audio", ["setReceptionStatus"]),
// 查询素材 // 查询素材
async getSoure() { async getSoure () {
const moduleList = await uni.$api.commonApi.findSoureList(); const moduleList = await uni.$api.commonApi.findSoureList();
moduleList.map((e) => { moduleList.map((e) => {
e.top_bg = require(`@/assets/images/media/bg-${e.id}.webp`); e.top_bg = require(`@/assets/images/media/bg-${e.id}.webp`);
...@@ -274,7 +307,7 @@ export default { ...@@ -274,7 +307,7 @@ export default {
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"
); );
...@@ -289,64 +322,67 @@ export default { ...@@ -289,64 +322,67 @@ export default {
this.startAudio(); this.startAudio();
this.id = this.moduleList[0].id; this.id = this.moduleList[0].id;
this.type = "edit"; this.type = "edit";
this.recording = true
}, },
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(); if (this.recording) this.stopAudio();
this.recording = false
setTimeout(() => { setTimeout(() => {
this.id = ""; this.id = "";
this.type = ""; this.type = "";
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.stopAudio(); if (this.recording) this.stopAudio();
this.recording = false
this.$refs.finish.close(); this.$refs.finish.close();
this.id = ""; this.id = "";
this.type = ""; this.type = "";
this.clearHistory(); this.clearHistory();
this.init(); this.init();
}, },
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;
}, },
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();
}, },
// 查询门店支付配置 // 查询门店支付配置
async findPayInfo() { async findPayInfo () {
const { shopMerchantId } = uni.$storage.get("userInfo"); const { shopMerchantId } = uni.$storage.get("userInfo");
const data = await uni.$api.commonApi.findPayInfo({ const data = await uni.$api.commonApi.findPayInfo({
merchantId: shopMerchantId, merchantId: shopMerchantId,
...@@ -370,7 +406,7 @@ export default { ...@@ -370,7 +406,7 @@ export default {
}); });
this.$store.dispatch("setPaymentType", paymentType); this.$store.dispatch("setPaymentType", paymentType);
}, },
changeIndex(index) { changeIndex (index) {
this.tabIndex = index; this.tabIndex = index;
if (index == 0) this.init(); if (index == 0) this.init();
}, },
...@@ -767,7 +803,7 @@ export default { ...@@ -767,7 +803,7 @@ export default {
} }
} }
} }
.pl-20{ .pl-20 {
padding-left: 40rpx; padding-left: 40rpx;
box-sizing: border-box; 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!