From fa31230d8456724cfda7c2240677e9c696236249 Mon Sep 17 00:00:00 2001 From: eric Date: Sun, 27 Nov 2022 11:53:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=B6=E8=B4=A7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/common.js | 2 +- .../activityList/components/details/index.js | 2 +- dist/pages/home/index.js | 2 +- dist/pages/my/index.js | 2 +- dist/pages/my/index.js.LICENSE.txt | 2 + .../activityList/components/details/index.tsx | 4 +- src/pages/home/index.tsx | 11 +- src/pages/my/index.tsx | 112 +++++++++++++----- src/utils/index.ts | 8 +- 9 files changed, 103 insertions(+), 42 deletions(-) diff --git a/dist/common.js b/dist/common.js index b3783f5..4f1dd30 100644 --- a/dist/common.js +++ b/dist/common.js @@ -1,2 +1,2 @@ /*! For license information please see common.js.LICENSE.txt */ -"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["common"],{"./config.js":function(e,n,t){t.d(n,{type:function(){return a},envConfig:function(){return o}});var a="people",o="people"===a?"citynew-0givkbre03955d8c":"cloud1-5g5xrgza12a0dd6d"},"./src/pages/components/ActiveCard/index.tsx":function(e,n,t){var a=t("./node_modules/@antmjs/vantui/es/button/index.js"),o=t("./node_modules/@antmjs/vantui/es/image/index.js"),l=t("./node_modules/@antmjs/vantui/es/tag/index.js"),s=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),i=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=t("webpack/container/remote/react"),u=t("webpack/container/remote/moment"),r=t.n(u),d=t("webpack/container/remote/react/jsx-runtime");n.default=function ActiveCard(e){var n,t=(0,c.useState)({}),u=(0,s.default)(t,2),m=(u[0],u[1],null==e?void 0:e.dataSource),f=m.title,p=m.address,v=m.date,b=m.tagName,g=(m.tagCode,m.Status,m.images);m.isDelete;return(0,d.jsxs)(i.View,{className:"activeCard",children:[(0,d.jsxs)(i.View,{className:"left",children:[!1,(0,d.jsx)(i.View,{className:"leftImage",children:(0,d.jsx)(o.default,{width:"100%",height:"100px",fit:"cover",src:null==g||null===(n=g[0])||void 0===n?void 0:n.url})})]}),(0,d.jsxs)(i.View,{className:"middle",children:[(0,d.jsxs)(i.View,{className:"title",children:[(0,d.jsx)(l.default,{round:!0,type:"warning",style:{marginRight:"5px"},children:b}),(0,d.jsx)(i.Text,{children:f})]}),(0,d.jsxs)(i.View,{className:"down",children:[(0,d.jsxs)(i.View,{className:"date",children:[(0,d.jsx)(i.View,{className:"",children:p}),(0,d.jsx)(i.View,{className:"",children:r()(v).format("YYYY-MM-DD")})]}),(0,d.jsx)(i.View,{className:"btn",children:(0,d.jsx)(a.default,{plain:!0,hairline:!0,type:"primary",children:"立即查看"})})]})]})]})}},"./src/pages/components/TabbarCom/index.tsx":function(e,n,t){var a=t("./node_modules/@antmjs/vantui/es/tabbar/index.js"),o=t("./node_modules/@antmjs/vantui/es/tabbar-item/index.js"),l=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),s=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),i=t("webpack/container/remote/@tarojs/taro"),c=t.n(i),u=t("webpack/container/remote/react"),r=t.n(u),d=t("webpack/container/remote/react/jsx-runtime");n.default=function TabbarCom(e){var n,t=r().useState(null!==(n=null==e?void 0:e.active)&&void 0!==n?n:0),i=(0,l.default)(t,2),u=i[0],m=i[1];return(0,d.jsx)(s.View,{style:{marginTop:"40px"},children:(0,d.jsxs)(a.default,{active:u,onChange:function onChange(e){console.log("e",e),m(null==e?void 0:e.detail),0===(null==e?void 0:e.detail)&&c().redirectTo({url:"/pages/home/index"}),1===(null==e?void 0:e.detail)&&c().redirectTo({url:"/pages/activityList/index"}),2===(null==e?void 0:e.detail)&&c().redirectTo({url:"/pages/my/index"})},safeAreaInsetBottom:!0,children:[(0,d.jsx)(o.default,{icon:"home-o",children:"首页"}),(0,d.jsx)(o.default,{icon:"friends-o",children:"活动"}),(0,d.jsx)(o.default,{icon:"setting-o",children:"我的"})]})})}},"./src/utils/index.ts":function(e,n,t){t.d(n,{getTable:function(){return u},getTableid:function(){return r},updateTableid:function(){return d},phoneLogin:function(){return m}});var a=t("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),o=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),l=t("webpack/container/remote/@tarojs/taro"),s=t.n(l),i=t("./config.js"),c=function addTable(e){var n=e.env,t=e.tableName,a=e.objData,o=e.okFun,l=s().cloud.database({env:n}),i=null==l?void 0:l.collection(t);null==i||i.add({data:a,success:function success(e){o(e)},fail:function fail(e){console.log("err",e)}})},u=function getTable(e){var n,t=e.env,a=e.tableName,o=e.keyValue,l=void 0===o?{}:o,i=e.okFun,c=s().cloud.database({env:t}),u=null==c?void 0:c.collection(a);(null===(n=Object.keys(l))||void 0===n?void 0:n.length)>0?null==u||u.where(l).get({success:function success(e){i(e)}}):null==u||u.get({success:function success(e){i(e)}})},r=function getTableid(e){var n,t,a=e.env,o=e.tableName,l=e.id,i=e.keyValue,c=void 0===i?{}:i,u=e.okFun,r=s().cloud.database({env:a}),d=null==r?void 0:r.collection(o);(null===(n=Object.keys(c))||void 0===n?void 0:n.length)>0?null==d||d.doc(l).where(c).get({success:function success(e){u(e)},fail:function fail(e){console.log("err",e)}}):null==d||null===(t=d.doc(l))||void 0===t||t.get({success:function success(e){u(e)},fail:function fail(e){console.log("err",e)}})},d=function updateTableid(e){var n=e.env,t=e.tableName,a=e.objData,o=e.id,l=e.okFun,i=s().cloud.database({env:n});(null==i?void 0:i.collection(t)).doc(o).update({data:a,success:function success(e){l(e)},fail:function fail(e){console.log("err",e)}})},m=function(){var e=(0,o.default)((0,a.default)().mark((function _callee4(){return(0,a.default)().wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var t,l=s().cloud.database({}).command,r="";s().cloud.callFunction({name:"getOpenid",complete:(t=(0,o.default)((0,a.default)().mark((function _callee3(n){var t,o,s;return(0,a.default)().wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:console.log("callFunction test result: ",n),r=null==n||null===(t=n.result)||void 0===t||null===(o=t.event)||void 0===o||null===(s=o.userInfo)||void 0===s?void 0:s.openId,console.log("openId--",r),u({tableName:"userInfo",keyValue:{openId:l.eq(r)},okFun:function okFun(n){var t;console.log("res",n);var a,o,l=null!==(t=null==n?void 0:n.data)&&void 0!==t?t:[];if(0!==(null==l?void 0:l.length))return null!=l&&null!==(a=l[0])&&void 0!==a&&null!==(o=a.authInfo)&&void 0!==o&&o.authPhonenum||"people"===i.type?(e(!0),!0):(e(!1),!1);c({tableName:"userInfo",objData:{openId:r},okFun:function okFun(e){}})}});case 4:case"end":return a.stop()}}),_callee3)}))),function complete(e){return t.apply(this,arguments)})})})));case 1:case"end":return e.stop()}}),_callee4)})));return function phoneLogin(){return e.apply(this,arguments)}}()}}]); \ No newline at end of file +"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["common"],{"./config.js":function(e,n,t){t.d(n,{type:function(){return a},envConfig:function(){return l}});var a="people",l="people"===a?"citynew-0givkbre03955d8c":"cloud1-5g5xrgza12a0dd6d"},"./src/pages/components/ActiveCard/index.tsx":function(e,n,t){var a=t("./node_modules/@antmjs/vantui/es/button/index.js"),l=t("./node_modules/@antmjs/vantui/es/image/index.js"),o=t("./node_modules/@antmjs/vantui/es/tag/index.js"),i=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),s=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=t("webpack/container/remote/react"),u=t("webpack/container/remote/moment"),r=t.n(u),d=t("webpack/container/remote/react/jsx-runtime");n.default=function ActiveCard(e){var n,t=(0,c.useState)({}),u=(0,i.default)(t,2),m=(u[0],u[1],null==e?void 0:e.dataSource),f=m.title,p=m.address,v=m.date,b=m.tagName,g=(m.tagCode,m.Status,m.images);m.isDelete;return(0,d.jsxs)(s.View,{className:"activeCard",children:[(0,d.jsxs)(s.View,{className:"left",children:[!1,(0,d.jsx)(s.View,{className:"leftImage",children:(0,d.jsx)(l.default,{width:"100%",height:"100px",fit:"cover",src:null==g||null===(n=g[0])||void 0===n?void 0:n.url})})]}),(0,d.jsxs)(s.View,{className:"middle",children:[(0,d.jsxs)(s.View,{className:"title",children:[(0,d.jsx)(o.default,{round:!0,type:"warning",style:{marginRight:"5px"},children:b}),(0,d.jsx)(s.Text,{children:f})]}),(0,d.jsxs)(s.View,{className:"down",children:[(0,d.jsxs)(s.View,{className:"date",children:[(0,d.jsx)(s.View,{className:"",children:p}),(0,d.jsx)(s.View,{className:"",children:r()(v).format("YYYY-MM-DD")})]}),(0,d.jsx)(s.View,{className:"btn",children:(0,d.jsx)(a.default,{plain:!0,hairline:!0,type:"primary",children:"立即查看"})})]})]})]})}},"./src/pages/components/TabbarCom/index.tsx":function(e,n,t){var a=t("./node_modules/@antmjs/vantui/es/tabbar/index.js"),l=t("./node_modules/@antmjs/vantui/es/tabbar-item/index.js"),o=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),i=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=t("webpack/container/remote/@tarojs/taro"),c=t.n(s),u=t("webpack/container/remote/react"),r=t.n(u),d=t("webpack/container/remote/react/jsx-runtime");n.default=function TabbarCom(e){var n,t=r().useState(null!==(n=null==e?void 0:e.active)&&void 0!==n?n:0),s=(0,o.default)(t,2),u=s[0],m=s[1];return(0,d.jsx)(i.View,{style:{marginTop:"40px"},children:(0,d.jsxs)(a.default,{active:u,onChange:function onChange(e){console.log("e",e),m(null==e?void 0:e.detail),0===(null==e?void 0:e.detail)&&c().redirectTo({url:"/pages/home/index"}),1===(null==e?void 0:e.detail)&&c().redirectTo({url:"/pages/activityList/index"}),2===(null==e?void 0:e.detail)&&c().redirectTo({url:"/pages/my/index"})},safeAreaInsetBottom:!0,children:[(0,d.jsx)(l.default,{icon:"home-o",children:"首页"}),(0,d.jsx)(l.default,{icon:"friends-o",children:"活动"}),(0,d.jsx)(l.default,{icon:"setting-o",children:"我的"})]})})}},"./src/utils/index.ts":function(e,n,t){t.d(n,{getTable:function(){return u},getTableid:function(){return r},updateTableid:function(){return d},phoneLogin:function(){return m}});var a=t("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),l=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),o=t("webpack/container/remote/@tarojs/taro"),i=t.n(o),s=t("./config.js"),c=function addTable(e){var n=e.env,t=e.tableName,a=e.objData,l=e.okFun,o=i().cloud.database({env:n}),s=null==o?void 0:o.collection(t);null==s||s.add({data:a,success:function success(e){l(e)},fail:function fail(e){console.log("err",e)}})},u=function getTable(e){var n,t=e.env,a=e.tableName,l=e.keyValue,o=void 0===l?{}:l,s=e.okFun,c=i().cloud.database({env:t}),u=null==c?void 0:c.collection(a);(null===(n=Object.keys(o))||void 0===n?void 0:n.length)>0?null==u||u.where(o).get({success:function success(e){s(e)}}):null==u||u.get({success:function success(e){s(e)}})},r=function getTableid(e){var n,t,a=e.env,l=e.tableName,o=e.id,s=e.keyValue,c=void 0===s?{}:s,u=e.okFun,r=i().cloud.database({env:a}),d=null==r?void 0:r.collection(l);(null===(n=Object.keys(c))||void 0===n?void 0:n.length)>0?null==d||d.doc(o).where(c).get({success:function success(e){u(e)},fail:function fail(e){console.log("err",e)}}):null==d||null===(t=d.doc(o))||void 0===t||t.get({success:function success(e){u(e)},fail:function fail(e){console.log("err",e)}})},d=function updateTableid(e){var n=e.env,t=e.tableName,a=e.objData,l=e.id,o=e.okFun,s=i().cloud.database({env:n});(null==s?void 0:s.collection(t)).doc(l).update({data:a,success:function success(e){o(e)},fail:function fail(e){console.log("err",e)}})},m=function(){var e=(0,l.default)((0,a.default)().mark((function _callee4(){return(0,a.default)().wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var t,o=i().cloud.database({}).command,r="";i().cloud.callFunction({name:"getOpenid",complete:(t=(0,l.default)((0,a.default)().mark((function _callee3(n){var t,l,i;return(0,a.default)().wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:console.log("callFunction test result: ",n),r=null==n||null===(t=n.result)||void 0===t||null===(l=t.event)||void 0===l||null===(i=l.userInfo)||void 0===i?void 0:i.openId,console.log("openId--",r),u({tableName:"userInfo",keyValue:{openId:o.eq(r)},okFun:function okFun(n){var t;console.log("res",n);var a,l,o,i=null!==(t=null==n?void 0:n.data)&&void 0!==t?t:[];if(0!==(null==i?void 0:i.length))return null!=i&&null!==(a=i[0])&&void 0!==a&&null!==(l=a.authInfo)&&void 0!==l&&null!==(o=l[0])&&void 0!==o&&o.telNumber?(e(!0),!0):(s.type,e(!1),!1);c({tableName:"userInfo",objData:{openId:r},okFun:function okFun(e){}})}});case 4:case"end":return a.stop()}}),_callee3)}))),function complete(e){return t.apply(this,arguments)})})})));case 1:case"end":return e.stop()}}),_callee4)})));return function phoneLogin(){return e.apply(this,arguments)}}()}}]); \ No newline at end of file diff --git a/dist/pages/activityList/components/details/index.js b/dist/pages/activityList/components/details/index.js index b891de8..dc0c552 100644 --- a/dist/pages/activityList/components/details/index.js +++ b/dist/pages/activityList/components/details/index.js @@ -1,2 +1,2 @@ /*! For license information please see index.js.LICENSE.txt */ -"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/activityList/components/details/index"],{"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/activityList/components/details/index.tsx":function(e,n,t){var l=t("./node_modules/@antmjs/vantui/es/skeleton/index.js"),o=t("./node_modules/@antmjs/vantui/es/dialog/index.js"),a=t("./node_modules/@antmjs/vantui/es/button/index.js"),i=t("./node_modules/@antmjs/vantui/es/cell/index.js"),s=t("./node_modules/@antmjs/vantui/es/image/index.js"),u=t("./node_modules/@antmjs/vantui/es/toast/index.js"),d=t("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),c=t("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),r=t("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),f=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),v=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),m=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),p=t("webpack/container/remote/@tarojs/taro"),h=t.n(p),j=t("webpack/container/remote/react"),x=t.n(j),b=t("./src/utils/index.ts"),g=t("webpack/container/remote/lodash"),w=t.n(g),k=t("webpack/container/remote/moment"),C=t.n(k),T=t("webpack/container/remote/react/jsx-runtime");n.default=function details(){var e,n,t,g,k,S,y,_=(0,j.useState)([]),A=(0,v.default)(_,2),D=A[0],V=A[1],F=(0,j.useState)("0"),L=(0,v.default)(F,2),N=L[0],E=L[1],Y=(0,j.useState)(),I=(0,v.default)(Y,2),M=I[0],B=I[1],H=(0,j.useState)(!1),O=(0,v.default)(H,2),P=O[0],R=O[1],J=(0,j.useState)(""),q=(0,v.default)(J,2),z=(q[0],q[1],(0,j.useState)(0)),G=(0,v.default)(z,2),$=G[0],K=G[1],Q=(0,p.getCurrentInstance)(),U=(null!==(e=null==Q||null===(n=Q.router)||void 0===n?void 0:n.params)&&void 0!==e?e:{}).id,W=(0,j.useState)(!1),X=(0,v.default)(W,2),Z=(X[0],X[1]),ee=(0,j.useState)(""),ne=(0,v.default)(ee,2),te=ne[0],le=ne[1],oe=x().useState(!1),ae=(0,v.default)(oe,2),ie=ae[0],se=ae[1],ue=x().useState(!1),de=(0,v.default)(ue,2),ce=de[0],re=de[1],fe=x().useState(""),ve=(0,v.default)(fe,2);ve[0],ve[1];(0,j.useEffect)((function(){R("1"===N||"1"!==M)}),[N,M]),(0,j.useEffect)((function(){}),[]),(0,p.useShareTimeline)((function(){return{title:"分享朋友圈"}})),(0,j.useEffect)((function(){h().showShareMenu({withShareTicket:!0}),h().updateShareMenu({withShareTicket:!0,success:function success(){}})}),[]),(0,j.useEffect)((function(){var e;h().cloud.callFunction({name:"getOpenid",complete:(e=(0,f.default)((0,r.default)().mark((function _callee(e){var n,t,l,o;return(0,r.default)().wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:console.log("callFunction test result: ",e),o=null==e||null===(n=e.result)||void 0===n||null===(t=n.event)||void 0===t||null===(l=t.userInfo)||void 0===l?void 0:l.openId,le(o);case 3:case"end":return a.stop()}}),_callee)}))),function complete(n){return e.apply(this,arguments)})})}),[]),(0,j.useEffect)((function(){var e,n=h().getSystemInfoSync(),t=n.screenHeight,l=n.safeArea,o=void 0===l?{}:l,a=null!==(e=t-(null==o?void 0:o.bottom))&&void 0!==e?e:0;K(a)}),[]),(0,j.useEffect)((function(){te&&me()}),[te]);var me=function getDetail(){var e={tableName:"details",id:U,okFun:function okFun(e){var n,t,l,o,a,i,s;console.log("res",e),V(null!==(n=null==e?void 0:e.data)&&void 0!==n?n:{}),console.log("dataSource ",D),B(null!==(t=null==e||null===(l=e.data)||void 0===l?void 0:l.Status)&&void 0!==t?t:"");var u=null!==(o=null==e||null===(a=e.data)||void 0===a?void 0:a.peopleArr)&&void 0!==o?o:[];(null==u?void 0:u.length)>0?u.forEach((function(e){var n;(null==e?void 0:e.openid)===te&&E(null!==(n=null==e?void 0:e.status)&&void 0!==n?n:"0")})):E("0"),(null!==(i=null==e||null===(s=e.data)||void 0===s?void 0:s.useridArr)&&void 0!==i?i:[]).includes(te)?Z(!0):Z(!1)}};(0,b.getTableid)(e)},pe=[{label:"活动待开放",value:"0"},{label:"活动已取消",value:"2"},{label:"活动进行中",value:"3"},{label:"活动已结束",value:"4"},{label:"活动已关闭",value:"5"}],he=function userinfoPost(){var e={tableName:"userInfo",keyValue:{openId:te},okFun:function okFun(e){var n,t,l,o,a={tableName:"userInfo",id:null==e||null===(n=e.data)||void 0===n||null===(t=n[0])||void 0===t?void 0:t._id,objData:{activeidArr:[].concat((0,d.default)(null!==(l=null==e||null===(o=e.data)||void 0===o?void 0:o.activeidArr)&&void 0!==l?l:[]),[te])},okFun:function okFun(e){console.log("添加用户记录",e)}};(0,b.updateTableid)((0,c.default)({},a))}};(0,b.getTable)((0,c.default)({},e))};return(0,T.jsx)(m.View,{children:(null===(t=Object.keys(D))||void 0===t?void 0:t.length)>0?(0,T.jsxs)(m.View,{className:"detailContent",children:[(0,T.jsxs)(m.View,{children:[(0,T.jsx)(m.View,{children:null==D?void 0:D.title}),(0,T.jsx)(s.default,{width:"100%",height:"180px",fit:"cover",src:null==D||null===(g=D.images)||void 0===g||null===(k=g[0])||void 0===k?void 0:k.url}),(0,T.jsxs)(m.View,{children:[(0,T.jsx)(i.default,{icon:"clock",title:"开始时间 ".concat(null!=D&&D.startTime?C()(null==D?void 0:D.startTime).format("YYYY-MM-DD HH:mm:ss"):"")}),(0,T.jsx)(i.default,{icon:"clock",title:"结束时间 ".concat(null!=D&&D.endTime?C()(null==D?void 0:D.endTime).format("YYYY-MM-DD HH:mm:ss"):"")}),(0,T.jsx)(i.default,{isLink:!0,icon:"location",title:"".concat(null==D?void 0:D.address),linkType:"navigateTo",url:"/pages/dashboard/index",onClick:function onClick(){h().openLocation({latitude:null==D?void 0:D.latitude,longitude:null==D?void 0:D.longitude,scale:18})}}),(0,T.jsx)(i.default,{icon:"friends",title:"已报名人数 ".concat((null===(S=(null!==(y=null==D?void 0:D.peopleArr)&&void 0!==y?y:[]).filter((function(e){return"2"===(null==e?void 0:e.status)||"1"===(null==e?void 0:e.status)})))||void 0===S?void 0:S.length)>>0)})]})]}),(0,T.jsx)(m.View,{onClick:function onClick(){},className:"RichText",children:(0,T.jsx)(m.RichText,{nodes:null==D?void 0:D.richText})}),(0,T.jsx)(m.View,{children:(0,T.jsx)(o.default,{id:"vanDialog3",title:"长按二维码识别",showCancelButton:!1,showConfirmButton:!1,show:ie,onClose:function onClose(){return se(!1)},children:(0,T.jsxs)(m.View,{className:"wechatCode",children:[(0,T.jsx)(s.default,{showMenuByLongpress:!0,width:300,height:300,src:null==D?void 0:D.qrCode}),(0,T.jsx)(a.default,{style:{width:"130px",marginTop:"20px"},type:"primary",round:!0,size:"small",onClick:function onClick(){se(!1)},children:"关闭"})]})})}),(0,T.jsx)(m.View,{children:(0,T.jsx)(o.default,{id:"vanDialog4",title:"取消后,再次报名,会严格审核",show:ce,onClose:function onClose(){return se(!1)},onConfirm:function onConfirm(){!function canelActive(){var e,n=(null!==(e=null==D?void 0:D.peopleArr)&&void 0!==e?e:[]).map((function(e,n,t){return(null==e?void 0:e.openid)===te?(0,c.default)((0,c.default)({},e),{},{status:"4"}):(0,c.default)({},e)}));(0,b.updateTableid)({tableName:"details",id:U,objData:{peopleArr:(0,d.default)(n)},okFun:function okFun(e){u.default.success({message:"取消成功",selector:"#vanToast-demo2",onClose:function onClose(){me()}})}})}()},children:(0,T.jsx)(m.View,{className:"wechatCode"})})}),(0,T.jsxs)(m.View,{className:"detailBtn",style:{bottom:"".concat(null!=$?$:0,"px")},children:[(0,T.jsx)(a.default,{type:P?"warning":"primary",block:!0,onClick:function onClick(){return P?(se(!0),!1):"2"===N?(re(!0),!1):"4"===N?(u.default.fail({message:"再次报名需审核!",selector:"#vanToast-demo2",duration:2e3,onClose:function onClose(){se(!0)}}),!1):void((0,b.phoneLogin)()?(console.log("id",U),function detailPost(){var e,n,t={id:U,tableName:"details",objData:{useridArr:[].concat((0,d.default)(w().cloneDeep(null!==(e=null==D?void 0:D.useridArr)&&void 0!==e?e:[])),[te]),peopleArr:[].concat((0,d.default)(w().cloneDeep(null!==(n=null==D?void 0:D.peopleArr)&&void 0!==n?n:[])),[{openid:te,status:"1"}])},okFun:function okFun(e){console.log("res333",e),u.default.success({message:"报名成功,审核中",selector:"#vanToast-demo2",onClose:function onClose(){he(),se(!0),me()}})}};console.log("postData",t),(0,b.updateTableid)((0,c.default)({},t))}()):u.default.fail({message:"请先登录",selector:"#vanToast-demo2",duration:2e3,onClose:function onClose(){h().navigateTo({url:"/pages/my/index"})}}))},children:function btnContent(){console.log("detailStatus,status,openid",M,N,te);var e="立即报名";return"1"===M?("0"===N&&(e="立即报名"),"4"===N&&(e="再次报名"),"2"===N&&(e="取消报名"),"1"===N&&(e="待审核")):pe.forEach((function(n){var t=null==D?void 0:D.Status;(null==n?void 0:n.value)===t&&(e=null==n?void 0:n.label)})),e}()}),(0,T.jsx)(u.default,{id:"vanToast-demo2"})]})]}):(0,T.jsx)(m.View,{children:(0,T.jsx)(l.default,{title:!0,row:16})})})}},"./src/pages/activityList/components/details/index.tsx":function(e,n,t){var l=t("webpack/container/remote/@tarojs/runtime"),o=t("./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/activityList/components/details/index.tsx");o.default.enableShareTimeline=!0;Page((0,l.createPageConfig)(o.default,"pages/activityList/components/details/index",{root:{cn:[]}},{navigationBarTitleText:"活动详情"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return n="./src/pages/activityList/components/details/index.tsx",e(e.s=n);var n}));e.O()}]); \ No newline at end of file +"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/activityList/components/details/index"],{"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/activityList/components/details/index.tsx":function(e,t,n){var l=n("./node_modules/@antmjs/vantui/es/skeleton/index.js"),o=n("./node_modules/@antmjs/vantui/es/dialog/index.js"),a=n("./node_modules/@antmjs/vantui/es/button/index.js"),i=n("./node_modules/@antmjs/vantui/es/cell/index.js"),s=n("./node_modules/@antmjs/vantui/es/image/index.js"),u=n("./node_modules/@antmjs/vantui/es/toast/index.js"),d=n("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),r=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),c=n("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),f=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),v=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),m=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),p=n("webpack/container/remote/@tarojs/taro"),x=n.n(p),h=n("webpack/container/remote/react"),b=n.n(h),j=n("./src/utils/index.ts"),g=n("webpack/container/remote/lodash"),w=n.n(g),k=n("webpack/container/remote/moment"),C=n.n(k),T=n("webpack/container/remote/react/jsx-runtime");t.default=function details(){var e,t,n,g,k,S,y,_=(0,h.useState)([]),A=(0,v.default)(_,2),D=A[0],V=A[1],F=(0,h.useState)("0"),L=(0,v.default)(F,2),N=L[0],E=L[1],Y=(0,h.useState)(),I=(0,v.default)(Y,2),M=I[0],B=I[1],H=(0,h.useState)(!1),O=(0,v.default)(H,2),P=O[0],R=O[1],J=(0,h.useState)(""),$=(0,v.default)(J,2),q=($[0],$[1],(0,h.useState)(0)),z=(0,v.default)(q,2),G=z[0],K=z[1],Q=(0,p.getCurrentInstance)(),U=(null!==(e=null==Q||null===(t=Q.router)||void 0===t?void 0:t.params)&&void 0!==e?e:{}).id,W=(0,h.useState)(!1),X=(0,v.default)(W,2),Z=(X[0],X[1]),ee=(0,h.useState)(""),te=(0,v.default)(ee,2),ne=te[0],le=te[1],oe=b().useState(!1),ae=(0,v.default)(oe,2),ie=ae[0],se=ae[1],ue=b().useState(!1),de=(0,v.default)(ue,2),re=de[0],ce=de[1],fe=b().useState(""),ve=(0,v.default)(fe,2);ve[0],ve[1];(0,h.useEffect)((function(){R("1"===N||"1"!==M)}),[N,M]),(0,h.useEffect)((function(){}),[]),(0,p.useShareTimeline)((function(){return{title:"分享朋友圈"}})),(0,h.useEffect)((function(){x().showShareMenu({withShareTicket:!0}),x().updateShareMenu({withShareTicket:!0,success:function success(){}})}),[]),(0,h.useEffect)((function(){var e;x().cloud.callFunction({name:"getOpenid",complete:(e=(0,f.default)((0,c.default)().mark((function _callee(e){var t,n,l,o;return(0,c.default)().wrap((function _callee$(a){for(;;)switch(a.prev=a.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===(l=n.userInfo)||void 0===l?void 0:l.openId,le(o);case 3:case"end":return a.stop()}}),_callee)}))),function complete(t){return e.apply(this,arguments)})})}),[]),(0,h.useEffect)((function(){var e,t=x().getSystemInfoSync(),n=t.screenHeight,l=t.safeArea,o=void 0===l?{}:l,a=null!==(e=n-(null==o?void 0:o.bottom))&&void 0!==e?e:0;K(a)}),[]),(0,h.useEffect)((function(){ne&&me()}),[ne]);var me=function getDetail(){var e={tableName:"details",id:U,okFun:function okFun(e){var t,n,l,o,a,i,s;console.log("res",e),V(null!==(t=null==e?void 0:e.data)&&void 0!==t?t:{}),console.log("dataSource ",D),B(null!==(n=null==e||null===(l=e.data)||void 0===l?void 0:l.Status)&&void 0!==n?n:"");var u=null!==(o=null==e||null===(a=e.data)||void 0===a?void 0:a.peopleArr)&&void 0!==o?o:[];(null==u?void 0:u.length)>0?u.forEach((function(e){var t;(null==e?void 0:e.openid)===ne&&E(null!==(t=null==e?void 0:e.status)&&void 0!==t?t:"0")})):E("0"),(null!==(i=null==e||null===(s=e.data)||void 0===s?void 0:s.useridArr)&&void 0!==i?i:[]).includes(ne)?Z(!0):Z(!1)}};(0,j.getTableid)(e)},pe=[{label:"活动待开放",value:"0"},{label:"活动已取消",value:"2"},{label:"活动进行中",value:"3"},{label:"活动已结束",value:"4"},{label:"活动已关闭",value:"5"}],xe=function detailPost(){var e,t,n={id:U,tableName:"details",objData:{useridArr:[].concat((0,d.default)(w().cloneDeep(null!==(e=null==D?void 0:D.useridArr)&&void 0!==e?e:[])),[ne]),peopleArr:[].concat((0,d.default)(w().cloneDeep(null!==(t=null==D?void 0:D.peopleArr)&&void 0!==t?t:[])),[{openid:ne,status:"1"}])},okFun:function okFun(e){console.log("res333",e),u.default.success({message:"报名成功,审核中",selector:"#vanToast-demo2",onClose:function onClose(){he(),se(!0),me()}})}};console.log("postData",n),(0,j.updateTableid)((0,r.default)({},n))},he=function userinfoPost(){var e={tableName:"userInfo",keyValue:{openId:ne},okFun:function okFun(e){var t,n,l,o,a={tableName:"userInfo",id:null==e||null===(t=e.data)||void 0===t||null===(n=t[0])||void 0===n?void 0:n._id,objData:{activeidArr:[].concat((0,d.default)(null!==(l=null==e||null===(o=e.data)||void 0===o?void 0:o.activeidArr)&&void 0!==l?l:[]),[ne])},okFun:function okFun(e){console.log("添加用户记录",e)}};(0,j.updateTableid)((0,r.default)({},a))}};(0,j.getTable)((0,r.default)({},e))};return(0,T.jsx)(m.View,{children:(null===(n=Object.keys(D))||void 0===n?void 0:n.length)>0?(0,T.jsxs)(m.View,{className:"detailContent",children:[(0,T.jsxs)(m.View,{children:[(0,T.jsx)(m.View,{children:null==D?void 0:D.title}),(0,T.jsx)(s.default,{width:"100%",height:"180px",fit:"cover",src:null==D||null===(g=D.images)||void 0===g||null===(k=g[0])||void 0===k?void 0:k.url}),(0,T.jsxs)(m.View,{children:[(0,T.jsx)(i.default,{icon:"clock",title:"开始时间 ".concat(null!=D&&D.startTime?C()(null==D?void 0:D.startTime).format("YYYY-MM-DD HH:mm:ss"):"")}),(0,T.jsx)(i.default,{icon:"clock",title:"结束时间 ".concat(null!=D&&D.endTime?C()(null==D?void 0:D.endTime).format("YYYY-MM-DD HH:mm:ss"):"")}),(0,T.jsx)(i.default,{isLink:!0,icon:"location",title:"".concat(null==D?void 0:D.address),linkType:"navigateTo",url:"/pages/dashboard/index",onClick:function onClick(){x().openLocation({latitude:null==D?void 0:D.latitude,longitude:null==D?void 0:D.longitude,scale:18})}}),(0,T.jsx)(i.default,{icon:"friends",title:"已报名人数 ".concat((null===(S=(null!==(y=null==D?void 0:D.peopleArr)&&void 0!==y?y:[]).filter((function(e){return"2"===(null==e?void 0:e.status)||"1"===(null==e?void 0:e.status)})))||void 0===S?void 0:S.length)>>0)})]})]}),(0,T.jsx)(m.View,{onClick:function onClick(){},className:"RichText",children:(0,T.jsx)(m.RichText,{nodes:null==D?void 0:D.richText})}),(0,T.jsx)(m.View,{children:(0,T.jsx)(o.default,{id:"vanDialog3",title:"长按二维码识别",showCancelButton:!1,showConfirmButton:!1,show:ie,onClose:function onClose(){return se(!1)},children:(0,T.jsxs)(m.View,{className:"wechatCode",children:[(0,T.jsx)(s.default,{showMenuByLongpress:!0,width:300,height:300,src:null==D?void 0:D.qrCode}),(0,T.jsx)(a.default,{style:{width:"130px",marginTop:"20px"},type:"primary",round:!0,size:"small",onClick:function onClick(){se(!1)},children:"关闭"})]})})}),(0,T.jsx)(m.View,{children:(0,T.jsx)(o.default,{id:"vanDialog4",title:"取消后,再次报名,会严格审核",show:re,onClose:function onClose(){return se(!1)},onConfirm:function onConfirm(){!function canelActive(){var e,t=(null!==(e=null==D?void 0:D.peopleArr)&&void 0!==e?e:[]).map((function(e,t,n){return(null==e?void 0:e.openid)===ne?(0,r.default)((0,r.default)({},e),{},{status:"4"}):(0,r.default)({},e)}));(0,j.updateTableid)({tableName:"details",id:U,objData:{peopleArr:(0,d.default)(t)},okFun:function okFun(e){u.default.success({message:"取消成功",selector:"#vanToast-demo2",onClose:function onClose(){me()}})}})}()},children:(0,T.jsx)(m.View,{className:"wechatCode"})})}),(0,T.jsxs)(m.View,{className:"detailBtn",style:{bottom:"".concat(null!=G?G:0,"px")},children:[(0,T.jsx)(a.default,{type:P?"warning":"primary",block:!0,onClick:(0,f.default)((0,c.default)().mark((function _callee2(){return(0,c.default)().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:if(!P){e.next=3;break}return se(!0),e.abrupt("return",!1);case 3:if("2"!==N){e.next=6;break}return ce(!0),e.abrupt("return",!1);case 6:if("4"!==N){e.next=9;break}return u.default.fail({message:"再次报名需审核!",selector:"#vanToast-demo2",duration:2e3,onClose:function onClose(){se(!0)}}),e.abrupt("return",!1);case 9:return e.next=11,(0,j.phoneLogin)();case 11:e.sent?(console.log("id",U),xe()):u.default.fail({message:"请先登录",selector:"#vanToast-demo2",duration:2e3,onClose:function onClose(){x().navigateTo({url:"/pages/my/index"})}});case 13:case"end":return e.stop()}}),_callee2)}))),children:function btnContent(){console.log("detailStatus,status,openid",M,N,ne);var e="立即报名";return"1"===M?("0"===N&&(e="立即报名"),"4"===N&&(e="再次报名"),"2"===N&&(e="取消报名"),"1"===N&&(e="待审核")):pe.forEach((function(t){var n=null==D?void 0:D.Status;(null==t?void 0:t.value)===n&&(e=null==t?void 0:t.label)})),e}()}),(0,T.jsx)(u.default,{id:"vanToast-demo2"})]})]}):(0,T.jsx)(m.View,{children:(0,T.jsx)(l.default,{title:!0,row:16})})})}},"./src/pages/activityList/components/details/index.tsx":function(e,t,n){var l=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/activityList/components/details/index.tsx");o.default.enableShareTimeline=!0;Page((0,l.createPageConfig)(o.default,"pages/activityList/components/details/index",{root:{cn:[]}},{navigationBarTitleText:"活动详情"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return t="./src/pages/activityList/components/details/index.tsx",e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/dist/pages/home/index.js b/dist/pages/home/index.js index c4b13ab..bb40b43 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/field/index.js":function(e,t,n){"use strict";n.d(t,{Field:function(){return Field}});var o=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=n("webpack/container/remote/@tarojs/taro"),i=n("webpack/container/remote/react"),l=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=n("./node_modules/@antmjs/vantui/es/cell/index.js"),u=n("./node_modules/@antmjs/vantui/es/icon/index.js"),d=(n("./node_modules/@antmjs/vantui/es/utils/index.js"),n("./node_modules/@antmjs/vantui/es/field/wxs.js")),m=n("webpack/container/remote/react/jsx-runtime");n("webpack/container/remote/@tarojs/runtime").document;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=H}),children:j.length>=H?H:j.length}),"/"+H]}),$&&(0,m.jsx)(l.View,{className:s.bem("field__error-message",[B,{disabled:A,error:U}]),children:$})]})}},"./node_modules/@antmjs/vantui/es/field/wxs.js":function(e,t,n){"use strict";n.d(t,{inputStyle:function(){return inputStyle}});var o=n("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=n("./node_modules/@antmjs/vantui/es/wxs/add-unit.js");function inputStyle(e){return e&&"Object"===e.constructor.name?(0,o.style)({"min-height":(0,r.addUnit)(e.minHeight),"max-height":(0,r.addUnit)(e.maxHeight)}):""}},"./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"),s=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=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),O=(0,i.useState)({}),T=(0,o.default)(O,2),P=T[0],N=T[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,s=y.iconSize;N({center:a,border:t,square:n,gutter:o,clickable:r,direction:i,reverse:l,iconSize:s,index:w,columnNum:e})}),[y,w]);return(0,d.jsx)(a.View,{className:" "+s.bem("grid-item",{square:null==P?void 0:P.square})+" "+k,style:s.style([u.wrapperStyle({square:null==P?void 0:P.square,gutter:null==P?void 0:P.gutter,columnNum:null==P?void 0:P.columnNum,index:null==P?void 0:P.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 "+s.bem("grid-item__content",[null==P?void 0:P.direction,{center:null==P?void 0:P.center,square:null==P?void 0:P.square,reverse:null==P?void 0:P.reverse,clickable:null==P?void 0:P.clickable,surround:(null==P?void 0:P.border)&&(null==P?void 0:P.gutter)}])+" "+(null!=P&&P.border?"van-hairline--surround":""),style:u.contentStyle({square:null==P?void 0:P.square,gutter:null==P?void 0:P.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)(c.default,{name:t,color:n,classPrefix:p,dot:v,info:b||h,size:null==P?void 0:P.iconSize}):P.renderIcon}),(0,d.jsx)(a.View,{className:"van-grid-item__text text-class",children:j?(0,d.jsx)(a.Text,{children:j}):P.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"),s=n("webpack/container/remote/react/jsx-runtime"),c=["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,O=(0,o.default)(e,c),T=(0,a.useRef)([]),P=(0,a.useCallback)((function(){T.current.forEach((function(e){e.updateStyle()}))}),[]);(0,a.useEffect)((function(){P()}),[P]);var N=(0,a.useCallback)((function(e,t){T.current[e]=t}),[]),I=(0,a.useMemo)((function(){var e=[];return O.children&&Array.isArray(O.children)&&O.children.forEach((function(t,o){e.push((0,a.cloneElement)(t,{setChildrenInstance:N,key:o,index:o,parentInstance:{columnNum:m,border:h,square:y,gutter:n,clickable:u,center:p,direction:b,reverse:x,iconSize:g}}))})),e}),[O.children,m]);return(0,s.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"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=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(){$()}),j.current.duration)}),[]),G=(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)/N*1e3,j.current.animation=(0,i.createAnimation)({duration:j.current.duration,timingFunction:"linear",delay:T}),$(!0))}))}))}))}),[o.unitag,D,N,T,$]),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==Y||Y(e))}),[x,Y]);return o.show&&(0,f.jsxs)(s.View,_objectSpread(_objectSpread({className:c.bem("notice-bar",{withicon:x,wrapable:q})+" ".concat(W||""),style:c.style([m.rootStyle({color:F,backgroundColor:M,background:R}),H])},U),{},{onClick:X,children:[V?(0,f.jsx)(d.default,{name:V,className:"van-notice-bar__left-icon"}):L,(0,f.jsx)(s.View,{className:"van-notice-bar__wrap van-notice-bar__wrap_".concat(o.unitag),children:(0,f.jsxs)(s.View,{className:"van-notice-bar__content van-notice-bar__content_".concat(o.unitag," ")+(!1!==D||q?"":"van-ellipsis"),animation:o.animationData,children:[y,!y&&B]})}),"closeable"===x?(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"cross",onClick:J}):"link"===x?(0,f.jsx)(s.Navigator,{url:S,openType:C,children:(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"arrow"})}):K]}))}},"./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"),s=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=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(),Oe(),ke((function(){ke((function(){P.current.moving=!1,xe({pace:-1,isEmit:!0})}))}))},ye=function next(){je(),Oe(),ke((function(){ke((function(){P.current.moving=!1,xe({pace:1,isEmit:!0})}))}))},we=function to(e){je(),Oe(),ke((function(){ke((function(){var t;P.current.moving=!1,t=s.loop&&me===e?0===R?0:e:e%me,xe({pace:t-R,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),c=Se(l,r);if(s.loop){if(Array.isArray(d)&&d[0]&&c!==ve){var u=c0;te[me-1]=m?-fe:0}ne(te)}i&&R!==l&&s.onChange&&s.onChange((l+me)%me),R=l,q(l),Q(c),Pe(c)}},_e=function getActive(e){if(e){var t=R+e;return s.loop?Ce(t,-1,me):Ce(t,0,me-1)}return R},Se=function getOffset(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e*Number(le);s.loop||(n=Math.min(n,-ve));var o=t-n;return s.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)},Oe=function touchReset(){ce.startX=0,ce.startY=0,ce.deltaX=0,ce.deltaY=0,ce.offsetX=0,ce.offsetY=0,ce.delta=0,ce.stateDirection="",ce.touchTime=0},Te=m()((n={},(0,i.default)(n,"van-swiper__inner",!0),(0,i.default)(n,"van-swiper__vertical",D),n)),Pe=function getStyle(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=T.current,n=0;if(S){var o=D?B:X,r=D?(null==A?void 0:A.height)-o:(null==A?void 0:A.width)-o;n=e+(R!==me-1||s.loop?r/2:-r/2)}else n=e;t.style.transitionDuration="".concat(P.current.moving?0:s.duration,"ms"),t.style[D?"height":"width"]="".concat(Number(le)*me,"px"),t.style[D?"width":"height"]="".concat(D?X:B,"px"),t.style.transform="translate3D".concat(D?"(0,".concat(n,"px,0)"):"(".concat(n,"px,0,0)"))};(0,u.useEffect)((function(){P.current.activePagination=(R+me)%me}),[R]);var Ne=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)(c().mark((function _callee(){var e,t,n,o,r,a,i=arguments;return c().wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:+s.initPage,l.next=3,Ne(O.current);case 3:t=l.sent,n=Math.max(Math.min(me-1,e),0),o=s.width?+s.width:null==t?void 0:t.width,r=s.height?+s.height:null==t?void 0:t.height,le=D?r:o,fe=me*Number(le),a=Se(n),P.current.moving=!0,ae&&(P.current.moving=!1),F(t),q(n),Y(o),U(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&&Pe()}),[D,X,B,J,ae]),(0,u.useEffect)((function(){return function(){ie(!1)}}),[]),(0,u.useEffect)((function(){he(),be()}),[d]),(0,u.useEffect)((function(){Ie()}),[s.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=s.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:O},C),{},{id:"container-"+I,onTouchStart:function onTouchStart(e){s.isPreventDefault&&e.preventDefault(),s.isStopPropagation&&e.stopPropagation(),s.touchable&&(!function touchStart(e){var t,n;Oe(),ce.startX=(null==e||null===(t=e.touches[0])||void 0===t?void 0:t.clientX)||0,ce.startY=(null==e||null===(n=e.touches[0])||void 0===n?void 0:n.clientY)||0}(e),ce.touchTime=Date.now(),he(),je())},onTouchMove:function onTouchMove(e){s.touchable&&P.current.moving&&(!function touchMove(e){var t,n;ce.deltaX=((null==e||null===(t=e.touches[0])||void 0===t?void 0:t.clientX)||0)-ce.startX,ce.deltaY=((null==e||null===(n=e.touches[0])||void 0===n?void 0:n.clientY)||0)-ce.startY,ce.offsetX=Math.abs(ce.deltaX),ce.offsetY=Math.abs(ce.deltaY),ce.delta=D?ce.deltaY:ce.deltaX,ce.stateDirection||(ce.stateDirection=function getDirection(e,t){return e>t&&e>5?"horizontal":t>e&&t>5?"vertical":""}(ce.offsetX,ce.offsetY))}(e),ce.stateDirection===s.direction&&xe({offset:ce.delta}))},onTouchEnd:function onTouchEnd(){if(s.touchable&&P.current.moving){var e=ce.delta/(Date.now()-ce.touchTime),t=Math.abs(e)>.3||Math.abs(ce.delta)>+(le/2).toFixed(2),n=0;if(P.current.moving=!1,t&&ce.stateDirection===s.direction){var o=D?ce.offsetY:ce.offsetX;n=s.loop?o>0?ce.delta>0?-1:1:0:-Math[ce.delta>0?"ceil":"floor"](ce.delta/le),xe({pace:n,isEmit:!0})}else ce.delta?xe({pace:0}):Pe();be()}},catchMove:D,style:_objectSpread(_objectSpread({},k),{},{height:B}),children:[(0,b.jsxs)(v.View,{className:Te,ref:T,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]:""})]}),s.paginationVisible&&!("pageContent"in s)?(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:(R+me)%me===t?{backgroundColor:s.paginationColor}:void 0,className:m()((n={},(0,i.default)(n,"van-swiper__pagination-item",!0),(0,i.default)(n,"active",(R+me)%me===t),n))},t)}))}):(0,b.jsx)(v.View,{children:_})]}))})},x=(0,u.forwardRef)(w);t.default=x},"./node_modules/@antmjs/vantui/es/utils/index.js":function(e,t,n){"use strict";n.d(t,{resizeTextarea:function(){return resizeTextarea}});n("./node_modules/@babel/runtime/helpers/esm/typeof.js"),n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),n("webpack/container/remote/react"),n("webpack/container/remote/@tarojs/taro");var o=n("./node_modules/@antmjs/vantui/es/utils/type.js"),r=n("webpack/container/remote/@tarojs/runtime").window,a=n("webpack/container/remote/@tarojs/runtime").document;function setScrollTop(e,t){"scrollTop"in e?e.scrollTop=t:e.scrollTo(e.scrollX,t)}function resizeTextarea(e,t){var n=function getRootScrollTop(){return r.pageYOffset||a.documentElement.scrollTop||a.body.scrollTop||0}();e.style.height="auto",e.style.lineHeight="inherit",e.rows=1;var i=e.scrollHeight;if(console.info(i),(0,o.isObject)(t)){var l=t.maxHeight,s=t.minHeight;void 0!==l&&(i=Math.min(i,"number"==typeof l?l:Number(l.replace("px","")))),void 0!==s&&(i=Math.max(i,"number"==typeof s?s:Number(s.replace("px",""))))}i&&(e.style.height="".concat(i,"px"),function setRootScrollTop(e){setScrollTop(r,e),setScrollTop(a.body,e)}(n))}},"./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==ee||null===(N=ee[0])||void 0===N?void 0:N.imagesArr)&&void 0!==P?P:[]).map((function(e,t){return(0,O.jsx)(l.default,{children:(0,O.jsx)(s.default,{src:null==e?void 0:e.url,fit:"cover",width:"100%",height:"200px"})},"swiper#demo1".concat(t))}))})}),(0,O.jsxs)(r.default,{children:[(0,O.jsx)(a.default,{icon:"star",text:"打卡",className:"iconStyle",onClick:(0,b.default)((0,h.default)().mark((function _callee8(){var e;return(0,h.default)().wrap((function _callee8$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,k.phoneLogin)();case 2:e=t.sent,ce(!0),console.log("isin",e),e?_().getLocation({type:"gcj02",success:function success(e){console.log("lbs",e);null==e||e.latitude,null==e||e.longitude;var t={latitude:null==e?void 0:e.latitude,longitude:null==e?void 0:e.longitude};fe(t)},fail:function fail(){p.default.fail({message:"定位授权异常,无法签到打卡",selector:"#vanToast-demo2"})}}):p.default.fail({message:"请先登录",selector:"#vanToast-demo2"});case 6:case"end":return t.stop()}}),_callee8)})))}),(0,O.jsx)(a.default,{icon:"like",className:"iconStyle",text:"深圳十峰",onClick:function onClick(){_().navigateTo({url:"/pages/mountainPeak/index"})}}),(0,O.jsx)(a.default,{icon:"eye",className:"iconStyle",text:"活动",onClick:function onClick(){_().navigateTo({url:"/pages/activityList/index"})}}),(0,O.jsx)(a.default,{icon:"manager",className:"iconStyle",text:"组队",onClick:function onClick(){p.default.fail({message:"参加1次活动后,可发起组队",selector:"#vanToast-demo2"})}})]}),(null==G?void 0:G.length)>0?(0,O.jsx)(g.View,{children:(null!==(I=null==G||null===(D=G.reverse())||void 0===D?void 0:D.splice(0,2))&&void 0!==I?I:[]).map((function(e,t){return(0,O.jsx)(g.View,{onClick:function onClick(){console.log("Card"),_().navigateTo({url:"/pages/activityList/components/details/index?id=".concat(null==e?void 0:e._id)})},children:(0,O.jsx)(C.default,{dataSource:e})})}))}):(0,O.jsx)(o.default,{title:!0,row:4}),(0,O.jsxs)(g.View,{style:{marginTop:"20px"},children:[" ",(0,O.jsx)(g.OfficialAccount,{onLoad:function onLoad(e){console.log("加载成功",e)},onError:function onError(e){console.log("加载失败",e)}})]}),(0,O.jsx)(p.default,{id:"vanToast-demo2"}),(0,O.jsx)(S.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");r.default.enableShareTimeline=!0,r.default.enableShareAppMessage=!0;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 +(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/home/index"],{"./node_modules/@antmjs/vantui/es/field/index.js":function(e,t,n){"use strict";n.d(t,{Field:function(){return Field}});var o=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=n("webpack/container/remote/@tarojs/taro"),i=n("webpack/container/remote/react"),l=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=n("./node_modules/@antmjs/vantui/es/cell/index.js"),u=n("./node_modules/@antmjs/vantui/es/icon/index.js"),d=(n("./node_modules/@antmjs/vantui/es/utils/index.js"),n("./node_modules/@antmjs/vantui/es/field/wxs.js")),m=n("webpack/container/remote/react/jsx-runtime");n("webpack/container/remote/@tarojs/runtime").document;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=H}),children:j.length>=H?H:j.length}),"/"+H]}),$&&(0,m.jsx)(l.View,{className:s.bem("field__error-message",[B,{disabled:A,error:U}]),children:$})]})}},"./node_modules/@antmjs/vantui/es/field/wxs.js":function(e,t,n){"use strict";n.d(t,{inputStyle:function(){return inputStyle}});var o=n("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=n("./node_modules/@antmjs/vantui/es/wxs/add-unit.js");function inputStyle(e){return e&&"Object"===e.constructor.name?(0,o.style)({"min-height":(0,r.addUnit)(e.minHeight),"max-height":(0,r.addUnit)(e.maxHeight)}):""}},"./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"),s=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=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),O=(0,i.useState)({}),T=(0,o.default)(O,2),P=T[0],N=T[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,s=y.iconSize;N({center:a,border:t,square:n,gutter:o,clickable:r,direction:i,reverse:l,iconSize:s,index:w,columnNum:e})}),[y,w]);return(0,d.jsx)(a.View,{className:" "+s.bem("grid-item",{square:null==P?void 0:P.square})+" "+k,style:s.style([u.wrapperStyle({square:null==P?void 0:P.square,gutter:null==P?void 0:P.gutter,columnNum:null==P?void 0:P.columnNum,index:null==P?void 0:P.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 "+s.bem("grid-item__content",[null==P?void 0:P.direction,{center:null==P?void 0:P.center,square:null==P?void 0:P.square,reverse:null==P?void 0:P.reverse,clickable:null==P?void 0:P.clickable,surround:(null==P?void 0:P.border)&&(null==P?void 0:P.gutter)}])+" "+(null!=P&&P.border?"van-hairline--surround":""),style:u.contentStyle({square:null==P?void 0:P.square,gutter:null==P?void 0:P.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)(c.default,{name:t,color:n,classPrefix:p,dot:v,info:b||h,size:null==P?void 0:P.iconSize}):P.renderIcon}),(0,d.jsx)(a.View,{className:"van-grid-item__text text-class",children:j?(0,d.jsx)(a.Text,{children:j}):P.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"),s=n("webpack/container/remote/react/jsx-runtime"),c=["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,O=(0,o.default)(e,c),T=(0,a.useRef)([]),P=(0,a.useCallback)((function(){T.current.forEach((function(e){e.updateStyle()}))}),[]);(0,a.useEffect)((function(){P()}),[P]);var N=(0,a.useCallback)((function(e,t){T.current[e]=t}),[]),I=(0,a.useMemo)((function(){var e=[];return O.children&&Array.isArray(O.children)&&O.children.forEach((function(t,o){e.push((0,a.cloneElement)(t,{setChildrenInstance:N,key:o,index:o,parentInstance:{columnNum:m,border:h,square:y,gutter:n,clickable:u,center:p,direction:b,reverse:x,iconSize:g}}))})),e}),[O.children,m]);return(0,s.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"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=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(){$()}),j.current.duration)}),[]),G=(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)/N*1e3,j.current.animation=(0,i.createAnimation)({duration:j.current.duration,timingFunction:"linear",delay:T}),$(!0))}))}))}))}),[o.unitag,D,N,T,$]),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==Y||Y(e))}),[x,Y]);return o.show&&(0,f.jsxs)(s.View,_objectSpread(_objectSpread({className:c.bem("notice-bar",{withicon:x,wrapable:q})+" ".concat(W||""),style:c.style([m.rootStyle({color:F,backgroundColor:M,background:R}),H])},U),{},{onClick:X,children:[V?(0,f.jsx)(d.default,{name:V,className:"van-notice-bar__left-icon"}):L,(0,f.jsx)(s.View,{className:"van-notice-bar__wrap van-notice-bar__wrap_".concat(o.unitag),children:(0,f.jsxs)(s.View,{className:"van-notice-bar__content van-notice-bar__content_".concat(o.unitag," ")+(!1!==D||q?"":"van-ellipsis"),animation:o.animationData,children:[y,!y&&B]})}),"closeable"===x?(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"cross",onClick:J}):"link"===x?(0,f.jsx)(s.Navigator,{url:S,openType:C,children:(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"arrow"})}):K]}))}},"./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"),s=n("./node_modules/@antmjs/vantui/es/wxs/utils.js"),c=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(),Oe(),ke((function(){ke((function(){P.current.moving=!1,xe({pace:-1,isEmit:!0})}))}))},ye=function next(){je(),Oe(),ke((function(){ke((function(){P.current.moving=!1,xe({pace:1,isEmit:!0})}))}))},we=function to(e){je(),Oe(),ke((function(){ke((function(){var t;P.current.moving=!1,t=s.loop&&me===e?0===R?0:e:e%me,xe({pace:t-R,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),c=Se(l,r);if(s.loop){if(Array.isArray(d)&&d[0]&&c!==ve){var u=c0;te[me-1]=m?-fe:0}ne(te)}i&&R!==l&&s.onChange&&s.onChange((l+me)%me),R=l,q(l),Q(c),Pe(c)}},_e=function getActive(e){if(e){var t=R+e;return s.loop?Ce(t,-1,me):Ce(t,0,me-1)}return R},Se=function getOffset(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e*Number(le);s.loop||(n=Math.min(n,-ve));var o=t-n;return s.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)},Oe=function touchReset(){ce.startX=0,ce.startY=0,ce.deltaX=0,ce.deltaY=0,ce.offsetX=0,ce.offsetY=0,ce.delta=0,ce.stateDirection="",ce.touchTime=0},Te=m()((n={},(0,i.default)(n,"van-swiper__inner",!0),(0,i.default)(n,"van-swiper__vertical",D),n)),Pe=function getStyle(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=T.current,n=0;if(S){var o=D?B:X,r=D?(null==A?void 0:A.height)-o:(null==A?void 0:A.width)-o;n=e+(R!==me-1||s.loop?r/2:-r/2)}else n=e;t.style.transitionDuration="".concat(P.current.moving?0:s.duration,"ms"),t.style[D?"height":"width"]="".concat(Number(le)*me,"px"),t.style[D?"width":"height"]="".concat(D?X:B,"px"),t.style.transform="translate3D".concat(D?"(0,".concat(n,"px,0)"):"(".concat(n,"px,0,0)"))};(0,u.useEffect)((function(){P.current.activePagination=(R+me)%me}),[R]);var Ne=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)(c().mark((function _callee(){var e,t,n,o,r,a,i=arguments;return c().wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:+s.initPage,l.next=3,Ne(O.current);case 3:t=l.sent,n=Math.max(Math.min(me-1,e),0),o=s.width?+s.width:null==t?void 0:t.width,r=s.height?+s.height:null==t?void 0:t.height,le=D?r:o,fe=me*Number(le),a=Se(n),P.current.moving=!0,ae&&(P.current.moving=!1),F(t),q(n),Y(o),U(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&&Pe()}),[D,X,B,J,ae]),(0,u.useEffect)((function(){return function(){ie(!1)}}),[]),(0,u.useEffect)((function(){he(),be()}),[d]),(0,u.useEffect)((function(){Ie()}),[s.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=s.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:O},C),{},{id:"container-"+I,onTouchStart:function onTouchStart(e){s.isPreventDefault&&e.preventDefault(),s.isStopPropagation&&e.stopPropagation(),s.touchable&&(!function touchStart(e){var t,n;Oe(),ce.startX=(null==e||null===(t=e.touches[0])||void 0===t?void 0:t.clientX)||0,ce.startY=(null==e||null===(n=e.touches[0])||void 0===n?void 0:n.clientY)||0}(e),ce.touchTime=Date.now(),he(),je())},onTouchMove:function onTouchMove(e){s.touchable&&P.current.moving&&(!function touchMove(e){var t,n;ce.deltaX=((null==e||null===(t=e.touches[0])||void 0===t?void 0:t.clientX)||0)-ce.startX,ce.deltaY=((null==e||null===(n=e.touches[0])||void 0===n?void 0:n.clientY)||0)-ce.startY,ce.offsetX=Math.abs(ce.deltaX),ce.offsetY=Math.abs(ce.deltaY),ce.delta=D?ce.deltaY:ce.deltaX,ce.stateDirection||(ce.stateDirection=function getDirection(e,t){return e>t&&e>5?"horizontal":t>e&&t>5?"vertical":""}(ce.offsetX,ce.offsetY))}(e),ce.stateDirection===s.direction&&xe({offset:ce.delta}))},onTouchEnd:function onTouchEnd(){if(s.touchable&&P.current.moving){var e=ce.delta/(Date.now()-ce.touchTime),t=Math.abs(e)>.3||Math.abs(ce.delta)>+(le/2).toFixed(2),n=0;if(P.current.moving=!1,t&&ce.stateDirection===s.direction){var o=D?ce.offsetY:ce.offsetX;n=s.loop?o>0?ce.delta>0?-1:1:0:-Math[ce.delta>0?"ceil":"floor"](ce.delta/le),xe({pace:n,isEmit:!0})}else ce.delta?xe({pace:0}):Pe();be()}},catchMove:D,style:_objectSpread(_objectSpread({},k),{},{height:B}),children:[(0,b.jsxs)(v.View,{className:Te,ref:T,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]:""})]}),s.paginationVisible&&!("pageContent"in s)?(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:(R+me)%me===t?{backgroundColor:s.paginationColor}:void 0,className:m()((n={},(0,i.default)(n,"van-swiper__pagination-item",!0),(0,i.default)(n,"active",(R+me)%me===t),n))},t)}))}):(0,b.jsx)(v.View,{children:_})]}))})},x=(0,u.forwardRef)(w);t.default=x},"./node_modules/@antmjs/vantui/es/utils/index.js":function(e,t,n){"use strict";n.d(t,{resizeTextarea:function(){return resizeTextarea}});n("./node_modules/@babel/runtime/helpers/esm/typeof.js"),n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),n("webpack/container/remote/react"),n("webpack/container/remote/@tarojs/taro");var o=n("./node_modules/@antmjs/vantui/es/utils/type.js"),r=n("webpack/container/remote/@tarojs/runtime").window,a=n("webpack/container/remote/@tarojs/runtime").document;function setScrollTop(e,t){"scrollTop"in e?e.scrollTop=t:e.scrollTo(e.scrollX,t)}function resizeTextarea(e,t){var n=function getRootScrollTop(){return r.pageYOffset||a.documentElement.scrollTop||a.body.scrollTop||0}();e.style.height="auto",e.style.lineHeight="inherit",e.rows=1;var i=e.scrollHeight;if(console.info(i),(0,o.isObject)(t)){var l=t.maxHeight,s=t.minHeight;void 0!==l&&(i=Math.min(i,"number"==typeof l?l:Number(l.replace("px","")))),void 0!==s&&(i=Math.max(i,"number"==typeof s?s:Number(s.replace("px",""))))}i&&(e.style.height="".concat(i,"px"),function setRootScrollTop(e){setScrollTop(r,e),setScrollTop(a.body,e)}(n))}},"./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==ee||null===(N=ee[0])||void 0===N?void 0:N.imagesArr)&&void 0!==P?P:[]).map((function(e,t){return(0,O.jsx)(l.default,{children:(0,O.jsx)(s.default,{src:null==e?void 0:e.url,fit:"cover",width:"100%",height:"200px"})},"swiper#demo1".concat(t))}))})}),(0,O.jsxs)(r.default,{children:[(0,O.jsx)(a.default,{icon:"star",text:"打卡",className:"iconStyle",onClick:(0,b.default)((0,h.default)().mark((function _callee8(){var e;return(0,h.default)().wrap((function _callee8$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,k.phoneLogin)();case 2:if(e=t.sent,ce(!0),console.log("isin",e),!e){t.next=9;break}_().getLocation({type:"gcj02",success:function success(e){console.log("lbs",e);null==e||e.latitude,null==e||e.longitude;var t={latitude:null==e?void 0:e.latitude,longitude:null==e?void 0:e.longitude};fe(t)},fail:function fail(){p.default.fail({message:"定位授权异常,无法签到打卡",selector:"#vanToast-demo2"})}}),t.next=12;break;case 9:return t.next=11,ue();case 11:p.default.fail({message:"请先登录",selector:"#vanToast-demo2",duration:2e3,onClose:function onClose(){_().navigateTo({url:"/pages/my/index"})}});case 12:case"end":return t.stop()}}),_callee8)})))}),(0,O.jsx)(a.default,{icon:"like",className:"iconStyle",text:"深圳十峰",onClick:function onClick(){_().navigateTo({url:"/pages/mountainPeak/index"})}}),(0,O.jsx)(a.default,{icon:"eye",className:"iconStyle",text:"活动",onClick:function onClick(){_().navigateTo({url:"/pages/activityList/index"})}}),(0,O.jsx)(a.default,{icon:"manager",className:"iconStyle",text:"组队",onClick:function onClick(){p.default.fail({message:"参加1次活动后,可发起组队",selector:"#vanToast-demo2"})}})]}),(null==G?void 0:G.length)>0?(0,O.jsx)(g.View,{children:(null!==(I=null==G||null===(D=G.reverse())||void 0===D?void 0:D.splice(0,2))&&void 0!==I?I:[]).map((function(e,t){return(0,O.jsx)(g.View,{onClick:function onClick(){console.log("Card"),_().navigateTo({url:"/pages/activityList/components/details/index?id=".concat(null==e?void 0:e._id)})},children:(0,O.jsx)(C.default,{dataSource:e})})}))}):(0,O.jsx)(o.default,{title:!0,row:4}),(0,O.jsxs)(g.View,{style:{marginTop:"20px"},children:[" ",(0,O.jsx)(g.OfficialAccount,{onLoad:function onLoad(e){console.log("加载成功",e)},onError:function onError(e){console.log("加载失败",e)}})]}),(0,O.jsx)(p.default,{id:"vanToast-demo2"}),(0,O.jsx)(S.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");r.default.enableShareTimeline=!0,r.default.enableShareAppMessage=!0;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 cc2f678..a991990 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/empty/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"),i=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),a=n("./node_modules/@antmjs/vantui/es/empty/wxs.js"),s=n("webpack/container/remote/react/jsx-runtime"),l=["image","description","renderImage","renderDescription","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]),P=(0,a.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&&j((function(e){return _objectSpread(_objectSpread({},e),t)})),null==_||_({detail:{scrollTop:C.current.scrollTop,isFixed:e.fixed||b.fixed}})}),[_,b]),I=(0,a.useCallback)((function(e){g?P({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)&&(y>=e.top?P({fixed:!0,height:e.height}):P({fixed:!1}))})):Promise.all([(0,c.getRect)(null,"#sticky-com-index".concat(t.current)),N()]).then((function(e){var t=(0,i.default)(e,2),n=t[0],r=t[1];n&&r&&(y+n.height>r.height+r.top?P({fixed:!1,transform:r.height-n.height}):y>=n.top?P({fixed:!0,height:n.height,transform:0}):P({fixed:!1,transform:0}))})).catch((function(e){console.log(e)})))}),[w,g,N,y,P]);return(0,a.useEffect)((function(){I(x)}),[x,w,g,y]),(0,d.usePageScroll)((function(e){I(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:v}),k])},T),{},{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:y,transform:b.transform,zIndex:v}),k]),children:O})}))}},"./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"),i=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=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!==D){var t=null!==D;P((function(t){return _objectSpread(_objectSpread({},t),{},{currentIndex:e})})),(0,j.requestAnimationFrame)((function(){Oe(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)},Oe=function resize(e){var r;"line"===W&&(e=null!==(r=e)&&void 0!==r?r:D,(0,c.nextTick)((function(){Promise.all([(0,j.getAllRect)(null,".tabs-com-index".concat(n.current," .van-tab")),(0,j.getRect)(null,".tabs-com-index".concat(n.current," .van-tabs__line"))]).then((function(n){var r=(0,i.default)(n,2),o=r[0],a=void 0===o?[]:o,s=r[1];if(a&&s){var l=a[e];if(null==l)return;var u=a.slice(0,e).reduce((function(e,t){return e+t.width}),0);u+=(l.width-s.width)/2+(Q?0:8),P((function(e){return _objectSpread(_objectSpread({},e),{},{lineOffsetLeft:u})})),t.current.swiping=!0,E&&(0,c.nextTick)((function(){P((function(e){return _objectSpread(_objectSpread({},e),{},{skipTransition:!1})}))}))}}))})))},Te=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:D,Promise.all([(0,j.getAllRect)(null,".tabs-com-index".concat(n.current," .van-tab")),(0,j.getRect)(null,".tabs-com-index".concat(n.current," .van-tabs__nav"))]).then((function(t){var n=(0,i.default)(t,2),r=n[0],o=n[1];if(r&&o){var a=r[e],s=r.slice(0,e).reduce((function(e,t){return e+t.width}),0);P((function(e){return _objectSpread(_objectSpread({},e),{},{scrollLeft:s-(o.width-a.width)/2})})),z||(0,c.nextTick)((function(){P((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},Pe=function onTouchEnd(){if(R&&t.current.swiping){var e=t.current,n=e.direction,r=e.deltaX,o=e.offsetX;if("horizontal"===n&&o>=50){var i=function getAvaiableTab(e){for(var t=e>0?-1:1,n=t;D+n=0;n+=t){var r=D+n;if(r>=0&&rle||!Q})}))}),[le,ge,Q]),(0,u.useEffect)((function(){(0,c.nextTick)((function(){Oe()}))}),[ge]);var Ie=(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,j.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,j.getAllRect)(null,"."+m.bem("renderNavRight"+n.current));case 9:(r=o.sent).length&&(e+=r[0].width);case 11:e&&O("calc(100% - ".concat(e,"px)"));case 12:case"end":return o.stop()}}),_callee)}))),[ue,g,de]);return(0,u.useEffect)((function(){setTimeout((function(){Ie()}))}),[Ie,g]),(0,y.jsxs)(f.View,_objectSpread(_objectSpread({className:"tabs-com-index".concat(n.current," ")+" "+m.bem("tabs",[W]+" ".concat(ve||"")),style:je},ye),{},{children:[(0,y.jsx)(b.Sticky,{disabled:!F,zIndex:H,offsetTop:B,container:U,onScroll:fe,children:(0,y.jsxs)(f.View,{className:m.bem("tabs__wrap",{scrollable:V})+" "+("line"===W&&$?"van-hairline--top-bottom":""),children:[(0,y.jsx)(f.View,{className:m.bem("renderNavLeft"+n.current),children:ue}),(0,y.jsx)(f.ScrollView,{scrollX:V,scrollWithAnimation:z,scrollLeft:I,className:m.bem("tabs__scroll",[W]),style:{width:S,borderColor:G},children:(0,y.jsxs)(f.View,{className:m.bem("tabs__nav",[W,{complete:!Q}])+" nav-class",style:h.navStyle(G,W),children:["line"===W&&(0,y.jsx)(f.View,{className:"van-tabs__line",style:h.lineStyle({color:G,lineOffsetLeft:A,lineHeight:ee,skipTransition:E,duration:ne,lineWidth:oe})}),xe.map((function(e,t){return(0,y.jsx)(f.View,{"data-index":t,className:h.tabClass(t===D,Q)+" "+m.bem("tab",{active:t===D,disabled:e.disabled,complete:!Q}),style:h.tabStyle({active:t===D,ellipsis:Q,color:G,type:W,disabled:e.disabled,titleActiveColor:ie,titleInactiveColor:ae,swipeThreshold:le,scrollable:V}),onClick:Te,children:(0,y.jsxs)(f.View,{className:Q?"van-ellipsis":"",style:e.titleStyle,children:[e.title,(null!==e.info||e.dot)&&(0,y.jsx)(v.Info,{info:e.info,dot:e.dot,className:"van-tab__title__info"})]})},t)}))]})}),(0,y.jsx)(f.View,{className:m.bem("renderNavRight"+n.current),children:de})]})}),(0,y.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:Pe,onTouchCancel:Pe,children:(0,y.jsx)(f.View,{className:m.bem("tabs__track",[{animated:ce}])+" van-tabs__track",style:h.trackStyle({duration:ne,currentIndex:D,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"),i=n("./node_modules/@antmjs/vantui/es/toast/index.js"),a=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/@antmjs/vantui/es/empty/index.js"),d=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),f=n("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),m=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),p=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),b=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),j=n("webpack/container/remote/react"),v=n("./src/pages/components/TabbarCom/index.tsx"),h=n("webpack/container/remote/@tarojs/taro"),y=n.n(h),x=n("./src/pages/components/ActiveCard/index.tsx"),g=n("./src/utils/index.ts"),w=n("./config.js"),_=n("webpack/container/remote/react/jsx-runtime");t.default=function my(e){var t=(0,j.useState)({}),n=(0,p.default)(t,2),h=(n[0],n[1]),k=(0,j.useState)(""),S=(0,p.default)(k,2),O=S[0],T=S[1],C=(0,j.useState)([]),N=(0,p.default)(C,2),P=(N[0],N[1]),I=(0,j.useState)([]),V=(0,p.default)(I,2),D=V[0],E=V[1],z=(0,j.useState)(0),A=(0,p.default)(z,2),R=A[0],L=A[1],X=(0,j.useState)(!0),M=(0,p.default)(X,2),Y=M[0],K=M[1];(0,j.useEffect)((function(){W()}),[]);var W=function(){var e=(0,m.default)((0,f.default)().mark((function _callee(){var e;return(0,f.default)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,g.phoneLogin)();case 2:e=t.sent,K(e);case 4:case"end":return t.stop()}}),_callee)})));return function getok(){return e.apply(this,arguments)}}();(0,j.useEffect)((function(){Y&&F()}),[Y]);var F=function getUserInfo(){var e;y().cloud.callFunction({name:"getOpenid",complete:(e=(0,m.default)((0,f.default)().mark((function _callee2(e){var t,n,r,o,i;return(0,f.default)().wrap((function _callee2$(a){for(;;)switch(a.prev=a.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,T(o),i={tableName:"userInfo",keyValue:{openId:o},okFun:function okFun(e){var t,n,r,i;console.log("userinfo--",e),h(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===(i=e.data)||void 0===i?void 0:i.activeidArr)&&void 0!==r?r:[]),U(o)}},(0,g.getTable)(i);case 5:case"end":return a.stop()}}),_callee2)}))),function complete(t){return e.apply(this,arguments)})})},U=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,d.default)({},r),okFun:function okFun(e){var t;console.log("detailsData/usero--",e),E(null!==(t=null==e?void 0:e.data)&&void 0!==t?t:[])}};(0,g.getTable)(o)};(0,j.useEffect)((function(){}),[]);var H=function CardCom(){return(0,_.jsx)(b.View,{children:(null==D?void 0:D.length)>0?(0,_.jsx)(b.View,{children:D.splice(0,2).map((function(e,t){return(0,_.jsx)(b.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,_.jsx)(x.default,{dataSource:e})})}))}):(0,_.jsx)(b.View,{children:(0,_.jsx)(u.default,{className:"customImage",image:"https://img.yzcdn.cn/vant/custom-empty-image.png"})})})};return(0,_.jsxs)(b.View,{className:"myContent",children:[(0,_.jsxs)(b.View,{className:"myImage",children:[(0,_.jsx)(c.default,{round:!0,width:"100px",height:"100px",src:"cloud://citynew-0givkbre03955d8c.6369-citynew-0givkbre03955d8c-1253655588/images/touxiang/images.jpg"}),!Y&&(0,_.jsx)(b.View,{className:"loginBtn",children:(0,_.jsx)(l.default,{type:"primary",size:"mini","open-type":"getPhoneNumber",lang:"zh_CN",children:"登录"})})]}),(0,_.jsx)(b.View,{children:(0,_.jsxs)(a.default,{sticky:!0,active:R,onClick:function onClick(e){var t,n;console.log("e",e),U(O,null==e||null===(t=e.detail)||void 0===t?void 0:t.name),L(null==e||null===(n=e.detail)||void 0===n?void 0:n.name)},children:[(0,_.jsx)(s.default,{title:"待审核",name:"1",children:(0,_.jsx)(b.View,{children:H()})}),(0,_.jsx)(s.default,{title:"待参加",name:"2",children:H()}),(0,_.jsx)(s.default,{title:"已取消",name:"4",children:H()})]})}),(0,_.jsxs)(b.View,{className:"cellArr",children:[(0,_.jsx)(o.default,{icon:"star",title:"打卡记录",isLink:!0,onClick:function onClick(){Y?y().navigateTo({url:"/pages/my/components/CheckinDetail/index"}):i.default.fail({message:"请先登录",selector:"#vanToast-demo2"})}}),(0,_.jsx)(o.default,{icon:"coupon",title:"更新收货地址",isLink:!0,onClick:function onClick(){y().chooseAddress({success:function success(e){console.log(e.userName),console.log(e.postalCode),console.log(e.provinceName),console.log(e.cityName),console.log(e.countyName),console.log(e.detailInfo),console.log(e.nationalCode),console.log(e.telNumber)}})}}),(0,_.jsx)(o.default,{icon:"manager",title:"申请成为领队",isLink:!0,onClick:function onClick(){i.default.fail({message:"首次参加活动后,可申请成为领队",selector:"#vanToast-demo2"})}}),(0,_.jsxs)(b.View,{className:"wechat",children:[(0,_.jsx)(r.default,{name:"wechat",size:"16px",className:"icon"}),(0,_.jsx)(l.default,{"open-type":"contact",className:"wecahtBtn",children:"联系我们"})]}),"people"!==w.type&&(0,_.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,_.jsx)(i.default,{id:"vanToast-demo2"}),(0,_.jsx)(v.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/empty/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/@tarojs/plugin-platform-weapp/dist/components-react.js"),i=n("./node_modules/@antmjs/vantui/es/empty/wxs.js"),s=n("webpack/container/remote/react/jsx-runtime"),l=["image","description","renderImage","renderDescription","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]),P=(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]),I=(0,i.useCallback)((function(e){g?P({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)&&(y>=e.top?P({fixed:!0,height:e.height}):P({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&&(y+n.height>r.height+r.top?P({fixed:!1,transform:r.height-n.height}):y>=n.top?P({fixed:!0,height:n.height,transform:0}):P({fixed:!1,transform:0}))})).catch((function(e){console.log(e)})))}),[w,g,N,y,P]);return(0,i.useEffect)((function(){I(x)}),[x,w,g,y]),(0,d.usePageScroll)((function(e){I(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])},T),{},{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:y,transform:b.transform,zIndex:j}),k]),children:O})}))}},"./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!==D){var t=null!==D;P((function(t){return _objectSpread(_objectSpread({},t),{},{currentIndex:e})})),(0,v.requestAnimationFrame)((function(){Oe(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)},Oe=function resize(e){var r;"line"===K&&(e=null!==(r=e)&&void 0!==r?r:D,(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),P((function(e){return _objectSpread(_objectSpread({},e),{},{lineOffsetLeft:u})})),t.current.swiping=!0,A&&(0,c.nextTick)((function(){P((function(e){return _objectSpread(_objectSpread({},e),{},{skipTransition:!1})}))}))}}))})))},Te=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:D,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);P((function(e){return _objectSpread(_objectSpread({},e),{},{scrollLeft:s-(o.width-i.width)/2})})),E||(0,c.nextTick)((function(){P((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},Pe=function onTouchEnd(){if(R&&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;D+n=0;n+=t){var r=D+n;if(r>=0&&rle||!Q})}))}),[le,ge,Q]),(0,u.useEffect)((function(){(0,c.nextTick)((function(){Oe()}))}),[ge]);var Ie=(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&&O("calc(100% - ".concat(e,"px)"));case 12:case"end":return o.stop()}}),_callee)}))),[ue,g,de]);return(0,u.useEffect)((function(){setTimeout((function(){Ie()}))}),[Ie,g]),(0,y.jsxs)(f.View,_objectSpread(_objectSpread({className:"tabs-com-index".concat(n.current," ")+" "+m.bem("tabs",[K]+" ".concat(je||"")),style:ve},ye),{},{children:[(0,y.jsx)(b.Sticky,{disabled:!W,zIndex:H,offsetTop:q,container:U,onScroll:fe,children:(0,y.jsxs)(f.View,{className:m.bem("tabs__wrap",{scrollable:V})+" "+("line"===K&&B?"van-hairline--top-bottom":""),children:[(0,y.jsx)(f.View,{className:m.bem("renderNavLeft"+n.current),children:ue}),(0,y.jsx)(f.ScrollView,{scrollX:V,scrollWithAnimation:E,scrollLeft:I,className:m.bem("tabs__scroll",[K]),style:{width:S,borderColor:G},children:(0,y.jsxs)(f.View,{className:m.bem("tabs__nav",[K,{complete:!Q}])+" nav-class",style:h.navStyle(G,K),children:["line"===K&&(0,y.jsx)(f.View,{className:"van-tabs__line",style:h.lineStyle({color:G,lineOffsetLeft:z,lineHeight:ee,skipTransition:A,duration:ne,lineWidth:oe})}),xe.map((function(e,t){return(0,y.jsx)(f.View,{"data-index":t,className:h.tabClass(t===D,Q)+" "+m.bem("tab",{active:t===D,disabled:e.disabled,complete:!Q}),style:h.tabStyle({active:t===D,ellipsis:Q,color:G,type:K,disabled:e.disabled,titleActiveColor:ae,titleInactiveColor:ie,swipeThreshold:le,scrollable:V}),onClick:Te,children:(0,y.jsxs)(f.View,{className:Q?"van-ellipsis":"",style:e.titleStyle,children:[e.title,(null!==e.info||e.dot)&&(0,y.jsx)(j.Info,{info:e.info,dot:e.dot,className:"van-tab__title__info"})]})},t)}))]})}),(0,y.jsx)(f.View,{className:m.bem("renderNavRight"+n.current),children:de})]})}),(0,y.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:Pe,onTouchCancel:Pe,children:(0,y.jsx)(f.View,{className:m.bem("tabs__track",[{animated:ce}])+" van-tabs__track",style:h.trackStyle({duration:ne,currentIndex:D,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"),y=n("webpack/container/remote/@tarojs/taro"),x=n.n(y),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),y=(n[0],n[1]),S=(0,j.useState)(""),O=(0,b.default)(S,2),T=O[0],C=O[1],N=(0,j.useState)([]),P=(0,b.default)(N,2),I=(P[0],P[1]),V=(0,j.useState)([]),D=(0,b.default)(V,2),A=D[0],E=D[1],z=(0,j.useState)(0),R=(0,b.default)(z,2),L=R[0],X=R[1],F=(0,j.useState)(!1),M=(0,b.default)(F,2),Y=M[0],K=M[1];(0,j.useEffect)((function(){W()}),[]);var W=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),K(e);case 5: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;x().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),y(null!==(t=null==e||null===(n=e.data)||void 0===n?void 0:n[0])&&void 0!==t?t:{}),I(null!==(r=null==e||null===(a=e.data)||void 0===a?void 0:a.activeidArr)&&void 0!==r?r:[]),H(o)}},(0,w.getTable)(a);case 5:case"end":return i.stop()}}),_callee2)}))),function complete(t){return e.apply(this,arguments)})})},H=function getDetails(e,t){var n=x().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),E(null!==(t=null==e?void 0:e.data)&&void 0!==t?t:[])}};(0,w.getTable)(o)};(0,j.useEffect)((function(){}),[]);var $=function CardCom(){return(0,k.jsx)(v.View,{children:(null==A?void 0:A.length)>0?(0,k.jsx)(v.View,{children:A.splice(0,2).map((function(e,t){return(0,k.jsx)(v.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,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"})})})};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:x().chooseAddress({success:function success(e){var t;console.log("AddressRes",e),x().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),K(!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.jsx)(v.View,{children:(0,k.jsxs)(i.default,{sticky:!0,active:L,onClick:function onClick(e){var t,n;console.log("e",e),H(T,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",children:(0,k.jsx)(v.View,{children:$()})}),(0,k.jsx)(s.default,{title:"待参加",name:"2",children:$()}),(0,k.jsx)(s.default,{title:"已取消",name:"4",children:$()})]})}),(0,k.jsxs)(v.View,{className:"cellArr",children:[(0,k.jsx)(o.default,{icon:"star",title:"打卡记录",isLink:!0,onClick:function onClick(){Y?x().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(){x().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 diff --git a/dist/pages/my/index.js.LICENSE.txt b/dist/pages/my/index.js.LICENSE.txt index 581b9c5..d6d191a 100644 --- a/dist/pages/my/index.js.LICENSE.txt +++ b/dist/pages/my/index.js.LICENSE.txt @@ -30,6 +30,8 @@ /*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ +/*! ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */ + /*! ./wxs */ /*! @antmjs/vantui/es/button */ diff --git a/src/pages/activityList/components/details/index.tsx b/src/pages/activityList/components/details/index.tsx index f5290f3..ef56cb5 100644 --- a/src/pages/activityList/components/details/index.tsx +++ b/src/pages/activityList/components/details/index.tsx @@ -480,7 +480,7 @@ const details = () => { type={disable ? "warning" : "primary"} block // disabled={disable} - onClick={() => { + onClick={async() => { if (disable) { setShow(true); return false; @@ -505,7 +505,7 @@ const details = () => { return false; } - let isin: any = phoneLogin(); + let isin: any = await phoneLogin(); if (!isin) { //重新登录- 跳转到我的页面 Toast.fail({ diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index ccf08ba..40e2620 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -402,9 +402,18 @@ const Home = () => { }); // chooseImage(); } else { + await getdetails(); + Toast.fail({ message: "请先登录", selector: "#vanToast-demo2", + duration: 2000, + onClose: () => { + // 跳转到目的页面,打开新页面 + Taro.navigateTo({ + url: "/pages/my/index", + }); + }, }); } }} @@ -562,8 +571,6 @@ const Home = () => { }) }}>订阅消息 */} - - diff --git a/src/pages/my/index.tsx b/src/pages/my/index.tsx index e4617b4..5da28af 100644 --- a/src/pages/my/index.tsx +++ b/src/pages/my/index.tsx @@ -39,19 +39,16 @@ const my = (props: any) => { const [detailsData, setdetailsData] = useState([]); //活动详情 const [currentIndex, setcurrentIndex] = useState(0); - const [isin, setisin] = useState(true); //0初始 1未登录 2有手机号 + const [isin, setisin] = useState(false); //0初始 1未登录 2有手机号 useEffect(() => { - getok(); - // let isin: any = isLogin(); - // setisin(isin); - - // getOpenid(); + getLogin(); }, []); - const getok = async () => { - let isOk: any = await phoneLogin(); - setisin(isOk); + const getLogin = async () => { + let isLogin: any = await phoneLogin(); + console.log('isLogin',isLogin) + setisin(isLogin); }; useEffect(() => { @@ -127,7 +124,7 @@ const my = (props: any) => { const CardCom = () => { return ( - {detailsData?.length>0 ? ( + {detailsData?.length > 0 ? ( {detailsData.splice(0, 2).map((item: any, index: any) => { return ( @@ -158,6 +155,22 @@ const my = (props: any) => { ); }; + const updateAuth =async (userRes:any) => { + let newobj = { + tableName: "userInfo", + id: userRes?.data?.[0]?._id, + objData: { + authInfo: [...(userRes?.data?.[0]?.authInfo ?? []), ...userRes], + }, + okFun: async (okFunres: any) => { + console.log("添加用户认证信息", okFunres); + setisin(true); + // + }, + }; + await updateTableid({ ...newobj }); + }; + return ( {/* */} @@ -176,9 +189,61 @@ const my = (props: any) => { @@ -193,7 +258,7 @@ const my = (props: any) => { onClick={(e: any) => { console.log("e", e); getDetails(openId, e?.detail?.name); - setcurrentIndex(e?.detail?.name); + setcurrentIndex(e?.detail?.index); }} > {/* */} @@ -233,26 +298,11 @@ const my = (props: any) => { }} /> - { - // 获取收获地址 - Taro.chooseAddress({ - success: function (res) { - console.log(res.userName); - console.log(res.postalCode); - console.log(res.provinceName); - console.log(res.cityName); - console.log(res.countyName); - console.log(res.detailInfo); - console.log(res.nationalCode); - console.log(res.telNumber); - }, - }); - }} - /> + /> */} {/* { }); } else { //查看是否存在手机号 - if (data?.[0]?.authInfo?.authPhonenum) { + if (data?.[0]?.authInfo?.[0]?.telNumber) { resolve(true) return true; } else { if(type==='people'){ - resolve(true) - return true; + // resolve(true) + // return true; + resolve(false) + return false; }else{ resolve(false) return false;