mirror of
https://github.com/vastxie/99AI.git
synced 2024-11-16 03:32:42 +08:00
2 lines
6.2 KiB
JavaScript
2 lines
6.2 KiB
JavaScript
import{f as U}from"./crami-99ee44eb.js";import{f as F}from"./order-8be5c617.js";import{_ as X}from"./titleBar.vue_vue_type_script_setup_true_lang-a53d5875.js";import{_ as Y}from"./index.vue_vue_type_script_setup_true_lang-f425914e.js";import{a as K,u as Z,t as o}from"./index-d64a7cc4.js";import{u as ee}from"./useBasicLayout-a4f17bae.js";import{d as ae,e as d,r as w,f as te,U as c,X as r,M as e,a8 as M,a3 as a,W as k,H as P,F as B,a6 as j,a5 as m,S as f,a4 as l,c as se}from"./vue-10b4afc0.js";import{e as oe,Y as le,X as W,v,B as E}from"./naive-ui-fedd20b1.js";import"./vueuse-motion-d4cdaf7b.js";const ne={class:"main min-h-screen bg-center h-full flex flex-col overflow-hidden bg-white dark:bg-gray-900"},re={key:0,class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-x-6 gap-y-10 px-4"},ie=["onClick"],de={class:"w-full rounded-t-xl overflow-hidden border dark:border-[#ffffff17] relative",style:{height:"40%"}},ce=["src"],fe={class:"absolute left-1/2 bottom-0 transform -translate-x-1/2 -translate-y-1/2 text-lg text-[#fff] ]"},ue={class:"p-5 text-lg h-[160px] border-b dark:border-[#ffffff17] overflow-hidden relative"},pe={class:"absolute bottom-1 right-2 font-semibold text-red-500 italic"},ye={class:"flex p-4 border-b dark:border-[#ffffff17] flex-col space-y-4"},ge={key:0,class:"flex justify-between"},me={key:1,class:"flex justify-between"},he={key:2,class:"flex justify-between"},xe={class:"px-4 flex-1 flex items-center justify-between"},ve={class:"flex items-end"},_e={class:"ml-2 text-[#3076fd] text-lg"},be=a("div",{class:"line"},null,-1),we={key:1,class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-x-6 gap-y-10 px-4"},ke={class:"w-full rounded-t-xl overflow-hidden",style:{height:"40%"}},Ne={class:"p-5 text-lg h-[160px] border-b dark:border-[#ffffff17] overflow-ellipsis"},Se={class:"flex p-4 border-b dark:border-[#ffffff17] flex-col space-y-4"},Ce={class:"px-4 flex-1 flex items-center justify-between"},Je=ae({__name:"index",setup(Me){const i=K(),{isMobile:y}=ee(),_=oe(),h=Z(),T=d(()=>{var n;const t=window.navigator.userAgent.toLowerCase();return t.match(/MicroMessenger/i)&&((n=t==null?void 0:t.match(/MicroMessenger/i))==null?void 0:n[0])==="micromessenger"}),u=d(()=>{const{payHupiStatus:t,payEpayStatus:n,payMpayStatus:s,payWechatStatus:p,payLtzfStatus:b}=i.globalConfig;return Number(p)===1?"wechat":Number(s)===1?"mpay":Number(t)===1?"hupi":Number(n)===1?"epay":Number(b)===1?"ltzf":null}),D=d(()=>i.globalConfig.model3Name||o("pay.baseModelQuota")),H=d(()=>i.globalConfig.model4Name)||o("pay.advancedModelQuota"),I=d(()=>i.globalConfig.drawMjName)||o("pay.MJDrawingQuota"),J=d(()=>Number(i.globalConfig.isHideModel3Point)===1),L=d(()=>Number(i.globalConfig.isHideModel4Point)===1),z=d(()=>Number(i.globalConfig.isHideDrawMjPoint)===1),G=d(()=>{const{payEpayChannel:t,payMpayChannel:n}=i.globalConfig;return u.value==="wechat"?["wxpay"]:u.value==="epay"?t?JSON.parse(t):[]:u.value==="mpay"?n?JSON.parse(n):[]:u.value==="hupi"?["wxpay"]:u.value==="ltzf"?["wxpay"]:[]}),N=w([]),S=w(1),g=w(!1);async function C(){try{g.value=!0;const t=await U({status:1,type:S.value,size:30});N.value=t.data.rows,g.value=!1}catch{g.value=!1}}const O=d(()=>y.value?o("pay.welcomeTipMobile"):o("pay.welcomeTipDesktop"));function A(t){S.value=t,C()}async function R(t){G.value.length||_.warning(o("pay.paymentNotEnabled")),V(t)}async function V(t){if(T.value&&u.value==="wechat"&&Number(i.globalConfig.payWechatStatus)===1){if(typeof WeixinJSBridge>"u")document.addEventListener?document.addEventListener("WeixinJSBridgeReady",x,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",x),document.attachEvent("onWeixinJSBridgeReady",x));else{const n=await F({goodsId:t.id,payType:"jsapi"}),{success:s,data:p}=n;s&&x(p)}return}h.updateOrderInfo({pkgInfo:t}),h.updateGoodsDialog(!1),h.updatePayDialog(!0)}function x(t){const{appId:n,timeStamp:s,nonceStr:p,package:b,signType:$,paySign:q}=t;n&&WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:n,timeStamp:s,nonceStr:p,package:b,signType:$,paySign:q},Q=>{Q.err_msg==="get_brand_wcpay_request:ok"?(_.success(o("pay.purchaseSuccess")),setTimeout(()=>{i.getUserInfo(),h.updateGoodsDialog(!1)},500)):_.warning(o("pay.paymentNotComplete"))})}return te(()=>{C()}),(t,n)=>(f(),c("div",ne,[r(e(X),{title:e(o)("pay.membershipMarket"),des:O.value,class:M([e(y)?"px-3":"px-24"])},null,8,["title","des","class"]),a("div",{class:"flex justify-center items-center",style:P({height:e(y)?"60px":"180px"})},[r(e(le),{type:"segment",style:P({width:e(y)?"90%":"400px"}),"onUpdate:value":A},{default:k(()=>[r(e(W),{name:1,tab:e(o)("pay.memberPackage")},null,8,["tab"]),r(e(W),{name:-1,tab:e(o)("pay.permanentAddOnCard")},null,8,["tab"])]),_:1},8,["style"])],4),a("div",{class:M(["flex-1 pb-10 overflow-y-auto",[e(y)?"px-3":"px-28"]])},[g.value?m("",!0):(f(),c("div",re,[(f(!0),c(B,null,j(N.value,s=>(f(),c("div",{key:s.id,class:"border dark:border-[#ffffff17] h-[580px] rounded-xl card-item flex flex-col",onClick:p=>R(s)},[a("div",de,[a("img",{src:s.coverImg,class:"object-cover w-full h-full cover",alt:""},null,8,ce),a("div",fe,l(s.name),1)]),a("div",ue,[se(l(s.des)+" ",1),a("span",pe,"¥"+l(s.price),1)]),a("div",ye,[J.value?m("",!0):(f(),c("div",ge,[a("span",null,l(D.value),1),a("span",null,l(s.model3Count||0)+" "+l(e(o)("pay.points")),1)])),L.value?m("",!0):(f(),c("div",me,[a("span",null,l(e(H)),1),a("span",null,l(s.model4Count||0)+" "+l(e(o)("pay.points")),1)])),z.value?m("",!0):(f(),c("div",he,[a("span",null,l(e(I)),1),a("span",null,l(s.drawMjCount||0)+" "+l(e(o)("pay.points")),1)]))]),a("div",xe,[a("div",ve,[a("span",null,l(e(o)("pay.packageValidity")),1),a("span",_e,l(s.days>0?`${s.days} ${e(o)("pay.days")}`:e(o)("pay.permanent")),1)]),be,a("div",null,[r(e(Y),{class:"text-lg right-icon",icon:"bi:arrow-right"})])])],8,ie))),128))])),g.value?(f(),c("div",we,[(f(),c(B,null,j(4,s=>a("div",{key:s,class:"border dark:border-[#ffffff17] h-[580px] rounded-xl card-item flex flex-col"},[a("div",ke,[r(e(v),{height:"100%",width:"100%"})]),a("div",Ne,[r(e(E),{vertical:""},{default:k(()=>[r(e(v),{text:"",repeat:4,width:"100%",sharp:!1})]),_:1})]),a("div",Se,[r(e(E),{vertical:""},{default:k(()=>[r(e(v),{text:"",repeat:4,width:"100%",sharp:!1})]),_:1})]),a("div",Ce,[r(e(v),{text:"",repeat:1,width:"100%",sharp:!1})])])),64))])):m("",!0)],2)]))}});export{Je as default};
|