From 96a3a2ef8d1b898ee1ce7d7e2c8304a7ebf337e1 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 30 May 2024 15:40:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/pay.vue | 8 ++++---- src/views/saleHome/index.vue | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/pay.vue b/src/components/pay.vue index 0e538ff..67bb7fd 100644 --- a/src/components/pay.vue +++ b/src/components/pay.vue @@ -104,10 +104,10 @@ const handleEnter = () => { auth_code: input.value, }) .then((res) => { - if (res.data.trade_state == "SUCCESS") { + if (res.data.out_trade_no && res.msg == "支付成功") { drawer.value = false; ElMessage({ - message: res.data.trade_state_desc || "支付成功", + message: "支付成功", type: "success", }); // if(res.data.message) audioplay(res.data.message); @@ -173,10 +173,10 @@ const orderPay = (id) => { }; orderPayApi(id, query) .then((res) => { - if (res.data.trade_state == "SUCCESS") { + if (res.data.out_trade_no && res.msg == "支付成功") { drawer.value = false; ElMessage({ - message: res.message == "success" ? "支付成功" : res.message, + message: "支付成功", type: "success", }); // if(res.data.message) audioplay(res.data.message); diff --git a/src/views/saleHome/index.vue b/src/views/saleHome/index.vue index 1a8812d..47a8dd7 100644 --- a/src/views/saleHome/index.vue +++ b/src/views/saleHome/index.vue @@ -139,6 +139,9 @@ const onPrint = (data)=>{ total: item.goods_total_price, //小计 }); }); + let paytype = "现金支付"; + if(data.pay_type==13) paytype = "支付宝支付"; + if(data.pay_type==9) paytype = "微信支付"; let obj = { mer_name: userStore.userInfo.merchant.mer_name, //商户名称 service_phone: userStore.userInfo.merchant.service_phone, //客服电话 @@ -146,7 +149,7 @@ const onPrint = (data)=>{ create_time: data.create_time, //下单时间 total_price: orderForm.value.total, //总价 pay_price: orderForm.value.total, //实付 - pay_type: data.trade_type=='MICROPAY' ? '微信支付':'余额支付', //支付方式 + pay_type: paytype, //支付方式 pay_number: data.transaction_id, //支付单号 goods: goods, //商品列表 };