|
@@ -12,7 +12,7 @@ const app = {
|
|
},
|
|
},
|
|
};
|
|
};
|
|
import uni from '@/utils/uniHooks';
|
|
import uni from '@/utils/uniHooks';
|
|
-import {parkingLots, qrCodes, unlicensedCarCheckIn, getConfValueOfKey, getVehicles, parkingRecord} from '@/api/parking';
|
|
|
|
|
|
+import {parkingLots, qrCodes, unlicensedCarCheckIn, getConfValueOfKey, getVehicles, parkingRecord, checkEligibility, addVehicles} from '@/api/parking';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -54,8 +54,11 @@ export default {
|
|
tabbarActive: '手动缴费',
|
|
tabbarActive: '手动缴费',
|
|
supportUnlicensed: false, // 控制当前site,是否使用无牌车
|
|
supportUnlicensed: false, // 控制当前site,是否使用无牌车
|
|
qrCodeHistory: '',
|
|
qrCodeHistory: '',
|
|
- isAlipayClient: isAlipayClient
|
|
|
|
|
|
+ isAlipayClient: isAlipayClient,
|
|
// custTypeId: 0,
|
|
// custTypeId: 0,
|
|
|
|
+ // 2.19新增内容
|
|
|
|
+ eligibility: {}, //
|
|
|
|
+ eventId: '',
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -269,9 +272,110 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async checkEligibility() {
|
|
|
|
+ try {
|
|
|
|
+ /*
|
|
|
|
+ * 如果是杭州,并且是登陆情况
|
|
|
|
+ * {
|
|
|
|
+ "eligible": false, // 是否优惠车
|
|
|
|
+ "isBound": false, // 是否绑定
|
|
|
|
+ "maxBindingCount": 3, // 绑定数量上限
|
|
|
|
+ "maxChangeCount": 5, // 换绑数量上限
|
|
|
|
+ "userBindingCount": 3, // 用户当前绑定车牌数量
|
|
|
|
+ "userRemainingChangeCount": 5, // 用户剩余换绑次数
|
|
|
|
+ "redirectTo": "CHANGE_BINDING" // 跳转页面
|
|
|
|
+ }
|
|
|
|
+ BIND_NEW //去绑定
|
|
|
|
+ CHANGE_BINDING //去换绑
|
|
|
|
+ PAY_WITHOUT_DISCOUNT //去无优惠支付或放弃支付
|
|
|
|
+ CHECK_OUT //直接去查费,带优惠
|
|
|
|
+ *
|
|
|
|
+ * */
|
|
|
|
+ // 如果是杭州,并且是登陆情况
|
|
|
|
+ // this.eligibility = await checkEligibility(this.vehicleNumber)
|
|
|
|
+ this.eligibility = {
|
|
|
|
+ "eligible": false, // 是否优惠车
|
|
|
|
+ "isBound": false, // 是否绑定
|
|
|
|
+ "maxBindingCount": 3, // 绑定数量上限
|
|
|
|
+ "maxChangeCount": 5, // 换绑数量上限
|
|
|
|
+ "userBindingCount": 3, // 用户当前绑定车牌数量
|
|
|
|
+ "userRemainingChangeCount": 5, // 用户剩余换绑次数
|
|
|
|
+ "redirectTo": "CHANGE_BINDING" // 跳转页面
|
|
|
|
+ }
|
|
|
|
+ // 是否优惠车 是否绑定, 或者 直接去查费,带优惠
|
|
|
|
+ if(this.eligibility.eligible && this.eligibility.isBound || this.eligibility.redirectTo === 'CHECK_OUT') {
|
|
|
|
+ this.toParkingFeeDetail()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 是否绑定
|
|
|
|
+ if(this.eligibility.redirectTo === 'BIND_NEW' && this.eligibility.maxBindingCount > this.eligibility.userBindingCount) {
|
|
|
|
+ this.$refs['checkCarPopup'].open({
|
|
|
|
+ redirectTo: this.eligibility.redirectTo,
|
|
|
|
+ vehicleNo: this.vehicleNumber,
|
|
|
|
+ topBtnFn: async () => {
|
|
|
|
+ const res = await addVehicles(this.kipUserId,
|
|
|
|
+ {
|
|
|
|
+ userId: this.kipUserId,
|
|
|
|
+ licensePlateType: LICENSE_PLATE_TYPE_ARR[this.carType].value,
|
|
|
|
+ vehicleNo: this.vehicleNumber,
|
|
|
|
+ })
|
|
|
|
+ if(res?.id) {
|
|
|
|
+ this.toParkingFeeDetail()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ bottomBtnFn: () => {
|
|
|
|
+ this.toParkingFeeDetail()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 是否换绑
|
|
|
|
+ if(this.eligibility.redirectTo === 'CHANGE_BINDING' && this.eligibility.userRemainingChangeCount) {
|
|
|
|
+ this.$refs['checkCarPopup'].open({
|
|
|
|
+ redirectTo: this.eligibility.redirectTo,
|
|
|
|
+ vehicleNo: this.vehicleNumber,
|
|
|
|
+ topBtnName: '去换绑(可享停车优惠)',
|
|
|
|
+ topBtnFn: async () => {
|
|
|
|
+ this.doRouter2()
|
|
|
|
+ },
|
|
|
|
+ bottomBtnName: '放弃换绑(无停车优惠)',
|
|
|
|
+ bottomBtnFn: () => {
|
|
|
|
+ this.toParkingFeeDetail()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 去无优惠支付或放弃支付,其余场景都是无优惠
|
|
|
|
+ /*if(this.eligibility.redirectTo === 'PAY_WITHOUT_DISCOUNT') {
|
|
|
|
+
|
|
|
|
+ }*/
|
|
|
|
+ this.$refs['checkCarPopup'].open({
|
|
|
|
+ // redirectTo: this.eligibility.redirectTo,
|
|
|
|
+ redirectTo: 'PAY_WITHOUT_DISCOUNT',
|
|
|
|
+ vehicleNo: this.vehicleNumber,
|
|
|
|
+ topBtnName: '继续缴费(无停车优惠)',
|
|
|
|
+ topBtnFn: () => {
|
|
|
|
+ this.toParkingFeeDetail()
|
|
|
|
+ },
|
|
|
|
+ bottomBtnName: '放弃缴费 ',
|
|
|
|
+ })
|
|
|
|
+ } catch (err) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 校验车牌号
|
|
// 校验车牌号
|
|
- preHandleSearch() {
|
|
|
|
|
|
+ async preHandleSearch() {
|
|
if (this.disabledBtn) return
|
|
if (this.disabledBtn) return
|
|
|
|
+ // 不是杭州的车牌 或者 用户拒绝登陆的场景
|
|
|
|
+ if (!isHZ(this.mallId) || this.$route.query.isLogin === 'loginDenied') {
|
|
|
|
+ this.toParkingFeeDetail()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 查询车辆优惠资格并提示跳转页面
|
|
|
|
+ await this.checkEligibility()
|
|
|
|
+ },
|
|
|
|
+ // 去缴费详情
|
|
|
|
+ toParkingFeeDetail() {
|
|
uni.setStorageSync('carList', [
|
|
uni.setStorageSync('carList', [
|
|
...new Set([this.vehicleNumber, ...this.carList]),
|
|
...new Set([this.vehicleNumber, ...this.carList]),
|
|
].slice(0, 6));
|
|
].slice(0, 6));
|