add avatar in notecard

main
Dawn_Ocean 2024-03-21 11:08:10 +08:00
parent 7ae5d8758a
commit 3de05c7cfc
4 changed files with 24 additions and 10 deletions

View File

@ -12,7 +12,7 @@
"isConfirmed": false, "isConfirmed": false,
"notes": [ "notes": [
{ {
"avatar": "https://....jpg", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
"id": 21368, "id": 21368,
"op": "宇航员", "op": "宇航员",
"type": 0, "type": 0,
@ -20,7 +20,7 @@
"createdTime": "2024-03-07T19:52:48.523305" "createdTime": "2024-03-07T19:52:48.523305"
}, },
{ {
"avatar": "https://....jpg", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
"id": 21370, "id": 21370,
"op": "宇航员", "op": "宇航员",
"type": 2, "type": 2,
@ -28,7 +28,7 @@
"createdTime": "2024-03-07T19:58:27.838816" "createdTime": "2024-03-07T19:58:27.838816"
}, },
{ {
"avatar": "https://....jpg", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
"id": 21373, "id": 21373,
"op": "宇航员", "op": "宇航员",
"type": 2, "type": 2,
@ -36,7 +36,7 @@
"createdTime": "2024-03-07T20:28:12.070707" "createdTime": "2024-03-07T20:28:12.070707"
}, },
{ {
"avatar": "https://....jpg", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
"id": 21374, "id": 21374,
"op": "宇航员", "op": "宇航员",
"type": 2, "type": 2,

View File

@ -1,4 +1,4 @@
import { View } from '@tarojs/components'; import { Image, View } from '@tarojs/components';
import { Component, ReactNode } from 'react'; import { Component, ReactNode } from 'react';
import { TicketNote, StatusStr } from '@/pages/TicketDetail/TicketNote'; import { TicketNote, StatusStr } from '@/pages/TicketDetail/TicketNote';
import pt from '@/plain-text'; import pt from '@/plain-text';
@ -35,13 +35,25 @@ export default class NoteCard extends Component<NoteCardProps, {}> {
} }
return ( return (
<View style={{ marginTop: '40rpx', marginBottom: '40rpx' }}> <View className='at-row at-row__align--center'>
<View className='at-col at-col-1 at-col--auto'>
<Image
style='width: 70rpx; height: 70rpx; border-radius: 35px;'
src={note.avatar}
mode='aspectFit'
/>
</View>
<View
className='at-col'
style={{ marginTop: '40rpx', marginBottom: '40rpx' }}
>
<View className='at-article__p'>{note.op}</View> <View className='at-article__p'>{note.op}</View>
<View className='at-article__info'> <View className='at-article__info'>
{note.createdTime.format(timeFormat)} {note.createdTime.format(timeFormat)}
</View> </View>
<View className='at-article__h3'>{message}</View> <View className='at-article__h3'>{message}</View>
</View> </View>
</View>
); );
} }
} }

View File

@ -12,6 +12,7 @@ export class TicketInfo {
} }
export class TicketNote { export class TicketNote {
avatar: string;
id: number; id: number;
op: string; op: string;
type: 0 | 1 | 2; type: 0 | 1 | 2;

View File

@ -36,6 +36,7 @@ export function getTicketInfo(that: DetailFramework, id: number) {
const notes: Array<TicketNote> = []; const notes: Array<TicketNote> = [];
data.notes.map((item) => { data.notes.map((item) => {
notes.push({ notes.push({
avatar: item.avatar,
id: item.id, id: item.id,
op: item.op, op: item.op,
type: item.type, type: item.type,