|
@@ -21,14 +21,13 @@ import { setScenario } from '@/store/scenario';
|
|
|
|
|
|
|
|
import { setSpecifiedStatus, setSpecifiedState, machine } from '@/store/trackTimeMachine';
|
|
import { setSpecifiedStatus, setSpecifiedState, machine } from '@/store/trackTimeMachine';
|
|
|
import trackTimeService from '@/store/trackTimeMachine';
|
|
import trackTimeService from '@/store/trackTimeMachine';
|
|
|
-import { setWXPubFollow } from '@/store/permission';
|
|
|
|
|
|
|
+import { setWXFollow } from '@/store/permission';
|
|
|
import Tooltip from '@/components/Tooltip'
|
|
import Tooltip from '@/components/Tooltip'
|
|
|
// import TabBar from '../../components/Tabbar';
|
|
// import TabBar from '../../components/Tabbar';
|
|
|
|
|
|
|
|
export default function IndexPage() {
|
|
export default function IndexPage() {
|
|
|
const dispatch = useDispatch();
|
|
const dispatch = useDispatch();
|
|
|
const array: any[] = []
|
|
const array: any[] = []
|
|
|
- const [isFollowed, setIsFollowed] = useState(false)
|
|
|
|
|
const [checkData, setCheckData] = useState(null)
|
|
const [checkData, setCheckData] = useState(null)
|
|
|
const user = useSelector((state: any) => state.user);
|
|
const user = useSelector((state: any) => state.user);
|
|
|
const permission = useSelector((state: any) => state.permission);
|
|
const permission = useSelector((state: any) => state.permission);
|
|
@@ -36,9 +35,6 @@ export default function IndexPage() {
|
|
|
const [counter, setCounter] = useState(0)
|
|
const [counter, setCounter] = useState(0)
|
|
|
const [timerId, setTimerId] = useState(null)
|
|
const [timerId, setTimerId] = useState(null)
|
|
|
const [needShowAddTip, setNeedShowAddTip] = useState(false)
|
|
const [needShowAddTip, setNeedShowAddTip] = useState(false)
|
|
|
- // const moreRef = useRef<any>(null);
|
|
|
|
|
- // global.moreRef = Taro.createRef()
|
|
|
|
|
- array.push('ffff');
|
|
|
|
|
array.push(<Text>ffff</Text>)
|
|
array.push(<Text>ffff</Text>)
|
|
|
// array.push(<Rings radius={50}/>)
|
|
// array.push(<Rings radius={50}/>)
|
|
|
global.dispatch = dispatch;
|
|
global.dispatch = dispatch;
|
|
@@ -84,9 +80,6 @@ export default function IndexPage() {
|
|
|
//更新session key,发送给服务器
|
|
//更新session key,发送给服务器
|
|
|
// dispatch(logoutSuccess());
|
|
// dispatch(logoutSuccess());
|
|
|
// wx.login() //重新登录
|
|
// wx.login() //重新登录
|
|
|
- Taro.login({
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Taro.login().then(res => {
|
|
Taro.login().then(res => {
|
|
@@ -141,6 +134,7 @@ export default function IndexPage() {
|
|
|
|
|
|
|
|
|
|
|
|
|
useReady(async () => {
|
|
useReady(async () => {
|
|
|
|
|
+ // console.log('wwwwwwww')
|
|
|
const userData = await getStorage('userData');
|
|
const userData = await getStorage('userData');
|
|
|
if (userData) {
|
|
if (userData) {
|
|
|
dispatch(getInfoSuccess(JSON.parse(userData as string)) as any);
|
|
dispatch(getInfoSuccess(JSON.parse(userData as string)) as any);
|
|
@@ -244,14 +238,7 @@ export default function IndexPage() {
|
|
|
|
|
|
|
|
function checkWXPubFollow() {
|
|
function checkWXPubFollow() {
|
|
|
wxPubFollow().then(res => {
|
|
wxPubFollow().then(res => {
|
|
|
- setIsFollowed((res as any).wx_pub_followed)
|
|
|
|
|
- // if ((res as any).wx_pub_followed == true) {
|
|
|
|
|
- // // setTimeout(() => {
|
|
|
|
|
- // // dispatch(setWXPubFollow(true));
|
|
|
|
|
- // // }, 1000)
|
|
|
|
|
- // // dispatch(setWXPubFollow(true));
|
|
|
|
|
- // setIsFollowed((res as any).wx_pub_followed)
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ dispatch(setWXFollow((res as any).wx_pub_followed));
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -310,7 +297,7 @@ export default function IndexPage() {
|
|
|
|
|
|
|
|
<More ref={global.moreRef} />
|
|
<More ref={global.moreRef} />
|
|
|
{
|
|
{
|
|
|
- !isFollowed && user.isLogin && <Text style={{ textAlign: 'center', width: '100%' }} onClick={() => followWxPub()}>去关注公众号</Text>
|
|
|
|
|
|
|
+ !permission.wxPubFollow && user.isLogin && <Text style={{ textAlign: 'center', width: '100%' }} onClick={() => followWxPub()}>去关注公众号</Text>
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
user.isLogin && <Text onClick={() => {
|
|
user.isLogin && <Text onClick={() => {
|