✨ feat: 卡密订单直接跳转
This commit is contained in:
parent
67d4237b9b
commit
d849fa5514
|
@ -9,11 +9,13 @@
|
|||
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript"
|
||||
charset="utf-8"></script>
|
||||
<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>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
|
||||
<!-- 单条弹出框 -->
|
||||
<div class="prompt" :class="toastShow?'proactive':''">
|
||||
{{this.toastTip}}
|
||||
|
@ -35,32 +37,41 @@
|
|||
<template v-if="cardData.card_number">
|
||||
<div class="item item-margin">
|
||||
<p class="title">卡号:</p>
|
||||
<p class="number">{{cardData.card_number}}</p>
|
||||
<p class="copy" @click="copyFunction(cardData.card_number)">
|
||||
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png"
|
||||
alt="">
|
||||
复制卡号
|
||||
</p>
|
||||
<template v-if="cardData.card_number">
|
||||
<p class="number">{{cardData.card_number}}</p>
|
||||
<p class="copy" @click="copyFunction(cardData.card_number)">
|
||||
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png"
|
||||
alt="">
|
||||
复制卡号
|
||||
</p>
|
||||
</template>
|
||||
<p v-else class="generate">卡密正在生成中,请稍后刷新再查看</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<p class="title">密码:</p>
|
||||
<p class="number">{{cardData.card_password}}</p>
|
||||
<p class="copy" @click="copyFunction(cardData.card_password)">
|
||||
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png"
|
||||
alt="">
|
||||
复制密码
|
||||
</p>
|
||||
<template v-if="cardData.card_password">
|
||||
<p class="number">{{cardData.card_password}}</p>
|
||||
<p class="copy" @click="copyFunction(cardData.card_password)">
|
||||
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png"
|
||||
alt="">
|
||||
复制密码
|
||||
</p>
|
||||
</template>
|
||||
<p v-else class="generate">卡密正在生成中,请稍后刷新再查看</p>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="item item-margin">
|
||||
<p class="title">卡密:</p>
|
||||
<p class="number">{{cardData.card_password}}</p>
|
||||
<p class="copy" @click="copyFunction(cardData.card_password)">
|
||||
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png"
|
||||
alt="">
|
||||
复制卡密
|
||||
</p>
|
||||
<template v-if="cardData.card_password">
|
||||
<p class="number">{{cardData.card_password}}</p>
|
||||
<p class="copy" @click="copyFunction(cardData.card_password)">
|
||||
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/copyNumber.png"
|
||||
alt="">
|
||||
复制卡密
|
||||
</p>
|
||||
</template>
|
||||
<p v-else class="generate">卡密正在生成中,请稍后刷新再查看</p>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
@ -72,7 +83,13 @@
|
|||
el: "#app",
|
||||
data () {
|
||||
return {
|
||||
cardData: {},
|
||||
cardData: {
|
||||
goods: {},
|
||||
card_password: null,
|
||||
card_number: null,
|
||||
product_name: null,
|
||||
show_url: null,
|
||||
},
|
||||
toastShow: false,
|
||||
toastTip: ''
|
||||
};
|
||||
|
@ -81,7 +98,13 @@
|
|||
|
||||
|
||||
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: {
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
|
||||
/* 查看卡密 */
|
||||
lookCard (item) {
|
||||
localStorage.setItem("cardProductDetail", JSON.stringify(item));
|
||||
localStorage.setItem("orderNumber", item.order_number);
|
||||
window.location.href = './lookCard.html';
|
||||
},
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
<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">
|
||||
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script>
|
||||
<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>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -83,6 +85,9 @@
|
|||
@click="exchangeGoodsFn">立即兑换</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mask" @touchmove.prevent @mousewheel.prevent v-if="loading" ref="load">
|
||||
<preload-component />
|
||||
</div>
|
||||
<!-- 单条弹出框 -->
|
||||
<div class="prompt" :class="promtshow?'proactive':''">
|
||||
{{this.promttip}}
|
||||
|
@ -157,6 +162,8 @@
|
|||
goodsDetail: {},//商品详情
|
||||
backAble: true,
|
||||
bindClick: false,//控制遮罩显示
|
||||
order_number: 0,
|
||||
loading: false,
|
||||
goodsShow: [
|
||||
'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220120/9bedd7af6a8a570be8f2858564f9ec6d.png'
|
||||
]
|
||||
|
@ -233,9 +240,15 @@
|
|||
this.promttip = '';
|
||||
}, 3000);
|
||||
},
|
||||
|
||||
//刷新页面
|
||||
successchangeBtnFn () {
|
||||
window.location.replace(document.referrer);
|
||||
if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) {
|
||||
localStorage.setItem('orderNumber', this.order_number);
|
||||
window.location.replace('./coupon/lookCard.html');
|
||||
} else {
|
||||
window.location.replace(document.referrer);
|
||||
}
|
||||
},
|
||||
|
||||
//兑换商品
|
||||
|
@ -325,19 +338,25 @@
|
|||
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.popboxshow = true;
|
||||
}
|
||||
this.popboxtype = '成功';
|
||||
this.popboxshow = true;
|
||||
|
||||
} else {
|
||||
this.openErrorDialog(res.message);
|
||||
|
|
|
@ -322,7 +322,7 @@
|
|||
|
||||
/* 查看卡密 */
|
||||
lookCard (item) {
|
||||
localStorage.setItem("cardProductDetail", JSON.stringify(item));
|
||||
localStorage.setItem("orderNumber", item.order_number);
|
||||
window.location.href = "./coupon/lookCard.html";
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue