import{f as a,o as e,c as s,w as t,a as l,u as o,h as i,b as u,r as n,F as r,m as c,C as p,D as d,g as f,d as m,V as v,i as A,E as h,t as C}from"./index-d76b1e7a.js";import{_}from"./uv-navbar.59911b60.js";import{c as x,r as g,u as B}from"./useRouter.2bdb47a0.js";import{_ as D}from"./uv-search.e89b765c.js";import{_ as b}from"./layout.f8e9d577.js";import{h as K,a as y,c as S}from"./product.b13622dd.js";import{_ as V}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-status-bar.66ab7702.js";/* empty css                                                                      */import"./uv-icon.5730d4d2.js";import"./uv-navbar.vue_vue_type_style_index_0_scoped_8d8b32e4_lang.3fde2b65.js";import"./api.9246a192.js";const j=V({__name:"search",setup(V){const{push:j,goBack:E}=B();a(),a("");const k=a([]),L=a([]),G=a(!1),U=async()=>{let a=await y();L.value=a.slice(0,20)};const w=a("");function P(a){w.value=a,W()}function W(){if(!w.value)return d({title:"请输入要搜索内容！",duration:2e3,icon:"none"});j({url:"/pages/goodsList/goodsList"},{data:{keyword:w.value}})}const I=()=>{};return x((()=>{Promise.all((async()=>{k.value=await K(0,10)})(),U())})),(a,x)=>{const B=g(f("uv-navbar"),_),K=g(f("uv-search"),D),y=m,V=v,j=A,Q=h("viewhot"),T=g(f("layout"),b);return e(),s(T,null,{default:t((()=>[l(B,{fixed:!1,title:"搜索","left-arrow":"",onLeftClick:o(E)},null,8,["onLeftClick"]),l(y,{class:"search-bar"},{default:t((()=>[l(K,{modelValue:w.value,"onUpdate:modelValue":x[0]||(x[0]=a=>w.value=a),shape:"round",placeholder:"搜索商品",actionText:"搜索","show-action":"",onClear:I,onCustom:W,onSearch:W,onCancel:I},null,8,["modelValue"])])),_:1}),k.value.length>0?(e(),s(y,{key:0,class:"hotSearchBox tipsBox"},{default:t((()=>[l(y,{class:"boxTitle mar-leftgetList-30"},{default:t((()=>[l(V,null,{default:t((()=>[i("热门搜索")])),_:1}),l(j,{class:"seeIcon hotSearchListSee-icon",src:G.value?"../../static/images/notSee.png":"../../static/images/see.png",onClick:x[1]||(x[1]=a=>G.value=!G.value)},null,8,["src"])])),_:1}),G.value?(e(),s(y,{key:1,class:"notSeeContent"},{default:t((()=>[i("当前热门搜索已隐藏 ")])),_:1})):(e(),s(Q,{key:0,class:"hot-flex-list"},{default:t((()=>[(e(!0),u(r,null,n(k.value,((a,o)=>(e(),s(y,{key:o,class:"historySearDel-box flex-items-plus mar-right-30"},{default:t((()=>[l(y,{class:"boxContent",onClick:e=>P(a)},{default:t((()=>[i(C(a),1)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1}))])),_:1})):c("",!0),L.value.length>0?(e(),s(y,{key:1,class:"historyBox tipsBox"},{default:t((()=>[l(y,{class:"boxTitle"},{default:t((()=>[l(V,{class:"title"},{default:t((()=>[i("历史搜索")])),_:1}),l(j,{class:"historyDel-icon",onClick:x[2]||(x[2]=a=>function(a=1,e){p({title:"温馨提示",content:1===a?"您确定要清空搜索记录吗？":"您确定要删除这一条记录吗？",success:async a=>{a.confirm?(await S(),d({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(y,{class:"historySear-box hot-flex-list"},{default:t((()=>[(e(!0),u(r,null,n(L.value,(o=>(e(),s(y,{key:a.index,class:"historySearDel-box flex-items-plus"},{default:t((()=>[l(y,{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{j as default};
