import{d as F,r as f,a as w,o as q,g as s,J as E,c as H,k as b,e as a,w as t,K as J,f as C,t as u,l as S,O as M,s as O,z as x,x as d,b as r,H as W,_ as G}from"./index-CUnFTKV2.js";import{j as Q}from"./rank-XE5cpzWb.js";const X={class:"page-container"},Y={class:"user-info"},Z={class:"user-detail"},$={class:"nickname"},ee={class:"uid"},ae={class:"mobile"},te={class:"prize-info"},le={class:"prize-title"},ne={class:"money"},se=F({__name:"week-log",setup(oe){const _=f(!1),h=f([]),v=f(0),o=w({userId:"",mobile:""}),i=w({page:1,pageSize:20}),p=async()=>{_.value=!0;try{const n={page:i.page,pageSize:i.pageSize};o.userId&&(n.userId=Number(o.userId)),o.mobile&&(n.mobile=o.mobile);const l=await Q(n);h.value=l.data.list,v.value=l.data.total}finally{_.value=!1}},m=()=>{i.page=1,p()},V=()=>{o.userId="",o.mobile="",i.page=1,p()},U=n=>{i.page=n,p()},D=n=>{i.pageSize=n,i.page=1,p()},N=n=>n===1?"danger":n===2?"warning":n===3?"success":"";return q(()=>{p()}),(n,l)=>{const z=s("el-input"),g=s("el-form-item"),y=s("el-icon"),I=s("el-button"),B=s("el-form"),K=s("el-tag"),c=s("el-table-column"),T=s("el-avatar"),L=s("el-image"),P=s("el-table"),R=s("el-pagination"),j=s("el-card"),A=E("loading");return b(),H("div",X,[a(j,null,{header:t(()=>[...l[4]||(l[4]=[r("div",{class:"card-header"},[r("span",null,"周榜中奖记录")],-1)])]),default:t(()=>[a(B,{inline:!0,model:o,class:"search-form"},{default:t(()=>[a(g,{label:"用户UID"},{default:t(()=>[a(z,{modelValue:o.userId,"onUpdate:modelValue":l[0]||(l[0]=e=>o.userId=e),placeholder:"请输入用户ID",clearable:"",onKeyup:C(m,["enter"]),style:{width:"140px"}},null,8,["modelValue"])]),_:1}),a(g,{label:"手机号"},{default:t(()=>[a(z,{modelValue:o.mobile,"onUpdate:modelValue":l[1]||(l[1]=e=>o.mobile=e),placeholder:"请输入手机号",clearable:"",onKeyup:C(m,["enter"]),style:{width:"160px"}},null,8,["modelValue"])]),_:1}),a(g,null,{default:t(()=>[a(I,{type:"primary",onClick:m},{default:t(()=>[a(y,null,{default:t(()=>[a(S(M))]),_:1}),l[5]||(l[5]=u("查询 ",-1))]),_:1}),a(I,{onClick:V},{default:t(()=>[a(y,null,{default:t(()=>[a(S(O))]),_:1}),l[6]||(l[6]=u("重置 ",-1))]),_:1})]),_:1})]),_:1},8,["model"]),J((b(),x(P,{data:h.value,border:"",stripe:""},{default:t(()=>[a(c,{prop:"rank",label:"排名",width:"80",align:"center"},{default:t(({row:e})=>[a(K,{type:N(e.rank),size:"small"},{default:t(()=>[u(" 第"+d(e.rank)+"名 ",1)]),_:2},1032,["type"])]),_:1}),a(c,{label:"用户信息","min-width":"180"},{default:t(({row:e})=>[r("div",Y,[a(T,{src:e.headImg,size:40},null,8,["src"]),r("div",Z,[r("span",$,d(e.nickname||"-"),1),r("span",ee,"UID: "+d(e.uid),1),r("span",ae,d(e.mobile||"-"),1)])])]),_:1}),a(c,{label:"奖品信息","min-width":"200"},{default:t(({row:e})=>[r("div",te,[e.prizeImgUrl?(b(),x(L,{key:0,src:e.prizeImgUrl,"preview-src-list":[e.prizeImgUrl],fit:"cover",class:"prize-image","preview-teleported":""},null,8,["src","preview-src-list"])):W("",!0),r("span",le,d(e.prizeTitle||"-"),1)])]),_:1}),a(c,{label:"消费金额",width:"120",align:"right"},{default:t(({row:e})=>{var k;return[r("span",ne,"¥"+d(((k=e.consumeAmount)==null?void 0:k.toFixed(2))||"0.00"),1)]}),_:1}),a(c,{label:"统计时间",width:"180",align:"center"},{default:t(({row:e})=>[u(d(e.timeRange||"-"),1)]),_:1}),a(c,{label:"中奖时间",width:"160",align:"center"},{default:t(({row:e})=>[u(d(e.createdAt||"-"),1)]),_:1})]),_:1},8,["data"])),[[A,_.value]]),a(R,{"current-page":i.page,"onUpdate:currentPage":l[2]||(l[2]=e=>i.page=e),"page-size":i.pageSize,"onUpdate:pageSize":l[3]||(l[3]=e=>i.pageSize=e),"page-sizes":[10,20,50,100],total:v.value,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:D,onCurrentChange:U,class:"pagination"},null,8,["current-page","page-size","total"])]),_:1})])}}}),de=G(se,[["__scopeId","data-v-f93e9e94"]]);export{de as default};
