|
@@ -1,71 +1,30 @@
|
|
|
-import { View, Image, Text, Icon } from '@tarojs/components'
|
|
|
|
|
|
|
+import { View, Text, Icon } from '@tarojs/components'
|
|
|
import './Timeline.scss'
|
|
import './Timeline.scss'
|
|
|
-import { CheckBoxType, TimelineType } from '@/utils/types'
|
|
|
|
|
-import CheckBox from '../basic/CheckBox'
|
|
|
|
|
|
|
+import { TimelineType } from '@/utils/types'
|
|
|
|
|
+import { IconRadio, IconRadioCheck, IconRadioCross } from '../basic/Icons'
|
|
|
|
|
|
|
|
|
|
|
|
|
-export default function Component(props: { items: any[], title?: string, type?: TimelineType }) {
|
|
|
|
|
-
|
|
|
|
|
- /*
|
|
|
|
|
- <View style={{ background: 'red', width: 30, height: 30 }}>
|
|
|
|
|
-
|
|
|
|
|
- <mysvg src='' colors={['gray']} />
|
|
|
|
|
- </View>
|
|
|
|
|
- */
|
|
|
|
|
- function paddingIcon() {
|
|
|
|
|
- return `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g><g><ellipse cx="8" cy="8" rx="7.5" ry="7.5" fill-opacity="0" stroke-opacity="1" stroke="#FFFFFF" fill="none" stroke-width="1"/></g></g></svg>`
|
|
|
|
|
- }
|
|
|
|
|
- function checkIcon(color) {
|
|
|
|
|
- return `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs>
|
|
|
|
|
- <clipPath id="master_svg0_1288_09724"><rect x="2" y="2" width="12" height="12" rx="0"/></clipPath></defs><g><g>
|
|
|
|
|
- <ellipse cx="8" cy="8" rx="8" ry="8" fill="${color}" fill-opacity="0.4000000059604645"/>
|
|
|
|
|
- <ellipse cx="8" cy="8" rx="7.5" ry="7.5" fill-opacity="0" stroke-opacity="1" stroke="${color}" fill="none" stroke-width="1"/></g>
|
|
|
|
|
- <g clip-path="url(#master_svg0_1288_09724)"><g><path d="M12.35355,4.646446C12.5488,4.841709,12.5488,5.15829,12.35355,5.353555C12.35355,5.353555,6.85355,10.85355,6.85355,10.85355C6.65829,11.0488,6.34171,11.0488,6.14645,10.85355C6.14645,10.85355,3.646446,8.35355,3.646446,8.35355C3.4511845,8.158290000000001,3.4511845,7.84171,3.646446,7.64645C3.841709,7.45118,4.15829,7.45118,4.353555,7.64645C4.353555,7.64645,6.5,9.7929,6.5,9.7929C6.5,9.7929,11.64645,4.646446,11.64645,4.646446C11.8417,4.4511845,12.1583,4.4511845,12.35355,4.646446C12.35355,4.646446,12.35355,4.646446,12.35355,4.646446Z" fill-rule="evenodd" fill="${color}" fill-opacity="1"/></g></g></g></svg>`
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- function cancelIcon(color) {
|
|
|
|
|
- return `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs>
|
|
|
|
|
- <clipPath id="master_svg0_1288_09725"><rect x="2" y="2" width="12" height="12" rx="0"/></clipPath></defs><g><g><ellipse cx="8" cy="8" rx="8" ry="8" fill="${color}" fill-opacity="0.4000000059604645"/>
|
|
|
|
|
- <ellipse cx="8" cy="8" rx="7.5" ry="7.5" fill-opacity="0" stroke-opacity="1" stroke="${color}" fill="none" stroke-width="1"/></g><g clip-path="url(#master_svg0_1288_09725)"><g><path d="M4.646446,4.646446C4.841709,4.4511845,5.15829,4.4511845,5.353555,4.646446C5.353555,4.646446,8,7.2928999999999995,8,7.2928999999999995C8,7.2928999999999995,10.64645,4.646446,10.64645,4.646446C10.8417,4.4511845,11.1583,4.4511845,11.35355,4.646446C11.5488,4.841709,11.5488,5.15829,11.35355,5.353555C11.35355,5.353555,8.70711,8,8.70711,8C8.70711,8,11.35355,10.64645,11.35355,10.64645C11.5488,10.8417,11.5488,11.1583,11.35355,11.35355C11.1583,11.5488,10.8417,11.5488,10.64645,11.35355C10.64645,11.35355,8,8.70711,8,8.70711C8,8.70711,5.353555,11.35355,5.353555,11.35355C5.15829,11.5488,4.841709,11.5488,4.646446,11.35355C4.4511845,11.1583,4.4511845,10.8417,4.646446,10.64645C4.646446,10.64645,7.2928999999999995,8,7.2928999999999995,8C7.2928999999999995,8,4.646446,5.353555,4.646446,5.353555C4.4511845,5.15829,4.4511845,4.841709,4.646446,4.646446C4.646446,4.646446,4.646446,4.646446,4.646446,4.646446Z" fill-rule="evenodd" fill="${color}" fill-opacity="1"/></g></g></g></svg>`
|
|
|
|
|
- }
|
|
|
|
|
|
|
+export default function Component(props: { items: any[], title?: string, type?: TimelineType, showLastLine?: boolean }) {
|
|
|
return <View className="timeline">
|
|
return <View className="timeline">
|
|
|
{
|
|
{
|
|
|
props.title && <Text className='timeline_title'>{props.title}</Text>
|
|
props.title && <Text className='timeline_title'>{props.title}</Text>
|
|
|
}
|
|
}
|
|
|
- {/* <MySVG src="../../assets/svg/check.svg"/> */}
|
|
|
|
|
{
|
|
{
|
|
|
props.items.map((item, index) => (
|
|
props.items.map((item, index) => (
|
|
|
<View className='timelineItem'>
|
|
<View className='timelineItem'>
|
|
|
- <View className='timelineContentView'>
|
|
|
|
|
|
|
+ <View className='timelineContentView' style={{ background: global.isDebug ? 'red' : 'transparent' }}>
|
|
|
{
|
|
{
|
|
|
- item.status == 'padding' && <View style={{ width: 16, height: 16 }}>
|
|
|
|
|
-
|
|
|
|
|
- <mysvg src={paddingIcon()} colors={['#ffffff66']} />
|
|
|
|
|
- </View>
|
|
|
|
|
- //<Icon type='circle' size='16' color='#ffffff66' />//<CheckBox type={CheckBoxType.empty} opacity={0.4} />
|
|
|
|
|
|
|
+ item.status == 'padding' && <IconRadio width={16} color={item.color} />
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- item.status == 'done' && <View style={{ width: 16, height: 16 }}>
|
|
|
|
|
-
|
|
|
|
|
- <mysvg src={checkIcon(item.color)} />
|
|
|
|
|
- </View>
|
|
|
|
|
- //<Icon type='success' color={item.color} size='16' />//<CheckBox type={CheckBoxType.check} opacity={0.4} color={item.color}/>
|
|
|
|
|
|
|
+ item.status == 'done' && <IconRadioCheck width={16} color={item.color} />
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- item.status == 'un_done' && <View style={{ width: 16, height: 16 }}>
|
|
|
|
|
-
|
|
|
|
|
- <mysvg src={cancelIcon(item.color)} />
|
|
|
|
|
- </View>
|
|
|
|
|
- //<Icon type='cancel' color={item.color} size='16' />//<CheckBox type={CheckBoxType.cross} opacity={0.4} color={item.color}/>
|
|
|
|
|
|
|
+ item.status == 'un_done' && <IconRadioCross width={16} color={item.color} />
|
|
|
}
|
|
}
|
|
|
<View className='timelineContentDetail'>
|
|
<View className='timelineContentDetail'>
|
|
|
<View className="timeline-time" style={{ color: item.color ? item.color : '#fff' }}>{item.title}</View>
|
|
<View className="timeline-time" style={{ color: item.color ? item.color : '#fff' }}>{item.title}</View>
|
|
|
-
|
|
|
|
|
<View style={{ flex: 1 }} />
|
|
<View style={{ flex: 1 }} />
|
|
|
- {/* {
|
|
|
|
|
- item.date && <View className="timeline-date">{item.date}</View>
|
|
|
|
|
- } */}
|
|
|
|
|
-
|
|
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
|
<View className="timeline-detail">{item.content}
|
|
<View className="timeline-detail">{item.content}
|
|
@@ -74,10 +33,33 @@ export default function Component(props: { items: any[], title?: string, type?:
|
|
|
}
|
|
}
|
|
|
</View>
|
|
</View>
|
|
|
<View className={index !== props.items.length - 1 ? 'timeline_line1 line1_bottom_space' : 'timeline_line1 line1_bottom_zero'} />
|
|
<View className={index !== props.items.length - 1 ? 'timeline_line1 line1_bottom_space' : 'timeline_line1 line1_bottom_zero'} />
|
|
|
- {index !== props.items.length - 1 &&
|
|
|
|
|
- <View className={(props.items[index + 1].status == 'done' && item.status == 'done') ? 'timeline-line' : 'timeline-line'}
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ index !== props.items.length - 1 &&
|
|
|
|
|
+ <View className='timeline-line-bg' style={{ width: 16,background: global.isDebug ? 'red' : 'transparent' }}>
|
|
|
|
|
+ <View className='timeline-line1'
|
|
|
|
|
+ style={{ background: (props.items[index + 1].status == 'done' && item.status == 'done') ? 'linear-gradient(to top, ' + props.items[index + 1].color + ', ' + item.color + ')' : '#ffffff66' }}
|
|
|
|
|
+ />
|
|
|
|
|
+ </View>
|
|
|
|
|
+ }
|
|
|
|
|
+ {
|
|
|
|
|
+ index == props.items.length - 1 && props.showLastLine &&
|
|
|
|
|
+ <View className='timeline-line-bg' style={{ width: 16,background: global.isDebug ? 'red' : 'transparent'}}>
|
|
|
|
|
+ <View className='timeline-line1'
|
|
|
|
|
+ style={{ background: item.color }}
|
|
|
|
|
+ />
|
|
|
|
|
+ </View>
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ {/* {index !== props.items.length - 1 &&
|
|
|
|
|
+ <View className='timeline-line'
|
|
|
style={{ background: (props.items[index + 1].status == 'done' && item.status == 'done') ? 'linear-gradient(to top, ' + props.items[index + 1].color + ', ' + item.color + ')' : '#ffffff66' }}
|
|
style={{ background: (props.items[index + 1].status == 'done' && item.status == 'done') ? 'linear-gradient(to top, ' + props.items[index + 1].color + ', ' + item.color + ')' : '#ffffff66' }}
|
|
|
/>}
|
|
/>}
|
|
|
|
|
+ {
|
|
|
|
|
+ index == props.items.length - 1 && props.showLastLine &&
|
|
|
|
|
+ <View className='timeline-line'
|
|
|
|
|
+ style={{ background: item.color }}
|
|
|
|
|
+ />
|
|
|
|
|
+ } */}
|
|
|
|
|
|
|
|
</View>
|
|
</View>
|
|
|
))
|
|
))
|