mobileclient/coupon/lookCard.html

162 lines
7.4 KiB
HTML
Raw Normal View History

2022-10-24 11:59:56 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<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>
<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">
2024-01-08 16:08:53 +08:00
<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>
2022-10-24 11:59:56 +08:00
</head>
<body>
<div id="app">
<!-- 单条弹出框 -->
<div class="prompt" :class="toastShow?'proactive':''">
{{this.toastTip}}
</div>
2024-01-08 19:14:48 +08:00
<div v-show="!loading">
2024-01-10 09:57:44 +08:00
<img class="backPresTy" @click="backHandler" v-if="!backShow"
2024-01-08 19:14:48 +08:00
src=" https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" alt="">
<p class="nav-title">卡密</p>
<div class="topBox">
<img :src="cardData.show_url" alt="">
<p class="product_name">{{cardData.product_name}}</p>
<p class="end_time">
卡密有效期至:{{cardData.goods.end_time}}
</p>
</div>
<div class="bottomBox">
<div>
<p class="cardInformation">卡密信息</p>
<template v-if="cardData.card_number">
<div class="item item-margin">
<p class="title">卡号:</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>
2024-01-08 19:36:02 +08:00
<div v-else class="generate">
<p>{{cardData.status===3?'卡密兑换失败,请重新兑换':'卡密正在生成中,请稍后刷新再查看'}} </p>
<span @click="backHandler" v-if="cardData.status===3">重新兑换</span>
2024-01-08 19:48:14 +08:00
<span @click="getInfo()" v-else>点击刷新</span>
2024-01-08 19:14:48 +08:00
</div>
2024-01-08 18:06:53 +08:00
</div>
2024-01-08 19:14:48 +08:00
<div class="item">
<p class="title">密码:</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>
2024-01-08 19:36:02 +08:00
<div v-else class="generate">
<p>{{cardData.status===3?'卡密兑换失败,请重新兑换':'卡密正在生成中,请稍后刷新再查看'}} </p>
<span @click="backHandler" v-if="cardData.status===3">重新兑换</span>
2024-01-08 19:48:14 +08:00
<span @click="getInfo()" v-else>点击刷新</span>
2024-01-08 19:14:48 +08:00
</div>
2024-01-08 18:06:53 +08:00
</div>
2024-01-08 19:14:48 +08:00
</template>
<template v-else>
<div class="item item-margin">
<p class="title">卡密:</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>
2024-01-08 19:36:02 +08:00
<div v-else class="generate">
<p>{{cardData.status===3?'卡密兑换失败,请重新兑换':'卡密正在生成中,请稍后刷新再查看'}} </p>
<span @click="backHandler" v-if="cardData.status===3">重新兑换</span>
2024-01-08 19:48:14 +08:00
<span @click="getInfo()" v-else>点击刷新</span>
2024-01-08 19:14:48 +08:00
</div>
2024-01-08 18:06:53 +08:00
</div>
2024-01-08 19:14:48 +08:00
</template>
</div>
2024-01-08 18:33:45 +08:00
</div>
2024-01-08 19:14:48 +08:00
</>
2022-10-24 11:59:56 +08:00
</div>
2024-01-08 19:14:48 +08:00
<script>
new Vue({
el: "#app",
data () {
return {
cardData: {
goods: {},
card_password: null,
card_number: null,
product_name: null,
show_url: null,
},
toastShow: false,
toastTip: '',
loading: true,
2024-01-10 09:56:38 +08:00
backShow: sessionStorage.getItem('backShow')
2024-01-08 19:14:48 +08:00
};
},
2023-12-20 17:17:16 +08:00
2022-10-24 11:59:56 +08:00
2024-01-08 19:14:48 +08:00
created () {
2024-01-08 19:48:14 +08:00
this.getInfo(true);
2022-10-24 11:59:56 +08:00
},
2024-01-08 19:14:48 +08:00
methods: {
/* 复制 */
copyFunction (number) {
var aux = document.createElement("input");
aux.setAttribute("value", number);
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
this.openDialog('复制成功');
},
2024-01-08 18:06:53 +08:00
2024-01-08 19:48:14 +08:00
getInfo (loading = false) {
const orderNumber = sessionStorage.getItem('orderNumber');
2024-01-08 19:48:14 +08:00
this.loading = loading;
2024-01-08 19:14:48 +08:00
/* 获取卡密详情 */
req.axiosGet(`/key/order/detail/${orderNumber}`).then(res => {
if (res.code == 200) {
this.cardData = res.data;
this.loading = false;
}
});
},
2022-10-24 11:59:56 +08:00
2024-01-08 19:14:48 +08:00
// 单条弹框
openDialog (tip) {
this.toastShow = true;
this.toastTip = tip;
setTimeout(() => {
this.toastShow = false;
this.toastTip = '';
}, 3000);
},
2022-10-24 11:59:56 +08:00
2024-01-08 19:14:48 +08:00
backHandler () {
history.go(-1);
2024-01-10 09:56:38 +08:00
},
2024-01-08 19:14:48 +08:00
}
})
</script>
2022-10-24 11:59:56 +08:00
</body>
</html>