From 2651275abd09283fce8d7e8413bc971e7a4acf0b Mon Sep 17 00:00:00 2001 From: huxiaoshuang Date: Fri, 25 Nov 2022 16:27:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A6=96=E9=A1=B5-=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=AE=98=E6=96=B9=E7=9A=84=E6=B8=B2=E6=9F=93bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/pages/home/index.js | 2 +- dist/pages/my/index.js | 2 +- src/pages/home/index.tsx | 91 +++++++++++++++++++++++----------------- src/pages/my/index.tsx | 31 +++++++------- 4 files changed, 69 insertions(+), 57 deletions(-) diff --git a/dist/pages/home/index.js b/dist/pages/home/index.js index 74641f4..af6f14e 100644 --- a/dist/pages/home/index.js +++ b/dist/pages/home/index.js @@ -1,2 +1,2 @@ /*! 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"),s=n("./node_modules/@antmjs/vantui/es/common/jumpLink.js"),c=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),l=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,s=y.reverse,c=y.iconSize;T({center:a,border:t,square:n,gutter:o,clickable:r,direction:i,reverse:s,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,s.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)(l.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"),s=n("./node_modules/@antmjs/vantui/es/grid/wxs.js"),c=n("webpack/container/remote/react/jsx-runtime"),l=["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,l),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([s.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"),s=n("webpack/container/remote/react"),c=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),l=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;t0&&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,s.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,s.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:l.bem("notice-bar",{withicon:x,wrapable:R})+" ".concat(B||""),style:l.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"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),l=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=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 s=_e(n),l=Se(s,r);if(c.loop){if(Array.isArray(d)&&d[0]&&l!==ve){var u=l0;te[me-1]=m?-fe:0}ne(te)}i&&M!==s&&c.onChange&&c.onChange((s+me)%me),M=s,R(s),Q(l),Ne(l)}},_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(se);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(){le.startX=0,le.startY=0,le.deltaX=0,le.deltaY=0,le.offsetX=0,le.offsetY=0,le.delta=0,le.stateDirection="",le.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(se)*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)(l().mark((function _callee(){var e,t,n,o,r,a,i=arguments;return l().wrap((function _callee$(s){for(;;)switch(s.prev=s.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:+c.initPage,s.next=3,Te(P.current);case 3:t=s.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,se=D?r:o,fe=me*Number(se),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 s.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=se;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(),le.startX=(null==e||null===(t=e.touches[0])||void 0===t?void 0:t.clientX)||0,le.startY=(null==e||null===(n=e.touches[0])||void 0===n?void 0:n.clientY)||0}(e),le.touchTime=Date.now(),he(),je())},onTouchMove:function onTouchMove(e){c.touchable&&N.current.moving&&(!function touchMove(e){var t,n;le.deltaX=((null==e||null===(t=e.touches[0])||void 0===t?void 0:t.clientX)||0)-le.startX,le.deltaY=((null==e||null===(n=e.touches[0])||void 0===n?void 0:n.clientY)||0)-le.startY,le.offsetX=Math.abs(le.deltaX),le.offsetY=Math.abs(le.deltaY),le.delta=D?le.deltaY:le.deltaX,le.stateDirection||(le.stateDirection=function getDirection(e,t){return e>t&&e>5?"horizontal":t>e&&t>5?"vertical":""}(le.offsetX,le.offsetY))}(e),le.stateDirection===c.direction&&xe({offset:le.delta}))},onTouchEnd:function onTouchEnd(){if(c.touchable&&N.current.moving){var e=le.delta/(Date.now()-le.touchTime),t=Math.abs(e)>.3||Math.abs(le.delta)>+(se/2).toFixed(2),n=0;if(N.current.moving=!1,t&&le.stateDirection===c.direction){var o=D?le.offsetY:le.offsetX;n=c.loop?o>0?le.delta>0?-1:1:0:-Math[le.delta>0?"ceil":"floor"](le.delta/se),xe({pace:n,isEmit:!0})}else le.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()((s={},(0,i.default)(s,"van-swiper__pagination",!0),(0,i.default)(s,"van-swiper__pagination-vertical",D),s)),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=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;t0&&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=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=s0;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;t0&&(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()}]); \ No newline at end of file diff --git a/dist/pages/my/index.js b/dist/pages/my/index.js index 49f4775..9e7227f 100644 --- a/dist/pages/my/index.js +++ b/dist/pages/my/index.js @@ -1,2 +1,2 @@ /*! For license information please see index.js.LICENSE.txt */ -"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/my/index"],{"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx":function(e,n,t){var o=t("./node_modules/@antmjs/vantui/es/icon/index.js"),a=t("./node_modules/@antmjs/vantui/es/cell/index.js"),s=t("./node_modules/@antmjs/vantui/es/toast/index.js"),i=t("./node_modules/@antmjs/vantui/es/button/index.js"),l=t("./node_modules/@antmjs/vantui/es/image/index.js"),u=t("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),c=t("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),d=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),m=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),f=t("webpack/container/remote/react"),p=t("./src/pages/components/TabbarCom/index.tsx"),x=t("webpack/container/remote/@tarojs/taro"),g=t.n(x),v=(t("./src/pages/components/ActiveCard/index.tsx"),t("./src/utils/index.ts")),j=t("./config.js"),b=t("webpack/container/remote/react/jsx-runtime");n.default=function my(e){var n=(0,f.useState)({}),t=(0,r.default)(n,2),x=(t[0],t[1],(0,f.useState)([])),h=(0,r.default)(x,2),k=(h[0],h[1],(0,f.useState)(0)),w=(0,r.default)(k,2),y=(w[0],w[1],(0,f.useState)(!0)),_=(0,r.default)(y,2),C=_[0],N=_[1];(0,f.useEffect)((function(){I()}),[]);var I=function(){var e=(0,d.default)((0,c.default)().mark((function _callee(){var e;return(0,c.default)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,v.phoneLogin)();case 2:e=n.sent,console.log("isok",e),N(e);case 5:case"end":return n.stop()}}),_callee)})));return function getok(){return e.apply(this,arguments)}}();(0,f.useEffect)((function(){}),[]);var T=function getPhoneNumber(e){console.log("点击获取手机事件",e.detail.cloudID),function getLogin(e){g().cloud.callFunction({name:"getPhoneNum",data:{weRunData:g().cloud.CloudID(e.detail.cloudID)}}).then((function(e){var n,t,o,a,s,i,l,c,d;console.log("res222",e);var r=null==e||null===(n=e.result)||void 0===n||null===(t=n.event)||void 0===t||null===(o=t.weRunData)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.phoneNumber,m=null==e||null===(s=e.result)||void 0===s||null===(i=s.context)||void 0===i?void 0:i.tencentcloud_uin,f={tableName:"userInfo",keyValue:{openId:null==e||null===(l=e.result)||void 0===l||null===(c=l.event)||void 0===c||null===(d=c.userInfo)||void 0===d?void 0:d.openId},okFun:function okFun(e){var n,t;console.log("q",e),(0,v.updateTableid)({id:null==e||null===(n=e.data)||void 0===n||null===(t=n[0])||void 0===t?void 0:t._id,tableName:"userInfo",objData:{tencentcloud_uin:m,authInfo:{authPhonenum:r}},okFun:function okFun(e){I()}})}};(0,v.getTable)((0,u.default)({},f))}))}(e)};return(0,b.jsxs)(m.View,{className:"myContent",children:[(0,b.jsxs)(m.View,{className:"myImage",children:[(0,b.jsx)(l.default,{round:!0,width:"100px",height:"100px",src:"cloud://citynew-0givkbre03955d8c.6369-citynew-0givkbre03955d8c-1253655588/images/touxiang/images.jpg"}),!C&&(0,b.jsx)(m.View,{className:"loginBtn",children:(0,b.jsx)(i.default,{type:"primary",size:"mini","open-type":"getPhoneNumber",lang:"zh_CN",onGetPhoneNumber:function onGetPhoneNumber(e){console.log("info",e),T(e)},children:"登录"})})]}),(0,b.jsxs)(m.View,{className:"cellArr",children:["people"!==j.type||(0,b.jsx)(a.default,{icon:"manager",title:"打卡记录",isLink:!0,onClick:function onClick(){C?g().navigateTo({url:"/pages/my/components/CheckinDetail/index"}):s.default.fail({message:"请先登录",selector:"#vanToast-demo2"})}}),(0,b.jsx)(a.default,{icon:"star",title:"我参与的",isLink:!0,onClick:function onClick(){}}),(0,b.jsx)(a.default,{icon:"manager",title:"申请成为领队",isLink:!0,onClick:function onClick(){}}),(0,b.jsxs)(m.View,{className:"wechat",children:[(0,b.jsx)(o.default,{name:"wechat",size:"16px",className:"icon"}),(0,b.jsx)(i.default,{"open-type":"contact",className:"wecahtBtn",children:"联系我们"})]}),"people"!==j.type&&(0,b.jsx)(a.default,{title:"微信客服",icon:"wechat",isLink:!0,value:"",onClick:function onClick(){g().openCustomerServiceChat({corpId:"wwb04af9a97514271c",extInfo:{url:"https://work.weixin.qq.com/kfid/kfc70f3f112c97a54c5"},success:function success(e){}})}}),(0,b.jsx)(a.default,{icon:"friends",title:"关于我们",isLink:!0,onClick:function onClick(){g().navigateTo({url:"/pages/my/components/AbountUs/index"})}})]}),(0,b.jsx)(s.default,{id:"vanToast-demo2"}),(0,b.jsx)(p.default,{active:2})]})}},"./src/pages/my/index.tsx":function(e,n,t){var o=t("webpack/container/remote/@tarojs/runtime"),a=t("./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx");Page((0,o.createPageConfig)(a.default,"pages/my/index",{root:{cn:[]}},{navigationBarTitleText:"我的"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return n="./src/pages/my/index.tsx",e(e.s=n);var n}));e.O()}]); \ No newline at end of file +"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/my/index"],{"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx":function(e,n,t){var o=t("./node_modules/@antmjs/vantui/es/icon/index.js"),a=t("./node_modules/@antmjs/vantui/es/cell/index.js"),s=t("./node_modules/@antmjs/vantui/es/toast/index.js"),l=t("./node_modules/@antmjs/vantui/es/button/index.js"),i=t("./node_modules/@antmjs/vantui/es/image/index.js"),u=t("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),c=t("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),d=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),m=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),f=t("webpack/container/remote/react"),p=t("./src/pages/components/TabbarCom/index.tsx"),x=t("webpack/container/remote/@tarojs/taro"),v=t.n(x),g=(t("./src/pages/components/ActiveCard/index.tsx"),t("./src/utils/index.ts")),j=t("./config.js"),h=t("webpack/container/remote/react/jsx-runtime");n.default=function my(e){var n=(0,f.useState)({}),t=(0,r.default)(n,2),x=(t[0],t[1],(0,f.useState)([])),b=(0,r.default)(x,2),k=(b[0],b[1],(0,f.useState)(0)),w=(0,r.default)(k,2),y=(w[0],w[1],(0,f.useState)(!0)),_=(0,r.default)(y,2),N=_[0],C=_[1];(0,f.useEffect)((function(){I()}),[]);var I=function(){var e=(0,d.default)((0,c.default)().mark((function _callee(){var e;return(0,c.default)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,g.phoneLogin)();case 2:e=n.sent,console.log("isok",e),C(e);case 5:case"end":return n.stop()}}),_callee)})));return function getok(){return e.apply(this,arguments)}}();(0,f.useEffect)((function(){}),[]);var T=function getPhoneNumber(e){console.log("点击获取手机事件",e.detail.cloudID),function getLogin(e){v().cloud.callFunction({name:"getPhoneNum",data:{weRunData:v().cloud.CloudID(e.detail.cloudID)}}).then((function(e){var n,t,o,a,s,l,i,c,d;console.log("res222",e);var r=null==e||null===(n=e.result)||void 0===n||null===(t=n.event)||void 0===t||null===(o=t.weRunData)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.phoneNumber,m=null==e||null===(s=e.result)||void 0===s||null===(l=s.context)||void 0===l?void 0:l.tencentcloud_uin,f={tableName:"userInfo",keyValue:{openId:null==e||null===(i=e.result)||void 0===i||null===(c=i.event)||void 0===c||null===(d=c.userInfo)||void 0===d?void 0:d.openId},okFun:function okFun(e){var n,t;console.log("q",e),(0,g.updateTableid)({id:null==e||null===(n=e.data)||void 0===n||null===(t=n[0])||void 0===t?void 0:t._id,tableName:"userInfo",objData:{tencentcloud_uin:m,authInfo:{authPhonenum:r}},okFun:function okFun(e){I()}})}};(0,g.getTable)((0,u.default)({},f))}))}(e)};return(0,h.jsxs)(m.View,{className:"myContent",children:[(0,h.jsxs)(m.View,{className:"myImage",children:[(0,h.jsx)(i.default,{round:!0,width:"100px",height:"100px",src:"cloud://citynew-0givkbre03955d8c.6369-citynew-0givkbre03955d8c-1253655588/images/touxiang/images.jpg"}),!N&&(0,h.jsx)(m.View,{className:"loginBtn",children:(0,h.jsx)(l.default,{type:"primary",size:"mini","open-type":"getPhoneNumber",lang:"zh_CN",onGetPhoneNumber:function onGetPhoneNumber(e){console.log("info",e),T(e)},children:"登录"})})]}),(0,h.jsxs)(m.View,{className:"cellArr",children:["people"!==j.type||(0,h.jsx)(a.default,{icon:"star",title:"打卡记录",isLink:!0,onClick:function onClick(){N?v().navigateTo({url:"/pages/my/components/CheckinDetail/index"}):s.default.fail({message:"请先登录",selector:"#vanToast-demo2"})}}),(0,h.jsx)(a.default,{icon:"manager",title:"申请成为领队",isLink:!0,onClick:function onClick(){s.default.fail({message:"首次参加活动后,可申请成为领队",selector:"#vanToast-demo2"})}}),(0,h.jsxs)(m.View,{className:"wechat",children:[(0,h.jsx)(o.default,{name:"wechat",size:"16px",className:"icon"}),(0,h.jsx)(l.default,{"open-type":"contact",className:"wecahtBtn",children:"联系我们"})]}),"people"!==j.type&&(0,h.jsx)(a.default,{title:"微信客服",icon:"wechat",isLink:!0,value:"",onClick:function onClick(){v().openCustomerServiceChat({corpId:"wwb04af9a97514271c",extInfo:{url:"https://work.weixin.qq.com/kfid/kfc70f3f112c97a54c5"},success:function success(e){}})}})]}),(0,h.jsx)(s.default,{id:"vanToast-demo2"}),(0,h.jsx)(p.default,{active:2})]})}},"./src/pages/my/index.tsx":function(e,n,t){var o=t("webpack/container/remote/@tarojs/runtime"),a=t("./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx");Page((0,o.createPageConfig)(a.default,"pages/my/index",{root:{cn:[]}},{navigationBarTitleText:"我的"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return n="./src/pages/my/index.tsx",e(e.s=n);var n}));e.O()}]); \ No newline at end of file diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index 2a05c2a..b88ed87 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -46,9 +46,8 @@ const Home = () => { // 系统配置 const [systemConfig, setsystemConfig] = useState({}); - const [openid,setopenid]=useState() - const [isIn,setisIn]=useState(false) - + const [openid, setopenid] = useState(); + const [isIn, setisIn] = useState(false); const onChange = (e) => {}; @@ -66,29 +65,33 @@ const Home = () => { withShareTicket: true, success() {}, }); - - getsystemConfig(); //获取系统配置 - getdetails(); //获取活动详情 }, []); - useEffect(()=>{ + useEffect(() => { + getsystemConfig(); //获取系统配置 + setTimeout(()=>{ + getdetails(); //获取活动详情 + },500) + }, []); + + useEffect(() => { Taro.cloud.callFunction({ name: "getOpenid", complete: async (res: any) => { console.log("callFunction test result: ", res); let newopenid = res?.result?.event?.userInfo?.openId; - setopenid(newopenid) + setopenid(newopenid); }, }); - },[isIn]) + }, [isIn]); const getdetails = async () => { let objParams = { tableName: "details", // id: "80516fb66370bcf300b8f43c5f4dd52b", - okFun: (res: any) => { + okFun: async (res: any) => { console.log("details--", res); - setdetails(res?.data ?? []); + await setdetails(res?.data ?? []); }, }; await getTable(objParams); @@ -98,9 +101,9 @@ const Home = () => { let objParams = { tableName: "systemConfig", // id: "80516fb66370bcf300b8f43c5f4dd52b", - okFun: (res: any) => { + okFun: async (res: any) => { console.log("systemConfig--", res); - setsystemConfig(res?.data ?? []); + await setsystemConfig(res?.data ?? []); }, }; await getTable(objParams); @@ -115,13 +118,12 @@ const Home = () => { success: (res: any) => { // get resource ID console.log("res", res?.fileID); - checkIn({imageUrl:res?.fileID}) + checkIn({ imageUrl: res?.fileID }); // 跳转到目的页面,打开新页面 // Taro.navigateTo({ // url: `/pages/home/components/CheckIn/index?fileID=${res?.fileID}`, // }); - }, fail: (err: any) => { // handle error @@ -145,7 +147,7 @@ const Home = () => { }; // 签到 - const checkIn = async (data:any) => { + const checkIn = async (data: any) => { let postData = { tableName: "userInfo", keyValue: { openId: openid }, @@ -160,7 +162,7 @@ const Home = () => { ...(res?.data?.[0]?.checkInArr ?? []), { imageUrl: data?.imageUrl, - checkTime :new Date().valueOf(),//打卡时间 + checkTime: new Date().valueOf(), //打卡时间 // remark: fieldValues?.remark, // location: address, }, @@ -174,7 +176,6 @@ const Home = () => { duration: 2000, onClose: () => { // 跳转到打卡页面 - // 返回首页 [上一页] // Taro.navigateBack({ // delta: 1, @@ -317,11 +318,19 @@ const Home = () => { paginationVisible onChange={onChange} > - {(systemConfig?.[0]?.imagesArr ?? []).map((item: any, index: any) => ( - - - - ))} + {systemConfig?.length > 0 && + (systemConfig?.[0]?.imagesArr ?? []).map( + (item: any, index: any) => ( + + + + ) + )} @@ -334,7 +343,7 @@ const Home = () => { onClick={async () => { // getLocation(); let isin: any = await phoneLogin(); - setisIn(true) + setisIn(true); console.log("isin", isin); if (isin) { chooseImage(); @@ -425,21 +434,25 @@ const Home = () => { */} {/* 截取数组2个活动 */} - {details.splice(0, 2).map((item: any, index: any) => { - return ( - { - console.log("Card"); - Taro.navigateTo({ - url: `/pages/activityList/components/details/index?id=${item?._id}`, - }); - }} - > - {/* 活动卡片 */} - - - ); - })} + {details?.length > 0 && ( + + {(details?.splice(0, 2) ?? []).map((item: any, index: any) => { + return ( + { + console.log("Card"); + Taro.navigateTo({ + url: `/pages/activityList/components/details/index?id=${item?._id}`, + }); + }} + > + {/* 活动卡片 */} + + + ); + })} + + )} {/* 直播live专区 */} {/* 视频号直播 */} diff --git a/src/pages/my/index.tsx b/src/pages/my/index.tsx index 3a9ecd8..e14b473 100644 --- a/src/pages/my/index.tsx +++ b/src/pages/my/index.tsx @@ -207,7 +207,7 @@ const my = (props: any) => { {type !== "people" || (true && ( { @@ -226,7 +226,7 @@ const my = (props: any) => { /> ))} - { // }); } }} - /> + /> */} { - if (isin) { - // 跳转到目的页面,打开新页面 - // Taro.navigateTo({ - // url: "/pages/my/components/CheckinDetail/index", - // }); - } else { - // Toast.fail({ - // message: "请先登录", - // selector: "#vanToast-demo2", - // }); - } + Toast.fail({ + message: "首次参加活动后,可申请成为领队", + selector: "#vanToast-demo2", + }); + // 跳转到目的页面,打开新页面 + // Taro.navigateTo({ + // url: "/pages/formSubmit/index", + // }); }} /> @@ -293,7 +290,7 @@ const my = (props: any) => { /> )} - { url: "/pages/my/components/AbountUs/index", }); }} - /> + /> */} + + {/*