feat: 兑换码卡密订单直接跳转卡密详情页面

This commit is contained in:
wangsongsole 2023-11-23 13:56:59 +08:00
parent 55fac5c36e
commit 9044eeab10
1 changed files with 37 additions and 5 deletions

View File

@ -29,6 +29,8 @@
<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">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage2_0.css?v=2">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/loading.css">
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/loading.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script>
</head>
@ -90,6 +92,11 @@
<!-- 弹出框 -->
<div class="mask" v-if="maskshow">
</div>
<div class="mask" @touchmove.prevent @mousewheel.prevent v-if="loading" ref="load">
<preload-component />
</div>
<!-- 悬浮提示 -->
<div v-if="suspension" class="suspensionDom">
<img @click="closeTip" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png"
@ -151,12 +158,14 @@
describe: {},
detailUrl: '',
successTip: '',
order_number: 0,
goodInfo: '',
bgcolor: '',
ftcolor: '',
goodsDetail: {},//商品详情
backAble: true,
bindClick: false,//控制遮罩显示
loading: false,
goodsShow: [
'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220120/9bedd7af6a8a570be8f2858564f9ec6d.png'
]
@ -229,7 +238,23 @@
},
//刷新页面
successchangeBtnFn () {
if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) {
this.getCardDetails();
} else {
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);
}
});
},
//兑换商品
@ -319,19 +344,26 @@
self.popboxshow = false;
req.axiosPost('/key/usage', data).then(res => {
if (res.code == 200) {
this.popboxtype = '成功';
sessionStorage.setItem('lastid', self.goodInfo.product_id);
// 查询订单接口
if (this.goodInfo.product_type === 2) {
if (this.goodInfo.card_show == 2) {
this.successTip = '兑换成功,请到页面左下角"订单"(订单列表处)查看卡密信息!';
this.loading = true;
this.order_number = res.data.order_number;
this.successTip = '兑换成功!';
setTimeout(() => {
this.popboxshow = true;
this.loading = false;
}, 3000);
} else {
this.successTip = '兑换成功,请到注意查收手机短信!';
this.popboxshow = true;
}
} else {
this.successTip = '兑换成功到账信息请关注官方APP';
}
this.popboxtype = '成功';
this.popboxshow = true;
}
} else {
this.openErrorDialog(res.message);