|
@@ -1,109 +1,27 @@
|
|
|
import { Component } from 'react'
|
|
|
import Taro from '@tarojs/taro'
|
|
|
-import { View, Text, Image, Button, Navigator, Input } from '@tarojs/components'
|
|
|
+import { View, Text, Image, Button, Navigator } from '@tarojs/components'
|
|
|
import { observer, inject } from 'mobx-react'
|
|
|
import './index.less'
|
|
|
-// import { pushUserInfo, pushAdLog, getUserInfoSecond, setSign, getVideoNoin, setTaskCoin, addSubscribe } from '../../api'
|
|
|
-import { getLoginSto } from '@src/utils/loginSto'
|
|
|
import { Store } from '@src/app'
|
|
|
-
|
|
|
-// import TipsUnlocking from '../../components/guidePage/tipsUnlocking'
|
|
|
-// import Toast from '../../components/guidePage/toast'
|
|
|
-// import SceneTips from '../../components/guidePage/sceneTips'
|
|
|
-// import Subscribe from '../../components/guidePage/subscribe'
|
|
|
-// import SignTips from '../../components/guidePage/signTips'
|
|
|
+import ModalStore from '@src/store/modalStore'
|
|
|
interface Props {
|
|
|
store: Store;
|
|
|
}
|
|
|
|
|
|
-let _this: any = null
|
|
|
|
|
|
@inject('store')
|
|
|
@observer
|
|
|
class My extends Component<Props> {
|
|
|
-
|
|
|
state = {
|
|
|
}
|
|
|
-
|
|
|
- componentDidShow() {
|
|
|
- this.getData()
|
|
|
- }
|
|
|
-
|
|
|
- onLoad() {
|
|
|
- /* @ts-ignore */
|
|
|
- if (wx.getUserProfile) {
|
|
|
- this.setState({
|
|
|
- canIUseGetUserProfile: true
|
|
|
- })
|
|
|
- }
|
|
|
- Taro.getSystemInfo({
|
|
|
- success(res) {
|
|
|
- log('===========', res);
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- _this = this
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- getUserProfile() {
|
|
|
- // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
|
|
|
- // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
|
|
|
- /* @ts-ignore */
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- getData = (type?: string) => {
|
|
|
- let { indexStore } = this.props.store
|
|
|
- // getUserInfoSecond().then((res: any) => {
|
|
|
- // this.getInsertScreen()
|
|
|
- // indexStore.SET_USERINFO()
|
|
|
- // let body = res?.body
|
|
|
- // this.setState({
|
|
|
- // signInfo: body?.sign,
|
|
|
- // task: body?.task,
|
|
|
- // account: body?.userinfo?.account
|
|
|
- // })
|
|
|
- // let { is_receive, subscribe_coin } = body?.task?.important
|
|
|
- // if (type && type === 'sub' && is_receive === 1) {
|
|
|
- // this.setState({
|
|
|
- // toastInfo: {
|
|
|
- // title: '消息订阅',
|
|
|
- // reward: subscribe_coin,
|
|
|
- // show: true
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- handleWXGetUserInfo = (event) => {
|
|
|
- let detail = event.detail
|
|
|
- // let { city, country, gender, nickName, province, avatarUrl } = detail.userInfo
|
|
|
- this.setState({
|
|
|
- userInfo: detail.userInfo
|
|
|
- })
|
|
|
- let { open_id } = getLoginSto()
|
|
|
- // pushUserInfo({ openid: open_id, city, country, gender, nickname: nickName, province, avatarUrl }).then(() => {
|
|
|
- // this.getData()
|
|
|
- // })
|
|
|
- }
|
|
|
-
|
|
|
- onChooseAvatar = (e) => {
|
|
|
- const { avatarUrl } = e.detail
|
|
|
- console.log(e.detail)
|
|
|
- }
|
|
|
render() {
|
|
|
let { userInfoStore } = this.props.store
|
|
|
-
|
|
|
return <View className='my'>
|
|
|
<View className="userInfo">
|
|
|
{/* <Image src={require('../../icon/myBack.png')} /> */}
|
|
|
<View className="userInfo_box">
|
|
|
+ {/* 个人信息 */}
|
|
|
<View className="top" >
|
|
|
<View className="left">
|
|
|
<View className="avtai">
|
|
@@ -126,11 +44,11 @@ class My extends Component<Props> {
|
|
|
userInfoStore.isAuth && <View className="right">
|
|
|
{
|
|
|
userInfoStore.isAuth ?
|
|
|
- <Button onClick={this.getUserProfile} className="loginBt" >
|
|
|
+ <Button onClick={() => { }} className="loginBt" >
|
|
|
<Image lazy-load src={require('../../icon/loaginBt.png')} />
|
|
|
</Button>
|
|
|
: <View>
|
|
|
- <Button openType='chooseAvatar' onChooseAvatar={this.onChooseAvatar} className="loginBt">
|
|
|
+ <Button openType='chooseAvatar' onChooseAvatar={() => { }} className="loginBt">
|
|
|
<Image lazy-load src={require('../../icon/loaginBt.png')} />
|
|
|
</Button>
|
|
|
{/* <Input type="nickname" placeholder="请输入昵称" /> */}
|
|
@@ -156,6 +74,23 @@ class My extends Component<Props> {
|
|
|
</View>
|
|
|
<Image lazy-load src={require('../../icon/vipBack.png')} />
|
|
|
</View>
|
|
|
+ {/*我的账户 */}
|
|
|
+ <View className='account_info'>
|
|
|
+ <View className='account_info_title'>我的账户</View>
|
|
|
+ <View className='account_info_content'>
|
|
|
+ <View className='account_info_content_left'>
|
|
|
+ <View className='account_info_content_text'>
|
|
|
+ <Text>12</Text>
|
|
|
+ <Text>书币</Text>
|
|
|
+ </View>
|
|
|
+ <View className='account_info_content_text' onClick={() => { }}>
|
|
|
+ <Text>300</Text>
|
|
|
+ <Text>赠币</Text>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View className='account_info_content_btn' onClick={() => { ModalStore.showModal() }}>充值</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
{/* 底部功能入口 */}
|
|
|
<View className="list_bt" >
|
|
|
<Navigator className="item" url="/pages/my/contactService/index">
|
|
@@ -180,8 +115,6 @@ class My extends Component<Props> {
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
-
|
|
|
-
|
|
|
</View>
|
|
|
}
|
|
|
}
|