Commit 90e1ba35 by 胡悦

提交优惠券校验问题

1 parent 62153801
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-09-06 10:11:03
* @LastEditors: huyue
* @LastEditTime: 2024-09-12 17:46:19
* @LastEditTime: 2024-09-13 14:29:45
-->
<template>
<view>
......@@ -231,7 +231,15 @@ export default {
handler(newval) {
console.log(newval, 'carModel')
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.$forceUpdate()
}
},
watchStatus: {
......@@ -239,7 +247,6 @@ export default {
handler(newval) {
console.log('重新进入', this.pageParams)
this.pageParams.QRURL = ''
this.isCheck = false
if (this.couponList.length) {
let item = this.couponList.find(e => e.couponType == 1),
item2 = this.couponList.find(e => e.couponType == 18)
......@@ -346,6 +353,12 @@ export default {
this.pageParams.customerQr = qrcode.createQrCodeImg(`id=${customerCouponId}`, {size: 200})
}
this.init()
try {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo
this.isCheck = customerName && phoneNumber && staffName
} catch (error) {
this.isCheck = false
}
},
close () {
this.$refs.couponPopup.close()
......@@ -390,6 +403,7 @@ export default {
},
async createCoupon() {
if (this.pageParams.received) return
if (!this.isCheck) return // 按钮置灰的情况
try {
console.log(this.pageParams)
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!