2 lines
35 KiB
JavaScript
2 lines
35 KiB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
|
|
(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/home/index"],{"./node_modules/@antmjs/vantui/es/grid-item/index.js":function(e,t,n){"use strict";var o=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),r=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),a=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),i=n("webpack/container/remote/react"),l=n("./node_modules/@antmjs/vantui/es/common/jumpLink.js"),c=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),s=n("./node_modules/@antmjs/vantui/es/icon/index.js"),u=n("./node_modules/@antmjs/vantui/es/grid-item/wxs.js"),d=n("webpack/container/remote/react/jsx-runtime"),m=["icon","iconColor","iconPrefix","dot","info","badge","text","setChildrenInstance","parentInstance","index","url","linkType","style","className"];t.default=function GridItem(e){var t=e.icon,n=e.iconColor,f=e.iconPrefix,p=void 0===f?"van-icon":f,v=e.dot,h=e.info,b=e.badge,j=e.text,g=e.setChildrenInstance,y=e.parentInstance,w=e.index,x=e.url,_=e.linkType,S=e.style,k=e.className,C=(0,r.default)(e,m),P=(0,i.useState)({}),O=(0,o.default)(P,2),N=O[0],T=O[1];(0,i.useEffect)((function(){g(w,{updateStyle:I})}),[w,g]),(0,i.useEffect)((function(){I()}),[y.columnNum]);var I=(0,i.useCallback)((function(){var e=y.columnNum,t=y.border,n=y.square,o=y.gutter,r=y.clickable,a=y.center,i=y.direction,l=y.reverse,c=y.iconSize;T({center:a,border:t,square:n,gutter:o,clickable:r,direction:i,reverse:l,iconSize:c,index:w,columnNum:e})}),[y,w]);return(0,d.jsx)(a.View,{className:" "+c.bem("grid-item",{square:null==N?void 0:N.square})+" "+k,style:c.style([u.wrapperStyle({square:null==N?void 0:N.square,gutter:null==N?void 0:N.gutter,columnNum:null==N?void 0:N.columnNum,index:null==N?void 0:N.index}),S]),onClick:function onClick(e){var t;x&&(0,l.jumpLink)(x,_),null==C||null===(t=C.onClick)||void 0===t||t.call(C,e)},children:(0,d.jsx)(a.View,{className:"content-class "+c.bem("grid-item__content",[null==N?void 0:N.direction,{center:null==N?void 0:N.center,square:null==N?void 0:N.square,reverse:null==N?void 0:N.reverse,clickable:null==N?void 0:N.clickable,surround:(null==N?void 0:N.border)&&(null==N?void 0:N.gutter)}])+" "+(null!=N&&N.border?"van-hairline--surround":""),style:u.contentStyle({square:null==N?void 0:N.square,gutter:null==N?void 0:N.gutter}),children:C.children||(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a.View,{className:"van-grid-item__icon icon-class",children:t?(0,d.jsx)(s.default,{name:t,color:n,classPrefix:p,dot:v,info:b||h,size:null==N?void 0:N.iconSize}):N.renderIcon}),(0,d.jsx)(a.View,{className:"van-grid-item__text text-class",children:j?(0,d.jsx)(a.Text,{children:j}):N.renderText})]})})})}},"./node_modules/@antmjs/vantui/es/grid-item/wxs.js":function(e,t,n){"use strict";n.d(t,{wrapperStyle:function(){return wrapperStyle},contentStyle:function(){return contentStyle}});var o=n("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=n("./node_modules/@antmjs/vantui/es/wxs/add-unit.js");function wrapperStyle(e){var t=100/e.columnNum+"%";return(0,o.style)({width:t,"padding-top":e.square?t:null,"padding-right":(0,r.addUnit)(e.gutter),"margin-top":e.index>=e.columnNum&&!e.square?(0,r.addUnit)(e.gutter):null})}function contentStyle(e){return e.square?(0,o.style)({right:(0,r.addUnit)(e.gutter),bottom:(0,r.addUnit)(e.gutter),height:"auto"}):""}},"./node_modules/@antmjs/vantui/es/grid/index.js":function(e,t,n){"use strict";var o=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),r=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),a=n("webpack/container/remote/react"),i=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),l=n("./node_modules/@antmjs/vantui/es/grid/wxs.js"),c=n("webpack/container/remote/react/jsx-runtime"),s=["gutter","clickable","columnNum","center","border","direction","iconSize","square","reverse","className","style"];t.default=function Grid(e){var t=e.gutter,n=void 0===t?null:t,u=e.clickable,d=e.columnNum,m=void 0===d?4:d,f=e.center,p=void 0===f||f,v=e.border,h=void 0===v||v,b=e.direction,j=e.iconSize,g=void 0===j?"48":j,y=e.square,w=e.reverse,x=void 0!==w&&w,_=e.className,S=void 0===_?"":_,k=e.style,C=void 0===k?{}:k,P=(0,o.default)(e,s),O=(0,a.useRef)([]),N=(0,a.useCallback)((function(){O.current.forEach((function(e){e.updateStyle()}))}),[]);(0,a.useEffect)((function(){N()}),[N]);var T=(0,a.useCallback)((function(e,t){O.current[e]=t}),[]),I=(0,a.useMemo)((function(){var e=[];return P.children&&Array.isArray(P.children)&&P.children.forEach((function(t,o){e.push((0,a.cloneElement)(t,{setChildrenInstance:T,key:o,index:o,parentInstance:{columnNum:m,border:h,square:y,gutter:n,clickable:u,center:p,direction:b,reverse:x,iconSize:g}}))})),e}),[P.children,m]);return(0,c.jsx)(r.View,{className:"van-grid "+(h&&!n?"van-hairline--top":"")+" "+S,style:i.style([l.rootStyle({gutter:n}),C]),children:I})}},"./node_modules/@antmjs/vantui/es/grid/wxs.js":function(e,t,n){"use strict";n.d(t,{rootStyle:function(){return rootStyle}});var o=n("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=n("./node_modules/@antmjs/vantui/es/wxs/add-unit.js");function rootStyle(e){return(0,o.style)({"padding-left":(0,r.addUnit)(e.gutter)})}},"./node_modules/@antmjs/vantui/es/notice-bar/index.js":function(e,t,n){"use strict";var o=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),a=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),i=n("webpack/container/remote/@tarojs/taro"),l=n("webpack/container/remote/react"),c=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),u=n("./node_modules/@antmjs/vantui/es/common/utils.js"),d=n("./node_modules/@antmjs/vantui/es/icon/index.js"),m=n("./node_modules/@antmjs/vantui/es/notice-bar/wxs.js"),f=n("webpack/container/remote/react/jsx-runtime"),p=["text","mode","url","openType","delay","speed","scrollable","leftIcon","color","backgroundColor","background","wrapable","renderLeftIcon","renderRightIcon","onClick","onClose","style","className","children"];function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=0;t.default=function NoticeBar(e){var t=(0,l.useState)({ready:!1,show:!0,animationData:{actions:[]},unitag:0}),n=(0,a.default)(t,2),o=n[0],h=n[1],b={animation:null,resetAnimation:null,timer:null,wrapWidth:void 0,contentWidth:void 0,duration:void 0},j=(0,l.useRef)(b),g=e.text,y=void 0===g?"":g,w=e.mode,x=void 0===w?"":w,_=e.url,S=void 0===_?"":_,k=e.openType,C=void 0===k?"navigate":k,P=e.delay,O=void 0===P?1:P,N=e.speed,T=void 0===N?60:N,I=e.scrollable,D=void 0===I?null:I,A=e.leftIcon,V=void 0===A?"":A,E=e.color,F=void 0===E?"#ed6a0c":E,q=e.backgroundColor,z=void 0===q?"#fffbe8":q,M=e.background,R=e.wrapable,X=e.renderLeftIcon,Y=e.renderRightIcon,L=e.onClick,K=e.onClose,W=e.style,B=e.className,U=e.children,$=(0,r.default)(e,p);(0,l.useEffect)((function(){h((function(e){return _objectSpread(_objectSpread({},e),{},{unitag:v++})}))}),[]),(0,i.useReady)((function(){j.current.resetAnimation=(0,i.createAnimation)({duration:0,timingFunction:"linear"}),h((function(e){return _objectSpread(_objectSpread({},e),{},{ready:!0})}))})),(0,l.useEffect)((function(){j.current.resetAnimation=(0,i.createAnimation)({duration:0,timingFunction:"linear"}),h((function(e){return _objectSpread(_objectSpread({},e),{},{ready:!0})}))}),[]),(0,l.useEffect)((function(){return y&&o.ready&&H(),function(){j.current.timer&&clearTimeout(j.current.timer)}}),[y,T,o.ready]);var G=(0,l.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];j.current.timer&&clearTimeout(j.current.timer),j.current.timer=null,h((function(t){return _objectSpread(_objectSpread({},t),{},{animationData:j.current.resetAnimation.translateX(e?0:j.current.wrapWidth).step().export()})})),setTimeout((function(){(0,u.requestAnimationFrame)((function(){h((function(e){return _objectSpread(_objectSpread({},e),{},{animationData:j.current.animation.translateX(-j.current.contentWidth).step().export()})}))}))}),10),j.current.timer=setTimeout((function(){G()}),j.current.duration)}),[]),H=(0,l.useCallback)((function(){(0,u.requestAnimationFrame)((function(){Promise.all([(0,u.getRect)(null,".van-notice-bar__content_".concat(o.unitag)),(0,u.getRect)(null,".van-notice-bar__wrap_".concat(o.unitag))]).then((function(e){var t=e[0],n=e[1];null!=t&&null!=n&&t.width&&n.width&&!1!==D&&(0,i.nextTick)((function(){(D||n.width<=t.width)&&(j.current.wrapWidth=n.width,j.current.contentWidth=t.width,j.current.duration=(n.width+t.width)/T*1e3,j.current.animation=(0,i.createAnimation)({duration:j.current.duration,timingFunction:"linear",delay:O}),G(!0))}))}))}))}),[o.unitag,D,T,O,G]),J=(0,l.useCallback)((function(e){"closeable"===x&&(j.current.timer&&clearTimeout(j.current.timer),j.current.timer=null,h((function(e){return _objectSpread(_objectSpread({},e),{},{show:!1})})),null==K||K(e))}),[x,K]);return o.show&&(0,f.jsxs)(c.View,_objectSpread(_objectSpread({className:s.bem("notice-bar",{withicon:x,wrapable:R})+" ".concat(B||""),style:s.style([m.rootStyle({color:F,backgroundColor:z,background:M}),W])},$),{},{onClick:L,children:[V?(0,f.jsx)(d.default,{name:V,className:"van-notice-bar__left-icon"}):X,(0,f.jsx)(c.View,{className:"van-notice-bar__wrap van-notice-bar__wrap_".concat(o.unitag),children:(0,f.jsxs)(c.View,{className:"van-notice-bar__content van-notice-bar__content_".concat(o.unitag," ")+(!1!==D||R?"":"van-ellipsis"),animation:o.animationData,children:[y,!y&&U]})}),"closeable"===x?(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"cross",onClick:J}):"link"===x?(0,f.jsx)(c.Navigator,{url:S,openType:C,children:(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"arrow"})}):Y]}))}},"./node_modules/@antmjs/vantui/es/notice-bar/wxs.js":function(e,t,n){"use strict";n.d(t,{rootStyle:function(){return rootStyle}});var o=n("./node_modules/@antmjs/vantui/es/wxs/style.js");function rootStyle(e){return(0,o.style)({color:e.color,"background-color":e.backgroundColor,background:e.background})}},"./node_modules/@antmjs/vantui/es/search/index.js":function(e,t,n){"use strict";var o=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),i=n("webpack/container/remote/react"),l=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),s=n("./node_modules/@antmjs/vantui/es/field/index.js"),u=n("webpack/container/remote/react/jsx-runtime"),d=["value","defaultValue","label","focus","error","disabled","readonly","inputAlign","showAction","leftIcon","rightIcon","placeholder","placeholderStyle","actionText","background","maxlength","shape","clearable","clearTrigger","clearIcon","renderLabel","renderLeftIcon","renderRightIcon","renderAction","onFocus","onBlur","onChange","onClear","onClickInput","onSearch","onCancel","style","className"];function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.default=function Search(e){var t=e.value,n=e.defaultValue,o=void 0===n?"":n,m=e.label,f=e.focus,p=e.error,v=e.disabled,h=e.readonly,b=e.inputAlign,j=e.showAction,g=e.leftIcon,y=void 0===g?"search":g,w=e.rightIcon,x=e.placeholder,_=e.placeholderStyle,S=e.actionText,k=void 0===S?"取消":S,C=e.background,P=void 0===C?"#ffffff":C,O=e.maxlength,N=void 0===O?-1:O,T=e.shape,I=void 0===T?"square":T,D=e.clearable,A=void 0===D||D,V=e.clearTrigger,E=void 0===V?"focus":V,F=e.clearIcon,q=void 0===F?"clear":F,z=e.renderLabel,M=e.renderLeftIcon,R=e.renderRightIcon,X=e.renderAction,Y=e.onFocus,L=e.onBlur,K=e.onChange,W=e.onClear,B=e.onClickInput,U=e.onSearch,$=e.onCancel,G=e.style,H=e.className,J=(0,a.default)(e,d),Q=(0,i.useMemo)((function(){return void 0===t}),[t]),Z=(0,i.useState)(Q?o:t),ee=(0,r.default)(Z,2),te=ee[0],ne=ee[1];(0,i.useEffect)((function(){Q||ne(t)}),[Q,t]);var oe=Q?te:t;return(0,u.jsxs)(l.View,_objectSpread(_objectSpread({className:"".concat(c.bem("search",{withaction:j||!!X})," ").concat(H),style:c.style([{background:P},G])},J),{},{children:[(0,u.jsxs)(l.View,{className:c.bem("search__content",[I]),children:[m?(0,u.jsx)(l.View,{className:"van-search__label",children:m}):z,(0,u.jsx)(s.Field,{type:"text",leftIcon:M?"":y,rightIcon:R?"":w,focus:f,error:p,border:!1,confirmType:"search",className:"van-search__field field-class",value:oe,disabled:v,readonly:h,clearable:A,clearTrigger:E,clearIcon:q,maxlength:N,inputAlign:b,placeholder:x,"placeholder-style":_,renderLeftIcon:M,renderRightIcon:R,style:"padding: 5px 10px 5px 0; background-color: transparent;",onBlur:L,onFocus:Y,onChange:function _change(e){Q&&ne(e.detail),null==K||K(e)},onConfirm:U,onClear:W,onClickInput:B})]}),(j||X)&&(0,u.jsx)(l.View,{className:"van-search__action",hoverClass:"van-search__action--hover",hoverStayTime:70,children:X||(0,u.jsx)(l.View,{onClick:function _cancel(e){setTimeout((function(){ne(""),null==$||$(),Object.defineProperty(e,"detail",{value:""}),null==K||K(e)}),200)},className:"cancel-class",children:k})})]}))}},"./node_modules/@antmjs/vantui/es/swiper-item/index.js":function(e,t,n){"use strict";var o=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=n("webpack/container/remote/react"),a=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),i=n("./node_modules/@antmjs/vantui/es/swiper/context.js"),l=n("webpack/container/remote/react/jsx-runtime");function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var c={direction:"horizontal",className:""};t.default=function SwiperItem(e){var t=_objectSpread(_objectSpread({},c),e),n=t.children,o=t.direction,s=t.size,u=t.className,d=(0,r.useContext)(i.DataContext);return(0,l.jsx)(a.View,{className:"van-swiper-item ".concat(u),style:function style(){var style={},e=(null==d?void 0:d.propSwiper.direction)||o,t=(null==d?void 0:d.size)||s;return t&&(style["horizontal"===e?"width":"height"]="".concat(t,"px")),style}(),children:n})}},"./node_modules/@antmjs/vantui/es/swiper/context.js":function(e,t,n){"use strict";n.d(t,{DataContext:function(){return r}});var o=n("webpack/container/remote/react"),r=(0,o.createContext)({})},"./node_modules/@antmjs/vantui/es/swiper/index.js":function(e,t,n){"use strict";var o=n("./node_modules/@antmjs/vantui/es/swiper/swiper.js");t.default=o.default},"./node_modules/@antmjs/vantui/es/swiper/swiper.js":function(e,t,n){"use strict";var o=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),r=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),i=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),l=n("./node_modules/@babel/runtime/helpers/esm/typeof.js"),c=n("./node_modules/@babel/runtime/regenerator/index.js"),s=n.n(c),u=n("webpack/container/remote/react"),d=n("./node_modules/classnames/index.js"),m=n.n(d),f=n("webpack/container/remote/@tarojs/taro"),p=n.n(f),v=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),h=n("./node_modules/@antmjs/vantui/es/swiper/context.js"),b=n("webpack/container/remote/react/jsx-runtime"),j=n("webpack/container/remote/@tarojs/runtime").window,g=["children","direction","className","pageContent","onChange","initPage","paginationColor","paginationVisible","touchable","isPreventDefault","isStopPropagation","autoPlay","isCenter","style"];function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y={width:"object"===(void 0===j?"undefined":(0,l.default)(j))?j.innerWidth:375,height:0,duration:500,initPage:0,autoPlay:0,direction:"horizontal",paginationColor:"#fff",paginationVisible:!1,loop:!0,touchable:!0,isPreventDefault:!0,isStopPropagation:!0,isCenter:!1,className:""},w=function Swiper(e,t){var n,l,c=_objectSpread(_objectSpread({},y),e),d=c.children,w=c.direction,x=c.className,_=c.pageContent,S=(c.onChange,c.initPage,c.paginationColor,c.paginationVisible,c.touchable,c.isPreventDefault,c.isStopPropagation,c.autoPlay,c.isCenter),k=c.style,C=(0,a.default)(c,g),P=(0,u.useRef)(null),O=(0,u.useRef)(null),N=(0,u.useRef)({moving:!1,autoplayTimer:null,width:0,height:0,offset:0,size:0}),T=(0,u.useState)(Math.random().toString(36).slice(-8)),I=(0,r.default)(T,1)[0],D="vertical"===w,A=(0,u.useState)(null),V=(0,r.default)(A,2),E=V[0],F=V[1],q=(0,u.useState)(0),z=(0,r.default)(q,2),M=z[0],R=z[1],X=(0,u.useState)(0),Y=(0,r.default)(X,2),L=Y[0],K=Y[1],W=(0,u.useState)(0),B=(0,r.default)(W,2),U=B[0],$=B[1],G=(0,u.useState)(0),H=(0,r.default)(G,2),J=H[0],Q=H[1],Z=(0,u.useState)([]),ee=(0,r.default)(Z,2),te=ee[0],ne=ee[1],oe=(0,u.useState)(!1),re=(0,r.default)(oe,2),ae=re[0],ie=re[1],le=D?U:L,ce=(0,u.useState)({startX:0,startY:0,deltaX:0,deltaY:0,offsetX:0,offsetY:0,stateDirection:"",delta:0,touchTime:0}),se=(0,r.default)(ce,1)[0],ue=(0,u.useMemo)((function(){var e=0;return{childs:u.Children.map(c.children,(function(t){return(0,u.isValidElement)(t)?(e++,t):null})),childCount:e}}),[c.children]),de=ue.childs,me=ue.childCount,fe=me*Number(le),pe={propSwiper:c,size:le},ve=E?(D?null==E?void 0:E.height:null==E?void 0:E.width)-Number(le)*me:0,he=function stopAutoPlay(){clearTimeout(N.current.autoplayTimer),N.current.autoplayTimer=null},be=function autoplay(){c.autoPlay<=0||me<=1||(he(),N.current.autoplayTimer=setTimeout((function(){ye(),autoplay()}),Number(c.autoPlay)))},je=function resettPosition(){N.current.moving=!0,M<=-1&&xe({pace:me}),M>=me&&xe({pace:-me})},ge=function prev(){je(),Pe(),ke((function(){ke((function(){N.current.moving=!1,xe({pace:-1,isEmit:!0})}))}))},ye=function next(){je(),Pe(),ke((function(){ke((function(){N.current.moving=!1,xe({pace:1,isEmit:!0})}))}))},we=function to(e){je(),Pe(),ke((function(){ke((function(){var t;N.current.moving=!1,t=c.loop&&me===e?0===M?0:e:e%me,xe({pace:t-M,isEmit:!0})}))}))},xe=function move(e){var t=e.pace,n=void 0===t?0:t,o=e.offset,r=void 0===o?0:o,a=e.isEmit,i=void 0!==a&&a;if(!(me<=1)){var l=_e(n),s=Se(l,r);if(c.loop){if(Array.isArray(d)&&d[0]&&s!==ve){var u=s<ve;te[0]=u?fe:0}if(Array.isArray(d)&&d[me-1]&&0!==s){var m=s>0;te[me-1]=m?-fe:0}ne(te)}i&&M!==l&&c.onChange&&c.onChange((l+me)%me),M=l,R(l),Q(s),Ne(s)}},_e=function getActive(e){if(e){var t=M+e;return c.loop?Ce(t,-1,me):Ce(t,0,me-1)}return M},Se=function getOffset(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e*Number(le);c.loop||(n=Math.min(n,-ve));var o=t-n;return c.loop||(o=Ce(o,ve,0)),o},ke=function requestFrame(e){j.requestAnimationFrame.call(j,e)},Ce=function range(e,t,n){return Math.min(Math.max(e,t),n)},Pe=function touchReset(){se.startX=0,se.startY=0,se.deltaX=0,se.deltaY=0,se.offsetX=0,se.offsetY=0,se.delta=0,se.stateDirection="",se.touchTime=0},Oe=m()((n={},(0,i.default)(n,"van-swiper__inner",!0),(0,i.default)(n,"van-swiper__vertical",D),n)),Ne=function getStyle(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=O.current,n=0;if(S){var o=D?U:L,r=D?(null==E?void 0:E.height)-o:(null==E?void 0:E.width)-o;n=e+(M!==me-1||c.loop?r/2:-r/2)}else n=e;t.style.transitionDuration="".concat(N.current.moving?0:c.duration,"ms"),t.style[D?"height":"width"]="".concat(Number(le)*me,"px"),t.style[D?"width":"height"]="".concat(D?L:U,"px"),t.style.transform="translate3D".concat(D?"(0,".concat(n,"px,0)"):"(".concat(n,"px,0,0)"))};(0,u.useEffect)((function(){N.current.activePagination=(M+me)%me}),[M]);var Te=function queryRect(e){return new Promise((function(t){var n=(0,f.createSelectorQuery)();n.select("#".concat(e.id))&&n.select("#".concat(e.id)).boundingClientRect(),n.exec((function(e){t(e[0])}))}))},Ie=function(){var e=(0,o.default)(s().mark((function _callee(){var e,t,n,o,r,a,i=arguments;return s().wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:+c.initPage,l.next=3,Te(P.current);case 3:t=l.sent,n=Math.max(Math.min(me-1,e),0),o=c.width?+c.width:null==t?void 0:t.width,r=c.height?+c.height:null==t?void 0:t.height,le=D?r:o,fe=me*Number(le),a=Se(n),N.current.moving=!0,ae&&(N.current.moving=!1),F(t),R(n),K(o),$(r),Q(a),ie(!0);case 18:case"end":return l.stop()}}),_callee)})));return function init(){return e.apply(this,arguments)}}();(0,u.useEffect)((function(){ae&&Ne()}),[D,L,U,J,ae]),(0,u.useEffect)((function(){return function(){ie(!1)}}),[]),(0,u.useEffect)((function(){he(),be()}),[d]),(0,u.useEffect)((function(){Ie()}),[c.initPage]),(0,u.useEffect)((function(){return function(){he()}}),[]),(0,f.useReady)((function(){Ie(),p().nextTick((function(){setTimeout((function(){he(),be()}),16)}))}));var De=function itemStyle(e){var t={},n=c.direction||w,o=le;o&&(t["horizontal"===n?"width":"height"]="".concat(o,"px"));var r=te[e];return r&&(t.transform="translate3D".concat("horizontal"===n?"(".concat(r,"px,0,0)"):"(0,".concat(r,"px,0)"))),t};return(0,u.useImperativeHandle)(t,(function(){return{to:we,next:ye,prev:ge}})),(0,b.jsx)(h.DataContext.Provider,{value:pe,children:(0,b.jsxs)(v.View,_objectSpread(_objectSpread({className:"van-swiper ".concat(x),ref:P},C),{},{id:"container-"+I,onTouchStart:function onTouchStart(e){c.isPreventDefault&&e.preventDefault(),c.isStopPropagation&&e.stopPropagation(),c.touchable&&(!function touchStart(e){var t,n;Pe(),se.startX=(null==e||null===(t=e.touches[0])||void 0===t?void 0:t.clientX)||0,se.startY=(null==e||null===(n=e.touches[0])||void 0===n?void 0:n.clientY)||0}(e),se.touchTime=Date.now(),he(),je())},onTouchMove:function onTouchMove(e){c.touchable&&N.current.moving&&(!function touchMove(e){var t,n;se.deltaX=((null==e||null===(t=e.touches[0])||void 0===t?void 0:t.clientX)||0)-se.startX,se.deltaY=((null==e||null===(n=e.touches[0])||void 0===n?void 0:n.clientY)||0)-se.startY,se.offsetX=Math.abs(se.deltaX),se.offsetY=Math.abs(se.deltaY),se.delta=D?se.deltaY:se.deltaX,se.stateDirection||(se.stateDirection=function getDirection(e,t){return e>t&&e>5?"horizontal":t>e&&t>5?"vertical":""}(se.offsetX,se.offsetY))}(e),se.stateDirection===c.direction&&xe({offset:se.delta}))},onTouchEnd:function onTouchEnd(){if(c.touchable&&N.current.moving){var e=se.delta/(Date.now()-se.touchTime),t=Math.abs(e)>.3||Math.abs(se.delta)>+(le/2).toFixed(2),n=0;if(N.current.moving=!1,t&&se.stateDirection===c.direction){var o=D?se.offsetY:se.offsetX;n=c.loop?o>0?se.delta>0?-1:1:0:-Math[se.delta>0?"ceil":"floor"](se.delta/le),xe({pace:n,isEmit:!0})}else se.delta?xe({pace:0}):Ne();be()}},catchMove:D,style:_objectSpread(_objectSpread({},k),{},{height:U}),children:[(0,b.jsxs)(v.View,{className:Oe,ref:O,children:[u.Children.map(de,(function(e,t){return(0,b.jsx)(v.View,{className:"van-swiper-item-wrapper",style:De(t),children:e},t)})),(0,b.jsx)(v.View,{className:"van-swiper-item-wrapper",style:De(0),children:de&&de.length?de[0]:""})]}),c.paginationVisible&&!("pageContent"in c)?(0,b.jsx)(v.View,{className:m()((l={},(0,i.default)(l,"van-swiper__pagination",!0),(0,i.default)(l,"van-swiper__pagination-vertical",D),l)),children:u.Children.map(de,(function(e,t){var n;return(0,b.jsx)(v.Text,{style:(M+me)%me===t?{backgroundColor:c.paginationColor}:void 0,className:m()((n={},(0,i.default)(n,"van-swiper__pagination-item",!0),(0,i.default)(n,"active",(M+me)%me===t),n))},t)}))}):(0,b.jsx)(v.View,{children:_})]}))})},x=(0,u.forwardRef)(w);t.default=x},"./node_modules/classnames/index.js":function(e,t,n){var o,r=n("webpack/container/remote/@tarojs/runtime").window,a=n("./node_modules/@babel/runtime/helpers/typeof.js").default;!function(){"use strict";var i={}.hasOwnProperty;function classNames(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=a(n);if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var r=classNames.apply(null,n);r&&e.push(r)}}else if("object"===o){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var l in n)i.call(n,l)&&n[l]&&e.push(l)}}}return e.join(" ")}e.exports?(classNames.default=classNames,e.exports=classNames):"object"===a(n.amdO)&&n.amdO?void 0===(o=function(){return classNames}.apply(t,[]))||(e.exports=o):r.classNames=classNames}()},"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/home/index.tsx":function(e,t,n){"use strict";var o=n("./node_modules/@antmjs/vantui/es/grid/index.js"),r=n("./node_modules/@antmjs/vantui/es/grid-item/index.js"),a=n("./node_modules/@antmjs/vantui/es/swiper/index.js"),i=n("./node_modules/@antmjs/vantui/es/swiper-item/index.js"),l=n("./node_modules/@antmjs/vantui/es/image/index.js"),c=n("./node_modules/@antmjs/vantui/es/search/index.js"),s=n("./node_modules/@antmjs/vantui/es/notice-bar/index.js"),u=n("./node_modules/@antmjs/vantui/es/dialog/index.js"),d=n("./node_modules/@antmjs/vantui/es/tag/index.js"),m=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),f=n("./node_modules/@antmjs/vantui/es/toast/index.js"),p=n("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),v=n("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),h=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),b=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),j=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),g=n("webpack/container/remote/react"),y=n.n(g),w=n("webpack/container/remote/@tarojs/taro"),x=n.n(w),_=n("./src/pages/components/TabbarCom/index.tsx"),S=n("./src/utils/index.ts"),k=n("./src/pages/components/ActiveCard/index.tsx"),C=n("webpack/container/remote/react/jsx-runtime");t.default=function Home(){var e,t,n,w,P,O,N,T=y().useState(0),I=(0,b.default)(T,2),D=I[0],A=(I[1],y().useState(0)),V=(0,b.default)(A,2),E=(V[0],V[1],y().useState(!1)),F=(0,b.default)(E,2),q=F[0],z=F[1],M=y().useState(""),R=(0,b.default)(M,2),X=(R[0],R[1],(0,g.useState)("")),Y=(0,b.default)(X,2),L=Y[0],K=Y[1],W=(0,g.useState)([]),B=(0,b.default)(W,2),U=B[0],$=B[1],G=(0,g.useState)({}),H=(0,b.default)(G,2),J=H[0],Q=H[1],Z=(0,g.useState)(),ee=(0,b.default)(Z,2),te=ee[0],ne=ee[1],oe=(0,g.useState)(!1),re=(0,b.default)(oe,2),ae=re[0],ie=re[1];(0,g.useEffect)((function(){x().showShareMenu({withShareTicket:!0}),x().updateShareMenu({withShareTicket:!0,success:function success(){}})}),[]),(0,g.useEffect)((function(){ce(),setTimeout((function(){le()}),500)}),[]),(0,g.useEffect)((function(){var e;x().cloud.callFunction({name:"getOpenid",complete:(e=(0,h.default)((0,v.default)().mark((function _callee(e){var t,n,o,r;return(0,v.default)().wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:console.log("callFunction test result: ",e),r=null==e||null===(t=e.result)||void 0===t||null===(n=t.event)||void 0===n||null===(o=n.userInfo)||void 0===o?void 0:o.openId,ne(r);case 3:case"end":return a.stop()}}),_callee)}))),function complete(t){return e.apply(this,arguments)})})}),[ae]);var le=function(){var e=(0,h.default)((0,v.default)().mark((function _callee3(){var e;return(0,v.default)().wrap((function _callee3$(t){for(;;)switch(t.prev=t.next){case 0:return e={tableName:"details",okFun:function(){var e=(0,h.default)((0,v.default)().mark((function _callee2(e){var t;return(0,v.default)().wrap((function _callee2$(n){for(;;)switch(n.prev=n.next){case 0:return console.log("details--",e),n.next=3,$(null!==(t=null==e?void 0:e.data)&&void 0!==t?t:[]);case 3:case"end":return n.stop()}}),_callee2)})));return function okFun(t){return e.apply(this,arguments)}}()},t.next=3,(0,S.getTable)(e);case 3:case"end":return t.stop()}}),_callee3)})));return function getdetails(){return e.apply(this,arguments)}}(),ce=function(){var e=(0,h.default)((0,v.default)().mark((function _callee5(){var e;return(0,v.default)().wrap((function _callee5$(t){for(;;)switch(t.prev=t.next){case 0:return e={tableName:"systemConfig",okFun:function(){var e=(0,h.default)((0,v.default)().mark((function _callee4(e){var t;return(0,v.default)().wrap((function _callee4$(n){for(;;)switch(n.prev=n.next){case 0:return console.log("systemConfig--",e),n.next=3,Q(null!==(t=null==e?void 0:e.data)&&void 0!==t?t:[]);case 3:case"end":return n.stop()}}),_callee4)})));return function okFun(t){return e.apply(this,arguments)}}()},t.next=3,(0,S.getTable)(e);case 3:case"end":return t.stop()}}),_callee5)})));return function getsystemConfig(){return e.apply(this,arguments)}}(),se=function(){var e=(0,h.default)((0,v.default)().mark((function _callee6(e){var t;return(0,v.default)().wrap((function _callee6$(n){for(;;)switch(n.prev=n.next){case 0:t={tableName:"userInfo",keyValue:{openId:te},okFun:function okFun(t){var n,o,r,a,i;console.log("提交打卡,res",t);var l={tableName:"userInfo",id:null==t||null===(n=t.data)||void 0===n||null===(o=n[0])||void 0===o?void 0:o._id,objData:{checkInArr:[].concat((0,p.default)(null!==(r=null==t||null===(a=t.data)||void 0===a||null===(i=a[0])||void 0===i?void 0:i.checkInArr)&&void 0!==r?r:[]),[{imageUrl:null==e?void 0:e.imageUrl,checkTime:(new Date).valueOf()}])},okFun:function okFun(e){console.log("提交打卡,res",e),f.default.success({message:"打卡成功",selector:"#vanToast-demo2",duration:2e3,onClose:function onClose(){}})}};(0,S.updateTableid)((0,m.default)({},l))}},(0,S.getTable)((0,m.default)({},t));case 2:case"end":return n.stop()}}),_callee6)})));return function checkIn(t){return e.apply(this,arguments)}}(),ue=function chooseImage(){x().chooseImage({count:1,sizeType:["original"],sourceType:["camera"],success:function success(e){var t=e.tempFilePaths;console.log("tempFilePaths===",t),function uploadTaro(e){var t;x().cloud.uploadFile({cloudPath:"images/checkIn/".concat(null===(t=new Date)||void 0===t?void 0:t.getTime(),".png"),filePath:null==e?void 0:e[0],success:function success(e){console.log("res",null==e?void 0:e.fileID),se({imageUrl:null==e?void 0:e.fileID})},fail:function fail(e){console.log("err",e)}})}(t)}})};return(0,C.jsxs)(j.View,{className:"homeContent",children:[(0,C.jsx)(j.View,{children:(0,C.jsx)(u.default,{id:"vanDialog3",showConfirmButton:!1,showCancelButton:!1,show:q,onClose:function onClose(){return z(!1)},children:(0,C.jsx)(j.View,{className:"tagArr",children:[{city:"深圳",color:""},{city:"北京",color:"#8c8c8c"},{city:"上海",color:"#8c8c8c"},{city:"广州",color:"#8c8c8c"},{city:"武汉",color:"#8c8c8c"},{city:"杭州",color:"#8c8c8c"},{city:"成都",color:"#8c8c8c"}].map((function(e){return(0,C.jsx)(d.default,{plain:!0,type:"primary",color:null==e?void 0:e.color,size:"large",style:{marginRight:"30px",marginBottom:"10px"},children:null==e?void 0:e.city})}))})})}),!(null!=J&&null!==(e=J[0])&&void 0!==e&&null!==(t=e.notice)&&void 0!==t&&t.isHidden)&&(0,C.jsx)(s.default,{leftIcon:"volume-o",text:null==J||null===(n=J[0])||void 0===n||null===(w=n.notice)||void 0===w?void 0:w.text}),(0,C.jsxs)(j.View,{className:"topHome",children:[(0,C.jsx)(j.View,{onClick:function onClick(){return z(!0)},children:(0,C.jsx)(d.default,{plain:!0,type:"primary",size:"large",children:"深圳"})}),(0,C.jsx)(j.View,{children:(0,C.jsx)(c.default,{value:L,onChange:function onChange(e){return K(e.detail)},placeholder:"请输入搜索关键词",style:{width:"320px"},onSearch:function onSearch(e){console.log("e---",e),K(""),x().navigateTo({url:"/pages/activityList/index"})}})})]}),(0,C.jsx)(j.View,{className:"demo-box",children:(0,C.jsx)(a.default,{height:180,paginationColor:"#426543",autoPlay:"3000",initPage:D,paginationVisible:!0,onChange:function onChange(e){},children:(null==J?void 0:J.length)>0&&(null!==(P=null==J||null===(O=J[0])||void 0===O?void 0:O.imagesArr)&&void 0!==P?P:[]).map((function(e,t){return(0,C.jsx)(i.default,{children:(0,C.jsx)(l.default,{src:null==e?void 0:e.url,fit:"cover",width:"100%",height:"200px"})},"swiper#demo1".concat(t))}))})}),(0,C.jsxs)(o.default,{children:[(0,C.jsx)(r.default,{icon:"star",text:"打卡",className:"iconStyle",onClick:(0,h.default)((0,v.default)().mark((function _callee8(){var e;return(0,v.default)().wrap((function _callee8$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,S.phoneLogin)();case 2:e=t.sent,ie(!0),console.log("isin",e),e?ue():f.default.fail({message:"请先登录",selector:"#vanToast-demo2"});case 6:case"end":return t.stop()}}),_callee8)})))}),(0,C.jsx)(r.default,{icon:"like",className:"iconStyle",text:"深圳十峰",onClick:function onClick(){x().navigateTo({url:"/pages/mountainPeak/index"})}}),(0,C.jsx)(r.default,{icon:"eye",className:"iconStyle",text:"活动",onClick:function onClick(){x().navigateTo({url:"/pages/activityList/index"})}}),(0,C.jsx)(r.default,{icon:"manager",className:"iconStyle",text:"组队",onClick:function onClick(){f.default.fail({message:"参加1次活动后,可发起组队",selector:"#vanToast-demo2"})}})]}),(null==U?void 0:U.length)>0&&(0,C.jsx)(j.View,{children:(null!==(N=null==U?void 0:U.splice(0,2))&&void 0!==N?N:[]).map((function(e,t){return(0,C.jsx)(j.View,{onClick:function onClick(){console.log("Card"),x().navigateTo({url:"/pages/activityList/components/details/index?id=".concat(null==e?void 0:e._id)})},children:(0,C.jsx)(k.default,{dataSource:e})})}))}),(0,C.jsx)(f.default,{id:"vanToast-demo2"}),(0,C.jsx)(_.default,{active:0})]})}},"./src/pages/home/index.tsx":function(e,t,n){"use strict";var o=n("webpack/container/remote/@tarojs/runtime"),r=n("./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/home/index.tsx");Page((0,o.createPageConfig)(r.default,"pages/home/index",{root:{cn:[]}},{navigationBarTitleText:"首页"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return t="./src/pages/home/index.tsx",e(e.s=t);var t}));e.O()}]); |