From 7a8397e44b8d5a514d1ac0672915231b93dda120 Mon Sep 17 00:00:00 2001 From: HongxuanG <1359774872@qq.com> Date: Fri, 2 Sep 2022 09:03:43 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20build(iconfont):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9Etaro-iconfont-cli=20=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 5 - iconfont.json | 7 +- package.json | 2 +- src/app.config.ts | 3 +- .../{iconfont.wxss => alipay/alipay.acss} | 0 src/components/iconfont/alipay/alipay.axml | 77 ++++++++++++ src/components/iconfont/alipay/alipay.js | 77 ++++++++++++ src/components/iconfont/alipay/alipay.json | 3 + src/components/iconfont/h5/IconDingdan.js | 27 ++++ src/components/iconfont/h5/IconDingdan1.js | 27 ++++ src/components/iconfont/h5/IconDizhi.js | 32 +++++ src/components/iconfont/h5/IconDuizhang.js | 32 +++++ .../iconfont/h5/IconFahuoliebiao.js | 32 +++++ .../iconfont/h5/IconGerenzhongxin.js | 27 ++++ .../iconfont/h5/IconGerenzhongxin1.js | 27 ++++ src/components/iconfont/h5/IconGouwu.js | 27 ++++ src/components/iconfont/h5/IconGouwu1.js | 27 ++++ src/components/iconfont/h5/IconLingquseka.js | 37 ++++++ src/components/iconfont/h5/IconMadanguanli.js | 45 +++++++ .../iconfont/h5/IconPandiansaoma.js | 32 +++++ .../iconfont/h5/IconQianzhicangkucun.js | 32 +++++ src/components/iconfont/h5/IconQusechazhao.js | 32 +++++ .../iconfont/h5/IconShouhouzhongxin.js | 32 +++++ .../iconfont/h5/IconShoukuanliebiao.js | 32 +++++ src/components/iconfont/h5/IconShouye.js | 27 ++++ src/components/iconfont/h5/IconShouye1.js | 27 ++++ .../iconfont/h5/IconTihuoliebiao.js | 32 +++++ src/components/iconfont/h5/IconWodekefu.js | 32 +++++ .../iconfont/h5/IconWodeshoucang.js | 32 +++++ src/components/iconfont/h5/IconXiaoshou.js | 32 +++++ .../iconfont/h5/IconYangpinduibi.js | 32 +++++ src/components/iconfont/h5/IconYansequyang.js | 32 +++++ src/components/iconfont/h5/IconYaoqingma.js | 32 +++++ .../iconfont/h5/IconYuncangkucun.js | 32 +++++ src/components/iconfont/h5/helper.js | 17 +++ src/components/iconfont/h5/index.js | 117 +++++++++++++++++ src/components/iconfont/helper.d.ts | 2 + src/components/iconfont/helper.js | 9 ++ src/components/iconfont/index.alipay.js | 16 +++ src/components/iconfont/index.d.ts | 13 ++ src/components/iconfont/index.h5.js | 17 +++ src/components/iconfont/index.js | 7 ++ src/components/iconfont/index.qq.js | 16 +++ src/components/iconfont/index.rn.js | 17 +++ src/components/iconfont/index.swan.js | 16 +++ src/components/iconfont/index.tt.js | 16 +++ src/components/iconfont/index.weapp.js | 16 +++ src/components/iconfont/qq/qq.js | 31 +++++ .../iconfont/{iconfont.json => qq/qq.json} | 0 src/components/iconfont/qq/qq.qml | 77 ++++++++++++ src/components/iconfont/qq/qq.qss | 3 + src/components/iconfont/rn/IconDingdan.js | 24 ++++ src/components/iconfont/rn/IconDingdan1.js | 24 ++++ src/components/iconfont/rn/IconDizhi.js | 29 +++++ src/components/iconfont/rn/IconDuizhang.js | 29 +++++ .../iconfont/rn/IconFahuoliebiao.js | 29 +++++ .../iconfont/rn/IconGerenzhongxin.js | 24 ++++ .../iconfont/rn/IconGerenzhongxin1.js | 24 ++++ src/components/iconfont/rn/IconGouwu.js | 24 ++++ src/components/iconfont/rn/IconGouwu1.js | 24 ++++ src/components/iconfont/rn/IconLingquseka.js | 34 +++++ src/components/iconfont/rn/IconMadanguanli.js | 42 +++++++ .../iconfont/rn/IconPandiansaoma.js | 29 +++++ .../iconfont/rn/IconQianzhicangkucun.js | 29 +++++ src/components/iconfont/rn/IconQusechazhao.js | 29 +++++ .../iconfont/rn/IconShouhouzhongxin.js | 29 +++++ .../iconfont/rn/IconShoukuanliebiao.js | 29 +++++ src/components/iconfont/rn/IconShouye.js | 24 ++++ src/components/iconfont/rn/IconShouye1.js | 24 ++++ .../iconfont/rn/IconTihuoliebiao.js | 29 +++++ src/components/iconfont/rn/IconWodekefu.js | 29 +++++ .../iconfont/rn/IconWodeshoucang.js | 29 +++++ src/components/iconfont/rn/IconXiaoshou.js | 29 +++++ .../iconfont/rn/IconYangpinduibi.js | 29 +++++ src/components/iconfont/rn/IconYansequyang.js | 29 +++++ src/components/iconfont/rn/IconYaoqingma.js | 29 +++++ .../iconfont/rn/IconYuncangkucun.js | 29 +++++ src/components/iconfont/rn/helper.js | 17 +++ src/components/iconfont/rn/index.js | 119 ++++++++++++++++++ src/components/iconfont/swan/swan.css | 3 + src/components/iconfont/swan/swan.js | 64 ++++++++++ src/components/iconfont/swan/swan.json | 4 + src/components/iconfont/swan/swan.swan | 77 ++++++++++++ src/components/iconfont/tt/tt.js | 64 ++++++++++ src/components/iconfont/tt/tt.json | 3 + src/components/iconfont/tt/tt.ttml | 77 ++++++++++++ src/components/iconfont/tt/tt.ttss | 3 + .../iconfont/{iconfont.js => weapp/weapp.js} | 4 +- src/components/iconfont/weapp/weapp.json | 4 + .../{iconfont.wxml => weapp/weapp.wxml} | 0 src/components/iconfont/weapp/weapp.wxss | 3 + src/pages/user/index.tsx | 6 +- yarn.lock | 59 ++++++++- 93 files changed, 2596 insertions(+), 17 deletions(-) delete mode 100644 app.json rename src/components/iconfont/{iconfont.wxss => alipay/alipay.acss} (100%) create mode 100644 src/components/iconfont/alipay/alipay.axml create mode 100644 src/components/iconfont/alipay/alipay.js create mode 100644 src/components/iconfont/alipay/alipay.json create mode 100644 src/components/iconfont/h5/IconDingdan.js create mode 100644 src/components/iconfont/h5/IconDingdan1.js create mode 100644 src/components/iconfont/h5/IconDizhi.js create mode 100644 src/components/iconfont/h5/IconDuizhang.js create mode 100644 src/components/iconfont/h5/IconFahuoliebiao.js create mode 100644 src/components/iconfont/h5/IconGerenzhongxin.js create mode 100644 src/components/iconfont/h5/IconGerenzhongxin1.js create mode 100644 src/components/iconfont/h5/IconGouwu.js create mode 100644 src/components/iconfont/h5/IconGouwu1.js create mode 100644 src/components/iconfont/h5/IconLingquseka.js create mode 100644 src/components/iconfont/h5/IconMadanguanli.js create mode 100644 src/components/iconfont/h5/IconPandiansaoma.js create mode 100644 src/components/iconfont/h5/IconQianzhicangkucun.js create mode 100644 src/components/iconfont/h5/IconQusechazhao.js create mode 100644 src/components/iconfont/h5/IconShouhouzhongxin.js create mode 100644 src/components/iconfont/h5/IconShoukuanliebiao.js create mode 100644 src/components/iconfont/h5/IconShouye.js create mode 100644 src/components/iconfont/h5/IconShouye1.js create mode 100644 src/components/iconfont/h5/IconTihuoliebiao.js create mode 100644 src/components/iconfont/h5/IconWodekefu.js create mode 100644 src/components/iconfont/h5/IconWodeshoucang.js create mode 100644 src/components/iconfont/h5/IconXiaoshou.js create mode 100644 src/components/iconfont/h5/IconYangpinduibi.js create mode 100644 src/components/iconfont/h5/IconYansequyang.js create mode 100644 src/components/iconfont/h5/IconYaoqingma.js create mode 100644 src/components/iconfont/h5/IconYuncangkucun.js create mode 100644 src/components/iconfont/h5/helper.js create mode 100644 src/components/iconfont/h5/index.js create mode 100644 src/components/iconfont/helper.d.ts create mode 100644 src/components/iconfont/helper.js create mode 100644 src/components/iconfont/index.alipay.js create mode 100644 src/components/iconfont/index.d.ts create mode 100644 src/components/iconfont/index.h5.js create mode 100644 src/components/iconfont/index.js create mode 100644 src/components/iconfont/index.qq.js create mode 100644 src/components/iconfont/index.rn.js create mode 100644 src/components/iconfont/index.swan.js create mode 100644 src/components/iconfont/index.tt.js create mode 100644 src/components/iconfont/index.weapp.js create mode 100644 src/components/iconfont/qq/qq.js rename src/components/iconfont/{iconfont.json => qq/qq.json} (100%) create mode 100644 src/components/iconfont/qq/qq.qml create mode 100644 src/components/iconfont/qq/qq.qss create mode 100644 src/components/iconfont/rn/IconDingdan.js create mode 100644 src/components/iconfont/rn/IconDingdan1.js create mode 100644 src/components/iconfont/rn/IconDizhi.js create mode 100644 src/components/iconfont/rn/IconDuizhang.js create mode 100644 src/components/iconfont/rn/IconFahuoliebiao.js create mode 100644 src/components/iconfont/rn/IconGerenzhongxin.js create mode 100644 src/components/iconfont/rn/IconGerenzhongxin1.js create mode 100644 src/components/iconfont/rn/IconGouwu.js create mode 100644 src/components/iconfont/rn/IconGouwu1.js create mode 100644 src/components/iconfont/rn/IconLingquseka.js create mode 100644 src/components/iconfont/rn/IconMadanguanli.js create mode 100644 src/components/iconfont/rn/IconPandiansaoma.js create mode 100644 src/components/iconfont/rn/IconQianzhicangkucun.js create mode 100644 src/components/iconfont/rn/IconQusechazhao.js create mode 100644 src/components/iconfont/rn/IconShouhouzhongxin.js create mode 100644 src/components/iconfont/rn/IconShoukuanliebiao.js create mode 100644 src/components/iconfont/rn/IconShouye.js create mode 100644 src/components/iconfont/rn/IconShouye1.js create mode 100644 src/components/iconfont/rn/IconTihuoliebiao.js create mode 100644 src/components/iconfont/rn/IconWodekefu.js create mode 100644 src/components/iconfont/rn/IconWodeshoucang.js create mode 100644 src/components/iconfont/rn/IconXiaoshou.js create mode 100644 src/components/iconfont/rn/IconYangpinduibi.js create mode 100644 src/components/iconfont/rn/IconYansequyang.js create mode 100644 src/components/iconfont/rn/IconYaoqingma.js create mode 100644 src/components/iconfont/rn/IconYuncangkucun.js create mode 100644 src/components/iconfont/rn/helper.js create mode 100644 src/components/iconfont/rn/index.js create mode 100644 src/components/iconfont/swan/swan.css create mode 100644 src/components/iconfont/swan/swan.js create mode 100644 src/components/iconfont/swan/swan.json create mode 100644 src/components/iconfont/swan/swan.swan create mode 100644 src/components/iconfont/tt/tt.js create mode 100644 src/components/iconfont/tt/tt.json create mode 100644 src/components/iconfont/tt/tt.ttml create mode 100644 src/components/iconfont/tt/tt.ttss rename src/components/iconfont/{iconfont.js => weapp/weapp.js} (92%) create mode 100644 src/components/iconfont/weapp/weapp.json rename src/components/iconfont/{iconfont.wxml => weapp/weapp.wxml} (100%) create mode 100644 src/components/iconfont/weapp/weapp.wxss diff --git a/app.json b/app.json deleted file mode 100644 index 873c66f..0000000 --- a/app.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "iconfont": "/src/components/iconfont/iconfont" - } -} diff --git a/iconfont.json b/iconfont.json index 489795a..fc9a1c0 100644 --- a/iconfont.json +++ b/iconfont.json @@ -1,7 +1,10 @@ { "symbol_url": "//at.alicdn.com/t/c/font_3619513_mrvpsyqxmzr.js", "save_dir": "./src/components/iconfont", - "use_rpx": false, + "use_typescript": false, + "platforms": "*", + "use_rpx": true, "trim_icon_prefix": "icon", - "default_icon_size": 18 + "default_icon_size": 18, + "design_width": 750 } diff --git a/package.json b/package.json index b9a9717..5464206 100644 --- a/package.json +++ b/package.json @@ -74,9 +74,9 @@ "eslint-plugin-import": "^2.12.0", "eslint-plugin-react": "^7.8.2", "eslint-plugin-react-hooks": "^4.2.0", - "mini-program-iconfont-cli": "^0.6.1", "react-refresh": "0.11.0", "stylelint": "9.3.0", + "taro-iconfont-cli": "^3.3.0", "typescript": "^4.1.0", "webpack": "^5.74.0" } diff --git a/src/app.config.ts b/src/app.config.ts index 32008ba..86146b4 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,3 +1,4 @@ +import { useGlobalIconFont } from './components/iconfont/helper' export default defineAppConfig({ pages: ['pages/user/index', 'pages/index/index', @@ -41,7 +42,7 @@ export default defineAppConfig({ }, usingComponents: { 'custom-wrapper': '/custom-wrapper', - + ...useGlobalIconFont(), }, subPackages: [], }) diff --git a/src/components/iconfont/iconfont.wxss b/src/components/iconfont/alipay/alipay.acss similarity index 100% rename from src/components/iconfont/iconfont.wxss rename to src/components/iconfont/alipay/alipay.acss diff --git a/src/components/iconfont/alipay/alipay.axml b/src/components/iconfont/alipay/alipay.axml new file mode 100644 index 0000000..1e3e325 --- /dev/null +++ b/src/components/iconfont/alipay/alipay.axml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/iconfont/alipay/alipay.js b/src/components/iconfont/alipay/alipay.js new file mode 100644 index 0000000..03d7167 --- /dev/null +++ b/src/components/iconfont/alipay/alipay.js @@ -0,0 +1,77 @@ +Component({ + props: { + // wodekefu | dizhi | shouhouzhongxin | wodeshoucang | shoukuanliebiao | madanguanli | qusechazhao | pandiansaoma | yaoqingma | duizhang | tihuoliebiao | yangpinduibi | yansequyang | fahuoliebiao | yuncangkucun | xiaoshou | qianzhicangkucun | lingquseka | gouwu1 | dingdan1 | gerenzhongxin1 | shouye1 | gerenzhongxin | dingdan | shouye | gouwu + name: null, + // string | string[] + color: '', + size: 18, + }, + data: { + colors: '', + quot: '"', + svgSize: 18, + isStr: true, + }, + didMount() { + const size = this.props.size; + const color = this.props.color; + + this.setData({ + colors: this.fixColor(color), + isStr: typeof color === 'string', + }); + + if (size !== this.data.svgSize) { + this.setData({ + svgSize: size / 750 * my.getSystemInfoSync().windowWidth, + }); + } + }, + disUpdate(prevProps) { + const size = this.props.size; + const color = this.props.color; + + if (color !== prevProps.color) { + this.setData({ + colors: this.fixColor(color), + isStr: typeof color === 'string', + }); + } + + if (size !== prevProps.size) { + this.setData({ + svgSize: size / 750 * my.getSystemInfoSync().windowWidth, + }); + } + }, + methods: { + fixColor: function() { + var color = this.props.color; + var hex2rgb = this.hex2rgb; + + if (typeof color === 'string') { + return color.indexOf('#') === 0 ? hex2rgb(color) : color; + } + + return color.map(function (item) { + return item.indexOf('#') === 0 ? hex2rgb(item) : item; + }); + }, + hex2rgb: function(hex) { + var rgb = []; + + hex = hex.substr(1); + + if (hex.length === 3) { + hex = hex.replace(/(.)/g, '$1$1'); + } + + hex.replace(/../g, function(color) { + rgb.push(parseInt(color, 0x10)); + return color; + }); + + return 'rgb(' + rgb.join(',') + ')'; + } + } +}); diff --git a/src/components/iconfont/alipay/alipay.json b/src/components/iconfont/alipay/alipay.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/components/iconfont/alipay/alipay.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/components/iconfont/h5/IconDingdan.js b/src/components/iconfont/h5/IconDingdan.js new file mode 100644 index 0000000..ed26299 --- /dev/null +++ b/src/components/iconfont/h5/IconDingdan.js @@ -0,0 +1,27 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconDingdan = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + ); +}; + +IconDingdan.defaultProps = { + size: 18, +}; + +export default IconDingdan; diff --git a/src/components/iconfont/h5/IconDingdan1.js b/src/components/iconfont/h5/IconDingdan1.js new file mode 100644 index 0000000..6646be2 --- /dev/null +++ b/src/components/iconfont/h5/IconDingdan1.js @@ -0,0 +1,27 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconDingdan1 = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + ); +}; + +IconDingdan1.defaultProps = { + size: 18, +}; + +export default IconDingdan1; diff --git a/src/components/iconfont/h5/IconDizhi.js b/src/components/iconfont/h5/IconDizhi.js new file mode 100644 index 0000000..d13f9ac --- /dev/null +++ b/src/components/iconfont/h5/IconDizhi.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconDizhi = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconDizhi.defaultProps = { + size: 18, +}; + +export default IconDizhi; diff --git a/src/components/iconfont/h5/IconDuizhang.js b/src/components/iconfont/h5/IconDuizhang.js new file mode 100644 index 0000000..1c054ec --- /dev/null +++ b/src/components/iconfont/h5/IconDuizhang.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconDuizhang = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconDuizhang.defaultProps = { + size: 18, +}; + +export default IconDuizhang; diff --git a/src/components/iconfont/h5/IconFahuoliebiao.js b/src/components/iconfont/h5/IconFahuoliebiao.js new file mode 100644 index 0000000..6186db7 --- /dev/null +++ b/src/components/iconfont/h5/IconFahuoliebiao.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconFahuoliebiao = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconFahuoliebiao.defaultProps = { + size: 18, +}; + +export default IconFahuoliebiao; diff --git a/src/components/iconfont/h5/IconGerenzhongxin.js b/src/components/iconfont/h5/IconGerenzhongxin.js new file mode 100644 index 0000000..0e0396a --- /dev/null +++ b/src/components/iconfont/h5/IconGerenzhongxin.js @@ -0,0 +1,27 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconGerenzhongxin = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + ); +}; + +IconGerenzhongxin.defaultProps = { + size: 18, +}; + +export default IconGerenzhongxin; diff --git a/src/components/iconfont/h5/IconGerenzhongxin1.js b/src/components/iconfont/h5/IconGerenzhongxin1.js new file mode 100644 index 0000000..e2048e9 --- /dev/null +++ b/src/components/iconfont/h5/IconGerenzhongxin1.js @@ -0,0 +1,27 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconGerenzhongxin1 = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + ); +}; + +IconGerenzhongxin1.defaultProps = { + size: 18, +}; + +export default IconGerenzhongxin1; diff --git a/src/components/iconfont/h5/IconGouwu.js b/src/components/iconfont/h5/IconGouwu.js new file mode 100644 index 0000000..acd351f --- /dev/null +++ b/src/components/iconfont/h5/IconGouwu.js @@ -0,0 +1,27 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconGouwu = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + ); +}; + +IconGouwu.defaultProps = { + size: 18, +}; + +export default IconGouwu; diff --git a/src/components/iconfont/h5/IconGouwu1.js b/src/components/iconfont/h5/IconGouwu1.js new file mode 100644 index 0000000..710069f --- /dev/null +++ b/src/components/iconfont/h5/IconGouwu1.js @@ -0,0 +1,27 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconGouwu1 = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + ); +}; + +IconGouwu1.defaultProps = { + size: 18, +}; + +export default IconGouwu1; diff --git a/src/components/iconfont/h5/IconLingquseka.js b/src/components/iconfont/h5/IconLingquseka.js new file mode 100644 index 0000000..a910c42 --- /dev/null +++ b/src/components/iconfont/h5/IconLingquseka.js @@ -0,0 +1,37 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconLingquseka = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + + ); +}; + +IconLingquseka.defaultProps = { + size: 18, +}; + +export default IconLingquseka; diff --git a/src/components/iconfont/h5/IconMadanguanli.js b/src/components/iconfont/h5/IconMadanguanli.js new file mode 100644 index 0000000..03d55ed --- /dev/null +++ b/src/components/iconfont/h5/IconMadanguanli.js @@ -0,0 +1,45 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconMadanguanli = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + + + + ); +}; + +IconMadanguanli.defaultProps = { + size: 18, +}; + +export default IconMadanguanli; diff --git a/src/components/iconfont/h5/IconPandiansaoma.js b/src/components/iconfont/h5/IconPandiansaoma.js new file mode 100644 index 0000000..cedaa00 --- /dev/null +++ b/src/components/iconfont/h5/IconPandiansaoma.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconPandiansaoma = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconPandiansaoma.defaultProps = { + size: 18, +}; + +export default IconPandiansaoma; diff --git a/src/components/iconfont/h5/IconQianzhicangkucun.js b/src/components/iconfont/h5/IconQianzhicangkucun.js new file mode 100644 index 0000000..6f58e2d --- /dev/null +++ b/src/components/iconfont/h5/IconQianzhicangkucun.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconQianzhicangkucun = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconQianzhicangkucun.defaultProps = { + size: 18, +}; + +export default IconQianzhicangkucun; diff --git a/src/components/iconfont/h5/IconQusechazhao.js b/src/components/iconfont/h5/IconQusechazhao.js new file mode 100644 index 0000000..95db3db --- /dev/null +++ b/src/components/iconfont/h5/IconQusechazhao.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconQusechazhao = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconQusechazhao.defaultProps = { + size: 18, +}; + +export default IconQusechazhao; diff --git a/src/components/iconfont/h5/IconShouhouzhongxin.js b/src/components/iconfont/h5/IconShouhouzhongxin.js new file mode 100644 index 0000000..097a48a --- /dev/null +++ b/src/components/iconfont/h5/IconShouhouzhongxin.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconShouhouzhongxin = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconShouhouzhongxin.defaultProps = { + size: 18, +}; + +export default IconShouhouzhongxin; diff --git a/src/components/iconfont/h5/IconShoukuanliebiao.js b/src/components/iconfont/h5/IconShoukuanliebiao.js new file mode 100644 index 0000000..58aee55 --- /dev/null +++ b/src/components/iconfont/h5/IconShoukuanliebiao.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconShoukuanliebiao = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconShoukuanliebiao.defaultProps = { + size: 18, +}; + +export default IconShoukuanliebiao; diff --git a/src/components/iconfont/h5/IconShouye.js b/src/components/iconfont/h5/IconShouye.js new file mode 100644 index 0000000..eab00c2 --- /dev/null +++ b/src/components/iconfont/h5/IconShouye.js @@ -0,0 +1,27 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconShouye = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + ); +}; + +IconShouye.defaultProps = { + size: 18, +}; + +export default IconShouye; diff --git a/src/components/iconfont/h5/IconShouye1.js b/src/components/iconfont/h5/IconShouye1.js new file mode 100644 index 0000000..ccceea2 --- /dev/null +++ b/src/components/iconfont/h5/IconShouye1.js @@ -0,0 +1,27 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconShouye1 = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + ); +}; + +IconShouye1.defaultProps = { + size: 18, +}; + +export default IconShouye1; diff --git a/src/components/iconfont/h5/IconTihuoliebiao.js b/src/components/iconfont/h5/IconTihuoliebiao.js new file mode 100644 index 0000000..e406a31 --- /dev/null +++ b/src/components/iconfont/h5/IconTihuoliebiao.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconTihuoliebiao = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconTihuoliebiao.defaultProps = { + size: 18, +}; + +export default IconTihuoliebiao; diff --git a/src/components/iconfont/h5/IconWodekefu.js b/src/components/iconfont/h5/IconWodekefu.js new file mode 100644 index 0000000..2b23a1f --- /dev/null +++ b/src/components/iconfont/h5/IconWodekefu.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconWodekefu = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconWodekefu.defaultProps = { + size: 18, +}; + +export default IconWodekefu; diff --git a/src/components/iconfont/h5/IconWodeshoucang.js b/src/components/iconfont/h5/IconWodeshoucang.js new file mode 100644 index 0000000..4c13ed5 --- /dev/null +++ b/src/components/iconfont/h5/IconWodeshoucang.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconWodeshoucang = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconWodeshoucang.defaultProps = { + size: 18, +}; + +export default IconWodeshoucang; diff --git a/src/components/iconfont/h5/IconXiaoshou.js b/src/components/iconfont/h5/IconXiaoshou.js new file mode 100644 index 0000000..cdd6508 --- /dev/null +++ b/src/components/iconfont/h5/IconXiaoshou.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconXiaoshou = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconXiaoshou.defaultProps = { + size: 18, +}; + +export default IconXiaoshou; diff --git a/src/components/iconfont/h5/IconYangpinduibi.js b/src/components/iconfont/h5/IconYangpinduibi.js new file mode 100644 index 0000000..6844d9f --- /dev/null +++ b/src/components/iconfont/h5/IconYangpinduibi.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconYangpinduibi = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconYangpinduibi.defaultProps = { + size: 18, +}; + +export default IconYangpinduibi; diff --git a/src/components/iconfont/h5/IconYansequyang.js b/src/components/iconfont/h5/IconYansequyang.js new file mode 100644 index 0000000..4139fe7 --- /dev/null +++ b/src/components/iconfont/h5/IconYansequyang.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconYansequyang = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconYansequyang.defaultProps = { + size: 18, +}; + +export default IconYansequyang; diff --git a/src/components/iconfont/h5/IconYaoqingma.js b/src/components/iconfont/h5/IconYaoqingma.js new file mode 100644 index 0000000..aadc7cf --- /dev/null +++ b/src/components/iconfont/h5/IconYaoqingma.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconYaoqingma = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconYaoqingma.defaultProps = { + size: 18, +}; + +export default IconYaoqingma; diff --git a/src/components/iconfont/h5/IconYuncangkucun.js b/src/components/iconfont/h5/IconYuncangkucun.js new file mode 100644 index 0000000..25db8f7 --- /dev/null +++ b/src/components/iconfont/h5/IconYuncangkucun.js @@ -0,0 +1,32 @@ +/* eslint-disable */ + +import React from 'react'; +import { getIconColor } from './helper'; + +const DEFAULT_STYLE = { + display: 'block', +}; + +const IconYuncangkucun = ({ size, color, style: _style, ...rest }) => { + const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; + + return ( + + + + + ); +}; + +IconYuncangkucun.defaultProps = { + size: 18, +}; + +export default IconYuncangkucun; diff --git a/src/components/iconfont/h5/helper.js b/src/components/iconfont/h5/helper.js new file mode 100644 index 0000000..b566c4c --- /dev/null +++ b/src/components/iconfont/h5/helper.js @@ -0,0 +1,17 @@ +/* eslint-disable */ + +/** + * @param {string | string[] | undefined} color + * @param {number} index + * @param {string} defaultColor + * @return {string} + */ +export const getIconColor = (color, index, defaultColor) => { + return color + ? ( + typeof color === 'string' + ? color + : color[index] || defaultColor + ) + : defaultColor; +}; diff --git a/src/components/iconfont/h5/index.js b/src/components/iconfont/h5/index.js new file mode 100644 index 0000000..e252820 --- /dev/null +++ b/src/components/iconfont/h5/index.js @@ -0,0 +1,117 @@ +/* eslint-disable */ + +import React from 'react'; +import IconWodekefu from './IconWodekefu'; +import IconDizhi from './IconDizhi'; +import IconShouhouzhongxin from './IconShouhouzhongxin'; +import IconWodeshoucang from './IconWodeshoucang'; +import IconShoukuanliebiao from './IconShoukuanliebiao'; +import IconMadanguanli from './IconMadanguanli'; +import IconQusechazhao from './IconQusechazhao'; +import IconPandiansaoma from './IconPandiansaoma'; +import IconYaoqingma from './IconYaoqingma'; +import IconDuizhang from './IconDuizhang'; +import IconTihuoliebiao from './IconTihuoliebiao'; +import IconYangpinduibi from './IconYangpinduibi'; +import IconYansequyang from './IconYansequyang'; +import IconFahuoliebiao from './IconFahuoliebiao'; +import IconYuncangkucun from './IconYuncangkucun'; +import IconXiaoshou from './IconXiaoshou'; +import IconQianzhicangkucun from './IconQianzhicangkucun'; +import IconLingquseka from './IconLingquseka'; +import IconGouwu1 from './IconGouwu1'; +import IconDingdan1 from './IconDingdan1'; +import IconGerenzhongxin1 from './IconGerenzhongxin1'; +import IconShouye1 from './IconShouye1'; +import IconGerenzhongxin from './IconGerenzhongxin'; +import IconDingdan from './IconDingdan'; +import IconShouye from './IconShouye'; +import IconGouwu from './IconGouwu'; +export { default as IconWodekefu } from './IconWodekefu'; +export { default as IconDizhi } from './IconDizhi'; +export { default as IconShouhouzhongxin } from './IconShouhouzhongxin'; +export { default as IconWodeshoucang } from './IconWodeshoucang'; +export { default as IconShoukuanliebiao } from './IconShoukuanliebiao'; +export { default as IconMadanguanli } from './IconMadanguanli'; +export { default as IconQusechazhao } from './IconQusechazhao'; +export { default as IconPandiansaoma } from './IconPandiansaoma'; +export { default as IconYaoqingma } from './IconYaoqingma'; +export { default as IconDuizhang } from './IconDuizhang'; +export { default as IconTihuoliebiao } from './IconTihuoliebiao'; +export { default as IconYangpinduibi } from './IconYangpinduibi'; +export { default as IconYansequyang } from './IconYansequyang'; +export { default as IconFahuoliebiao } from './IconFahuoliebiao'; +export { default as IconYuncangkucun } from './IconYuncangkucun'; +export { default as IconXiaoshou } from './IconXiaoshou'; +export { default as IconQianzhicangkucun } from './IconQianzhicangkucun'; +export { default as IconLingquseka } from './IconLingquseka'; +export { default as IconGouwu1 } from './IconGouwu1'; +export { default as IconDingdan1 } from './IconDingdan1'; +export { default as IconGerenzhongxin1 } from './IconGerenzhongxin1'; +export { default as IconShouye1 } from './IconShouye1'; +export { default as IconGerenzhongxin } from './IconGerenzhongxin'; +export { default as IconDingdan } from './IconDingdan'; +export { default as IconShouye } from './IconShouye'; +export { default as IconGouwu } from './IconGouwu'; + +const IconFont = ({ name, ...rest }) => { + switch (name) { + case 'wodekefu': + return ; + case 'dizhi': + return ; + case 'shouhouzhongxin': + return ; + case 'wodeshoucang': + return ; + case 'shoukuanliebiao': + return ; + case 'madanguanli': + return ; + case 'qusechazhao': + return ; + case 'pandiansaoma': + return ; + case 'yaoqingma': + return ; + case 'duizhang': + return ; + case 'tihuoliebiao': + return ; + case 'yangpinduibi': + return ; + case 'yansequyang': + return ; + case 'fahuoliebiao': + return ; + case 'yuncangkucun': + return ; + case 'xiaoshou': + return ; + case 'qianzhicangkucun': + return ; + case 'lingquseka': + return ; + case 'gouwu1': + return ; + case 'dingdan1': + return ; + case 'gerenzhongxin1': + return ; + case 'shouye1': + return ; + case 'gerenzhongxin': + return ; + case 'dingdan': + return ; + case 'shouye': + return ; + case 'gouwu': + return ; + + } + + return null; +}; + +export default IconFont; diff --git a/src/components/iconfont/helper.d.ts b/src/components/iconfont/helper.d.ts new file mode 100644 index 0000000..24a9a53 --- /dev/null +++ b/src/components/iconfont/helper.d.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export declare var useGlobalIconFont: () => { iconfont: string }; diff --git a/src/components/iconfont/helper.js b/src/components/iconfont/helper.js new file mode 100644 index 0000000..2caa692 --- /dev/null +++ b/src/components/iconfont/helper.js @@ -0,0 +1,9 @@ +/* eslint-disable */ +const useGlobalIconFont = () => { + return { + iconfont: `components/iconfont/${process.env.TARO_ENV}/${process.env.TARO_ENV}`, + }; +}; + +// es modules is unavaiable. +module.exports.useGlobalIconFont = useGlobalIconFont; diff --git a/src/components/iconfont/index.alipay.js b/src/components/iconfont/index.alipay.js new file mode 100644 index 0000000..731305b --- /dev/null +++ b/src/components/iconfont/index.alipay.js @@ -0,0 +1,16 @@ +/* eslint-disable */ + +import React from 'react'; +import Taro from '@tarojs/taro'; + +const IconFont = (props) => { + const { name, size, color, style } = props; + + return ; +}; + +IconFont.defaultProps = { + size: 18, +}; + +export default IconFont; diff --git a/src/components/iconfont/index.d.ts b/src/components/iconfont/index.d.ts new file mode 100644 index 0000000..f128c62 --- /dev/null +++ b/src/components/iconfont/index.d.ts @@ -0,0 +1,13 @@ +/* eslint-disable */ +import React, { FunctionComponent } from 'react'; + +interface Props { + name: 'wodekefu' | 'dizhi' | 'shouhouzhongxin' | 'wodeshoucang' | 'shoukuanliebiao' | 'madanguanli' | 'qusechazhao' | 'pandiansaoma' | 'yaoqingma' | 'duizhang' | 'tihuoliebiao' | 'yangpinduibi' | 'yansequyang' | 'fahuoliebiao' | 'yuncangkucun' | 'xiaoshou' | 'qianzhicangkucun' | 'lingquseka' | 'gouwu1' | 'dingdan1' | 'gerenzhongxin1' | 'shouye1' | 'gerenzhongxin' | 'dingdan' | 'shouye' | 'gouwu'; + size?: number; + color?: string | string[]; + style?: React.CSSProperties; +} + +declare const IconFont: FunctionComponent; + +export default IconFont; diff --git a/src/components/iconfont/index.h5.js b/src/components/iconfont/index.h5.js new file mode 100644 index 0000000..80b208b --- /dev/null +++ b/src/components/iconfont/index.h5.js @@ -0,0 +1,17 @@ +/* eslint-disable */ + +import React from 'react'; +import Taro from '@tarojs/taro'; +import Icon from './h5'; + +const IconFont = (props) => { + const { name, size, color, style } = props; + + return ; +}; + +IconFont.defaultProps = { + size: 18, +}; + +export default IconFont; diff --git a/src/components/iconfont/index.js b/src/components/iconfont/index.js new file mode 100644 index 0000000..9236f4b --- /dev/null +++ b/src/components/iconfont/index.js @@ -0,0 +1,7 @@ +/* eslint-disable */ + +const IconFont = () => { + return null; +}; + +export default IconFont; diff --git a/src/components/iconfont/index.qq.js b/src/components/iconfont/index.qq.js new file mode 100644 index 0000000..731305b --- /dev/null +++ b/src/components/iconfont/index.qq.js @@ -0,0 +1,16 @@ +/* eslint-disable */ + +import React from 'react'; +import Taro from '@tarojs/taro'; + +const IconFont = (props) => { + const { name, size, color, style } = props; + + return ; +}; + +IconFont.defaultProps = { + size: 18, +}; + +export default IconFont; diff --git a/src/components/iconfont/index.rn.js b/src/components/iconfont/index.rn.js new file mode 100644 index 0000000..5375b4a --- /dev/null +++ b/src/components/iconfont/index.rn.js @@ -0,0 +1,17 @@ +/* eslint-disable */ + +import React from 'react'; +import Taro from '@tarojs/taro'; +import Icon from './rn'; + +const IconFont = (props) => { + const { name, size, color, style } = props; + + return ; +}; + +IconFont.defaultProps = { + size: 18, +}; + +export default IconFont; diff --git a/src/components/iconfont/index.swan.js b/src/components/iconfont/index.swan.js new file mode 100644 index 0000000..731305b --- /dev/null +++ b/src/components/iconfont/index.swan.js @@ -0,0 +1,16 @@ +/* eslint-disable */ + +import React from 'react'; +import Taro from '@tarojs/taro'; + +const IconFont = (props) => { + const { name, size, color, style } = props; + + return ; +}; + +IconFont.defaultProps = { + size: 18, +}; + +export default IconFont; diff --git a/src/components/iconfont/index.tt.js b/src/components/iconfont/index.tt.js new file mode 100644 index 0000000..731305b --- /dev/null +++ b/src/components/iconfont/index.tt.js @@ -0,0 +1,16 @@ +/* eslint-disable */ + +import React from 'react'; +import Taro from '@tarojs/taro'; + +const IconFont = (props) => { + const { name, size, color, style } = props; + + return ; +}; + +IconFont.defaultProps = { + size: 18, +}; + +export default IconFont; diff --git a/src/components/iconfont/index.weapp.js b/src/components/iconfont/index.weapp.js new file mode 100644 index 0000000..731305b --- /dev/null +++ b/src/components/iconfont/index.weapp.js @@ -0,0 +1,16 @@ +/* eslint-disable */ + +import React from 'react'; +import Taro from '@tarojs/taro'; + +const IconFont = (props) => { + const { name, size, color, style } = props; + + return ; +}; + +IconFont.defaultProps = { + size: 18, +}; + +export default IconFont; diff --git a/src/components/iconfont/qq/qq.js b/src/components/iconfont/qq/qq.js new file mode 100644 index 0000000..106e505 --- /dev/null +++ b/src/components/iconfont/qq/qq.js @@ -0,0 +1,31 @@ +Component({ + properties: { + // wodekefu | dizhi | shouhouzhongxin | wodeshoucang | shoukuanliebiao | madanguanli | qusechazhao | pandiansaoma | yaoqingma | duizhang | tihuoliebiao | yangpinduibi | yansequyang | fahuoliebiao | yuncangkucun | xiaoshou | qianzhicangkucun | lingquseka | gouwu1 | dingdan1 | gerenzhongxin1 | shouye1 | gerenzhongxin | dingdan | shouye | gouwu + name: { + type: String, + }, + // string | string[] + color: { + type: null, + observer: function(color) { + this.setData({ + isStr: typeof color === 'string', + }); + } + }, + size: { + type: Number, + value: 18, + observer: function(size) { + this.setData({ + svgSize: size / 750 * qq.getSystemInfoSync().windowWidth, + }); + }, + }, + }, + data: { + svgSize: 18 / 750 * qq.getSystemInfoSync().windowWidth, + quot: '"', + isStr: true, + }, +}); diff --git a/src/components/iconfont/iconfont.json b/src/components/iconfont/qq/qq.json similarity index 100% rename from src/components/iconfont/iconfont.json rename to src/components/iconfont/qq/qq.json diff --git a/src/components/iconfont/qq/qq.qml b/src/components/iconfont/qq/qq.qml new file mode 100644 index 0000000..e5ce604 --- /dev/null +++ b/src/components/iconfont/qq/qq.qml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/iconfont/qq/qq.qss b/src/components/iconfont/qq/qq.qss new file mode 100644 index 0000000..9f68d1a --- /dev/null +++ b/src/components/iconfont/qq/qq.qss @@ -0,0 +1,3 @@ +.icon { + background-repeat: no-repeat; +} diff --git a/src/components/iconfont/rn/IconDingdan.js b/src/components/iconfont/rn/IconDingdan.js new file mode 100644 index 0000000..28998fd --- /dev/null +++ b/src/components/iconfont/rn/IconDingdan.js @@ -0,0 +1,24 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconDingdan = ({ size, color, ...rest }) => { + return ( + + + + ); +}; + +IconDingdan.defaultProps = { + size: 18, +}; + +IconDingdan = React.memo ? React.memo(IconDingdan) : IconDingdan; + +export default IconDingdan; diff --git a/src/components/iconfont/rn/IconDingdan1.js b/src/components/iconfont/rn/IconDingdan1.js new file mode 100644 index 0000000..98be064 --- /dev/null +++ b/src/components/iconfont/rn/IconDingdan1.js @@ -0,0 +1,24 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconDingdan1 = ({ size, color, ...rest }) => { + return ( + + + + ); +}; + +IconDingdan1.defaultProps = { + size: 18, +}; + +IconDingdan1 = React.memo ? React.memo(IconDingdan1) : IconDingdan1; + +export default IconDingdan1; diff --git a/src/components/iconfont/rn/IconDizhi.js b/src/components/iconfont/rn/IconDizhi.js new file mode 100644 index 0000000..5f8e1b2 --- /dev/null +++ b/src/components/iconfont/rn/IconDizhi.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconDizhi = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconDizhi.defaultProps = { + size: 18, +}; + +IconDizhi = React.memo ? React.memo(IconDizhi) : IconDizhi; + +export default IconDizhi; diff --git a/src/components/iconfont/rn/IconDuizhang.js b/src/components/iconfont/rn/IconDuizhang.js new file mode 100644 index 0000000..5691cb6 --- /dev/null +++ b/src/components/iconfont/rn/IconDuizhang.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconDuizhang = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconDuizhang.defaultProps = { + size: 18, +}; + +IconDuizhang = React.memo ? React.memo(IconDuizhang) : IconDuizhang; + +export default IconDuizhang; diff --git a/src/components/iconfont/rn/IconFahuoliebiao.js b/src/components/iconfont/rn/IconFahuoliebiao.js new file mode 100644 index 0000000..a72bce1 --- /dev/null +++ b/src/components/iconfont/rn/IconFahuoliebiao.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconFahuoliebiao = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconFahuoliebiao.defaultProps = { + size: 18, +}; + +IconFahuoliebiao = React.memo ? React.memo(IconFahuoliebiao) : IconFahuoliebiao; + +export default IconFahuoliebiao; diff --git a/src/components/iconfont/rn/IconGerenzhongxin.js b/src/components/iconfont/rn/IconGerenzhongxin.js new file mode 100644 index 0000000..f2e1b32 --- /dev/null +++ b/src/components/iconfont/rn/IconGerenzhongxin.js @@ -0,0 +1,24 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconGerenzhongxin = ({ size, color, ...rest }) => { + return ( + + + + ); +}; + +IconGerenzhongxin.defaultProps = { + size: 18, +}; + +IconGerenzhongxin = React.memo ? React.memo(IconGerenzhongxin) : IconGerenzhongxin; + +export default IconGerenzhongxin; diff --git a/src/components/iconfont/rn/IconGerenzhongxin1.js b/src/components/iconfont/rn/IconGerenzhongxin1.js new file mode 100644 index 0000000..8679204 --- /dev/null +++ b/src/components/iconfont/rn/IconGerenzhongxin1.js @@ -0,0 +1,24 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconGerenzhongxin1 = ({ size, color, ...rest }) => { + return ( + + + + ); +}; + +IconGerenzhongxin1.defaultProps = { + size: 18, +}; + +IconGerenzhongxin1 = React.memo ? React.memo(IconGerenzhongxin1) : IconGerenzhongxin1; + +export default IconGerenzhongxin1; diff --git a/src/components/iconfont/rn/IconGouwu.js b/src/components/iconfont/rn/IconGouwu.js new file mode 100644 index 0000000..2eb69f2 --- /dev/null +++ b/src/components/iconfont/rn/IconGouwu.js @@ -0,0 +1,24 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconGouwu = ({ size, color, ...rest }) => { + return ( + + + + ); +}; + +IconGouwu.defaultProps = { + size: 18, +}; + +IconGouwu = React.memo ? React.memo(IconGouwu) : IconGouwu; + +export default IconGouwu; diff --git a/src/components/iconfont/rn/IconGouwu1.js b/src/components/iconfont/rn/IconGouwu1.js new file mode 100644 index 0000000..db0f795 --- /dev/null +++ b/src/components/iconfont/rn/IconGouwu1.js @@ -0,0 +1,24 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconGouwu1 = ({ size, color, ...rest }) => { + return ( + + + + ); +}; + +IconGouwu1.defaultProps = { + size: 18, +}; + +IconGouwu1 = React.memo ? React.memo(IconGouwu1) : IconGouwu1; + +export default IconGouwu1; diff --git a/src/components/iconfont/rn/IconLingquseka.js b/src/components/iconfont/rn/IconLingquseka.js new file mode 100644 index 0000000..268b6eb --- /dev/null +++ b/src/components/iconfont/rn/IconLingquseka.js @@ -0,0 +1,34 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconLingquseka = ({ size, color, ...rest }) => { + return ( + + + + + + ); +}; + +IconLingquseka.defaultProps = { + size: 18, +}; + +IconLingquseka = React.memo ? React.memo(IconLingquseka) : IconLingquseka; + +export default IconLingquseka; diff --git a/src/components/iconfont/rn/IconMadanguanli.js b/src/components/iconfont/rn/IconMadanguanli.js new file mode 100644 index 0000000..c89af2d --- /dev/null +++ b/src/components/iconfont/rn/IconMadanguanli.js @@ -0,0 +1,42 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconMadanguanli = ({ size, color, ...rest }) => { + return ( + + + + + + + + ); +}; + +IconMadanguanli.defaultProps = { + size: 18, +}; + +IconMadanguanli = React.memo ? React.memo(IconMadanguanli) : IconMadanguanli; + +export default IconMadanguanli; diff --git a/src/components/iconfont/rn/IconPandiansaoma.js b/src/components/iconfont/rn/IconPandiansaoma.js new file mode 100644 index 0000000..307b85d --- /dev/null +++ b/src/components/iconfont/rn/IconPandiansaoma.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconPandiansaoma = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconPandiansaoma.defaultProps = { + size: 18, +}; + +IconPandiansaoma = React.memo ? React.memo(IconPandiansaoma) : IconPandiansaoma; + +export default IconPandiansaoma; diff --git a/src/components/iconfont/rn/IconQianzhicangkucun.js b/src/components/iconfont/rn/IconQianzhicangkucun.js new file mode 100644 index 0000000..658ea97 --- /dev/null +++ b/src/components/iconfont/rn/IconQianzhicangkucun.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconQianzhicangkucun = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconQianzhicangkucun.defaultProps = { + size: 18, +}; + +IconQianzhicangkucun = React.memo ? React.memo(IconQianzhicangkucun) : IconQianzhicangkucun; + +export default IconQianzhicangkucun; diff --git a/src/components/iconfont/rn/IconQusechazhao.js b/src/components/iconfont/rn/IconQusechazhao.js new file mode 100644 index 0000000..0d0bd23 --- /dev/null +++ b/src/components/iconfont/rn/IconQusechazhao.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconQusechazhao = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconQusechazhao.defaultProps = { + size: 18, +}; + +IconQusechazhao = React.memo ? React.memo(IconQusechazhao) : IconQusechazhao; + +export default IconQusechazhao; diff --git a/src/components/iconfont/rn/IconShouhouzhongxin.js b/src/components/iconfont/rn/IconShouhouzhongxin.js new file mode 100644 index 0000000..49e8f23 --- /dev/null +++ b/src/components/iconfont/rn/IconShouhouzhongxin.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconShouhouzhongxin = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconShouhouzhongxin.defaultProps = { + size: 18, +}; + +IconShouhouzhongxin = React.memo ? React.memo(IconShouhouzhongxin) : IconShouhouzhongxin; + +export default IconShouhouzhongxin; diff --git a/src/components/iconfont/rn/IconShoukuanliebiao.js b/src/components/iconfont/rn/IconShoukuanliebiao.js new file mode 100644 index 0000000..52dbda4 --- /dev/null +++ b/src/components/iconfont/rn/IconShoukuanliebiao.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconShoukuanliebiao = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconShoukuanliebiao.defaultProps = { + size: 18, +}; + +IconShoukuanliebiao = React.memo ? React.memo(IconShoukuanliebiao) : IconShoukuanliebiao; + +export default IconShoukuanliebiao; diff --git a/src/components/iconfont/rn/IconShouye.js b/src/components/iconfont/rn/IconShouye.js new file mode 100644 index 0000000..18c0ee1 --- /dev/null +++ b/src/components/iconfont/rn/IconShouye.js @@ -0,0 +1,24 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconShouye = ({ size, color, ...rest }) => { + return ( + + + + ); +}; + +IconShouye.defaultProps = { + size: 18, +}; + +IconShouye = React.memo ? React.memo(IconShouye) : IconShouye; + +export default IconShouye; diff --git a/src/components/iconfont/rn/IconShouye1.js b/src/components/iconfont/rn/IconShouye1.js new file mode 100644 index 0000000..019fe55 --- /dev/null +++ b/src/components/iconfont/rn/IconShouye1.js @@ -0,0 +1,24 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconShouye1 = ({ size, color, ...rest }) => { + return ( + + + + ); +}; + +IconShouye1.defaultProps = { + size: 18, +}; + +IconShouye1 = React.memo ? React.memo(IconShouye1) : IconShouye1; + +export default IconShouye1; diff --git a/src/components/iconfont/rn/IconTihuoliebiao.js b/src/components/iconfont/rn/IconTihuoliebiao.js new file mode 100644 index 0000000..9dda212 --- /dev/null +++ b/src/components/iconfont/rn/IconTihuoliebiao.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconTihuoliebiao = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconTihuoliebiao.defaultProps = { + size: 18, +}; + +IconTihuoliebiao = React.memo ? React.memo(IconTihuoliebiao) : IconTihuoliebiao; + +export default IconTihuoliebiao; diff --git a/src/components/iconfont/rn/IconWodekefu.js b/src/components/iconfont/rn/IconWodekefu.js new file mode 100644 index 0000000..af01d12 --- /dev/null +++ b/src/components/iconfont/rn/IconWodekefu.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconWodekefu = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconWodekefu.defaultProps = { + size: 18, +}; + +IconWodekefu = React.memo ? React.memo(IconWodekefu) : IconWodekefu; + +export default IconWodekefu; diff --git a/src/components/iconfont/rn/IconWodeshoucang.js b/src/components/iconfont/rn/IconWodeshoucang.js new file mode 100644 index 0000000..71492c6 --- /dev/null +++ b/src/components/iconfont/rn/IconWodeshoucang.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconWodeshoucang = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconWodeshoucang.defaultProps = { + size: 18, +}; + +IconWodeshoucang = React.memo ? React.memo(IconWodeshoucang) : IconWodeshoucang; + +export default IconWodeshoucang; diff --git a/src/components/iconfont/rn/IconXiaoshou.js b/src/components/iconfont/rn/IconXiaoshou.js new file mode 100644 index 0000000..677d6ec --- /dev/null +++ b/src/components/iconfont/rn/IconXiaoshou.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconXiaoshou = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconXiaoshou.defaultProps = { + size: 18, +}; + +IconXiaoshou = React.memo ? React.memo(IconXiaoshou) : IconXiaoshou; + +export default IconXiaoshou; diff --git a/src/components/iconfont/rn/IconYangpinduibi.js b/src/components/iconfont/rn/IconYangpinduibi.js new file mode 100644 index 0000000..24019a2 --- /dev/null +++ b/src/components/iconfont/rn/IconYangpinduibi.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconYangpinduibi = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconYangpinduibi.defaultProps = { + size: 18, +}; + +IconYangpinduibi = React.memo ? React.memo(IconYangpinduibi) : IconYangpinduibi; + +export default IconYangpinduibi; diff --git a/src/components/iconfont/rn/IconYansequyang.js b/src/components/iconfont/rn/IconYansequyang.js new file mode 100644 index 0000000..f18a5f3 --- /dev/null +++ b/src/components/iconfont/rn/IconYansequyang.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconYansequyang = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconYansequyang.defaultProps = { + size: 18, +}; + +IconYansequyang = React.memo ? React.memo(IconYansequyang) : IconYansequyang; + +export default IconYansequyang; diff --git a/src/components/iconfont/rn/IconYaoqingma.js b/src/components/iconfont/rn/IconYaoqingma.js new file mode 100644 index 0000000..afcc8c9 --- /dev/null +++ b/src/components/iconfont/rn/IconYaoqingma.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconYaoqingma = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconYaoqingma.defaultProps = { + size: 18, +}; + +IconYaoqingma = React.memo ? React.memo(IconYaoqingma) : IconYaoqingma; + +export default IconYaoqingma; diff --git a/src/components/iconfont/rn/IconYuncangkucun.js b/src/components/iconfont/rn/IconYuncangkucun.js new file mode 100644 index 0000000..429f875 --- /dev/null +++ b/src/components/iconfont/rn/IconYuncangkucun.js @@ -0,0 +1,29 @@ +/* eslint-disable */ + +import React from 'react'; +import { Svg, Path } from 'react-native-svg'; +import { getIconColor } from './helper'; + +let IconYuncangkucun = ({ size, color, ...rest }) => { + return ( + + + + + ); +}; + +IconYuncangkucun.defaultProps = { + size: 18, +}; + +IconYuncangkucun = React.memo ? React.memo(IconYuncangkucun) : IconYuncangkucun; + +export default IconYuncangkucun; diff --git a/src/components/iconfont/rn/helper.js b/src/components/iconfont/rn/helper.js new file mode 100644 index 0000000..b566c4c --- /dev/null +++ b/src/components/iconfont/rn/helper.js @@ -0,0 +1,17 @@ +/* eslint-disable */ + +/** + * @param {string | string[] | undefined} color + * @param {number} index + * @param {string} defaultColor + * @return {string} + */ +export const getIconColor = (color, index, defaultColor) => { + return color + ? ( + typeof color === 'string' + ? color + : color[index] || defaultColor + ) + : defaultColor; +}; diff --git a/src/components/iconfont/rn/index.js b/src/components/iconfont/rn/index.js new file mode 100644 index 0000000..cde4094 --- /dev/null +++ b/src/components/iconfont/rn/index.js @@ -0,0 +1,119 @@ +/* eslint-disable */ + +import React from 'react'; + +import IconWodekefu from './IconWodekefu'; +import IconDizhi from './IconDizhi'; +import IconShouhouzhongxin from './IconShouhouzhongxin'; +import IconWodeshoucang from './IconWodeshoucang'; +import IconShoukuanliebiao from './IconShoukuanliebiao'; +import IconMadanguanli from './IconMadanguanli'; +import IconQusechazhao from './IconQusechazhao'; +import IconPandiansaoma from './IconPandiansaoma'; +import IconYaoqingma from './IconYaoqingma'; +import IconDuizhang from './IconDuizhang'; +import IconTihuoliebiao from './IconTihuoliebiao'; +import IconYangpinduibi from './IconYangpinduibi'; +import IconYansequyang from './IconYansequyang'; +import IconFahuoliebiao from './IconFahuoliebiao'; +import IconYuncangkucun from './IconYuncangkucun'; +import IconXiaoshou from './IconXiaoshou'; +import IconQianzhicangkucun from './IconQianzhicangkucun'; +import IconLingquseka from './IconLingquseka'; +import IconGouwu1 from './IconGouwu1'; +import IconDingdan1 from './IconDingdan1'; +import IconGerenzhongxin1 from './IconGerenzhongxin1'; +import IconShouye1 from './IconShouye1'; +import IconGerenzhongxin from './IconGerenzhongxin'; +import IconDingdan from './IconDingdan'; +import IconShouye from './IconShouye'; +import IconGouwu from './IconGouwu'; +export { default as IconWodekefu } from './IconWodekefu'; +export { default as IconDizhi } from './IconDizhi'; +export { default as IconShouhouzhongxin } from './IconShouhouzhongxin'; +export { default as IconWodeshoucang } from './IconWodeshoucang'; +export { default as IconShoukuanliebiao } from './IconShoukuanliebiao'; +export { default as IconMadanguanli } from './IconMadanguanli'; +export { default as IconQusechazhao } from './IconQusechazhao'; +export { default as IconPandiansaoma } from './IconPandiansaoma'; +export { default as IconYaoqingma } from './IconYaoqingma'; +export { default as IconDuizhang } from './IconDuizhang'; +export { default as IconTihuoliebiao } from './IconTihuoliebiao'; +export { default as IconYangpinduibi } from './IconYangpinduibi'; +export { default as IconYansequyang } from './IconYansequyang'; +export { default as IconFahuoliebiao } from './IconFahuoliebiao'; +export { default as IconYuncangkucun } from './IconYuncangkucun'; +export { default as IconXiaoshou } from './IconXiaoshou'; +export { default as IconQianzhicangkucun } from './IconQianzhicangkucun'; +export { default as IconLingquseka } from './IconLingquseka'; +export { default as IconGouwu1 } from './IconGouwu1'; +export { default as IconDingdan1 } from './IconDingdan1'; +export { default as IconGerenzhongxin1 } from './IconGerenzhongxin1'; +export { default as IconShouye1 } from './IconShouye1'; +export { default as IconGerenzhongxin } from './IconGerenzhongxin'; +export { default as IconDingdan } from './IconDingdan'; +export { default as IconShouye } from './IconShouye'; +export { default as IconGouwu } from './IconGouwu'; + +let IconFont = ({ name, ...rest }) => { + switch (name) { + case 'wodekefu': + return ; + case 'dizhi': + return ; + case 'shouhouzhongxin': + return ; + case 'wodeshoucang': + return ; + case 'shoukuanliebiao': + return ; + case 'madanguanli': + return ; + case 'qusechazhao': + return ; + case 'pandiansaoma': + return ; + case 'yaoqingma': + return ; + case 'duizhang': + return ; + case 'tihuoliebiao': + return ; + case 'yangpinduibi': + return ; + case 'yansequyang': + return ; + case 'fahuoliebiao': + return ; + case 'yuncangkucun': + return ; + case 'xiaoshou': + return ; + case 'qianzhicangkucun': + return ; + case 'lingquseka': + return ; + case 'gouwu1': + return ; + case 'dingdan1': + return ; + case 'gerenzhongxin1': + return ; + case 'shouye1': + return ; + case 'gerenzhongxin': + return ; + case 'dingdan': + return ; + case 'shouye': + return ; + case 'gouwu': + return ; + } + + return null; +}; + +IconFont = React.memo ? React.memo(IconFont) : IconFont; + +export default IconFont; diff --git a/src/components/iconfont/swan/swan.css b/src/components/iconfont/swan/swan.css new file mode 100644 index 0000000..9f68d1a --- /dev/null +++ b/src/components/iconfont/swan/swan.css @@ -0,0 +1,3 @@ +.icon { + background-repeat: no-repeat; +} diff --git a/src/components/iconfont/swan/swan.js b/src/components/iconfont/swan/swan.js new file mode 100644 index 0000000..a4ef6af --- /dev/null +++ b/src/components/iconfont/swan/swan.js @@ -0,0 +1,64 @@ +Component({ + properties: { + // wodekefu | dizhi | shouhouzhongxin | wodeshoucang | shoukuanliebiao | madanguanli | qusechazhao | pandiansaoma | yaoqingma | duizhang | tihuoliebiao | yangpinduibi | yansequyang | fahuoliebiao | yuncangkucun | xiaoshou | qianzhicangkucun | lingquseka | gouwu1 | dingdan1 | gerenzhongxin1 | shouye1 | gerenzhongxin | dingdan | shouye | gouwu + name: { + type: String, + }, + // string | string[] + color: { + type: null, + value: '', + observer: function(color) { + this.setData({ + colors: this.fixColor(color), + isStr: typeof color === 'string', + }); + } + }, + size: { + type: Number, + value: 18, + observer: function(size) { + this.setData({ + svgSize: size / 750 * swan.getSystemInfoSync().windowWidth, + }); + }, + }, + }, + data: { + colors: '', + svgSize: 18 / 750 * swan.getSystemInfoSync().windowWidth, + quot: '"', + isStr: true, + }, + methods: { + fixColor: function() { + var color = this.data.color; + var hex2rgb = this.hex2rgb; + + if (typeof color === 'string') { + return color.indexOf('#') === 0 ? hex2rgb(color) : color; + } + + return color.map(function (item) { + return item.indexOf('#') === 0 ? hex2rgb(item) : item; + }); + }, + hex2rgb: function(hex) { + var rgb = []; + + hex = hex.substr(1); + + if (hex.length === 3) { + hex = hex.replace(/(.)/g, '$1$1'); + } + + hex.replace(/../g, function(color) { + rgb.push(parseInt(color, 0x10)); + return color; + }); + + return 'rgb(' + rgb.join(',') + ')'; + } + } +}); diff --git a/src/components/iconfont/swan/swan.json b/src/components/iconfont/swan/swan.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/components/iconfont/swan/swan.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/iconfont/swan/swan.swan b/src/components/iconfont/swan/swan.swan new file mode 100644 index 0000000..03cd6df --- /dev/null +++ b/src/components/iconfont/swan/swan.swan @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/iconfont/tt/tt.js b/src/components/iconfont/tt/tt.js new file mode 100644 index 0000000..0c7dfb1 --- /dev/null +++ b/src/components/iconfont/tt/tt.js @@ -0,0 +1,64 @@ +Component({ + properties: { + // wodekefu | dizhi | shouhouzhongxin | wodeshoucang | shoukuanliebiao | madanguanli | qusechazhao | pandiansaoma | yaoqingma | duizhang | tihuoliebiao | yangpinduibi | yansequyang | fahuoliebiao | yuncangkucun | xiaoshou | qianzhicangkucun | lingquseka | gouwu1 | dingdan1 | gerenzhongxin1 | shouye1 | gerenzhongxin | dingdan | shouye | gouwu + name: { + type: String, + }, + // string | string[] + color: { + type: null, + value: '', + observer: function(color) { + this.setData({ + colors: this.fixColor(), + isStr: typeof color === 'string', + }); + } + }, + size: { + type: Number, + value: 18, + observer: function(size) { + this.setData({ + svgSize: size / 750 * tt.getSystemInfoSync().windowWidth, + }); + }, + }, + }, + data: { + colors: '', + svgSize: 18 / 750 * tt.getSystemInfoSync().windowWidth, + quot: '"', + isStr: true, + }, + methods: { + fixColor: function() { + var color = this.data.color; + var hex2rgb = this.hex2rgb; + + if (typeof color === 'string') { + return color.indexOf('#') === 0 ? hex2rgb(color) : color; + } + + return color.map(function (item) { + return item.indexOf('#') === 0 ? hex2rgb(item) : item; + }); + }, + hex2rgb: function(hex) { + var rgb = []; + + hex = hex.substr(1); + + if (hex.length === 3) { + hex = hex.replace(/(.)/g, '$1$1'); + } + + hex.replace(/../g, function(color) { + rgb.push(parseInt(color, 0x10)); + return color; + }); + + return 'rgb(' + rgb.join(',') + ')'; + } + } +}); diff --git a/src/components/iconfont/tt/tt.json b/src/components/iconfont/tt/tt.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/components/iconfont/tt/tt.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/components/iconfont/tt/tt.ttml b/src/components/iconfont/tt/tt.ttml new file mode 100644 index 0000000..03e4c24 --- /dev/null +++ b/src/components/iconfont/tt/tt.ttml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/iconfont/tt/tt.ttss b/src/components/iconfont/tt/tt.ttss new file mode 100644 index 0000000..9f68d1a --- /dev/null +++ b/src/components/iconfont/tt/tt.ttss @@ -0,0 +1,3 @@ +.icon { + background-repeat: no-repeat; +} diff --git a/src/components/iconfont/iconfont.js b/src/components/iconfont/weapp/weapp.js similarity index 92% rename from src/components/iconfont/iconfont.js rename to src/components/iconfont/weapp/weapp.js index 1b0dc5a..89c17f5 100644 --- a/src/components/iconfont/iconfont.js +++ b/src/components/iconfont/weapp/weapp.js @@ -19,14 +19,14 @@ Component({ value: 18, observer: function(size) { this.setData({ - svgSize: size, + svgSize: size / 750 * wx.getSystemInfoSync().windowWidth, }); }, }, }, data: { colors: '', - svgSize: 18, + svgSize: 18 / 750 * wx.getSystemInfoSync().windowWidth, quot: '"', isStr: true, }, diff --git a/src/components/iconfont/weapp/weapp.json b/src/components/iconfont/weapp/weapp.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/components/iconfont/weapp/weapp.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/iconfont/iconfont.wxml b/src/components/iconfont/weapp/weapp.wxml similarity index 100% rename from src/components/iconfont/iconfont.wxml rename to src/components/iconfont/weapp/weapp.wxml diff --git a/src/components/iconfont/weapp/weapp.wxss b/src/components/iconfont/weapp/weapp.wxss new file mode 100644 index 0000000..9f68d1a --- /dev/null +++ b/src/components/iconfont/weapp/weapp.wxss @@ -0,0 +1,3 @@ +.icon { + background-repeat: no-repeat; +} diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index e24a9aa..6c8c64a 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -1,6 +1,7 @@ import { isEmptyObject } from '@/common/common' import { Button, View } from '@tarojs/components' import { FC, memo, useState } from 'react' +import IconFont from '../components/iconfont' import styles from './index.module.scss' const SonComp: FC = memo(() => { return 我改变了吗{new Date().getTime()} @@ -25,10 +26,11 @@ const User = () => { return ( <> - - sdfasdfasdf {count} + + sdfasdfasdf {count} + ) diff --git a/yarn.lock b/yarn.lock index 7ef2562..174e4d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4948,7 +4948,7 @@ colorette@^2.0.10: resolved "https://registry.npmmirror.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== -colors@^1.3.3: +colors@^1.3.3, colors@^1.4.0: version "1.4.0" resolved "https://registry.npmmirror.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== @@ -7525,6 +7525,16 @@ human-signals@^2.1.0: resolved "https://registry.npmmirror.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +iconfont-parser@^1.0.0: + version "1.0.0" + resolved "https://registry.npmmirror.com/iconfont-parser/-/iconfont-parser-1.0.0.tgz#1fa61be02677005a9a014653ef2eeb7503c3538a" + integrity sha512-3RJceYHEjaqYyeDdfSAb1vP1x1Eb7ZtC9Xwetj+axm85sBlJU7HMvdNLVpwm/3g5eghYOdkQK+epUITZGAIqKQ== + dependencies: + axios "^0.19.0" + colors "^1.4.0" + tslib "^1.10.0" + xml2js "^0.4.22" + iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -9047,7 +9057,7 @@ mini-css-extract-plugin@2.4.6: dependencies: schema-utils "^4.0.0" -mini-program-iconfont-cli@^0.6.1: +mini-program-iconfont-cli@0.6.1: version "0.6.1" resolved "https://registry.npmmirror.com/mini-program-iconfont-cli/-/mini-program-iconfont-cli-0.6.1.tgz#61d08cf05bf5a51c82a75c4afcf77224e20ed06c" integrity sha512-69FsU+tSevwmHBiL55535Hfh1q0ciRpNyYtiTBZw2bvw9lvW3N/SCTg395P0rkisWMqf1Ki9VYIWeaONvNWy2Q== @@ -10648,6 +10658,19 @@ react-dom@^18.2.0: loose-envify "^1.1.0" scheduler "^0.23.0" +react-iconfont-cli@2.0.2: + version "2.0.2" + resolved "https://registry.npmmirror.com/react-iconfont-cli/-/react-iconfont-cli-2.0.2.tgz#547d872e5d76796230877176e397bc6ed3337467" + integrity sha512-43NP+dsk08XwJf8oXfrDwHk1WeE76vy1Xzbd2zz7WjjxsdblF9h/oalFMPclZSibIirwsckz3L0IV+42Yu//iQ== + dependencies: + colors "^1.3.3" + glob "^7.1.4" + iconfont-parser "^1.0.0" + lodash "^4.17.15" + minimist "^1.2.5" + mkdirp "^0.5.1" + tslib "^1.10.0" + react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" resolved "https://registry.npmmirror.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -10658,6 +10681,19 @@ react-is@^18.0.0: resolved "https://registry.npmmirror.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== +react-native-iconfont-cli@2.2.4: + version "2.2.4" + resolved "https://registry.npmmirror.com/react-native-iconfont-cli/-/react-native-iconfont-cli-2.2.4.tgz#9bc3b18653105950646f8e5f5fcde9f8835d76f3" + integrity sha512-qTjfHG2f/sc3/YKWZJvIJk/SwiTu8C9/SvtoLxRX+GM/6pvOJq0ge6rcV3vTh4s3QJDuNDOD6+a4hGD6vv2vSg== + dependencies: + colors "^1.3.3" + glob "^7.1.4" + iconfont-parser "^1.0.0" + lodash "^4.17.15" + minimist "^1.2.5" + mkdirp "^0.5.1" + tslib "^1.10.0" + react-reconciler@0.27.0: version "0.27.0" resolved "https://registry.npmmirror.com/react-reconciler/-/react-reconciler-0.27.0.tgz#360124fdf2d76447c7491ee5f0e04503ed9acf5b" @@ -12242,6 +12278,21 @@ taro-css-to-react-native@3.3.10: css-mediaquery "^0.1.2" postcss-value-parser "^3.3.0" +taro-iconfont-cli@^3.3.0: + version "3.3.0" + resolved "https://registry.npmmirror.com/taro-iconfont-cli/-/taro-iconfont-cli-3.3.0.tgz#b4d3f83598099d84bdc61435cadf4a8a584a29d7" + integrity sha512-lkZE/zaL0J3a6ymlUp1sMBiM8krJkDh0ZsrzB5FM2IGdgQO1/4Vs7N2hzTEVZ7EZoV/6hBqL0YwzTXg4MpuJMg== + dependencies: + colors "^1.4.0" + fs-extra "^8.1.0" + iconfont-parser "^1.0.0" + mini-program-iconfont-cli "0.6.1" + minimist "^1.2.5" + mkdirp "^0.5.1" + react-iconfont-cli "2.0.2" + react-native-iconfont-cli "2.2.4" + tslib "^2.3.1" + tarojs@^2.1.1: version "2.1.1" resolved "https://registry.npmmirror.com/tarojs/-/tarojs-2.1.1.tgz#d56b50608b01de4efd6f245ecbf8cc3cd632173f" @@ -12442,7 +12493,7 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.npmmirror.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.3.0: +tslib@^2.0.3, tslib@^2.3.0, tslib@^2.3.1: version "2.4.0" resolved "https://registry.npmmirror.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== @@ -13186,7 +13237,7 @@ xml-parse-from-string@^1.0.0: resolved "https://registry.npmmirror.com/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz#a9029e929d3dbcded169f3c6e28238d95a5d5a28" integrity sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g== -xml2js@^0.4.19, xml2js@^0.4.5: +xml2js@^0.4.19, xml2js@^0.4.22, xml2js@^0.4.5: version "0.4.23" resolved "https://registry.npmmirror.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==