import{a1 as e,a2 as a,a3 as t,ap as l,j as o,k as r,b as s,c,w as i,e as n,n as u,a4 as d,y as h,z as p,i as m,A as f,L as y,D as g,l as _,O as x,d as b,r as k,s as v,F as C,K as S,f as w,aq as I,W as j,ae as $,X as A,af as z,ag as B,a8 as T,ao as V,R as F,a as M}from"./index-83368bfa.js";import{_ as U}from"./u-icon.592effc8.js";import{_ as N}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as D}from"./u--image.daf935cf.js";import{_ as O}from"./tabbar.b1f7f4a7.js";import{g as R,a as H}from"./article.ba44b8c1.js";import{u as q,M as E}from"./useMescroll.db3d1b9a.js";import{M as K}from"./mescroll-empty.250a0733.js";import"./u-transition.ac24b0f0.js";import"./u-safe-bottom.579f9172.js";import"./mescroll-i18n.a0e7e612.js";const L=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"),U),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"]]),P=N(b({__name:"list",setup(e){const{mescrollInit:a,downCallback:t,getMescroll:l}=q(B,z),{setShare:d,onShareAppMessage:y,onShareTimeline:g}=T();d(),y(),g();let x=k([]),b=k([]),N=k(""),P=k(""),W=k(null),X=k(!1);v((async()=>{await R().then((e=>{const a={name:C("all"),category_id:""};x.value.push(a),x.value=x.value.concat(e.data)}))}));const G=e=>{X.value=!1;let a={category_id:N.value,title:P.value,page:e.num,limit:e.size};H(a).then((a=>{let t=a.data.data;1==e.num&&(b.value=[]),b.value=b.value.concat(t),e.endSuccess(t.length),X.value=!0})).catch((()=>{X.value=!0,e.endErr()}))},J=()=>{l().resetUpScroll()};return S((()=>{setTimeout((()=>{l().optUp.textNoMore=C("end")}),500)})),(e,d)=>{const y=o(r("u-search"),L),g=_,k=V,v=o(r("u-icon"),U),S=o(r("u--image"),D),z=o(r("tabbar"),O);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(P),"onUpdate:modelValue":d[0]||(d[0]=e=>I(P)?P.value=e:P=e),onClickIcon:J},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(E,{ref_key:"mescrollRef",ref:W,onInit:w(a),top:"210rpx",onDown:w(t),onUp:G},{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 M({url:"/app/pages/article/detail",param:{id:t}});var t}},{default:i((()=>[n(S,{width:"174rpx",height:"174rpx",src:w(F)(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(X)?(s(),c(K,{key:0})):m("v-if",!0)])),_:1},8,["onInit","onDown"]),n(z)])),_:1},8,["style"])}}}),[["__scopeId","data-v-0939786e"]]);export{P as default};