Yansen 2 年之前
父節點
當前提交
02c91be5da

+ 1
- 2
src/app.config.js 查看文件

@@ -13,8 +13,7 @@ export default defineAppConfig({
13 13
     'pages/apply/verify/index',
14 14
     'pages/apply/detail/index',
15 15
     'pages/message/list/index',
16
-    'pages/index3/index',
17
-    'pages/index4/index',
16
+    'pages/checkStand/index',
18 17
     'pages/reporting/index',
19 18
     'pages/reporting/detail/index',
20 19
     'pages/reset-password/index',

+ 1
- 1
src/layouts/TabBar.jsx 查看文件

@@ -47,7 +47,7 @@ const check = {
47 47
   label: '测评标准',
48 48
   icon: checkIcon,
49 49
   activeIcon: checkActiveIcon,
50
-  page: '/pages/index4/index'
50
+  page: '/pages/checkStand/index'
51 51
 }
52 52
 const mine = {
53 53
   name: 'mine',

+ 3
- 0
src/pages/checkStand/index.config.js 查看文件

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '测评标准'
3
+})

+ 31
- 0
src/pages/checkStand/index.jsx 查看文件

@@ -0,0 +1,31 @@
1
+import React from 'react';
2
+import Taro from '@tarojs/taro';
3
+import Page from '@/layouts/index';
4
+import { View, RichText } from '@tarojs/components';
5
+import { getTaCheckStandById } from '@/services/tacheckstand';
6
+
7
+export default (props) => {
8
+
9
+  const [loading, setLoading] = React.useState(false);
10
+  const [detail, setDetail] = React.useState();
11
+
12
+  React.useEffect(() => {
13
+    setLoading(true);
14
+
15
+    // ID 固定是 1
16
+    getTaCheckStandById(1).then((res) => {
17
+      setDetail(res);
18
+      setLoading(false);
19
+    }).catch(() => {
20
+      setLoading(false);
21
+    });
22
+  }, []);
23
+  
24
+  return (
25
+    <Page tabBar="check" loading={loading}>
26
+      <View style={{ padding: 'var(--main-space)' }}>
27
+        <RichText style={{ lineHeight: '2em' }} nodes={detail?.content} />
28
+      </View>
29
+    </Page>
30
+  )
31
+}

src/pages/index3/index.less → src/pages/checkStand/index.less 查看文件


+ 0
- 3
src/pages/index3/index.config.js 查看文件

@@ -1,3 +0,0 @@
1
-export default definePageConfig({
2
-  navigationBarTitleText: '首页'
3
-})

+ 0
- 24
src/pages/index3/index.jsx 查看文件

@@ -1,24 +0,0 @@
1
-import { Component } from 'react'
2
-import { View, Text } from '@tarojs/components'
3
-import './index.less'
4
-
5
-export default class Index extends Component {
6
-
7
-  componentWillMount () { }
8
-
9
-  componentDidMount () { }
10
-
11
-  componentWillUnmount () { }
12
-
13
-  componentDidShow () { }
14
-
15
-  componentDidHide () { }
16
-
17
-  render () {
18
-    return (
19
-      <View className='index'>
20
-        <Text>Hello world!</Text>
21
-      </View>
22
-    )
23
-  }
24
-}

+ 0
- 3
src/pages/index4/index.config.js 查看文件

@@ -1,3 +0,0 @@
1
-export default definePageConfig({
2
-  navigationBarTitleText: '首页'
3
-})

+ 0
- 24
src/pages/index4/index.jsx 查看文件

@@ -1,24 +0,0 @@
1
-import { Component } from 'react'
2
-import { View, Text } from '@tarojs/components'
3
-import './index.less'
4
-
5
-export default class Index extends Component {
6
-
7
-  componentWillMount () { }
8
-
9
-  componentDidMount () { }
10
-
11
-  componentWillUnmount () { }
12
-
13
-  componentDidShow () { }
14
-
15
-  componentDidHide () { }
16
-
17
-  render () {
18
-    return (
19
-      <View className='index'>
20
-        <Text>Hello world!</Text>
21
-      </View>
22
-    )
23
-  }
24
-}

+ 0
- 0
src/pages/index4/index.less 查看文件


+ 29
- 0
src/services/tacheckstand.js 查看文件

@@ -0,0 +1,29 @@
1
+import request from '@/utils/request';
2
+
3
+/*
4
+ * 分页查询
5
+ */
6
+export const getTaCheckStand = (params) => request('/api/taCheckStand', { params });
7
+
8
+/*
9
+ * 新增数据
10
+ */
11
+export const postTaCheckStand = (data) => request('/api/taCheckStand', { data, method: 'post' });
12
+
13
+/*
14
+ * 通过ID查询单条数据
15
+ */
16
+export const getTaCheckStandById = (id) => request(`/api/taCheckStand/${id}`);
17
+
18
+/**
19
+ * 更新数据
20
+ * @param {*} id
21
+ * @param {*} data
22
+ * @returns
23
+ */
24
+export const putTaCheckStand = (id, data) => request(`/api/taCheckStand/${id}`, { data, method: 'put' });
25
+
26
+/*
27
+ * 通过主键删除数据
28
+ */
29
+export const deleteTaCheckStand = (id) => request(`/api/taCheckStand/${id}`, { method: 'delete' });