diff --git a/dist/pages/my/index.js b/dist/pages/my/index.js index f481057..2035f15 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/@antmjs/vantui/es/mixins/page-scroll.js":function(e,t,n){n.d(t,{usePageScroll:function(){return usePageScroll}});var r=n("webpack/container/remote/react"),o=n("webpack/container/remote/@tarojs/taro");n("webpack/container/remote/@tarojs/runtime"),n("webpack/container/remote/@tarojs/runtime").document;function usePageScroll(e){(0,r.useEffect)((function(){return void 0}),[e]),(0,o.usePageScroll)((function(t){e(t)}))}},"./node_modules/@antmjs/vantui/es/sticky/index.js":function(e,t,n){n.d(t,{Sticky:function(){return Sticky}});var r=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),o=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),a=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),i=n("webpack/container/remote/react"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),l=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=n("./node_modules/@antmjs/vantui/es/common/utils.js"),u=n("./node_modules/@antmjs/vantui/es/common/validator.js"),d=n("./node_modules/@antmjs/vantui/es/mixins/page-scroll.js"),f=n("./node_modules/@antmjs/vantui/es/sticky/wxs.js"),m=n("webpack/container/remote/react/jsx-runtime"),p=["zIndex","offsetTop","scrollTop","disabled","container","onScroll","style","className","children"];function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[];return t(e[0])}))}))}),[w]),I=(0,i.useCallback)((function(e){var t=Object.keys(e).reduce((function(t,n){return e[n]!==b[n]&&(t[n]=e[n]),t}),{});Object.keys(t).length>0&&v((function(e){return _objectSpread(_objectSpread({},e),t)})),null==_||_({detail:{scrollTop:C.current.scrollTop,isFixed:e.fixed||b.fixed}})}),[_,b]),P=(0,i.useCallback)((function(e){g?I({fixed:!1,transform:0}):(C.current.scrollTop=e||C.current.scrollTop,"function"!=typeof w?(0,c.getRect)(null,"#sticky-com-index".concat(t.current)).then((function(e){(0,u.isDef)(e)&&(x>=e.top?I({fixed:!0,height:e.height}):I({fixed:!1}))})):Promise.all([(0,c.getRect)(null,"#sticky-com-index".concat(t.current)),N()]).then((function(e){var t=(0,a.default)(e,2),n=t[0],r=t[1];n&&r&&(x+n.height>r.height+r.top?I({fixed:!1,transform:r.height-n.height}):x>=n.top?I({fixed:!0,height:n.height,transform:0}):I({fixed:!1,transform:0}))})).catch((function(e){console.log(e)})))}),[w,g,N,x,I]);return(0,i.useEffect)((function(){P(y)}),[y,w,g,x]),(0,d.usePageScroll)((function(e){P(e.scrollTop)})),(0,m.jsx)(s.View,_objectSpread(_objectSpread({id:"sticky-com-index".concat(t.current),className:" van-sticky "+(S||""),style:l.style([f.containerStyle({fixed:b.fixed,height:b.height,zIndex:j}),k])},O),{},{children:(0,m.jsx)(s.View,{className:l.bem("sticky-wrap",{fixed:b.fixed})+" ".concat(S||""),style:l.style([f.wrapStyle({fixed:b.fixed,offsetTop:x,transform:b.transform,zIndex:j}),k]),children:T})}))}},"./node_modules/@antmjs/vantui/es/sticky/wxs.js":function(e,t,n){n.d(t,{wrapStyle:function(){return wrapStyle},containerStyle:function(){return containerStyle}});var r=n("./node_modules/@antmjs/vantui/es/wxs/style.js");function wrapStyle(e){return(0,r.style)({transform:e.transform?"translate3d(0, "+e.transform+"px, 0)":"",top:e.fixed?e.offsetTop+"px":"","z-index":e.zIndex})}function containerStyle(e){return(0,r.style)({height:e.fixed?e.height+"px":"","z-index":e.zIndex})}},"./node_modules/@antmjs/vantui/es/tab/index.js":function(e,t,n){var r=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),o=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),a=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),i=n("webpack/container/remote/react"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),l=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=n("webpack/container/remote/react/jsx-runtime"),u=["children","style","className","active","lazyRender","lazyTimeout","animated","title"];function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t=ge.length||e<0)&&e!==A){var t=null!==A;I((function(t){return _objectSpread(_objectSpread({},t),{},{currentIndex:e})})),(0,v.requestAnimationFrame)((function(){Te(e),Ce(e)})),(0,c.nextTick)((function(){t&&we("onChange",ge[e])}))}},Se=function setCurrentIndexByName(e){var t=ge.filter((function(t){return(t.props.name||t.props.index)===e}));t.length&&ke(t[0].props.index)},Te=function resize(e){var r;"line"===W&&(e=null!==(r=e)&&void 0!==r?r:A,(0,c.nextTick)((function(){Promise.all([(0,v.getAllRect)(null,".tabs-com-index".concat(n.current," .van-tab")),(0,v.getRect)(null,".tabs-com-index".concat(n.current," .van-tabs__line"))]).then((function(n){var r=(0,a.default)(n,2),o=r[0],i=void 0===o?[]:o,s=r[1];if(i&&s){var l=i[e];if(null==l)return;var u=i.slice(0,e).reduce((function(e,t){return e+t.width}),0);u+=(l.width-s.width)/2+(Q?0:8),I((function(e){return _objectSpread(_objectSpread({},e),{},{lineOffsetLeft:u})})),t.current.swiping=!0,D&&(0,c.nextTick)((function(){I((function(e){return _objectSpread(_objectSpread({},e),{},{skipTransition:!1})}))}))}}))})))},Oe=function onTap(e){var t=e.currentTarget.dataset.index;t=parseInt(t);var n=ge[t];n.props.disabled?we("onDisabled",n):(ke(t),(0,c.nextTick)((function(){we("onClick",n)})))},Ce=function scrollIntoView(e){var t;V&&(e=null!==(t=e)&&void 0!==t?t:A,Promise.all([(0,v.getAllRect)(null,".tabs-com-index".concat(n.current," .van-tab")),(0,v.getRect)(null,".tabs-com-index".concat(n.current," .van-tabs__nav"))]).then((function(t){var n=(0,a.default)(t,2),r=n[0],o=n[1];if(r&&o){var i=r[e],s=r.slice(0,e).reduce((function(e,t){return e+t.width}),0);I((function(e){return _objectSpread(_objectSpread({},e),{},{scrollLeft:s-(o.width-i.width)/2})})),z||(0,c.nextTick)((function(){I((function(e){return _objectSpread(_objectSpread({},e),{},{scrollWithAnimation:!0})}))}))}})))},Ne=function touchStart(e){!function resetTouchStatus(){t.current.direction="",t.current.deltaX=0,t.current.deltaY=0,t.current.offsetX=0,t.current.offsetY=0}();var n=e.touches[0];t.current.startX=n.clientX,t.current.startY=n.clientY},Ie=function onTouchEnd(){if(E&&t.current.swiping){var e=t.current,n=e.direction,r=e.deltaX,o=e.offsetX;if("horizontal"===n&&o>=50){var a=function getAvaiableTab(e){for(var t=e>0?-1:1,n=t;A+n=0;n+=t){var r=A+n;if(r>=0&&rle||!Q})}))}),[le,ge,Q]),(0,u.useEffect)((function(){(0,c.nextTick)((function(){Te()}))}),[ge]);var Pe=(0,u.useCallback)((0,r.default)(l().mark((function _callee(){var e,t,r;return l().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:if(e=0,!ue||!g){o.next=6;break}return o.next=4,(0,v.getAllRect)(null,"."+m.bem("renderNavLeft"+n.current));case 4:(t=o.sent).length&&(e+=t[0].width);case 6:if(!de||!g){o.next=11;break}return o.next=9,(0,v.getAllRect)(null,"."+m.bem("renderNavRight"+n.current));case 9:(r=o.sent).length&&(e+=r[0].width);case 11:e&&T("calc(100% - ".concat(e,"px)"));case 12:case"end":return o.stop()}}),_callee)}))),[ue,g,de]);return(0,u.useEffect)((function(){setTimeout((function(){Pe()}))}),[Pe,g]),(0,x.jsxs)(f.View,_objectSpread(_objectSpread({className:"tabs-com-index".concat(n.current," ")+" "+m.bem("tabs",[W]+" ".concat(je||"")),style:ve},xe),{},{children:[(0,x.jsx)(b.Sticky,{disabled:!K,zIndex:$,offsetTop:B,container:H,onScroll:fe,children:(0,x.jsxs)(f.View,{className:m.bem("tabs__wrap",{scrollable:V})+" "+("line"===W&&U?"van-hairline--top-bottom":""),children:[(0,x.jsx)(f.View,{className:m.bem("renderNavLeft"+n.current),children:ue}),(0,x.jsx)(f.ScrollView,{scrollX:V,scrollWithAnimation:z,scrollLeft:P,className:m.bem("tabs__scroll",[W]),style:{width:S,borderColor:G},children:(0,x.jsxs)(f.View,{className:m.bem("tabs__nav",[W,{complete:!Q}])+" nav-class",style:h.navStyle(G,W),children:["line"===W&&(0,x.jsx)(f.View,{className:"van-tabs__line",style:h.lineStyle({color:G,lineOffsetLeft:R,lineHeight:ee,skipTransition:D,duration:ne,lineWidth:oe})}),ye.map((function(e,t){return(0,x.jsx)(f.View,{"data-index":t,className:h.tabClass(t===A,Q)+" "+m.bem("tab",{active:t===A,disabled:e.disabled,complete:!Q}),style:h.tabStyle({active:t===A,ellipsis:Q,color:G,type:W,disabled:e.disabled,titleActiveColor:ae,titleInactiveColor:ie,swipeThreshold:le,scrollable:V}),onClick:Oe,children:(0,x.jsxs)(f.View,{className:Q?"van-ellipsis":"",style:e.titleStyle,children:[e.title,(null!==e.info||e.dot)&&(0,x.jsx)(j.Info,{info:e.info,dot:e.dot,className:"van-tab__title__info"})]})},t)}))]})}),(0,x.jsx)(f.View,{className:m.bem("renderNavRight"+n.current),children:de})]})}),(0,x.jsx)(f.View,{className:"van-tabs__content",onTouchStart:function onTouchStart(e){E&&(t.current.swiping=!0,Ne(e))},onTouchMove:function onTouchMove(e){E&&t.current.swiping&&function touchMove(e){var n=e.touches[0];t.current.deltaX=n.clientX-t.current.startX,t.current.deltaY=n.clientY-t.current.startY,t.current.offsetX=Math.abs(t.current.deltaX),t.current.offsetY=Math.abs(t.current.deltaY),t.current.direction=t.current.direction||function getDirection(e,t){return e>t&&e>10?"horizontal":t>e&&t>10?"vertical":""}(t.current.offsetX,t.current.offsetY)}(e)},onTouchEnd:Ie,onTouchCancel:Ie,children:(0,x.jsx)(f.View,{className:m.bem("tabs__track",[{animated:ce}])+" van-tabs__track",style:h.trackStyle({duration:ne,currentIndex:A,animated:ce}),children:ge})})]}))}},"./node_modules/@antmjs/vantui/es/tabs/wxs.js":function(e,t,n){n.d(t,{tabClass:function(){return tabClass},tabStyle:function(){return tabStyle},trackStyle:function(){return trackStyle},lineStyle:function(){return lineStyle},navStyle:function(){return navStyle}});var r=n("./node_modules/@antmjs/vantui/es/wxs/style.js"),o=n("./node_modules/@antmjs/vantui/es/wxs/utils.js");function tabClass(e,t){var n=["tab-class"];return e&&n.push("tab-active-class"),t&&n.push("van-ellipsis"),n.join(" ")}function tabStyle(e){var t=e.active?e.titleActiveColor:e.titleInactiveColor,n=e.scrollable&&e.ellipsis;return"card"===e.type?(0,r.style)({"border-color":e.color,"background-color":!e.disabled&&e.active?e.color:null,color:t||(e.disabled||e.active?null:e.color),"flex-basis":n?88/e.swipeThreshold+"%":null}):(0,r.style)({color:t,"flex-basis":n?88/e.swipeThreshold+"%":null})}function navStyle(e,t){return(0,r.style)({"border-color":"card"===t&&e?e:null})}function trackStyle(e){return e.animated?(0,r.style)({transform:"translate3d(".concat(-100*e.currentIndex,"%, 0px, 0px)"),"-webkit-transform":"translate3d(".concat(-100*e.currentIndex,"%, 0px, 0px)"),"transition-duration":e.duration+"s","-webkit-transition-duration":e.duration+"s",transition:e.duration+"s"}):""}function lineStyle(e){return(0,r.style)({visibility:0===e.lineOffsetLeft?"hidden":"visible",width:o.addUnit(e.lineWidth),transform:"translateX("+e.lineOffsetLeft+"px)","-webkit-transform":"translateX("+e.lineOffsetLeft+"px)","background-color":e.color,height:-1!==e.lineHeight?o.addUnit(e.lineHeight):null,"border-radius":-1!==e.lineHeight?o.addUnit(e.lineHeight):null,"transition-duration":e.skipTransition?null:e.duration+"s","-webkit-transition-duration":e.skipTransition?null:e.duration+"s"})}},"./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,t,n){var r=n("./node_modules/@antmjs/vantui/es/icon/index.js"),o=n("./node_modules/@antmjs/vantui/es/cell/index.js"),a=n("./node_modules/@antmjs/vantui/es/toast/index.js"),i=n("./node_modules/@antmjs/vantui/es/tabs/index.js"),s=n("./node_modules/@antmjs/vantui/es/tab/index.js"),l=n("./node_modules/@antmjs/vantui/es/button/index.js"),c=n("./node_modules/@antmjs/vantui/es/image/index.js"),u=n("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),d=n("./node_modules/@antmjs/vantui/es/empty/index.js"),f=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),m=n("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),p=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),b=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),v=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),j=n("webpack/container/remote/react"),h=n("./src/pages/components/TabbarCom/index.tsx"),x=n("webpack/container/remote/@tarojs/taro"),y=n.n(x),g=n("./src/pages/components/ActiveCard/index.tsx"),w=n("./src/utils/index.ts"),_=n("./config.js"),k=n("webpack/container/remote/react/jsx-runtime");t.default=function my(e){var t=(0,j.useState)({}),n=(0,b.default)(t,2),x=(n[0],n[1]),S=(0,j.useState)(""),T=(0,b.default)(S,2),O=T[0],C=T[1],N=(0,j.useState)([]),I=(0,b.default)(N,2),P=(I[0],I[1]),V=(0,j.useState)([]),A=(0,b.default)(V,2),D=A[0],z=A[1],R=(0,j.useState)(0),E=(0,b.default)(R,2),L=E[0],X=E[1],F=(0,j.useState)(!1),M=(0,b.default)(F,2),Y=M[0],W=M[1],K=(0,j.useState)(!1),H=(0,b.default)(K,2),$=H[0],q=H[1];(0,j.useEffect)((function(){B()}),[]);var B=function(){var e=(0,p.default)((0,m.default)().mark((function _callee(){var e;return(0,m.default)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.phoneLogin)();case 2:e=t.sent,console.log("isLogin",e),W(e),q(!0);case 6:case"end":return t.stop()}}),_callee)})));return function getLogin(){return e.apply(this,arguments)}}();(0,j.useEffect)((function(){Y&&U()}),[Y]);var U=function getUserInfo(){var e;y().cloud.callFunction({name:"getOpenid",complete:(e=(0,p.default)((0,m.default)().mark((function _callee2(e){var t,n,r,o,a;return(0,m.default)().wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:console.log("callFunction test result: ",e),o=null==e||null===(t=e.result)||void 0===t||null===(n=t.event)||void 0===n||null===(r=n.userInfo)||void 0===r?void 0:r.openId,C(o),a={tableName:"userInfo",keyValue:{openId:o},okFun:function okFun(e){var t,n,r,a;console.log("userinfo--",e),x(null!==(t=null==e||null===(n=e.data)||void 0===n?void 0:n[0])&&void 0!==t?t:{}),P(null!==(r=null==e||null===(a=e.data)||void 0===a?void 0:a.activeidArr)&&void 0!==r?r:[]),G(o,"1")}},(0,w.getTable)(a);case 5:case"end":return i.stop()}}),_callee2)}))),function complete(t){return e.apply(this,arguments)})})},G=function getDetails(e,t){var n=y().cloud.database({}).command,r=t?{peopleArr:n.elemMatch({openid:n.eq(e),status:n.eq(t)})}:{peopleArr:n.elemMatch({openid:n.eq(e)})},o={tableName:"details",keyValue:(0,f.default)({},r),okFun:function okFun(e){var t;console.log("detailsData/usero--",e),z(null!==(t=null==e?void 0:e.data)&&void 0!==t?t:[])}};(0,w.getTable)(o)};(0,j.useEffect)((function(){}),[]);return(0,k.jsxs)(v.View,{className:"myContent",children:[(0,k.jsxs)(v.View,{className:"myImage",children:[(0,k.jsx)(c.default,{round:!0,width:"100px",height:"100px",src:"cloud://citynew-0givkbre03955d8c.6369-citynew-0givkbre03955d8c-1253655588/images/touxiang/images.jpg"}),!Y&&$&&(0,k.jsx)(v.View,{className:"loginBtn",children:(0,k.jsx)(l.default,{type:"primary",size:"mini",lang:"zh_CN",onClick:(0,p.default)((0,m.default)().mark((function _callee8(){return(0,m.default)().wrap((function _callee8$(e){for(;;)switch(e.prev=e.next){case 0:y().chooseAddress({success:function success(e){var t;console.log("AddressRes",e),y().cloud.callFunction({name:"getOpenid",complete:(t=(0,p.default)((0,m.default)().mark((function _callee7(t){var n,r,o,a,i;return(0,m.default)().wrap((function _callee7$(s){for(;;)switch(s.prev=s.next){case 0:return a=null==t||null===(n=t.result)||void 0===n||null===(r=n.event)||void 0===r||null===(o=r.userInfo)||void 0===o?void 0:o.openId,console.log("openid",a),i={tableName:"userInfo",keyValue:{openId:a},okFun:function(){var t=(0,p.default)((0,m.default)().mark((function _callee6(t){var n,r,o,a,i,s;return(0,m.default)().wrap((function _callee6$(l){for(;;)switch(l.prev=l.next){case 0:return console.log("userRes",t),s={tableName:"userInfo",id:null==t||null===(n=t.data)||void 0===n||null===(r=n[0])||void 0===r?void 0:r._id,objData:{authInfo:[].concat((0,u.default)(null!==(o=null==t||null===(a=t.data)||void 0===a||null===(i=a[0])||void 0===i?void 0:i.authInfo)&&void 0!==o?o:[]),[e])},okFun:function(){var e=(0,p.default)((0,m.default)().mark((function _callee5(e){return(0,m.default)().wrap((function _callee5$(t){for(;;)switch(t.prev=t.next){case 0:console.log("添加用户认证信息",e),W(!0);case 2:case"end":return t.stop()}}),_callee5)})));return function okFun(t){return e.apply(this,arguments)}}()},l.next=4,(0,w.updateTableid)((0,f.default)({},s));case 4:case"end":return l.stop()}}),_callee6)})));return function okFun(e){return t.apply(this,arguments)}}()},s.next=5,(0,w.getTable)((0,f.default)({},i));case 5:case"end":return s.stop()}}),_callee7)}))),function complete(e){return t.apply(this,arguments)})}),console.log(e.telNumber)}});case 1:case"end":return e.stop()}}),_callee8)}))),children:"登录"})})]}),(0,k.jsxs)(v.View,{children:[(0,k.jsxs)(i.default,{sticky:!0,active:L,onClick:function onClick(e){var t,n;console.log("e",e),G(O,null==e||null===(t=e.detail)||void 0===t?void 0:t.name),X(null==e||null===(n=e.detail)||void 0===n?void 0:n.index)},children:[(0,k.jsx)(s.default,{title:"待审核",name:"1"}),(0,k.jsx)(s.default,{title:"待参加",name:"2"}),(0,k.jsx)(s.default,{title:"已取消",name:"4"})]}),(0,k.jsx)(v.View,{children:function CardCom(){return(0,k.jsx)(v.View,{children:(null==D?void 0:D.length)>0?(0,k.jsx)(v.View,{children:D.splice(0,2).map((function(e,t){return(0,k.jsx)(v.View,{onClick:function onClick(){console.log("Card"),y().navigateTo({url:"/pages/activityList/components/details/index?id=".concat(null==e?void 0:e._id)})},children:(0,k.jsx)(g.default,{dataSource:e})})}))}):(0,k.jsx)(v.View,{children:(0,k.jsx)(d.default,{className:"customImage",image:"https://img.yzcdn.cn/vant/custom-empty-image.png"})})})}()})]}),(0,k.jsxs)(v.View,{className:"cellArr",children:[(0,k.jsx)(o.default,{icon:"star",title:"打卡记录",isLink:!0,onClick:function onClick(){Y?y().navigateTo({url:"/pages/my/components/CheckinDetail/index"}):a.default.fail({message:"请先登录",selector:"#vanToast-demo2"})}}),(0,k.jsx)(o.default,{icon:"manager",title:"申请成为领队",isLink:!0,onClick:function onClick(){a.default.fail({message:"首次参加活动后,可申请成为领队",selector:"#vanToast-demo2"})}}),(0,k.jsxs)(v.View,{className:"wechat",children:[(0,k.jsx)(r.default,{name:"wechat",size:"16px",className:"icon"}),(0,k.jsx)(l.default,{"open-type":"contact",className:"wecahtBtn",children:"联系我们"})]}),"people"!==_.type&&(0,k.jsx)(o.default,{title:"微信客服",icon:"wechat",isLink:!0,value:"",onClick:function onClick(){y().openCustomerServiceChat({corpId:"wwb04af9a97514271c",extInfo:{url:"https://work.weixin.qq.com/kfid/kfc70f3f112c97a54c5"},success:function success(e){}})}})]}),(0,k.jsx)(a.default,{id:"vanToast-demo2"}),(0,k.jsx)(h.default,{active:2})]})}},"./src/pages/my/index.tsx":function(e,t,n){var r=n("webpack/container/remote/@tarojs/runtime"),o=n("./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,r.createPageConfig)(o.default,"pages/my/index",{root:{cn:[]}},{navigationBarTitleText:"我的"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return t="./src/pages/my/index.tsx",e(e.s=t);var t}));e.O()}]); \ No newline at end of file +"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/my/index"],{"./node_modules/@antmjs/vantui/es/mixins/page-scroll.js":function(e,t,n){n.d(t,{usePageScroll:function(){return usePageScroll}});var o=n("webpack/container/remote/react"),r=n("webpack/container/remote/@tarojs/taro");n("webpack/container/remote/@tarojs/runtime"),n("webpack/container/remote/@tarojs/runtime").document;function usePageScroll(e){(0,o.useEffect)((function(){return void 0}),[e]),(0,r.usePageScroll)((function(t){e(t)}))}},"./node_modules/@antmjs/vantui/es/sticky/index.js":function(e,t,n){n.d(t,{Sticky:function(){return Sticky}});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/react"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),l=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=n("./node_modules/@antmjs/vantui/es/common/utils.js"),u=n("./node_modules/@antmjs/vantui/es/common/validator.js"),d=n("./node_modules/@antmjs/vantui/es/mixins/page-scroll.js"),f=n("./node_modules/@antmjs/vantui/es/sticky/wxs.js"),m=n("webpack/container/remote/react/jsx-runtime"),p=["zIndex","offsetTop","scrollTop","disabled","container","onScroll","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]:[];return t(e[0])}))}))}),[w]),I=(0,i.useCallback)((function(e){var t=Object.keys(e).reduce((function(t,n){return e[n]!==b[n]&&(t[n]=e[n]),t}),{});Object.keys(t).length>0&&v((function(e){return _objectSpread(_objectSpread({},e),t)})),null==_||_({detail:{scrollTop:C.current.scrollTop,isFixed:e.fixed||b.fixed}})}),[_,b]),P=(0,i.useCallback)((function(e){g?I({fixed:!1,transform:0}):(C.current.scrollTop=e||C.current.scrollTop,"function"!=typeof w?(0,c.getRect)(null,"#sticky-com-index".concat(t.current)).then((function(e){(0,u.isDef)(e)&&(x>=e.top?I({fixed:!0,height:e.height}):I({fixed:!1}))})):Promise.all([(0,c.getRect)(null,"#sticky-com-index".concat(t.current)),N()]).then((function(e){var t=(0,a.default)(e,2),n=t[0],o=t[1];n&&o&&(x+n.height>o.height+o.top?I({fixed:!1,transform:o.height-n.height}):x>=n.top?I({fixed:!0,height:n.height,transform:0}):I({fixed:!1,transform:0}))})).catch((function(e){console.log(e)})))}),[w,g,N,x,I]);return(0,i.useEffect)((function(){P(y)}),[y,w,g,x]),(0,d.usePageScroll)((function(e){P(e.scrollTop)})),(0,m.jsx)(s.View,_objectSpread(_objectSpread({id:"sticky-com-index".concat(t.current),className:" van-sticky "+(S||""),style:l.style([f.containerStyle({fixed:b.fixed,height:b.height,zIndex:j}),k])},O),{},{children:(0,m.jsx)(s.View,{className:l.bem("sticky-wrap",{fixed:b.fixed})+" ".concat(S||""),style:l.style([f.wrapStyle({fixed:b.fixed,offsetTop:x,transform:b.transform,zIndex:j}),k]),children:T})}))}},"./node_modules/@antmjs/vantui/es/sticky/wxs.js":function(e,t,n){n.d(t,{wrapStyle:function(){return wrapStyle},containerStyle:function(){return containerStyle}});var o=n("./node_modules/@antmjs/vantui/es/wxs/style.js");function wrapStyle(e){return(0,o.style)({transform:e.transform?"translate3d(0, "+e.transform+"px, 0)":"",top:e.fixed?e.offsetTop+"px":"","z-index":e.zIndex})}function containerStyle(e){return(0,o.style)({height:e.fixed?e.height+"px":"","z-index":e.zIndex})}},"./node_modules/@antmjs/vantui/es/tab/index.js":function(e,t,n){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/react"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),l=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=n("webpack/container/remote/react/jsx-runtime"),u=["children","style","className","active","lazyRender","lazyTimeout","animated","title"];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=ge.length||e<0)&&e!==A){var t=null!==A;I((function(t){return _objectSpread(_objectSpread({},t),{},{currentIndex:e})})),(0,v.requestAnimationFrame)((function(){Te(e),Ce(e)})),(0,c.nextTick)((function(){t&&we("onChange",ge[e])}))}},Se=function setCurrentIndexByName(e){var t=ge.filter((function(t){return(t.props.name||t.props.index)===e}));t.length&&ke(t[0].props.index)},Te=function resize(e){var o;"line"===W&&(e=null!==(o=e)&&void 0!==o?o:A,(0,c.nextTick)((function(){Promise.all([(0,v.getAllRect)(null,".tabs-com-index".concat(n.current," .van-tab")),(0,v.getRect)(null,".tabs-com-index".concat(n.current," .van-tabs__line"))]).then((function(n){var o=(0,a.default)(n,2),r=o[0],i=void 0===r?[]:r,s=o[1];if(i&&s){var l=i[e];if(null==l)return;var u=i.slice(0,e).reduce((function(e,t){return e+t.width}),0);u+=(l.width-s.width)/2+(Q?0:8),I((function(e){return _objectSpread(_objectSpread({},e),{},{lineOffsetLeft:u})})),t.current.swiping=!0,D&&(0,c.nextTick)((function(){I((function(e){return _objectSpread(_objectSpread({},e),{},{skipTransition:!1})}))}))}}))})))},Oe=function onTap(e){var t=e.currentTarget.dataset.index;t=parseInt(t);var n=ge[t];n.props.disabled?we("onDisabled",n):(ke(t),(0,c.nextTick)((function(){we("onClick",n)})))},Ce=function scrollIntoView(e){var t;V&&(e=null!==(t=e)&&void 0!==t?t:A,Promise.all([(0,v.getAllRect)(null,".tabs-com-index".concat(n.current," .van-tab")),(0,v.getRect)(null,".tabs-com-index".concat(n.current," .van-tabs__nav"))]).then((function(t){var n=(0,a.default)(t,2),o=n[0],r=n[1];if(o&&r){var i=o[e],s=o.slice(0,e).reduce((function(e,t){return e+t.width}),0);I((function(e){return _objectSpread(_objectSpread({},e),{},{scrollLeft:s-(r.width-i.width)/2})})),z||(0,c.nextTick)((function(){I((function(e){return _objectSpread(_objectSpread({},e),{},{scrollWithAnimation:!0})}))}))}})))},Ne=function touchStart(e){!function resetTouchStatus(){t.current.direction="",t.current.deltaX=0,t.current.deltaY=0,t.current.offsetX=0,t.current.offsetY=0}();var n=e.touches[0];t.current.startX=n.clientX,t.current.startY=n.clientY},Ie=function onTouchEnd(){if(R&&t.current.swiping){var e=t.current,n=e.direction,o=e.deltaX,r=e.offsetX;if("horizontal"===n&&r>=50){var a=function getAvaiableTab(e){for(var t=e>0?-1:1,n=t;A+n=0;n+=t){var o=A+n;if(o>=0&&ole||!Q})}))}),[le,ge,Q]),(0,u.useEffect)((function(){(0,c.nextTick)((function(){Te()}))}),[ge]);var Pe=(0,u.useCallback)((0,o.default)(l().mark((function _callee(){var e,t,o;return l().wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:if(e=0,!ue||!g){r.next=6;break}return r.next=4,(0,v.getAllRect)(null,"."+m.bem("renderNavLeft"+n.current));case 4:(t=r.sent).length&&(e+=t[0].width);case 6:if(!de||!g){r.next=11;break}return r.next=9,(0,v.getAllRect)(null,"."+m.bem("renderNavRight"+n.current));case 9:(o=r.sent).length&&(e+=o[0].width);case 11:e&&T("calc(100% - ".concat(e,"px)"));case 12:case"end":return r.stop()}}),_callee)}))),[ue,g,de]);return(0,u.useEffect)((function(){setTimeout((function(){Pe()}))}),[Pe,g]),(0,x.jsxs)(f.View,_objectSpread(_objectSpread({className:"tabs-com-index".concat(n.current," ")+" "+m.bem("tabs",[W]+" ".concat(je||"")),style:ve},xe),{},{children:[(0,x.jsx)(b.Sticky,{disabled:!K,zIndex:$,offsetTop:U,container:H,onScroll:fe,children:(0,x.jsxs)(f.View,{className:m.bem("tabs__wrap",{scrollable:V})+" "+("line"===W&&B?"van-hairline--top-bottom":""),children:[(0,x.jsx)(f.View,{className:m.bem("renderNavLeft"+n.current),children:ue}),(0,x.jsx)(f.ScrollView,{scrollX:V,scrollWithAnimation:z,scrollLeft:P,className:m.bem("tabs__scroll",[W]),style:{width:S,borderColor:G},children:(0,x.jsxs)(f.View,{className:m.bem("tabs__nav",[W,{complete:!Q}])+" nav-class",style:h.navStyle(G,W),children:["line"===W&&(0,x.jsx)(f.View,{className:"van-tabs__line",style:h.lineStyle({color:G,lineOffsetLeft:L,lineHeight:ee,skipTransition:D,duration:ne,lineWidth:re})}),ye.map((function(e,t){return(0,x.jsx)(f.View,{"data-index":t,className:h.tabClass(t===A,Q)+" "+m.bem("tab",{active:t===A,disabled:e.disabled,complete:!Q}),style:h.tabStyle({active:t===A,ellipsis:Q,color:G,type:W,disabled:e.disabled,titleActiveColor:ae,titleInactiveColor:ie,swipeThreshold:le,scrollable:V}),onClick:Oe,children:(0,x.jsxs)(f.View,{className:Q?"van-ellipsis":"",style:e.titleStyle,children:[e.title,(null!==e.info||e.dot)&&(0,x.jsx)(j.Info,{info:e.info,dot:e.dot,className:"van-tab__title__info"})]})},t)}))]})}),(0,x.jsx)(f.View,{className:m.bem("renderNavRight"+n.current),children:de})]})}),(0,x.jsx)(f.View,{className:"van-tabs__content",onTouchStart:function onTouchStart(e){R&&(t.current.swiping=!0,Ne(e))},onTouchMove:function onTouchMove(e){R&&t.current.swiping&&function touchMove(e){var n=e.touches[0];t.current.deltaX=n.clientX-t.current.startX,t.current.deltaY=n.clientY-t.current.startY,t.current.offsetX=Math.abs(t.current.deltaX),t.current.offsetY=Math.abs(t.current.deltaY),t.current.direction=t.current.direction||function getDirection(e,t){return e>t&&e>10?"horizontal":t>e&&t>10?"vertical":""}(t.current.offsetX,t.current.offsetY)}(e)},onTouchEnd:Ie,onTouchCancel:Ie,children:(0,x.jsx)(f.View,{className:m.bem("tabs__track",[{animated:ce}])+" van-tabs__track",style:h.trackStyle({duration:ne,currentIndex:A,animated:ce}),children:ge})})]}))}},"./node_modules/@antmjs/vantui/es/tabs/wxs.js":function(e,t,n){n.d(t,{tabClass:function(){return tabClass},tabStyle:function(){return tabStyle},trackStyle:function(){return trackStyle},lineStyle:function(){return lineStyle},navStyle:function(){return navStyle}});var o=n("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=n("./node_modules/@antmjs/vantui/es/wxs/utils.js");function tabClass(e,t){var n=["tab-class"];return e&&n.push("tab-active-class"),t&&n.push("van-ellipsis"),n.join(" ")}function tabStyle(e){var t=e.active?e.titleActiveColor:e.titleInactiveColor,n=e.scrollable&&e.ellipsis;return"card"===e.type?(0,o.style)({"border-color":e.color,"background-color":!e.disabled&&e.active?e.color:null,color:t||(e.disabled||e.active?null:e.color),"flex-basis":n?88/e.swipeThreshold+"%":null}):(0,o.style)({color:t,"flex-basis":n?88/e.swipeThreshold+"%":null})}function navStyle(e,t){return(0,o.style)({"border-color":"card"===t&&e?e:null})}function trackStyle(e){return e.animated?(0,o.style)({transform:"translate3d(".concat(-100*e.currentIndex,"%, 0px, 0px)"),"-webkit-transform":"translate3d(".concat(-100*e.currentIndex,"%, 0px, 0px)"),"transition-duration":e.duration+"s","-webkit-transition-duration":e.duration+"s",transition:e.duration+"s"}):""}function lineStyle(e){return(0,o.style)({visibility:0===e.lineOffsetLeft?"hidden":"visible",width:r.addUnit(e.lineWidth),transform:"translateX("+e.lineOffsetLeft+"px)","-webkit-transform":"translateX("+e.lineOffsetLeft+"px)","background-color":e.color,height:-1!==e.lineHeight?r.addUnit(e.lineHeight):null,"border-radius":-1!==e.lineHeight?r.addUnit(e.lineHeight):null,"transition-duration":e.skipTransition?null:e.duration+"s","-webkit-transition-duration":e.skipTransition?null:e.duration+"s"})}},"./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,t,n){var o=n("./node_modules/@antmjs/vantui/es/icon/index.js"),r=n("./node_modules/@antmjs/vantui/es/cell/index.js"),a=n("./node_modules/@antmjs/vantui/es/toast/index.js"),i=n("./node_modules/@antmjs/vantui/es/tabs/index.js"),s=n("./node_modules/@antmjs/vantui/es/tab/index.js"),l=n("./node_modules/@antmjs/vantui/es/button/index.js"),c=n("./node_modules/@antmjs/vantui/es/image/index.js"),u=n("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),d=n("./node_modules/@antmjs/vantui/es/empty/index.js"),f=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),m=n("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),p=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),b=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),v=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),j=n("webpack/container/remote/react"),h=n("./src/pages/components/TabbarCom/index.tsx"),x=n("webpack/container/remote/@tarojs/taro"),y=n.n(x),g=n("./src/pages/components/ActiveCard/index.tsx"),w=n("./src/utils/index.ts"),_=n("./config.js"),k=n("webpack/container/remote/react/jsx-runtime");t.default=function my(e){var t=(0,j.useState)({}),n=(0,b.default)(t,2),x=(n[0],n[1]),S=(0,j.useState)(""),T=(0,b.default)(S,2),O=T[0],C=T[1],N=(0,j.useState)([]),I=(0,b.default)(N,2),P=(I[0],I[1]),V=(0,j.useState)([]),A=(0,b.default)(V,2),D=A[0],z=A[1],L=(0,j.useState)(0),R=(0,b.default)(L,2),E=R[0],X=R[1],F=(0,j.useState)(!1),M=(0,b.default)(F,2),Y=M[0],W=M[1],K=(0,j.useState)(!1),H=(0,b.default)(K,2),$=H[0],q=H[1];(0,j.useEffect)((function(){U()}),[]);var U=function(){var e=(0,p.default)((0,m.default)().mark((function _callee(){var e;return(0,m.default)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.phoneLogin)();case 2:e=t.sent,console.log("isLogin",e),W(e),q(!0);case 6:case"end":return t.stop()}}),_callee)})));return function getLogin(){return e.apply(this,arguments)}}();(0,j.useEffect)((function(){Y&&B()}),[Y]);var B=function getUserInfo(){var e;y().cloud.callFunction({name:"getOpenid",complete:(e=(0,p.default)((0,m.default)().mark((function _callee2(e){var t,n,o,r,a;return(0,m.default)().wrap((function _callee2$(i){for(;;)switch(i.prev=i.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,C(r),a={tableName:"userInfo",keyValue:{openId:r},okFun:function okFun(e){var t,n,o,a;console.log("userinfo--",e),x(null!==(t=null==e||null===(n=e.data)||void 0===n?void 0:n[0])&&void 0!==t?t:{}),P(null!==(o=null==e||null===(a=e.data)||void 0===a?void 0:a.activeidArr)&&void 0!==o?o:[]),G(r,"1")}},(0,w.getTable)(a);case 5:case"end":return i.stop()}}),_callee2)}))),function complete(t){return e.apply(this,arguments)})})},G=function getDetails(e,t){var n=y().cloud.database({}).command,o=t?{peopleArr:n.elemMatch({openid:n.eq(e),status:n.eq(t)})}:{peopleArr:n.elemMatch({openid:n.eq(e)})},r={tableName:"details",keyValue:(0,f.default)({},o),okFun:function okFun(e){var t;console.log("detailsData/usero--",e),z(null!==(t=null==e?void 0:e.data)&&void 0!==t?t:[])}};(0,w.getTable)(r)};(0,j.useEffect)((function(){}),[]);return(0,k.jsxs)(v.View,{className:"myContent",children:[(0,k.jsxs)(v.View,{className:"myImage",children:[(0,k.jsx)(c.default,{round:!0,width:"100px",height:"100px",src:"cloud://citynew-0givkbre03955d8c.6369-citynew-0givkbre03955d8c-1253655588/images/touxiang/images.jpg"}),!Y&&$&&(0,k.jsx)(v.View,{className:"loginBtn",children:(0,k.jsx)(l.default,{type:"primary",size:"mini",lang:"zh_CN",onClick:(0,p.default)((0,m.default)().mark((function _callee8(){return(0,m.default)().wrap((function _callee8$(e){for(;;)switch(e.prev=e.next){case 0:y().chooseAddress({success:function success(e){var t;console.log("AddressRes",e),y().cloud.callFunction({name:"getOpenid",complete:(t=(0,p.default)((0,m.default)().mark((function _callee7(t){var n,o,r,a,i;return(0,m.default)().wrap((function _callee7$(s){for(;;)switch(s.prev=s.next){case 0:return a=null==t||null===(n=t.result)||void 0===n||null===(o=n.event)||void 0===o||null===(r=o.userInfo)||void 0===r?void 0:r.openId,console.log("openid",a),i={tableName:"userInfo",keyValue:{openId:a},okFun:function(){var t=(0,p.default)((0,m.default)().mark((function _callee6(t){var n,o,r,a,i,s;return(0,m.default)().wrap((function _callee6$(l){for(;;)switch(l.prev=l.next){case 0:return console.log("userRes",t),s={tableName:"userInfo",id:null==t||null===(n=t.data)||void 0===n||null===(o=n[0])||void 0===o?void 0:o._id,objData:{authInfo:[].concat((0,u.default)(null!==(r=null==t||null===(a=t.data)||void 0===a||null===(i=a[0])||void 0===i?void 0:i.authInfo)&&void 0!==r?r:[]),[e])},okFun:function(){var e=(0,p.default)((0,m.default)().mark((function _callee5(e){return(0,m.default)().wrap((function _callee5$(t){for(;;)switch(t.prev=t.next){case 0:console.log("添加用户认证信息",e),W(!0);case 2:case"end":return t.stop()}}),_callee5)})));return function okFun(t){return e.apply(this,arguments)}}()},l.next=4,(0,w.updateTableid)((0,f.default)({},s));case 4:case"end":return l.stop()}}),_callee6)})));return function okFun(e){return t.apply(this,arguments)}}()},s.next=5,(0,w.getTable)((0,f.default)({},i));case 5:case"end":return s.stop()}}),_callee7)}))),function complete(e){return t.apply(this,arguments)})}),console.log(e.telNumber)}});case 1:case"end":return e.stop()}}),_callee8)}))),children:"登录"})})]}),(0,k.jsxs)(v.View,{children:[(0,k.jsxs)(i.default,{sticky:!0,active:E,onClick:function onClick(e){var t,n;console.log("e",e),G(O,null==e||null===(t=e.detail)||void 0===t?void 0:t.name),X(null==e||null===(n=e.detail)||void 0===n?void 0:n.index)},children:[(0,k.jsx)(s.default,{title:"待审核",name:"1"}),(0,k.jsx)(s.default,{title:"待参加",name:"2"}),(0,k.jsx)(s.default,{title:"已取消",name:"4"})]}),(0,k.jsx)(v.View,{children:function CardCom(){return(0,k.jsx)(v.View,{children:(null==D?void 0:D.length)>0?(0,k.jsx)(v.View,{children:D.splice(0,2).map((function(e,t){return(0,k.jsx)(v.View,{onClick:function onClick(){console.log("Card"),y().navigateTo({url:"/pages/activityList/components/details/index?id=".concat(null==e?void 0:e._id)})},children:(0,k.jsx)(g.default,{dataSource:e})})}))}):(0,k.jsx)(v.View,{children:(0,k.jsx)(d.default,{className:"customImage",image:"https://img.yzcdn.cn/vant/custom-empty-image.png"})})})}()})]}),(0,k.jsxs)(v.View,{className:"cellArr",children:[(0,k.jsx)(r.default,{icon:"star",title:"打卡记录",isLink:!0,onClick:function onClick(){Y?y().navigateTo({url:"/pages/my/components/CheckinDetail/index"}):a.default.fail({message:"请先登录",selector:"#vanToast-demo2"})}}),(0,k.jsx)(r.default,{icon:"manager",title:"申请成为领队",isLink:!0,onClick:function onClick(){a.default.fail({message:"首次参加活动后,可申请成为领队",selector:"#vanToast-demo2"})}}),(0,k.jsxs)(v.View,{className:"wechat",children:[(0,k.jsx)(o.default,{name:"wechat",size:"16px",className:"icon"}),(0,k.jsx)(l.default,{"open-type":"contact",className:"wecahtBtn",children:"联系客服"})]}),"people"!==_.type&&(0,k.jsx)(r.default,{title:"微信客服",icon:"wechat",isLink:!0,value:"",onClick:function onClick(){y().openCustomerServiceChat({corpId:"wwb04af9a97514271c",extInfo:{url:"https://work.weixin.qq.com/kfid/kfc70f3f112c97a54c5"},success:function success(e){}})}}),(0,k.jsx)(r.default,{icon:"friends",title:"关于我们",isLink:!0,onClick:function onClick(){y().navigateTo({url:"/pages/my/components/AbountUs/index"})}}),(0,k.jsx)(r.default,{icon:"setting",title:"版本日志",isLink:!0,onClick:function onClick(){y().navigateTo({url:"/pages/my/components/Version/index"})}})]}),(0,k.jsx)(a.default,{id:"vanToast-demo2"}),(0,k.jsx)(h.default,{active:2})]})}},"./src/pages/my/index.tsx":function(e,t,n){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/my/index.tsx");Page((0,o.createPageConfig)(r.default,"pages/my/index",{root:{cn:[]}},{navigationBarTitleText:"我的"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return t="./src/pages/my/index.tsx",e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/src/pages/my/components/Version/index.tsx b/src/pages/my/components/Version/index.tsx index d51344c..02ecb53 100644 --- a/src/pages/my/components/Version/index.tsx +++ b/src/pages/my/components/Version/index.tsx @@ -1,18 +1,36 @@ -import { View } from "@tarojs/components"; +import { RichText, View } from "@tarojs/components"; import react, { useEffect } from "react"; import { Collapse, CollapseItem, Toast } from "@antmjs/vantui"; import "./index.scss"; +import { getTable } from "../../../../utils/index"; +import moment from "moment"; const Version = () => { - - useEffect(() => { - // 设置标题 - definePageConfig({ - navigationBarTitleText: "版本日志", - }); - }, []); + useEffect(() => { + // 设置标题 + definePageConfig({ + navigationBarTitleText: "版本日志", + }); + }, []); const [values, setValues] = react.useState(["1"]); + const [versionArr, setversionArr] = react.useState([]); + + useEffect(() => { + getTabledata(); + }); + // 版本跟心日志 + const getTabledata = async () => { + let paramsObj = { + tableName: "version", + okFun: (res: any) => { + // console.log("res", res); + setversionArr(res?.data ?? []); + }, + }; + await getTable({ ...paramsObj }); + return []; + }; return ( { // onOpen={(e) => Toast.show(`打开${e.detail}`)} // onClose={(e) => Toast.show(`关闭${e.detail}`)} > - {[ - { title: "2022-12-09", name: "name1", content: "content" }, - { title: "2022-12-08", name: "name2", content: "content" }, - { title: "2022-12-07", name: "name3", content: "content" }, - ].map((item: any, index: any) => { + {versionArr?.reverse()?.map((item: any, index: any) => { return ( - - {item?.content} + + {/* 富文本 */} + {}} className="RichText"> + + ); })} diff --git a/src/pages/my/index.tsx b/src/pages/my/index.tsx index 17756a5..75ee67b 100644 --- a/src/pages/my/index.tsx +++ b/src/pages/my/index.tsx @@ -350,7 +350,7 @@ const my = (props: any) => { {/* 微信客服 */} @@ -372,7 +372,7 @@ const my = (props: any) => { /> )} - {/* { url: "/pages/my/components/AbountUs/index", }); }} - /> */} + /> - {/* { url: "/pages/my/components/Version/index", }); }} - /> */} + /> diff --git a/src/utils/index.ts b/src/utils/index.ts index 95325d9..80eb794 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -22,6 +22,8 @@ export const getparams = () => { let $instance: any = getCurrentInstance(); return $instance?.router?.params; }; + + // 添加数据 export const addTable: any = ({ env, tableName, objData, okFun }: Typeint) => { // 数据库环境