From 5f3712b7ab686ab11af7ecabda3b15fa486a0f53 Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 14 Dec 2022 13:42:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BE=AE=E4=BF=A1=E4=BA=91=E6=89=98?= =?UTF-8?q?=E7=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.js | 2 +- dist/app.js | 2 +- dist/app.js.LICENSE.txt | 4 +++ dist/common.js | 2 +- dist/pages/home/index.js | 2 +- dist/runtime.js | 2 +- src/app.ts | 78 +++++++++++++++++++++++++++++++++++----- src/pages/home/index.tsx | 12 +++++++ 8 files changed, 91 insertions(+), 13 deletions(-) diff --git a/config.js b/config.js index 4d7e94d..505b02c 100644 --- a/config.js +++ b/config.js @@ -4,4 +4,4 @@ export const type = "people"; //office 个人公司 export const appId = type === "people" ? "wx515bd42ee0db5c5d" : "wx2b2ec2ba5ee694bc"; export const envConfig=type === "people" ? "citynew-0givkbre03955d8c" : "cloud1-5g5xrgza12a0dd6d"; - +// export const envConfig="prod-4go74loxa6ac34a8" diff --git a/dist/app.js b/dist/app.js index 440b0ee..ef654bc 100644 --- a/dist/app.js +++ b/dist/app.js @@ -1,2 +1,2 @@ /*! For license information please see app.js.LICENSE.txt */ -"use strict";require("./prebundle/vendors-node_modules_taro_weapp_prebundle_antmjs_vantui_js.js"),require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-TS5T3MDA_js.js"),require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-5ZOEZXK4_js.js"),require("./prebundle/vendors-node_modules_taro_weapp_prebundle_lodash_js.js"),require("./prebundle/vendors-node_modules_taro_weapp_prebundle_moment_js.js"),require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-JHQVW7VO_js.js"),require("./prebundle/vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-framework-react_dist_runtime_js.js"),require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-YPK4VK53_js.js"),require("./prebundle/node_modules_taro_weapp_prebundle_sync_recursive-node_modules_taro_weapp_prebundle_tarojs_plu-b2bd19.js"),require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-HER2BAHA_js.js"),require("./prebundle/remoteEntry.js"),require("./prebundle/node_modules_taro_weapp_prebundle_react_jsx-runtime_js.js"),require("./prebundle/node_modules_taro_weapp_prebundle_react_js.js"),require("./prebundle/node_modules_taro_weapp_prebundle_sync_recursive-node_modules_taro_weapp_prebundle_tarojs_run-08648c.js"),require("./prebundle/node_modules_taro_weapp_prebundle_sync_recursive-node_modules_taro_weapp_prebundle_react-dom_js.js"),require("./prebundle/node_modules_taro_weapp_prebundle_sync_recursive-node_modules_taro_weapp_prebundle_tarojs_taro_js.js"),require("./prebundle/node_modules_taro_weapp_prebundle_sync_recursive-_94890.js"),require("./prebundle/node_modules_taro_weapp_prebundle_sync_recursive-_94891.js"),require("./prebundle/node_modules_taro_weapp_prebundle_sync_recursive-_94892.js"),require("./prebundle/node_modules_taro_weapp_prebundle_sync_recursive-_94893.js"),require("./common"),require("./vendors"),require("./taro"),require("./runtime"),(wx.webpackJsonp=wx.webpackJsonp||[]).push([["app"],{"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/app.ts":function(e,r,t){var n=t("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),o=t("./node_modules/@babel/runtime/helpers/esm/createClass.js"),s=t("./node_modules/@babel/runtime/helpers/esm/inherits.js"),u=t("./node_modules/@babel/runtime/helpers/esm/createSuper.js"),i=t("webpack/container/remote/@tarojs/taro"),a=t.n(i),d=t("webpack/container/remote/react"),p=t("./config.js"),l=function(e){(0,s.default)(App,e);var r=(0,u.default)(App);function App(){return(0,n.default)(this,App),r.apply(this,arguments)}return(0,o.default)(App,[{key:"componentDidMount",value:function componentDidMount(){a().cloud.init({env:p.envConfig,traceUser:!0}),new(a().cloud.Cloud)({resourceEnv:p.envConfig}).init()}},{key:"componentDidShow",value:function componentDidShow(){}},{key:"componentDidHide",value:function componentDidHide(){}},{key:"render",value:function render(){return this.props.children}}]),App}(d.Component);r.default=l},"./src/app.ts":function(e,r,t){t("webpack/container/remote/@tarojs/plugin-platform-weapp/dist/runtime");var n=t("webpack/container/remote/@tarojs/runtime"),o=t("webpack/container/remote/@tarojs/plugin-framework-react/dist/runtime"),s=t("webpack/container/remote/@tarojs/taro"),u=t("./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/app.ts"),i=t("webpack/container/remote/react"),a=t("webpack/container/remote/react-dom"),d=t.n(a),p={pages:["pages/home/index","pages/home/components/CheckIn/index","pages/home/components/Certified/index","pages/activityList/index","pages/formSubmit/index","pages/activityList/components/details/index","pages/mountainPeak/index","pages/my/index","pages/my/components/Version/index","pages/my/components/AbountUs/index","pages/my/components/CheckinDetail/index"],permission:{"scope.userLocation":{desc:"你的位置信息将用于小程序位置接口的效果展示"}},requiredPrivateInfos:["getLocation","chooseLocation","chooseAddress"],window:{backgroundTextStyle:"light",navigationBarBackgroundColor:"#fff",navigationBarTitleText:"WeChat",navigationBarTextStyle:"black"},usingComponents:{}};n.window.__taroAppConfig=p;App((0,o.createReactApp)(u.default,i,d(),p));(0,s.initPxTransform)({designWidth:750,deviceRatio:{640:1.17,750:1,828:.905}})},"./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":function(e,r,t){function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}t.d(r,{default:function(){return _assertThisInitialized}})},"./node_modules/@babel/runtime/helpers/esm/classCallCheck.js":function(e,r,t){function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}t.d(r,{default:function(){return _classCallCheck}})},"./node_modules/@babel/runtime/helpers/esm/createClass.js":function(e,r,t){function _defineProperties(e,r){for(var t=0;t1&&void 0!==u[1]?u[1]:0,null!=(t=this).cloud){n.next=6;break}return t.cloud=new(d().cloud.Cloud)({resourceAppid:"wx515bd42ee0db5c5d",resourceEnv:"prod-4go74loxa6ac34a8"}),n.next=6,t.cloud.init();case 6:return n.prev=6,n.next=9,t.cloud.callContainer({path:e.path,method:e.method||"GET",header:{"X-WX-SERVICE":"fastapi-003"}});case 9:return o=n.sent,console.log("微信云托管调用结果".concat(o.errMsg," | callid:").concat(o.callID)),n.abrupt("return",o.data);case 14:if(n.prev=14,n.t0=n.catch(6),!(-1!=(s=n.t0.toString()).indexOf("Cloud API isn't enabled")&&r<3)){n.next=21;break}return n.abrupt("return",new Promise((function(n){setTimeout((function(){n(t.call(e,r+1))}),300)})));case 21:throw new Error("微信云托管调用失败".concat(s));case 22:case"end":return n.stop()}}),_callee2,this,[[6,14]])}))),function call(e){return r.apply(this,arguments)})},{key:"render",value:function render(){return this.props.children}}]),App}(p.Component);r.default=_},"./src/app.ts":function(e,r,t){t("webpack/container/remote/@tarojs/plugin-platform-weapp/dist/runtime");var n=t("webpack/container/remote/@tarojs/runtime"),o=t("webpack/container/remote/@tarojs/plugin-framework-react/dist/runtime"),s=t("webpack/container/remote/@tarojs/taro"),u=t("./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/app.ts"),a=t("webpack/container/remote/react"),i=t("webpack/container/remote/react-dom"),l=t.n(i),d={pages:["pages/home/index","pages/home/components/CheckIn/index","pages/home/components/Certified/index","pages/activityList/index","pages/formSubmit/index","pages/activityList/components/details/index","pages/mountainPeak/index","pages/my/index","pages/my/components/Version/index","pages/my/components/AbountUs/index","pages/my/components/CheckinDetail/index"],permission:{"scope.userLocation":{desc:"你的位置信息将用于小程序位置接口的效果展示"}},requiredPrivateInfos:["getLocation","chooseLocation","chooseAddress"],window:{backgroundTextStyle:"light",navigationBarBackgroundColor:"#fff",navigationBarTitleText:"WeChat",navigationBarTextStyle:"black"},usingComponents:{}};n.window.__taroAppConfig=d;App((0,o.createReactApp)(u.default,a,l(),d));(0,s.initPxTransform)({designWidth:750,deviceRatio:{640:1.17,750:1,828:.905}})},"./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":function(e,r,t){function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}t.d(r,{default:function(){return _assertThisInitialized}})},"./node_modules/@babel/runtime/helpers/esm/classCallCheck.js":function(e,r,t){function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}t.d(r,{default:function(){return _classCallCheck}})},"./node_modules/@babel/runtime/helpers/esm/createClass.js":function(e,r,t){function _defineProperties(e,r){for(var t=0;t0?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 +"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["common"],{"./config.js":function(e,n,t){t.d(n,{type:function(){return a},appId:function(){return l},envConfig:function(){return o}});var a="people",l="people"===a?"wx515bd42ee0db5c5d":"wx2b2ec2ba5ee694bc",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"),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/home/index.js b/dist/pages/home/index.js index 57e7b09..35d04d8 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 */ -"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/home/index"],{"./node_modules/@antmjs/vantui/es/field/index.js":function(e,n,t){t.d(n,{Field:function(){return Field}});var o=t("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=t("webpack/container/remote/@tarojs/taro"),l=t("webpack/container/remote/react"),i=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),s=t("./node_modules/@antmjs/vantui/es/cell/index.js"),u=t("./node_modules/@antmjs/vantui/es/icon/index.js"),d=(t("./node_modules/@antmjs/vantui/es/utils/index.js"),t("./node_modules/@antmjs/vantui/es/field/wxs.js")),m=t("webpack/container/remote/react/jsx-runtime");t("webpack/container/remote/@tarojs/runtime").document;function ownKeys(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var n=1;n=W}),children:j.length>=W?W:j.length}),"/"+W]}),Q&&(0,m.jsx)(i.View,{className:c.bem("field__error-message",[$,{disabled:F,error:X}]),children:Q})]})}},"./node_modules/@antmjs/vantui/es/field/wxs.js":function(e,n,t){t.d(n,{inputStyle:function(){return inputStyle}});var o=t("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=t("./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,n,t){var o=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),r=t("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),a=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),l=t("webpack/container/remote/react"),i=t("./node_modules/@antmjs/vantui/es/common/jumpLink.js"),c=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),s=t("./node_modules/@antmjs/vantui/es/icon/index.js"),u=t("./node_modules/@antmjs/vantui/es/grid-item/wxs.js"),d=t("webpack/container/remote/react/jsx-runtime"),m=["icon","iconColor","iconPrefix","dot","info","badge","text","setChildrenInstance","parentInstance","index","url","linkType","style","className"];n.default=function GridItem(e){var n=e.icon,t=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,x=e.parentInstance,y=e.index,_=e.url,w=e.linkType,k=e.style,S=e.className,C=(0,r.default)(e,m),T=(0,l.useState)({}),I=(0,o.default)(T,2),N=I[0],O=I[1];(0,l.useEffect)((function(){g(y,{updateStyle:P})}),[y,g]),(0,l.useEffect)((function(){P()}),[x.columnNum]);var P=(0,l.useCallback)((function(){var e=x.columnNum,n=x.border,t=x.square,o=x.gutter,r=x.clickable,a=x.center,l=x.direction,i=x.reverse,c=x.iconSize;O({center:a,border:n,square:t,gutter:o,clickable:r,direction:l,reverse:i,iconSize:c,index:y,columnNum:e})}),[x,y]);return(0,d.jsx)(a.View,{className:" "+c.bem("grid-item",{square:null==N?void 0:N.square})+" "+S,style:c.style([u.wrapperStyle({square:null==N?void 0:N.square,gutter:null==N?void 0:N.gutter,columnNum:null==N?void 0:N.columnNum,index:null==N?void 0:N.index}),k]),onClick:function onClick(e){var n;_&&(0,i.jumpLink)(_,w),null==C||null===(n=C.onClick)||void 0===n||n.call(C,e)},children:(0,d.jsx)(a.View,{className:"content-class "+c.bem("grid-item__content",[null==N?void 0:N.direction,{center:null==N?void 0:N.center,square:null==N?void 0:N.square,reverse:null==N?void 0:N.reverse,clickable:null==N?void 0:N.clickable,surround:(null==N?void 0:N.border)&&(null==N?void 0:N.gutter)}])+" "+(null!=N&&N.border?"van-hairline--surround":""),style:u.contentStyle({square:null==N?void 0:N.square,gutter:null==N?void 0:N.gutter}),children:C.children||(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a.View,{className:"van-grid-item__icon icon-class",children:n?(0,d.jsx)(s.default,{name:n,color:t,classPrefix:p,dot:v,info:b||h,size:null==N?void 0:N.iconSize}):N.renderIcon}),(0,d.jsx)(a.View,{className:"van-grid-item__text text-class",children:j?(0,d.jsx)(a.Text,{children:j}):N.renderText})]})})})}},"./node_modules/@antmjs/vantui/es/grid-item/wxs.js":function(e,n,t){t.d(n,{wrapperStyle:function(){return wrapperStyle},contentStyle:function(){return contentStyle}});var o=t("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=t("./node_modules/@antmjs/vantui/es/wxs/add-unit.js");function wrapperStyle(e){var n=100/e.columnNum+"%";return(0,o.style)({width:n,"padding-top":e.square?n: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,n,t){var o=t("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),r=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),a=t("webpack/container/remote/react"),l=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),i=t("./node_modules/@antmjs/vantui/es/grid/wxs.js"),c=t("webpack/container/remote/react/jsx-runtime"),s=["gutter","clickable","columnNum","center","border","direction","iconSize","square","reverse","className","style"];n.default=function Grid(e){var n=e.gutter,t=void 0===n?null:n,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,x=e.square,y=e.reverse,_=void 0!==y&&y,w=e.className,k=void 0===w?"":w,S=e.style,C=void 0===S?{}:S,T=(0,o.default)(e,s),I=(0,a.useRef)([]),N=(0,a.useCallback)((function(){I.current.forEach((function(e){e.updateStyle()}))}),[]);(0,a.useEffect)((function(){N()}),[N]);var O=(0,a.useCallback)((function(e,n){I.current[e]=n}),[]),P=(0,a.useMemo)((function(){var e=[];return T.children&&Array.isArray(T.children)&&T.children.forEach((function(n,o){e.push((0,a.cloneElement)(n,{setChildrenInstance:O,key:o,index:o,parentInstance:{columnNum:m,border:h,square:x,gutter:t,clickable:u,center:p,direction:b,reverse:_,iconSize:g}}))})),e}),[T.children,m]);return(0,c.jsx)(r.View,{className:"van-grid "+(h&&!t?"van-hairline--top":"")+" "+k,style:l.style([i.rootStyle({gutter:t}),C]),children:P})}},"./node_modules/@antmjs/vantui/es/grid/wxs.js":function(e,n,t){t.d(n,{rootStyle:function(){return rootStyle}});var o=t("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=t("./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,n,t){var o=t("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=t("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),a=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),l=t("webpack/container/remote/@tarojs/taro"),i=t("webpack/container/remote/react"),c=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),u=t("./node_modules/@antmjs/vantui/es/common/utils.js"),d=t("./node_modules/@antmjs/vantui/es/icon/index.js"),m=t("./node_modules/@antmjs/vantui/es/notice-bar/wxs.js"),f=t("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,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var n=1;n0&&void 0!==arguments[0]&&arguments[0];j.current.timer&&clearTimeout(j.current.timer),j.current.timer=null,h((function(n){return _objectSpread(_objectSpread({},n),{},{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(){Q()}),j.current.duration)}),[]),G=(0,i.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 n=e[0],t=e[1];null!=n&&null!=t&&n.width&&t.width&&!1!==A&&(0,l.nextTick)((function(){(A||t.width<=n.width)&&(j.current.wrapWidth=t.width,j.current.contentWidth=n.width,j.current.duration=(t.width+n.width)/O*1e3,j.current.animation=(0,l.createAnimation)({duration:j.current.duration,timingFunction:"linear",delay:I}),Q(!0))}))}))}))}),[o.unitag,A,O,I,Q]),J=(0,i.useCallback)((function(e){"closeable"===_&&(j.current.timer&&clearTimeout(j.current.timer),j.current.timer=null,h((function(e){return _objectSpread(_objectSpread({},e),{},{show:!1})})),null==U||U(e))}),[_,U]);return o.show&&(0,f.jsxs)(c.View,_objectSpread(_objectSpread({className:s.bem("notice-bar",{withicon:_,wrapable:R})+" ".concat(M||""),style:s.style([m.rootStyle({color:D,backgroundColor:q,background:z}),W])},X),{},{onClick:K,children:[V?(0,f.jsx)(d.default,{name:V,className:"van-notice-bar__left-icon"}):B,(0,f.jsx)(c.View,{className:"van-notice-bar__wrap van-notice-bar__wrap_".concat(o.unitag),children:(0,f.jsxs)(c.View,{className:"van-notice-bar__content van-notice-bar__content_".concat(o.unitag," ")+(!1!==A||R?"":"van-ellipsis"),animation:o.animationData,children:[x,!x&&$]})}),"closeable"===_?(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"cross",onClick:J}):"link"===_?(0,f.jsx)(c.Navigator,{url:k,openType:C,children:(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"arrow"})}):H]}))}},"./node_modules/@antmjs/vantui/es/notice-bar/wxs.js":function(e,n,t){t.d(n,{rootStyle:function(){return rootStyle}});var o=t("./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,n,t){var o=t("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=t("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),l=t("webpack/container/remote/react"),i=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),s=t("./node_modules/@antmjs/vantui/es/field/index.js"),u=t("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,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var n=1;n0&&(0,S.jsx)(b.Swiper,{className:"Swiper",indicatorActiveColor:"#333",circular:!0,indicatorDots:!0,autoplay:!0,children:(null!==(T=null==J||null===(I=J[0])||void 0===I?void 0:I.imagesArr)&&void 0!==T?T:[]).map((function(e,n){return(0,S.jsx)(b.SwiperItem,{children:(0,S.jsx)(l.default,{className:"SwiperImg",src:null==e?void 0:e.url,fit:"cover",width:"100%",height:"150px"})})}))})}),(0,S.jsxs)(r.default,{children:[(0,S.jsx)(a.default,{icon:"star",text:"打卡",className:"iconStyle",onClick:(0,v.default)((0,p.default)().mark((function _callee9(){return(0,p.default)().wrap((function _callee9$(e){for(;;)switch(e.prev=e.next){case 0:if(!ae){e.next=4;break}y().getLocation({type:"gcj02",success:function success(e){console.log("lbs",e);null==e||e.latitude,null==e||e.longitude;var n={latitude:null==e?void 0:e.latitude,longitude:null==e?void 0:e.longitude};de(n)},fail:function fail(){m.default.fail({message:"定位授权异常,无法签到打卡",selector:"#vanToast-demo2"})}}),e.next=7;break;case 4:return e.next=6,ce();case 6:m.default.fail({message:"请先登录",selector:"#vanToast-demo2",duration:2e3,onClose:function onClose(){y().navigateTo({url:"/pages/my/index"})}});case 7:case"end":return e.stop()}}),_callee9)})))}),(0,S.jsx)(a.default,{icon:"like",className:"iconStyle",text:"深圳十峰",onClick:function onClick(){y().navigateTo({url:"/pages/mountainPeak/index"})}}),(0,S.jsx)(a.default,{icon:"eye",className:"iconStyle",text:"活动",onClick:function onClick(){y().navigateTo({url:"/pages/activityList/index"})}}),(0,S.jsx)(a.default,{icon:"video",className:"iconStyle",text:"视频",onClick:function onClick(){var e,n,t,o,r,a;y().openChannelsActivity({finderUserName:null!==(e=null==J||null===(n=J[0])||void 0===n||null===(t=n.videoObj)||void 0===t?void 0:t.finderUserName)&&void 0!==e?e:"sphqzUmI0BlppCI",feedId:null!==(o=null==J||null===(r=J[0])||void 0===r||null===(a=r.videoObj)||void 0===a?void 0:a.feedId)&&void 0!==o?o:"export/UzFfAgtgekIEAQAAAAAAeIIQA5S-0wAAAAstQy6ubaLX4KHWvLEZgBPEj6MUcExXaL37zNPgMJpEUVVnZ9njxR_hb9_u-bQj",success:function success(e){console.log("res",e)}})}})]}),(null==$?void 0:$.length)>0?(0,S.jsx)(b.View,{children:(null!==(N=null==$||null===(O=$.reverse())||void 0===O?void 0:O.splice(0,2))&&void 0!==N?N:[]).map((function(e,n){return(0,S.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,S.jsx)(k.default,{dataSource:e})})}))}):(0,S.jsx)(o.default,{title:!0,row:4}),(0,S.jsxs)(b.View,{style:{marginTop:"20px"},children:[" ",(0,S.jsx)(b.OfficialAccount,{onLoad:function onLoad(e){console.log("加载成功",e)},onError:function onError(e){console.log("加载失败",e)}})]}),(0,S.jsx)(m.default,{id:"vanToast-demo2"}),(0,S.jsx)(_.default,{active:0})]})}},"./src/pages/home/index.tsx":function(e,n,t){var o=t("webpack/container/remote/@tarojs/runtime"),r=t("./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 n="./src/pages/home/index.tsx",e(e.s=n);var n}));e.O()}]); \ No newline at end of file +"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/home/index"],{"./node_modules/@antmjs/vantui/es/field/index.js":function(e,n,t){t.d(n,{Field:function(){return Field}});var o=t("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=t("webpack/container/remote/@tarojs/taro"),l=t("webpack/container/remote/react"),i=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),s=t("./node_modules/@antmjs/vantui/es/cell/index.js"),u=t("./node_modules/@antmjs/vantui/es/icon/index.js"),d=(t("./node_modules/@antmjs/vantui/es/utils/index.js"),t("./node_modules/@antmjs/vantui/es/field/wxs.js")),m=t("webpack/container/remote/react/jsx-runtime");t("webpack/container/remote/@tarojs/runtime").document;function ownKeys(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var n=1;n=W}),children:j.length>=W?W:j.length}),"/"+W]}),Q&&(0,m.jsx)(i.View,{className:c.bem("field__error-message",[$,{disabled:F,error:X}]),children:Q})]})}},"./node_modules/@antmjs/vantui/es/field/wxs.js":function(e,n,t){t.d(n,{inputStyle:function(){return inputStyle}});var o=t("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=t("./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,n,t){var o=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),r=t("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),a=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),l=t("webpack/container/remote/react"),i=t("./node_modules/@antmjs/vantui/es/common/jumpLink.js"),c=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),s=t("./node_modules/@antmjs/vantui/es/icon/index.js"),u=t("./node_modules/@antmjs/vantui/es/grid-item/wxs.js"),d=t("webpack/container/remote/react/jsx-runtime"),m=["icon","iconColor","iconPrefix","dot","info","badge","text","setChildrenInstance","parentInstance","index","url","linkType","style","className"];n.default=function GridItem(e){var n=e.icon,t=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,x=e.parentInstance,y=e.index,_=e.url,w=e.linkType,k=e.style,S=e.className,C=(0,r.default)(e,m),T=(0,l.useState)({}),I=(0,o.default)(T,2),N=I[0],O=I[1];(0,l.useEffect)((function(){g(y,{updateStyle:P})}),[y,g]),(0,l.useEffect)((function(){P()}),[x.columnNum]);var P=(0,l.useCallback)((function(){var e=x.columnNum,n=x.border,t=x.square,o=x.gutter,r=x.clickable,a=x.center,l=x.direction,i=x.reverse,c=x.iconSize;O({center:a,border:n,square:t,gutter:o,clickable:r,direction:l,reverse:i,iconSize:c,index:y,columnNum:e})}),[x,y]);return(0,d.jsx)(a.View,{className:" "+c.bem("grid-item",{square:null==N?void 0:N.square})+" "+S,style:c.style([u.wrapperStyle({square:null==N?void 0:N.square,gutter:null==N?void 0:N.gutter,columnNum:null==N?void 0:N.columnNum,index:null==N?void 0:N.index}),k]),onClick:function onClick(e){var n;_&&(0,i.jumpLink)(_,w),null==C||null===(n=C.onClick)||void 0===n||n.call(C,e)},children:(0,d.jsx)(a.View,{className:"content-class "+c.bem("grid-item__content",[null==N?void 0:N.direction,{center:null==N?void 0:N.center,square:null==N?void 0:N.square,reverse:null==N?void 0:N.reverse,clickable:null==N?void 0:N.clickable,surround:(null==N?void 0:N.border)&&(null==N?void 0:N.gutter)}])+" "+(null!=N&&N.border?"van-hairline--surround":""),style:u.contentStyle({square:null==N?void 0:N.square,gutter:null==N?void 0:N.gutter}),children:C.children||(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a.View,{className:"van-grid-item__icon icon-class",children:n?(0,d.jsx)(s.default,{name:n,color:t,classPrefix:p,dot:v,info:b||h,size:null==N?void 0:N.iconSize}):N.renderIcon}),(0,d.jsx)(a.View,{className:"van-grid-item__text text-class",children:j?(0,d.jsx)(a.Text,{children:j}):N.renderText})]})})})}},"./node_modules/@antmjs/vantui/es/grid-item/wxs.js":function(e,n,t){t.d(n,{wrapperStyle:function(){return wrapperStyle},contentStyle:function(){return contentStyle}});var o=t("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=t("./node_modules/@antmjs/vantui/es/wxs/add-unit.js");function wrapperStyle(e){var n=100/e.columnNum+"%";return(0,o.style)({width:n,"padding-top":e.square?n: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,n,t){var o=t("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),r=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),a=t("webpack/container/remote/react"),l=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),i=t("./node_modules/@antmjs/vantui/es/grid/wxs.js"),c=t("webpack/container/remote/react/jsx-runtime"),s=["gutter","clickable","columnNum","center","border","direction","iconSize","square","reverse","className","style"];n.default=function Grid(e){var n=e.gutter,t=void 0===n?null:n,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,x=e.square,y=e.reverse,_=void 0!==y&&y,w=e.className,k=void 0===w?"":w,S=e.style,C=void 0===S?{}:S,T=(0,o.default)(e,s),I=(0,a.useRef)([]),N=(0,a.useCallback)((function(){I.current.forEach((function(e){e.updateStyle()}))}),[]);(0,a.useEffect)((function(){N()}),[N]);var O=(0,a.useCallback)((function(e,n){I.current[e]=n}),[]),P=(0,a.useMemo)((function(){var e=[];return T.children&&Array.isArray(T.children)&&T.children.forEach((function(n,o){e.push((0,a.cloneElement)(n,{setChildrenInstance:O,key:o,index:o,parentInstance:{columnNum:m,border:h,square:x,gutter:t,clickable:u,center:p,direction:b,reverse:_,iconSize:g}}))})),e}),[T.children,m]);return(0,c.jsx)(r.View,{className:"van-grid "+(h&&!t?"van-hairline--top":"")+" "+k,style:l.style([i.rootStyle({gutter:t}),C]),children:P})}},"./node_modules/@antmjs/vantui/es/grid/wxs.js":function(e,n,t){t.d(n,{rootStyle:function(){return rootStyle}});var o=t("./node_modules/@antmjs/vantui/es/wxs/style.js"),r=t("./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,n,t){var o=t("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=t("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),a=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),l=t("webpack/container/remote/@tarojs/taro"),i=t("webpack/container/remote/react"),c=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),u=t("./node_modules/@antmjs/vantui/es/common/utils.js"),d=t("./node_modules/@antmjs/vantui/es/icon/index.js"),m=t("./node_modules/@antmjs/vantui/es/notice-bar/wxs.js"),f=t("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,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var n=1;n0&&void 0!==arguments[0]&&arguments[0];j.current.timer&&clearTimeout(j.current.timer),j.current.timer=null,h((function(n){return _objectSpread(_objectSpread({},n),{},{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(){Q()}),j.current.duration)}),[]),G=(0,i.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 n=e[0],t=e[1];null!=n&&null!=t&&n.width&&t.width&&!1!==A&&(0,l.nextTick)((function(){(A||t.width<=n.width)&&(j.current.wrapWidth=t.width,j.current.contentWidth=n.width,j.current.duration=(t.width+n.width)/O*1e3,j.current.animation=(0,l.createAnimation)({duration:j.current.duration,timingFunction:"linear",delay:I}),Q(!0))}))}))}))}),[o.unitag,A,O,I,Q]),J=(0,i.useCallback)((function(e){"closeable"===_&&(j.current.timer&&clearTimeout(j.current.timer),j.current.timer=null,h((function(e){return _objectSpread(_objectSpread({},e),{},{show:!1})})),null==U||U(e))}),[_,U]);return o.show&&(0,f.jsxs)(c.View,_objectSpread(_objectSpread({className:s.bem("notice-bar",{withicon:_,wrapable:R})+" ".concat(M||""),style:s.style([m.rootStyle({color:D,backgroundColor:q,background:z}),W])},X),{},{onClick:K,children:[V?(0,f.jsx)(d.default,{name:V,className:"van-notice-bar__left-icon"}):B,(0,f.jsx)(c.View,{className:"van-notice-bar__wrap van-notice-bar__wrap_".concat(o.unitag),children:(0,f.jsxs)(c.View,{className:"van-notice-bar__content van-notice-bar__content_".concat(o.unitag," ")+(!1!==A||R?"":"van-ellipsis"),animation:o.animationData,children:[x,!x&&$]})}),"closeable"===_?(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"cross",onClick:J}):"link"===_?(0,f.jsx)(c.Navigator,{url:k,openType:C,children:(0,f.jsx)(d.default,{className:"van-notice-bar__right-icon",name:"arrow"})}):H]}))}},"./node_modules/@antmjs/vantui/es/notice-bar/wxs.js":function(e,n,t){t.d(n,{rootStyle:function(){return rootStyle}});var o=t("./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,n,t){var o=t("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=t("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),l=t("webpack/container/remote/react"),i=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=t("./node_modules/@antmjs/vantui/es/wxs/utils.js"),s=t("./node_modules/@antmjs/vantui/es/field/index.js"),u=t("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,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var n=1;n0&&(0,S.jsx)(b.Swiper,{className:"Swiper",indicatorActiveColor:"#333",circular:!0,indicatorDots:!0,autoplay:!0,children:(null!==(T=null==J||null===(I=J[0])||void 0===I?void 0:I.imagesArr)&&void 0!==T?T:[]).map((function(e,n){return(0,S.jsx)(b.SwiperItem,{children:(0,S.jsx)(l.default,{className:"SwiperImg",src:null==e?void 0:e.url,fit:"cover",width:"100%",height:"150px"})})}))})}),(0,S.jsxs)(r.default,{children:[(0,S.jsx)(a.default,{icon:"star",text:"打卡",className:"iconStyle",onClick:(0,v.default)((0,p.default)().mark((function _callee10(){return(0,p.default)().wrap((function _callee10$(e){for(;;)switch(e.prev=e.next){case 0:if(!ae){e.next=4;break}y().getLocation({type:"gcj02",success:function success(e){console.log("lbs",e);null==e||e.latitude,null==e||e.longitude;var n={latitude:null==e?void 0:e.latitude,longitude:null==e?void 0:e.longitude};me(n)},fail:function fail(){m.default.fail({message:"定位授权异常,无法签到打卡",selector:"#vanToast-demo2"})}}),e.next=7;break;case 4:return e.next=6,se();case 6:m.default.fail({message:"请先登录",selector:"#vanToast-demo2",duration:2e3,onClose:function onClose(){y().navigateTo({url:"/pages/my/index"})}});case 7:case"end":return e.stop()}}),_callee10)})))}),(0,S.jsx)(a.default,{icon:"like",className:"iconStyle",text:"深圳十峰",onClick:function onClick(){y().navigateTo({url:"/pages/mountainPeak/index"})}}),(0,S.jsx)(a.default,{icon:"eye",className:"iconStyle",text:"活动",onClick:function onClick(){y().navigateTo({url:"/pages/activityList/index"})}}),(0,S.jsx)(a.default,{icon:"video",className:"iconStyle",text:"视频",onClick:function onClick(){var e,n,t,o,r,a;y().openChannelsActivity({finderUserName:null!==(e=null==J||null===(n=J[0])||void 0===n||null===(t=n.videoObj)||void 0===t?void 0:t.finderUserName)&&void 0!==e?e:"sphqzUmI0BlppCI",feedId:null!==(o=null==J||null===(r=J[0])||void 0===r||null===(a=r.videoObj)||void 0===a?void 0:a.feedId)&&void 0!==o?o:"export/UzFfAgtgekIEAQAAAAAAeIIQA5S-0wAAAAstQy6ubaLX4KHWvLEZgBPEj6MUcExXaL37zNPgMJpEUVVnZ9njxR_hb9_u-bQj",success:function success(e){console.log("res",e)}})}})]}),(null==$?void 0:$.length)>0?(0,S.jsx)(b.View,{children:(null!==(N=null==$||null===(O=$.reverse())||void 0===O?void 0:O.splice(0,2))&&void 0!==N?N:[]).map((function(e,n){return(0,S.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,S.jsx)(k.default,{dataSource:e})})}))}):(0,S.jsx)(o.default,{title:!0,row:4}),(0,S.jsxs)(b.View,{style:{marginTop:"20px"},children:[" ",(0,S.jsx)(b.OfficialAccount,{onLoad:function onLoad(e){console.log("加载成功",e)},onError:function onError(e){console.log("加载失败",e)}})]}),(0,S.jsx)(m.default,{id:"vanToast-demo2"}),(0,S.jsx)(_.default,{active:0})]})}},"./src/pages/home/index.tsx":function(e,n,t){var o=t("webpack/container/remote/@tarojs/runtime"),r=t("./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 n="./src/pages/home/index.tsx",e(e.s=n);var n}));e.O()}]); \ No newline at end of file diff --git a/dist/runtime.js b/dist/runtime.js index 32e3ae2..cd764fb 100644 --- a/dist/runtime.js +++ b/dist/runtime.js @@ -1 +1 @@ -!function(){"use strict";var e,r,t,n,_={},a={};function __webpack_require__(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={id:e,loaded:!1,exports:{}};return _[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}__webpack_require__.m=_,e=[],__webpack_require__.O=function(r,t,n,_){if(!t){var a=1/0;for(c=0;c=_)&&Object.keys(__webpack_require__.O).every((function(e){return __webpack_require__.O[e](t[o])}))?t.splice(o--,1):(i=!1,_0&&e[c-1][2]>_;c--)e[c]=e[c-1];e[c]=[t,n,_]},__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.f={},__webpack_require__.e=function(e){return Promise.all(Object.keys(__webpack_require__.f).reduce((function(r,t){return __webpack_require__.f[t](e,r),r}),[]))},__webpack_require__.u=function(e){},__webpack_require__.miniCssF=function(e){},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r={},t="myApp:",__webpack_require__.l=function(e,n,_,a){if(r[e])r[e].push(n);else{var i,o;if(void 0!==_)for(var u=document.getElementsByTagName("script"),c=0;c=_)&&Object.keys(__webpack_require__.O).every((function(e){return __webpack_require__.O[e](t[o])}))?t.splice(o--,1):(i=!1,_0&&e[c-1][2]>_;c--)e[c]=e[c-1];e[c]=[t,n,_]},__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.f={},__webpack_require__.e=function(e){return Promise.all(Object.keys(__webpack_require__.f).reduce((function(r,t){return __webpack_require__.f[t](e,r),r}),[]))},__webpack_require__.u=function(e){},__webpack_require__.miniCssF=function(e){},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r={},t="myApp:",__webpack_require__.l=function(e,n,_,a){if(r[e])r[e].push(n);else{var i,o;if(void 0!==_)for(var u=document.getElementsByTagName("script"),c=0;c { - componentDidMount() { + async componentDidMount() { Taro.cloud.init({ // env: 'cloud1-5g5xrgza12a0dd6d',//公司 - env:envConfig, //个人 - traceUser:true - }) + env: envConfig, //个人 + traceUser: true, + }); const a = new Taro.cloud.Cloud({ - resourceEnv:envConfig, //公司 - }) - a.init() + resourceEnv: envConfig, + resourceAppid: appId, // 环境所属的账号appid + // resourceEnv: "prod-4go74loxa6ac34a8", // 微信云托管的环境ID + }); + + await a.init(); + + // setTimeout(()=>{ + // const b= new Taro.cloud.Cloud({ + // resourceEnv: "prod-4go74loxa6ac34a8", // 微信云托管的环境ID + // resourceAppid: appId, // 环境所属的账号appid + + // }); + // b.init(); + // const r = b.callContainer({ + // path: '/', // 填入业务自定义路径 + // header: { + // 'X-WX-SERVICE': 'fastapi-003', // 填入服务名称 + // }, + // // 其余参数同 wx.request + // method: 'GET', + // }) + // console.log(r,'rrrr') + + // },3000) } componentDidShow() {} componentDidHide() {} + async call(obj, number = 0) { + const that: any = this; + if (that.cloud == null) { + that.cloud = new Taro.cloud.Cloud({ + resourceAppid: "wx515bd42ee0db5c5d", // 微信云托管环境所属账号,服务商appid、公众号或小程序appid + resourceEnv: "prod-4go74loxa6ac34a8", // 微信云托管的环境ID + }); + await that.cloud.init(); // init过程是异步的,需要等待 init 完成才可以发起调用 + } + try { + const result = await that.cloud.callContainer({ + path: obj.path, // 填入业务自定义路径和参数,根目录,就是 / + method: obj.method || "GET", // 按照自己的业务开发,选择对应的方法 + // dataType:'text', // 如果返回的不是 json 格式,需要添加此项 + header: { + "X-WX-SERVICE": "fastapi-003", // xxx中填入服务名称(微信云托管 - 服务管理 - 服务列表 - 服务名称) + // 其他 header 参数 + }, + // 其余参数同 wx.request + }); + console.log( + `微信云托管调用结果${result.errMsg} | callid:${result.callID}` + ); + return result.data; // 业务数据在 data 中 + } catch (e) { + const error = e.toString(); + // 如果错误信息为未初始化,则等待300ms再次尝试,因为 init 过程是异步的 + if (error.indexOf("Cloud API isn't enabled") != -1 && number < 3) { + return new Promise((resolve) => { + setTimeout(function () { + resolve(that.call(obj, number + 1)); + }, 300); + }); + } else { + throw new Error(`微信云托管调用失败${error}`); + } + } + } + // this.props.children 是将要会渲染的页面 render() { return this.props.children; diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index b6399ce..8ea6b76 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -93,6 +93,18 @@ const Home = () => { }; }); + const testCloud = async () => { + // const app = Taro.getApp() + // console.log('app',app) + // const res = await app.call({ + // path:'/' + // }) + // console.log('业务返回结果',res) + }; + useEffect(() => { + testCloud(); + }, []); + useEffect(() => { // 设置标题 definePageConfig({