add pic preview in ticketnote

mgy
Dawn_Ocean 2024-04-08 15:42:02 +08:00
parent ab52ffe7ae
commit 4d6eca0434
1 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import { Component, ReactNode } from 'react';
import { TicketNote, StatusStr } from '@/pages/TicketDetail/TicketNote';
import pt from '@/plain-text';
import { timeFormat } from '@/utils';
import Taro from '@tarojs/taro';
import './NoteCard.scss';
interface NoteCardProps {
@ -38,6 +39,13 @@ export default class NoteCard extends Component<NoteCardProps, {}> {
break;
}
const showPicDetail = (url: string) => {
Taro.previewImage({
current: url,
urls: [url],
});
};
const notePicRenderer = (
<View>
<View className='at-row' style={{ marginLeft: '30rpx' }}>
@ -47,6 +55,7 @@ export default class NoteCard extends Component<NoteCardProps, {}> {
style='width: 160rpx; height: 160rpx;'
src={url}
mode='aspectFit'
onClick={showPicDetail.bind(this, url)}
/>
</View>
))}