2 lines
2.5 KiB
JavaScript
2 lines
2.5 KiB
JavaScript
import{r as e,t as a,H as n,a as t,w as o,x as s,e as i,a1 as d,I as u,a2 as p,o as l,b as r,s as c}from"./index-BWFbK6MW.js";import{_ as g}from"./_plugin-vue_export-helper.BCo6x5W8.js";const v=g({__name:"index",setup(g){const v=e(""),m=e(!1),y=e("");e({timeStamp:"1747983532",package:"prepay_id=wx23145806465232c82870c59d2d41cf0000",paySign:"0pUqj2JZ77BYchyJuthQyP4yRfqhjvwag78Q4IMnIyQ3/OQP6OyJreZfmj0GFSEMrRsKAHIdBBM7tVnot0aaRhI5qwSOWpzyvJCkYa4eqPgqlV4XYVMqE3zeB/Cx4C9bv4poMXnaGlfFPdkhMYbUcdtsw4gBXXhqUx//9x7eu9cOERRzLquM8Z8rewRpar/kkVKSCV6h8pX19kRj+KEkK5LZB8IUIG995g1lsVFOqdO4mVFBJ1wZCkwJczgVI+jdNGgnR2lpdjwIpJFm+5Hm0y9SwR0UFvgkm95NrmY+Sruty/Zf8ekQwF4+atubW8CE6i8wm2zZpMEnnfS4WFwAwg==",appId:"wx8fc3e4305d2fbf0b",signType:"RSA",nonceStr:"DxpF2uIMl0VM7vPOG7pWnPHk2Dvi3V7K"});const w=()=>{const e={title:"测试订单",openId:S.value,amountPrice:v.value,orgCode:"组织id",nursingUnit:"护理单元id",customerId:"顾客id",orderType:"订单类型",price:1,count:1,unit:"单位"};console.log("???/",e),fetch("https://www.focusnu.com/nursing-unit_0010507/weiXinPay/native",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then((e=>e.json())).then((e=>{e.appId?function(e){const a=()=>{window.WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:e.appId,timeStamp:e.timeStamp,nonceStr:e.nonceStr,package:e.package,signType:e.signType,paySign:e.paySign},(function(e){m.value=!1,"get_brand_wcpay_request:ok"===e.err_msg?y.value="支付成功":y.value="支付失败或取消"}))};void 0===window.WeixinJSBridge?document.addEventListener("WeixinJSBridgeReady",a,!1):a()}(e):c({title:"支付失败",icon:"error"})})).catch((e=>{console.error("请求失败:",e)}))},f=e(""),S=e("");function k(){v.value&&(m.value=!0,y.value="拉起微信支付...",d({key:"serverUrl",success:function(e){console.log("读取缓存:",e.data.url),f.value=e.data.url}}),d({key:"openid",success:function(e){console.log("读取缓存:",e.data.openid),S.value=e.data.openid}}),w())}return(e,d)=>{const c=u,g=p;return l(),a("div",{class:"container"},[n("div",{class:"input-group"},[t(c,{type:"number",modelValue:v.value,"onUpdate:modelValue":d[0]||(d[0]=e=>v.value=e),placeholder:"请输入金额",class:"amount-input"},null,8,["modelValue"]),t(g,{onClick:k,disabled:m.value||!v.value,class:"pay-btn"},{default:o((()=>[r(" 支付 ")])),_:1},8,["disabled"])]),y.value?(l(),a("div",{key:0,class:"status-group"},[n("p",null,s(y.value),1)])):i("",!0)])}}},[["__scopeId","data-v-6425dffb"]]);export{v as default};
|