Commit 90e1ba35 by 胡悦

提交优惠券校验问题

1 parent 62153801
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-09-06 10:11:03 * @Date: 2024-09-06 10:11:03
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-09-12 17:46:19 * @LastEditTime: 2024-09-13 14:29:45
--> -->
<template> <template>
<view> <view>
...@@ -231,7 +231,15 @@ export default { ...@@ -231,7 +231,15 @@ export default {
handler(newval) { handler(newval) {
console.log(newval, 'carModel') console.log(newval, 'carModel')
this.customerInfo = Object.assign(this.customerInfo, newval) this.customerInfo = Object.assign(this.customerInfo, newval)
try {
// 监听完成接待修改数据,同步修改生成优惠券按钮状态
const { customerName, phoneNumber, staffName } = this.customerInfo
this.isCheck = customerName && phoneNumber && staffName
} catch (error) {
this.isCheck = false
}
this.pageParams.showDetail = false this.pageParams.showDetail = false
this.$forceUpdate()
} }
}, },
watchStatus: { watchStatus: {
...@@ -239,7 +247,6 @@ export default { ...@@ -239,7 +247,6 @@ export default {
handler(newval) { handler(newval) {
console.log('重新进入', this.pageParams) console.log('重新进入', this.pageParams)
this.pageParams.QRURL = '' this.pageParams.QRURL = ''
this.isCheck = false
if (this.couponList.length) { if (this.couponList.length) {
let item = this.couponList.find(e => e.couponType == 1), let item = this.couponList.find(e => e.couponType == 1),
item2 = this.couponList.find(e => e.couponType == 18) item2 = this.couponList.find(e => e.couponType == 18)
...@@ -346,6 +353,12 @@ export default { ...@@ -346,6 +353,12 @@ export default {
this.pageParams.customerQr = qrcode.createQrCodeImg(`id=${customerCouponId}`, {size: 200}) this.pageParams.customerQr = qrcode.createQrCodeImg(`id=${customerCouponId}`, {size: 200})
} }
this.init() this.init()
try {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo
this.isCheck = customerName && phoneNumber && staffName
} catch (error) {
this.isCheck = false
}
}, },
close () { close () {
this.$refs.couponPopup.close() this.$refs.couponPopup.close()
...@@ -390,6 +403,7 @@ export default { ...@@ -390,6 +403,7 @@ export default {
}, },
async createCoupon() { async createCoupon() {
if (this.pageParams.received) return if (this.pageParams.received) return
if (!this.isCheck) return // 按钮置灰的情况
try { try {
console.log(this.pageParams) console.log(this.pageParams)
const { pageParams: { clickFlag, couponId }, carInfo, customerInfo } = this, { const { pageParams: { clickFlag, couponId }, carInfo, customerInfo } = this, {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!