From d8c2288f59b42a3e6e9bada808d90587d7913559 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 22 Apr 2024 10:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=94=B9=E4=B8=BA=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api2_0.js | 9 ++++++++ exchange.html | 42 +++++++++++++++++------------------ homepage2_0.css | 16 +++++++++----- packkey/exchange.html | 44 ++++++++++++++++++------------------- packkey/redPackets.html | 21 +++++++++--------- packkey/reduce.html | 35 +++++++++++++++-------------- packkey/ysf-reduce.html | 24 ++++++++++---------- packkey/ysf.html | 16 +++++++------- packkey/zfb-redPackets.html | 21 +++++++++--------- packkey/zfb-reduce.html | 27 ++++++++++++----------- redPackets.html | 25 ++++++++++----------- reduce.html | 7 +++--- ysf-reduce.html | 24 ++++++++++---------- ysf.html | 16 +++++++------- zfb-redPackets.css | 17 +++++++++----- zfb-redPackets.html | 21 +++++++++--------- zfb-reduce.html | 27 ++++++++++++----------- 17 files changed, 204 insertions(+), 188 deletions(-) diff --git a/api2_0.js b/api2_0.js index e695738..4b1ed15 100644 --- a/api2_0.js +++ b/api2_0.js @@ -267,3 +267,12 @@ function isWxminiprogram() { return false } } + +/* 自定义按钮文案 */ +function buttonTextFun(type, code) { + const buttonData = JSON.parse(sessionStorage.getItem("bm_auth")).button_conf + const lastText = buttonData.filter( + (item) => item.type == type && item.code == code + )[0] + return lastText.custom || lastText.default +} diff --git a/exchange.html b/exchange.html index 91bf81b..44903ac 100644 --- a/exchange.html +++ b/exchange.html @@ -104,7 +104,7 @@ + @click="exchangeGoodsFn">{{buttonTextFun(goodsDetail.type,'receive')}} @@ -156,7 +156,7 @@ let goodsCount = null, goodsDetail = null; new Vue({ el: '#exchangePage', - data() { + data () { return { account: '', reaccount: '', @@ -189,7 +189,7 @@ ] }; }, - created() { + created () { document.title = localStorage.getItem('title'); let detailsConfig = JSON.parse(localStorage.getItem('product_detail')); goodsCount = sessionStorage.getItem('goodsCount'); @@ -227,7 +227,7 @@ }); }, methods: { - bindAvailable() { + bindAvailable () { if (goodsDetail.available != 1) { this.openErrorDialog(product_status(goodsDetail.available, goodsDetail)); return; @@ -235,7 +235,7 @@ }, /* 获取京东E卡短信 */ - sendJDSms() { + sendJDSms () { if (this.cunt === 60) { req.axiosPost('/key/order/jdSendSms', { code_batch_id: this.goodsDetail.code_batch_id, mobile: this.account }) .then((res) => { @@ -255,27 +255,27 @@ } }, - openErrorDialog(tip) { + openErrorDialog (tip) { this.maskshow = true; this.popboxtype = '提示'; this.tiptext = tip; this.popboxshow = true; }, - backgoodsFn() { + backgoodsFn () { if (goodsCount > 1) { window.location.replace('./homepage.html'); } else { history.go(-2); } }, - closeTip() { + closeTip () { this.suspension = false; }, - susTipFn() { + susTipFn () { this.suspension = true; }, // 单条弹框 - openDialog(tip) { + openDialog (tip) { this.promtshow = true; this.promttip = tip; const clr = setTimeout(() => { @@ -286,12 +286,12 @@ }, //刷新页面 - successchangeBtnFn() { + successchangeBtnFn () { window.location.replace(document.referrer); }, //兑换商品 - exchangeGoodsFn() { + exchangeGoodsFn () { if (goodsDetail.available != 1) { return this.openErrorDialog(product_status(goodsDetail.available, goodsDetail)); } @@ -381,7 +381,7 @@ this.popboxtype = '兑换'; }, //确定兑换 - surexchangeBtn() { + surexchangeBtn () { this.maskshow = false; let self = this; let data = { @@ -435,14 +435,14 @@ }); }, //关闭弹出框,仅关闭弹框 - successchangeBtn() { + successchangeBtn () { this.maskshow = false; this.popboxshow = false; this.account = ""; this.reaccount = ""; this.jd_code = ''; }, - focusFn(a) { + focusFn (a) { let ele = document.querySelector('.ipt-acc'); setTimeout(function () { ele.scrollIntoView(false); @@ -451,7 +451,7 @@ }, 400); }, //关闭,关闭弹框 - closeBtn() { + closeBtn () { this.popboxshow = false; this.maskshow = false; this.account = ""; @@ -462,25 +462,25 @@ computed: { /* 手机号验证 */ - computedAccount() { + computedAccount () { 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; } }, watch: { - account() { + account () { if ((this.account == this.reaccount) && this.account) { this.exchangeOpen = true; } else { this.exchangeOpen = false; } }, - reaccount() { + reaccount () { if ((this.account == this.reaccount) && this.account) { this.exchangeOpen = true; } else { @@ -489,7 +489,7 @@ }, productType: { immediate: true, - handler(newVal) { + handler (newVal) { this.maxlen = 50; this.acctype = "text"; if (newVal == 0) { diff --git a/homepage2_0.css b/homepage2_0.css index 741a297..d8289c9 100644 --- a/homepage2_0.css +++ b/homepage2_0.css @@ -1329,10 +1329,18 @@ ul { } #redPacketsViews .bt { - height: 1.8rem; - line-height: 2.3rem; + width: 2rem; + height: 0.46rem; + background: url("https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/but_back_img.png"); + background-size: 100% 100%; + margin-top: 1rem; text-align: center; + line-height: 0.42rem; + color: #df1104; + font-size: 0.16rem; + font-weight: bold; } + #redPacketsViews .title { margin-top: 0.3rem; font-size: 0.25rem; @@ -1341,10 +1349,6 @@ ul { text-align: center; } -#redPacketsViews .bt img { - width: 2rem; -} - #redPacketsViews .type { color: #fd3b2d; font-size: 0.1rem; diff --git a/packkey/exchange.html b/packkey/exchange.html index 3a27197..ac412e2 100644 --- a/packkey/exchange.html +++ b/packkey/exchange.html @@ -132,7 +132,7 @@ + @click="exchangeGoodsFn">{{buttonTextFun(goodsDetail.type,'receive')}} @@ -185,7 +185,7 @@ let goodsCount = null, goodsDetail = null; new Vue({ el: '#exchangePage', - data() { + data () { return { account: '', reaccount: '', @@ -218,7 +218,7 @@ ] }; }, - created() { + created () { document.title = localStorage.getItem('title'); let detailsConfig = JSON.parse(localStorage.getItem('product_detail')); goodsCount = sessionStorage.getItem('goodsCount'); @@ -255,7 +255,7 @@ }); }); }, - mounted() { + mounted () { // 领取成功结算 5 // 不是卡密 if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 5 && this.goodInfo.product_type !== 2) { @@ -275,7 +275,7 @@ } }, methods: { - bindAvailable() { + bindAvailable () { if (goodsDetail.available != 1) { this.openErrorDialog(product_status(goodsDetail.available, goodsDetail)); return; @@ -283,7 +283,7 @@ }, /* 获取京东E卡短信 */ - sendJDSms() { + sendJDSms () { if (this.cunt === 60) { req.axiosPost('/key/order/jdSendSms', { code_batch_id: this.goodsDetail.code_batch_id, mobile: this.account }) .then((res) => { @@ -303,27 +303,27 @@ } }, - openErrorDialog(tip) { + openErrorDialog (tip) { this.maskshow = true; this.popboxtype = '提示'; this.tiptext = tip; this.popboxshow = true; }, - backgoodsFn() { + backgoodsFn () { if (goodsCount > 1) { locationReplace('./homepage.html'); } else { history.go(-2); } }, - closeTip() { + closeTip () { this.suspension = false; }, - susTipFn() { + susTipFn () { this.suspension = true; }, // 单条弹框 - openDialog(tip) { + openDialog (tip) { this.promtshow = true; this.promttip = tip; const clr = setTimeout(() => { @@ -334,12 +334,12 @@ }, //刷新页面 - successchangeBtnFn() { + successchangeBtnFn () { window.location.replace(document.referrer); }, //兑换商品 - exchangeGoodsFn() { + exchangeGoodsFn () { if (goodsDetail.available != 1) { return this.openErrorDialog(product_status(goodsDetail.available, goodsDetail)); } @@ -429,7 +429,7 @@ this.popboxtype = '兑换'; }, //确定兑换 - surexchangeBtn() { + surexchangeBtn () { this.maskshow = false; let self = this; let data = { @@ -501,14 +501,14 @@ }); }, //关闭弹出框,仅关闭弹框 - successchangeBtn() { + successchangeBtn () { this.maskshow = false; this.popboxshow = false; this.account = ""; this.reaccount = ""; this.jd_code = ''; }, - focusFn(a) { + focusFn (a) { if (goodsDetail.available != 1) { this.bindAvailable(); } @@ -521,7 +521,7 @@ }, 400); }, //关闭,关闭弹框 - closeBtn() { + closeBtn () { this.popboxshow = false; this.maskshow = false; this.account = ""; @@ -532,25 +532,25 @@ computed: { /* 手机号验证 */ - computedAccount() { + computedAccount () { 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; } }, watch: { - account() { + account () { if ((this.account == this.reaccount) && this.account) { this.exchangeOpen = true; } else { this.exchangeOpen = false; } }, - reaccount() { + reaccount () { if ((this.account == this.reaccount) && this.account) { this.exchangeOpen = true; } else { @@ -559,7 +559,7 @@ }, productType: { immediate: true, - handler(newVal) { + handler (newVal) { this.maxlen = 50; this.acctype = "text"; if (newVal == 0) { diff --git a/packkey/redPackets.html b/packkey/redPackets.html index c35d572..cbc6b2f 100644 --- a/packkey/redPackets.html +++ b/packkey/redPackets.html @@ -11,7 +11,7 @@ - +