12 |
- "use strict";const a=require("../common/vendor.js"),s=require("../common/request.js");let c=new s.Request().http;const u={zfbPayment:"/app/live/liveOrder/aliPayment",weChatPayment:"/app/live/liveOrder/weChatPayment"};function m(e){return new Promise((i,n)=>{c(u.weChatPayment,e,"POST","application/json;charset=UTF-8").then(t=>{l(t.data).then(i).catch(r=>{o(r),n(r)})}).catch(t=>{o(t),n(t)})})}function l(e){return new Promise((i,n)=>{a.index.requestPayment({provider:"wxpay",...e,success:t=>{a.index.showToast({title:"支付成功"}),i(t)},fail:t=>{n(new Error(h(t)))}})})}function h(e){if(e.errMsg){if(e.errMsg.includes("cancel"))return"支付已取消";if(e.errMsg.includes("fail"))return"支付失败"}return e.message||"支付异常"}function o(e){a.index.__f__("error","at api/pay.js:125","[支付错误]",e),a.index.showToast({title:e.message,icon:"none",duration:3e3})}exports.weChatPayment=m;
- //# sourceMappingURL=../../.sourcemap/mp-weixin/api/pay.js.map
|