修复 立减金生效时间限制范围

This commit is contained in:
wangsongsole 2022-08-16 15:44:03 +08:00
parent 30bd46c9d5
commit 52a1450b35
1 changed files with 0 additions and 19 deletions

View File

@ -537,13 +537,6 @@ export default class exchangedit extends React.Component {
addProduct.map((item) => { addProduct.map((item) => {
if (item.type === 2) { if (item.type === 2) {
if (item.origin) { if (item.origin) {
const is = this.compareDate(
this.state.codeInfo.date_time[1],
item.origin.time_limit.effect_time.end_time
)
if (!is)
item.origin.time_limit.effect_time.end_time =
this.state.codeInfo.date_time[1]
addProductCopy.reduce.push(item.origin) addProductCopy.reduce.push(item.origin)
} }
} else { } else {
@ -555,13 +548,6 @@ export default class exchangedit extends React.Component {
const updateProductCopy = { legal: [], reduce: [] } const updateProductCopy = { legal: [], reduce: [] }
updateProduct.map((item) => { updateProduct.map((item) => {
if (item.type === 2) { if (item.type === 2) {
const is = this.compareDate(
this.state.codeInfo.date_time[1],
item.time_limit.effect_time.end_time
)
if (!is)
item.time_limit.effect_time.end_time =
this.state.codeInfo.date_time[1]
updateProductCopy.reduce.push(item) updateProductCopy.reduce.push(item)
} else { } else {
updateProductCopy.legal.push(item) updateProductCopy.legal.push(item)
@ -588,11 +574,6 @@ export default class exchangedit extends React.Component {
return { data, addProduct, updateProduct } return { data, addProduct, updateProduct }
} }
//比较时间
compareDate(d1, d2) {
return new Date(d1.replace(/-/g, '/')) > new Date(d2.replace(/-/g, '/'))
}
submitCodeData() { submitCodeData() {
if (!this.state.reseller) { if (!this.state.reseller) {
Notify.error('该兑换码对应分销商不存在') Notify.error('该兑换码对应分销商不存在')