1 |
- import{a0 as a,c as s,y as e,o as t,s as l,e as o,f as r,w as n,bA as d,bB as c,l as u,j as p,t as i,u as f,v as y,k as m,r as b,F as _,B as x,M as h,E as g,i as I,ae as v,G as S,m as w,g as $,x as k,H as T,I as j}from"./index-b48a414d.js";import{f as M,u as B,_ as F}from"./s-layout.d6dcdc81.js";import{_ as G}from"./_plugin-vue_export-helper.1b428a4d.js";import"./phone-international-input.feef99c7.js";const O=s=>a({url:"/pay/channel/get-enable-code-list",method:"GET",params:{appId:s}}),W=G({__name:"index",setup(a){const G=s((()=>l.$store("user").userWallet)),W=e({orderType:"goods",orderInfo:{},payStatus:0,payMethods:[],payment:""}),A=()=>{""!==W.payment?"wallet"===W.payment?h({title:"提示",content:"确定要支付吗?",success:function(a){a.confirm&&l.$platform.pay(W.payment,W.orderType,W.orderInfo.id)}}):l.$platform.pay(W.payment,W.orderType,W.orderInfo.id):l.$helper.toast("请选择支付方式")},C=s((()=>{if(2===W.payStatus)return"该订单已支付";if(1===W.payStatus){const a=B(W.orderInfo.expireTime);return a.ms<=0?(W.payStatus=-1,""):`剩余支付时间 ${a.h}:${a.m}:${a.s} `}return-2===W.payStatus?"未查询到支付单信息":""}));function E(){10!==W.orderInfo.status&&20!==W.orderInfo.status?30!==W.orderInfo.status?W.payStatus=1:W.payStatus=-1:W.payStatus=2}function P(a){W.payment=a.detail.value}async function H(){const{data:a,code:s}=await O(W.orderInfo.appId);0===s&&(W.payMethods=c(a))}return t((a=>{if("WechatOfficialAccount"===l.$platform.name&&"ios"===l.$platform.os&&!l.$platform.landingPage.includes("pages/pay/index"))return void location.reload();console.log(a);let s=a.id;a.orderType&&(W.orderType=a.orderType),2==a.openType?async function(a){const{data:s,code:e}=await d.getPayOrder(a);0===e&&s?(W.orderInfo=s,await H(),E()):W.payStatus=-2}(s):(console.log(123),async function(a){const{data:s,code:e}=await d.getOrder(a);0===e&&s?(W.orderInfo=s,await H(),E()):W.payStatus=-2}(s)),l.$store("user").getWallet()})),(a,s)=>{const e=g,t=I,d=k,c=T,h=j,B=v,O=S,E=u(w("s-layout"),F);return o(),r(E,{title:"收银台"},{default:n((()=>[p(t,{class:"bg-white ss-modal-box ss-flex-col"},{default:n((()=>[p(t,{class:"modal-header ss-flex-col ss-col-center ss-row-center"},{default:n((()=>[p(t,{class:"money-box ss-m-b-20"},{default:n((()=>[p(e,{class:"money-text"},{default:n((()=>[i(f(y(M)(W.orderInfo.price)),1)])),_:1})])),_:1}),p(t,{class:"time-text"},{default:n((()=>[p(e,null,{default:n((()=>[i(f(C.value),1)])),_:1})])),_:1})])),_:1}),p(t,{class:"modal-content ss-flex-1"},{default:n((()=>[p(t,{class:"pay-title ss-p-l-30 ss-m-y-30"},{default:n((()=>[i("选择支付方式")])),_:1}),p(B,{onChange:P},{default:n((()=>[(o(!0),m(_,null,b(W.payMethods,(a=>(o(),r(h,{class:"pay-type-item",key:a.title},{default:n((()=>[p(t,{class:x(["pay-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom",{"disabled-pay-item":a.disabled}])},{default:n((()=>[p(t,{class:"ss-flex ss-col-center"},{default:n((()=>[a.disabled?(o(),r(d,{key:0,class:"pay-icon",src:y(l).$url.static("/static/img/shop/pay/cod_disabled.png"),mode:"aspectFit"},null,8,["src"])):(o(),r(d,{key:1,class:"pay-icon",src:y(l).$url.static(a.icon),mode:"aspectFit"},null,8,["src"])),p(e,{class:"pay-title"},{default:n((()=>[i(f(a.title),1)])),_:2},1024)])),_:2},1024),p(t,{class:"check-box ss-flex ss-col-center ss-p-l-10"},{default:n((()=>["wallet"===a.value?(o(),r(t,{key:0,class:"userInfo-money ss-m-r-10"},{default:n((()=>[i(" 余额: "+f(y(M)(G.value.balance))+"元 ",1)])),_:1})):$("",!0),p(c,{value:a.value,color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},disabled:a.disabled,checked:W.payment===a.value},null,8,["value","disabled","checked"])])),_:2},1024)])),_:2},1032,["class"])])),_:2},1024)))),128))])),_:1})])),_:1}),p(t,{class:"modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40"},{default:n((()=>[0===W.payStatus?(o(),r(O,{key:0,class:"ss-reset-button past-due-btn"},{default:n((()=>[i(" 检测支付环境中 ")])),_:1})):-1===W.payStatus?(o(),r(O,{key:1,class:"ss-reset-button past-due-btn",disabled:""},{default:n((()=>[i(" 支付已过期 ")])),_:1})):(o(),r(O,{key:2,class:x(["ss-reset-button save-btn",{"disabled-btn":1!==W.payStatus}]),onClick:A,disabled:1!==W.payStatus},{default:n((()=>[i(" 立即支付 ")])),_:1},8,["disabled","class"]))])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-7b71f260"]]);export{W as default};
|