Skip to content
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

fix(rate): 多端适配 #2754

Open
wants to merge 7 commits into
base: V3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
2 changes: 1 addition & 1 deletion src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@
"author": "vickyYe"
},
{
"version": "2.0.0",
"version": "3.0.0",
"name": "Rate",
"type": "component",
"cName": "评分",
Expand Down
51 changes: 27 additions & 24 deletions src/packages/rate/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ import { View, ScrollView } from '@tarojs/components'
import { Cell } from '@nutui/nutui-react-taro'
import Header from '@/sites/components/header'
import { useTranslate } from '@/sites/assets/locale/taro'
// import Demo1 from './demos/taro/demo1'
// import Demo2 from './demos/taro/demo2'
// import Demo3 from './demos/taro/demo3'
// import Demo4 from './demos/taro/demo4'
// import Demo5 from './demos/taro/demo5'
// import Demo6 from './demos/taro/demo6'
// import Demo7 from './demos/taro/demo7'
// import Demo8 from './demos/taro/demo8'
// import Demo9 from './demos/taro/demo9'
// import Demo10 from './demos/taro/demo10'
// import Demo11 from './demos/taro/demo11'
// import Demo12 from './demos/taro/demo12'
import { harmony } from '@/utils/platform-taro'
import Demo1 from './demos/taro/demo1'
import Demo2 from './demos/taro/demo2'
import Demo3 from './demos/taro/demo3'
import Demo4 from './demos/taro/demo4'
import Demo5 from './demos/taro/demo5'
import Demo6 from './demos/taro/demo6'
import Demo7 from './demos/taro/demo7'
import Demo8 from './demos/taro/demo8'
import Demo9 from './demos/taro/demo9'
import Demo10 from './demos/taro/demo10'
import Demo11 from './demos/taro/demo11'
import Demo12 from './demos/taro/demo12'

const RateDemo = () => {
const [translated] = useTranslate({
Expand Down Expand Up @@ -73,10 +74,9 @@ const RateDemo = () => {
<ScrollView className={`demo ${Taro.getEnv() === 'WEB' ? 'web' : ''}`}>
<View className="h2">{translated.basic}</View>
<Cell style={cellStyle}>
TODO:icon 问题需先解决
{/* <Demo1 /> */}
<Demo1 />
</Cell>
{/*

<View className="h2">{translated.control}</View>
<Cell style={cellStyle}>
<Demo2 />
Expand Down Expand Up @@ -121,16 +121,19 @@ const RateDemo = () => {
<Cell style={cellStyle}>
<Demo10 />
</Cell>
{harmony() ? null : (
<>
<View className="h2">{translated.touchable}</View>
<Cell style={cellStyle}>
<Demo11 />
</Cell>

<View className="h2">{translated.touchable}</View>
<Cell style={cellStyle}>
<Demo11 />
</Cell>

<View className="h2">{translated.touchend}</View>
<Cell style={cellStyle}>
<Demo12 />
</Cell> */}
<View className="h2">{translated.touchend}</View>
<Cell style={cellStyle}>
<Demo12 />
</Cell>
</>
)}
</ScrollView>
</>
)
Expand Down
14 changes: 8 additions & 6 deletions src/packages/rate/rate.harmony.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
display: flex;
flex-shrink: 0;
position: relative;
margin-right: 14px;
margin-left: 14px;
}
.nut-rate-item:last-child {
margin-right: 0;
.nut-rate-item:first-child {
margin-left: 0;
}
.nut-rate-item-half {
position: absolute;
Expand All @@ -30,11 +30,13 @@
}
.nut-rate-item-icon {
display: flex;
color: #FF0F23;
cursor: pointer;
}
.nut-rate-item-icon-disabled {
color: #C2C4CC;
.nut-rate-item-icon .nut-icon {
color: #ff0f23;
}
.nut-rate-item-icon-disabled .nut-icon {
color: #c2c4cc;
}
.nut-rate-item-icon.nut-rate-item-icon.nut-rate-item-icon-half {
position: absolute;
Expand Down
15 changes: 10 additions & 5 deletions src/packages/rate/rate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
display: flex;
flex-shrink: 0;
position: relative;
margin-right: $rate-item-margin;
margin-left: $rate-item-margin;

&:last-child {
margin-right: 0;
&:first-child {
margin-left: 0;
}

&-half {
Expand All @@ -39,11 +39,16 @@

&-icon {
display: flex;
color: $rate-icon-color;
cursor: pointer;

.nut-icon {
color: $rate-icon-color;
}

&-disabled {
color: $rate-icon-inactive-color;
.nut-icon {
color: $rate-icon-inactive-color;
}
}

&.nut-rate-item-icon.nut-rate-item-icon-half {
Expand Down
Loading