diff --git a/coupon/couponCollection.html b/coupon/couponCollection.html index 7001bc6..c5abcde 100644 --- a/coupon/couponCollection.html +++ b/coupon/couponCollection.html @@ -126,12 +126,13 @@ 券后价 {{item.coupon_price}} + :class="dynamicAsh(item)">{{Number(item.coupon_price)}}

- {{item.origin_price}} + {{Number(item.origin_price)}}

@@ -162,15 +163,16 @@

- {{item.origin_price}} + {{Number(item.origin_price)}}

@@ -227,10 +229,10 @@ x{{item.entity.send_num}} @@ -238,7 +240,7 @@

- {{item.origin_price}} + {{Number(item.origin_price)}}

diff --git a/coupon/details.html b/coupon/details.html index 2726b63..0701538 100644 --- a/coupon/details.html +++ b/coupon/details.html @@ -49,20 +49,47 @@

{{goodInfo.product_name}}

- - + @@ -207,6 +227,8 @@ placeholder: '', exchangeOpen: false, suspension: false, + cunt: 60, + jd_code: '', describe: {}, detailUrl: '', goodInfo: '', @@ -340,6 +362,18 @@ this.getDetails(goodsId, code_batch_id); }, + computed: { + /* 手机号验证 */ + computedAccount () { + return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.account); + }, + + /* 兑换按钮验证 */ + 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; + } + }, + methods: { bindAvailable () { if (goodsDetail.wait_pay_order == 1) { @@ -352,6 +386,27 @@ } }, + /* 获取京东E卡短信 */ + sendJDSms () { + if (this.cunt === 60) { + req.axiosPost('/key/order/jdSendSms', { code_batch_id: this.goodsDetail.code_batch_id, mobile: this.account }) + .then((res) => { + if (res.code == 200) { + this.openDialog('短信下发成功!'); + const clr = setInterval(() => { + if (this.cunt <= 1) { + this.cunt = 60; + return clearInterval(clr); + } + this.cunt--; + }, 1000); + } else { + this.openErrorDialog(res.message); + } + }); + } + }, + /* 请求详情 */ getDetails (goods_id, code_batch_id) { const token = localStorage.getItem('token'); @@ -449,10 +504,22 @@ this.openErrorDialog('您有未支付的订单'); return; } + if (goodsDetail.available != 1) { this.openErrorDialog(product_status(goodsDetail.available, goodsDetail)); return; } + + /* 京东E卡 */ + if (this.goodInfo.is_e_card && this.goodInfo.product_type === 1) { + if (this.computedExChange) { + localStorage.setItem('account', this.account); + localStorage.setItem('jd_code', this.jd_code); + window.location.href = './settlement.html'; + } + return; + } + if ((this.goodsDetail.type === 1 && this.goodInfo.product_type === 1) || (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 1)) { /* 兑换码 */ if (!this.account) { this.openDialog('请输入兑换账号!'); diff --git a/coupon/settlement.html b/coupon/settlement.html index 0497c7f..03e4ddc 100644 --- a/coupon/settlement.html +++ b/coupon/settlement.html @@ -290,7 +290,8 @@ "goods_id": this.goodInfo.goods_id, "account": this.account, /* 卡密时默认账号 */ "pay_type": payType == 2 ? 1 : 5, - "pay_amount": this.goodsDetail.coupon_price + "pay_amount": this.goodsDetail.coupon_price, + 'jd_code': this.goodInfo.is_e_card ? localStorage.getItem('jd_code') : '' }; return new Promise((resolve, reject) => { req.axiosPost('/key/createCouponOrder', data).then(res => { diff --git a/exchange.html b/exchange.html index 91d1515..134f73d 100644 --- a/exchange.html +++ b/exchange.html @@ -51,20 +51,44 @@
-

{{goodInfo.product_name}}

+

{{goodInfo.product_name}}

@@ -79,7 +103,7 @@

订单

@@ -147,6 +171,8 @@ popboxshow: false, exchangeOpen: false, suspension: false, + cunt: 60, + jd_code: '', popboxtype: '', describe: {}, detailUrl: '', @@ -207,6 +233,28 @@ return; } }, + + /* 获取京东E卡短信 */ + sendJDSms () { + if (this.cunt === 60) { + req.axiosPost('/key/order/jdSendSms', { code_batch_id: this.goodsDetail.code_batch_id, mobile: this.account }) + .then((res) => { + if (res.code == 200) { + this.openDialog('短信下发成功!'); + const clr = setInterval(() => { + if (this.cunt <= 1) { + this.cunt = 60; + return clearInterval(clr); + } + this.cunt--; + }, 1000); + } else { + this.openErrorDialog(res.message); + } + }); + } + }, + openErrorDialog (tip) { this.maskshow = true; this.popboxtype = '提示'; @@ -260,6 +308,16 @@ return this.surexchangeBtn(); } + /* 京东E卡 */ + if (this.goodInfo.is_e_card && this.goodInfo.product_type === 1) { + if (this.computedExChange) { + this.maskshow = true; + this.popboxshow = true; + this.popboxtype = '兑换'; + } + return; + } + if (!this.account) { this.openDialog('请输入兑换账号!'); return false; @@ -330,7 +388,8 @@ "goods_id": this.goodInfo.goods_id, "account": this.account, "code_batch_id": this.goodInfo.code_batch_id, - "token": localStorage.getItem('token') + "token": localStorage.getItem('token'), + 'jd_code': this.jd_code }; self.popboxshow = false; req.axiosPost('/key/usage', data).then(res => { @@ -397,6 +456,19 @@ this.reaccount = ""; }, }, + + computed: { + /* 手机号验证 */ + computedAccount () { + return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.account); + }, + + /* 兑换按钮验证 */ + 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; + } + }, + watch: { account () { if ((this.account == this.reaccount) && this.account) { diff --git a/homepage2_0.css b/homepage2_0.css index 8b9d508..2efc197 100644 --- a/homepage2_0.css +++ b/homepage2_0.css @@ -777,6 +777,21 @@ img.changegray { z-index: 888; } +#exchangePage .queryCode { + width: 100%; +} + +#exchangePage .query-code { + color: #2691fc; + border: 0; + outline: 0; + font-size: 0.14rem; +} + +#exchangePage .query-code:disabled { + color: #a2cbf5; +} + #exchangePage .about-good > span { position: absolute; top: 0.1rem; @@ -893,7 +908,7 @@ img.changegray { font-size: 0.17rem; font-weight: bold; color: #0a0a0a; - margin-left: 0.12rem; + margin-left: 0.24rem; margin-bottom: 0.24rem; }