"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BB7fFseo.cjs"),f=require("./SetpayModal-Bw5EnINg.cjs"),o=l=>(e.pushScopeId("data-v-9607f689"),l=l(),e.popScopeId(),l),h={class:"panel-box"},y=o(()=>e.createBaseVNode("div",{class:"box-title"},"支付方式",-1)),x=o(()=>e.createBaseVNode("div",{class:"tip-text"},"表单添加商品字段时，可以配置支付方式完成收款。",-1)),V={class:"box-row"},B={key:0,class:"flex flex-col"},N=o(()=>e.createBaseVNode("span",{style:{color:"#1aad19"},class:"box-text flex gap-2"},[e.createBaseVNode("i",{style:{color:"#1aad19","font-size":"18px"},class:"iconfont icon-form-weixinzhifu"}),e.createTextVNode("微信支付")],-1)),S={class:"box-text"},b={key:1,class:"flex flex-col"},k=o(()=>e.createBaseVNode("span",{class:"box-text"},"人民币(CNY)",-1)),w=o(()=>e.createBaseVNode("span",{class:"box-text"},"无需支付仅展示商品价格",-1)),F=[k,w],C={class:"setting-text"},E=["src"],I={class:"panel-box"},M=o(()=>e.createBaseVNode("div",{class:"box-title"},"设置交易超时规则",-1)),P=o(()=>e.createBaseVNode("div",{class:"tip-text"},"设置交易超时规则，买家逾期未付款，平台将在设定的时间关闭交易， 此规则仅对在线支付的商品或可支付预约生效。",-1)),O={class:"box-row"},T={style:{"margin-left":"4px"}},U={key:0,class:"flex flex-col gap-4"},q=o(()=>e.createBaseVNode("div",{class:"divide"},null,-1)),z=o(()=>e.createBaseVNode("div",null,"设置超时时间",-1)),D={class:"flex flex-row items-center",style:{gap:"8px"}},j=o(()=>e.createBaseVNode("div",null,"分钟后，将关闭交易、恢复库存",-1)),A=o(()=>e.createBaseVNode("div",{class:"divide"},null,-1)),L=e.defineComponent({__name:"PayMethod",setup(l){const c=e.ref(!1),s=e.ref(e.FormSetting.value.pay_setting.trade_is_over==1),i=e.ref(e.FormSetting.value.pay_setting.trade_overtime),d=e.computed({get:()=>e.FormSetting.value.pay_setting.is_pay,set:()=>{}}),p=e.computed({get:()=>e.FormSetting.value.pay_setting.mch_config_name,set:()=>{}}),r=()=>{c.value=!0},u=[{value:600,label:"10"},{value:1200,label:"20"},{value:1800,label:"30"}],v=()=>{c.value=!1},m=t=>{t||_()},_=async()=>{e.FormSetting.value.pay_setting.trade_is_over=s.value?1:0,e.FormSetting.value.pay_setting.trade_overtime=i.value,await e.updateSetting()&&e.message.success("保存设置成功")},g=t=>{console.debug(t),e.FormSetting.value.pay_setting.pappid=t.pappid,e.FormSetting.value.pay_setting.is_pay=t.is_pay,e.FormSetting.value.pay_setting.mch_config_id=t.mch_config_id,e.FormSetting.value.pay_setting.mch_config_name=t.mch_config_name,e.FormSetting.value.pay_setting.pay_appid=t.pay_appid,e.FormSetting.value.crown_setting.isCollectInfo.pappid=t.pappid,e.FormSetting.value.crown_setting.isCollectInfo.collectAccountId=t.mch_config_id,e.updateSetting()};return(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createBaseVNode("section",null,[e.createBaseVNode("div",h,[y,x,e.createBaseVNode("div",V,[d.value==null?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:r,class:"set-pay-button"},[e.createVNode(e.unref(e.ElIcon),{class:"plus-icon mr-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.plus_default))]),_:1}),e.createTextVNode(" 设置支付方式 ")])):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:r,class:"view-pay-button"},[d.value==1?(e.openBlock(),e.createElementBlock("div",B,[N,e.createBaseVNode("span",S,e.toDisplayString(p.value),1)])):(e.openBlock(),e.createElementBlock("div",b,F)),e.createBaseVNode("div",C,[e.createBaseVNode("img",{style:{width:"14px"},src:e.unref(e.getImageUrl)("images/widget/gain-edit-icon.png")},null,8,E),e.createTextVNode("更改配置 ")])]))])]),e.createBaseVNode("div",I,[M,P,e.createBaseVNode("div",O,[e.createVNode(e.unref(e.ElSwitch),{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=a=>s.value=a),onChange:m},null,8,["modelValue"]),e.createBaseVNode("span",T,e.toDisplayString(s.value?"已开启":"已关闭"),1),s.value?(e.openBlock(),e.createElementBlock("div",U,[q,z,e.createBaseVNode("div",D,[e.createVNode(e.unref(e.ElSelect),{modelValue:i.value,"onUpdate:modelValue":n[1]||(n[1]=a=>i.value=a),placeholder:"超时时间",style:{width:"120px"}},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,a=>e.createVNode(e.unref(e.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),j]),A,e.createVNode(e.unref(e.ElButton),{class:"button",type:"primary",onClick:_},{default:e.withCtx(()=>[e.createTextVNode(" 保存设置 ")]),_:1})])):e.createCommentVNode("",!0)])])]),e.createVNode(f.SetpayModal,{visible:c.value,onSetPay:g,onClose:v},null,8,["visible"])],64))}}),Y=e._export_sfc(L,[["__scopeId","data-v-9607f689"]]);exports.default=Y;
