You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB
TypeScript

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<any, any> {
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 (
<Block>
<Navbar titleSlot="更多设置" isBack={true} />
<View className="cell flex aitems sb" style="margin-top:20rpx;">
<View className="label"></View>
<View className="value">{version}</View>
</View>
</Block>
);
}
}