|
@@ -51,7 +51,7 @@ export default function HistoryItem(props: {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function singleItem(type, url, obj, key) {
|
|
|
|
|
|
|
+ function singleItem(type, url, obj, key,urls=[]) {
|
|
|
return <View
|
|
return <View
|
|
|
onClick={(e) => {
|
|
onClick={(e) => {
|
|
|
if (process.env.TARO_ENV == 'weapp') {
|
|
if (process.env.TARO_ENV == 'weapp') {
|
|
@@ -100,20 +100,32 @@ export default function HistoryItem(props: {
|
|
|
type == 'PIC' && <CoverList imgs={[url]} count={1} />
|
|
type == 'PIC' && <CoverList imgs={[url]} count={1} />
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- type == 'PIC_TEXT' && <Image
|
|
|
|
|
- className="gray_bg"
|
|
|
|
|
- style={{ width: rpxToPx(178), height: rpxToPx(178), marginRight: rpxToPx(7), flexShrink: 0 }}
|
|
|
|
|
- src={url+scale}
|
|
|
|
|
- onClick={(e) => {
|
|
|
|
|
- if (process.env.TARO_ENV == 'weapp') {
|
|
|
|
|
- e.stopPropagation()
|
|
|
|
|
- }
|
|
|
|
|
- Taro.previewImage({
|
|
|
|
|
- current: url,
|
|
|
|
|
- urls: [url]
|
|
|
|
|
- })
|
|
|
|
|
- }}
|
|
|
|
|
- mode="aspectFill" />
|
|
|
|
|
|
|
+ type == 'PIC_TEXT' && <View onClick={(e) => {
|
|
|
|
|
+ if (process.env.TARO_ENV == 'weapp') {
|
|
|
|
|
+ e.stopPropagation()
|
|
|
|
|
+ }
|
|
|
|
|
+ Taro.previewImage({
|
|
|
|
|
+ current: urls[0],
|
|
|
|
|
+ urls: urls
|
|
|
|
|
+ })
|
|
|
|
|
+ }}>
|
|
|
|
|
+ <JournalCover imgs={urls} />
|
|
|
|
|
+ </View>
|
|
|
|
|
+
|
|
|
|
|
+ // <Image
|
|
|
|
|
+ // className="gray_bg"
|
|
|
|
|
+ // style={{ width: rpxToPx(178), height: rpxToPx(178), marginRight: rpxToPx(7), flexShrink: 0 }}
|
|
|
|
|
+ // src={url+scale}
|
|
|
|
|
+ // onClick={(e) => {
|
|
|
|
|
+ // if (process.env.TARO_ENV == 'weapp') {
|
|
|
|
|
+ // e.stopPropagation()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // Taro.previewImage({
|
|
|
|
|
+ // current: url,
|
|
|
|
|
+ // urls: [url]
|
|
|
|
|
+ // })
|
|
|
|
|
+ // }}
|
|
|
|
|
+ // mode="aspectFill" />
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
type == 'PIC_TEXT' && <View style={{
|
|
type == 'PIC_TEXT' && <View style={{
|
|
@@ -197,6 +209,12 @@ export default function HistoryItem(props: {
|
|
|
<View className="history_content" style={{ paddingTop: rpxToPx(0) }}>
|
|
<View className="history_content" style={{ paddingTop: rpxToPx(0) }}>
|
|
|
{
|
|
{
|
|
|
props.mode != 'EAT' && props.mode != 'ACTIVE' && props.data.dataArray.map((content, i) => {
|
|
props.mode != 'EAT' && props.mode != 'ACTIVE' && props.data.dataArray.map((content, i) => {
|
|
|
|
|
+ var urlArray:any = []
|
|
|
|
|
+ if (content.type == 'PIC_TEXT'){
|
|
|
|
|
+ urlArray = content.data[0].urls.map(obj => obj.url);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
return <View style={{ display: 'flex', flexDirection: 'row', marginBottom: rpxToPx(12), flex: 1 }} key={i}>
|
|
return <View style={{ display: 'flex', flexDirection: 'row', marginBottom: rpxToPx(12), flex: 1 }} key={i}>
|
|
|
{
|
|
{
|
|
|
content.type == 'TEXT' && <View style={{
|
|
content.type == 'TEXT' && <View style={{
|
|
@@ -223,20 +241,32 @@ export default function HistoryItem(props: {
|
|
|
content.type == 'PIC' && <CoverList imgs={content.data} count={content.data.length} />
|
|
content.type == 'PIC' && <CoverList imgs={content.data} count={content.data.length} />
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- content.type == 'PIC_TEXT' && <Image
|
|
|
|
|
- className="gray_bg"
|
|
|
|
|
- style={{ width: rpxToPx(178), height: rpxToPx(178), marginRight: rpxToPx(7), flexShrink: 0 }}
|
|
|
|
|
- src={content.data[0].url+scale}
|
|
|
|
|
- onClick={(e) => {
|
|
|
|
|
- if (process.env.TARO_ENV == 'weapp') {
|
|
|
|
|
- e.stopPropagation()
|
|
|
|
|
- }
|
|
|
|
|
- Taro.previewImage({
|
|
|
|
|
- current: content.data[0].url,
|
|
|
|
|
- urls: [content.data[0].url]
|
|
|
|
|
- })
|
|
|
|
|
- }}
|
|
|
|
|
- mode="aspectFill" />
|
|
|
|
|
|
|
+
|
|
|
|
|
+ content.type == 'PIC_TEXT' && <View style={{marginRight: rpxToPx(7)}} onClick={(e) => {
|
|
|
|
|
+ if (process.env.TARO_ENV == 'weapp') {
|
|
|
|
|
+ e.stopPropagation()
|
|
|
|
|
+ }
|
|
|
|
|
+ Taro.previewImage({
|
|
|
|
|
+ current: urlArray[0],
|
|
|
|
|
+ urls: urlArray
|
|
|
|
|
+ })
|
|
|
|
|
+ }}>
|
|
|
|
|
+ <JournalCover imgs={urlArray} />
|
|
|
|
|
+ </View>
|
|
|
|
|
+ // <Image
|
|
|
|
|
+ // className="gray_bg"
|
|
|
|
|
+ // style={{ width: rpxToPx(178), height: rpxToPx(178), marginRight: rpxToPx(7), flexShrink: 0 }}
|
|
|
|
|
+ // src={content.data[0].url+scale}
|
|
|
|
|
+ // onClick={(e) => {
|
|
|
|
|
+ // if (process.env.TARO_ENV == 'weapp') {
|
|
|
|
|
+ // e.stopPropagation()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // Taro.previewImage({
|
|
|
|
|
+ // current: content.data[0].url,
|
|
|
|
|
+ // urls: [content.data[0].url]
|
|
|
|
|
+ // })
|
|
|
|
|
+ // }}
|
|
|
|
|
+ // mode="aspectFill" />
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
content.type == 'PIC_TEXT' && <View style={{
|
|
content.type == 'PIC_TEXT' && <View style={{
|
|
@@ -285,7 +315,8 @@ export default function HistoryItem(props: {
|
|
|
}
|
|
}
|
|
|
break
|
|
break
|
|
|
case 'PIC_TEXT':
|
|
case 'PIC_TEXT':
|
|
|
- return singleItem('PIC_TEXT', content.data[0].url, content.data[0], i)
|
|
|
|
|
|
|
+ const urlArray = content.data[0].urls.map(obj => obj.url);
|
|
|
|
|
+ return singleItem('PIC_TEXT', content.data[0].url, content.data[0], i,urlArray)
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|