版本更新日志

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 { Collapse, CollapseItem, Toast } from "@antmjs/vantui";
import "./index.scss";
import { getTable } from "../../../../utils/index";
import moment from "moment";
const Version = () => {
useEffect(() => {
// 设置标题
definePageConfig({
@@ -13,6 +14,23 @@ const Version = () => {
}, []);
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 (
<View>
<Collapse
@@ -21,14 +39,16 @@ const Version = () => {
// onOpen={(e) => Toast.show(`打开${e.detail}`)}
// onClose={(e) => Toast.show(`关闭${e.detail}`)}
>
{[
{ 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) => {
{versionArr?.reverse()?.map((item: any, index: any) => {
return (
<CollapseItem title={item?.title} name={item?.name}>
{item?.content}
<CollapseItem
title={moment(item?.date).format("YYYY-MM-DD")}
name={item?.name}
>
{/* 富文本 */}
<View onClick={() => {}} className="RichText">
<RichText nodes={item?.content} />
</View>
</CollapseItem>
);
})}

View File

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

View File

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