From 951d1902fb7e74ca6734da4e72b059848c508208 Mon Sep 17 00:00:00 2001 From: zhangds Date: Tue, 18 Jun 2024 13:47:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=BA=91=E9=97=AA?= =?UTF-8?q?=E4=BB=98=E5=88=A4=E6=96=AD=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packkey/ysf-reduce.html | 39 ++++++++++++++++++++------------------- packkey/ysf.html | 31 ++++++++++++++++--------------- ysf-reduce.html | 39 ++++++++++++++++++++------------------- ysf.html | 31 ++++++++++++++++--------------- 4 files changed, 72 insertions(+), 68 deletions(-) diff --git a/packkey/ysf-reduce.html b/packkey/ysf-reduce.html index abd3e84..660698e 100644 --- a/packkey/ysf-reduce.html +++ b/packkey/ysf-reduce.html @@ -112,7 +112,7 @@ const phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; new Vue({ el: "#ysf", - data () { + data() { return { ysf: JSON.parse(sessionStorage.getItem('goodsInfo')), account: null, @@ -136,7 +136,7 @@ modelPop }, - mounted () { + mounted() { // 领取成功结算 5 if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 5) { settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type); @@ -170,7 +170,7 @@ } }, filters: { - cardType (val) { + cardType(val) { return val.map((item) => { return item == 1 ? "借记卡" : "信用卡" + " "; }).join(" "); @@ -179,22 +179,23 @@ methods: { /* 立即领取 */ - submit () { - if (this.ysf.available != 1 || this.ysf.available != 11) return; - if (phoneReg.test(this.account) && this.confirmAccount) { - if (this.account === this.confirmAccount) { - this.finalSubmit(); + submit() { + // if (this.ysf.available != 1) return; + if ([1, 11].includes(this.ysf.available)) { + if (phoneReg.test(this.account) && this.confirmAccount) { + if (this.account === this.confirmAccount) { + this.finalSubmit(); + } else { + this.tips('手机号输入不一致'); + } } else { - this.tips('手机号输入不一致'); + this.tips('请输入正确的手机号'); } - } else { - this.tips('请输入正确的手机号'); } - }, /* 验证后 最终提交 */ - finalSubmit () { + finalSubmit() { if (this.loading) return; this.loading = true; const self = this; @@ -225,7 +226,7 @@ }, /* 核销云闪付立减金 */ - verificationYsf ({ order_number }) { + verificationYsf({ order_number }) { console.log(order_number); let params = { order_number: order_number, @@ -247,7 +248,7 @@ }, /* 返回 */ - backGoodsFn () { + backGoodsFn() { /* 判断是否web-view打开 则不返回 */ if (this.isMini) return; if (this.backAble) { @@ -260,14 +261,14 @@ }, /* 触发提示 */ - tip (text, status) { + tip(text, status) { this.popText = text; this.popStatus = status; /*1 成功 2提示 3失败 */ this.popShow = true; }, /* 接口异常处理 */ - axiosErrorFun (code, message, status) { + axiosErrorFun(code, message, status) { this.is = false; if (code == 403) { if (this.backAble) { @@ -284,7 +285,7 @@ }, /* 触发提示 */ - tips (text) { + tips(text) { this.cls && clearTimeout(this.cls); this.prompt_text = text; this.promptShow = true; @@ -294,7 +295,7 @@ }, /* 动态font */ - fonts () { + fonts() { const { denomination, reduce_amount } = this.ysf.entity; const defaultCss = { a: '0.34rem' }; const count = String(parseFloat(denomination)).length + String(parseFloat(reduce_amount)).length + 4; diff --git a/packkey/ysf.html b/packkey/ysf.html index bf36334..4b818e9 100644 --- a/packkey/ysf.html +++ b/packkey/ysf.html @@ -105,7 +105,7 @@ const phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; new Vue({ el: "#ysf", - data () { + data() { return { ysf: JSON.parse(sessionStorage.getItem('goodsInfo')), account: null, @@ -127,7 +127,7 @@ modelPop }, - mounted () { + mounted() { // 领取成功结算 5 if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 5) { settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type); @@ -141,22 +141,23 @@ methods: { /* 立即领取 */ - submit () { - if (this.ysf.available != 1 || this.ysf.available != 11) return; - if (phoneReg.test(this.account) && this.confirmAccount) { - if (this.account === this.confirmAccount) { - this.finalSubmit(); + submit() { + // if (this.ysf.available != 1) return; + if ([1, 11].includes(this.ysf.available)) { + if (phoneReg.test(this.account) && this.confirmAccount) { + if (this.account === this.confirmAccount) { + this.finalSubmit(); + } else { + this.tips('手机号输入不一致'); + } } else { - this.tips('手机号输入不一致'); + this.tips('请输入正确的手机号'); } - } else { - this.tips('请输入正确的手机号'); } - }, /* 验证后 最终提交 */ - finalSubmit () { + finalSubmit() { if (this.loading) return; this.loading = true; const self = this; @@ -203,7 +204,7 @@ }, /* 返回 */ - backGoodsFn () { + backGoodsFn() { this.money = 0; /* 判断是否web-view打开 则不返回 */ if (this.isMini) return; @@ -215,14 +216,14 @@ }, /* 触发提示 */ - tip (text, status,) { + tip(text, status,) { this.popText = text; this.popStatus = status; /*1 成功 2提示 3失败 */ this.popShow = true; }, /* 触发提示 */ - tips (text) { + tips(text) { this.cls && clearTimeout(this.cls); this.prompt_text = text; this.promptShow = true; diff --git a/ysf-reduce.html b/ysf-reduce.html index 7fe466e..8a634fd 100644 --- a/ysf-reduce.html +++ b/ysf-reduce.html @@ -113,7 +113,7 @@ const phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; new Vue({ el: "#ysf", - data () { + data() { return { ysf: JSON.parse(sessionStorage.getItem('goodsInfo')), account: null, @@ -137,7 +137,7 @@ modelPop }, - mounted () { + mounted() { document.title = localStorage.getItem('title'); /* 判断是否是微信小程序内 */ let ua = window.navigator.userAgent.toLowerCase(); @@ -166,7 +166,7 @@ } }, filters: { - cardType (val) { + cardType(val) { return val.map((item) => { return item == 1 ? "借记卡" : "信用卡" + " "; }).join(" "); @@ -175,22 +175,23 @@ methods: { /* 立即领取 */ - submit () { - if (this.ysf.available != 1 || this.ysf.available != 11) return; - if (phoneReg.test(this.account) && this.confirmAccount) { - if (this.account === this.confirmAccount) { - this.finalSubmit(); + submit() { + // if (this.ysf.available != 1) return; + if ([1, 11].includes(this.ysf.available)) { + if (phoneReg.test(this.account) && this.confirmAccount) { + if (this.account === this.confirmAccount) { + this.finalSubmit(); + } else { + this.tips('手机号输入不一致'); + } } else { - this.tips('手机号输入不一致'); + this.tips('请输入正确的手机号'); } - } else { - this.tips('请输入正确的手机号'); } - }, /* 验证后 最终提交 */ - finalSubmit () { + finalSubmit() { if (this.loading) return; this.loading = true; const self = this; @@ -215,7 +216,7 @@ }, /* 核销云闪付立减金 */ - verificationYsf ({ order_number }) { + verificationYsf({ order_number }) { console.log(order_number); let params = { order_number: order_number, @@ -237,7 +238,7 @@ }, /* 返回 */ - backGoodsFn () { + backGoodsFn() { /* 判断是否web-view打开 则不返回 */ if (this.isMini) return; if (this.backAble) { @@ -250,14 +251,14 @@ }, /* 触发提示 */ - tip (text, status) { + tip(text, status) { this.popText = text; this.popStatus = status; /*1 成功 2提示 3失败 */ this.popShow = true; }, /* 接口异常处理 */ - axiosErrorFun (code, message, status) { + axiosErrorFun(code, message, status) { this.is = false; if (code == 403) { if (this.backAble) { @@ -274,7 +275,7 @@ }, /* 触发提示 */ - tips (text) { + tips(text) { this.cls && clearTimeout(this.cls); this.prompt_text = text; this.promptShow = true; @@ -284,7 +285,7 @@ }, /* 动态font */ - fonts () { + fonts() { const { denomination, reduce_amount } = this.ysf.entity; const defaultCss = { a: '0.34rem' }; const count = String(parseFloat(denomination)).length + String(parseFloat(reduce_amount)).length + 4; diff --git a/ysf.html b/ysf.html index 0afe8af..51c2871 100644 --- a/ysf.html +++ b/ysf.html @@ -103,7 +103,7 @@ const phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; new Vue({ el: "#ysf", - data () { + data() { return { ysf: JSON.parse(sessionStorage.getItem('goodsInfo')), account: null, @@ -125,7 +125,7 @@ modelPop }, - mounted () { + mounted() { document.title = localStorage.getItem('title'); /* 判断是否是微信小程序内 */ let ua = window.navigator.userAgent.toLowerCase(); @@ -134,22 +134,23 @@ methods: { /* 立即领取 */ - submit () { - if (this.ysf.available != 1 || this.ysf.available != 11) return; - if (phoneReg.test(this.account) && this.confirmAccount) { - if (this.account === this.confirmAccount) { - this.finalSubmit(); + submit() { + // if (this.ysf.available != 1) return; + if ([1, 11].includes(this.ysf.available)) { + if (phoneReg.test(this.account) && this.confirmAccount) { + if (this.account === this.confirmAccount) { + this.finalSubmit(); + } else { + this.tips('手机号输入不一致'); + } } else { - this.tips('手机号输入不一致'); + this.tips('请输入正确的手机号'); } - } else { - this.tips('请输入正确的手机号'); } - }, /* 验证后 最终提交 */ - finalSubmit () { + finalSubmit() { if (this.loading) return; this.loading = true; const self = this; @@ -189,7 +190,7 @@ }, /* 返回 */ - backGoodsFn () { + backGoodsFn() { this.money = 0; /* 判断是否web-view打开 则不返回 */ if (this.isMini) return; @@ -201,14 +202,14 @@ }, /* 触发提示 */ - tip (text, status,) { + tip(text, status,) { this.popText = text; this.popStatus = status; /*1 成功 2提示 3失败 */ this.popShow = true; }, /* 触发提示 */ - tips (text) { + tips(text) { this.cls && clearTimeout(this.cls); this.prompt_text = text; this.promptShow = true;