-
Notifications
You must be signed in to change notification settings - Fork 286
feat(progress): 四端适配 #2325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat(progress): 四端适配 #2325
Changes from 13 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1d93dba
feat: progress鸿蒙适配
Miles-hxy f0e859a
feat(progress): 四端适配
Miles-hxy e763291
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy 735f3a3
fix: web h5适配
Miles-hxy a1012fc
Merge branch 'hxy/0603/progress' of https://github.com/jdf2e/nutui-re…
Miles-hxy 5a29946
chore: transfer cell
Miles-hxy 923a916
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy eec8bd9
chore: css端侧区分
Miles-hxy 80d8608
Merge branch 'hxy/0603/progress' of https://github.com/jdf2e/nutui-re…
Miles-hxy 6f6e4b5
chore: delete css
Miles-hxy cb8fb0f
chore: delete useless css
Miles-hxy 9d1f220
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy ce43935
Merge branch 'dev-harmony' into hxy/0603/progress
xiaoyatong a66a1fb
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy 202093c
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy 3759ace
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy 18ec5a2
fix: demos fix
Miles-hxy b855f23
fix: component fix
Miles-hxy 7362d7f
fix: review
Miles-hxy ded0a9a
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy 25cc2e9
fix: delete
Miles-hxy cb29213
fix: delete
Miles-hxy 7bba50d
fix: delete
Miles-hxy 5f91899
fix: re
Miles-hxy ebe4654
Merge branch 'dev-harmony' into hxy/0603/progress
Miles-hxy 7491fb7
chore: 验证、调整demo
Miles-hxy 8a4dd7e
fix: remove
Miles-hxy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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()) | ||
Miles-hxy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ? '#FF0F23' | ||
| : 'var(--nutui-color-primary)' | ||
| } | ||
| background={ | ||
| ['HARMONY', 'RN'].includes(Taro.getEnv()) | ||
| ? '#FFEAE8' | ||
| : 'var(--nutui-brand-1)' | ||
| } | ||
| strokeWidth="15" | ||
| /> | ||
| </Cell> | ||
| ) | ||
| } | ||
| export default Demo2 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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()) && ( | ||
Miles-hxy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <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) }}> | ||
|
||
| <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') | ||
|
|
@@ -35,7 +42,6 @@ const Demo7 = () => { | |
| </Button> | ||
| <Button | ||
| type="primary" | ||
| style={{ margin: 8 }} | ||
| onClick={() => { | ||
| if (value >= 100) { | ||
| setToastMsg('进度已为100%') | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.