2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
|
import{V as e,W as a,D as t,h as l,i as o,w as r,S as s,d as n,ag as u,r as i,aq as c,$ as d,p,q as m,j as y,J as f,K as _,m as x,Y as v,aj as g,E as b,F as h,G as S,x as k,l as w,a9 as C,t as I,ao as j,X as E,a as P,e as T,ar as F,ai as A,k as V,v as $,n as R,ap as H,as as D,M as O,H as U}from"./index-849cf30e.js";import{_ as z}from"./u-loading-page.195e23a4.js";import{_ as B}from"./u-button.9fa3f2a0.js";import{p as K,_ as W}from"./u-input.46b72faa.js";import{_ as L}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as q}from"./u-popup.e01742d2.js";import{_ as X}from"./u-image.5cc88b24.js";import{_ as Y}from"./u-icon.e3aa4770.js";import{p as G,g as J}from"./pay.46c830b5.js";import{w as M}from"./wechat.b5eac334.js";import"./u-loading-icon.d012ecbf.js";import"./u-transition.75065529.js";import"./u-safe-bottom.2f6af56c.js";const Z=L({name:"u--input",mixins:[e,K,a],components:{uvInput:W}},[["render",function(e,a,n,u,i,c){const d=t("uvInput");return l(),o(d,{modelValue:e.modelValue,"onUpdate:modelValue":a[0]||(a[0]=a=>e.$emit("update:modelValue",a)),type:e.type,fixed:e.fixed,disabled:e.disabled,disabledColor:e.disabledColor,clearable:e.clearable,password:e.password,maxlength:e.maxlength,placeholder:e.placeholder,placeholderClass:e.placeholderClass,placeholderStyle:e.placeholderStyle,showWordLimit:e.showWordLimit,confirmType:e.confirmType,confirmHold:e.confirmHold,holdKeyboard:e.holdKeyboard,focus:e.focus,autoBlur:e.autoBlur,disableDefaultPadding:e.disableDefaultPadding,cursor:e.cursor,cursorSpacing:e.cursorSpacing,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd,adjustPosition:e.adjustPosition,inputAlign:e.inputAlign,fontSize:e.fontSize,color:e.color,prefixIcon:e.prefixIcon,suffixIcon:e.suffixIcon,suffixIconStyle:e.suffixIconStyle,prefixIconStyle:e.prefixIconStyle,border:e.border,readonly:e.readonly,shape:e.shape,customStyle:e.customStyle,formatter:e.formatter,ignoreCompositionEvent:e.ignoreCompositionEvent},{default:r((()=>[s(e.$slots,"prefix",{slot:"prefix"}),s(e.$slots,"suffix",{slot:"suffix"})])),_:3},8,["modelValue","type","fixed","disabled","disabledColor","clearable","password","maxlength","placeholder","placeholderClass","placeholderStyle","showWordLimit","confirmType","confirmHold","holdKeyboard","focus","autoBlur","disableDefaultPadding","cursor","cursorSpacing","selectionStart","selectionEnd","adjustPosition","inputAlign","fontSize","color","prefixIcon","suffixIcon","suffixIconStyle","prefixIconStyle","border","readonly","shape","customStyle","formatter","ignoreCompositionEvent"])}]]),N=L(n({__name:"pay",emits:["close"],setup(e,{expose:a,emit:t}){u()&&M.init();const s=i(!1),n=i(!1),E=i(null),P=i(""),T=()=>{var e,a;uni.$u.test.isEmpty(P.value)?C({title:v("pay.notHavePayType"),icon:"none"}):n.value||(n.value=!0,G({trade_type:null==(e=E.value)?void 0:e.trade_type,trade_id:null==(a=E.value)?void 0:a.trade_id,type:P.value}).then((e=>{var a,t,l,o,r,s;switch(P.value){case"wechatpay":u()?(e.data.timestamp=e.data.timeStamp,delete e.data.timeStamp,M.pay({...e.data,success:()=>{F()},cancel:()=>{n.value=!1}})):(uni.setStorageSync("paymenting",{trade_type:null==(a=E.value)?void 0:a.trade_type,trade_id:null==(t=E.value)?void 0:t.trade_id}),location.href=e.data.h5_url);break;case"alipay":u()?d({url:"/app/pages/pay/browser",param:{trade_type:null==(l=E.value)?void 0:l.trade_type,trade_id:null==(o=E.value)?void 0:o.trade_id,alipay:encodeURIComponent(e.data.url)},mode:"redirectTo"}):(uni.setStorageSync("paymenting",{trade_type:null==(r=E.value)?void 0:r.trade_type,trade_id:null==(s=E.value)?void 0:s.trade_id}),location.href=e.data.url);break;default:F()}})).catch((()=>{n.value=!1})))};c("checkIsReturnAfterPayment",(()=>{const e=uni.getStorageSync("paymenting");uni.getStorageSync("paymenting")&&d({url:"/app/pages/pay/result",param:{trade_type:e.trade_type,trade_id:e.trade_id},mode:"redirectTo",success(){uni.removeStorageSync("paymenting")}})}));const F=()=>{var e,a;d({url:"/app/pages/pay/result",param:{trade_type:null==(e=E.value)?void 0:e.trade_type,trade_id:null==(a=E.value)?void 0:a.trade_id},mode:"redirectTo"})},
|