版本更新日志

This commit is contained in:
eric
2022-12-09 13:28:44 +08:00
parent 09750101c6
commit 8212d4df91
4 changed files with 43 additions and 21 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,11 @@
import { View } from "@tarojs/components"; import { RichText, View } from "@tarojs/components";
import react, { useEffect } from "react"; import react, { useEffect } from "react";
import { Collapse, CollapseItem, Toast } from "@antmjs/vantui"; import { Collapse, CollapseItem, Toast } from "@antmjs/vantui";
import "./index.scss"; import "./index.scss";
import { getTable } from "../../../../utils/index";
import moment from "moment";
const Version = () => { const Version = () => {
useEffect(() => { useEffect(() => {
// 设置标题 // 设置标题
definePageConfig({ definePageConfig({
@@ -13,6 +14,23 @@ const Version = () => {
}, []); }, []);
const [values, setValues] = react.useState(["1"]); const [values, setValues] = react.useState(["1"]);
const [versionArr, setversionArr] = react.useState([]);
useEffect(() => {
getTabledata();
});
// 版本跟心日志
const getTabledata = async () => {
let paramsObj = {
tableName: "version",
okFun: (res: any) => {
// console.log("res", res);
setversionArr(res?.data ?? []);
},
};
await getTable({ ...paramsObj });
return [];
};
return ( return (
<View> <View>
<Collapse <Collapse
@@ -21,14 +39,16 @@ const Version = () => {
// onOpen={(e) => Toast.show(`打开${e.detail}`)} // onOpen={(e) => Toast.show(`打开${e.detail}`)}
// onClose={(e) => Toast.show(`关闭${e.detail}`)} // onClose={(e) => Toast.show(`关闭${e.detail}`)}
> >
{[ {versionArr?.reverse()?.map((item: any, index: any) => {
{ title: "2022-12-09", name: "name1", content: "content" },
{ title: "2022-12-08", name: "name2", content: "content" },
{ title: "2022-12-07", name: "name3", content: "content" },
].map((item: any, index: any) => {
return ( return (
<CollapseItem title={item?.title} name={item?.name}> <CollapseItem
{item?.content} title={moment(item?.date).format("YYYY-MM-DD")}
name={item?.name}
>
{/* 富文本 */}
<View onClick={() => {}} className="RichText">
<RichText nodes={item?.content} />
</View>
</CollapseItem> </CollapseItem>
); );
})} })}

View File

@@ -350,7 +350,7 @@ const my = (props: any) => {
<Icon name="wechat" size="16px" className="icon"></Icon> <Icon name="wechat" size="16px" className="icon"></Icon>
{/* <Text>微信客服</Text> */} {/* <Text>微信客服</Text> */}
<Button open-type="contact" className="wecahtBtn"> <Button open-type="contact" className="wecahtBtn">
</Button> </Button>
</View> </View>
@@ -372,7 +372,7 @@ const my = (props: any) => {
/> />
)} )}
{/* <Cell <Cell
icon="friends" icon="friends"
title="关于我们" title="关于我们"
isLink isLink
@@ -382,9 +382,9 @@ const my = (props: any) => {
url: "/pages/my/components/AbountUs/index", url: "/pages/my/components/AbountUs/index",
}); });
}} }}
/> */} />
{/* <Cell <Cell
icon="setting" icon="setting"
title="版本日志" title="版本日志"
isLink isLink
@@ -394,7 +394,7 @@ const my = (props: any) => {
url: "/pages/my/components/Version/index", url: "/pages/my/components/Version/index",
}); });
}} }}
/> */} />
</View> </View>
<Toast id="vanToast-demo2" /> <Toast id="vanToast-demo2" />

View File

@@ -22,6 +22,8 @@ export const getparams = () => {
let $instance: any = getCurrentInstance(); let $instance: any = getCurrentInstance();
return $instance?.router?.params; return $instance?.router?.params;
}; };
// 添加数据 // 添加数据
export const addTable: any = ({ env, tableName, objData, okFun }: Typeint) => { export const addTable: any = ({ env, tableName, objData, okFun }: Typeint) => {
// 数据库环境 // 数据库环境