/** * 通知信息详情 * @邠心vbe on 2023/08/17 */ import React, { Component } from 'react'; import { View, StyleSheet, ScrollView } from 'react-native'; import apiNotification from '../../api/apiNotification'; import Button, { ElevationObject } from '../../components/Button'; import HeaderTitle from '../../components/HeaderTitle'; import TextView from '../../components/TextView'; import VbeSkeleton from '../../components/VbeSkeleton'; import { PageList } from '../Router'; export default class ViewAlerts extends Component { constructor(props) { super(props); this.state = { id: "", loading: true, messageInfo: { createTime: "", notificationText: "", notificationTitle: "", notificationType: "" } }; } componentDidMount() { if (this.props.route?.params?.id) { this.setState({ id: this.props.route?.params?.id }, () => { this.readMessage(); }) } } readMessage() { apiNotification.readMessage(this.state.id).then(res => { if (res.data) { this.setState({ messageInfo: res.data }, () => { this.setPageTitle(); }); } }).catch(err => { toastShort(err); }); } setPageTitle() { if (this.state.messageInfo.notificationTitle) { this.props.navigation.setOptions({ headerTitle: () => () }); setTimeout(() => { this.setState({ loading: false }); }, 300); } } submitFeedback() { startPage(PageList.feedback); } render() { if (this.state.loading) { return ( ); } return ( {this.state.messageInfo.notificationTitle} {this.state.messageInfo.createTime} {this.state.messageInfo.notificationText} { this.state.messageInfo.notificationType == "Review" &&