var e=Object.defineProperty,a=Object.defineProperties,o=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,l=(a,o,t)=>o in a?e(a,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[o]=t;import{d as i,G as p,r as n,b as d,g as c,H as m,f,h as g,w as y,j as u,i as v,u as h,a3 as b,l as P,C as T,k as x,m as k,n as w,F as O,p as _,c as S,P as j,e as C,x as I}from"./index.54f2b399.js";import{S as N}from"./ShopCard.3e0ed372.js";import{t as A}from"./toTop.24e5e01d.js";import{_ as B}from"./plugin-vue_export-helper.21dcd24c.js";var E=B(i({setup(e){p((e=>{}));const i=n({temPP:null,skuId:"",spuId:"",params:{},sortType:0,showStyle:!0,active:0,keyword:"",loading:{cartAdd:!1,productFav:!1,brandFav:!1,share:!1},banner:{top:[],afterTop:[],afterTap:[]},good:{loading:!1,finished:!1,fail:!1,page:0,list:[]}});function B(e){i.good.list=[],i.good.page=0,0==e.name&&(i.params.sortType=0,i.sortType=0,delete i.params.sort),1==e.name&&(i.params.sortType=3,i.sortType=3,i.temPP&&(25==i.temPP.sortType&&(i.sortType=25,i.params.sortType=25),20==i.temPP.sortType&&(i.sortType=21,i.params.sortType=21)),1==i.params.sort?i.params.sort=0:i.params.sort=1),F(),2==e.name&&(localStorage.getItem("isClassify")?history.back():_({url:"/pages/classify/index?good=1"}),localStorage.removeItem("isClassify"))}function E(){_({url:"/pages/topSearch/index"})}function F(){var e,p;(i.temPP&&0==i.active&&(25==i.temPP.sortType&&(i.sortType=0,i.params.sortType=0),20==i.temPP.sortType&&(i.sortType=20,i.params.sortType=20)),i.good.loading||i.good.fail)||(i.good.loading=!0,++i.good.page,S.productList((e=((e,a)=>{for(var o in a||(a={}))s.call(a,o)&&l(e,o,a[o]);if(t)for(var o of t(a))r.call(a,o)&&l(e,o,a[o]);return e})({sortType:i.sortType},i.params),p={pageNum:i.good.page,pageSize:20,link:c("subdomain")?c("subdomain"):"alisa"},a(e,o(p)))).then((e=>{e&&e.hasNextPage||(i.good.finished=!0),i.good.list.push(...e.list)})).catch((()=>{i.good.fail=!0})).finally((()=>{i.good.loading=!1})))}function U(){i.good.page-=1,i.good.finished=!1,i.good.fail=!1,F()}function V(){j.goBack()}return d((()=>{i.showStyle=""===c("searchCard")||c("searchCard");let e=m().ctx.$page.options||"";if(e){if(i.temPP=JSON.parse(JSON.stringify(e)),e.money){let a="",o="",t=e.money;if(t.indexOf("元以下")>-1)o=t.replace("元以下","");else if(t.indexOf("以上")>-1)a=t.replace("以上","");else{let e=t.replace("元","");a=e.split("-")[0],o=e.split("-")[1]}return i.params.minSalePrice=a,void(i.params.maxSalePrice=o)}e.search&&(i.keyword=decodeURIComponent(e.search)),e.actId&&(i.params.actId=e.actId,i.keyword="");let a=Object.keys(e);i.params[a]=e[a]}i.params=e})),(e,a)=>{const o=C("van-icon"),t=C("van-search"),s=C("van-tab"),r=C("van-tabs"),l=C("van-sticky"),p=C("van-col"),n=C("van-row"),d=C("van-list"),c=I;return f(),g(c,{class:"text-center pd-b-px-55"},{default:y((()=>[u(l,null,{default:y((()=>[v("div",{style:{display:"flex","align-items":"center",background:"#ffffff"}},[u(o,{size:"1.5rem",name:"arrow-left",style:{color:"#757575"},onClick:V}),u(t,{modelValue:h(i).keyword,"onUpdate:modelValue":a[0]||(a[0]=e=>h(i).keyword=e),style:{flex:"1"},placeholder:"请输入搜索关键词",onClick:b(E,["stop"])},null,8,["modelValue","onClick"])]),u(r,{active:h(i).active,"onUpdate:active":a[1]||(a[1]=e=>h(i).active=e),color:"#EBA926","line-width":"206rpx","title-active-color":"#EBA926",onClickTab:B},{default:y((()=>[u(s,{title:"默认"}),u(s,null,{title:y((()=>[P(" 价格 "),void 0!==h(i).params.sort?(f(),g(o,{key:0,class:T(0==h(i).params.sort?"down_price":"up_price"),name:"play"},null,8,["class"])):x("v-if",!0)])),_:1}),u(s,{title:"筛选"})])),_:1},8,["active"])])),_:1}),v("div",{style:{"margin-top":".2rem"}}),u(d,{loading:h(i).good.loading,finished:h(i).good.finished,"finished-text":"没有更多了",onLoad:F},{default:y((()=>[u(n,{gutter:"12",style:{margin:"20rpx 20rpx"}},{default:y((()=>[(f(!0),k(O,null,w(h(i).good.list,(e=>(f(),g(p,{span:"12",style:{"margin-bottom":"25rpx"}},{default:y((()=>[u(N,{item:e},null,8,["item"])])),_:2},1024)))),256))])),_:1})])),_:1},8,["loading","finished"]),h(i).good.fail?(f(),g(c,{key:0,class:"text-ss text-gray pd-50",onClick:U},{default:y((()=>[P("请求失败，点击重试 "),u(o,{name:"replay"})])),_:1})):x("v-if",!0),u(A,{showNav:!0})])),_:1})}}}),[["__scopeId","data-v-60aa199e"]]);export{E as default};
