import{x as e,y as a,z as t,bu as l,h as o,i as r,a as s,c,w as i,b as n,n as u,C as d,p as h,D as p,g as m,A as f,B as y,E as g,j as _,a9 as x,d as b,r as k,l as v,J as C,I as S,e as w,bs as I,S as j,T as $,U as A,ac as z,ad as B,k as T,aa as M,t as U,M as V}from"./index-65a0752a.js";import{_ as F}from"./u-icon.086befcc.js";import{_ as N}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as D}from"./u--image.311958c0.js";import{_ as E}from"./tabbar.2bf8dc03.js";import{g as H,a as O}from"./article.cc4fa007.js";import{u as R,M as J}from"./useMescroll.d7eb7970.js";import{M as P}from"./mescroll-empty.9e667eae.js";import"./u-transition.4a1deb0f.js";import"./u-safe-bottom.ed5ce7c3.js";/* empty css */import"./mescroll-i18n.8cdb125f.js";const q=N({name:"u-search",mixins:[a,t,{props:{shape:{type:String,default:e.search.shape},bgColor:{type:String,default:e.search.bgColor},placeholder:{type:String,default:e.search.placeholder},clearabled:{type:Boolean,default:e.search.clearabled},focus:{type:Boolean,default:e.search.focus},showAction:{type:Boolean,default:e.search.showAction},actionStyle:{type:Object,default:e.search.actionStyle},actionText:{type:String,default:e.search.actionText},inputAlign:{type:String,default:e.search.inputAlign},inputStyle:{type:Object,default:e.search.inputStyle},disabled:{type:Boolean,default:e.search.disabled},borderColor:{type:String,default:e.search.borderColor},searchIconColor:{type:String,default:e.search.searchIconColor},color:{type:String,default:e.search.color},placeholderColor:{type:String,default:e.search.placeholderColor},searchIcon:{type:String,default:e.search.searchIcon},searchIconSize:{type:[Number,String],default:e.search.searchIconSize},margin:{type:String,default:e.search.margin},animation:{type:Boolean,default:e.search.animation},modelValue:{type:String,default:e.search.value},value:{type:String,default:e.search.value},maxlength:{type:[String,Number],default:e.search.maxlength},height:{type:[String,Number],default:e.search.height},label:{type:[String,Number,null],default:e.search.label}}}],data(){return{keyword:"",showClear:!1,show:!1,focused:this.focus}},watch:{keyword(e){this.$emit("update:modelValue",e),this.$emit("change",e)},modelValue:{immediate:!0,handler(e){this.keyword=e}}},computed:{showActionBtn(){return!this.animation&&this.showAction}},emits:["clear","search","custom","focus","blur","click","clickIcon","update:modelValue","change"],methods:{inputChange(e){this.keyword=e.detail.value},clear(){this.keyword="",this.$nextTick((()=>{this.$emit("clear")}))},search(e){this.$emit("search",e.detail.value);try{l()}catch(a){}},custom(){this.$emit("custom",this.keyword);try{l()}catch(e){}},getFocus(){this.focused=!0,this.animation&&this.showAction&&(this.show=!0),this.$emit("focus",this.keyword)},blur(){setTimeout((()=>{this.focused=!1}),100),this.show=!1,this.$emit("blur",this.keyword)},clickHandler(){this.disabled&&this.$emit("click")},clickIcon(){this.$emit("clickIcon")}}},[["render",function(e,a,t,l,b,k){const v=g,C=o(r("u-icon"),F),S=_,w=x;return s(),c(S,{class:"u-search",onClick:k.clickHandler,style:u([{margin:e.margin},e.$u.addStyle(e.customStyle)])},{default:i((()=>[n(S,{class:"u-search__content",style:u({backgroundColor:e.bgColor,borderRadius:"round"==e.shape?"100px":"4px",borderColor:e.borderColor})},{default:i((()=>[e.$slots.label||null!==e.label?d(e.$slots,"label",{key:0},(()=>[n(v,{class:"u-search__content__label"},{default:i((()=>[h(p(e.label),1)])),_:1})]),!0):m("v-if",!0),n(S,{class:"u-search__content__icon"},{default:i((()=>[n(C,{onClick:k.clickIcon,size:e.searchIconSize,name:e.searchIcon,color:e.searchIconColor?e.searchIconColor:e.color},null,8,["onClick","size","name","color"])])),_:1}),n(w,{"confirm-type":"search",onBlur:k.blur,value:b.keyword,onConfirm:k.search,onInput:k.inputChange,disabled:e.disabled,onFocus:k.getFocus,focus:e.focus,maxlength:e.maxlength,"placeholder-class":"u-search__content__input--placeholder",placeholder:e.placeholder,"placeholder-style":`color: ${e.placeholderColor}`,class:"u-search__content__input",type:"text",style:u([{textAlign:e.inputAlign,color:e.color,backgroundColor:e.bgColor,height:e.$u.addUnit(e.height)},e.inputStyle])},null,8,["onBlur","value","onConfirm","onInput","disabled","onFocus","focus","maxlength","placeholder","placeholder-style","style"]),b.keyword&&e.clearabled&&b.focused?(s(),c(S,{key:1,class:"u-search__content__icon u-search__content__close",onClick:k.clear},{default:i((()=>[n(C,{name:"close",size:"11",color:"#ffffff",customStyle:"line-height: 12px"})])),_:1},8,["onClick"])):m("v-if",!0)])),_:3},8,["style"]),n(v,{style:u([e.actionStyle]),class:f(["u-search__action",[(k.showActionBtn||b.show)&&"u-search__action--active"]]),onClick:y(k.custom,["stop","prevent"])},{default:i((()=>[h(p(e.actionText),1)])),_:1},8,["style","class","onClick"])])),_:3},8,["onClick","style"])}],["__scopeId","data-v-7ec77839"]]),G=N(b({__name:"list",setup(e){const{mescrollInit:a,downCallback:t,getMescroll:l}=R(B,z),{setShare:d,onShareAppMessage:y,onShareTimeline:g}=T();d(),y(),g();let x=k([]),b=k([]),N=k(""),G=k(""),K=k(null),L=k(!1);v((async()=>{await H().then((e=>{const a={name:C("all"),category_id:""};x.value.push(a),x.value=x.value.concat(e.data)}))}));const Q=e=>{L.value=!1;let a={category_id:N.value,title:G.value,page:e.num,limit:e.size};O(a).then((a=>{let t=a.data.data;1==e.num&&(b.value=[]),b.value=b.value.concat(t),e.endSuccess(t.length),L.value=!0})).catch((()=>{L.value=!0,e.endErr()}))},W=()=>{l().resetUpScroll()};return S((()=>{setTimeout((()=>{l().optUp.textNoMore=C("end")}),500)})),(e,d)=>{const y=o(r("u-search"),q),g=_,k=M,v=o(r("u-icon"),F),S=o(r("u--image"),D),z=o(r("tabbar"),E);return s(),c(g,{class:"bg-gray-100 min-h-[100vh]",style:u(e.themeColor())},{default:i((()=>[n(g,{class:"fixed top-0 inset-x-0 z-10"},{default:i((()=>[n(g,{class:"p-[20rpx] bg-white border-solid border-0 border-b-[2rpx] border-gray-200"},{default:i((()=>[n(y,{placeholder:w(C)("searchPlaceholder"),actionText:"",actionStyle:{width:0,margin:0},inputStyle:{"font-size":"28rpx"},height:"68rpx",modelValue:w(G),"onUpdate:modelValue":d[0]||(d[0]=e=>I(G)?G.value=e:G=e),onClickIcon:W},null,8,["placeholder","modelValue"])])),_:1}),n(k,{"scroll-x":!0,"enable-flex":!0,class:"nav-list bg-white align-center px-[20rpx] box-border"},{default:i((()=>[n(g,{class:"flex scroll-view-wrap"},{default:i((()=>[(s(!0),j(A,null,$(w(x),((e,a)=>(s(),c(g,{class:f(["nav-item text-[28rpx] mx-[10rpx] h-[60rpx] leading-[60rpx] my-[10rpx] border-t-0 border-l-0 border-r-0",{"border-solid border-b-[4rpx] active":w(N)==e.category_id}]),onClick:a=>{return t=e.category_id,N.value=t,void l().resetUpScroll();var t},key:e.category_id},{default:i((()=>[h(p(e.name),1)])),_:2},1032,["class","onClick"])))),128))])),_:1})])),_:1})])),_:1}),n(J,{ref_key:"mescrollRef",ref:K,onInit:w(a),top:"210rpx",onDown:w(t),onUp:Q},{default:i((()=>[(s(!0),j(A,null,$(w(b),((e,a)=>(s(),c(g,{key:e.id,class:f(["bg-white flex align-center p-[20rpx] rounded-[8rpx] mx-[20rpx]",{"mb-[20rpx]":w(b).length-1!==a}]),onClick:a=>{return t=e.id,void V({url:"/app/pages/article/detail",param:{id:t}});var t}},{default:i((()=>[n(S,{width:"174rpx",height:"174rpx",src:w(U)(e.image),model:"aspectFill"},{error:i((()=>[n(v,{name:"photo",color:"#999",size:"50"})])),_:2},1032,["src"]),n(g,{class:"flex-1 flex flex-col ml-[20rpx]"},{default:i((()=>[n(g,{class:"text-[32rpx] leading-[1.3] multi-hidden mt-[4rpx]"},{default:i((()=>[h(p(e.title),1)])),_:2},1024),n(g,{class:"text-[28rpx] max-w-[480rpx] truncate mt-[10rpx] text-gray-500"},{default:i((()=>[h(p(e.summary),1)])),_:2},1024),n(g,{class:"text-[24rpx] text-gray-400 mt-auto flex justify-between"},{default:i((()=>[h(p(e.create_time),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["class","onClick"])))),128)),!w(b).length&&w(L)?(s(),c(P,{key:0})):m("v-if",!0)])),_:1},8,["onInit","onDown"]),n(z)])),_:1},8,["style"])}}}),[["__scopeId","data-v-0939786e"]]);export{G as default};