import{i as y,c as C}from"./app-a6cKceqE.js";import{_}from"./app-CignoBaV.js";import{P as w}from"./app-CberKKnC.js";import{_ as h}from"./app-Dm54XnL8.js";import{_ as g}from"./app-CQ-vNlMj.js";import{D as V}from"./app-7GBSHA5C.js";import{o as n,g as r,b as i,w as s,u as t,F as k,a as o,t as a,f as u,h as d,c as f}from"./app-BYcXwl4U.js";import"./app-CrjU8lgK.js";import"./app-Btbk6LWy.js";function b(){const{utils:p,Tea:e}=y(this);this.period="yearly",this.success=function(l){if(l.data.success){p.success("套餐购买成功",function(){window.location="/ns/plans"});return}l.data.orderCode.length>0&&(window.location="/finance/pay?code="+l.data.orderCode+"&from="+window.escape(window.location.toString())+"&returnURL=/ns/plans")},this.methodCode="@balance",this.changePayMethod=function(l){this.methodCode=l}}const x=o("h5",{class:"!mb-4"},"购买域名解析套餐",-1),P=["value"],S=o("td",{class:"title"},"套餐类型",-1),T=o("td",null,"付费周期",-1),v=o("td",null,"价格",-1),B={key:0},F={key:1},N=o("td",null,"有效期",-1),$={key:0},D={key:1},M=o("td",null,"支付方式",-1),G={__name:"buy",setup(p){const e=C(new b);return(l,c)=>(n(),r(k,null,[x,i(g,{action:"$",onSuccess:t(e).success},{default:s(()=>[o("input",{type:"hidden",name:"planId",value:t(e).plan.id},null,8,P),i(V,null,{default:s(()=>[o("tbody",null,[o("tr",null,[S,o("td",null,[o("strong",null,a(t(e).plan.name),1)])]),o("tr",null,[T,o("td",null,[i(h,{name:"period",value:"yearly",modelValue:t(e).period,"onUpdate:modelValue":c[0]||(c[0]=m=>t(e).period=m)},{default:s(()=>[u("按年")]),_:1},8,["modelValue"]),u("     "),i(h,{name:"period",value:"monthly",modelValue:t(e).period,"onUpdate:modelValue":c[1]||(c[1]=m=>t(e).period=m)},{default:s(()=>[u("按月")]),_:1},8,["modelValue"])])]),o("tr",null,[v,o("td",null,[t(e).period=="yearly"?(n(),r("span",B,"￥"+a(t(e).plan.yearlyPrice)+"元/年",1)):d("",!0),t(e).period=="monthly"?(n(),r("span",F,"￥"+a(t(e).plan.monthlyPrice)+"元/月",1)):d("",!0)])]),o("tr",null,[N,o("td",null,[t(e).period=="yearly"?(n(),r("span",$,a(t(e).plan.yearFrom)+" 到 "+a(t(e).plan.yearTo),1)):d("",!0),t(e).period=="monthly"?(n(),r("span",D,a(t(e).plan.monthFrom)+" 到 "+a(t(e).plan.monthTo),1)):d("",!0)])]),o("tr",null,[M,o("td",null,[i(w,{onChange:t(e).changePayMethod},null,8,["onChange"])])])])]),_:1}),t(e).methodCode=="@balance"?(n(),f(_,{key:0},{default:s(()=>[u("确定使用余额购买")]),_:1})):d("",!0),t(e).methodCode!="@balance"?(n(),f(_,{key:1},{default:s(()=>[u("下一步")]),_:1})):d("",!0)]),_:1},8,["onSuccess"])],64))}};export{G as default};
