bindbox-game/build/resources/admin/assets/grant-reward-dialog-LD26CFdy.js
邹方成 6ee627139c
Some checks failed
Build docker and publish / linux (1.24.5) (push) Failing after 40s
feat: 新增支付测试小程序与微信支付集成
feat(pay): 添加支付API基础结构
feat(miniapp): 创建支付测试小程序页面与配置
feat(wechatpay): 配置微信支付参数与证书
fix(guild): 修复成员列表查询条件
docs: 更新代码规范文档与需求文档
style: 统一前后端枚举显示与注释格式
refactor(admin): 重构用户奖励发放接口参数处理
test(title): 添加称号效果参数验证测试
2025-11-17 00:42:08 +08:00

2 lines
5.7 KiB
JavaScript

var e=(e,i,t)=>new Promise((a,r)=>{var o=e=>{try{s(t.next(e))}catch(i){r(i)}},l=e=>{try{s(t.throw(e))}catch(i){r(i)}},s=e=>e.done?a(e.value):Promise.resolve(e.value).then(o,l);s((t=t.apply(e,i)).next())});import{d as i,a as t,r as a,w as r,y as o,f as l,z as s,p as d,e as m,F as n,G as p,h as u,m as c,l as v,O as f}from"./index-DBHnxsy6.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{f as j}from"./product-njVTTbuM.js";import{E as y,a as x}from"./index-zIv9y_XZ.js";import{E as _,a as g}from"./index-CHZ9Ls9_.js";import{E as h}from"./index-D2YpA_om.js";import{E as k}from"./index-B4jq9Ja2.js";import{E as b}from"./index-qSQlj0RO.js";import{E as w}from"./index-r0EsCkBw.js";import{E as q}from"./index-CtUPMuT5.js";import{_ as P}from"./_plugin-vue_export-helper-BCo6x5W8.js";import"./use-form-common-props-BOfz9xGR.js";import"./index-DZO7eApA.js";import"./index-MOpuiu9Z.js";import"./index-nZra831X.js";import"./use-form-item-ByasanrX.js";import"./_initCloneObject-7oWMW-Ot.js";import"./index-B99ckkYy.js";import"./index-sqhzrW2O.js";import"./token-DWNpOE8r.js";import"./scroll-Cceui3yC.js";import"./debounce-CkazOn_9.js";import"./_baseIteratee-DRiXPtOg.js";import"./index-BC2pRl3S.js";import"./vnode-CqxKQBn0.js";import"./index-CuWUnlSZ.js";import"./index-DfWQjCuY.js";import"./index-DeCbFeva.js";import"./use-dialog-yhiLZsn9.js";import"./index-DvlZWusB.js";import"./refs-Cw5r5QN8.js";const V={class:"flex items-center justify-between"},E={class:"font-medium"},I={class:"text-sm text-gray-500"},A=P(i({__name:"grant-reward-dialog",props:{visible:{type:Boolean},playerId:{}},emits:["update:visible","submit"],setup(i,{emit:P}){const A=i,C=P,z=t(),L=t(!1),U=t(!1),B=a({product_id:void 0,quantity:1,activity_id:void 0,reward_id:void 0,remark:""}),F=t([]);t([]),t([]);const M=t([]),G={product_id:[{required:!0,message:"请选择商品",trigger:"change"}],quantity:[{required:!0,message:"请输入发放数量",trigger:"blur"},{type:"number",min:1,max:100,message:"发放数量必须在1-100之间",trigger:"blur"}]},H=i=>e(this,null,function*(){U.value=!0;try{const e=(yield j({name:i||void 0,status:1,page:1,page_size:50})).list.map(e=>({id:e.id,name:e.name,price:e.price,stock:e.stock||0}));F.value=e,0===e.length?f.info(i?"未找到相关商品":"暂无可用商品"):f.success(`成功加载 ${e.length} 个商品`)}catch(e){const t=[{id:1,name:"iPhone 15 Pro",stock:100,price:9999},{id:2,name:"MacBook Air",stock:50,price:8999},{id:3,name:"AirPods Pro",stock:200,price:1999},{id:4,name:"iPad Air",stock:80,price:4399},{id:5,name:"Apple Watch",stock:150,price:2999},{id:6,name:"iPhone 15",stock:120,price:7999},{id:7,name:"MacBook Pro",stock:30,price:15999},{id:8,name:"AirPods Max",stock:75,price:4399}],a=i?t.filter(e=>e.name.toLowerCase().includes(i.toLowerCase())):t;F.value=a,f.warning("商品数据加载失败,使用演示数据")}finally{U.value=!1}}),O=()=>e(this,null,function*(){if(A.playerId)try{M.value=[]}catch(e){}}),D=()=>e(this,null,function*(){z.value&&A.playerId&&(yield z.value.validate(i=>e(this,null,function*(){if(i){L.value=!0;try{const e={product_id:B.product_id,quantity:B.quantity,activity_id:B.activity_id||void 0,reward_id:B.reward_id||void 0,remark:B.remark};C("submit",e),J()}catch(e){f.error(e.message||"奖励发放失败")}finally{L.value=!1}}})))}),J=()=>{C("update:visible",!1)},K=()=>{var e;null==(e=z.value)||e.resetFields(),B.quantity=1,B.activity_id=void 0,B.reward_id=void 0,B.remark="",F.value=[]};return r(()=>A.playerId,e=>{e&&(O(),H(""))},{immediate:!0}),r(()=>A.visible,e=>{e&&0===F.value.length&&H("")}),(e,t)=>{const a=h,r=g,f=_,j=x,P=k,A=b,M=y,O=w,R=q;return l(),o(R,{title:"给用户发放奖励","model-value":i.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>C("update:visible",e)),width:"600px","close-on-click-modal":!1,onClosed:K},{footer:s(()=>[d(O,{onClick:J},{default:s(()=>[...t[5]||(t[5]=[v("取消",-1)])]),_:1}),d(O,{type:"primary",loading:L.value,onClick:D},{default:s(()=>[...t[6]||(t[6]=[v(" 确认发放 ",-1)])]),_:1},8,["loading"])]),default:s(()=>[d(M,{ref_key:"formRef",ref:z,model:B,rules:G,"label-width":"100px",class:"reward-form"},{default:s(()=>[d(j,{label:"选择商品",prop:"product_id"},{default:s(()=>[d(f,{modelValue:B.product_id,"onUpdate:modelValue":t[0]||(t[0]=e=>B.product_id=e),placeholder:"请选择要发放的商品",filterable:"",remote:"","remote-method":H,loading:U.value,style:{width:"100%"}},{default:s(()=>[(l(!0),m(n,null,p(F.value,e=>(l(),o(r,{key:e.id,label:e.name,value:e.id},{default:s(()=>[u("div",V,[u("div",null,[u("div",E,c(e.name),1),u("div",I,"¥"+c(e.price),1)]),d(a,{size:"small",type:e.stock>0?"success":"danger"},{default:s(()=>[v(" 库存: "+c(e.stock||0),1)]),_:2},1032,["type"])])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1}),d(j,{label:"发放数量",prop:"quantity"},{default:s(()=>[d(P,{modelValue:B.quantity,"onUpdate:modelValue":t[1]||(t[1]=e=>B.quantity=e),min:1,max:100,"controls-position":"right",style:{width:"120px"}},null,8,["modelValue"]),t[4]||(t[4]=u("span",{class:"ml-2 text-sm text-gray-500"},"最多可发放100个",-1))]),_:1}),d(j,{label:"备注",prop:"remark"},{default:s(()=>[d(A,{modelValue:B.remark,"onUpdate:modelValue":t[2]||(t[2]=e=>B.remark=e),type:"textarea",rows:2,placeholder:"请输入发放备注(可选)",maxlength:"200","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}}),[["__scopeId","data-v-41e26f40"]]);export{A as default};