fix: 使用包码结算

This commit is contained in:
zhangds 2024-02-23 16:18:52 +08:00
parent 8c4251d92f
commit 67daf96242
3 changed files with 32 additions and 6 deletions

View File

@ -15,6 +15,7 @@
<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>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/modelPop.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/libs.js"></script>
<style>
input {
color: var(--placeholderColor);
@ -234,6 +235,12 @@
goToPackKey(data) {
// 第一步:判断是否为包码
if (data.settlement_data && data.settlement_data.settlement_type > 0) {
// 包码打开结算
if (!data.settlement_data.is_settlement && data.settlement_data.settlement_type === 2) {
settlementFun(data.token, data.settlement_data.settlement_type);
}
// 存储数据
sessionStorage.setItem("bm_auth", JSON.stringify(data));
// 跳转包码页面

View File

@ -30,6 +30,7 @@
<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>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/libs.js"></script>
</head>
<body>
@ -129,6 +130,8 @@
</div>
</body>
<script>
// 获取 包码结算数据
const bm_obj_data = sessionStorage.getItem("bm_auth") ? JSON.parse(sessionStorage.getItem("bm_auth")) : null;
let goodsCount = null, goodsDetail = null;
new Vue({
el: '#exchangePage',
@ -200,6 +203,12 @@
});
});
},
mounted() {
// 领取成功结算 5
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 5) {
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
}
},
methods: {
bindAvailable() {
if (goodsDetail.available != 1) {
@ -323,6 +332,11 @@
},
//确定兑换
surexchangeBtn() {
// 使用结算 6
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 6 && this.goodInfo.product_type !== 2) {
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
}
this.maskshow = false;
let self = this;
let data = {
@ -335,6 +349,14 @@
self.popboxshow = false;
req.axiosPost('/key/usage', data).then(res => {
if (res.code == 200) {
// 使用成功结算 7 直充
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 7) {
if (state.goodsInfo.product_type === 1) {
settlementFun(bm_obj_data.token, bm_obj_data.settlement_type);
}
}
this.popboxtype = '成功';
sessionStorage.setItem('lastid', self.goodInfo.product_id);
sessionStorage.setItem('orderNumber', res.data.order_number);

View File

@ -31,6 +31,7 @@
<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>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/libs.js"></script>
<link rel="stylesheet" href="./style.css">
</head>
@ -76,11 +77,6 @@
// sessionStorage.setItem("bm_auth", JSON.stringify(bm_gold_obj));
// 获取 包码结算数据-打开结算
const bm_obj_data = sessionStorage.getItem("bm_auth") ? JSON.parse(sessionStorage.getItem("bm_auth")) : null;
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 2) {
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
}
const { createApp, ref, reactive, onMounted } = Vue;
createApp({
@ -120,6 +116,7 @@
// 立即领取
const goToExchange = () => {
// 领取结算 4
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 4) {
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
}
@ -127,7 +124,7 @@
}
onMounted(() => {
// 领取结算
// 打开成功结算3
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 3) {
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
}