diff --git a/compiled/alipay/demo/pages/Rate/index.axml b/compiled/alipay/demo/pages/Rate/index.axml
index 7e2720a02..f23b31ab7 100644
--- a/compiled/alipay/demo/pages/Rate/index.axml
+++ b/compiled/alipay/demo/pages/Rate/index.axml
@@ -36,14 +36,23 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+ 无 onChange 函数
+
diff --git a/compiled/alipay/demo/pages/RateCustom/index.axml b/compiled/alipay/demo/pages/RateCustom/index.axml
index 9b9cc0350..d41f4d5f2 100644
--- a/compiled/alipay/demo/pages/RateCustom/index.axml
+++ b/compiled/alipay/demo/pages/RateCustom/index.axml
@@ -1,84 +1,84 @@
-
-
+
+
8px
-
+
16px
-
+
-
-
+
30px
-
40px
-
+
-
-
+
基础
-
渐变
-
+
-
-
-
+
+
-
+
自定义为HeartFill
-
-
-
+
自定义为StarOutline
-
正
-
+
自定义为正
-
A
-
+
自定义为A
-
- {{rate.index}}
+ {{ rate.index }}
-
+
自定义为索引
-
+
diff --git a/compiled/alipay/demo/pages/RateCustom/index.js b/compiled/alipay/demo/pages/RateCustom/index.js
index 82e2e7a7a..f7a80473c 100644
--- a/compiled/alipay/demo/pages/RateCustom/index.js
+++ b/compiled/alipay/demo/pages/RateCustom/index.js
@@ -1,5 +1,5 @@
Page({
- onChange (value) {
- console.log(value);
- },
+ onChange: function (value) {
+ console.log(value);
+ },
});
diff --git a/compiled/alipay/demo/pages/RateCustom/index.json b/compiled/alipay/demo/pages/RateCustom/index.json
index d5aeeb2eb..1970988b9 100644
--- a/compiled/alipay/demo/pages/RateCustom/index.json
+++ b/compiled/alipay/demo/pages/RateCustom/index.json
@@ -1,9 +1,9 @@
{
"defaultTitle": "Rate",
"usingComponents": {
- "rate": "../../../src/Rate/index",
- "icon": "../../../src/Icon/index",
- "container": "../../../src/Container/index"
+ "ant-rate": "../../../src/Rate/index",
+ "ant-icon": "../../../src/Icon/index",
+ "ant-container": "../../../src/Container/index"
},
"allowsBounceVertical": "NO"
}
diff --git a/compiled/alipay/demo/pages/RateCustom/index.less b/compiled/alipay/demo/pages/RateCustom/index.less
index de4b9d1f1..3196acc06 100644
--- a/compiled/alipay/demo/pages/RateCustom/index.less
+++ b/compiled/alipay/demo/pages/RateCustom/index.less
@@ -1,4 +1,4 @@
-@import "../../../src/style/themes/color.less";
+@import '../../../src/style/themes/color.less';
.star {
color: rgb(118, 118, 118);
@@ -6,6 +6,7 @@
.star-active {
color: red;
+
}
.description {
@@ -14,17 +15,25 @@
}
.star-gradient {
- background-image: linear-gradient(to right, rgb(151, 151, 151), rgb(255, 255, 255),);
+ background-image: linear-gradient(
+ to right,
+ rgb(151, 151, 151),
+ rgb(255, 255, 255)
+ );
-webkit-background-clip: text;
+
+
color: transparent;
}
.star-active-gradient {
background-image: linear-gradient(to right, orange, yellow);
-webkit-background-clip: text;
+
+
color: transparent;
}
.character {
font-size: 40px;
-}
\ No newline at end of file
+}
diff --git a/compiled/alipay/src/Rate/index.axml b/compiled/alipay/src/Rate/index.axml
index c28ebcefd..0ddaf37db 100644
--- a/compiled/alipay/src/Rate/index.axml
+++ b/compiled/alipay/src/Rate/index.axml
@@ -22,7 +22,7 @@
name="character"
index="{{ index }}"
isActive="{{ true }}">
-
+
-
+
diff --git a/compiled/alipay/src/Rate/index.json b/compiled/alipay/src/Rate/index.json
index 2bc97e186..090c137c7 100644
--- a/compiled/alipay/src/Rate/index.json
+++ b/compiled/alipay/src/Rate/index.json
@@ -1,6 +1,6 @@
{
- "component": true,
- "usingComponents": {
- "icon": "../Icon/index"
+ "component": true,
+ "usingComponents": {
+ "ant-icon": "../Icon/index"
}
}
diff --git a/compiled/alipay/src/Rate/index.less b/compiled/alipay/src/Rate/index.less
index 44d672941..5f7e3bdcd 100644
--- a/compiled/alipay/src/Rate/index.less
+++ b/compiled/alipay/src/Rate/index.less
@@ -35,4 +35,5 @@
overflow: hidden;
}
}
+
}
diff --git a/compiled/wechat/app.json b/compiled/wechat/app.json
index 0f9612d5a..34c7aeb22 100644
--- a/compiled/wechat/app.json
+++ b/compiled/wechat/app.json
@@ -1,5 +1,6 @@
{
"pages": [
+ "demo/pages/RateCustom/index",
"demo/pages/RadioGroup/index",
"demo/pages/Radio/index",
"demo/pages/Rate/index",
diff --git a/compiled/wechat/demo/pages/Rate/index.wxml b/compiled/wechat/demo/pages/Rate/index.wxml
index 5a8a4c71b..e6c343402 100644
--- a/compiled/wechat/demo/pages/Rate/index.wxml
+++ b/compiled/wechat/demo/pages/Rate/index.wxml
@@ -36,14 +36,23 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+ 无 onChange 函数
+
diff --git a/compiled/wechat/demo/pages/RateCustom/index.js b/compiled/wechat/demo/pages/RateCustom/index.js
new file mode 100644
index 000000000..f7a80473c
--- /dev/null
+++ b/compiled/wechat/demo/pages/RateCustom/index.js
@@ -0,0 +1,5 @@
+Page({
+ onChange: function (value) {
+ console.log(value);
+ },
+});
diff --git a/compiled/wechat/demo/pages/RateCustom/index.json b/compiled/wechat/demo/pages/RateCustom/index.json
new file mode 100644
index 000000000..1970988b9
--- /dev/null
+++ b/compiled/wechat/demo/pages/RateCustom/index.json
@@ -0,0 +1,9 @@
+{
+ "defaultTitle": "Rate",
+ "usingComponents": {
+ "ant-rate": "../../../src/Rate/index",
+ "ant-icon": "../../../src/Icon/index",
+ "ant-container": "../../../src/Container/index"
+ },
+ "allowsBounceVertical": "NO"
+}
diff --git a/compiled/wechat/demo/pages/RateCustom/index.wxml b/compiled/wechat/demo/pages/RateCustom/index.wxml
new file mode 100644
index 000000000..1a54cc1f5
--- /dev/null
+++ b/compiled/wechat/demo/pages/RateCustom/index.wxml
@@ -0,0 +1,37 @@
+
+
+ 8px
+
+
+ 16px
+
+
+
+
+ 30px
+
+
+ 40px
+
+
+
+
+ 基础
+
+
+ 渐变
+
diff --git a/compiled/wechat/demo/pages/RateCustom/index.wxss b/compiled/wechat/demo/pages/RateCustom/index.wxss
new file mode 100644
index 000000000..0007795cc
--- /dev/null
+++ b/compiled/wechat/demo/pages/RateCustom/index.wxss
@@ -0,0 +1,23 @@
+.star {
+ color: #767676;
+}
+.star-active {
+ color: red !important;
+}
+.description {
+ margin: 4px 0 16px 0;
+ color: #333333;
+}
+.star-gradient {
+ background-image: linear-gradient(to right, #979797, #ffffff);
+ -webkit-background-clip: text;
+ color: transparent !important;
+}
+.star-active-gradient {
+ background-image: linear-gradient(to right, orange, yellow);
+ -webkit-background-clip: text;
+ color: transparent !important;
+}
+.character {
+ font-size: 40px;
+}
diff --git a/compiled/wechat/src/Rate/index.json b/compiled/wechat/src/Rate/index.json
index 2bc97e186..090c137c7 100644
--- a/compiled/wechat/src/Rate/index.json
+++ b/compiled/wechat/src/Rate/index.json
@@ -1,6 +1,6 @@
{
- "component": true,
- "usingComponents": {
- "icon": "../Icon/index"
+ "component": true,
+ "usingComponents": {
+ "ant-icon": "../Icon/index"
}
}
diff --git a/compiled/wechat/src/Rate/index.wxml b/compiled/wechat/src/Rate/index.wxml
index 8ac03bc58..1b282fedc 100644
--- a/compiled/wechat/src/Rate/index.wxml
+++ b/compiled/wechat/src/Rate/index.wxml
@@ -18,11 +18,11 @@
-
+
-
+
diff --git a/compiled/wechat/src/Rate/index.wxss b/compiled/wechat/src/Rate/index.wxss
index 5c7d20f26..2f99101e1 100644
--- a/compiled/wechat/src/Rate/index.wxss
+++ b/compiled/wechat/src/Rate/index.wxss
@@ -27,3 +27,6 @@
width: 50%;
overflow: hidden;
}
+.ant-rate .ant-icon {
+ font-size: unset;
+}
diff --git a/config/wechat.json b/config/wechat.json
index 255285927..52804bf7a 100644
--- a/config/wechat.json
+++ b/config/wechat.json
@@ -1,6 +1,7 @@
{
"pages": [
"pages/RadioGroup",
+ "pages/RateCustom",
"pages/Radio",
"pages/Rate",
"pages/ImageUploadControl",
diff --git a/demo/pages/Rate/index.axml.tsx b/demo/pages/Rate/index.axml.tsx
index 75892b7e7..c64b34d73 100644
--- a/demo/pages/Rate/index.axml.tsx
+++ b/demo/pages/Rate/index.axml.tsx
@@ -29,9 +29,18 @@ export default ({ value }: InternalData) => (
-
-
-
+
+
+
+
+
+
+
+
+
+
+ 无 onChange 函数
+
diff --git a/demo/pages/RateCustom/index.axml b/demo/pages/RateCustom/index.axml
deleted file mode 100644
index 9b9cc0350..000000000
--- a/demo/pages/RateCustom/index.axml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
- 8px
-
-
- 16px
-
-
-
-
- 30px
-
-
- 40px
-
-
-
-
- 基础
-
-
- 渐变
-
-
-
-
-
-
- 自定义为HeartFill
-
-
-
-
- 自定义为StarOutline
-
-
- 正
-
- 自定义为正
-
-
- A
-
- 自定义为A
-
-
-
- {{rate.index}}
-
-
- 自定义为索引
-
diff --git a/demo/pages/RateCustom/index.axml.tsx b/demo/pages/RateCustom/index.axml.tsx
new file mode 100644
index 000000000..8d28ba3be
--- /dev/null
+++ b/demo/pages/RateCustom/index.axml.tsx
@@ -0,0 +1,76 @@
+import { InternalData, View } from 'tsxml';
+import AntContainer from '../../../src/Container/index.axml';
+import AntIcon from '../../../src/Icon/index.axml';
+import AntRate from '../../../src/Rate/index.axml';
+
+export default ({ rate }: InternalData) => (
+
+
+
+ 8px
+
+
+ 16px
+
+
+
+
+ 30px
+
+
+ 40px
+
+
+
+
+ 基础
+
+
+ 渐变
+
+
+ {/* #if ALIPAY */}
+
+
+
+
+ 自定义为HeartFill
+
+
+
+
+ 自定义为StarOutline
+
+
+ 正
+
+ 自定义为正
+
+
+ A
+
+ 自定义为A
+
+
+
+ {rate.index}
+
+
+ 自定义为索引
+
+ {/* #endif */}
+
+);
diff --git a/demo/pages/RateCustom/index.json b/demo/pages/RateCustom/index.json
index d5aeeb2eb..1970988b9 100644
--- a/demo/pages/RateCustom/index.json
+++ b/demo/pages/RateCustom/index.json
@@ -1,9 +1,9 @@
{
"defaultTitle": "Rate",
"usingComponents": {
- "rate": "../../../src/Rate/index",
- "icon": "../../../src/Icon/index",
- "container": "../../../src/Container/index"
+ "ant-rate": "../../../src/Rate/index",
+ "ant-icon": "../../../src/Icon/index",
+ "ant-container": "../../../src/Container/index"
},
"allowsBounceVertical": "NO"
}
diff --git a/demo/pages/RateCustom/index.less b/demo/pages/RateCustom/index.less
index de4b9d1f1..b78bc9168 100644
--- a/demo/pages/RateCustom/index.less
+++ b/demo/pages/RateCustom/index.less
@@ -1,11 +1,17 @@
-@import "../../../src/style/themes/color.less";
+@import '../../../src/style/themes/color.less';
.star {
color: rgb(118, 118, 118);
}
.star-active {
+ /// #if ALIPAY
color: red;
+ /// #endif
+
+ /// #if WECHAT
+ color: red !important;
+ /// #endif
}
.description {
@@ -14,17 +20,35 @@
}
.star-gradient {
- background-image: linear-gradient(to right, rgb(151, 151, 151), rgb(255, 255, 255),);
+ background-image: linear-gradient(
+ to right,
+ rgb(151, 151, 151),
+ rgb(255, 255, 255)
+ );
-webkit-background-clip: text;
+
+ /// #if WECHAT
+ color: transparent !important;
+ /// #endif
+
+ /// #if ALIPAY
color: transparent;
+ /// #endif
}
.star-active-gradient {
background-image: linear-gradient(to right, orange, yellow);
-webkit-background-clip: text;
+
+ /// #if WECHAT
+ color: transparent !important;
+ /// #endif
+
+ /// #if ALIPAY
color: transparent;
+ /// #endif
}
.character {
font-size: 40px;
-}
\ No newline at end of file
+}
diff --git a/demo/pages/RateCustom/index.js b/demo/pages/RateCustom/index.ts
similarity index 100%
rename from demo/pages/RateCustom/index.js
rename to demo/pages/RateCustom/index.ts
diff --git a/src/Rate/index.axml.tsx b/src/Rate/index.axml.tsx
index e3ccde556..2fdf351de 100644
--- a/src/Rate/index.axml.tsx
+++ b/src/Rate/index.axml.tsx
@@ -1,5 +1,5 @@
import { View, Slot, TSXMLProps, InternalData } from 'tsxml';
-import Icon from '../Icon/index.axml';
+import AntIcon from '../Icon/index.axml';
import { IRateProps } from './props';
export default (
@@ -40,7 +40,7 @@ export default (
{/* #if ALIPAY */}
{/* #endif */}
-
+
{/* #if ALIPAY */}
{/* #endif */}
@@ -60,7 +60,7 @@ export default (
{/* #if ALIPAY */}
{/* #endif */}
-
+
{/* #if ALIPAY */}
{/* #endif */}
diff --git a/src/Rate/index.json b/src/Rate/index.json
index 2bc97e186..090c137c7 100644
--- a/src/Rate/index.json
+++ b/src/Rate/index.json
@@ -1,6 +1,6 @@
{
- "component": true,
- "usingComponents": {
- "icon": "../Icon/index"
+ "component": true,
+ "usingComponents": {
+ "ant-icon": "../Icon/index"
}
}
diff --git a/src/Rate/index.less b/src/Rate/index.less
index 44d672941..9d3a171d8 100644
--- a/src/Rate/index.less
+++ b/src/Rate/index.less
@@ -35,4 +35,10 @@
overflow: hidden;
}
}
+
+ /// #if WECHAT
+ .ant-icon {
+ font-size: unset;
+ }
+ /// #endif
}