1 |
- import{B as s,o as t,V as e,f as o,g as a,w as r,q as i,n as l,m as n,p as c,r as u,F as f,s as h,x as y,R as d,Z as p,u as _,l as m,L as x,t as L}from"./index-b8b5cfb1.js";import{b as g,_ as b}from"./s-layout.ccc89613.js";import{_ as w}from"./_plugin-vue_export-helper.1b428a4d.js";import"./phone-international-input.4d0a0f5c.js";import"./useGoods.fb903b2c.js";const j=w({__name:"search",setup(w){const j=s({historyList:[]});function k(s){s&&(!function(s){j.historyList.includes(s)&&j.historyList.splice(j.historyList.indexOf(s),1);j.historyList.unshift(s),j.historyList.length>=10&&(j.historyList.length=10);y("searchHistory",j.historyList)}(s),h.$router.go("/pages/goods/list",{keyword:s}))}function C(){d({title:"提示",content:"确认清除搜索历史吗?",success:function(s){s.confirm&&(j.historyTag=[],p("searchHistory"))}})}return t((()=>{j.historyList=e("searchHistory")||[]})),(s,t)=>{const e=i(_("uni-search-bar"),g),h=m,y=x,d=i(_("s-layout"),b);return o(),a(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=>k(s.value))})])),_:1}),l(h,{class:"ss-flex ss-row-between ss-col-center"},{default:r((()=>[l(h,{class:"serach-history"},{default:r((()=>[n("搜索历史")])),_:1}),l(y,{class:"clean-history ss-reset-button",onClick:C},{default:r((()=>[n(" 清除搜索历史 ")])),_:1})])),_:1}),l(h,{class:"ss-flex ss-col-center ss-row-left ss-flex-wrap"},{default:r((()=>[(o(!0),c(f,null,u(j.historyList,((s,t)=>(o(),a(y,{class:"history-btn ss-reset-button",onClick:t=>k(s),key:t},{default:r((()=>[n(L(s),1)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-d3779116"]]);export{j as default};
|