feat: 改为动态按钮

This commit is contained in:
wangsongsole 2024-04-22 10:24:59 +08:00
parent 96de9742d6
commit d8c2288f59
17 changed files with 204 additions and 188 deletions

View File

@ -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
}

View File

@ -104,7 +104,7 @@
</div>
<button class="exchange-btn"
:style="{'background': computedExChange?bgcolor:'#D7D7D7','color':computedExChange?ftcolor:'#333'}"
@click="exchangeGoodsFn">立即兑换</button>
@click="exchangeGoodsFn">{{buttonTextFun(goodsDetail.type,'receive')}}</button>
</div>
</div>
<!-- 单条弹出框 -->
@ -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) {

View File

@ -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;

View File

@ -132,7 +132,7 @@
</div>
<button class="exchange-btn"
:style="{'background': computedExChange?bgcolor:'#D7D7D7','color':computedExChange?ftcolor:'#333'}"
@click="exchangeGoodsFn">立即兑换</button>
@click="exchangeGoodsFn">{{buttonTextFun(goodsDetail.type,'receive')}}</button>
</div>
</div>
<!-- 单条弹出框 -->
@ -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) {

View File

@ -11,7 +11,7 @@
<script type="text/javascript" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322">
</script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js?v=1000"></script>
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage2_0.css" />
<link rel="stylesheet" href="../homepage2_0.css" />
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/modelPop.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/libs.js?v=sdfhksdfklwrwer"></script>
<style>
@ -63,8 +63,7 @@
<span>{{goodsInfo.entity.cash_amount_type==='1'?'固额红包':'随机红包'}}</span>
</p>
<p class="bt" @click="receive">
<img src='https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/redPacktes/common_btn_receive.png'
alt='' />
{{buttonTextFun(goodsInfo.type,'receive')}}
</p>
</div>
<div class="instruction-box">
@ -120,7 +119,7 @@
const bm_obj_data = sessionStorage.getItem("bm_auth") ? JSON.parse(sessionStorage.getItem("bm_auth")) : null;
new Vue({
el: "#redPacketsViews",
data() {
data () {
return {
promptShow: false,
popShow: false,
@ -138,13 +137,13 @@
modelPop
},
mounted() {
mounted () {
document.title = localStorage.getItem('title');
},
methods: {
/* 立即领取 */
receive() {
receive () {
if (this.loading) return;
this.loading = true;
let data = {
@ -185,7 +184,7 @@
},
/* 根据环境进行下一步操作 1 支付宝 2 微信 */
judgeEnvironment(order_number, weiXinUrl) {
judgeEnvironment (order_number, weiXinUrl) {
let ua = window.navigator.userAgent.toLowerCase();
/* 判断如果是微信/安卓百度浏览器 则复制链接 */
if (this.goodsInfo.entity.channel === 1) {
@ -208,7 +207,7 @@
},
/* 复制文本 */
copyFn() {
copyFn () {
if (this.popBt === '关闭') {
return this.popShow = false;
}
@ -227,7 +226,7 @@
},
/* 触发提示 */
tip(text, status, bt) {
tip (text, status, bt) {
this.popText = text;
this.popStatus = status; /*1 成功 2提示 3失败 */
this.popBt = bt;
@ -235,7 +234,7 @@
},
/* 返回 */
backGoodsFn() {
backGoodsFn () {
if (this.backAble) {
locationReplace('./homepage.html');
} else {
@ -244,7 +243,7 @@
},
/* 动态font */
fonts() {
fonts () {
const { cash_amount_type, min_denomination, max_denomination } = this.goodsInfo.entity;
const defaultCss = { b: '0.2rem', a: '0.32rem' };
if (cash_amount_type === '2') {

View File

@ -92,7 +92,8 @@
</p>
</div>
</div>
<div class="receiveBtn" @click="receiveFn" :class="goodInfo.available!=1?'readOnly':''">立即领取</div>
<div class="receiveBtn" @click="receiveFn" :class="goodInfo.available!=1?'readOnly':''">
{{buttonTextFun(goodsInfo.type,'receive')}}</div>
<div class="coupon_explain">
<h1>- 兑换说明 -</h1>
<div class="content">
@ -137,7 +138,7 @@
let goodsDetail = null, goodsCount = null;
new Vue({
el: "#reduce",
data() {
data () {
return {
plaflam: 1, //支付宝
promtshow: false,
@ -164,7 +165,7 @@
5、使用立减金的微信支付订单如发生全额退款且立减金仍在有效期内立减金将自动退还给用户如立减金已过期则不退还给用户如发生部分退款用户支付金额将按比例原路退还立减金将不退还给用户<br />`,
};
},
created() {
created () {
document.title = localStorage.getItem('title');
/* 获取立减金信息*/
goodsDetail = JSON.parse(sessionStorage.getItem("goodsInfo"));
@ -200,31 +201,31 @@
}
},
filters: {
cardType(val) {
cardType (val) {
return val.map((item) => {
return item == 1 ? "借记卡" : "信用卡" + " ";
}).join(" ");
},
},
methods: {
globalFormatStatus(type) {
globalFormatStatus (type) {
switch (type) {
case 1:
return "立即兑换"
return "立即兑换";
case 9:
return "已兑换"
return "已兑换";
default:
return "立即兑换"
return "立即兑换";
}
},
backgoodsFn() {
backgoodsFn () {
if (goodsCount > 1) {
locationReplace('./homepage.html');
} else {
history.go(-2);
}
},
receiveFn() {
receiveFn () {
if (this.loading) return;
this.loading = true;
let self = this;
@ -292,7 +293,7 @@
},
/* 公众号领取 */
publicCollection(order_number) {
publicCollection (order_number) {
let params = {
order_number,
channel: 2,
@ -319,7 +320,7 @@
},
toLinkAlipay() {
toLinkAlipay () {
// 领取成功结算 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);
@ -344,18 +345,18 @@
}
},
//错误弹出框关闭
knowFn() {
knowFn () {
this.popboxshow = false;
this.maskshow = false;
},
//错误弹出框
openErrorDialog(tip) {
openErrorDialog (tip) {
this.maskshow = true;
this.tiptext = tip;
this.popboxshow = true;
},
// 单条弹框
openDialog(tip) {
openDialog (tip) {
this.promtshow = true;
this.promttip = tip;
setTimeout(() => {
@ -365,7 +366,7 @@
},
/* 动态font */
fonts() {
fonts () {
const defaultCss = '0.32rem';
const count = String(parseFloat(this.reduceInfo.reduce_amount)).length + 1;
if (count > 4) {
@ -376,7 +377,7 @@
},
//复制文本
copyFn() {
copyFn () {
var textArea = document.createElement("textarea");
textArea.value = this.copyLink;
document.body.appendChild(textArea);

View File

@ -60,7 +60,7 @@
</p>
</div>
<button :class="ysf.available===9?'disable':''" class="form-button"
@click="submit">{{ysf.available===9?'已领取':'立即领取'}}</button>
@click="submit">{{ysf.available===9?buttonTextFun(ysf.type,'received'):buttonTextFun(ysf.type,'receive')}}</button>
</div>
<div class="segmentation">
<i class="left"></i>
@ -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,7 +179,7 @@
methods: {
/* 立即领取 */
submit() {
submit () {
if (phoneReg.test(this.account) && this.confirmAccount) {
if (this.account === this.confirmAccount) {
this.finalSubmit();
@ -193,7 +193,7 @@
},
/* 验证后 最终提交 */
finalSubmit() {
finalSubmit () {
if (this.loading) return;
this.loading = true;
const self = this;
@ -226,7 +226,7 @@
},
/* 核销云闪付立减金 */
verificationYsf({ order_number }) {
verificationYsf ({ order_number }) {
console.log(order_number);
let params = {
order_number: order_number,
@ -248,7 +248,7 @@
},
/* 返回 */
backGoodsFn() {
backGoodsFn () {
/* 判断是否web-view打开 则不返回 */
if (this.isMini) return;
if (this.backAble) {
@ -261,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) {
@ -285,7 +285,7 @@
},
/* 触发提示 */
tips(text) {
tips (text) {
this.cls && clearTimeout(this.cls);
this.prompt_text = text;
this.promptShow = true;
@ -295,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;

View File

@ -56,7 +56,7 @@
<p class="form-note">您可在云闪付的个人信息中查看【云闪付账号】</p>
</div>
<button :class="ysf.available=== 9 ? 'disable':''" class="form-button" :disabled="ysf.available=== 9"
@click="submit">{{ysf.available!==9?'立即领取':'已领取'}}</button>
@click="submit">{{ysf.available!==9?buttonTextFun(ysf.type,'receive'):buttonTextFun(ysf.type,'received')}}</button>
</div>
<div class="segmentation">
<i class="left"></i>
@ -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,7 +141,7 @@
methods: {
/* 立即领取 */
submit() {
submit () {
if (phoneReg.test(this.account) && this.confirmAccount) {
if (this.account === this.confirmAccount) {
this.finalSubmit();
@ -155,7 +155,7 @@
},
/* 验证后 最终提交 */
finalSubmit() {
finalSubmit () {
if (this.loading) return;
this.loading = true;
const self = this;
@ -202,7 +202,7 @@
},
/* 返回 */
backGoodsFn() {
backGoodsFn () {
this.money = 0;
/* 判断是否web-view打开 则不返回 */
if (this.isMini) return;
@ -214,14 +214,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;

View File

@ -52,8 +52,7 @@
<span>{{goodsInfo.entity.cash_amount_type==='1'?'固额红包':'随机红包'}}</span>
</p>
<p class="bt" v-show="goodsInfo.available==9">
<img src='https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/_h-common_btn_receive@2x.png'
alt='' />
{{buttonTextFun(goodInfo.type,'received')}}
</p>
</div>
<div class="form">
@ -62,7 +61,7 @@
maxlength="100">
<input type="text" placeholder="请输入支付宝账号" class="f-input" v-model="form.receive_account">
<p class="f-prompt">您可在支付宝的个人信息中查看【支付宝账号】</p>
<button class="but" @click="receive">立即领取</button>
<button class="but" @click="receive">{{buttonTextFun(goodInfo.type,'receive')}}</button>
</template>
</div>
<div class="instruction-box">
@ -120,7 +119,7 @@
const emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
new Vue({
el: "#redPacketsViews",
data() {
data () {
return {
popShow: false,
popText: '请点击下方[复制]按钮,复制链接到浏览器打开!',
@ -142,7 +141,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);
@ -159,7 +158,7 @@
methods: {
/* 立即领取 */
receive() {
receive () {
let self = this;
const { receive_name, receive_account } = this.form;
if (this.loading) return;
@ -207,7 +206,7 @@
},
judgeEnvironment(order_number) {
judgeEnvironment (order_number) {
req.axiosPost('/alipay/cash/receive/account', { ...this.form, order_number })
.then(({ code, data, message }) => {
if (code == 200) {
@ -237,7 +236,7 @@
},
/* 触发提示 */
tip(text, status, bt) {
tip (text, status, bt) {
this.popText = text;
this.popStatus = status; /*1 成功 2提示 3失败 */
this.popShow = true;
@ -245,7 +244,7 @@
/* 触发提示 */
tips(text) {
tips (text) {
this.cls && clearTimeout(this.cls);
this.prompt_text = text;
this.promptShow = true;
@ -256,7 +255,7 @@
/* 返回 */
backGoodsFn() {
backGoodsFn () {
if (this.backAble) {
locationReplace('./homepage.html');
} else {
@ -265,7 +264,7 @@
},
/* 动态font */
fonts() {
fonts () {
const { cash_amount_type, min_denomination, max_denomination } = this.goodsInfo.entity;
const defaultCss = { b: '0.2rem', a: '0.32rem' };
if (cash_amount_type === '2') {

View File

@ -60,9 +60,10 @@
<p class="form-note">
您可在支付宝的个人信息中查看【支付宝账号】
</p>
<button :class="goods.available===9?'disable':''" class="form-button" @click="submit">立即领取</button>
<button :class="goods.available===9?'disable':''" class="form-button"
@click="submit">{{buttonTextFun(goods.type,'received')}}</button>
</template>
<button v-else class="form-button disable">已领取</button>
<button v-else class="form-button disable">{{buttonTextFun(goods.type,'received')}}</button>
</div>
<div class="segmentation">
<i class="left"></i>
@ -115,7 +116,7 @@
const emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
new Vue({
el: "#app",
data() {
data () {
return {
goods: JSON.parse(sessionStorage.getItem('goodsInfo')),
backAble: (~~sessionStorage.getItem('goodsCount')) > 1,
@ -140,7 +141,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);
@ -171,7 +172,7 @@
},
filters: {
cardType(val) {
cardType (val) {
return val.map((item) => {
return item == 1 ? "借记卡" : "信用卡" + " ";
}).join(" ");
@ -180,7 +181,7 @@
methods: {
/* 立即领取 */
submit() {
submit () {
const { confirm, receive_account } = this.form;
if (this.loading) return;
if (confirm !== receive_account) return this.tips('支付宝账号不一致');
@ -192,7 +193,7 @@
},
/* 验证后 最终提交 */
finalSubmit() {
finalSubmit () {
this.loading = true;
const self = this;
let data = {
@ -221,7 +222,7 @@
},
/* 核销支付宝立减金 */
verificationYsf({ order_number }) {
verificationYsf ({ order_number }) {
let params = {
order_number,
channel: "3", //立减金发放渠道1支付宝2微信 3云闪付
@ -245,7 +246,7 @@
},
/* 返回 */
backGoodsFn() {
backGoodsFn () {
if (this.backAble) {
locationReplace('./homepage.html');
} else {
@ -254,14 +255,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.loading = false;
if (code == 403) {
if (this.backAble) {
@ -278,7 +279,7 @@
},
/* 触发提示 */
tips(text) {
tips (text) {
this.cls && clearTimeout(this.cls);
this.prompt_text = text;
this.promptShow = true;
@ -288,7 +289,7 @@
},
/* 动态font */
fonts() {
fonts () {
const { denomination, reduce_amount } = this.goods.entity;
const defaultCss = { a: '0.34rem' };
const count = String(parseFloat(denomination)).length + String(parseFloat(reduce_amount)).length + 4;

View File

@ -11,7 +11,7 @@
<script type="text/javascript" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322">
</script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js?v=1000"></script>
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage2_0.css" />
<link rel="stylesheet" href="./homepage2_0.css" />
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/modelPop.js"></script>
<style>
* {
@ -61,10 +61,9 @@
<p class='type'>
<span>{{goodsInfo.entity.cash_amount_type==='1'?'固额红包':'随机红包'}}</span>
</p>
<p class="bt" @click="receive">
<img src='https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/redPacktes/common_btn_receive.png'
alt='' />
</p>
<div class="bt" @click="receive">
{{buttonTextFun(goodsInfo.type,'receive')}}
</div>
</div>
<div class="instruction-box">
<div class="instruction-header"></div>
@ -118,7 +117,7 @@
<script>
new Vue({
el: "#redPacketsViews",
data() {
data () {
return {
promptShow: false,
popShow: false,
@ -136,13 +135,13 @@
modelPop
},
mounted() {
mounted () {
document.title = localStorage.getItem('title');
},
methods: {
/* 立即领取 */
receive() {
receive () {
if (this.loading) return;
this.loading = true;
let data = {
@ -176,7 +175,7 @@
},
/* 根据环境进行下一步操作 1 支付宝 2 微信 */
judgeEnvironment(order_number, weiXinUrl) {
judgeEnvironment (order_number, weiXinUrl) {
let ua = window.navigator.userAgent.toLowerCase();
/* 判断如果是微信/安卓百度浏览器 则复制链接 */
if (this.goodsInfo.entity.channel === 1) {
@ -199,7 +198,7 @@
},
/* 复制文本 */
copyFn() {
copyFn () {
if (this.popBt === '关闭') {
return this.popShow = false;
}
@ -218,7 +217,7 @@
},
/* 触发提示 */
tip(text, status, bt) {
tip (text, status, bt) {
this.popText = text;
this.popStatus = status; /*1 成功 2提示 3失败 */
this.popBt = bt;
@ -226,7 +225,7 @@
},
/* 返回 */
backGoodsFn() {
backGoodsFn () {
if (this.backAble) {
window.location.replace('./homepage.html');
} else {
@ -235,7 +234,7 @@
},
/* 动态font */
fonts() {
fonts () {
const { cash_amount_type, min_denomination, max_denomination } = this.goodsInfo.entity;
const defaultCss = { b: '0.2rem', a: '0.32rem' };
if (cash_amount_type === '2') {

View File

@ -98,9 +98,8 @@
</p>
</div>
</div>
<div class="receiveBtn" @click="receiveFn" :class="goodInfo.available!=1?'readOnly':''">立即领取</div>
<div class="receiveBtn" @click="receiveFn" :class="goodInfo.available!=1?'readOnly':''">
{{buttonTextFun(goodInfo.type,'receive')}}</div>
<div class="coupon_explain">
<h1>- 兑换说明 -</h1>
<div class="content">
@ -128,7 +127,7 @@
</div>
<div class="content">
<h3>使用须知</h3>
<p v-html="goodInfo.notice" v-if="goodInfo.notice"></p>
<p v-html="goodInfo.entity.notice" v-if="goodInfo.entity.notice"></p>
<p v-else>
1、在{{reduceInfo.channel==1?'支付宝H5':'微信APP内打开链接'}},点击【一键领取】完成领取{{reduceInfo.channel==1?'支付宝':'微信'}}立减金<br />
2、{{reduceInfo.channel==1?'支付宝':'微信'}}立减金一旦领取不可撤销、不可转让。注意不要将兑换券泄露给他人

View File

@ -62,7 +62,7 @@
</p>
</div>
<button :class="ysf.available===9?'disable':''" class="form-button"
@click="submit">{{ysf.available===9?'已领取':'立即领取'}}</button>
@click="submit">{{ysf.available===9?buttonTextFun(ysf.type,'received'):buttonTextFun(ysf.type,'receive')}}</button>
</div>
<div class="segmentation">
<i class="left"></i>
@ -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,7 +175,7 @@
methods: {
/* 立即领取 */
submit() {
submit () {
if (phoneReg.test(this.account) && this.confirmAccount) {
if (this.account === this.confirmAccount) {
this.finalSubmit();
@ -189,7 +189,7 @@
},
/* 验证后 最终提交 */
finalSubmit() {
finalSubmit () {
if (this.loading) return;
this.loading = true;
const self = this;
@ -214,7 +214,7 @@
},
/* 核销云闪付立减金 */
verificationYsf({ order_number }) {
verificationYsf ({ order_number }) {
console.log(order_number);
let params = {
order_number: order_number,
@ -236,7 +236,7 @@
},
/* 返回 */
backGoodsFn() {
backGoodsFn () {
/* 判断是否web-view打开 则不返回 */
if (this.isMini) return;
if (this.backAble) {
@ -249,14 +249,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) {
@ -273,7 +273,7 @@
},
/* 触发提示 */
tips(text) {
tips (text) {
this.cls && clearTimeout(this.cls);
this.prompt_text = text;
this.promptShow = true;
@ -283,7 +283,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;

View File

@ -55,7 +55,7 @@
<p class="form-note">您可在云闪付的个人信息中查看【云闪付账号】</p>
</div>
<button :class="ysf.available===9?'disable':''" class="form-button"
@click="submit">{{ysf.available!==9?'立即领取':'已领取'}}</button>
@click="submit">{{ysf.available!==9?buttonTextFun(ysf.type,'receive'):buttonTextFun(ysf.type,'received')}}</button>
</div>
<div class="segmentation">
<i class="left"></i>
@ -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,7 +134,7 @@
methods: {
/* 立即领取 */
submit() {
submit () {
if (phoneReg.test(this.account) && this.confirmAccount) {
if (this.account === this.confirmAccount) {
this.finalSubmit();
@ -148,7 +148,7 @@
},
/* 验证后 最终提交 */
finalSubmit() {
finalSubmit () {
if (this.loading) return;
this.loading = true;
const self = this;
@ -188,7 +188,7 @@
},
/* 返回 */
backGoodsFn() {
backGoodsFn () {
this.money = 0;
/* 判断是否web-view打开 则不返回 */
if (this.isMini) return;
@ -200,14 +200,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;

View File

@ -99,10 +99,19 @@ body {
}
#redPacketsViews .bt {
height: 1.8rem;
line-height: 2.6rem;
width: 2rem;
height: 0.46rem;
background: url("https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/but_back_img.png");
background-size: 100% 100%;
text-align: center;
line-height: 0.42rem;
color: #df1104;
font-size: 0.16rem;
font-weight: bold;
margin: 0 auto;
margin-top: 1rem;
}
#redPacketsViews .title {
margin-top: 0.3rem;
font-size: 0.25rem;
@ -111,10 +120,6 @@ body {
text-align: center;
}
#redPacketsViews .bt img {
width: 2rem;
}
#redPacketsViews .type {
color: #fd3b2d;
font-size: 0.1rem;

View File

@ -51,8 +51,7 @@
<span>{{goodsInfo.entity.cash_amount_type==='1'?'固额红包':'随机红包'}}</span>
</p>
<p class="bt" v-show="goodsInfo.available==9">
<img src='https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/_h-common_btn_receive@2x.png'
alt='' />
{{buttonTextFun(goodsInfo.type,'received')}}
</p>
</div>
<div class="form">
@ -61,7 +60,7 @@
maxlength="100">
<input type="text" placeholder="请输入支付宝账号" class="f-input" v-model="form.receive_account">
<p class="f-prompt">您可在支付宝的个人信息中查看【支付宝账号】</p>
<button class="but" @click="receive">立即领取</button>
<button class="but" @click="receive">{{buttonTextFun(goodsInfo.type,'receive')}}</button>
</template>
</div>
<div class="instruction-box">
@ -118,7 +117,7 @@
const emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
new Vue({
el: "#redPacketsViews",
data() {
data () {
return {
popShow: false,
popText: '请点击下方[复制]按钮,复制链接到浏览器打开!',
@ -140,7 +139,7 @@
modelPop
},
mounted() {
mounted () {
document.title = localStorage.getItem('title');
// /* 初始弹窗 */
@ -152,7 +151,7 @@
methods: {
/* 立即领取 */
receive() {
receive () {
const { receive_name, receive_account } = this.form;
if (this.loading) return;
if (!receive_name) return this.tips('请输入真实姓名');
@ -191,7 +190,7 @@
},
judgeEnvironment(order_number) {
judgeEnvironment (order_number) {
req.axiosPost('/alipay/cash/receive/account', { ...this.form, order_number })
.then(({ code, data, message }) => {
if (code == 200) {
@ -221,7 +220,7 @@
},
/* 触发提示 */
tip(text, status, bt) {
tip (text, status, bt) {
this.popText = text;
this.popStatus = status; /*1 成功 2提示 3失败 */
this.popShow = true;
@ -229,7 +228,7 @@
/* 触发提示 */
tips(text) {
tips (text) {
this.cls && clearTimeout(this.cls);
this.prompt_text = text;
this.promptShow = true;
@ -240,7 +239,7 @@
/* 返回 */
backGoodsFn() {
backGoodsFn () {
if (this.backAble) {
window.location.replace('./homepage.html');
} else {
@ -249,7 +248,7 @@
},
/* 动态font */
fonts() {
fonts () {
const { cash_amount_type, min_denomination, max_denomination } = this.goodsInfo.entity;
const defaultCss = { b: '0.2rem', a: '0.32rem' };
if (cash_amount_type === '2') {

View File

@ -60,9 +60,10 @@
<p class="form-note">
您可在支付宝的个人信息中查看【支付宝账号】
</p>
<button :class="goods.available===9?'disable':''" class="form-button" @click="submit">立即领取</button>
<button :class="goods.available===9?'disable':''" class="form-button"
@click="submit">{{buttonTextFun(goods.type,'receive')}}</button>
</template>
<button v-else class="form-button disable">已领取</button>
<button v-else class="form-button disable">{{buttonTextFun(goods.type,'received')}}</button>
</div>
<div class="segmentation">
<i class="left"></i>
@ -114,7 +115,7 @@
const emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
new Vue({
el: "#app",
data() {
data () {
return {
goods: JSON.parse(sessionStorage.getItem('goodsInfo')),
backAble: (~~sessionStorage.getItem('goodsCount')) > 1,
@ -139,7 +140,7 @@
modelPop
},
mounted() {
mounted () {
document.title = localStorage.getItem('title');
/* 初始弹窗 */
@ -166,7 +167,7 @@
},
filters: {
cardType(val) {
cardType (val) {
return val.map((item) => {
return item == 1 ? "借记卡" : "信用卡" + " ";
}).join(" ");
@ -175,7 +176,7 @@
methods: {
/* 立即领取 */
submit() {
submit () {
const { confirm, receive_account } = this.form;
if (this.loading) return;
if (confirm !== receive_account) return this.tips('支付宝账号不一致');
@ -187,7 +188,7 @@
},
/* 验证后 最终提交 */
finalSubmit() {
finalSubmit () {
this.loading = true;
const self = this;
let data = {
@ -210,7 +211,7 @@
},
/* 核销支付宝立减金 */
verificationYsf({ order_number }) {
verificationYsf ({ order_number }) {
let params = {
order_number,
channel: "3", //立减金发放渠道1支付宝2微信 3云闪付
@ -234,7 +235,7 @@
},
/* 返回 */
backGoodsFn() {
backGoodsFn () {
if (this.backAble) {
window.location.replace('./homepage.html');
} else {
@ -243,14 +244,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.loading = false;
if (code == 403) {
if (this.backAble) {
@ -267,7 +268,7 @@
},
/* 触发提示 */
tips(text) {
tips (text) {
this.cls && clearTimeout(this.cls);
this.prompt_text = text;
this.promptShow = true;
@ -277,7 +278,7 @@
},
/* 动态font */
fonts() {
fonts () {
const { denomination, reduce_amount } = this.goods.entity;
const defaultCss = { a: '0.34rem' };
const count = String(parseFloat(denomination)).length + String(parseFloat(reduce_amount)).length + 4;