"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[817],{9981:function(o,e,t){var n=t(9439),i=t(1515),l=t(2954),s=t.n(l),c=t(7294),u=t(4184),r=t.n(u),a=t(6028),p=t(5989),d=t(4356),h=t(7730),f=t(5893),m=function DropDownItem(o,e){var t,l=o.children,u=o.direction,m=void 0===u?"down":u,v=o.title,w=void 0===v?"":v,x=o.value,y=o.options,C=void 0===y?[]:y,Z=o.change,k=o.activeColor,D=o.showOverlay,I=void 0===D||D,g=o.hasBottomBtn,S=void 0!==g&&g,b=o.customClassName,j=o.customStyle,O=o.onCloseOverlay,N=(0,c.useState)(!1),P=(0,n.Z)(N,2),z=P[0],B=P[1];(0,c.useImperativeHandle)(e,(function(){return{show:z,closePopup:function closePopup(){B(!1)},showPopup:function showPopup(){B(!0)}}}),[z]);var G=(0,c.useState)((null==C||null===(t=C[0])||void 0===t?void 0:t.text)||""),T=(0,n.Z)(G,2),q=T[0],H=T[1],J=(0,c.useMemo)((function(){var o=x;return null==C?void 0:C.map((function(e,t){var n=e.text,i=e.value;return o===i&&H(n),(0,f.jsx)(d.Z,{title:n,desc:"",isLink:!0,onClick:function onClick(){return function handleClickOption(o){null==Z||Z(o)}(i)}},t)}))}),[x]),L=(0,c.useState)("unset"),M=(0,n.Z)(L,2),R=M[0],A=M[1],E=(0,c.useState)(0),Q=(0,n.Z)(E,2),V=Q[0],F=Q[1];(0,c.useEffect)((function(){var o=s().createSelectorQuery();o.select("#DropDownItem").boundingClientRect(),o.selectViewport().scrollOffset(),o.exec((function(o){console.log("res==>",o),F(o[1].scrollHeight),A("".concat("down"===m?o[0].bottom:o[0].top,"px"))}))}),[]);var K=(0,c.useMemo)((function(){return"up"===m?{position:"absolute",top:0,height:R}:{position:"absolute",top:R,height:"calc(".concat("".concat(V,"px")," - ",R,")")}}),[R]);return(0,f.jsxs)(i.G7,{className:h.Z.dropDownItem,id:"DropDownItem",children:[(0,f.jsxs)(i.G7,{className:r()(b,h.Z["dropDownItem--title"]),style:j,onClick:function handleClickTitle(){console.log("handleClickTitle",z),null==O||O(),B((function(o){return!o}))},children:[(0,f.jsx)(i.xv,{className:h.Z["dropDownItem--title--text"],style:z?{color:k}:{},children:w||q}),(0,f.jsx)(a.Z,{name:function getIconName(){return"up"===m?z?"icon-zhankai1":"icon-shouqi1":z?"icon-shouqi1":"icon-zhankai1"}(),size:20,color:z?k:"#7f7f7f"})]}),(0,f.jsx)(p.Z,{onClose:function handleClosePopup(){S||(B(!1),null==O||O())},showOverLay:I,show:z,showTitle:!1,safeAreaInsetBottom:!1,customStyle:K,overlayStyle:function getOverlayStyle(){return{position:I?"absolute":"fixed",top:0}}(),position:"down"===m?"top":"bottom",children:l||(0,f.jsx)(i.G7,{className:h.Z.dropDownItemOptions,children:J})})]})};e.Z=(0,c.forwardRef)(m)}}]);