HaniBlindBox/server/HoneyBox/src/HoneyBox.Admin/wwwroot/assets/AppSettingCard-Dri2ZHU9.js
2026-01-19 00:09:38 +08:00

2 lines
10 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{d as q,r as v,a as A,o as B,g as d,J as E,K as j,z,k as g,w as n,e,t as c,b as i,c as w,H as U,l as H,N as J,E as b,_ as K}from"./index-C-IfdMnF.js";import{k as O,l as T}from"./config-DZcyKGh8.js";const F={class:"card-header"},G={class:"icon-input-wrapper"},P={key:0,class:"icon-preview"},Q={class:"icon-input-wrapper"},W={key:0,class:"icon-preview"},X={class:"icon-input-wrapper"},Y={key:0,class:"icon-preview"},Z=q({__name:"AppSettingCard",setup($){const y=v(!1),x=v(!1),h=v(),a=A({app_name:"",purchase_popup:"1",exchange_times:0,balance_name:"余额",balance_icon:"",currency1_name:"钻石",currency1_icon:"",currency2_name:"UU币",currency2_icon:"",win_audio:"",version:"1.0.0",sign_threshold:0,exchange_show_threshold:0,takeout_box_id:0,daily_free_draw_id:0,box_exchange_limit:0,daily_coupon_limit:0}),N={app_name:[{required:!0,message:"请输入项目名称",trigger:"blur"},{max:50,message:"项目名称不能超过50个字符",trigger:"blur"}],balance_name:[{required:!0,message:"请输入余额名称",trigger:"blur"}],currency1_name:[{required:!0,message:"请输入货币1名称",trigger:"blur"}],currency2_name:[{required:!0,message:"请输入货币2名称",trigger:"blur"}]},S=async()=>{var p;y.value=!0;try{const l=await O();if((p=l.data)!=null&&p.value){const t=l.data.value;Object.assign(a,{app_name:t.app_name||"",purchase_popup:t.purchase_popup||"1",exchange_times:Number(t.exchange_times)||0,balance_name:t.balance_name||"余额",balance_icon:t.balance_icon||"",currency1_name:t.currency1_name||"钻石",currency1_icon:t.currency1_icon||"",currency2_name:t.currency2_name||"UU币",currency2_icon:t.currency2_icon||"",win_audio:t.win_audio||"",version:t.version||"1.0.0",sign_threshold:Number(t.sign_threshold)||0,exchange_show_threshold:Number(t.exchange_show_threshold)||0,takeout_box_id:Number(t.takeout_box_id)||0,daily_free_draw_id:Number(t.daily_free_draw_id)||0,box_exchange_limit:Number(t.box_exchange_limit)||0,daily_coupon_limit:Number(t.daily_coupon_limit)||0})}}catch(l){b.error("加载应用设置失败"),console.error("加载应用设置失败:",l)}finally{y.value=!1}},D=async()=>{if(h.value){try{await h.value.validate()}catch{b.warning("请检查表单填写是否正确");return}x.value=!0;try{const p={app_name:a.app_name,purchase_popup:a.purchase_popup,exchange_times:String(a.exchange_times),balance_name:a.balance_name,balance_icon:a.balance_icon,currency1_name:a.currency1_name,currency1_icon:a.currency1_icon,currency2_name:a.currency2_name,currency2_icon:a.currency2_icon,win_audio:a.win_audio,version:a.version,sign_threshold:String(a.sign_threshold),exchange_show_threshold:String(a.exchange_show_threshold),takeout_box_id:String(a.takeout_box_id),daily_free_draw_id:String(a.daily_free_draw_id),box_exchange_limit:String(a.box_exchange_limit),daily_coupon_limit:String(a.daily_coupon_limit)};await T(p),b.success("保存成功")}catch(p){b.error("保存失败"),console.error("保存应用设置失败:",p)}finally{x.value=!1}}};return B(()=>{S()}),(p,l)=>{const t=d("el-icon"),M=d("el-button"),f=d("el-divider"),_=d("el-input"),r=d("el-form-item"),u=d("el-col"),s=d("el-row"),k=d("el-radio"),R=d("el-radio-group"),m=d("el-input-number"),V=d("el-image"),C=d("el-form"),I=d("el-card"),L=E("loading");return j((g(),z(I,null,{header:n(()=>[i("div",F,[l[18]||(l[18]=i("span",null,"应用设置",-1)),e(M,{type:"primary",loading:x.value,onClick:D},{default:n(()=>[e(t,null,{default:n(()=>[e(H(J))]),_:1}),l[17]||(l[17]=c("保存配置 ",-1))]),_:1},8,["loading"])])]),default:n(()=>[e(C,{ref_key:"formRef",ref:h,model:a,rules:N,"label-width":"140px",class:"config-form"},{default:n(()=>[e(f,{"content-position":"left"},{default:n(()=>[...l[19]||(l[19]=[c("基本信息",-1)])]),_:1}),e(s,{gutter:24},{default:n(()=>[e(u,{span:12},{default:n(()=>[e(r,{label:"项目名称",prop:"app_name"},{default:n(()=>[e(_,{modelValue:a.app_name,"onUpdate:modelValue":l[0]||(l[0]=o=>a.app_name=o),placeholder:"请输入项目名称",maxlength:"50"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:12},{default:n(()=>[e(r,{label:"小程序版本号",prop:"version"},{default:n(()=>[e(_,{modelValue:a.version,"onUpdate:modelValue":l[1]||(l[1]=o=>a.version=o),placeholder:"请输入版本号,如 1.0.0",maxlength:"20"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(s,{gutter:24},{default:n(()=>[e(u,{span:12},{default:n(()=>[e(r,{label:"购买弹窗设置",prop:"purchase_popup"},{default:n(()=>[e(R,{modelValue:a.purchase_popup,"onUpdate:modelValue":l[2]||(l[2]=o=>a.purchase_popup=o)},{default:n(()=>[e(k,{value:"1"},{default:n(()=>[...l[20]||(l[20]=[c("弹出一次",-1)])]),_:1}),e(k,{value:"2"},{default:n(()=>[...l[21]||(l[21]=[c("每天显示",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(u,{span:12},{default:n(()=>[e(r,{label:"商城购买次数",prop:"exchange_times"},{default:n(()=>[e(m,{modelValue:a.exchange_times,"onUpdate:modelValue":l[3]||(l[3]=o=>a.exchange_times=o),modelModifiers:{number:!0},min:0,max:999,placeholder:"每日购买限制",style:{width:"100%"}},null,8,["modelValue"]),l[22]||(l[22]=i("div",{class:"form-tip"},"每日商城购买次数限制0表示不限制",-1))]),_:1})]),_:1})]),_:1}),e(f,{"content-position":"left"},{default:n(()=>[...l[23]||(l[23]=[c("货币配置",-1)])]),_:1}),e(s,{gutter:24},{default:n(()=>[e(u,{span:12},{default:n(()=>[e(r,{label:"余额名称",prop:"balance_name"},{default:n(()=>[e(_,{modelValue:a.balance_name,"onUpdate:modelValue":l[4]||(l[4]=o=>a.balance_name=o),placeholder:"请输入余额名称",maxlength:"20"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:12},{default:n(()=>[e(r,{label:"余额图标",prop:"balance_icon"},{default:n(()=>[i("div",G,[e(_,{modelValue:a.balance_icon,"onUpdate:modelValue":l[5]||(l[5]=o=>a.balance_icon=o),placeholder:"请输入图标URL"},null,8,["modelValue"]),a.balance_icon?(g(),w("div",P,[e(V,{src:a.balance_icon,fit:"contain"},null,8,["src"])])):U("",!0)])]),_:1})]),_:1})]),_:1}),e(s,{gutter:24},{default:n(()=>[e(u,{span:12},{default:n(()=>[e(r,{label:"货币1名称",prop:"currency1_name"},{default:n(()=>[e(_,{modelValue:a.currency1_name,"onUpdate:modelValue":l[6]||(l[6]=o=>a.currency1_name=o),placeholder:"请输入货币1名称",maxlength:"20"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:12},{default:n(()=>[e(r,{label:"货币1图标",prop:"currency1_icon"},{default:n(()=>[i("div",Q,[e(_,{modelValue:a.currency1_icon,"onUpdate:modelValue":l[7]||(l[7]=o=>a.currency1_icon=o),placeholder:"请输入图标URL"},null,8,["modelValue"]),a.currency1_icon?(g(),w("div",W,[e(V,{src:a.currency1_icon,fit:"contain"},null,8,["src"])])):U("",!0)])]),_:1})]),_:1})]),_:1}),e(s,{gutter:24},{default:n(()=>[e(u,{span:12},{default:n(()=>[e(r,{label:"货币2名称",prop:"currency2_name"},{default:n(()=>[e(_,{modelValue:a.currency2_name,"onUpdate:modelValue":l[8]||(l[8]=o=>a.currency2_name=o),placeholder:"请输入货币2名称",maxlength:"20"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:12},{default:n(()=>[e(r,{label:"货币2图标",prop:"currency2_icon"},{default:n(()=>[i("div",X,[e(_,{modelValue:a.currency2_icon,"onUpdate:modelValue":l[9]||(l[9]=o=>a.currency2_icon=o),placeholder:"请输入图标URL"},null,8,["modelValue"]),a.currency2_icon?(g(),w("div",Y,[e(V,{src:a.currency2_icon,fit:"contain"},null,8,["src"])])):U("",!0)])]),_:1})]),_:1})]),_:1}),e(f,{"content-position":"left"},{default:n(()=>[...l[24]||(l[24]=[c("音频配置",-1)])]),_:1}),e(s,{gutter:24},{default:n(()=>[e(u,{span:24},{default:n(()=>[e(r,{label:"中奖音频",prop:"win_audio"},{default:n(()=>[e(_,{modelValue:a.win_audio,"onUpdate:modelValue":l[10]||(l[10]=o=>a.win_audio=o),placeholder:"请输入中奖音频URL"},null,8,["modelValue"]),l[25]||(l[25]=i("div",{class:"form-tip"},"用户中奖时播放的音频文件URL",-1))]),_:1})]),_:1})]),_:1}),e(f,{"content-position":"left"},{default:n(()=>[...l[26]||(l[26]=[c("限制配置",-1)])]),_:1}),e(s,{gutter:24},{default:n(()=>[e(u,{span:12},{default:n(()=>[e(r,{label:"签到消费门槛",prop:"sign_threshold"},{default:n(()=>[e(m,{modelValue:a.sign_threshold,"onUpdate:modelValue":l[11]||(l[11]=o=>a.sign_threshold=o),modelModifiers:{number:!0},min:0,max:99999,placeholder:"请输入签到消费门槛",style:{width:"100%"}},null,8,["modelValue"]),l[27]||(l[27]=i("div",{class:"form-tip"},"用户需消费达到此金额才能签到",-1))]),_:1})]),_:1}),e(u,{span:12},{default:n(()=>[e(r,{label:"兑换按钮门槛",prop:"exchange_show_threshold"},{default:n(()=>[e(m,{modelValue:a.exchange_show_threshold,"onUpdate:modelValue":l[12]||(l[12]=o=>a.exchange_show_threshold=o),modelModifiers:{number:!0},min:0,max:99999,placeholder:"请输入显示门槛",style:{width:"100%"}},null,8,["modelValue"]),l[28]||(l[28]=i("div",{class:"form-tip"},"达到此金额显示兑换达达券按钮",-1))]),_:1})]),_:1})]),_:1}),e(s,{gutter:24},{default:n(()=>[e(u,{span:12},{default:n(()=>[e(r,{label:"外卖盒子ID",prop:"takeout_box_id"},{default:n(()=>[e(m,{modelValue:a.takeout_box_id,"onUpdate:modelValue":l[13]||(l[13]=o=>a.takeout_box_id=o),modelModifiers:{number:!0},min:0,max:999999,placeholder:"请输入外卖盒子ID",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:12},{default:n(()=>[e(r,{label:"每日免费抽奖ID",prop:"daily_free_draw_id"},{default:n(()=>[e(m,{modelValue:a.daily_free_draw_id,"onUpdate:modelValue":l[14]||(l[14]=o=>a.daily_free_draw_id=o),modelModifiers:{number:!0},min:0,max:999999,placeholder:"请输入每日免费抽奖ID",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(s,{gutter:24},{default:n(()=>[e(u,{span:12},{default:n(()=>[e(r,{label:"盒柜兑换次数",prop:"box_exchange_limit"},{default:n(()=>[e(m,{modelValue:a.box_exchange_limit,"onUpdate:modelValue":l[15]||(l[15]=o=>a.box_exchange_limit=o),modelModifiers:{number:!0},min:0,max:999,placeholder:"请输入盒柜兑换次数限制",style:{width:"100%"}},null,8,["modelValue"]),l[29]||(l[29]=i("div",{class:"form-tip"},"盒柜每日兑换次数限制0表示不限制",-1))]),_:1})]),_:1}),e(u,{span:12},{default:n(()=>[e(r,{label:"每天优惠券次数",prop:"daily_coupon_limit"},{default:n(()=>[e(m,{modelValue:a.daily_coupon_limit,"onUpdate:modelValue":l[16]||(l[16]=o=>a.daily_coupon_limit=o),modelModifiers:{number:!0},min:0,max:999,placeholder:"请输入每天优惠券次数",style:{width:"100%"}},null,8,["modelValue"]),l[30]||(l[30]=i("div",{class:"form-tip"},"每天可使用优惠券次数限制",-1))]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})),[[L,y.value]])}}}),ae=K(Z,[["__scopeId","data-v-4d2399a1"]]);export{ae as default};