import{y as a,o as t,z as e,e as s,f as l,w as i,_ as o,l as n,j as r,A as c,g as d,k as u,r as g,F as f,t as p,u as m,i as _,E as y,ak as b,m as x,v as k,s as w,x as T,al as h}from"./index-9aa72eed.js";import{B as v,_ as C}from"./bargain.bcd71005.js";import{_ as L}from"./s-layout.bffb18b8.js";import{f as j}from"./useGoods.ce02ada2.js";import{_ as B}from"./_plugin-vue_export-helper.1b428a4d.js";import"./form.c66b5271.js";const S=B({__name:"list",setup(B){const S=a({navH:"",returnShow:!0,bargainTotal:0,bargainSuccessList:[],bargainList:[],page:1,limit:10,loading:!1,loadend:!1,bgColor:{bgColor:"#E93323",Color:"#fff",width:"44rpx",timeTxtwidth:"16rpx",isDay:!0},loadTitle:"加载更多"});async function z(){if(S.loadend||S.loading)return;S.loading=!0,S.loadTitle="";let{data:a,code:t}=await v.getBargainActivityPage({pageNo:S.page,pageSize:S.limit});if(0==t){const t=a.list;o.concat(S.bargainList,t);const e=t.length<S.limit;S.loadend=e,S.loading=!1,S.loadTitle=e?"已全部加载":"加载更多",S.bargainList=a.list,S.page=S.page+1}else S.loading=!1,S.loadTitle="加载更多"}function N(a){console.log("跳转"),console.log(a),w.$router.go(a)}return t((function(){!async function(){let{code:a,data:t}=await v.getBargainRecordSummary();0==a?(S.bargainTotal=t.successUserCount,S.bargainSuccessList=t.successList):S.$util.Tips({title:t})}(),z()})),e((()=>{z()})),(a,t)=>{const e=_,o=T,w=y,v=h,B=b,z=n(x("s-count-down"),C),U=n(x("s-layout"),L);return s(),l(U,{navbar:"inner",title:"砍价列表"},{default:i((()=>[r(e,{style:{"background-color":"red",height:"100vh"}},{default:i((()=>[r(e,{class:"bargain-list"},{default:i((()=>[S.returnShow?(s(),l(e,{key:0,class:"iconfont icon-xiangzuo",onClick:a.goBack,style:c("top:"+S.navH/2+"rpx")},null,8,["onClick","style"])):d("",!0),r(e,{class:"header"},{default:i((()=>[r(e,{class:"pic"},{default:i((()=>[r(e,{class:"swipers"},{default:i((()=>[r(B,{"indicator-dots":"true",autoplay:"true",interval:"2500",duration:"500",vertical:"true",circular:"true"},{default:i((()=>[(s(!0),u(f,null,g(S.bargainSuccessList,((a,t)=>(s(),l(v,{key:t},{default:i((()=>[r(e,{class:"acea-row row-middle",style:{display:"flex"}},{default:i((()=>[r(o,{src:a.avatar,class:"mr9"},null,8,["src"]),r(e,{class:"mr9 nickName"},{default:i((()=>[p(m(a.nickname),1)])),_:2},1024),r(w,{class:"mr9"},{default:i((()=>[p("拿了")])),_:1}),r(e,{class:"line1"},{default:i((()=>[p(m(a.activityName),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1}),r(e,{class:"tit"},{default:i((()=>[p("已有"+m(S.bargainTotal)+"人砍成功",1)])),_:1})])),_:1}),r(e,{class:"list"},{default:i((()=>[(s(!0),u(f,null,g(S.bargainList,((t,n)=>(s(),l(e,{key:n,style:{display:"flex"},class:"item acea-row row-between-wrapper",onClick:a=>N("/pages/activity/bargain/detail?id="+t.id)},{default:i((()=>[r(e,{class:"pictrue"},{default:i((()=>[r(o,{src:t.picUrl},null,8,["src"])])),_:2},1024),r(e,{class:"text acea-row row-column-around"},{default:i((()=>[r(e,{class:"name line2"},{default:i((()=>[p(m(t.name),1)])),_:2},1024),r(e,{class:"acea-row",style:{"margin-bottom":"14rpx",display:"flex"}},{default:i((()=>[r(z,{tipText:" ",bgColor:S.bgColor,dayText:":",hourText:":",minuteText:":",secondText:" ",datatime:t.endTime/1e3,isDay:!0},null,8,["bgColor","datatime"]),r(w,{class:"txt"},{default:i((()=>[p("后结束")])),_:1})])),_:2},1024),0===t.stock?(s(),l(e,{key:0},{default:i((()=>[r(e,{style:{"font-size":"22rpx"},onClick:e=>N("/pages/activity/goods_bargain_details/index?id="+t.id+"&startBargainUid="+a.uid)},{default:i((()=>[p(" 已售罄")])),_:2},1032,["onClick"])])),_:2},1024)):d("",!0),r(e,{class:"money font-color"},{default:i((()=>[p("最低: ￥"),r(w,{class:"price"},{default:i((()=>[p(m(k(j)(t.bargainMinPrice)),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),t.stock>0?(s(),l(e,{key:0,class:"cutBnt bg-color"},{default:i((()=>[p("参与砍价")])),_:1})):d("",!0),0===t.stock?(s(),l(e,{key:1,class:"cutBnt bg-color-hui"},{default:i((()=>[p("已售罄")])),_:1})):d("",!0)])),_:2},1032,["onClick"])))),128)),S.bargainList.length>0?(s(),l(e,{key:0,class:"loadingicon acea-row row-center-wrapper",style:{"text-align":"center"}},{default:i((()=>[r(w,{class:"loading iconfont icon-jiazai",hidden:!a.loading},null,8,["hidden"]),p(m(S.loadTitle),1)])),_:1})):d("",!0)])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-c77a1c67"]]);export{S as default};
