diff --git a/orderDetails/cardOrder.html b/orderDetails/cardOrder.html index 1417bb3..0b6546c 100644 --- a/orderDetails/cardOrder.html +++ b/orderDetails/cardOrder.html @@ -102,26 +102,28 @@ /* 获取详情 */ function getInfo(isLoading) { - const orderNumber = sessionStorage.getItem('orderNumber'); - req.axiosGet(`/key/order/detail/${orderNumber}`).then(res => { - if (isLoading) { - loading.value = true; - const clr = setTimeout(() => { - loading.value = false; - clearTimeout(clr); - }, 1000); - } - if (res.code == 200) { - const { product_name, status, show_url, card_number, card_password, use_coupon, product, mask_card_password } = res.data; - card_look_pwd.value = mask_card_password && mask_card_password.length > 16 ? mask_card_password.substring(0, 16) : mask_card_password; - goods.value = { product_name, time: res.data.goods.end_time, status, show_url, card_number, card_password, card_show: res.data.goods.card_show, use_coupon, detail_url: product.detail_url }; - // 领取成功结算 5 - if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 5 && status === 2) { - settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type); + if (orderNumber) { + req.axiosGet(`/key/order/detail/${orderNumber}`).then(res => { + if (isLoading) { + loading.value = true; + const clr = setTimeout(() => { + loading.value = false; + clearTimeout(clr); + }, 1000); } - } - }); + if (res.code == 200) { + const { product_name, status, show_url, card_number, card_password, use_coupon, product, mask_card_password } = res.data; + card_look_pwd.value = mask_card_password && mask_card_password.length > 16 ? mask_card_password.substring(0, 16) : mask_card_password; + goods.value = { product_name, time: res.data.goods.end_time, status, show_url, card_number, card_password, card_show: res.data.goods.card_show, use_coupon, detail_url: product.detail_url }; + // 领取成功结算 5 + if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 5 && status === 2) { + settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type); + } + } + }); + } + } /* 重新兑换 */ diff --git a/orderDetails/chargerOrder.html b/orderDetails/chargerOrder.html index d0da420..53a8e75 100644 --- a/orderDetails/chargerOrder.html +++ b/orderDetails/chargerOrder.html @@ -92,19 +92,21 @@ /* 获取详情 */ function getInfo(isLoading) { const orderNumber = sessionStorage.getItem('orderNumber'); - req.axiosGet(`/key/order/detail/${orderNumber}`).then(res => { - if (isLoading) { - loading.value = true; - const clr = setTimeout(() => { - loading.value = false; - clearTimeout(clr); - }, 1000); - } - if (res.code == 200) { - const { product_name, update_time, status, show_url, account, create_time, use_coupon } = res.data; - goods.value = { product_name, update_time, status, show_url, account, create_time, orderNumber, use_coupon }; - } - }); + if (orderNumber) { + req.axiosGet(`/key/order/detail/${orderNumber}`).then(res => { + if (isLoading) { + loading.value = true; + const clr = setTimeout(() => { + loading.value = false; + clearTimeout(clr); + }, 1000); + } + if (res.code == 200) { + const { product_name, update_time, status, show_url, account, create_time, use_coupon } = res.data; + goods.value = { product_name, update_time, status, show_url, account, create_time, orderNumber, use_coupon }; + } + }); + } } /* 重新兑换 */ diff --git a/paysuccess.html b/paysuccess.html index 279c89e..cb9fd3f 100644 --- a/paysuccess.html +++ b/paysuccess.html @@ -113,23 +113,26 @@ }, //获取订单详情 getOrderDetail(id) { - req.axiosGet("/key/order/detail/" + id).then((res) => { - if (res.code == 200) { - this.orderInfo = res.data; - this.payResult = true; - if (res.data.type == 2) { //1 商品 2立减金 - //channel 1支付宝 2微信 - this.plaflam = res.data.product.entity.channel;//只有立减金商品才有channel字段 - this.redirect_url = res.data.wechat_redirect_url; - this.payStatus = res.data.pay_status; - this.orderId = res.data.alipay_order_number; - this.is_webview = res.data.product.entity.is_webview; - this.code_batch_id = res.data.product.code_batch_id; - } else { - this.countdownFn(); + if (id) { + req.axiosGet("/key/order/detail/" + id).then((res) => { + if (res.code == 200) { + this.orderInfo = res.data; + this.payResult = true; + if (res.data.type == 2) { //1 商品 2立减金 + //channel 1支付宝 2微信 + this.plaflam = res.data.product.entity.channel;//只有立减金商品才有channel字段 + this.redirect_url = res.data.wechat_redirect_url; + this.payStatus = res.data.pay_status; + this.orderId = res.data.alipay_order_number; + this.is_webview = res.data.product.entity.is_webview; + this.code_batch_id = res.data.product.code_batch_id; + } else { + this.countdownFn(); + } } - } - }).catch(); + }).catch(); + } + }, //弹出框提示