import{f as a,o as s,c as e,w as t,a as l,u as o,h as i,b as u,r as n,F as r,m as c,s as f,q as p,g as d,d as m,Q as A,i as h,v,t as C}from"./index-3714412c.js";import{_ as x}from"./uv-navbar.31c484ad.js";import{b as B,r as D,u as g}from"./useRouter.f44141c1.js";import{_ as K}from"./uv-search.3960861f.js";import{_ as b}from"./layout.99605750.js";import{h as S,a as V,c as _}from"./product.d7200236.js";import{_ as k}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-status-bar.b515a02d.js";import"./uv-icon.c593f91d.js";import"./api.966d6934.js";const E=k({__name:"search",setup(k){const{push:E,goBack:G}=g();a(),a("");const L=a([]),j=a([]),y=a(!1),U=async()=>{let a=await V();j.value=a.slice(0,20)};const w=a("");function P(a){w.value=a,W()}function W(){if(!w.value)return p({title:"请输入要搜索内容！",duration:2e3,icon:"none"});E({url:"/pages/goodsList/goodsList"},{data:{keyword:w.value}})}const Q=()=>{};return B((()=>{Promise.all((async()=>{L.value=await S(0,10)})(),U())})),(a,B)=>{const g=D(d("uv-navbar"),x),S=D(d("uv-search"),K),V=m,k=A,E=h,Y=v("viewhot"),I=D(d("layout"),b);return s(),e(I,null,{default:t((()=>[l(g,{fixed:!1,title:"搜索","left-arrow":"",onLeftClick:o(G)},null,8,["onLeftClick"]),l(V,{class:"search-bar"},{default:t((()=>[l(S,{modelValue:w.value,"onUpdate:modelValue":B[0]||(B[0]=a=>w.value=a),shape:"round",placeholder:"搜索商品",actionText:"搜索","show-action":"",onClear:Q,onCustom:W,onSearch:W,onCancel:Q},null,8,["modelValue"])])),_:1}),L.value.length>0?(s(),e(V,{key:0,class:"hotSearchBox tipsBox"},{default:t((()=>[l(V,{class:"boxTitle mar-leftgetList-30"},{default:t((()=>[l(k,null,{default:t((()=>[i("热门搜索")])),_:1}),l(E,{class:"seeIcon hotSearchListSee-icon",src:y.value?"../../static/images/notSee.png":"../../static/images/see.png",onClick:B[1]||(B[1]=a=>y.value=!y.value)},null,8,["src"])])),_:1}),y.value?(s(),e(V,{key:1,class:"notSeeContent"},{default:t((()=>[i("当前热门搜索已隐藏 ")])),_:1})):(s(),e(Y,{key:0,class:"hot-flex-list"},{default:t((()=>[(s(!0),u(r,null,n(L.value,((a,o)=>(s(),e(V,{key:o,class:"historySearDel-box flex-items-plus mar-right-30"},{default:t((()=>[l(V,{class:"boxContent",onClick:s=>P(a)},{default:t((()=>[i(C(a),1)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1}))])),_:1})):c("",!0),j.value.length>0?(s(),e(V,{key:1,class:"historyBox tipsBox"},{default:t((()=>[l(V,{class:"boxTitle"},{default:t((()=>[l(k,{class:"title"},{default:t((()=>[i("历史搜索")])),_:1}),l(E,{class:"historyDel-icon",onClick:B[2]||(B[2]=a=>function(a=1,s){f({title:"温馨提示",content:1===a?"您确定要清空搜索记录吗？":"您确定要删除这一条记录吗？",success:async a=>{a.confirm?(await _(),p({title:"已清空",duration:2e3}),await U()):a.cancel}})}(1)),src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAAXNSR0IArs4c6QAAAttJREFUaEPtWruKFEEUrVuVGS1ioNGuqSLWA2NnBcHMBcHExP0Acf0C9QscMzONTBTUSDDZ3VS4NeUka+YaCSYKYiBD9ZVee7Vpph/V3fPYtTqbmVvnnnMfXa8Bdswf6EufMWaDiC52wUuSxDnn3nTBKI7tLFBKKYUQTxljsidiznu/mSrtA6+zQK21A4BOmZsixCGiWrjAtCwZY6/6IFLEIKJNa+2zrtidMqi1fgAA9w9JENHDJEl22pDinA8KWI+ttVttsPJjehXovV93zrUSKKUcCCG2c8HatdYOosCaCMQMVgWo2INLX6Ja60cA0LixiYgB/CuC4ueQ/umKRURDa+290ok+m7BH00iVEe9KKu+rCVZqkz5pUKdx8t6r4gLhb/illGtCiE9lUZ8GWOcwJIOp7aGPPG4VRpGT9/6sc26/dJrI1pMHJUpEpzjn53Ov7e+MsQ+hpPu0J6ILnPOTOU57jLGvWVaHiPi6tESLPyilbnDOX+a+30bEK30SDsXSWr8FgGu5cbcQ8XkVTuk0EQWGhr8H+5jBKUGMJRpfMj30VlOIpehBKeX1lHDTsxWl1GUiWmliv3CBxph0d5/u8tOFQu2GVWs9BIC7WQZ3EHG9KpvLIPDPYjF7ELFyO6a1/gYAKwH2i53ojTFBAkPtj1wGo8BCQ8YMznolE1pyofYxgzGDuQi02Q+GllyofSzRWKKxRKsPnUJ7KtQ+9mDswdiDzXuQiD5ba9dqNrD7ALB6ZPaDWuvbADBMCXvvN+pue7Nb3YPjdiLaqruTX/hLpunhUVu7KHDWb9G2mWk6LmYwZrDjPNi01NraxRKNJfo/laiU8pIQ4n3bfpnHuCRJBqPRaLfKV+XdgTHmC2Ps9DzItvDxYzKZnBmPxz9bC5RSXhVCvGvhfB5DbiLiizpHtX/GU0qtcs7vENE5xtiJOsBZ/g4Av4hoDwCeIOLHJr5qBTYBWWabYy/wN7o7E2anW37zAAAAAElFTkSuQmCC"})])),_:1}),l(V,{class:"historySear-box hot-flex-list"},{default:t((()=>[(s(!0),u(r,null,n(j.value,(o=>(s(),e(V,{key:a.index,class:"historySearDel-box flex-items-plus"},{default:t((()=>[l(V,{class:"boxContent historyText line1",onClick:a=>P(o)},{default:t((()=>[i(C(o),1)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1})])),_:1})):c("",!0)])),_:1})}}},[["__scopeId","data-v-2dae2889"]]);export{E as default};
