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,G as n,r as d,b as p,g as c,H as f,f as m,h as g,w as u,j as y,i as v,u as h,a3 as b,l as x,C as k,k as w,m as _,n as j,F as C,p as O,c as S,P as T,e as I,x as P}from"./index.012ca997.js";import{S as A}from"./ShopCard.9bc70a4a.js";import{t as B}from"./toTop.1a00b900.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.params.sortType=0,i.sortType=0,delete i.params.sort),1==a.name&&(i.params.sortType=3,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(){T.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=I("van-icon"),t=I("van-search"),s=I("van-tab"),r=I("van-tabs"),l=I("van-sticky"),n=I("van-col"),d=I("van-row"),p=I("van-list"),c=P;return m(),g(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:h(i).keyword,"onUpdate:modelValue":e[0]||(e[0]=a=>h(i).keyword=a),style:{flex:"1"},placeholder:"请输入搜索关键词",onClick:b(F,["stop"])},null,8,["modelValue","onClick"])]),y(r,{active:h(i).active,"onUpdate:active":e[1]||(e[1]=a=>h(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!==h(i).params.sort?(m(),g(o,{key:0,class:k(0==h(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:h(i).good.loading,finished:h(i).good.finished,"finished-text":"没有更多了",onLoad:N},{default:u((()=>[y(d,{gutter:"12",style:{margin:"20rpx 20rpx"}},{default:u((()=>[(m(!0),_(C,null,j(h(i).good.list,(a=>(m(),g(n,{span:"12",style:{"margin-bottom":"25rpx"}},{default:u((()=>[y(A,{item:a},null,8,["item"])])),_:2},1024)))),256))])),_:1})])),_:1},8,["loading","finished"]),h(i).good.fail?(m(),g(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-34096354"]]);export{F as default};
