|
@@ -4,6 +4,7 @@ import uni from '@/utils/uniHooks';
|
|
import { Toast } from 'vant';
|
|
import { Toast } from 'vant';
|
|
import { getPlatform, getAppIdByGroupIdAndMallId, isInWeixinH5 } from '@/utils';
|
|
import { getPlatform, getAppIdByGroupIdAndMallId, isInWeixinH5 } from '@/utils';
|
|
import { initWxJsSdkConfig } from '@/utils/login';
|
|
import { initWxJsSdkConfig } from '@/utils/login';
|
|
|
|
+import moment from 'moment'
|
|
// import { compare } from '@/utils/location.js';
|
|
// import { compare } from '@/utils/location.js';
|
|
// import { isArray } from 'lodash';
|
|
// import { isArray } from 'lodash';
|
|
// import { v4 as uuidv4 } from 'uuid';
|
|
// import { v4 as uuidv4 } from 'uuid';
|
|
@@ -223,7 +224,7 @@ export default {
|
|
let couponList = [...this.couponList]; // 获取目前用户的电子券
|
|
let couponList = [...this.couponList]; // 获取目前用户的电子券
|
|
if (!this.checkedCouponList.length) {
|
|
if (!this.checkedCouponList.length) {
|
|
this.couponList = couponList.map(elm => {
|
|
this.couponList = couponList.map(elm => {
|
|
- elm.disabled = elm?.status !== 'available';
|
|
|
|
|
|
+ elm.disabled = elm?.status !== 'available' || !moment().isBefore(elm.expirationDate);
|
|
return elm;
|
|
return elm;
|
|
})
|
|
})
|
|
return
|
|
return
|
|
@@ -247,9 +248,9 @@ export default {
|
|
// 找到
|
|
// 找到
|
|
couponList = couponList.map((elm, i) => {
|
|
couponList = couponList.map((elm, i) => {
|
|
// 只有 status === 'available' 的才会赋值为 false
|
|
// 只有 status === 'available' 的才会赋值为 false
|
|
- elm.disabled = elm?.status !== 'available'; // 默认可选
|
|
|
|
|
|
+ elm.disabled = elm?.status !== 'available' || !moment().isBefore(elm.expirationDate); // 默认可选
|
|
// 找到所以 superposition === 2 的同类型的券
|
|
// 找到所以 superposition === 2 的同类型的券
|
|
- if ( elm?.status === 'unavailable' ) {
|
|
|
|
|
|
+ if ( elm?.status === 'unavailable' || moment().isSameOrAfter(elm.expirationDate)) {
|
|
// 这里是做一个阻断,就是避免程序往下执行,没有别的意思
|
|
// 这里是做一个阻断,就是避免程序往下执行,没有别的意思
|
|
elm.disabled = true
|
|
elm.disabled = true
|
|
} else if (elm.superposition === superposition) { // 这里是找到一样类型的券
|
|
} else if (elm.superposition === superposition) { // 这里是找到一样类型的券
|
|
@@ -276,7 +277,7 @@ export default {
|
|
isDisabledByRule(item, index, showMsg) {
|
|
isDisabledByRule(item, index, showMsg) {
|
|
const { parkMallCode } = this.orderDetail.parkInfo;
|
|
const { parkMallCode } = this.orderDetail.parkInfo;
|
|
// 最高优先级,提示未生效的电子券
|
|
// 最高优先级,提示未生效的电子券
|
|
- if (item.status === 'unavailable') {
|
|
|
|
|
|
+ if (item.status === 'unavailable' || moment().isSameOrAfter(item.expirationDate)) {
|
|
return Toast({
|
|
return Toast({
|
|
className: 'top300',
|
|
className: 'top300',
|
|
message: `当前电子券暂未生效,不可用`,
|
|
message: `当前电子券暂未生效,不可用`,
|