feat: 卡密商品兑换成功直接跳转卡密查看页面

This commit is contained in:
wangsongsole 2023-11-23 15:32:01 +08:00
parent 9044eeab10
commit d8c97426a2
4 changed files with 17 additions and 21 deletions

View File

@ -9,6 +9,9 @@
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript" <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript"
charset="utf-8"></script> charset="utf-8"></script>
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/lookCard.css"> <link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/lookCard.css">
<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"></script>
</head> </head>
<body> <body>
@ -35,7 +38,7 @@
<template v-if="cardData.card_number"> <template v-if="cardData.card_number">
<div class="item item-margin"> <div class="item item-margin">
<p class="title">卡号:</p> <p class="title">卡号:</p>
<p class="number">{{cardData.card_number}}</p> <p class="number">{{cardData.card_number||'卡密正在生成中,请稍后刷新再查看'}}</p>
<p class="copy" @click="copyFunction(cardData.card_number)"> <p class="copy" @click="copyFunction(cardData.card_number)">
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png" <img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png"
alt=""> alt="">
@ -44,7 +47,7 @@
</div> </div>
<div class="item"> <div class="item">
<p class="title">密码:</p> <p class="title">密码:</p>
<p class="number">{{cardData.card_password}}</p> <p class="number">{{cardData.card_password||'卡密正在生成中,请稍后刷新再查看'}}</p>
<p class="copy" @click="copyFunction(cardData.card_password)"> <p class="copy" @click="copyFunction(cardData.card_password)">
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png" <img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png"
alt=""> alt="">
@ -55,7 +58,7 @@
<template v-else> <template v-else>
<div class="item item-margin"> <div class="item item-margin">
<p class="title">卡密:</p> <p class="title">卡密:</p>
<p class="number">{{cardData.card_password}}</p> <p class="number">{{cardData.card_password||'卡密正在生成中,请稍后刷新再查看'}}</p>
<p class="copy" @click="copyFunction(cardData.card_password)"> <p class="copy" @click="copyFunction(cardData.card_password)">
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png" <img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png"
alt=""> alt="">
@ -78,10 +81,14 @@
}; };
}, },
created () { created () {
this.cardData = JSON.parse(localStorage.getItem('cardProductDetail')); const orderNumber = localStorage.getItem('orderNumber');
/* 获取卡密详情 */
req.axiosGet(`/key/order/detail/${orderNumber}`).then(res => {
if (res.code == 200) {
this.cardData = res.data;
}
});
}, },
methods: { methods: {

View File

@ -181,7 +181,7 @@
/* 查看卡密 */ /* 查看卡密 */
lookCard (item) { lookCard (item) {
localStorage.setItem("cardProductDetail", JSON.stringify(item)); localStorage.setItem("orderNumber", item.order_number);
window.location.href = './lookCard.html'; window.location.href = './lookCard.html';
}, },

View File

@ -239,24 +239,13 @@
//刷新页面 //刷新页面
successchangeBtnFn () { successchangeBtnFn () {
if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) { if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) {
this.getCardDetails(); localStorage.setItem("orderNumber", this.order_number);
window.location.href = './coupon/lookCard.html';
} else { } else {
window.location.replace(document.referrer); window.location.replace(document.referrer);
} }
}, },
/* 获取卡密详情 */
getCardDetails () {
req.axiosGet(`/key/order/detail/${this.order_number}`).then(res => {
if (res.code == 200) {
localStorage.setItem('cardProductDetail', JSON.stringify(res.data));
window.location.replace('./coupon/lookCard.html');
} else {
this.openErrorDialog(res.message);
}
});
},
//兑换商品 //兑换商品
exchangeGoodsFn () { exchangeGoodsFn () {
if (goodsDetail.available != 1) { if (goodsDetail.available != 1) {

View File

@ -250,7 +250,7 @@
/* 查看卡密 */ /* 查看卡密 */
lookCard (item) { lookCard (item) {
localStorage.setItem("cardProductDetail", JSON.stringify(item)); localStorage.setItem("orderNumber", item.order_number);
window.location.href = './coupon/lookCard.html'; window.location.href = './coupon/lookCard.html';
}, },