|
@@ -1,90 +1,28 @@
|
|
import { Component } from 'react'
|
|
import { Component } from 'react'
|
|
import Taro from '@tarojs/taro'
|
|
import Taro from '@tarojs/taro'
|
|
-import { View, Text, Image, Button, Navigator } from '@tarojs/components'
|
|
|
|
|
|
+import { View, Text, Image, Button, Navigator, Input } from '@tarojs/components'
|
|
import { observer, inject } from 'mobx-react'
|
|
import { observer, inject } from 'mobx-react'
|
|
import './index.less'
|
|
import './index.less'
|
|
// import { pushUserInfo, pushAdLog, getUserInfoSecond, setSign, getVideoNoin, setTaskCoin, addSubscribe } from '../../api'
|
|
// import { pushUserInfo, pushAdLog, getUserInfoSecond, setSign, getVideoNoin, setTaskCoin, addSubscribe } from '../../api'
|
|
import { getLoginSto } from '@src/utils/loginSto'
|
|
import { getLoginSto } from '@src/utils/loginSto'
|
|
|
|
+import { Store } from '@src/app'
|
|
|
|
|
|
// import TipsUnlocking from '../../components/guidePage/tipsUnlocking'
|
|
// import TipsUnlocking from '../../components/guidePage/tipsUnlocking'
|
|
// import Toast from '../../components/guidePage/toast'
|
|
// import Toast from '../../components/guidePage/toast'
|
|
// import SceneTips from '../../components/guidePage/sceneTips'
|
|
// import SceneTips from '../../components/guidePage/sceneTips'
|
|
// import Subscribe from '../../components/guidePage/subscribe'
|
|
// import Subscribe from '../../components/guidePage/subscribe'
|
|
// import SignTips from '../../components/guidePage/signTips'
|
|
// import SignTips from '../../components/guidePage/signTips'
|
|
-
|
|
|
|
-type PageStateProps = {
|
|
|
|
- store: {
|
|
|
|
- indexStore: {
|
|
|
|
- navBarTop: number,
|
|
|
|
- SET_NAVBARMARGINTOP: Function,
|
|
|
|
- openType: number,
|
|
|
|
- userInfo: userInfo,
|
|
|
|
- SET_USERINFO: Function
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-interface My {
|
|
|
|
- props: PageStateProps;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-type userInfo = {
|
|
|
|
- user_name: string,
|
|
|
|
- avatar_url: string,
|
|
|
|
- is_auth: number,
|
|
|
|
- is_vip: boolean,
|
|
|
|
- member_end_date: string,
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-type state = {
|
|
|
|
- canIUseGetUserProfile: boolean,
|
|
|
|
- videoAd: Taro.RewardedVideoAd | undefined,
|
|
|
|
- isPullVideo: boolean,
|
|
|
|
- signInfo: { // 签到信息
|
|
|
|
- list: any[],
|
|
|
|
- signInfo: any
|
|
|
|
- },
|
|
|
|
- account: number, // 我的免费豆
|
|
|
|
- task: { // 任务相关信息
|
|
|
|
- daily: any,
|
|
|
|
- important: any
|
|
|
|
- },
|
|
|
|
- toastInfo: {
|
|
|
|
- title: string,
|
|
|
|
- reward: number,
|
|
|
|
- show: boolean
|
|
|
|
- },
|
|
|
|
- messageShow: boolean,
|
|
|
|
- signShow: boolean,
|
|
|
|
- signType: 'direct' | 'look' | 'lookTask'
|
|
|
|
|
|
+interface Props {
|
|
|
|
+ store: Store;
|
|
}
|
|
}
|
|
|
|
|
|
let _this: any = null
|
|
let _this: any = null
|
|
|
|
|
|
@inject('store')
|
|
@inject('store')
|
|
@observer
|
|
@observer
|
|
-class My extends Component {
|
|
|
|
|
|
+class My extends Component<Props> {
|
|
|
|
|
|
- state: state = {
|
|
|
|
- canIUseGetUserProfile: false,
|
|
|
|
- videoAd: undefined,
|
|
|
|
- isPullVideo: false,
|
|
|
|
- signInfo: {
|
|
|
|
- list: [],
|
|
|
|
- signInfo: {}
|
|
|
|
- },
|
|
|
|
- account: 0,
|
|
|
|
- task: {
|
|
|
|
- daily: {},
|
|
|
|
- important: {}
|
|
|
|
- },
|
|
|
|
- toastInfo: {
|
|
|
|
- title: '',
|
|
|
|
- reward: 0,
|
|
|
|
- show: false
|
|
|
|
- },
|
|
|
|
- messageShow: false,
|
|
|
|
- signShow: false,
|
|
|
|
- signType: 'direct'
|
|
|
|
|
|
+ state = {
|
|
}
|
|
}
|
|
|
|
|
|
componentDidShow() {
|
|
componentDidShow() {
|
|
@@ -112,19 +50,8 @@ class My extends Component {
|
|
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
|
|
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
|
|
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
|
|
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
|
|
/* @ts-ignore */
|
|
/* @ts-ignore */
|
|
- wx.getUserProfile({
|
|
|
|
- desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
|
|
|
- success: res => {
|
|
|
|
- _this.setState({
|
|
|
|
- userInfo: res.userInfo
|
|
|
|
- })
|
|
|
|
- // let { city, country, gender, nickName, province, avatarUrl } = res.userInfo
|
|
|
|
- let { open_id } = getLoginSto()
|
|
|
|
- // pushUserInfo({ openid: open_id, city, country, gender, nickname: nickName, province, avatarUrl }).then(() => {
|
|
|
|
- // _this.getData()
|
|
|
|
- // })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
getData = (type?: string) => {
|
|
getData = (type?: string) => {
|
|
@@ -166,93 +93,96 @@ class My extends Component {
|
|
// })
|
|
// })
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ onChooseAvatar = (e) => {
|
|
|
|
+ const { avatarUrl } = e.detail
|
|
|
|
+ console.log(e.detail)
|
|
|
|
+ }
|
|
render() {
|
|
render() {
|
|
- let { indexStore } = this.props.store
|
|
|
|
|
|
+ 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">
|
|
|
|
+ <Image mode="widthFix" lazy-load src={userInfoStore.userInfo?.avatarUrl ? userInfoStore.userInfo?.avatarUrl : require('../../icon/avatar.jpg')} />
|
|
|
|
+ </View>
|
|
|
|
+ <View className="name" style={userInfoStore.isAuth ? { width: Taro.pxTransform(120) } : {}}>
|
|
|
|
+ {
|
|
|
|
+ userInfoStore.userInfo?.nickName ? <View className="ID">{userInfoStore.userInfo?.nickName || ""}</View> :
|
|
|
|
+ <View className="ID">读友_sdajhsd</View>
|
|
|
|
+ }
|
|
|
|
+ {
|
|
|
|
+ userInfoStore.isVip && <View className="grade">
|
|
|
|
+ <Image lazy-load src={require('../../icon/grade.png')} />
|
|
|
|
+ <Text>V1</Text>
|
|
|
|
+ </View>
|
|
|
|
+ }
|
|
|
|
+ </View>
|
|
|
|
+ </View>
|
|
|
|
+ {
|
|
|
|
+ userInfoStore.isAuth && <View className="right">
|
|
|
|
+ {
|
|
|
|
+ userInfoStore.isAuth ?
|
|
|
|
+ <Button onClick={this.getUserProfile} className="loginBt" >
|
|
|
|
+ <Image lazy-load src={require('../../icon/loaginBt.png')} />
|
|
|
|
+ </Button>
|
|
|
|
+ : <View>
|
|
|
|
+ <Button openType='chooseAvatar' onChooseAvatar={this.onChooseAvatar} className="loginBt">
|
|
|
|
+ <Image lazy-load src={require('../../icon/loaginBt.png')} />
|
|
|
|
+ </Button>
|
|
|
|
+ {/* <Input type="nickname" placeholder="请输入昵称" /> */}
|
|
|
|
+ </View>
|
|
|
|
|
|
- return (
|
|
|
|
- <View className='my'>
|
|
|
|
- <View className="userInfo">
|
|
|
|
- <Image src={require('../../icon/myBack.png')} />
|
|
|
|
- <View className="userInfo_box">
|
|
|
|
- <View className="top" style={indexStore.openType === 1 ? { marginTop: Taro.pxTransform(130) } : {}}>
|
|
|
|
|
|
+ }
|
|
|
|
+ </View>
|
|
|
|
+ }
|
|
|
|
+ </View>
|
|
|
|
+ {/* vip续费 */}
|
|
|
|
+ <View className="bottom">
|
|
|
|
+ <View>
|
|
<View className="left">
|
|
<View className="left">
|
|
- <View className="avtai">
|
|
|
|
- <Image mode="widthFix" lazy-load src={indexStore.userInfo?.avatar_url ? indexStore.userInfo?.avatar_url : require('../../icon/avatar.jpg')} />
|
|
|
|
- </View>
|
|
|
|
- <View className="name" style={indexStore.userInfo?.is_auth === 0 ? { width: Taro.pxTransform(120) } : {}}>
|
|
|
|
- {
|
|
|
|
- indexStore.openType === 1 ? <View className="ID">{indexStore.userInfo?.user_name || ""}</View> :
|
|
|
|
- <View className="ID">读友_sdajhsd</View>
|
|
|
|
- }
|
|
|
|
|
|
+ <Image lazy-load src={require('../../icon/VIP.png')} />
|
|
|
|
+ <View className="txt">
|
|
|
|
+ <Text>会员尊享免费解锁权益</Text>
|
|
{
|
|
{
|
|
- indexStore.userInfo?.is_vip && indexStore.openType !== 1 && <View className="grade">
|
|
|
|
- <Image lazy-load src={require('../../icon/grade.png')} />
|
|
|
|
- <Text>V1</Text>
|
|
|
|
- </View>
|
|
|
|
|
|
+ userInfoStore.isVip && <Text className="tfv">有效期至:{1111}</Text>
|
|
}
|
|
}
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
- {
|
|
|
|
- indexStore.userInfo?.is_auth === 0 && <View className="right">
|
|
|
|
- {
|
|
|
|
- this.state.canIUseGetUserProfile ?
|
|
|
|
- <Button onClick={this.getUserProfile} className="loginBt">
|
|
|
|
- <Image lazy-load src={require('../../icon/loaginBt.png')} />
|
|
|
|
- </Button>
|
|
|
|
- :
|
|
|
|
- <Button openType='getUserInfo' onGetUserInfo={this.handleWXGetUserInfo.bind(this)} className="loginBt">
|
|
|
|
- <Image lazy-load src={require('../../icon/loaginBt.png')} />
|
|
|
|
- </Button>
|
|
|
|
- }
|
|
|
|
- </View>
|
|
|
|
- }
|
|
|
|
|
|
+ <View className="right" onClick={() => { Taro.navigateTo({ url: '/pages/vipCore/index' }) }}>{userInfoStore.isVip ? '立即续费' : '立即开通'}</View>
|
|
</View>
|
|
</View>
|
|
- {/* vip续费 */}
|
|
|
|
- <View className="bottom">
|
|
|
|
- <View>
|
|
|
|
- <View className="left">
|
|
|
|
- <Image lazy-load src={require('../../icon/VIP.png')} />
|
|
|
|
- <View className="txt">
|
|
|
|
- <Text>会员尊享免费解锁权益</Text>
|
|
|
|
- {
|
|
|
|
- indexStore.userInfo?.is_vip && <Text className="tfv">有效期至:{indexStore.userInfo?.member_end_date}</Text>
|
|
|
|
- }
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- <View className="right" onClick={() => { Taro.navigateTo({ url: '/pages/vipCore/index' }) }}>{indexStore.userInfo?.is_vip ? '立即续费' : '立即开通'}</View>
|
|
|
|
|
|
+ <Image lazy-load src={require('../../icon/vipBack.png')} />
|
|
|
|
+ </View>
|
|
|
|
+ {/* 底部功能入口 */}
|
|
|
|
+ <View className="list_bt" >
|
|
|
|
+ <Navigator className="item" url="/pages/my/contactService/index">
|
|
|
|
+ <View className="left">
|
|
|
|
+ <Image lazy-load src={require('../../icon/phone.png')} mode="widthFix" />
|
|
|
|
+ <Text>联系客服</Text>
|
|
</View>
|
|
</View>
|
|
- <Image lazy-load src={require('../../icon/vipBack.png')} />
|
|
|
|
- </View>
|
|
|
|
- {/* 底部功能入口 */}
|
|
|
|
- <View className="list_bt" style={indexStore.openType === 1 ? { marginTop: Taro.pxTransform(100) } : {}}>
|
|
|
|
- <Navigator className="item" url="/pages/contactus/index">
|
|
|
|
- <View className="left">
|
|
|
|
- <Image lazy-load src={require('../../icon/phone.png')} mode="widthFix" />
|
|
|
|
- <Text>联系客服</Text>
|
|
|
|
- </View>
|
|
|
|
- <View className="right">
|
|
|
|
- <Image lazy-load src={require('../../icon/jtRight.png')} mode="widthFix" />
|
|
|
|
- </View>
|
|
|
|
- </Navigator>
|
|
|
|
- <View className="line"></View>
|
|
|
|
- <Navigator className="item" url="/pages/aboutWe/index">
|
|
|
|
- <View className="left">
|
|
|
|
- <Image lazy-load src={require('../../icon/we.png')} mode="widthFix" />
|
|
|
|
- <Text>关于我们</Text>
|
|
|
|
- </View>
|
|
|
|
- <View className="right">
|
|
|
|
- <Image lazy-load src={require('../../icon/jtRight.png')} mode="widthFix" />
|
|
|
|
- </View>
|
|
|
|
- </Navigator>
|
|
|
|
- </View>
|
|
|
|
|
|
+ <View className="right">
|
|
|
|
+ <Image lazy-load src={require('../../icon/jtRight.png')} mode="widthFix" />
|
|
|
|
+ </View>
|
|
|
|
+ </Navigator>
|
|
|
|
+ <View className="line"></View>
|
|
|
|
+ <Navigator className="item" url="/pages/my/aboutUs/index">
|
|
|
|
+ <View className="left">
|
|
|
|
+ <Image lazy-load src={require('../../icon/we.png')} mode="widthFix" />
|
|
|
|
+ <Text>关于我们</Text>
|
|
|
|
+ </View>
|
|
|
|
+ <View className="right">
|
|
|
|
+ <Image lazy-load src={require('../../icon/jtRight.png')} mode="widthFix" />
|
|
|
|
+ </View>
|
|
|
|
+ </Navigator>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
|
|
+ </View>
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
- </View>
|
|
|
|
- )
|
|
|
|
|
|
+ </View>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|