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