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