Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1d93dba
feat: progress鸿蒙适配
Miles-hxy Jun 4, 2024
f0e859a
feat(progress): 四端适配
Miles-hxy Jun 6, 2024
e763291
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy Jun 6, 2024
735f3a3
fix: web h5适配
Miles-hxy Jun 6, 2024
a1012fc
Merge branch 'hxy/0603/progress' of https://github.com/jdf2e/nutui-re…
Miles-hxy Jun 6, 2024
5a29946
chore: transfer cell
Miles-hxy Jun 6, 2024
923a916
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy Jun 6, 2024
eec8bd9
chore: css端侧区分
Miles-hxy Jun 7, 2024
80d8608
Merge branch 'hxy/0603/progress' of https://github.com/jdf2e/nutui-re…
Miles-hxy Jun 7, 2024
6f6e4b5
chore: delete css
Miles-hxy Jun 7, 2024
cb8fb0f
chore: delete useless css
Miles-hxy Jun 7, 2024
9d1f220
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy Jul 15, 2024
ce43935
Merge branch 'dev-harmony' into hxy/0603/progress
xiaoyatong Jul 22, 2024
a66a1fb
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy Jul 22, 2024
202093c
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy Jul 23, 2024
3759ace
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy Jul 23, 2024
18ec5a2
fix: demos fix
Miles-hxy Jul 23, 2024
b855f23
fix: component fix
Miles-hxy Jul 23, 2024
7362d7f
fix: review
Miles-hxy Jul 23, 2024
ded0a9a
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy Jul 23, 2024
25cc2e9
fix: delete
Miles-hxy Jul 23, 2024
cb29213
fix: delete
Miles-hxy Jul 23, 2024
7bba50d
fix: delete
Miles-hxy Jul 23, 2024
5f91899
fix: re
Miles-hxy Jul 23, 2024
ebe4654
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy Aug 12, 2024
7491fb7
chore: 验证、调整demo
Miles-hxy Aug 12, 2024
8a4dd7e
fix: remove
Miles-hxy Aug 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions src/packages/progress/demo.taro.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import Taro from '@tarojs/taro'
import { ScrollView, View } from '@tarojs/components'
import { Cell } from '@nutui/nutui-react-taro'
import { useTranslate } from '@/sites/assets/locale/taro'
import Header from '@/sites/components/header'
import Demo1 from './demos/taro/demo1'
Expand Down Expand Up @@ -52,31 +51,30 @@ const ProgressDemo = () => {
<Header />
<ScrollView className={`demo ${Taro.getEnv() === 'WEB' ? 'web' : ''}`}>
<View className="h2">{translated.basic}</View>
<Cell>
<Demo1 />
</Cell>
<Demo1 />
<View className="h2">{translated.customStyle}</View>
<Cell>
<Demo2 />
</Cell>
<Demo2 />
<View className="h2">{translated.noShowPercentage}</View>
<Cell>
<Demo3 />
</Cell>
<View className="h2">{translated.customContent}</View>
<Cell>
<Demo4 />
</Cell>
<Demo3 />
{!['HARMONY', 'RN'].includes(Taro.getEnv()) && (
<>
<View className="h2">{translated.customContent}</View>
<Demo4 />
</>
)}
<View className="h2">{translated.customSize}</View>
<Demo5 />
<View className="h2">{translated.statusDisplay}</View>
<Demo6 />

<View className="h2">{translated.dynamicChange}</View>
<Demo7 />
<View className="h2">{translated.lazy}</View>
<Cell>
<Demo8 />
</Cell>
{!['HARMONY', 'RN'].includes(Taro.getEnv()) && (
<>
<View className="h2">{translated.lazy}</View>
<Demo8 />
</>
)}
</ScrollView>
</>
)
Expand Down
21 changes: 5 additions & 16 deletions src/packages/progress/demo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import { useTranslate } from '../../sites/assets/locale'
import { Cell } from '@/packages/cell/cell'
import Demo1 from './demos/h5/demo1'
import Demo2 from './demos/h5/demo2'
import Demo3 from './demos/h5/demo3'
Expand Down Expand Up @@ -48,31 +47,21 @@ const ProgressDemo = () => {
<>
<div className="demo">
<h2>{translated.basic}</h2>
<Cell>
<Demo1 />
</Cell>
<Demo1 />
<h2>{translated.customStyle}</h2>
<Cell>
<Demo2 />
</Cell>
<Demo2 />
<h2>{translated.noShowPercentage}</h2>
<Cell>
<Demo3 />
</Cell>
<Demo3 />
<h2>{translated.customContent}</h2>
<Cell>
<Demo4 />
</Cell>
<Demo4 />
<h2>{translated.customSize}</h2>
<Demo5 />
<h2>{translated.statusDisplay}</h2>
<Demo6 />
<h2>{translated.dynamicChange}</h2>
<Demo7 />
<h2>{translated.lazy}</h2>
<Cell align="center">
<Demo8 />
</Cell>
<Demo8 />
</div>
</>
)
Expand Down
8 changes: 6 additions & 2 deletions src/packages/progress/demos/h5/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react'
import { Progress } from '@nutui/nutui-react'
import { Cell, Progress } from '@nutui/nutui-react'

const Demo1 = () => {
return <Progress percent={30} />
return (
<Cell>
<Progress percent={30} />
</Cell>
)
}
export default Demo1
16 changes: 9 additions & 7 deletions src/packages/progress/demos/h5/demo2.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import React from 'react'
import { Progress } from '@nutui/nutui-react'
import { Progress, Cell } from '@nutui/nutui-react'

const Demo2 = () => {
return (
<Progress
percent={30}
color="var(--nutui-color-primary)"
background="var(--nutui-brand-1)"
strokeWidth="15"
/>
<Cell>
<Progress
percent={30}
color="var(--nutui-color-primary)"
background="var(--nutui-brand-1)"
strokeWidth="15"
/>
</Cell>
)
}
export default Demo2
8 changes: 6 additions & 2 deletions src/packages/progress/demos/h5/demo3.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react'
import { Progress } from '@nutui/nutui-react'
import { Cell, Progress } from '@nutui/nutui-react'

const Demo3 = () => {
return <Progress percent={50} showText />
return (
<Cell>
<Progress percent={50} showText />
</Cell>
)
}
export default Demo3
18 changes: 10 additions & 8 deletions src/packages/progress/demos/h5/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import React from 'react'
import { Progress, Image } from '@nutui/nutui-react'
import { Progress, Image, Cell } from '@nutui/nutui-react'

const Demo4 = () => {
return (
<Progress percent={60} showText>
<Image
width="30px"
height="30px"
src="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
/>
</Progress>
<Cell>
<Progress percent={60} showText>
<Image
width="30px"
height="30px"
src="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
/>
</Progress>
</Cell>
)
}
export default Demo4
12 changes: 2 additions & 10 deletions src/packages/progress/demos/h5/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@ const Demo6 = () => {
return (
<>
<Cell>
<Progress
percent={30}
color="linear-gradient(270deg, rgba(18,126,255,1) 0%,rgba(32,147,255,1) 32.815625%,rgba(13,242,204,1) 100%)"
animated
/>
<Progress percent={30} color="blue" animated />
</Cell>
<Cell align="center">
<Progress percent={100} />
<Checked color="green" style={{ margin: '0 5px' }} />
</Cell>
<Cell align="center">
<Progress
percent={100}
color="linear-gradient(90deg, rgba(180,236,81,1) 0%,rgba(66,147,33,1) 100%)"
strokeWidth="15"
/>
<Progress percent={100} color="#AAFF00" strokeWidth="15" />
<Tips color="red" style={{ margin: '0 5px' }} />
</Cell>
</>
Expand Down
8 changes: 6 additions & 2 deletions src/packages/progress/demos/h5/demo8.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react'
import { Progress } from '@nutui/nutui-react'
import { Cell, Progress } from '@nutui/nutui-react'

const Demo8 = () => {
return <Progress percent={30} lazy delay={500} />
return (
<Cell align="center">
<Progress percent={30} lazy delay={500} />
</Cell>
)
}
export default Demo8
8 changes: 6 additions & 2 deletions src/packages/progress/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react'
import { Progress } from '@nutui/nutui-react-taro'
import { Cell, Progress } from '@nutui/nutui-react-taro'

const Demo1 = () => {
return <Progress percent={30} />
return (
<Cell>
<Progress percent={30} />
</Cell>
)
}
export default Demo1
25 changes: 18 additions & 7 deletions src/packages/progress/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import React from 'react'
import { Progress } from '@nutui/nutui-react-taro'
import { Cell, Progress } from '@nutui/nutui-react-taro'
import Taro from '@tarojs/taro'

const Demo2 = () => {
return (
<Progress
percent={30}
color="var(--nutui-color-primary)"
background="var(--nutui-brand-1)"
strokeWidth="15"
/>
<Cell>
<Progress
percent={30}
color={
['HARMONY', 'RN'].includes(Taro.getEnv())
? '#FF0F23'
: 'var(--nutui-color-primary)'
}
background={
['HARMONY', 'RN'].includes(Taro.getEnv())
? '#FFEAE8'
: 'var(--nutui-brand-1)'
}
strokeWidth="15"
/>
</Cell>
)
}
export default Demo2
8 changes: 6 additions & 2 deletions src/packages/progress/demos/taro/demo3.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react'
import { Progress } from '@nutui/nutui-react-taro'
import { Cell, Progress } from '@nutui/nutui-react-taro'

const Demo3 = () => {
return <Progress percent={50} showText />
return (
<Cell>
<Progress percent={50} showText />
</Cell>
)
}
export default Demo3
18 changes: 10 additions & 8 deletions src/packages/progress/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import React from 'react'
import { Progress, Image } from '@nutui/nutui-react-taro'
import { Progress, Image, Cell } from '@nutui/nutui-react-taro'

const Demo4 = () => {
return (
<Progress percent={60} showText>
<Image
width="30px"
height="30px"
src="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
/>
</Progress>
<Cell>
<Progress percent={60} showText>
<Image
width="30px"
height="30px"
src="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
/>
</Progress>
</Cell>
)
}
export default Demo4
21 changes: 9 additions & 12 deletions src/packages/progress/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
import React from 'react'
import { Progress, Cell } from '@nutui/nutui-react-taro'
import Taro from '@tarojs/taro'
import { Checked, Tips } from '@nutui/icons-react-taro'

const Demo6 = () => {
return (
<>
<Cell>
<Progress
percent={30}
color="linear-gradient(270deg, rgba(18,126,255,1) 0%,rgba(32,147,255,1) 32.815625%,rgba(13,242,204,1) 100%)"
animated
/>
<Progress percent={30} color="blue" animated />
</Cell>
<Cell align="center">
<Progress percent={100} />
<Checked color="green" style={{ margin: '0 5px' }} />
{!['HARMONY', 'RN'].includes(Taro.getEnv()) && (
<Checked color="green" style={{ margin: '0 5px' }} />
)}
</Cell>
<Cell align="center">
<Progress
percent={100}
color="linear-gradient(90deg, rgba(180,236,81,1) 0%,rgba(66,147,33,1) 100%)"
strokeWidth="15"
/>
<Tips color="red" style={{ margin: '0 5px' }} />
<Progress percent={100} color="#AAFF00" strokeWidth="15" />
{!['HARMONY', 'RN'].includes(Taro.getEnv()) && (
<Tips color="red" style={{ margin: '0 5px' }} />
)}
</Cell>
</>
)
Expand Down
32 changes: 19 additions & 13 deletions src/packages/progress/demos/taro/demo7.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
import React, { useState } from 'react'
import { Progress, Cell, Button, Toast } from '@nutui/nutui-react-taro'
import { Cell, Button, Toast, Progress } from '@nutui/nutui-react-taro'
import { View, Text } from '@tarojs/components'
import Taro, { pxTransform } from '@tarojs/taro'

const Demo7 = () => {
const [value, setValue] = useState(0)
const [show, setShow] = useState(false)
const [toastMsg, setToastMsg] = useState('')
return (
<Cell.Group>
<Toast
type="text"
visible={show}
content={toastMsg}
onClose={() => {
setShow(false)
}}
/>
{!['HARMONY', 'RN'].includes(Taro.getEnv()) && (
<Toast
type="text"
visible={show}
content={toastMsg}
onClose={() => {
setShow(false)
}}
/>
)}

<Cell align="center">
<Progress percent={value} />
<span style={{ margin: '0 5px' }}>{value}%</span>
<View style={{ width: '90%', marginRight: pxTransform(5) }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥包一层

<Progress percent={value} />
</View>
<Text>{value}%</Text>
</Cell>
<Cell align="center">
<Button
type="default"
style={{ margin: 8 }}
style={{ marginRight: pxTransform(16) }}
onClick={() => {
if (value <= 0) {
setToastMsg('进度已为0')
Expand All @@ -35,7 +42,6 @@ const Demo7 = () => {
</Button>
<Button
type="primary"
style={{ margin: 8 }}
onClick={() => {
if (value >= 100) {
setToastMsg('进度已为100%')
Expand Down
Loading