import { Component, PropsWithChildren, useEffect, useState } from "react"; import Taro from "@tarojs/taro"; import { Block, View, Text } from "@tarojs/components"; import Navbar from "../../components/navbar/navbar"; import { GetAboutUs } from "../../utils/Interface"; import "./about.less"; export default class About extends Component { constructor(props) { super(props); this.state = { name: "更多设置", version: "", }; } async onLoad() { this.initData(); } componentDidMount() {} componentWillUnmount() {} componentDidShow() {} componentDidHide() {} async initData() { // let res = await GetAboutUs(); // if (res.data.code === 200) { // this.setState({ version: res.data.data.value }); // } const accountInfo = Taro.getAccountInfoSync(); console.log("accountInfo", accountInfo); if (accountInfo?.miniProgram?.version) { this.setState({ version: accountInfo?.miniProgram?.version || "暂无", }); } } render() { let { version } = this.state; return ( 版本管理 {version} ); } }