feat: 更新依赖库

This commit is contained in:
eric
2022-11-20 22:12:26 +08:00
parent 9045642740
commit 54d12d3259
13 changed files with 492 additions and 23 deletions

View File

@@ -7,7 +7,7 @@
flex-direction: row;
align-items: center;
justify-content: center;
background-color: #f6ffed;
// background-color: #f6ffed;
padding: 20px;
}

View File

@@ -1,5 +1,13 @@
import { Card, Cell, Col, Row, Tabbar, TabbarItem } from "@antmjs/vantui";
import { View } from "@tarojs/components";
import {
Button,
Card,
Cell,
Col,
Row,
Tabbar,
TabbarItem,
} from "@antmjs/vantui";
import { OpenData, View } from "@tarojs/components";
import react, { useEffect } from "react";
import TabbarCom from "../components/TabbarCom";
import { Image } from "@antmjs/vantui";
@@ -17,6 +25,18 @@ const my = (props: any) => {
definePageConfig({
navigationBarTitleText: "我的",
});
// Taro.getUserProfile({
// desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
// success: (res) => {
// // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
// console.log('res',res)
// // this.setState({
// // userInfo: res.userInfo,
// // hasUserInfo: true
// // })
// }
// })
}, []);
const CardCom = () => {
@@ -28,20 +48,69 @@ const my = (props: any) => {
</View>
);
};
// 获取用户信息 [头像/昵称]
const onGetUserInfo = (info: any) => {
console.log("info", info);
};
// 获取用户手机 [手机号]-需要揭秘
const onGetPhoneNumber = (info: any) => {
console.log("info", info);
getPhoneNumber(info)
// Taro.cloud.openapi.phonenumber.getPhoneNumber({code:'code'})
};
const getPhoneNumber = (e:any) => {
console.log('点击获取手机事件', e.detail.cloudID);
Taro.cloud.callFunction({
name: "getPhone",
data: {
cloudID: e.detail.cloudID
// weRunData
},
}).then((res:any) => {
console.log(res);
console.log(res.result.list[0].data.phoneNumber);
})
}
return (
<View className="myContent">
{/* <View className={styles?.myContent}> */}
{/* 头像 */}
<View className={`myImage`}>
<Image
{/* 微信开放api-用户头像 */}
<OpenData type="userAvatarUrl"></OpenData>
{/* <Image
round
width="100px"
height="100px"
src="cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/images/images-2.jpg"
/>
/> */}
</View>
<View>
<Button
open-type="getUserInfo"
lang="zh_CN"
onGetUserInfo={onGetUserInfo}
>
获取用户信息
</Button>
<Button
open-type="getPhoneNumber"
lang="zh_CN"
onGetPhoneNumber={onGetPhoneNumber}
>
获取手机信息
</Button>
</View>
<View>
<Tabs sticky={true}>
<Tab title="待审核">{CardCom()}</Tab>
@@ -84,6 +153,8 @@ const my = (props: any) => {
/>
</View>
{/* <Button className='btn-max-w' plain type='primary' >按钮</Button> */}
<TabbarCom active={2} />
</View>
);