From 6b3d439bdd6484954377848614bef579f5f8018c Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 22 Nov 2022 22:44:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=99=BB=E5=BD=95=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/pages/my/index.js | 2 +- dist/pages/my/index.js.LICENSE.txt | 2 ++ src/pages/my/index.tsx | 27 +++++++++++++++++++++------ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/dist/pages/my/index.js b/dist/pages/my/index.js index 1ce2cff..e772981 100644 --- a/dist/pages/my/index.js +++ b/dist/pages/my/index.js @@ -1,2 +1,2 @@ /*! For license information please see index.js.LICENSE.txt */ -"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/my/index"],{"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx":function(e,n,o){var t=o("./node_modules/@antmjs/vantui/es/cell/index.js"),a=o("./node_modules/@antmjs/vantui/es/button/index.js"),s=o("./node_modules/@antmjs/vantui/es/image/index.js"),l=o("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),u=o("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),i=o("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),d=o("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),r=o("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=o("webpack/container/remote/react"),m=o("./src/pages/components/TabbarCom/index.tsx"),f=o("webpack/container/remote/@tarojs/taro"),p=o.n(f),x=(o("./src/pages/components/ActiveCard/index.tsx"),o("./src/utils/index.ts")),g=o("webpack/container/remote/react/jsx-runtime");n.default=function my(e){var n=(0,c.useState)({}),o=(0,d.default)(n,2),f=(o[0],o[1],(0,c.useState)([])),v=(0,d.default)(f,2),b=(v[0],v[1],(0,c.useState)(0)),j=(0,d.default)(b,2),h=(j[0],j[1],(0,c.useState)(!0)),k=(0,d.default)(h,2),w=k[0],_=k[1];(0,c.useEffect)((function(){y()}),[]);var y=function(){var e=(0,i.default)((0,u.default)().mark((function _callee(){var e;return(0,u.default)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,x.phoneLogin)();case 2:e=n.sent,console.log("isok",e),_(e);case 5:case"end":return n.stop()}}),_callee)})));return function getok(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){}),[]);var C=function getPhoneNumber(e){console.log("点击获取手机事件",e.detail.cloudID),function getLogin(e){p().cloud.callFunction({name:"getPhoneNum",data:{weRunData:p().cloud.CloudID(e.detail.cloudID)}}).then((function(e){var n,o,t,a,s,u,i,d,r;console.log("res222",e);var c=null==e||null===(n=e.result)||void 0===n||null===(o=n.event)||void 0===o||null===(t=o.weRunData)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.phoneNumber,m=null==e||null===(s=e.result)||void 0===s||null===(u=s.context)||void 0===u?void 0:u.tencentcloud_uin,f={tableName:"userInfo",keyValue:{openId:null==e||null===(i=e.result)||void 0===i||null===(d=i.event)||void 0===d||null===(r=d.userInfo)||void 0===r?void 0:r.openId},okFun:function okFun(e){var n,o;console.log("q",e),(0,x.updateTableid)({id:null==e||null===(n=e.data)||void 0===n||null===(o=n[0])||void 0===o?void 0:o._id,tableName:"userInfo",objData:{tencentcloud_uin:m,authInfo:{authPhonenum:c}},okFun:function okFun(e){y()}})}};(0,x.getTable)((0,l.default)({},f))}))}(e)};return(0,g.jsxs)(r.View,{className:"myContent",children:[(0,g.jsxs)(r.View,{className:"myImage",children:[(0,g.jsx)(s.default,{round:!0,width:"100px",height:"100px",src:"cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/images/images-2.jpg"}),!w&&(0,g.jsx)(r.View,{className:"loginBtn",children:(0,g.jsx)(a.default,{type:"primary",size:"mini","open-type":"getPhoneNumber",lang:"zh_CN",onGetPhoneNumber:function onGetPhoneNumber(e){console.log("info",e),C(e)},children:"登录"})})]}),(0,g.jsxs)(r.View,{className:"cellArr",children:[(0,g.jsx)(t.default,{icon:"manager",title:"打卡记录",isLink:!0,onClick:function onClick(){p().navigateTo({url:"/pages/my/components/CheckinDetail/index"})}}),(0,g.jsx)(t.default,{title:"微信客服",icon:"wechat",isLink:!0,value:"",onClick:function onClick(){p().openCustomerServiceChat({corpId:"wwb04af9a97514271c",extInfo:{url:"https://work.weixin.qq.com/kfid/kfc70f3f112c97a54c5"},success:function success(e){}})}}),(0,g.jsx)(t.default,{icon:"friends",title:"关于我们",isLink:!0,onClick:function onClick(){p().navigateTo({url:"/pages/my/components/AbountUs/index"})}})]}),(0,g.jsx)(m.default,{active:2})]})}},"./src/pages/my/index.tsx":function(e,n,o){var t=o("webpack/container/remote/@tarojs/runtime"),a=o("./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,t.createPageConfig)(a.default,"pages/my/index",{root:{cn:[]}},{navigationBarTitleText:"我的"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return n="./src/pages/my/index.tsx",e(e.s=n);var n}));e.O()}]); \ No newline at end of file +"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/my/index"],{"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx":function(e,n,t){var o=t("./node_modules/@antmjs/vantui/es/cell/index.js"),a=t("./node_modules/@antmjs/vantui/es/toast/index.js"),s=t("./node_modules/@antmjs/vantui/es/button/index.js"),l=t("./node_modules/@antmjs/vantui/es/image/index.js"),u=t("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),i=t("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),d=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),c=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),m=t("webpack/container/remote/react"),f=t("./src/pages/components/TabbarCom/index.tsx"),p=t("webpack/container/remote/@tarojs/taro"),x=t.n(p),g=(t("./src/pages/components/ActiveCard/index.tsx"),t("./src/utils/index.ts")),v=t("webpack/container/remote/react/jsx-runtime");n.default=function my(e){var n=(0,m.useState)({}),t=(0,r.default)(n,2),p=(t[0],t[1],(0,m.useState)([])),j=(0,r.default)(p,2),b=(j[0],j[1],(0,m.useState)(0)),h=(0,r.default)(b,2),k=(h[0],h[1],(0,m.useState)(!0)),w=(0,r.default)(k,2),_=w[0],y=w[1];(0,m.useEffect)((function(){C()}),[]);var C=function(){var e=(0,d.default)((0,i.default)().mark((function _callee(){var e;return(0,i.default)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,g.phoneLogin)();case 2:e=n.sent,console.log("isok",e),y(e);case 5:case"end":return n.stop()}}),_callee)})));return function getok(){return e.apply(this,arguments)}}();(0,m.useEffect)((function(){}),[]);var N=function getPhoneNumber(e){console.log("点击获取手机事件",e.detail.cloudID),function getLogin(e){x().cloud.callFunction({name:"getPhoneNum",data:{weRunData:x().cloud.CloudID(e.detail.cloudID)}}).then((function(e){var n,t,o,a,s,l,i,d,r;console.log("res222",e);var c=null==e||null===(n=e.result)||void 0===n||null===(t=n.event)||void 0===t||null===(o=t.weRunData)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.phoneNumber,m=null==e||null===(s=e.result)||void 0===s||null===(l=s.context)||void 0===l?void 0:l.tencentcloud_uin,f={tableName:"userInfo",keyValue:{openId:null==e||null===(i=e.result)||void 0===i||null===(d=i.event)||void 0===d||null===(r=d.userInfo)||void 0===r?void 0:r.openId},okFun:function okFun(e){var n,t;console.log("q",e),(0,g.updateTableid)({id:null==e||null===(n=e.data)||void 0===n||null===(t=n[0])||void 0===t?void 0:t._id,tableName:"userInfo",objData:{tencentcloud_uin:m,authInfo:{authPhonenum:c}},okFun:function okFun(e){C()}})}};(0,g.getTable)((0,u.default)({},f))}))}(e)};return(0,v.jsxs)(c.View,{className:"myContent",children:[(0,v.jsxs)(c.View,{className:"myImage",children:[(0,v.jsx)(l.default,{round:!0,width:"100px",height:"100px",src:"cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/images/images-2.jpg"}),!_&&(0,v.jsx)(c.View,{className:"loginBtn",children:(0,v.jsx)(s.default,{type:"primary",size:"mini","open-type":"getPhoneNumber",lang:"zh_CN",onGetPhoneNumber:function onGetPhoneNumber(e){console.log("info",e),N(e)},children:"登录"})})]}),(0,v.jsxs)(c.View,{className:"cellArr",children:[(0,v.jsx)(o.default,{icon:"manager",title:"打卡记录",isLink:!0,onClick:function onClick(){_?x().navigateTo({url:"/pages/my/components/CheckinDetail/index"}):a.default.fail({message:"请先登录",selector:"#vanToast-demo2"})}}),(0,v.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,v.jsx)(o.default,{icon:"friends",title:"关于我们",isLink:!0,onClick:function onClick(){x().navigateTo({url:"/pages/my/components/AbountUs/index"})}})]}),(0,v.jsx)(a.default,{id:"vanToast-demo2"}),(0,v.jsx)(f.default,{active:2})]})}},"./src/pages/my/index.tsx":function(e,n,t){var o=t("webpack/container/remote/@tarojs/runtime"),a=t("./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx");Page((0,o.createPageConfig)(a.default,"pages/my/index",{root:{cn:[]}},{navigationBarTitleText:"我的"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return n="./src/pages/my/index.tsx",e(e.s=n);var n}));e.O()}]); \ No newline at end of file diff --git a/dist/pages/my/index.js.LICENSE.txt b/dist/pages/my/index.js.LICENSE.txt index b284db7..633bc16 100644 --- a/dist/pages/my/index.js.LICENSE.txt +++ b/dist/pages/my/index.js.LICENSE.txt @@ -20,6 +20,8 @@ /*! @antmjs/vantui/es/image */ +/*! @antmjs/vantui/es/toast */ + /*! @tarojs/components */ /*! @tarojs/runtime */ diff --git a/src/pages/my/index.tsx b/src/pages/my/index.tsx index 3c75570..76ef585 100644 --- a/src/pages/my/index.tsx +++ b/src/pages/my/index.tsx @@ -6,6 +6,7 @@ import { Row, Tabbar, TabbarItem, + Toast, } from "@antmjs/vantui"; import { OpenData, View } from "@tarojs/components"; import react, { useEffect, useState } from "react"; @@ -201,12 +202,24 @@ const my = (props: any) => { */} - { - // 跳转到目的页面,打开新页面 - Taro.navigateTo({ - url: "/pages/my/components/CheckinDetail/index", - }); - }}/> + { + if (isin) { + // 跳转到目的页面,打开新页面 + Taro.navigateTo({ + url: "/pages/my/components/CheckinDetail/index", + }); + }else{ + Toast.fail({ + message: '请先登录', + selector: '#vanToast-demo2', + }) + } + }} + /> {/* */} { /> */} + + {/* tabbar */}