fix: 增加判断
This commit is contained in:
parent
de7986c47d
commit
1b9a52c844
|
@ -215,7 +215,7 @@
|
||||||
let goodsCount = null, goodsDetail = null;
|
let goodsCount = null, goodsDetail = null;
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#exchangePage',
|
el: '#exchangePage',
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
account: '',
|
account: '',
|
||||||
reAccount: '',
|
reAccount: '',
|
||||||
|
@ -253,7 +253,7 @@
|
||||||
|
|
||||||
|
|
||||||
filters: {
|
filters: {
|
||||||
cardType (val) {
|
cardType(val) {
|
||||||
return val.map((item) => {
|
return val.map((item) => {
|
||||||
return item == 1 ? "借记卡" : "信用卡" + " ";
|
return item == 1 ? "借记卡" : "信用卡" + " ";
|
||||||
}).join(" ");
|
}).join(" ");
|
||||||
|
@ -261,17 +261,17 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
account (va) {
|
account(va) {
|
||||||
va && this.watchAccount();
|
va && this.watchAccount();
|
||||||
},
|
},
|
||||||
|
|
||||||
reAccount (va) {
|
reAccount(va) {
|
||||||
va && this.watchAccount();
|
va && this.watchAccount();
|
||||||
},
|
},
|
||||||
|
|
||||||
productType: {
|
productType: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler (newVal) {
|
handler(newVal) {
|
||||||
this.maxlen = 50;
|
this.maxlen = 50;
|
||||||
this.acctype = "text";
|
this.acctype = "text";
|
||||||
switch (Number(newVal)) {
|
switch (Number(newVal)) {
|
||||||
|
@ -345,15 +345,17 @@
|
||||||
modelPop
|
modelPop
|
||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
created() {
|
||||||
/* 配置信息 */
|
/* 配置信息 */
|
||||||
document.title = localStorage.getItem('title');
|
document.title = localStorage.getItem('title');
|
||||||
let detailsConfig = JSON.parse(localStorage.getItem('product_detail'));
|
let detailsConfig = JSON.parse(localStorage.getItem('product_detail'));
|
||||||
goodsCount = localStorage.getItem('goodsCount');
|
goodsCount = localStorage.getItem('goodsCount');
|
||||||
this.backAble = goodsCount > 1;//多个商品才有返回
|
this.backAble = goodsCount > 1;//多个商品才有返回
|
||||||
|
if (detailsConfig) {
|
||||||
this.bgcolor = detailsConfig.button_color;
|
this.bgcolor = detailsConfig.button_color;
|
||||||
this.ftColor = detailsConfig.font_color;
|
this.ftColor = detailsConfig.font_color;
|
||||||
this.describe = detailsConfig.describe;
|
this.describe = detailsConfig.describe;
|
||||||
|
}
|
||||||
|
|
||||||
//商品详情
|
//商品详情
|
||||||
goodsDetail = JSON.parse(localStorage.getItem('goodsInfo'));
|
goodsDetail = JSON.parse(localStorage.getItem('goodsInfo'));
|
||||||
|
@ -364,18 +366,18 @@
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
/* 手机号验证 */
|
/* 手机号验证 */
|
||||||
computedAccount () {
|
computedAccount() {
|
||||||
return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.account);
|
return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.account);
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 兑换按钮验证 */
|
/* 兑换按钮验证 */
|
||||||
computedExChange () {
|
computedExChange() {
|
||||||
return this.exchangeOpen || (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) || this.goodInfo.is_e_card && this.computedAccount && this.jd_code.length === 6;
|
return this.exchangeOpen || (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) || this.goodInfo.is_e_card && this.computedAccount && this.jd_code.length === 6;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
bindAvailable () {
|
bindAvailable() {
|
||||||
if (goodsDetail.wait_pay_order == 1) {
|
if (goodsDetail.wait_pay_order == 1) {
|
||||||
this.openErrorDialog('您有未支付的订单');
|
this.openErrorDialog('您有未支付的订单');
|
||||||
return;
|
return;
|
||||||
|
@ -387,7 +389,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 获取京东E卡短信 */
|
/* 获取京东E卡短信 */
|
||||||
sendJDSms () {
|
sendJDSms() {
|
||||||
if (this.cunt === 60) {
|
if (this.cunt === 60) {
|
||||||
req.axiosPost('/key/order/jdSendSms', { code_batch_id: this.goodsDetail.code_batch_id, mobile: this.account })
|
req.axiosPost('/key/order/jdSendSms', { code_batch_id: this.goodsDetail.code_batch_id, mobile: this.account })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
@ -408,7 +410,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 请求详情 */
|
/* 请求详情 */
|
||||||
getDetails (goods_id, code_batch_id) {
|
getDetails(goods_id, code_batch_id) {
|
||||||
const token = localStorage.getItem('token');
|
const token = localStorage.getItem('token');
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
req.axiosPost(`/key/product_detail/${goods_id}`, { token, code_batch_id }).then(({ code, data, message }) => {
|
req.axiosPost(`/key/product_detail/${goods_id}`, { token, code_batch_id }).then(({ code, data, message }) => {
|
||||||
|
@ -452,11 +454,11 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 跳转订单 */
|
/* 跳转订单 */
|
||||||
toOrder () {
|
toOrder() {
|
||||||
window.location.replace('./myOrder.html');
|
window.location.replace('./myOrder.html');
|
||||||
},
|
},
|
||||||
|
|
||||||
openErrorDialog (tip, bottomText) {
|
openErrorDialog(tip, bottomText) {
|
||||||
this.popTitle = '温馨提示';
|
this.popTitle = '温馨提示';
|
||||||
this.popText = tip;
|
this.popText = tip;
|
||||||
this.popStatus = 2;
|
this.popStatus = 2;
|
||||||
|
@ -464,7 +466,7 @@
|
||||||
this.bottomText = bottomText;
|
this.bottomText = bottomText;
|
||||||
},
|
},
|
||||||
|
|
||||||
backHandler () {
|
backHandler() {
|
||||||
if (goodsCount > 1) {
|
if (goodsCount > 1) {
|
||||||
window.location.replace('./couponCollection.html');
|
window.location.replace('./couponCollection.html');
|
||||||
} else {
|
} else {
|
||||||
|
@ -473,7 +475,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
// 单条弹框
|
// 单条弹框
|
||||||
openDialog (tip) {
|
openDialog(tip) {
|
||||||
this.promtshow = true;
|
this.promtshow = true;
|
||||||
this.promttip = tip;
|
this.promttip = tip;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -483,14 +485,14 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 弹窗回调 */
|
/* 弹窗回调 */
|
||||||
backFunctionPop (type) {
|
backFunctionPop(type) {
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
this.delayedOut();
|
this.delayedOut();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 延时自动退出 */
|
/* 延时自动退出 */
|
||||||
delayedOut (time = 1) {
|
delayedOut(time = 1) {
|
||||||
let entryLink = localStorage.getItem('entryLink');
|
let entryLink = localStorage.getItem('entryLink');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.replace(entryLink);
|
window.location.replace(entryLink);
|
||||||
|
@ -498,7 +500,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
//兑换商品
|
//兑换商品
|
||||||
exchangeGoodsFn () {
|
exchangeGoodsFn() {
|
||||||
//wait_pay_order 1有订单 5无订单
|
//wait_pay_order 1有订单 5无订单
|
||||||
if (goodsDetail.wait_pay_order == 1) {
|
if (goodsDetail.wait_pay_order == 1) {
|
||||||
this.openErrorDialog('您有未支付的订单');
|
this.openErrorDialog('您有未支付的订单');
|
||||||
|
@ -603,7 +605,7 @@
|
||||||
window.location.href = './settlement.html';
|
window.location.href = './settlement.html';
|
||||||
},
|
},
|
||||||
|
|
||||||
focusFn (a) {
|
focusFn(a) {
|
||||||
let ele = document.querySelector('.ipt-acc');
|
let ele = document.querySelector('.ipt-acc');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
ele.scrollIntoView(false);
|
ele.scrollIntoView(false);
|
||||||
|
@ -612,7 +614,7 @@
|
||||||
}, 400);
|
}, 400);
|
||||||
},
|
},
|
||||||
/* 监听账号 */
|
/* 监听账号 */
|
||||||
watchAccount () {
|
watchAccount() {
|
||||||
if ((this.account === this.reAccount) && this.account) {
|
if ((this.account === this.reAccount) && this.account) {
|
||||||
this.exchangeOpen = true;
|
this.exchangeOpen = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue