2021-12-29 11:51:28 +08:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
2022-10-17 11:23:00 +08:00
|
|
|
|
|
2021-12-29 11:51:28 +08:00
|
|
|
|
<head>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<meta name="viewport"
|
|
|
|
|
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover">
|
|
|
|
|
<title>权益兑换页</title>
|
2022-04-18 15:01:12 +08:00
|
|
|
|
<style>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
* {
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
padding: 0;
|
|
|
|
|
font-family: HYQiHei;
|
|
|
|
|
}
|
2021-12-29 11:51:28 +08:00
|
|
|
|
|
2022-01-20 14:45:21 +08:00
|
|
|
|
html {
|
|
|
|
|
font-size: 26.66666667vw;
|
|
|
|
|
}
|
2021-12-29 11:51:28 +08:00
|
|
|
|
|
2022-01-20 14:45:21 +08:00
|
|
|
|
body {
|
|
|
|
|
-webkit-text-size-adjust: 100%;
|
|
|
|
|
-ms-text-size-adjust: 100%;
|
|
|
|
|
}
|
2021-12-29 11:51:28 +08:00
|
|
|
|
</style>
|
2023-03-09 14:19:30 +08:00
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript"
|
|
|
|
|
charset="utf-8"></script>
|
|
|
|
|
<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/siteqiexchange/js/swiper.min.js"></script>
|
|
|
|
|
<link href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/siteqiexchange/css/swiper.min.css" rel="stylesheet">
|
2023-08-14 15:52:59 +08:00
|
|
|
|
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage2_0.css?v=2">
|
2023-03-09 14:19:30 +08:00
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script>
|
2021-12-29 11:51:28 +08:00
|
|
|
|
</head>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
|
2021-12-29 11:51:28 +08:00
|
|
|
|
<body>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
<div id="exchangePage">
|
2022-06-16 18:07:46 +08:00
|
|
|
|
<div v-if="!suspension">
|
2022-01-20 14:45:21 +08:00
|
|
|
|
<div class="about-good">
|
|
|
|
|
<span>
|
2022-01-24 14:17:24 +08:00
|
|
|
|
<img @click="backgoodsFn" v-if="backAble"
|
2022-01-20 14:45:21 +08:00
|
|
|
|
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" alt="">
|
|
|
|
|
</span>
|
|
|
|
|
<img :src="goodsShow[0]" alt="" v-if="goodsShow.length<=1">
|
|
|
|
|
<div class="swiper-container" v-else>
|
2022-01-22 14:41:08 +08:00
|
|
|
|
<div class="swiper-wrapper">
|
|
|
|
|
<div class="swiper-slide" v-for="(item,i) in goodsShow" :key="i">
|
|
|
|
|
<img :src="item" alt="">
|
2022-01-20 14:45:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-01-22 14:41:08 +08:00
|
|
|
|
<div class="swiper-pagination"></div>
|
|
|
|
|
</div>
|
2022-01-14 13:48:14 +08:00
|
|
|
|
</div>
|
2022-10-11 09:43:31 +08:00
|
|
|
|
<div class="ipt-acc" style="position: relative;z-index: 99;" @click="bindAvailable">
|
2023-08-18 09:08:13 +08:00
|
|
|
|
<h4 class="title" v-if="goodInfo.product_type===2&&goodInfo.card_show==2">{{goodInfo.product_name}}</h4>
|
|
|
|
|
<template v-if="goodInfo.product_type===1||goodInfo.product_type===2&&goodInfo.card_show==1">
|
2023-08-11 10:41:14 +08:00
|
|
|
|
<p v-if="acctype=='tel'"><span>账号:</span><input :type="acctype"
|
|
|
|
|
onkeyup="this.value=this.value.replace(/\D/g,'')" :disabled="goodsDetail.available!=1"
|
|
|
|
|
onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" :maxlength="maxlen" v-model="account"
|
|
|
|
|
:placeholder="placeholder" @focus="(e)=>focusFn(e)"></p>
|
|
|
|
|
<p v-if="acctype=='tel'"><span>再次输入:</span> <input :type="acctype"
|
|
|
|
|
onkeyup="this.value=this.value.replace(/\D/g,'')" :disabled="goodsDetail.available!=1"
|
|
|
|
|
onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" :maxlength="maxlen"
|
|
|
|
|
v-model="reaccount" placeholder="请再次输入" @focus="(e)=>focusFn(e)"></p>
|
|
|
|
|
<p v-if="acctype!='tel'"><span>账号:</span> <input :type="acctype" :maxlength="maxlen" v-model="account"
|
|
|
|
|
:disabled="goodsDetail.available!=1" :placeholder="placeholder" @focus="(e)=>focusFn(e)"></p>
|
|
|
|
|
<p v-if="acctype!='tel'"><span>再次输入:</span><input :type="acctype" :maxlength="maxlen" v-model="reaccount"
|
|
|
|
|
:disabled="goodsDetail.available!=1" placeholder="请再次输入" @focus="(e)=>focusFn(e)"></p>
|
|
|
|
|
</template>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
</div>
|
2022-01-24 19:03:08 +08:00
|
|
|
|
<div class="bottom" id="bottom" v-show="describe.type||detailUrl">
|
2022-04-18 15:01:12 +08:00
|
|
|
|
<img :src="detailUrl" v-show="detailUrl">
|
2022-01-20 14:45:21 +08:00
|
|
|
|
<img :src="describe.bg_image" v-show="describe.type==1&&describe.bg_image">
|
|
|
|
|
<div v-html="describe.content" class="goodsTip" v-show="describe.type==3&&describe.content"></div>
|
2021-12-29 11:51:28 +08:00
|
|
|
|
</div>
|
2023-08-09 18:01:04 +08:00
|
|
|
|
<div class="e-btn-box">
|
2023-08-18 09:08:13 +08:00
|
|
|
|
<div class="order-box" v-if="!backAble&&goodInfo.product_type===2&&goodInfo.card_show==2">
|
2023-08-09 18:01:04 +08:00
|
|
|
|
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/toOrder.png" alt=""
|
|
|
|
|
@click="()=>{location.href='./order.html'}">
|
|
|
|
|
<p>订单</p>
|
|
|
|
|
</div>
|
|
|
|
|
<button class="exchange-btn"
|
2023-08-18 09:08:13 +08:00
|
|
|
|
:style="{'background': (exchangeOpen||(goodInfo.product_type===2&&goodInfo.card_show==2))?bgcolor:'#D7D7D7','color':(exchangeOpen||(goodInfo.product_type===2&&goodInfo.card_show==2))?ftcolor:'#333'}"
|
2023-08-09 18:01:04 +08:00
|
|
|
|
@click="exchangeGoodsFn">立即兑换</button>
|
|
|
|
|
</div>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 单条弹出框 -->
|
|
|
|
|
<div class="prompt" :class="promtshow?'proactive':''">
|
|
|
|
|
{{this.promttip}}
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 弹出框 -->
|
2022-06-16 18:07:46 +08:00
|
|
|
|
<div class="mask" v-if="maskshow">
|
2022-01-20 14:45:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 悬浮提示 -->
|
|
|
|
|
<div v-if="suspension" class="suspensionDom">
|
|
|
|
|
<img @click="closeTip" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png"
|
|
|
|
|
alt="">
|
|
|
|
|
<h4>活动规则</h4>
|
|
|
|
|
<div v-html="describe.content">
|
|
|
|
|
</div>
|
2022-01-14 13:48:14 +08:00
|
|
|
|
</div>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
<img class="susTip" @click="susTipFn" v-if="describe.type==2&&describe.content&&!suspension"
|
|
|
|
|
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/acticeTextTip.png" alt="">
|
|
|
|
|
<!-- 弹出框 -->
|
2021-12-29 11:51:28 +08:00
|
|
|
|
<!-- 询问 -->
|
|
|
|
|
<div class="popboxshow" v-if="popboxshow&&popboxtype=='兑换'" :class="popboxshow?'active':''">
|
2022-01-20 14:45:21 +08:00
|
|
|
|
<div>
|
2023-08-11 10:41:14 +08:00
|
|
|
|
<p v-if="acctype=='tel'">{{goodInfo.product_type===1?`是否为账号${this.account}兑换${this.proname}会员?`:'是否确认兑换?'}}</p>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
<p v-if="acctype=='text'">是否兑换{{this.proname}}会员?</p>
|
|
|
|
|
<span @click="surexchangeBtn">确认兑换</span>
|
2021-12-29 11:51:28 +08:00
|
|
|
|
</div>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 弹出提示 -->
|
|
|
|
|
<div class="popboxshow" v-if="popboxshow&&popboxtype=='提示'" :class="popboxshow?'active':''">
|
|
|
|
|
<div class="tip">
|
|
|
|
|
<p>{{tiptext}}</p>
|
|
|
|
|
<span @click="successchangeBtn">知道了</span>
|
2021-12-29 11:51:28 +08:00
|
|
|
|
</div>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 成功 -->
|
|
|
|
|
<div class="popboxshow successbox" v-if="popboxshow&&popboxtype=='成功'" :class="popboxshow?'active':''">
|
|
|
|
|
<div>
|
2023-08-18 15:38:43 +08:00
|
|
|
|
<p :style="{fontSize:goodInfo.card_show===2?'0.13rem':''}">{{this.successTip}}</p>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
<span @click="successchangeBtnFn">我知道啦</span>
|
2021-12-29 11:51:28 +08:00
|
|
|
|
</div>
|
2022-01-20 14:45:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
<img v-if="popboxshow&&popboxtype!='成功'" class="closed"
|
2023-06-16 09:30:39 +08:00
|
|
|
|
src="https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/cardpwd/img/commimgs/close.png" alt=""
|
2022-01-20 14:45:21 +08:00
|
|
|
|
@click="closeBtn()">
|
2021-12-29 11:51:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
<script>
|
2022-10-17 11:23:00 +08:00
|
|
|
|
let goodsCount = null, goodsDetail = null;
|
2021-12-29 11:51:28 +08:00
|
|
|
|
new Vue({
|
2022-01-20 14:45:21 +08:00
|
|
|
|
el: '#exchangePage',
|
2023-06-16 09:30:39 +08:00
|
|
|
|
data () {
|
2022-01-20 14:45:21 +08:00
|
|
|
|
return {
|
|
|
|
|
account: '',
|
|
|
|
|
reaccount: '',
|
|
|
|
|
maxlen: 11,
|
|
|
|
|
acctype: 'tel',
|
|
|
|
|
promttip: '',
|
|
|
|
|
promtshow: false,
|
|
|
|
|
productType: 0,
|
|
|
|
|
proname: '',
|
|
|
|
|
placeholder: '',
|
|
|
|
|
maskshow: false,
|
|
|
|
|
popboxshow: false,
|
|
|
|
|
exchangeOpen: false,
|
|
|
|
|
suspension: false,
|
|
|
|
|
popboxtype: '',
|
|
|
|
|
describe: {},
|
2022-04-18 15:01:12 +08:00
|
|
|
|
detailUrl: '',
|
2022-01-20 14:45:21 +08:00
|
|
|
|
successTip: '',
|
|
|
|
|
goodInfo: '',
|
|
|
|
|
bgcolor: '',
|
|
|
|
|
ftcolor: '',
|
2022-10-17 11:23:00 +08:00
|
|
|
|
goodsDetail: {},//商品详情
|
2022-04-18 15:01:12 +08:00
|
|
|
|
backAble: true,
|
2022-10-17 11:23:00 +08:00
|
|
|
|
bindClick: false,//控制遮罩显示
|
2022-01-22 14:41:08 +08:00
|
|
|
|
goodsShow: [
|
|
|
|
|
'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220120/9bedd7af6a8a570be8f2858564f9ec6d.png'
|
|
|
|
|
]
|
2023-03-01 15:04:19 +08:00
|
|
|
|
};
|
2021-12-29 11:51:28 +08:00
|
|
|
|
},
|
2023-06-16 09:30:39 +08:00
|
|
|
|
created () {
|
2022-10-11 09:43:31 +08:00
|
|
|
|
document.title = localStorage.getItem('title');
|
|
|
|
|
let detailsConfig = JSON.parse(localStorage.getItem('product_detail'));
|
2022-06-15 14:41:42 +08:00
|
|
|
|
goodsCount = sessionStorage.getItem('goodsCount');
|
2022-06-13 16:49:06 +08:00
|
|
|
|
this.backAble = goodsCount > 1;//多个商品才有返回
|
2022-01-21 19:17:24 +08:00
|
|
|
|
this.bgcolor = detailsConfig.button_color;
|
|
|
|
|
this.ftcolor = detailsConfig.font_color;
|
|
|
|
|
this.describe = detailsConfig.describe;
|
2022-10-17 11:23:00 +08:00
|
|
|
|
goodsDetail = JSON.parse(sessionStorage.getItem('goodsInfo'));//商品详情
|
|
|
|
|
this.goodsDetail = goodsDetail;//商品详情
|
|
|
|
|
let goodsInform = goodsDetail.entity; //商品信息
|
2022-01-24 17:04:25 +08:00
|
|
|
|
this.goodInfo = goodsInform;
|
2022-04-18 15:01:12 +08:00
|
|
|
|
let goods_desc = goodsInform.describe_url;
|
2022-11-25 13:44:36 +08:00
|
|
|
|
this.goodsShow = goods_desc.length > 0 ? goods_desc : [goodsInform.show_url];
|
2022-04-18 15:01:12 +08:00
|
|
|
|
this.detailUrl = goodsInform.detail_url ? goodsInform.detail_url : '';
|
2022-07-14 16:27:23 +08:00
|
|
|
|
this.productType = goodsDetail.entity.account_type;
|
2023-08-18 09:08:13 +08:00
|
|
|
|
/* 区分卡密短信 */
|
|
|
|
|
if (goodsInform.product_type === 2 && goodsInform.card_show == 1) {
|
|
|
|
|
this.productType = 1;
|
|
|
|
|
} else {
|
|
|
|
|
this.productType = goodsInform.account_type;
|
|
|
|
|
}
|
2022-06-13 16:49:06 +08:00
|
|
|
|
this.$nextTick(function () {
|
2022-01-20 14:45:21 +08:00
|
|
|
|
var swiper = new Swiper('.swiper-container', {
|
|
|
|
|
loop: true, // 循环模式选项
|
2022-01-22 14:41:08 +08:00
|
|
|
|
autoplay: 3000, //可选选项,自动滑动
|
|
|
|
|
pagination: '.swiper-pagination',
|
2023-03-01 15:04:19 +08:00
|
|
|
|
});
|
|
|
|
|
});
|
2021-12-29 11:51:28 +08:00
|
|
|
|
},
|
2022-01-20 14:45:21 +08:00
|
|
|
|
methods: {
|
2023-06-16 09:30:39 +08:00
|
|
|
|
bindAvailable () {
|
2022-10-17 11:23:00 +08:00
|
|
|
|
if (goodsDetail.available != 1) {
|
|
|
|
|
this.openErrorDialog(product_status(goodsDetail.available, goodsDetail));
|
2023-03-01 15:04:19 +08:00
|
|
|
|
return;
|
2022-06-17 09:58:28 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2023-06-16 09:30:39 +08:00
|
|
|
|
openErrorDialog (tip) {
|
2022-06-16 18:07:46 +08:00
|
|
|
|
this.maskshow = true;
|
|
|
|
|
this.popboxtype = '提示';
|
|
|
|
|
this.tiptext = tip;
|
|
|
|
|
this.popboxshow = true;
|
2022-06-16 11:16:54 +08:00
|
|
|
|
},
|
2023-06-16 09:30:39 +08:00
|
|
|
|
backgoodsFn () {
|
2022-04-18 15:01:12 +08:00
|
|
|
|
if (goodsCount > 1) {
|
2022-01-24 15:25:19 +08:00
|
|
|
|
window.location.replace('./homepage.html');
|
2022-04-18 15:01:12 +08:00
|
|
|
|
} else {
|
2022-01-24 11:55:00 +08:00
|
|
|
|
history.go(-2);
|
2022-01-22 15:50:40 +08:00
|
|
|
|
}
|
2022-01-14 13:48:14 +08:00
|
|
|
|
},
|
2023-06-16 09:30:39 +08:00
|
|
|
|
closeTip () {
|
2022-01-20 14:45:21 +08:00
|
|
|
|
this.suspension = false;
|
2022-01-14 13:48:14 +08:00
|
|
|
|
},
|
2023-06-16 09:30:39 +08:00
|
|
|
|
susTipFn () {
|
2022-01-20 14:45:21 +08:00
|
|
|
|
this.suspension = true;
|
2021-12-29 11:51:28 +08:00
|
|
|
|
},
|
2022-01-20 14:45:21 +08:00
|
|
|
|
// 单条弹框
|
2023-06-16 09:30:39 +08:00
|
|
|
|
openDialog (tip) {
|
2022-10-17 11:23:00 +08:00
|
|
|
|
this.promtshow = true;
|
2023-03-01 15:04:19 +08:00
|
|
|
|
this.promttip = tip;
|
2022-10-17 11:23:00 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.promtshow = false;
|
|
|
|
|
this.promttip = '';
|
2023-03-01 15:04:19 +08:00
|
|
|
|
}, 3000);
|
2022-10-17 11:23:00 +08:00
|
|
|
|
},
|
2021-12-30 17:11:17 +08:00
|
|
|
|
//刷新页面
|
2023-06-16 09:30:39 +08:00
|
|
|
|
successchangeBtnFn () {
|
2022-01-22 15:20:34 +08:00
|
|
|
|
window.location.replace(document.referrer);
|
2021-12-30 17:11:17 +08:00
|
|
|
|
},
|
2023-08-11 10:41:14 +08:00
|
|
|
|
|
2021-12-29 11:51:28 +08:00
|
|
|
|
//兑换商品
|
2023-06-16 09:30:39 +08:00
|
|
|
|
exchangeGoodsFn () {
|
2022-10-17 11:23:00 +08:00
|
|
|
|
if (goodsDetail.available != 1) {
|
2023-08-11 10:41:14 +08:00
|
|
|
|
return this.openErrorDialog(product_status(goodsDetail.available, goodsDetail));
|
2022-06-16 18:07:46 +08:00
|
|
|
|
}
|
2023-08-11 10:41:14 +08:00
|
|
|
|
/* 卡密商品直接兑换 */
|
2023-08-18 09:08:13 +08:00
|
|
|
|
if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) {
|
2023-08-11 10:41:14 +08:00
|
|
|
|
this.maskshow = true;
|
|
|
|
|
this.popboxshow = true;
|
|
|
|
|
this.popboxtype = '兑换';
|
|
|
|
|
return;
|
|
|
|
|
};
|
|
|
|
|
|
2022-01-20 14:45:21 +08:00
|
|
|
|
if (!this.account) {
|
2022-06-13 16:49:06 +08:00
|
|
|
|
this.openDialog('请输入兑换账号!');
|
2021-12-29 11:51:28 +08:00
|
|
|
|
return false;
|
2022-01-20 14:45:21 +08:00
|
|
|
|
} else {
|
|
|
|
|
let namereg = /\w{4}/.test(this.account);
|
|
|
|
|
let phonereg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.account);
|
|
|
|
|
let qqreg = /^[1-9][0-9]{4,9}$/.test(this.account);
|
|
|
|
|
let emailsreg = /^[A-Za-z0-9\u4e00-\u9fa5\.]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(this.account);
|
|
|
|
|
let weixinreg = /^[a-zA-Z][a-zA-Z\d_-]{5,19}$/.test(this.account);
|
2021-12-29 11:51:28 +08:00
|
|
|
|
let regflag = true;
|
|
|
|
|
if (this.productType == 0) {
|
2022-01-20 14:45:21 +08:00
|
|
|
|
this.placeholder = "请输入昵称";
|
|
|
|
|
} else if (this.productType == 1) {
|
|
|
|
|
regflag = phonereg;
|
|
|
|
|
} else if (this.productType == 2) {
|
|
|
|
|
regflag = emailsreg;
|
|
|
|
|
} else if (this.productType == 3) {
|
|
|
|
|
regflag = phonereg || emailsreg;
|
|
|
|
|
} else if (this.productType == 4) {
|
|
|
|
|
regflag = qqreg;
|
|
|
|
|
} else if (this.productType == 5) {
|
|
|
|
|
regflag = phonereg || qqreg;
|
|
|
|
|
} else if (this.productType == 6) {
|
|
|
|
|
regflag = emailsreg || qqreg;
|
|
|
|
|
} else if (this.productType == 7) {
|
|
|
|
|
regflag = phonereg || emailsreg || qqreg;
|
|
|
|
|
} else if (this.productType == 8) {
|
|
|
|
|
regflag = weixinreg;
|
|
|
|
|
} else if (this.productType == 9) {
|
|
|
|
|
regflag = phonereg || weixinreg;
|
|
|
|
|
} else if (this.productType == 10) {
|
|
|
|
|
regflag = emailsreg || weixinreg;
|
|
|
|
|
} else if (this.productType == 11) {
|
|
|
|
|
regflag = phonereg || emailsreg || weixinreg;
|
|
|
|
|
} else if (this.productType == 12) {
|
|
|
|
|
regflag = qqreg || weixinreg;;
|
|
|
|
|
} else if (this.productType == 13) {
|
|
|
|
|
regflag = phonereg || qqreg || weixinreg;
|
|
|
|
|
} else if (this.productType == 14) {
|
|
|
|
|
regflag = emailsreg || qqreg || weixinreg;
|
|
|
|
|
} else {
|
|
|
|
|
regflag = phonereg || emailsreg || qqreg || weixinreg;
|
|
|
|
|
}
|
2021-12-29 11:51:28 +08:00
|
|
|
|
if (!regflag) {
|
2022-06-13 16:49:06 +08:00
|
|
|
|
this.openDialog("充值账号格式不正确!");
|
2021-12-29 11:51:28 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.reaccount == "") {
|
2022-06-13 16:49:06 +08:00
|
|
|
|
this.openDialog("请再次输入账号!");
|
2021-12-29 11:51:28 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (this.account != this.reaccount) {
|
2023-03-01 15:04:19 +08:00
|
|
|
|
this.reaccount == "";
|
2022-06-13 16:49:06 +08:00
|
|
|
|
this.openDialog("两次输入的账号必须一致!");
|
2021-12-29 11:51:28 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
this.maskshow = true;
|
|
|
|
|
this.popboxshow = true;
|
|
|
|
|
this.popboxtype = '兑换';
|
|
|
|
|
},
|
2022-01-20 14:45:21 +08:00
|
|
|
|
//确定兑换
|
2023-06-16 09:30:39 +08:00
|
|
|
|
surexchangeBtn () {
|
2021-12-29 11:51:28 +08:00
|
|
|
|
let self = this;
|
|
|
|
|
let data = {
|
2022-10-11 09:43:31 +08:00
|
|
|
|
"key": localStorage.getItem('key'),
|
2022-06-15 20:28:39 +08:00
|
|
|
|
"goods_id": this.goodInfo.goods_id,
|
2021-12-29 11:51:28 +08:00
|
|
|
|
"account": this.account,
|
2021-12-30 17:11:17 +08:00
|
|
|
|
"code_batch_id": this.goodInfo.code_batch_id,
|
2022-10-11 09:43:31 +08:00
|
|
|
|
"token": localStorage.getItem('token')
|
2023-03-01 15:04:19 +08:00
|
|
|
|
};
|
2022-12-02 15:07:03 +08:00
|
|
|
|
self.popboxshow = false;
|
2022-06-13 16:49:06 +08:00
|
|
|
|
req.axiosPost('/key/usage', data).then(res => {
|
2021-12-29 11:51:28 +08:00
|
|
|
|
if (res.code == 200) {
|
2022-07-08 17:33:56 +08:00
|
|
|
|
sessionStorage.setItem('lastid', self.goodInfo.product_id);
|
2021-12-29 11:51:28 +08:00
|
|
|
|
// 查询订单接口
|
2023-08-09 11:14:37 +08:00
|
|
|
|
if (this.goodInfo.product_type === 2) {
|
2023-08-18 09:08:13 +08:00
|
|
|
|
if (this.goodInfo.card_show == 2) {
|
2023-08-18 15:38:43 +08:00
|
|
|
|
this.successTip = '兑换成功,请到页面左下角"订单"(订单列表处)查看卡密信息!';
|
2023-08-18 09:08:13 +08:00
|
|
|
|
} else {
|
|
|
|
|
this.successTip = '兑换成功,请到注意查收手机短信!';
|
|
|
|
|
}
|
2023-08-09 11:14:37 +08:00
|
|
|
|
} else {
|
|
|
|
|
this.successTip = '兑换成功,到账信息请关注官方APP!';
|
|
|
|
|
}
|
2021-12-29 11:51:28 +08:00
|
|
|
|
this.popboxtype = '成功';
|
|
|
|
|
this.popboxshow = true;
|
2023-08-09 11:14:37 +08:00
|
|
|
|
|
2021-12-29 11:51:28 +08:00
|
|
|
|
} else {
|
2022-06-16 18:07:46 +08:00
|
|
|
|
this.openErrorDialog(res.message);
|
2022-10-17 11:23:00 +08:00
|
|
|
|
if (res.code == 403) {
|
2022-04-18 15:01:12 +08:00
|
|
|
|
if (goodsCount > 1) {
|
2021-12-29 11:51:28 +08:00
|
|
|
|
setTimeout(() => {
|
2022-01-24 15:25:19 +08:00
|
|
|
|
window.location.replace('./homepage.html');
|
2021-12-29 11:51:28 +08:00
|
|
|
|
}, 3000);
|
2022-04-18 15:01:12 +08:00
|
|
|
|
} else {
|
2022-06-16 09:47:37 +08:00
|
|
|
|
/*跳转起始页面*/
|
2022-10-27 17:04:22 +08:00
|
|
|
|
let entryLink = localStorage.getItem('entryLink');
|
2022-06-21 15:04:03 +08:00
|
|
|
|
setTimeout(() => {
|
2022-10-17 11:23:00 +08:00
|
|
|
|
window.location.replace(entryLink);
|
2022-06-21 15:04:03 +08:00
|
|
|
|
}, 3000);
|
2022-10-17 11:23:00 +08:00
|
|
|
|
|
2021-12-29 11:51:28 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//关闭弹出框,仅关闭弹框
|
2023-06-16 09:30:39 +08:00
|
|
|
|
successchangeBtn () {
|
2021-12-29 11:51:28 +08:00
|
|
|
|
this.maskshow = false;
|
|
|
|
|
this.popboxshow = false;
|
|
|
|
|
this.account = "";
|
|
|
|
|
this.reaccount = "";
|
2022-01-14 13:48:14 +08:00
|
|
|
|
},
|
2023-06-16 09:30:39 +08:00
|
|
|
|
focusFn (a) {
|
2022-01-22 11:57:25 +08:00
|
|
|
|
let ele = document.querySelector('.ipt-acc');
|
2022-01-14 13:48:14 +08:00
|
|
|
|
setTimeout(function () {
|
|
|
|
|
ele.scrollIntoView(false);
|
2022-01-24 20:20:27 +08:00
|
|
|
|
document.body.scrollTop = ele.scrollHeight;
|
|
|
|
|
document.documentElement.scrollTop = ele.scrollHeight;
|
2022-01-14 13:48:14 +08:00
|
|
|
|
}, 400);
|
2021-12-29 11:51:28 +08:00
|
|
|
|
},
|
2022-01-20 14:45:21 +08:00
|
|
|
|
//关闭,关闭弹框
|
2023-06-16 09:30:39 +08:00
|
|
|
|
closeBtn () {
|
2021-12-29 11:51:28 +08:00
|
|
|
|
this.popboxshow = false;
|
|
|
|
|
this.maskshow = false;
|
|
|
|
|
this.account = "";
|
2022-01-20 14:45:21 +08:00
|
|
|
|
this.reaccount = "";
|
2021-12-29 11:51:28 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
2023-06-16 09:30:39 +08:00
|
|
|
|
account () {
|
2023-08-18 09:08:13 +08:00
|
|
|
|
if ((this.account == this.reaccount) && this.account) {
|
2022-01-20 14:45:21 +08:00
|
|
|
|
this.exchangeOpen = true;
|
2023-08-18 09:08:13 +08:00
|
|
|
|
} else {
|
|
|
|
|
this.exchangeOpen = false;
|
2021-12-29 11:51:28 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2023-06-16 09:30:39 +08:00
|
|
|
|
reaccount () {
|
2023-08-18 09:08:13 +08:00
|
|
|
|
if ((this.account == this.reaccount) && this.account) {
|
2022-01-20 14:45:21 +08:00
|
|
|
|
this.exchangeOpen = true;
|
2023-08-18 09:08:13 +08:00
|
|
|
|
} else {
|
|
|
|
|
this.exchangeOpen = false;
|
2021-12-29 11:51:28 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2022-01-20 14:45:21 +08:00
|
|
|
|
productType: {
|
2021-12-29 11:51:28 +08:00
|
|
|
|
immediate: true,
|
2023-06-16 09:30:39 +08:00
|
|
|
|
handler (newVal) {
|
2022-01-20 14:45:21 +08:00
|
|
|
|
this.maxlen = 50;
|
|
|
|
|
this.acctype = "text";
|
|
|
|
|
if (newVal == 0) {
|
|
|
|
|
this.placeholder = "请输入昵称";
|
|
|
|
|
} else if (newVal == 1) {
|
|
|
|
|
this.acctype = "tel";
|
|
|
|
|
this.placeholder = "请输入手机号";
|
|
|
|
|
this.maxlen = 11;
|
|
|
|
|
} else if (newVal == 2) {
|
|
|
|
|
this.placeholder = "请输入邮箱";
|
|
|
|
|
} else if (newVal == 3) {
|
|
|
|
|
this.placeholder = "请输入手机号或邮箱";
|
|
|
|
|
} else if (newVal == 4) {
|
|
|
|
|
this.placeholder = "请输入QQ号";
|
|
|
|
|
this.acctype = "tel";
|
|
|
|
|
this.maxlen = 10;
|
|
|
|
|
} else if (newVal == 5) {
|
|
|
|
|
this.placeholder = "请输入手机号或QQ号";
|
|
|
|
|
this.maxlen = 11;
|
|
|
|
|
this.acctype = "tel";
|
|
|
|
|
} else if (newVal == 6) {
|
|
|
|
|
this.placeholder = "请输入邮箱或QQ号";
|
|
|
|
|
} else if (newVal == 7) {
|
|
|
|
|
this.placeholder = "请输入手机号/邮箱/QQ号";
|
|
|
|
|
} else if (newVal == 8) {
|
|
|
|
|
this.placeholder = "请输入微信号";
|
|
|
|
|
this.maxlen = 20;
|
|
|
|
|
} else if (newVal == 9) {
|
|
|
|
|
this.placeholder = "请输入手机号或微信";
|
|
|
|
|
this.maxlen = 20;
|
|
|
|
|
} else if (newVal == 10) {
|
|
|
|
|
this.placeholder = "请输入邮箱或微信号";
|
|
|
|
|
} else if (newVal == 11) {
|
|
|
|
|
this.placeholder = "请输入手机号/邮箱/微信号";
|
|
|
|
|
} else if (newVal == 12) {
|
|
|
|
|
this.placeholder = "请输入QQ号或微信号";
|
|
|
|
|
this.maxlen = 20;
|
|
|
|
|
} else if (newVal == 13) {
|
|
|
|
|
this.placeholder = "请输入手机号/QQ号/微信号";
|
|
|
|
|
this.maxlen = 20;
|
|
|
|
|
} else if (newVal == 14) {
|
|
|
|
|
this.placeholder = "请输入邮箱/QQ号/微信号";
|
|
|
|
|
} else {
|
|
|
|
|
this.placeholder = "请输入手机号/邮箱/QQ号/微信号";
|
|
|
|
|
}
|
2021-12-29 11:51:28 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
2022-10-17 11:23:00 +08:00
|
|
|
|
|
2021-12-29 11:51:28 +08:00
|
|
|
|
</html>
|