|
@@ -143,29 +143,33 @@ const actions = {
|
|
|
*/
|
|
|
async orderInit({ commit, dispatch, state }, { gateId='124p3LK1', vehicleNo = '浙A616A1', callback, endlessLoop }) {
|
|
|
try {
|
|
|
- const unlicensed = vehicleNo.indexOf('临') > -1; // true: 临时车牌;false:普通车牌
|
|
|
- // const res = await checkOut('浙A616A1');
|
|
|
- // const res = await checkOut('闽AAQ5519', unlicensed);
|
|
|
- // const res = await checkOut('粤A51113');
|
|
|
- // const res = await checkOut('沪DCJ986');
|
|
|
- // console.log('无牌车扫码出场', endlessLoop);
|
|
|
- // 场内缴费,调 check-out 接口,
|
|
|
- const method = unlicensed && endlessLoop ? unlicensedCarCheckout : checkOut
|
|
|
- const res = await method(vehicleNo, false, gateId);
|
|
|
- if ( res?.parkingRecord?.totalFee <= 0) {
|
|
|
- callback && callback({
|
|
|
- unlicensed,
|
|
|
- endlessLoop,
|
|
|
- code: endlessLoop,
|
|
|
- orderDetail: res,
|
|
|
- }); // 统一处理错误原因
|
|
|
- return
|
|
|
- }
|
|
|
- // console.log(vehicleNo, res);
|
|
|
- // 所有的优惠时间长转为金额
|
|
|
- // console.log(112, '所有的优惠时间长转为金额');
|
|
|
- // dispatch('orderInitRule', checkOutQHResponse);
|
|
|
- dispatch('orderInitRule', res);
|
|
|
+ dispatch('clearOrderInfo');
|
|
|
+ setTimeout(async () => {
|
|
|
+ const unlicensed = vehicleNo.indexOf('临') > -1; // true: 临时车牌;false:普通车牌
|
|
|
+ // const res = await checkOut('浙A616A1');
|
|
|
+ // const res = await checkOut('闽AAQ5519', unlicensed);
|
|
|
+ // const res = await checkOut('粤A51113');
|
|
|
+ // const res = await checkOut('沪DCJ986');
|
|
|
+ // console.log('无牌车扫码出场', endlessLoop);
|
|
|
+ // 场内缴费,调 check-out 接口,
|
|
|
+ const method = unlicensed && endlessLoop ? unlicensedCarCheckout : checkOut
|
|
|
+ const res = await method(vehicleNo, false, gateId);
|
|
|
+ if ( res?.parkingRecord?.totalFee <= 0) {
|
|
|
+ callback && callback({
|
|
|
+ unlicensed,
|
|
|
+ endlessLoop,
|
|
|
+ code: endlessLoop,
|
|
|
+ orderDetail: res,
|
|
|
+ }); // 统一处理错误原因
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // console.log(vehicleNo, res);
|
|
|
+ // 所有的优惠时间长转为金额
|
|
|
+ // console.log(112, '所有的优惠时间长转为金额');
|
|
|
+ // dispatch('orderInitRule', checkOutQHResponse);
|
|
|
+ dispatch('orderInitRule', res);
|
|
|
+ }, 100)
|
|
|
+
|
|
|
} catch (error) {
|
|
|
// console.log('151151151151151', error);
|
|
|
/* if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(error.code)) {
|
|
@@ -519,7 +523,7 @@ const actions = {
|
|
|
} catch (err) {
|
|
|
console.log(err);
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
|
|
|
// 是否展示优惠
|
|
|
// getIsShowDiscounts({commit, dispatch}, orderDetail) {
|
|
@@ -530,6 +534,43 @@ const actions = {
|
|
|
/*
|
|
|
如果积分发生变化
|
|
|
*/
|
|
|
+ // 订单初始化
|
|
|
+ clearOrderInfo({ state }) {
|
|
|
+ state = {
|
|
|
+ // 微服务接口字段
|
|
|
+ orderDetail: {}, // 订单原始数据
|
|
|
+ isShowDiscounts: false, // 是否展示会员登记优惠
|
|
|
+ discountDesc: '', // 停车优惠(首停、会员减免、消费减免)
|
|
|
+ checkedTotal: 0, // 选中count数
|
|
|
+ enableNewMemberPoints: false, // 是否开启新会员积分
|
|
|
+ enablePoints: false, // 是否开启积分减免
|
|
|
+ usePoints: 0, // 用户已选择的积分
|
|
|
+ isFirst: 0, // 判断用户是否首次进入
|
|
|
+ integralDesc: '', // 积分减免说明文案
|
|
|
+ pointsPerHour: 0, // 每小时兑换积分
|
|
|
+ enableCoupon: false, // 电子优惠券是否启用
|
|
|
+ maxOneDayCoupons: 0, // 单日可选优惠券上限
|
|
|
+ coupons: [], // 可选优惠券数量
|
|
|
+ couponCount: 0, // 已选择优惠券
|
|
|
+ couponDesc: '', // 优惠券说明文案
|
|
|
+ enablePaperCoupons: false, // 启动纸质优惠券
|
|
|
+ usingTotalDiscount: 0, // 优惠金额
|
|
|
+ actualPayFee: 0, // 应付金额
|
|
|
+ availableDiscountFee: 0, // 当日剩余可使用优惠金额
|
|
|
+ // 积分相关
|
|
|
+ available: 0, // 用户可用积分
|
|
|
+ maxPointsTime: '', // 积分最大兑换时长
|
|
|
+ pointsTime: '', // 已兑换的积分时间
|
|
|
+ unitAmount: 0,
|
|
|
+ // 停车优惠:会员等级和消费减免
|
|
|
+ memberLevelDiscount: false, // 是否开启会员等级
|
|
|
+ enableConsume: false, // 是否开启消费减免
|
|
|
+ pointsPerUnit: 0, //
|
|
|
+ // unlicensed: false // true: 临时车牌;false:普通车牌
|
|
|
+ // 无牌车逻辑
|
|
|
+ unlicensedCar: '',
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
export default {
|