pages-index-search.BQeFLnpB.js 2.2 KB

1
  1. import{v as s,o as t,T as e,a as o,b as a,d as i,w as r,e as l,f as n,g as c,x as u,y as _,F as f,s as p,H as y,V as h,a0 as d,i as m,O as x,j as g}from"./index-dGICJBA1.js";import{a as j}from"./s-search-block.vue_vue_type_style_index_0_scoped_f692e81a_lang.BkXbqiPQ.js";import{_ as v}from"./s-layout.2n749i-h.js";import{_ as L}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.BZJC71FJ.js";import"./s-menu-tools.BHmVopdZ.js";import"./s-layout.vue_vue_type_style_index_0_scoped_c1143e8c_lang.C9LLV9dD.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_0f0268ff_lang.DfrFtxCM.js";import"./s-search-block.DW-gs1wX.js";import"./phone-international-input.BSO1ObdH.js";const b=L({__name:"search",setup(L){const b=s({historyList:[]});function w(s){s&&(!function(s){b.historyList.includes(s)&&b.historyList.splice(b.historyList.indexOf(s),1);b.historyList.unshift(s),b.historyList.length>=10&&(b.historyList.length=10);y("searchHistory",b.historyList)}(s),p.$router.go("/pages/goods/list",{keyword:s}))}function k(){h({title:"提示",content:"确认清除搜索历史吗?",success:function(s){s.confirm&&(b.historyTag=[],d("searchHistory"))}})}return t((()=>{b.historyList=e("searchHistory")||[]})),(s,t)=>{const e=o(a("uni-search-bar"),j),p=m,y=x,h=o(a("s-layout"),v);return l(),i(h,{class:"set-wrap",title:"搜索",bgStyle:{color:"#FFF"}},{default:r((()=>[n(p,{class:"ss-p-x-24"},{default:r((()=>[n(p,{class:"ss-flex ss-col-center"},{default:r((()=>[n(e,{class:"ss-flex-1",radius:"33",placeholder:"请输入关键字",cancelButton:"none",focus:!0,onConfirm:t[0]||(t[0]=s=>w(s.value))})])),_:1}),n(p,{class:"ss-flex ss-row-between ss-col-center"},{default:r((()=>[n(p,{class:"serach-history"},{default:r((()=>[c("搜索历史")])),_:1}),n(y,{class:"clean-history ss-reset-button",onClick:k},{default:r((()=>[c(" 清除搜索历史 ")])),_:1})])),_:1}),n(p,{class:"ss-flex ss-col-center ss-row-left ss-flex-wrap"},{default:r((()=>[(l(!0),u(f,null,_(b.historyList,((s,t)=>(l(),i(y,{class:"history-btn ss-reset-button",onClick:t=>w(s),key:t},{default:r((()=>[c(g(s),1)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-268850fd"]]);export{b as default};