1 |
- import{v as s,o as t,I as e,e as a,f as o,w as r,l as i,j as l,p as c,k as n,r as u,F as f,s as h,L as y,M as d,N as p,m as _,i as L,D as m,t as x}from"./index-9880b451.js";import{b as g,_ as b}from"./s-layout.dfc5b0b5.js";import{_ as w}from"./_plugin-vue_export-helper.1b428a4d.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 v(){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=L,y=m,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:v},{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(x(s),1)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-d3779116"]]);export{k as default};
|