|
@@ -1,6 +1,6 @@
|
1
|
1
|
import React from 'react';
|
2
|
2
|
import Taro from '@tarojs/taro';
|
3
|
|
-import { View, Image } from '@tarojs/components';
|
|
3
|
+import { View, Image, RichText } from '@tarojs/components';
|
4
|
4
|
import Page from '@/layouts/index';
|
5
|
5
|
import { getTaNoticeById } from '@/services/tanotice';
|
6
|
6
|
import { getDtStr } from '@/utils/date';
|
|
@@ -15,11 +15,27 @@ export default (props) => {
|
15
|
15
|
const router = Taro.useRouter();
|
16
|
16
|
const { id } = router.params;
|
17
|
17
|
|
|
18
|
+ const onPreview = () => {
|
|
19
|
+ if (!detail?.thumb) return;
|
|
20
|
+
|
|
21
|
+ Taro.previewMedia({
|
|
22
|
+ sources: [
|
|
23
|
+ {
|
|
24
|
+ url: detail.thumb,
|
|
25
|
+ },
|
|
26
|
+ ],
|
|
27
|
+ current: 0,
|
|
28
|
+ })
|
|
29
|
+ }
|
|
30
|
+
|
18
|
31
|
React.useEffect(() => {
|
19
|
32
|
if (id) {
|
20
|
33
|
setLoading(true);
|
21
|
34
|
getTaNoticeById(id).then((res) => {
|
22
|
35
|
setDetail(res);
|
|
36
|
+ Taro.setNavigationBarTitle({
|
|
37
|
+ title: res.title,
|
|
38
|
+ })
|
23
|
39
|
setLoading(false);
|
24
|
40
|
}).catch(er => {
|
25
|
41
|
console.error(er);
|
|
@@ -37,7 +53,8 @@ export default (props) => {
|
37
|
53
|
<View className={style['notice-hd2']}>{dateStr}</View>
|
38
|
54
|
</View>
|
39
|
55
|
<View className={style['notice-bd']}>
|
40
|
|
- <Image></Image>
|
|
56
|
+ <Image src={detail?.thumb} onClick={onPreview}></Image>
|
|
57
|
+ <RichText nodes={detail?.content} />
|
41
|
58
|
</View>
|
42
|
59
|
<View className={style['notice-ft']}>
|
43
|
60
|
|