test_lgq/niucloud/public/wap/assets/app-pages-member-balance.b4095371.js
2024-01-24 17:36:08 +08:00

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"})},A=()=>{uni.removeStorageSync("paymenting"),s.value=!1,t("close")};return a({open:(e,a,t="")=>{uni.setStorageSync("payReturn",encodeURIComponent(t)),J(e,a).then((e=>{let{data:a}=e;E.value=a,uni.$u.test.isEmpty(a)?C({title:v("pay.notObtainedInfo"),icon:"none"}):0!=a.money?0==a.status?(P.value=a.pay_type_list[0]?a.pay_type_list[0].key:"",s.value=!0):C({title:v("pay.paymentDocuments")+a.status_name,icon:"none"}):F()})).catch((()=>{}))}}),(e,a)=>{const t=I,u=p(m("u-image"),X),i=p(m("u-icon"),Y),c=j,d=p(m("u-button"),B),C=p(m("u-popup"),q);return l(),o(C,{show:s.value,round:10,onClose:A,closeable:!0,bgColor:"#fff",zIndex:"10081",closeOnClickOverlay:!1},{default:r((()=>[E.value?(l(),o(t,{key:0,class:"flex flex-col h-[75vh]"},{default:r((()=>[y(t,{class:"head"},{default:r((()=>[y(t,{class:"text-center py-[26rpx]"},{default:r((()=>[f(_(x(v)("pay.payTitle")),1)])),_:1}),y(t,{class:"flex items-end justify-center w-full text-xl font-bold py-[20rpx]"},{default:r((()=>[y(t,{class:"text-base mr-[4rpx]"},{default:r((()=>[f(_(x(v)("currency")),1)])),_:1}),f(" "+_(x(g)(E.value.money)),1)])),_:1})])),_:1}),y(c,{"scroll-y":"true",class:"flex-1 pt-[20rpx]"},{default:r((()=>[y(t,{class:"flex text-sm px-[30rpx] py-[20rpx]"},{default:r((()=>[y(t,{class:"text-gray-500"},{default:r((()=>[f(_(x(v)("pay.orderInfo")),1)])),_:1}),y(t,{class:"text-right flex-1 pl-[30rpx] truncate"},{default:r((()=>[f(_(E.value.body),1)])),_:1})])),_:1}),y(t,{class:"mx-[30rpx] py-[10rpx] px-[30rpx] bg-white rounded-md bg-page"},{default:r((()=>[E.value.pay_type_list.length?(l(!0),b(h,{key:0},S(E.value.pay_type_list,((e,a)=>(l(),o(t,{class:"pay-item py-[18rpx] flex items-center border-0 border-b border-solid border-[#eee]",key:a,onClick:a=>P.value=e.key},{default:r((()=>[y(u,{src:x(k)(e.icon),width:"50rpx",height:"50rpx"},null,8,["src"]),y(t,{class:"flex-1 px-[20rpx] text-sm font-bold"},{default:r((()=>[f(_(e.name),1)])),_:2},1024),e.key==P.value?(l(),o(i,{key:0,name:"checkbox-mark",color:"var(--primary-color)"})):w("v-if",!0)])),_:2},1032,["onClick"])))),128)):(l(),o(t,{key:1,class:"py-[20rpx] text-center text-sm text-gray-subtitle"},{default:r((()=>[f(_(x(v)("pay.notHavePayType")),1)])),_:1}))])),_:1})])),_:1}),y(t,{class:"p-[30rpx]"},{default:r((()=>[y(d,{type:"primary",loading:n.value,text:x(v)("pay.confirmPay"),shape:"circle",onClick:T},null,8,["loading","text"])])),_:1})])),_:1})):w("v-if",!0)])),_:1},8,["show"])}}}),[["__scopeId","data-v-1a623d68"]]),Q=L(n({__name:"balance",setup(e){const a=E(),t=i(!1),s=()=>{t.value=!0},n=()=>{t.value=!1},u=i([20,30,50,100,200,300]),c=i(""),j=i(!1),K=i(null),W=P({is_auto_transfer:0,is_auto_verify:0,is_open:0,min:0,rate:0,transfer_type:[]}),L=i(!0);T((()=>{F("checkIsReturnAfterPayment"),A().then((e=>{for(let a in e.data)W[a]=e.data[a];L.value=!1}))}));const X=()=>{uni.$u.test.isEmpty(c.value)?C({title:v("rechargeAmountPlaceholder"),icon:"none"}):!uni.$u.test.amount(c.value)||c.value<=0?C({title:v("rechargeAmountError"),icon:"none"}):j.value||(j.value=!0,D({recharge_money:c.value}).then((e=>{var a;null==(a=K.value)||a.open(e.data.trade_type,e.data.trade_id)})).catch((()=>{j.value=!1})))},Y=()=>{uni.setStorageSync("cashOutAccountType","money"),d({url:"/app/pages/member/apply_cash_out"})};return(e,i)=>{const C=p(m("u-loading-page"),z),E=I,P=O,T=p(m("u-button"),B),F=p(m("u--input"),Z),A=p(m("u-popup"),q),D=p(m("pay"),N);return l(),b(h,null,[y(C,{loading:L.value,loadingText:""},null,8,["loading"]),V(y(E,{class:"account-info-wrap"},{default:r((()=>[y(E,{class:"account-info-head",style:R({background:"url("+x(k)("static/resource/images/member/balance_bg.png")+") no-repeat 95% 30% / auto 250rpx, linear-gradient(314deg, #FE7849 0%, #FF1959 100%)"})},{default:r((()=>[y(E,{class:"name"},{default:r((()=>[f(_(x(v)("balanceInfo")),1)])),_:1}),y(E,{class:"content"},{default:r((()=>[y(E,{class:"money"},{default:r((()=>[f(_(x(a).info?x(g)((parseFloat(x(a).info.balance)+parseFloat(x(a).info.money)).toString()):"0.00"),1)])),_:1}),y(E,{class:"text"},{default:r((()=>[f(_(x(v)("accountBalance")),1)])),_:1}),y(E,{class:"money-wrap"},{default:r((()=>[y(E,{class:"money-item",onClick:i[0]||(i[0]=e=>x(d)({url:"/app/pages/member/detailed_account",param:{type:"balance"}}))},{default:r((()=>[y(E,{class:"money"},{default:r((()=>{var e;return[f(_(x(g)(null==(e=x(a).info)?void 0:e.balance)||"0.00"),1)]})),_:1}),y(E,{class:"text leading-none"},{default:r((()=>[f(_(x(v)("balance")),1)])),_:1})])),_:1}),y(E,{class:"money-item",onClick:i[1]||(i[1]=e=>x(d)({url:"/app/pages/member/detailed_account",param:{type:"money"}}))},{default:r((()=>[y(E,{class:"money"},{default:r((()=>{var e;return[f(_(x(g)(null==(e=x(a).info)?void 0:e.money)||"0.00"),1)]})),_:1}),y(E,{class:"text leading-none"},{default:r((()=>[f(_(x(v)("money")),1)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1},8,["style"]),y(E,{class:"account-info-btn"},{default:r((()=>[y(T,{type:"primary",shape:"circle",class:"btn",customStyle:{backgroundColor:"#FE4E50",color:"#fff",borderColor:"#FE4E50",width:"calc(100vw - 64rpx)"},onClick:s},{default:r((()=>[H("img",{class:"max-w-[36rpx] max-h-[36rpx] mr-1",src:x(k)("static/resource/images/member/reset.png"),alt:""},null,8,["src"]),y(P,null,{default:r((()=>[f(_(x(v)("recharge")),1)])),_:1})])),_:1},8,["customStyle"]),1==W.is_open?(l(),o(T,{key:0,type:"primary",plain:!0,shape:"circle",class:"btn",customStyle:{backgroundColor:"#fff",color:"#FE4E50",borderColor:"#FE4E50",width:"calc(100vw - 64rpx)"},onClick:Y},{default:r((()=>[H("img",{class:"max-w-[36rpx] max-h-[36rpx] mr-1",src:x(k)("static/resource/images/member/withdraw_deposit.png"),alt:""},null,8,["src"]),y(P,null,{default:r((()=>[f(_(x(v)("cashOut")),1)])),_:1})])),_:1},8,["customStyle"])):w("v-if",!0)])),_:1}),w(" 充值 "),y(A,{show:t.value,mode:"center",round:10,onClose:n,closeable:!0},{default:r((()=>[y(E,{class:"w-80 px-3 pb-4 pt-7 box-border"},{default:r((()=>[y(F,{placeholder:x(v)("rechargeAmountPlaceholder"),modelValue:c.value,"onUpdate:modelValue":i[2]||(i[2]=e=>c.value=e),border:"bottom",type:"number",clearable:""},null,8,["placeholder","modelValue"]),y(E,{class:"top-up-wrap flex flex-wrap justify-around mt-3"},{default:r((()=>[(l(!0),b(h,null,S(u.value,((e,a)=>(l(),o(E,{key:a,class:U(["top-up-item w-22 box-border border-1 text-center rounded mt-2 py-3 px-4 border-gray-400 border-solid",{"border-primary text-primary":c.value==e}]),onClick:a=>c.value=e},{default:r((()=>[y(P,null,{default:r((()=>[f(_(e)+_(x(v)("yuan")),1)])),_:2},1024)])),_:2},1032,["class","onClick"])))),128))])),_:1}),y(E,{class:"mt-5 px-2"},{default:r((()=>[y(T,{type:"primary",shape:"circle",loading:j.value,text:x(v)("clickRecharge"),onClick:X},null,8,["loading","text"])])),_:1}),y(E,{class:"mt-[20rpx] text-center text-sm",onClick:i[3]||(i[3]=e=>x(d)({url:"/app/pages/member/recharge_record"}))},{default:r((()=>[f(_(x(v)("rechargeRecord")),1)])),_:1})])),_:1})])),_:1},8,["show"]),y(D,{ref_key:"payRef",ref:K,onClose:i[4]||(i[4]=e=>j.value=!1)},null,512)])),_:1},512),[[$,!L.value]])],64)}}}),[["__scopeId","data-v-b51df219"]]);export{Q as default};