import{a as e,x as a,a1 as s,O as l,o as t,e as o,h as u,w as n,i as r,F as i,u as c,G as _,j as v,I as d,k as f,z as p,s as m,H as y,B as h,J as x,p as k,l as b}from"./index-90c12cc1.js";import{_ as j}from"./uv-navbar.917fb540.js";import{_ as C}from"./uv-search.62b2f92a.js";import{_ as g}from"./layout.e3de63ac.js";import{h as w,b as S,c as L}from"./product.4783a646.js";import{M as B}from"./index.4bde3b32.js";import{C as D,D as T,E as I}from"./images.cf3befb9.js";import{_ as V}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-status-bar.acda7a2c.js";/* empty css                                                                      */import"./uv-icon.c815b875.js";import"./uv-icon.vue_vue_type_style_index_0_scoped_23936b10_lang.7145f5b2.js";import"./uv-navbar.vue_vue_type_style_index_0_scoped_4c301e25_lang.553ed1e6.js";/* empty css                                                               */import"./index.188c29d6.js";const z=V({__name:"search",setup(V){const{push:z,goBack:E,getParams:F}=c();e(),e("");const M=e(""),P=e([]),G=async()=>{P.value=await w(0,10)},H=e([]),J=e(!1),O=async()=>{let e=await S();H.value=e.slice(0,20)},R=e(),U=e(0),W=a((()=>["您确定要清空搜索记录吗？","您确定要删除这一条记录吗？"][U.value]));function Y(){[q][U.value]()}async function q(){await L(),await O()}const A=e("");function K(e){A.value=e,N()}function N(){if(!A.value&&!M.value)return m({title:"请输入要搜索内容！",duration:2e3,icon:"none"});z({url:"/pages/goodsList/goodsList"},{data:{keyword:A.value||M.value}})}const Q=()=>{};return s((()=>{Promise.all([G(),O()])})),l((e=>{const a=F(e);M.value=a.key})),(e,a)=>{const s=_(y("uv-navbar"),j),l=_(y("uv-search"),C),c=h,m=x,w=k,S=_(y("layout"),g);return t(),o(i,null,[u(S,null,{default:n((()=>[u(s,{fixed:!1,title:"搜索","left-arrow":"",onLeftClick:r(E)},null,8,["onLeftClick"]),u(c,{class:"search-bar"},{default:n((()=>[u(l,{modelValue:A.value,"onUpdate:modelValue":a[0]||(a[0]=e=>A.value=e),shape:"round",placeholder:M.value||"搜索商品",actionText:"搜索","show-action":"",onClear:Q,onCustom:N,onSearch:N,onCancel:Q},null,8,["modelValue","placeholder"])])),_:1}),P.value.length>0?(t(),v(c,{key:0,class:"hotSearchBox tipsBox"},{default:n((()=>[u(c,{class:"boxTitle mar-leftgetList-30"},{default:n((()=>[u(m,null,{default:n((()=>[d("热门搜索")])),_:1}),u(w,{class:"seeIcon hotSearchListSee-icon",src:J.value?r(T):r(D),onClick:a[1]||(a[1]=e=>J.value=!J.value)},null,8,["src"])])),_:1}),J.value?(t(),v(c,{key:1,class:"notSeeContent"},{default:n((()=>[d("当前热门搜索已隐藏 ")])),_:1})):(t(),v(c,{key:0,class:"hot-flex-list"},{default:n((()=>[(t(!0),o(i,null,f(P.value,((e,a)=>(t(),v(c,{key:a,class:"historySearDel-box flex-items-plus"},{default:n((()=>[u(c,{class:"boxContent",onClick:a=>K(e)},{default:n((()=>[d(b(e),1)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1}))])),_:1})):p("",!0),H.value.length>0?(t(),v(c,{key:1,class:"historyBox tipsBox"},{default:n((()=>[u(c,{class:"boxTitle"},{default:n((()=>[u(m,{class:"title"},{default:n((()=>[d("历史搜索")])),_:1}),u(w,{class:"historyDel-icon",onClick:a[2]||(a[2]=e=>{return a=0,U.value=a,console.log(R.value),void r(R).show();var a}),src:r(I)},null,8,["src"])])),_:1}),u(c,{class:"historySear-box hot-flex-list"},{default:n((()=>[(t(!0),o(i,null,f(H.value,((e,a)=>(t(),v(c,{key:a,class:"historySearDel-box flex-items-plus"},{default:n((()=>[u(c,{class:"boxContent historyText line1",onClick:a=>K(e)},{default:n((()=>[d(b(e),1)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1})])),_:1})):p("",!0)])),_:1}),u(B,{ref_key:"modalRef",ref:R,content:r(W),onConfirm:Y},null,8,["content"])],64)}}},[["__scopeId","data-v-5435b1c3"]]);export{z as default};
