import{y as s,o as t,M as e,e as a,f as o,w as r,l as i,j as l,t as c,k as n,r as u,F as f,s as h,p as y,U as d,V as p,m as _,i as m,G as x,u as L}from"./index-9aa72eed.js";import{b as g,_ as b}from"./s-layout.bffb18b8.js";import{_ as w}from"./_plugin-vue_export-helper.1b428a4d.js";import"./form.c66b5271.js";const k=w({__name:"search",setup(w){const k=s({historyList:[]});function j(s){s&&(!function(s){k.historyList.includes(s)&&k.historyList.splice(k.historyList.indexOf(s),1);k.historyList.unshift(s),k.historyList.length>=10&&(k.historyList.length=10);y("searchHistory",k.historyList)}(s),h.$router.go("/pages/goods/list",{keyword:s}))}function C(){d({title:"提示",content:"确认清除搜索历史吗？",success:function(s){s.confirm&&(k.historyTag=[],p("searchHistory"))}})}return t((()=>{k.historyList=e("searchHistory")||[]})),(s,t)=>{const e=i(_("uni-search-bar"),g),h=m,y=x,d=i(_("s-layout"),b);return a(),o(d,{class:"set-wrap",title:"搜索",bgStyle:{color:"#FFF"}},{default:r((()=>[l(h,{class:"ss-p-x-24"},{default:r((()=>[l(h,{class:"ss-flex ss-col-center"},{default:r((()=>[l(e,{class:"ss-flex-1",radius:"33",placeholder:"请输入关键字",cancelButton:"none",focus:!0,onConfirm:t[0]||(t[0]=s=>j(s.value))})])),_:1}),l(h,{class:"ss-flex ss-row-between ss-col-center"},{default:r((()=>[l(h,{class:"serach-history"},{default:r((()=>[c("搜索历史")])),_:1}),l(y,{class:"clean-history ss-reset-button",onClick:C},{default:r((()=>[c(" 清除搜索历史 ")])),_:1})])),_:1}),l(h,{class:"ss-flex ss-col-center ss-row-left ss-flex-wrap"},{default:r((()=>[(a(!0),n(f,null,u(k.historyList,((s,t)=>(a(),o(y,{class:"history-btn ss-reset-button",onClick:t=>j(s),key:t},{default:r((()=>[c(L(s),1)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-d3779116"]]);export{k as default};
