diff --git a/iconfont.json b/iconfont.json index 82e3464..2ef9342 100644 --- a/iconfont.json +++ b/iconfont.json @@ -1,5 +1,5 @@ { - "symbol_url": "//at.alicdn.com/t/c/font_3786318_eat16pif2dp.js", + "symbol_url": "https://at.alicdn.com/t/c/font_3786318_yrquaqja59.js", "save_dir": "./src/components/iconfont", "use_typescript": false, "platforms": "*", diff --git a/src/api/user.ts b/src/api/user.ts index b8ac650..b9c4912 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -1,3 +1,4 @@ +import { CAP_HTML_TO_IMAGE_BASE_URL } from '@/common/constant' import { useRequest } from '@/use/useHttp' /** * 解密用户微信信息 @@ -108,3 +109,33 @@ export const BindInvitationInfoApi = () => { method: 'post', }) } +// 生成二维码 +export const GenBarCodeOrQrCode = () => { + return useRequest({ + url: '/xima-caphtml/genBarcodeOrQrCode', + base_url: CAP_HTML_TO_IMAGE_BASE_URL, + method: 'post', + }) +} +// 获取邀请码列表 +export const GetInviteCodeList = () => { + return useRequest({ + url: '/v2/mall/user/inviterList', + method: 'get', + pagination: true, + }) +} +// 邀请码 +export const GetInvitationInfo = () => { + return useRequest({ + url: '/v2/mall/user/invitationInfoRecord', + method: 'get', + }) +} +// 邀请码 +export const GetInviteeRecord = () => { + return useRequest({ + url: '/v2/mall/user/invitee_record', + method: 'get', + }) +} diff --git a/src/app.config.ts b/src/app.config.ts index 4d9d8bf..4e717fb 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,8 +1,6 @@ -import { useGlobalIconFont } from './components/iconfont/helper' export default { // eslint-disable-next-line react-hooks/rules-of-hooks - usingComponents: Object.assign(useGlobalIconFont()), pages: [ 'pages/index/index', 'pages/user/index', @@ -180,9 +178,10 @@ export default { ], }, { - root: 'pages/bindSalesman', + root: 'pages/inviteCode', pages: [ 'index', + 'inviteCord/index', ], }, diff --git a/src/components/Dialog/index.module.scss b/src/components/Dialog/index.module.scss new file mode 100644 index 0000000..c3468ac --- /dev/null +++ b/src/components/Dialog/index.module.scss @@ -0,0 +1,40 @@ +$am-ms: 200ms; + +.dialog { + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + width: 100vw; + height: 100vh; + &_mask { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.8); + z-index: 1; + opacity: 0; + transition: opacity $am-ms ease-in; + &_active { + opacity: 1; + } + &--hidden { + background: transparent; + } + } + &_content { + position: fixed; + z-index: 2; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + opacity: 0; + transition: opacity $am-ms ease-in; + &_active { + opacity: 1; + } + } +} diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx new file mode 100644 index 0000000..55cafca --- /dev/null +++ b/src/components/Dialog/index.tsx @@ -0,0 +1,63 @@ +import { Image, View } from '@tarojs/components' +import classnames from 'classnames' +import { useEffect, useState } from 'react' +import style from './index.module.scss' +import { usePropsValue } from '@/use/useCommon' + +interface PropsType { + showOverLay?: boolean + show: boolean + onClose?: (show: boolean) => void + onChange?: (isShow) => void + children?: React.ReactNode +} +// 弹出框 +const Dialog = (props: PropsType) => { + const { showOverLay = true, show = false, onClose: _onClose, onChange: _onChange, children } = props + + const [_show, setShow] = usePropsValue({ + value: show, + defaultValue: false, + onChange: (value) => { + _onChange?.(value) + }, + }) + + const [animShow, setAnimShow] = useState(false) + + const handleAnimShow = () => { + setShow(true) + setTimeout(() => { + setAnimShow(true) + }, 200) + } + const handleAnimHide = () => { + setAnimShow(false) + setTimeout(() => { + setShow(false) + }, 200) + } + const onClose = () => { + handleAnimHide() + _onClose?.(_show) + } + useEffect(() => { + if (show) { + handleAnimShow() + } + }, [show]) + return _show + ? + {/* 遮罩层 start */} + + {/* 遮罩层 end */} + + {children} + + + : +} +export default Dialog diff --git a/src/components/LoadMore/index.module.scss b/src/components/LoadMore/index.module.scss new file mode 100644 index 0000000..c0833ef --- /dev/null +++ b/src/components/LoadMore/index.module.scss @@ -0,0 +1,12 @@ +.loadMore{ + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + font-size: 28px; + color: $color_font_three; + padding: 24px 0; +} +.empty{ + padding: 100px; +} diff --git a/src/components/LoadMore/index.tsx b/src/components/LoadMore/index.tsx new file mode 100644 index 0000000..d91b3b6 --- /dev/null +++ b/src/components/LoadMore/index.tsx @@ -0,0 +1,52 @@ +import { Text, View } from '@tarojs/components' +import type { FC } from 'react' +import Iconfont from '../iconfont/iconfont' +import LoadingCard from '../loadingCard/index' +import styles from './index.module.scss' + +export type LoadMoreStatus = 'more' | 'loading' | 'noMore' | 'empty' + +interface LoadMoreEvent { + onClick?: () => void +} + +interface LoadMorePropsType extends LoadMoreEvent { + status: LoadMoreStatus + moreText?: string + loadingText?: string + noMoreText?: string + emptyText?: string +} + +const LoadMore: FC = (props) => { + const { status, moreText = '查看更多', loadingText = '加载中', noMoreText = '没有更多', emptyText = '暂无数据', onClick } = props + + const handleShowMore = () => { + onClick && onClick() + } + + let component: JSX.Element | null = null + if (status === 'loading') { + component = + } + else if (status === 'more') { + component = ( + + {moreText} + + + ) + } + else if (status === 'empty') { + component = ( + + {emptyText} + + ) + } + else { + component = {noMoreText} + } + return {component} +} +export default LoadMore diff --git a/src/components/bindSalesManDialog/index.module.scss b/src/components/bindSalesManDialog/index.module.scss new file mode 100644 index 0000000..08afb64 --- /dev/null +++ b/src/components/bindSalesManDialog/index.module.scss @@ -0,0 +1,103 @@ +.inviteCodeDialog { + width: 80vw; + background-color: #e4eefd; + border-radius: 24px; + padding-bottom: 12px; + .background { + display: flex; + flex-flow: row nowrap; + padding: 20px 24px; + padding-bottom: 0; + justify-content: space-between; + height: 160px; + position: relative; + z-index: 99; + .left { + margin-left: 20px; + margin-top: 16px; + .title { + padding-bottom: 15px; + font-size: 40px; + font-weight: 550; + } + .description { + font-size: 26px; + color: #848689; + font-weight: 400; + } + } + .right { + position: relative; + z-index: 99; + .iconContainer { + width: 260px; + position: relative; + .icon { + width: 130%; + } + } + } + } + .content { + position: relative; + } +} +.inputCode { + width: 100%; + height: 106px; + background: #f6f6f6; + border: 2px solid #f0f0f0; + border-radius: 20px; + display: flex; + align-items: center; + padding: 20px 0 20px 30px; + box-sizing: border-box; + position: relative; + input { + flex: 1; + z-index: 0; + letter-spacing: 10px; + } + .scan_code { + width: 101px; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + border-left: 1px solid #ccc; + .miconfont { + font-size: 50px; + color: #007aff; + } + } + .close_btn { + padding: 0 20px; + } +} +.tipsGroup { + color: #8a8a8a; + font-size: 24px; + margin-top: 88px; + .tips { + display: flex; + flex-flow: row nowrap; + } +} +.bottomBar { + margin: 24px; + margin-bottom: 24px; + &__button { + border-radius: 10px; + } + &__text { + } +} +.salesMan { + margin: 5px 0; + font-size: 24px; + font-weight: 500; + color: #000000; +} +.error { + color: #f45069; +} diff --git a/src/components/bindSalesManDialog/index.tsx b/src/components/bindSalesManDialog/index.tsx new file mode 100644 index 0000000..85f0f84 --- /dev/null +++ b/src/components/bindSalesManDialog/index.tsx @@ -0,0 +1,185 @@ +import { CoverView, Image, Input, Swiper, SwiperItem, Text, View } from '@tarojs/components' +import Taro from '@tarojs/taro' +import type { Ref } from 'react' +import { forwardRef, useEffect, useImperativeHandle, useState } from 'react' +import classnames from 'classnames' +import Dialog from '../Dialog' +import NormalButton from '../normalButton' +import LayoutBlock from '../layoutBlock' +import IconText from '../iconText' +import IconFont from '../iconfont/iconfont' +import InputX from '../InputX' +import styles from './index.module.scss' +import { formatImgUrl } from '@/common/fotmat' +import { alert, goLink } from '@/common/common' +import CloseBtn from '@/components/closeBtn' +import { getCDNSource } from '@/common/constant' +import { getFilterData } from '@/common/util' +import { BindInvitationInfoApi, GetInvitationInfoApi } from '@/api/user' +// 获取业务员信息 +interface Param { invitation_code: string; name: string; phone: string } +interface params { + onSuccess?: () => void +} +interface SalesManDialogRef { + show: boolean + handleChange: (show: boolean) => void +} +const BindSalesManDialog = ({ onSuccess }: params, ref: Ref) => { + const [isError, setError] = useState(false) + const [show, setShow] = useState(false) + const [submitData, setSubmitData] = useState({ + invitation_code: '', + }) + const [salesMan, setSalesMan] = useState(null) + const { fetchData: GetInvitationInfoFetchData } = GetInvitationInfoApi() + const getInvitationInfo = async() => { + const res = await GetInvitationInfoFetchData({ invitation_code: submitData.invitation_code }) + if (res.success) { + setSalesMan(res.data) + setError(false) + } + else { + setSalesMan(null) + setError(true) + } + } + const onInputCode = (e) => { + const value = e.detail.value.replace(/[\W]/g, '') + if (value === '') { + setError(false) + setSubmitData({ invitation_code: '' }) + } + else { + setSubmitData(val => ({ ...val, invitation_code: value })) + } + } + const oncloseEven = () => { + setSubmitData(val => ({ ...val, invitation_code: '' })) + setSalesMan(null) + setError(false) + } + const handleChange = (value) => { + setShow(value) + } + const onCloseEven = () => { + handleChange(false) + } + const { fetchData: bindInvitationInfoFetchData } = BindInvitationInfoApi() + const handleConfirm = async() => { + if (!submitData.invitation_code) { return alert.error('请输入邀请码') } + const res = await bindInvitationInfoFetchData({ ...submitData }) + if (!res.success) { + console.log('res', res) + setError(true) + } + else { + onCloseEven() + onSuccess?.() + } + } + const onScanCode = () => { + Taro.scanCode({ + success: (res) => { + const val = res.result.match(/InviteCode:([a-zA-Z0-9]{4})/) + setSubmitData(() => ({ invitation_code: val ? val![1] : '' })) + }, + }) + } + + // 获取粘贴版内容 + const onClipboardData = () => { + Taro.getClipboardData({ + success(res) { + const val = res.data.match(/InviteCode:([a-zA-Z0-9]{4})/) + if (val) { setSubmitData(e => ({ ...e, invitation_code: val ? val[1] : '' })) } + }, + }) + } + useEffect(() => { + if (show) { + onClipboardData() + } + }, []) + + useEffect(() => { + if (submitData.invitation_code.length === 4) { getInvitationInfo() } + }, [submitData]) + useImperativeHandle( + ref, + () => { + return { + show, + handleChange, + } + }, + [show], + ) + const onCustomer = async() => { + const res = await Taro.showModal({ + title: '是否拨打服务热线', + confirmText: '拨打', + content: '(0757) 8270 6695', + cancelText: '取消', + }) + if (res.confirm) { + Taro.makePhoneCall({ + phoneNumber: '(0757)82706695', + }) + } + } + return ( + + + + + 陆盈商城服务 + 欢迎使用!填写邀请码 + + + + + + + + + + + + + + + {submitData.invitation_code && } + + onScanCode()}> + + + + {(salesMan && !isError) ? 邀请人:{salesMan?.name} {salesMan?.phone} : null} + {(submitData.invitation_code && isError) ? 邀请码错误 : null} + + 1、联系自己的专属客户经理获取邀请码 + 2、私聊客服进行获取- + + + + + 确定 + + + + + + ) +} + +export default forwardRef(BindSalesManDialog) diff --git a/src/components/bindSalesmanPopup/index.tsx b/src/components/bindSalesmanPopup/index.tsx index b21fa16..d1aaca7 100644 --- a/src/components/bindSalesmanPopup/index.tsx +++ b/src/components/bindSalesmanPopup/index.tsx @@ -25,7 +25,7 @@ const BindSalesmanPopup = ({ show, onClose }: params) => { const onConfirm = () => { onClose?.() - goLink('/pages/bindSalesman/index') + goLink('/pages/inviteCode/index') } return ( <> diff --git a/src/components/iconfont/alipay/alipay.acss b/src/components/iconfont/alipay/alipay.acss deleted file mode 100644 index 9f68d1a..0000000 --- a/src/components/iconfont/alipay/alipay.acss +++ /dev/null @@ -1,3 +0,0 @@ -.icon { - background-repeat: no-repeat; -} diff --git a/src/components/iconfont/alipay/alipay.axml b/src/components/iconfont/alipay/alipay.axml deleted file mode 100644 index 8cbdcf3..0000000 --- a/src/components/iconfont/alipay/alipay.axml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/components/iconfont/alipay/alipay.js b/src/components/iconfont/alipay/alipay.js deleted file mode 100644 index 3d0adb0..0000000 --- a/src/components/iconfont/alipay/alipay.js +++ /dev/null @@ -1,77 +0,0 @@ -Component({ - props: { - // riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 - 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 deleted file mode 100644 index 467ce29..0000000 --- a/src/components/iconfont/alipay/alipay.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/components/iconfont/h5/IconA0Tianzhangqi.js b/src/components/iconfont/h5/IconA0Tianzhangqi.js deleted file mode 100644 index e8ed87b..0000000 --- a/src/components/iconfont/h5/IconA0Tianzhangqi.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconA0Tianzhangqi = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconA0Tianzhangqi.defaultProps = { - size: 18, -}; - -export default IconA0Tianzhangqi; diff --git a/src/components/iconfont/h5/IconBianji.js b/src/components/iconfont/h5/IconBianji.js deleted file mode 100644 index 89f279b..0000000 --- a/src/components/iconfont/h5/IconBianji.js +++ /dev/null @@ -1,27 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconBianji = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconBianji.defaultProps = { - size: 18, -}; - -export default IconBianji; diff --git a/src/components/iconfont/h5/IconBianjizidingyimadan.js b/src/components/iconfont/h5/IconBianjizidingyimadan.js deleted file mode 100644 index 8466492..0000000 --- a/src/components/iconfont/h5/IconBianjizidingyimadan.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconBianjizidingyimadan = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconBianjizidingyimadan.defaultProps = { - size: 18, -}; - -export default IconBianjizidingyimadan; diff --git a/src/components/iconfont/h5/IconDaifahuo2.js b/src/components/iconfont/h5/IconDaifahuo2.js deleted file mode 100644 index d2564c2..0000000 --- a/src/components/iconfont/h5/IconDaifahuo2.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconDaifahuo2 = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconDaifahuo2.defaultProps = { - size: 18, -}; - -export default IconDaifahuo2; diff --git a/src/components/iconfont/h5/IconDaifukuan2.js b/src/components/iconfont/h5/IconDaifukuan2.js deleted file mode 100644 index f9ba186..0000000 --- a/src/components/iconfont/h5/IconDaifukuan2.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconDaifukuan2 = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconDaifukuan2.defaultProps = { - size: 18, -}; - -export default IconDaifukuan2; diff --git a/src/components/iconfont/h5/IconDaipeibu2.js b/src/components/iconfont/h5/IconDaipeibu2.js deleted file mode 100644 index df39166..0000000 --- a/src/components/iconfont/h5/IconDaipeibu2.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconDaipeibu2 = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconDaipeibu2.defaultProps = { - size: 18, -}; - -export default IconDaipeibu2; diff --git a/src/components/iconfont/h5/IconDaishouhuo2.js b/src/components/iconfont/h5/IconDaishouhuo2.js deleted file mode 100644 index 1350886..0000000 --- a/src/components/iconfont/h5/IconDaishouhuo2.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconDaishouhuo2 = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconDaishouhuo2.defaultProps = { - size: 18, -}; - -export default IconDaishouhuo2; diff --git a/src/components/iconfont/h5/IconDianjishoucang.js b/src/components/iconfont/h5/IconDianjishoucang.js deleted file mode 100644 index eef18dd..0000000 --- a/src/components/iconfont/h5/IconDianjishoucang.js +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconDianjishoucang = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - - ); -}; - -IconDianjishoucang.defaultProps = { - size: 18, -}; - -export default IconDianjishoucang; diff --git a/src/components/iconfont/h5/IconErweima.js b/src/components/iconfont/h5/IconErweima.js deleted file mode 100644 index 071b3ff..0000000 --- a/src/components/iconfont/h5/IconErweima.js +++ /dev/null @@ -1,27 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconErweima = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconErweima.defaultProps = { - size: 18, -}; - -export default IconErweima; diff --git a/src/components/iconfont/h5/IconFenxiangshangpin.js b/src/components/iconfont/h5/IconFenxiangshangpin.js deleted file mode 100644 index 23dfd2c..0000000 --- a/src/components/iconfont/h5/IconFenxiangshangpin.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconFenxiangshangpin = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconFenxiangshangpin.defaultProps = { - size: 18, -}; - -export default IconFenxiangshangpin; diff --git a/src/components/iconfont/h5/IconGongnengtubiaoSaomiao.js b/src/components/iconfont/h5/IconGongnengtubiaoSaomiao.js deleted file mode 100644 index c1cba5e..0000000 --- a/src/components/iconfont/h5/IconGongnengtubiaoSaomiao.js +++ /dev/null @@ -1,27 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconGongnengtubiaoSaomiao = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconGongnengtubiaoSaomiao.defaultProps = { - size: 18, -}; - -export default IconGongnengtubiaoSaomiao; diff --git a/src/components/iconfont/h5/IconGouwuche.js b/src/components/iconfont/h5/IconGouwuche.js deleted file mode 100644 index 23d1c00..0000000 --- a/src/components/iconfont/h5/IconGouwuche.js +++ /dev/null @@ -1,35 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconGouwuche = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - - ); -}; - -IconGouwuche.defaultProps = { - size: 18, -}; - -export default IconGouwuche; diff --git a/src/components/iconfont/h5/IconGuanli.js b/src/components/iconfont/h5/IconGuanli.js deleted file mode 100644 index a82dd00..0000000 --- a/src/components/iconfont/h5/IconGuanli.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconGuanli = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconGuanli.defaultProps = { - size: 18, -}; - -export default IconGuanli; diff --git a/src/components/iconfont/h5/IconHuodaofukuan.js b/src/components/iconfont/h5/IconHuodaofukuan.js deleted file mode 100644 index 0254b64..0000000 --- a/src/components/iconfont/h5/IconHuodaofukuan.js +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconHuodaofukuan = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - - - ); -}; - -IconHuodaofukuan.defaultProps = { - size: 18, -}; - -export default IconHuodaofukuan; diff --git a/src/components/iconfont/h5/IconHuozhuziti.js b/src/components/iconfont/h5/IconHuozhuziti.js deleted file mode 100644 index 2c5f5d0..0000000 --- a/src/components/iconfont/h5/IconHuozhuziti.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconHuozhuziti = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconHuozhuziti.defaultProps = { - size: 18, -}; - -export default IconHuozhuziti; diff --git a/src/components/iconfont/h5/IconJianshaoanniu.js b/src/components/iconfont/h5/IconJianshaoanniu.js deleted file mode 100644 index 6e58f49..0000000 --- a/src/components/iconfont/h5/IconJianshaoanniu.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconJianshaoanniu = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconJianshaoanniu.defaultProps = { - size: 18, -}; - -export default IconJianshaoanniu; diff --git a/src/components/iconfont/h5/IconKefu.js b/src/components/iconfont/h5/IconKefu.js deleted file mode 100644 index d41aa25..0000000 --- a/src/components/iconfont/h5/IconKefu.js +++ /dev/null @@ -1,27 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconKefu = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconKefu.defaultProps = { - size: 18, -}; - -export default IconKefu; diff --git a/src/components/iconfont/h5/IconQingchusousuo.js b/src/components/iconfont/h5/IconQingchusousuo.js deleted file mode 100644 index 7d26da0..0000000 --- a/src/components/iconfont/h5/IconQingchusousuo.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconQingchusousuo = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconQingchusousuo.defaultProps = { - size: 18, -}; - -export default IconQingchusousuo; diff --git a/src/components/iconfont/h5/IconQingchuxinxi.js b/src/components/iconfont/h5/IconQingchuxinxi.js deleted file mode 100644 index 94a2e34..0000000 --- a/src/components/iconfont/h5/IconQingchuxinxi.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconQingchuxinxi = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconQingchuxinxi.defaultProps = { - size: 18, -}; - -export default IconQingchuxinxi; diff --git a/src/components/iconfont/h5/IconRiqi.js b/src/components/iconfont/h5/IconRiqi.js deleted file mode 100644 index a64b856..0000000 --- a/src/components/iconfont/h5/IconRiqi.js +++ /dev/null @@ -1,27 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconRiqi = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconRiqi.defaultProps = { - size: 18, -}; - -export default IconRiqi; diff --git a/src/components/iconfont/h5/IconSaomazhifu.js b/src/components/iconfont/h5/IconSaomazhifu.js deleted file mode 100644 index 1f6d5b9..0000000 --- a/src/components/iconfont/h5/IconSaomazhifu.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconSaomazhifu = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconSaomazhifu.defaultProps = { - size: 18, -}; - -export default IconSaomazhifu; diff --git a/src/components/iconfont/h5/IconShangla.js b/src/components/iconfont/h5/IconShangla.js deleted file mode 100644 index b63dc8b..0000000 --- a/src/components/iconfont/h5/IconShangla.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconShangla = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconShangla.defaultProps = { - size: 18, -}; - -export default IconShangla; diff --git a/src/components/iconfont/h5/IconShezhi.js b/src/components/iconfont/h5/IconShezhi.js deleted file mode 100644 index dd0aae8..0000000 --- a/src/components/iconfont/h5/IconShezhi.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconShezhi = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconShezhi.defaultProps = { - size: 18, -}; - -export default IconShezhi; diff --git a/src/components/iconfont/h5/IconShoucangchenggong.js b/src/components/iconfont/h5/IconShoucangchenggong.js deleted file mode 100644 index cf6ceaa..0000000 --- a/src/components/iconfont/h5/IconShoucangchenggong.js +++ /dev/null @@ -1,27 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconShoucangchenggong = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconShoucangchenggong.defaultProps = { - size: 18, -}; - -export default IconShoucangchenggong; diff --git a/src/components/iconfont/h5/IconShoucangjia.js b/src/components/iconfont/h5/IconShoucangjia.js deleted file mode 100644 index 47d23cd..0000000 --- a/src/components/iconfont/h5/IconShoucangjia.js +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconShoucangjia = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - - - - ); -}; - -IconShoucangjia.defaultProps = { - size: 18, -}; - -export default IconShoucangjia; diff --git a/src/components/iconfont/h5/IconShuru.js b/src/components/iconfont/h5/IconShuru.js deleted file mode 100644 index 9d062f4..0000000 --- a/src/components/iconfont/h5/IconShuru.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconShuru = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconShuru.defaultProps = { - size: 18, -}; - -export default IconShuru; diff --git a/src/components/iconfont/h5/IconSousuo.js b/src/components/iconfont/h5/IconSousuo.js deleted file mode 100644 index 8dc0597..0000000 --- a/src/components/iconfont/h5/IconSousuo.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconSousuo = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconSousuo.defaultProps = { - size: 18, -}; - -export default IconSousuo; diff --git a/src/components/iconfont/h5/IconTishi.js b/src/components/iconfont/h5/IconTishi.js deleted file mode 100644 index 539248f..0000000 --- a/src/components/iconfont/h5/IconTishi.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconTishi = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconTishi.defaultProps = { - size: 18, -}; - -export default IconTishi; diff --git a/src/components/iconfont/h5/IconTuikuanShouhou.js b/src/components/iconfont/h5/IconTuikuanShouhou.js deleted file mode 100644 index da2c9a7..0000000 --- a/src/components/iconfont/h5/IconTuikuanShouhou.js +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconTuikuanShouhou = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconTuikuanShouhou.defaultProps = { - size: 18, -}; - -export default IconTuikuanShouhou; diff --git a/src/components/iconfont/h5/IconXiala.js b/src/components/iconfont/h5/IconXiala.js deleted file mode 100644 index 9e5d8bd..0000000 --- a/src/components/iconfont/h5/IconXiala.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconXiala = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconXiala.defaultProps = { - size: 18, -}; - -export default IconXiala; diff --git a/src/components/iconfont/h5/IconXianxiahuikuan.js b/src/components/iconfont/h5/IconXianxiahuikuan.js deleted file mode 100644 index 0309c59..0000000 --- a/src/components/iconfont/h5/IconXianxiahuikuan.js +++ /dev/null @@ -1,35 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconXianxiahuikuan = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - - ); -}; - -IconXianxiahuikuan.defaultProps = { - size: 18, -}; - -export default IconXianxiahuikuan; diff --git a/src/components/iconfont/h5/IconXinzenganniu.js b/src/components/iconfont/h5/IconXinzenganniu.js deleted file mode 100644 index b67aa1b..0000000 --- a/src/components/iconfont/h5/IconXinzenganniu.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconXinzenganniu = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconXinzenganniu.defaultProps = { - size: 18, -}; - -export default IconXinzenganniu; diff --git a/src/components/iconfont/h5/IconXinzengshoucangjia.js b/src/components/iconfont/h5/IconXinzengshoucangjia.js deleted file mode 100644 index b938d70..0000000 --- a/src/components/iconfont/h5/IconXinzengshoucangjia.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconXinzengshoucangjia = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconXinzengshoucangjia.defaultProps = { - size: 18, -}; - -export default IconXinzengshoucangjia; diff --git a/src/components/iconfont/h5/IconXuanzechenggong.js b/src/components/iconfont/h5/IconXuanzechenggong.js deleted file mode 100644 index adc0579..0000000 --- a/src/components/iconfont/h5/IconXuanzechenggong.js +++ /dev/null @@ -1,27 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconXuanzechenggong = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - ); -}; - -IconXuanzechenggong.defaultProps = { - size: 18, -}; - -export default IconXuanzechenggong; diff --git a/src/components/iconfont/h5/IconYuanshimadanyulan.js b/src/components/iconfont/h5/IconYuanshimadanyulan.js deleted file mode 100644 index 008aff0..0000000 --- a/src/components/iconfont/h5/IconYuanshimadanyulan.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconYuanshimadanyulan = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconYuanshimadanyulan.defaultProps = { - size: 18, -}; - -export default IconYuanshimadanyulan; diff --git a/src/components/iconfont/h5/IconYufukuan.js b/src/components/iconfont/h5/IconYufukuan.js deleted file mode 100644 index a6b645d..0000000 --- a/src/components/iconfont/h5/IconYufukuan.js +++ /dev/null @@ -1,36 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconYufukuan = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - - ); -}; - -IconYufukuan.defaultProps = { - size: 18, -}; - -export default IconYufukuan; diff --git a/src/components/iconfont/h5/IconZidingyimadanyulan.js b/src/components/iconfont/h5/IconZidingyimadanyulan.js deleted file mode 100644 index a7a59d1..0000000 --- a/src/components/iconfont/h5/IconZidingyimadanyulan.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { getIconColor } from './helper'; - -const DEFAULT_STYLE = { - display: 'block', -}; - -const IconZidingyimadanyulan = ({ size, color, style: _style, ...rest }) => { - const style = _style ? { ...DEFAULT_STYLE, ..._style } : DEFAULT_STYLE; - - return ( - - - - - ); -}; - -IconZidingyimadanyulan.defaultProps = { - size: 18, -}; - -export default IconZidingyimadanyulan; diff --git a/src/components/iconfont/h5/helper.js b/src/components/iconfont/h5/helper.js deleted file mode 100644 index b566c4c..0000000 --- a/src/components/iconfont/h5/helper.js +++ /dev/null @@ -1,17 +0,0 @@ -/* 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 deleted file mode 100644 index 0bab1ab..0000000 --- a/src/components/iconfont/h5/index.js +++ /dev/null @@ -1,161 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import IconRiqi from './IconRiqi'; -import IconShuru from './IconShuru'; -import IconA0Tianzhangqi from './IconA0Tianzhangqi'; -import IconHuodaofukuan from './IconHuodaofukuan'; -import IconHuozhuziti from './IconHuozhuziti'; -import IconSaomazhifu from './IconSaomazhifu'; -import IconXianxiahuikuan from './IconXianxiahuikuan'; -import IconYufukuan from './IconYufukuan'; -import IconXinzengshoucangjia from './IconXinzengshoucangjia'; -import IconQingchusousuo from './IconQingchusousuo'; -import IconXuanzechenggong from './IconXuanzechenggong'; -import IconGongnengtubiaoSaomiao from './IconGongnengtubiaoSaomiao'; -import IconBianjizidingyimadan from './IconBianjizidingyimadan'; -import IconZidingyimadanyulan from './IconZidingyimadanyulan'; -import IconYuanshimadanyulan from './IconYuanshimadanyulan'; -import IconXiala from './IconXiala'; -import IconShangla from './IconShangla'; -import IconQingchuxinxi from './IconQingchuxinxi'; -import IconSousuo from './IconSousuo'; -import IconGuanli from './IconGuanli'; -import IconBianji from './IconBianji'; -import IconShoucangjia from './IconShoucangjia'; -import IconShezhi from './IconShezhi'; -import IconTishi from './IconTishi'; -import IconErweima from './IconErweima'; -import IconDianjishoucang from './IconDianjishoucang'; -import IconGouwuche from './IconGouwuche'; -import IconShoucangchenggong from './IconShoucangchenggong'; -import IconFenxiangshangpin from './IconFenxiangshangpin'; -import IconKefu from './IconKefu'; -import IconXinzenganniu from './IconXinzenganniu'; -import IconJianshaoanniu from './IconJianshaoanniu'; -import IconDaifahuo2 from './IconDaifahuo2'; -import IconDaishouhuo2 from './IconDaishouhuo2'; -import IconTuikuanShouhou from './IconTuikuanShouhou'; -import IconDaipeibu2 from './IconDaipeibu2'; -import IconDaifukuan2 from './IconDaifukuan2'; -export { default as IconRiqi } from './IconRiqi'; -export { default as IconShuru } from './IconShuru'; -export { default as IconA0Tianzhangqi } from './IconA0Tianzhangqi'; -export { default as IconHuodaofukuan } from './IconHuodaofukuan'; -export { default as IconHuozhuziti } from './IconHuozhuziti'; -export { default as IconSaomazhifu } from './IconSaomazhifu'; -export { default as IconXianxiahuikuan } from './IconXianxiahuikuan'; -export { default as IconYufukuan } from './IconYufukuan'; -export { default as IconXinzengshoucangjia } from './IconXinzengshoucangjia'; -export { default as IconQingchusousuo } from './IconQingchusousuo'; -export { default as IconXuanzechenggong } from './IconXuanzechenggong'; -export { default as IconGongnengtubiaoSaomiao } from './IconGongnengtubiaoSaomiao'; -export { default as IconBianjizidingyimadan } from './IconBianjizidingyimadan'; -export { default as IconZidingyimadanyulan } from './IconZidingyimadanyulan'; -export { default as IconYuanshimadanyulan } from './IconYuanshimadanyulan'; -export { default as IconXiala } from './IconXiala'; -export { default as IconShangla } from './IconShangla'; -export { default as IconQingchuxinxi } from './IconQingchuxinxi'; -export { default as IconSousuo } from './IconSousuo'; -export { default as IconGuanli } from './IconGuanli'; -export { default as IconBianji } from './IconBianji'; -export { default as IconShoucangjia } from './IconShoucangjia'; -export { default as IconShezhi } from './IconShezhi'; -export { default as IconTishi } from './IconTishi'; -export { default as IconErweima } from './IconErweima'; -export { default as IconDianjishoucang } from './IconDianjishoucang'; -export { default as IconGouwuche } from './IconGouwuche'; -export { default as IconShoucangchenggong } from './IconShoucangchenggong'; -export { default as IconFenxiangshangpin } from './IconFenxiangshangpin'; -export { default as IconKefu } from './IconKefu'; -export { default as IconXinzenganniu } from './IconXinzenganniu'; -export { default as IconJianshaoanniu } from './IconJianshaoanniu'; -export { default as IconDaifahuo2 } from './IconDaifahuo2'; -export { default as IconDaishouhuo2 } from './IconDaishouhuo2'; -export { default as IconTuikuanShouhou } from './IconTuikuanShouhou'; -export { default as IconDaipeibu2 } from './IconDaipeibu2'; -export { default as IconDaifukuan2 } from './IconDaifukuan2'; - -const IconFont = ({ name, ...rest }) => { - switch (name) { - case 'riqi': - return ; - case 'shuru': - return ; - case 'a-0tianzhangqi': - return ; - case 'huodaofukuan': - return ; - case 'huozhuziti': - return ; - case 'saomazhifu': - return ; - case 'xianxiahuikuan': - return ; - case 'yufukuan': - return ; - case 'xinzengshoucangjia': - return ; - case 'qingchusousuo': - return ; - case 'xuanzechenggong': - return ; - case 'gongnengtubiao-saomiao': - return ; - case 'bianjizidingyimadan': - return ; - case 'zidingyimadanyulan': - return ; - case 'yuanshimadanyulan': - return ; - case 'xiala': - return ; - case 'shangla': - return ; - case 'qingchuxinxi': - return ; - case 'sousuo': - return ; - case 'guanli': - return ; - case 'bianji': - return ; - case 'shoucangjia': - return ; - case 'shezhi': - return ; - case 'tishi': - return ; - case 'erweima': - return ; - case 'dianjishoucang': - return ; - case 'gouwuche': - return ; - case 'shoucangchenggong': - return ; - case 'fenxiangshangpin': - return ; - case 'kefu': - return ; - case 'xinzenganniu': - return ; - case 'jianshaoanniu': - return ; - case 'daifahuo2': - return ; - case 'daishouhuo2': - return ; - case 'tuikuan-shouhou': - return ; - case 'daipeibu2': - return ; - case 'daifukuan2': - return ; - - } - - return null; -}; - -export default IconFont; diff --git a/src/components/iconfont/helper.d.ts b/src/components/iconfont/helper.d.ts deleted file mode 100644 index 24a9a53..0000000 --- a/src/components/iconfont/helper.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export declare var useGlobalIconFont: () => { iconfont: string }; diff --git a/src/components/iconfont/helper.js b/src/components/iconfont/helper.js deleted file mode 100644 index 2caa692..0000000 --- a/src/components/iconfont/helper.js +++ /dev/null @@ -1,9 +0,0 @@ -/* 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/iconfont.tsx b/src/components/iconfont/iconfont.tsx index cb4bc5d..40fb99d 100644 --- a/src/components/iconfont/iconfont.tsx +++ b/src/components/iconfont/iconfont.tsx @@ -24,7 +24,7 @@ function hex2rgb(hex) { return "rgb(" + rgb.join(",") + ")"; } -export type IconNames = 'icon-xinzengshoucangjia' | 'icon-qingchusousuo' | 'icon-xuanzechenggong' | 'icon-gongnengtubiao-saomiao' | 'icon-bianjizidingyimadan' | 'icon-zidingyimadanyulan' | 'icon-yuanshimadanyulan' | 'icon-xiala' | 'icon-shangla' | 'icon-qingchuxinxi' | 'icon-sousuo' | 'icon-guanli' | 'icon-bianji' | 'icon-shoucangjia' | 'icon-shezhi' | 'icon-tishi' | 'icon-erweima' | 'icon-dianjishoucang' | 'icon-gouwuche' | 'icon-shoucangchenggong' | 'icon-fenxiangshangpin' | 'icon-kefu' | 'icon-xinzenganniu' | 'icon-jianshaoanniu' | 'icon-daifahuo2' | 'icon-daishouhuo2' | 'icon-tuikuan-shouhou' | 'icon-daipeibu2' | 'icon-daifukuan2'; +export type IconNames = 'icon-rukou' | 'icon-renzhengchenggong' | 'icon-wodekefu' | 'icon-yanseduibi' | 'icon-dizhiguanli' | 'icon-weixin' | 'icon-riqi' | 'icon-shuru' | 'icon-a-0tianzhangqi' | 'icon-huodaofukuan' | 'icon-huozhuziti' | 'icon-saomazhifu' | 'icon-xianxiahuikuan' | 'icon-yufukuan' | 'icon-xinzengshoucangjia' | 'icon-qingchusousuo' | 'icon-xuanzechenggong' | 'icon-gongnengtubiao-saomiao' | 'icon-bianjizidingyimadan' | 'icon-zidingyimadanyulan' | 'icon-yuanshimadanyulan' | 'icon-xiala' | 'icon-shangla' | 'icon-qingchuxinxi' | 'icon-sousuo' | 'icon-guanli' | 'icon-bianji' | 'icon-shoucangjia' | 'icon-shezhi' | 'icon-tishi' | 'icon-erweima' | 'icon-dianjishoucang' | 'icon-gouwuche' | 'icon-shoucangchenggong' | 'icon-fenxiangshangpin' | 'icon-kefu' | 'icon-xinzenganniu' | 'icon-jianshaoanniu' | 'icon-daifahuo2' | 'icon-daishouhuo2' | 'icon-tuikuan-shouhou' | 'icon-daipeibu2' | 'icon-daifukuan2'; type PropsType = { name: IconNames; @@ -36,7 +36,7 @@ type PropsType = { const IconFont:FC = ({ name, - size = 36, + size = 18, color, customStyle = {}, customClassName = "" @@ -82,7 +82,49 @@ const IconFont:FC = ({ className={classnames(icon, customClassName)} /> )} */} - {/* icon-xinzengshoucangjia */} + {/* icon-rukou */} + + { name === 'icon-rukou' && () } +{/* icon-renzhengchenggong */} + + { name === 'icon-renzhengchenggong' && () } +{/* icon-wodekefu */} + + { name === 'icon-wodekefu' && () } +{/* icon-yanseduibi */} + + { name === 'icon-yanseduibi' && () } +{/* icon-dizhiguanli */} + + { name === 'icon-dizhiguanli' && () } +{/* icon-weixin */} + + { name === 'icon-weixin' && () } +{/* icon-riqi */} + + { name === 'icon-riqi' && () } +{/* icon-shuru */} + + { name === 'icon-shuru' && () } +{/* icon-a-0tianzhangqi */} + + { name === 'icon-a-0tianzhangqi' && () } +{/* icon-huodaofukuan */} + + { name === 'icon-huodaofukuan' && () } +{/* icon-huozhuziti */} + + { name === 'icon-huozhuziti' && () } +{/* icon-saomazhifu */} + + { name === 'icon-saomazhifu' && () } +{/* icon-xianxiahuikuan */} + + { name === 'icon-xianxiahuikuan' && () } +{/* icon-yufukuan */} + + { name === 'icon-yufukuan' && () } +{/* icon-xinzengshoucangjia */} { name === 'icon-xinzengshoucangjia' && () } {/* icon-qingchusousuo */} diff --git a/src/components/iconfont/index.alipay.js b/src/components/iconfont/index.alipay.js deleted file mode 100644 index 731305b..0000000 --- a/src/components/iconfont/index.alipay.js +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 deleted file mode 100644 index 95c9f7f..0000000 --- a/src/components/iconfont/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* eslint-disable */ -import React, { FunctionComponent } from 'react'; - -interface Props { - name: 'riqi' | 'shuru' | 'a-0tianzhangqi' | 'huodaofukuan' | 'huozhuziti' | 'saomazhifu' | 'xianxiahuikuan' | 'yufukuan' | 'xinzengshoucangjia' | 'qingchusousuo' | 'xuanzechenggong' | 'gongnengtubiao-saomiao' | 'bianjizidingyimadan' | 'zidingyimadanyulan' | 'yuanshimadanyulan' | 'xiala' | 'shangla' | 'qingchuxinxi' | 'sousuo' | 'guanli' | 'bianji' | 'shoucangjia' | 'shezhi' | 'tishi' | 'erweima' | 'dianjishoucang' | 'gouwuche' | 'shoucangchenggong' | 'fenxiangshangpin' | 'kefu' | 'xinzenganniu' | 'jianshaoanniu' | 'daifahuo2' | 'daishouhuo2' | 'tuikuan-shouhou' | 'daipeibu2' | 'daifukuan2'; - 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 deleted file mode 100644 index 80b208b..0000000 --- a/src/components/iconfont/index.h5.js +++ /dev/null @@ -1,17 +0,0 @@ -/* 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 deleted file mode 100644 index 9236f4b..0000000 --- a/src/components/iconfont/index.js +++ /dev/null @@ -1,7 +0,0 @@ -/* 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 deleted file mode 100644 index 731305b..0000000 --- a/src/components/iconfont/index.qq.js +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 deleted file mode 100644 index 5375b4a..0000000 --- a/src/components/iconfont/index.rn.js +++ /dev/null @@ -1,17 +0,0 @@ -/* 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 deleted file mode 100644 index 731305b..0000000 --- a/src/components/iconfont/index.swan.js +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 deleted file mode 100644 index 731305b..0000000 --- a/src/components/iconfont/index.tt.js +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 deleted file mode 100644 index 731305b..0000000 --- a/src/components/iconfont/index.weapp.js +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 deleted file mode 100644 index ebc1fc9..0000000 --- a/src/components/iconfont/qq/qq.js +++ /dev/null @@ -1,31 +0,0 @@ -Component({ - properties: { - // riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 - 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/qq/qq.json b/src/components/iconfont/qq/qq.json deleted file mode 100644 index a89ef4d..0000000 --- a/src/components/iconfont/qq/qq.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} diff --git a/src/components/iconfont/qq/qq.qml b/src/components/iconfont/qq/qq.qml deleted file mode 100644 index e0cbf19..0000000 --- a/src/components/iconfont/qq/qq.qml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/components/iconfont/qq/qq.qss b/src/components/iconfont/qq/qq.qss deleted file mode 100644 index 9f68d1a..0000000 --- a/src/components/iconfont/qq/qq.qss +++ /dev/null @@ -1,3 +0,0 @@ -.icon { - background-repeat: no-repeat; -} diff --git a/src/components/iconfont/rn/IconA0Tianzhangqi.js b/src/components/iconfont/rn/IconA0Tianzhangqi.js deleted file mode 100644 index cb92dad..0000000 --- a/src/components/iconfont/rn/IconA0Tianzhangqi.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconA0Tianzhangqi = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconA0Tianzhangqi.defaultProps = { - size: 18, -}; - -IconA0Tianzhangqi = React.memo ? React.memo(IconA0Tianzhangqi) : IconA0Tianzhangqi; - -export default IconA0Tianzhangqi; diff --git a/src/components/iconfont/rn/IconBianji.js b/src/components/iconfont/rn/IconBianji.js deleted file mode 100644 index 15090c1..0000000 --- a/src/components/iconfont/rn/IconBianji.js +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconBianji = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconBianji.defaultProps = { - size: 18, -}; - -IconBianji = React.memo ? React.memo(IconBianji) : IconBianji; - -export default IconBianji; diff --git a/src/components/iconfont/rn/IconBianjizidingyimadan.js b/src/components/iconfont/rn/IconBianjizidingyimadan.js deleted file mode 100644 index 46da4b8..0000000 --- a/src/components/iconfont/rn/IconBianjizidingyimadan.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconBianjizidingyimadan = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconBianjizidingyimadan.defaultProps = { - size: 18, -}; - -IconBianjizidingyimadan = React.memo ? React.memo(IconBianjizidingyimadan) : IconBianjizidingyimadan; - -export default IconBianjizidingyimadan; diff --git a/src/components/iconfont/rn/IconDaifahuo2.js b/src/components/iconfont/rn/IconDaifahuo2.js deleted file mode 100644 index a215615..0000000 --- a/src/components/iconfont/rn/IconDaifahuo2.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconDaifahuo2 = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconDaifahuo2.defaultProps = { - size: 18, -}; - -IconDaifahuo2 = React.memo ? React.memo(IconDaifahuo2) : IconDaifahuo2; - -export default IconDaifahuo2; diff --git a/src/components/iconfont/rn/IconDaifukuan2.js b/src/components/iconfont/rn/IconDaifukuan2.js deleted file mode 100644 index b774be2..0000000 --- a/src/components/iconfont/rn/IconDaifukuan2.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconDaifukuan2 = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconDaifukuan2.defaultProps = { - size: 18, -}; - -IconDaifukuan2 = React.memo ? React.memo(IconDaifukuan2) : IconDaifukuan2; - -export default IconDaifukuan2; diff --git a/src/components/iconfont/rn/IconDaipeibu2.js b/src/components/iconfont/rn/IconDaipeibu2.js deleted file mode 100644 index 417756b..0000000 --- a/src/components/iconfont/rn/IconDaipeibu2.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconDaipeibu2 = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconDaipeibu2.defaultProps = { - size: 18, -}; - -IconDaipeibu2 = React.memo ? React.memo(IconDaipeibu2) : IconDaipeibu2; - -export default IconDaipeibu2; diff --git a/src/components/iconfont/rn/IconDaishouhuo2.js b/src/components/iconfont/rn/IconDaishouhuo2.js deleted file mode 100644 index 0d27d63..0000000 --- a/src/components/iconfont/rn/IconDaishouhuo2.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconDaishouhuo2 = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconDaishouhuo2.defaultProps = { - size: 18, -}; - -IconDaishouhuo2 = React.memo ? React.memo(IconDaishouhuo2) : IconDaishouhuo2; - -export default IconDaishouhuo2; diff --git a/src/components/iconfont/rn/IconDianjishoucang.js b/src/components/iconfont/rn/IconDianjishoucang.js deleted file mode 100644 index 8b6bd5f..0000000 --- a/src/components/iconfont/rn/IconDianjishoucang.js +++ /dev/null @@ -1,35 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconDianjishoucang = ({ size, color, ...rest }) => { - return ( - - - - - - ); -}; - -IconDianjishoucang.defaultProps = { - size: 18, -}; - -IconDianjishoucang = React.memo ? React.memo(IconDianjishoucang) : IconDianjishoucang; - -export default IconDianjishoucang; diff --git a/src/components/iconfont/rn/IconErweima.js b/src/components/iconfont/rn/IconErweima.js deleted file mode 100644 index 6afacad..0000000 --- a/src/components/iconfont/rn/IconErweima.js +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconErweima = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconErweima.defaultProps = { - size: 18, -}; - -IconErweima = React.memo ? React.memo(IconErweima) : IconErweima; - -export default IconErweima; diff --git a/src/components/iconfont/rn/IconFenxiangshangpin.js b/src/components/iconfont/rn/IconFenxiangshangpin.js deleted file mode 100644 index deca92e..0000000 --- a/src/components/iconfont/rn/IconFenxiangshangpin.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconFenxiangshangpin = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconFenxiangshangpin.defaultProps = { - size: 18, -}; - -IconFenxiangshangpin = React.memo ? React.memo(IconFenxiangshangpin) : IconFenxiangshangpin; - -export default IconFenxiangshangpin; diff --git a/src/components/iconfont/rn/IconGongnengtubiaoSaomiao.js b/src/components/iconfont/rn/IconGongnengtubiaoSaomiao.js deleted file mode 100644 index 1af35c5..0000000 --- a/src/components/iconfont/rn/IconGongnengtubiaoSaomiao.js +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconGongnengtubiaoSaomiao = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconGongnengtubiaoSaomiao.defaultProps = { - size: 18, -}; - -IconGongnengtubiaoSaomiao = React.memo ? React.memo(IconGongnengtubiaoSaomiao) : IconGongnengtubiaoSaomiao; - -export default IconGongnengtubiaoSaomiao; diff --git a/src/components/iconfont/rn/IconGouwuche.js b/src/components/iconfont/rn/IconGouwuche.js deleted file mode 100644 index 8d86366..0000000 --- a/src/components/iconfont/rn/IconGouwuche.js +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconGouwuche = ({ size, color, ...rest }) => { - return ( - - - - - - ); -}; - -IconGouwuche.defaultProps = { - size: 18, -}; - -IconGouwuche = React.memo ? React.memo(IconGouwuche) : IconGouwuche; - -export default IconGouwuche; diff --git a/src/components/iconfont/rn/IconGuanli.js b/src/components/iconfont/rn/IconGuanli.js deleted file mode 100644 index 1b00afc..0000000 --- a/src/components/iconfont/rn/IconGuanli.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconGuanli = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconGuanli.defaultProps = { - size: 18, -}; - -IconGuanli = React.memo ? React.memo(IconGuanli) : IconGuanli; - -export default IconGuanli; diff --git a/src/components/iconfont/rn/IconHuodaofukuan.js b/src/components/iconfont/rn/IconHuodaofukuan.js deleted file mode 100644 index adade31..0000000 --- a/src/components/iconfont/rn/IconHuodaofukuan.js +++ /dev/null @@ -1,36 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconHuodaofukuan = ({ size, color, ...rest }) => { - return ( - - - - - - - ); -}; - -IconHuodaofukuan.defaultProps = { - size: 18, -}; - -IconHuodaofukuan = React.memo ? React.memo(IconHuodaofukuan) : IconHuodaofukuan; - -export default IconHuodaofukuan; diff --git a/src/components/iconfont/rn/IconHuozhuziti.js b/src/components/iconfont/rn/IconHuozhuziti.js deleted file mode 100644 index 238a5a1..0000000 --- a/src/components/iconfont/rn/IconHuozhuziti.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconHuozhuziti = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconHuozhuziti.defaultProps = { - size: 18, -}; - -IconHuozhuziti = React.memo ? React.memo(IconHuozhuziti) : IconHuozhuziti; - -export default IconHuozhuziti; diff --git a/src/components/iconfont/rn/IconJianshaoanniu.js b/src/components/iconfont/rn/IconJianshaoanniu.js deleted file mode 100644 index ad32208..0000000 --- a/src/components/iconfont/rn/IconJianshaoanniu.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconJianshaoanniu = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconJianshaoanniu.defaultProps = { - size: 18, -}; - -IconJianshaoanniu = React.memo ? React.memo(IconJianshaoanniu) : IconJianshaoanniu; - -export default IconJianshaoanniu; diff --git a/src/components/iconfont/rn/IconKefu.js b/src/components/iconfont/rn/IconKefu.js deleted file mode 100644 index 4418458..0000000 --- a/src/components/iconfont/rn/IconKefu.js +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconKefu = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconKefu.defaultProps = { - size: 18, -}; - -IconKefu = React.memo ? React.memo(IconKefu) : IconKefu; - -export default IconKefu; diff --git a/src/components/iconfont/rn/IconQingchusousuo.js b/src/components/iconfont/rn/IconQingchusousuo.js deleted file mode 100644 index b992d1b..0000000 --- a/src/components/iconfont/rn/IconQingchusousuo.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconQingchusousuo = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconQingchusousuo.defaultProps = { - size: 18, -}; - -IconQingchusousuo = React.memo ? React.memo(IconQingchusousuo) : IconQingchusousuo; - -export default IconQingchusousuo; diff --git a/src/components/iconfont/rn/IconQingchuxinxi.js b/src/components/iconfont/rn/IconQingchuxinxi.js deleted file mode 100644 index 0604fa9..0000000 --- a/src/components/iconfont/rn/IconQingchuxinxi.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconQingchuxinxi = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconQingchuxinxi.defaultProps = { - size: 18, -}; - -IconQingchuxinxi = React.memo ? React.memo(IconQingchuxinxi) : IconQingchuxinxi; - -export default IconQingchuxinxi; diff --git a/src/components/iconfont/rn/IconRiqi.js b/src/components/iconfont/rn/IconRiqi.js deleted file mode 100644 index d56a3d9..0000000 --- a/src/components/iconfont/rn/IconRiqi.js +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconRiqi = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconRiqi.defaultProps = { - size: 18, -}; - -IconRiqi = React.memo ? React.memo(IconRiqi) : IconRiqi; - -export default IconRiqi; diff --git a/src/components/iconfont/rn/IconSaomazhifu.js b/src/components/iconfont/rn/IconSaomazhifu.js deleted file mode 100644 index 5dead39..0000000 --- a/src/components/iconfont/rn/IconSaomazhifu.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconSaomazhifu = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconSaomazhifu.defaultProps = { - size: 18, -}; - -IconSaomazhifu = React.memo ? React.memo(IconSaomazhifu) : IconSaomazhifu; - -export default IconSaomazhifu; diff --git a/src/components/iconfont/rn/IconShangla.js b/src/components/iconfont/rn/IconShangla.js deleted file mode 100644 index 74f2945..0000000 --- a/src/components/iconfont/rn/IconShangla.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconShangla = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconShangla.defaultProps = { - size: 18, -}; - -IconShangla = React.memo ? React.memo(IconShangla) : IconShangla; - -export default IconShangla; diff --git a/src/components/iconfont/rn/IconShezhi.js b/src/components/iconfont/rn/IconShezhi.js deleted file mode 100644 index 103c4f1..0000000 --- a/src/components/iconfont/rn/IconShezhi.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconShezhi = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconShezhi.defaultProps = { - size: 18, -}; - -IconShezhi = React.memo ? React.memo(IconShezhi) : IconShezhi; - -export default IconShezhi; diff --git a/src/components/iconfont/rn/IconShoucangchenggong.js b/src/components/iconfont/rn/IconShoucangchenggong.js deleted file mode 100644 index 1e35e46..0000000 --- a/src/components/iconfont/rn/IconShoucangchenggong.js +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconShoucangchenggong = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconShoucangchenggong.defaultProps = { - size: 18, -}; - -IconShoucangchenggong = React.memo ? React.memo(IconShoucangchenggong) : IconShoucangchenggong; - -export default IconShoucangchenggong; diff --git a/src/components/iconfont/rn/IconShoucangjia.js b/src/components/iconfont/rn/IconShoucangjia.js deleted file mode 100644 index 814c3b6..0000000 --- a/src/components/iconfont/rn/IconShoucangjia.js +++ /dev/null @@ -1,40 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconShoucangjia = ({ size, color, ...rest }) => { - return ( - - - - - - - - ); -}; - -IconShoucangjia.defaultProps = { - size: 18, -}; - -IconShoucangjia = React.memo ? React.memo(IconShoucangjia) : IconShoucangjia; - -export default IconShoucangjia; diff --git a/src/components/iconfont/rn/IconShuru.js b/src/components/iconfont/rn/IconShuru.js deleted file mode 100644 index df57a4b..0000000 --- a/src/components/iconfont/rn/IconShuru.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconShuru = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconShuru.defaultProps = { - size: 18, -}; - -IconShuru = React.memo ? React.memo(IconShuru) : IconShuru; - -export default IconShuru; diff --git a/src/components/iconfont/rn/IconSousuo.js b/src/components/iconfont/rn/IconSousuo.js deleted file mode 100644 index c143819..0000000 --- a/src/components/iconfont/rn/IconSousuo.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconSousuo = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconSousuo.defaultProps = { - size: 18, -}; - -IconSousuo = React.memo ? React.memo(IconSousuo) : IconSousuo; - -export default IconSousuo; diff --git a/src/components/iconfont/rn/IconTishi.js b/src/components/iconfont/rn/IconTishi.js deleted file mode 100644 index 9920767..0000000 --- a/src/components/iconfont/rn/IconTishi.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconTishi = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconTishi.defaultProps = { - size: 18, -}; - -IconTishi = React.memo ? React.memo(IconTishi) : IconTishi; - -export default IconTishi; diff --git a/src/components/iconfont/rn/IconTuikuanShouhou.js b/src/components/iconfont/rn/IconTuikuanShouhou.js deleted file mode 100644 index cd0b337..0000000 --- a/src/components/iconfont/rn/IconTuikuanShouhou.js +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconTuikuanShouhou = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconTuikuanShouhou.defaultProps = { - size: 18, -}; - -IconTuikuanShouhou = React.memo ? React.memo(IconTuikuanShouhou) : IconTuikuanShouhou; - -export default IconTuikuanShouhou; diff --git a/src/components/iconfont/rn/IconXiala.js b/src/components/iconfont/rn/IconXiala.js deleted file mode 100644 index 9917565..0000000 --- a/src/components/iconfont/rn/IconXiala.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconXiala = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconXiala.defaultProps = { - size: 18, -}; - -IconXiala = React.memo ? React.memo(IconXiala) : IconXiala; - -export default IconXiala; diff --git a/src/components/iconfont/rn/IconXianxiahuikuan.js b/src/components/iconfont/rn/IconXianxiahuikuan.js deleted file mode 100644 index b7ddd4b..0000000 --- a/src/components/iconfont/rn/IconXianxiahuikuan.js +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconXianxiahuikuan = ({ size, color, ...rest }) => { - return ( - - - - - - ); -}; - -IconXianxiahuikuan.defaultProps = { - size: 18, -}; - -IconXianxiahuikuan = React.memo ? React.memo(IconXianxiahuikuan) : IconXianxiahuikuan; - -export default IconXianxiahuikuan; diff --git a/src/components/iconfont/rn/IconXinzenganniu.js b/src/components/iconfont/rn/IconXinzenganniu.js deleted file mode 100644 index 1ca8aaf..0000000 --- a/src/components/iconfont/rn/IconXinzenganniu.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconXinzenganniu = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconXinzenganniu.defaultProps = { - size: 18, -}; - -IconXinzenganniu = React.memo ? React.memo(IconXinzenganniu) : IconXinzenganniu; - -export default IconXinzenganniu; diff --git a/src/components/iconfont/rn/IconXinzengshoucangjia.js b/src/components/iconfont/rn/IconXinzengshoucangjia.js deleted file mode 100644 index 0761d9c..0000000 --- a/src/components/iconfont/rn/IconXinzengshoucangjia.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconXinzengshoucangjia = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconXinzengshoucangjia.defaultProps = { - size: 18, -}; - -IconXinzengshoucangjia = React.memo ? React.memo(IconXinzengshoucangjia) : IconXinzengshoucangjia; - -export default IconXinzengshoucangjia; diff --git a/src/components/iconfont/rn/IconXuanzechenggong.js b/src/components/iconfont/rn/IconXuanzechenggong.js deleted file mode 100644 index 4a6d373..0000000 --- a/src/components/iconfont/rn/IconXuanzechenggong.js +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconXuanzechenggong = ({ size, color, ...rest }) => { - return ( - - - - ); -}; - -IconXuanzechenggong.defaultProps = { - size: 18, -}; - -IconXuanzechenggong = React.memo ? React.memo(IconXuanzechenggong) : IconXuanzechenggong; - -export default IconXuanzechenggong; diff --git a/src/components/iconfont/rn/IconYuanshimadanyulan.js b/src/components/iconfont/rn/IconYuanshimadanyulan.js deleted file mode 100644 index 56d007c..0000000 --- a/src/components/iconfont/rn/IconYuanshimadanyulan.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconYuanshimadanyulan = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconYuanshimadanyulan.defaultProps = { - size: 18, -}; - -IconYuanshimadanyulan = React.memo ? React.memo(IconYuanshimadanyulan) : IconYuanshimadanyulan; - -export default IconYuanshimadanyulan; diff --git a/src/components/iconfont/rn/IconYufukuan.js b/src/components/iconfont/rn/IconYufukuan.js deleted file mode 100644 index e3e03ca..0000000 --- a/src/components/iconfont/rn/IconYufukuan.js +++ /dev/null @@ -1,33 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconYufukuan = ({ size, color, ...rest }) => { - return ( - - - - - - ); -}; - -IconYufukuan.defaultProps = { - size: 18, -}; - -IconYufukuan = React.memo ? React.memo(IconYufukuan) : IconYufukuan; - -export default IconYufukuan; diff --git a/src/components/iconfont/rn/IconZidingyimadanyulan.js b/src/components/iconfont/rn/IconZidingyimadanyulan.js deleted file mode 100644 index 396900a..0000000 --- a/src/components/iconfont/rn/IconZidingyimadanyulan.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; -import { Svg, Path } from 'react-native-svg'; -import { getIconColor } from './helper'; - -let IconZidingyimadanyulan = ({ size, color, ...rest }) => { - return ( - - - - - ); -}; - -IconZidingyimadanyulan.defaultProps = { - size: 18, -}; - -IconZidingyimadanyulan = React.memo ? React.memo(IconZidingyimadanyulan) : IconZidingyimadanyulan; - -export default IconZidingyimadanyulan; diff --git a/src/components/iconfont/rn/helper.js b/src/components/iconfont/rn/helper.js deleted file mode 100644 index b566c4c..0000000 --- a/src/components/iconfont/rn/helper.js +++ /dev/null @@ -1,17 +0,0 @@ -/* 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 deleted file mode 100644 index d06d167..0000000 --- a/src/components/iconfont/rn/index.js +++ /dev/null @@ -1,163 +0,0 @@ -/* eslint-disable */ - -import React from 'react'; - -import IconRiqi from './IconRiqi'; -import IconShuru from './IconShuru'; -import IconA0Tianzhangqi from './IconA0Tianzhangqi'; -import IconHuodaofukuan from './IconHuodaofukuan'; -import IconHuozhuziti from './IconHuozhuziti'; -import IconSaomazhifu from './IconSaomazhifu'; -import IconXianxiahuikuan from './IconXianxiahuikuan'; -import IconYufukuan from './IconYufukuan'; -import IconXinzengshoucangjia from './IconXinzengshoucangjia'; -import IconQingchusousuo from './IconQingchusousuo'; -import IconXuanzechenggong from './IconXuanzechenggong'; -import IconGongnengtubiaoSaomiao from './IconGongnengtubiaoSaomiao'; -import IconBianjizidingyimadan from './IconBianjizidingyimadan'; -import IconZidingyimadanyulan from './IconZidingyimadanyulan'; -import IconYuanshimadanyulan from './IconYuanshimadanyulan'; -import IconXiala from './IconXiala'; -import IconShangla from './IconShangla'; -import IconQingchuxinxi from './IconQingchuxinxi'; -import IconSousuo from './IconSousuo'; -import IconGuanli from './IconGuanli'; -import IconBianji from './IconBianji'; -import IconShoucangjia from './IconShoucangjia'; -import IconShezhi from './IconShezhi'; -import IconTishi from './IconTishi'; -import IconErweima from './IconErweima'; -import IconDianjishoucang from './IconDianjishoucang'; -import IconGouwuche from './IconGouwuche'; -import IconShoucangchenggong from './IconShoucangchenggong'; -import IconFenxiangshangpin from './IconFenxiangshangpin'; -import IconKefu from './IconKefu'; -import IconXinzenganniu from './IconXinzenganniu'; -import IconJianshaoanniu from './IconJianshaoanniu'; -import IconDaifahuo2 from './IconDaifahuo2'; -import IconDaishouhuo2 from './IconDaishouhuo2'; -import IconTuikuanShouhou from './IconTuikuanShouhou'; -import IconDaipeibu2 from './IconDaipeibu2'; -import IconDaifukuan2 from './IconDaifukuan2'; -export { default as IconRiqi } from './IconRiqi'; -export { default as IconShuru } from './IconShuru'; -export { default as IconA0Tianzhangqi } from './IconA0Tianzhangqi'; -export { default as IconHuodaofukuan } from './IconHuodaofukuan'; -export { default as IconHuozhuziti } from './IconHuozhuziti'; -export { default as IconSaomazhifu } from './IconSaomazhifu'; -export { default as IconXianxiahuikuan } from './IconXianxiahuikuan'; -export { default as IconYufukuan } from './IconYufukuan'; -export { default as IconXinzengshoucangjia } from './IconXinzengshoucangjia'; -export { default as IconQingchusousuo } from './IconQingchusousuo'; -export { default as IconXuanzechenggong } from './IconXuanzechenggong'; -export { default as IconGongnengtubiaoSaomiao } from './IconGongnengtubiaoSaomiao'; -export { default as IconBianjizidingyimadan } from './IconBianjizidingyimadan'; -export { default as IconZidingyimadanyulan } from './IconZidingyimadanyulan'; -export { default as IconYuanshimadanyulan } from './IconYuanshimadanyulan'; -export { default as IconXiala } from './IconXiala'; -export { default as IconShangla } from './IconShangla'; -export { default as IconQingchuxinxi } from './IconQingchuxinxi'; -export { default as IconSousuo } from './IconSousuo'; -export { default as IconGuanli } from './IconGuanli'; -export { default as IconBianji } from './IconBianji'; -export { default as IconShoucangjia } from './IconShoucangjia'; -export { default as IconShezhi } from './IconShezhi'; -export { default as IconTishi } from './IconTishi'; -export { default as IconErweima } from './IconErweima'; -export { default as IconDianjishoucang } from './IconDianjishoucang'; -export { default as IconGouwuche } from './IconGouwuche'; -export { default as IconShoucangchenggong } from './IconShoucangchenggong'; -export { default as IconFenxiangshangpin } from './IconFenxiangshangpin'; -export { default as IconKefu } from './IconKefu'; -export { default as IconXinzenganniu } from './IconXinzenganniu'; -export { default as IconJianshaoanniu } from './IconJianshaoanniu'; -export { default as IconDaifahuo2 } from './IconDaifahuo2'; -export { default as IconDaishouhuo2 } from './IconDaishouhuo2'; -export { default as IconTuikuanShouhou } from './IconTuikuanShouhou'; -export { default as IconDaipeibu2 } from './IconDaipeibu2'; -export { default as IconDaifukuan2 } from './IconDaifukuan2'; - -let IconFont = ({ name, ...rest }) => { - switch (name) { - case 'riqi': - return ; - case 'shuru': - return ; - case 'a-0tianzhangqi': - return ; - case 'huodaofukuan': - return ; - case 'huozhuziti': - return ; - case 'saomazhifu': - return ; - case 'xianxiahuikuan': - return ; - case 'yufukuan': - return ; - case 'xinzengshoucangjia': - return ; - case 'qingchusousuo': - return ; - case 'xuanzechenggong': - return ; - case 'gongnengtubiao-saomiao': - return ; - case 'bianjizidingyimadan': - return ; - case 'zidingyimadanyulan': - return ; - case 'yuanshimadanyulan': - return ; - case 'xiala': - return ; - case 'shangla': - return ; - case 'qingchuxinxi': - return ; - case 'sousuo': - return ; - case 'guanli': - return ; - case 'bianji': - return ; - case 'shoucangjia': - return ; - case 'shezhi': - return ; - case 'tishi': - return ; - case 'erweima': - return ; - case 'dianjishoucang': - return ; - case 'gouwuche': - return ; - case 'shoucangchenggong': - return ; - case 'fenxiangshangpin': - return ; - case 'kefu': - return ; - case 'xinzenganniu': - return ; - case 'jianshaoanniu': - return ; - case 'daifahuo2': - return ; - case 'daishouhuo2': - return ; - case 'tuikuan-shouhou': - return ; - case 'daipeibu2': - return ; - case 'daifukuan2': - 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 deleted file mode 100644 index 9f68d1a..0000000 --- a/src/components/iconfont/swan/swan.css +++ /dev/null @@ -1,3 +0,0 @@ -.icon { - background-repeat: no-repeat; -} diff --git a/src/components/iconfont/swan/swan.js b/src/components/iconfont/swan/swan.js deleted file mode 100644 index 2f8833b..0000000 --- a/src/components/iconfont/swan/swan.js +++ /dev/null @@ -1,64 +0,0 @@ -Component({ - properties: { - // riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 - 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 deleted file mode 100644 index a89ef4d..0000000 --- a/src/components/iconfont/swan/swan.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} diff --git a/src/components/iconfont/swan/swan.swan b/src/components/iconfont/swan/swan.swan deleted file mode 100644 index 7e27b16..0000000 --- a/src/components/iconfont/swan/swan.swan +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/components/iconfont/tt/tt.js b/src/components/iconfont/tt/tt.js deleted file mode 100644 index 045bc05..0000000 --- a/src/components/iconfont/tt/tt.js +++ /dev/null @@ -1,64 +0,0 @@ -Component({ - properties: { - // riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 - 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 deleted file mode 100644 index 467ce29..0000000 --- a/src/components/iconfont/tt/tt.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/components/iconfont/tt/tt.ttml b/src/components/iconfont/tt/tt.ttml deleted file mode 100644 index ec8ba24..0000000 --- a/src/components/iconfont/tt/tt.ttml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/components/iconfont/tt/tt.ttss b/src/components/iconfont/tt/tt.ttss deleted file mode 100644 index 9f68d1a..0000000 --- a/src/components/iconfont/tt/tt.ttss +++ /dev/null @@ -1,3 +0,0 @@ -.icon { - background-repeat: no-repeat; -} diff --git a/src/components/iconfont/weapp/weapp.js b/src/components/iconfont/weapp/weapp.js deleted file mode 100644 index 4b0fbe4..0000000 --- a/src/components/iconfont/weapp/weapp.js +++ /dev/null @@ -1,63 +0,0 @@ -Component({ - properties: { - // riqi | shuru | a-0tianzhangqi | huodaofukuan | huozhuziti | saomazhifu | xianxiahuikuan | yufukuan | xinzengshoucangjia | qingchusousuo | xuanzechenggong | gongnengtubiao-saomiao | bianjizidingyimadan | zidingyimadanyulan | yuanshimadanyulan | xiala | shangla | qingchuxinxi | sousuo | guanli | bianji | shoucangjia | shezhi | tishi | erweima | dianjishoucang | gouwuche | shoucangchenggong | fenxiangshangpin | kefu | xinzenganniu | jianshaoanniu | daifahuo2 | daishouhuo2 | tuikuan-shouhou | daipeibu2 | daifukuan2 - name: { - type: String, - }, - // string | string[] - color: { - type: null, - 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 * wx.getSystemInfoSync().windowWidth, - }); - }, - }, - }, - data: { - colors: '', - svgSize: 18 / 750 * wx.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/weapp/weapp.json b/src/components/iconfont/weapp/weapp.json deleted file mode 100644 index a89ef4d..0000000 --- a/src/components/iconfont/weapp/weapp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} diff --git a/src/components/iconfont/weapp/weapp.wxml b/src/components/iconfont/weapp/weapp.wxml deleted file mode 100644 index e57bbc6..0000000 --- a/src/components/iconfont/weapp/weapp.wxml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/components/iconfont/weapp/weapp.wxss b/src/components/iconfont/weapp/weapp.wxss deleted file mode 100644 index 9f68d1a..0000000 --- a/src/components/iconfont/weapp/weapp.wxss +++ /dev/null @@ -1,3 +0,0 @@ -.icon { - background-repeat: no-repeat; -} diff --git a/src/components/infiniteScroll/index.tsx b/src/components/infiniteScroll/index.tsx index a68b582..b432d5c 100644 --- a/src/components/infiniteScroll/index.tsx +++ b/src/components/infiniteScroll/index.tsx @@ -1,19 +1,20 @@ import { ScrollView, View } from '@tarojs/components' import type { ReactNode } from 'react' -import { memo, useMemo, useState } from 'react' +import React, { memo, useMemo, useState } from 'react' import LoadingCard from '../loadingCard' import style from './index.module.scss' import DotLoading from '@/components/dotLoading' -import Empty from '../empty' +import Empty from '@/components/empty' import { SEARCH_EMPTY_IMAGE } from '@/common/constant' -export type StatusParam = 0|1|2|3 +export type StatusParam = 0 | 1 | 2 | 3 interface Params { - styleObj?: Object + styleObj?: React.CSSProperties selfonScrollToLower?: () => void - hasMore?: false|true - moreStatus?: false|true + enableLoadMoreStatus?: boolean + safeAreaInsetBottom?: boolean + moreStatus?: boolean statusMore?: StatusParam // 0:数据从无到有加载数据,1,没有任何数据, 2:下拉加载,3:下拉没有数据 children?: ReactNode lowerThresholdNum?: number @@ -26,7 +27,11 @@ interface Params { paddingBottom?: number refresherTriggered?: boolean refresherEnabled?: boolean + enableBackToTop?: boolean emptySlot?: React.ReactNode + moreText?: string + loadingText?: string + noMoreText?: string } const InfiniteScroll = ({ styleObj, @@ -37,7 +42,8 @@ const InfiniteScroll = ({ selfOnRefresherRefresh, selfOnRefresherRestore, selfOnRefresherAbort, - emptySlot, + safeAreaInsetBottom = true, + enableLoadMoreStatus = true, children, lowerThresholdNum = 5, paddingBottom = 0, @@ -45,6 +51,8 @@ const InfiniteScroll = ({ refresherEnabled = false, moreStatus = true, statusMore = 0, + enableBackToTop = true, + emptySlot, }: Params) => { const scrollToLower = () => { selfonScrollToLower?.() @@ -75,9 +83,54 @@ const InfiniteScroll = ({ } }, [statusMore]) + const component = () => { + if (enableLoadMoreStatus) { + if (!moreStatus) { + return ( + + {children} + + ) + } + else { + return ( + <> + {(statusMore == 2 || statusMore == 3) && ( + + {children} + + {statusMore == 2 + ? ( + + 加载中 + + + ) + : ( + 没有更多数据了 + )} + + + )} + {statusMore == 0 && } + {statusMore == 1 && (emptySlot || )} + + ) + } + } + else { + return ( + + {children} + + ) + } + } + return ( <> refresherRestore()} onRefresherAbort={() => refresherAbort()} refresherBackground="#F8F8F8" + enableBackToTop={enableBackToTop} scrollTop={scrollTop} > - {!moreStatus - ? <> - - {children} - - - : <> - {(statusMore == 2 || statusMore == 3) && - {children} - - { - (statusMore == 2) - ? 加载中 - : 没有更多数据了 - } - - - } - {(statusMore == 0) && } - {statusMore == 1 && (emptySlot || )} - } - - + {component()} + {safeAreaInsetBottom && } ) } -export default memo(InfiniteScroll) +export default memo( + InfiniteScroll, +) diff --git a/src/components/table/index.module.scss b/src/components/table/index.module.scss new file mode 100644 index 0000000..9f35e98 --- /dev/null +++ b/src/components/table/index.module.scss @@ -0,0 +1,50 @@ +.table { + border: 0px solid darkgray; + border-radius: 5px; + font-size: 22px; + color: #333; +} + +.tr { + display: flex; + width: 100%; + justify-content: center; + align-items: center; + padding: 12px 0; + border-bottom: 1px solid #f7f7f7; +} + +.td { + justify-content: center; + text-align: center; + align-items: center; + display: flex; + font-size: 26px; +} + +.th{ + font-size: 26px; +} + +.bg-line { + background: #fff; +} + +.bg-header { + justify-content: center; + background: #f6f7fb; + color: $color_font_three; + display: flex; + align-items: center; + text-align: center; + border-radius: 8px; +} + +.ellipsis_1{ + @include common_ellipsis(1) +} +.ellipsis_2{ + @include common_ellipsis(2) +} + + diff --git a/src/components/table/index.tsx b/src/components/table/index.tsx new file mode 100644 index 0000000..fded4e3 --- /dev/null +++ b/src/components/table/index.tsx @@ -0,0 +1,128 @@ +import { ScrollView, Text, View } from '@tarojs/components' +import classnames from 'classnames' +import type { FC } from 'react' +import { useCallback, useMemo, useState } from 'react' +import Iconfont from '../iconfont/iconfont' +import InfiniteScroll from '../infiniteScroll' +import LoadMore, { LoadMoreStatus } from '../LoadMore' +import styles from './index.module.scss' + +export interface ColumnsType { + title: string + dataIndex: string + width: string + key: string + render?: (text?: string, record?: RecordType, index?: number) => React.ReactNode + ellipsis?: boolean | { isEllipsis: boolean; rows: number } +} + +export interface RecordType { + key: string + [Property: string]: any +} + +export interface TablePropsType { + columns: ColumnsType[] + dataSource?: { list: RecordType[]; total: number } + onLoadMore?: () => void + height?: number + moreText?: string + loadingText?: string + noMoreText?: string + emptyText?: string + safeAreaInsetBottom?: boolean +} + +const Table: FC = (props) => { + const { columns, dataSource, onLoadMore, height = 400, moreText = '查看更多', loadingText = '加载中', noMoreText = '没有更多了', emptyText = '暂无数据', safeAreaInsetBottom = true } = props + + const handleShowMore = () => { + onLoadMore && onLoadMore() + } + + const getColumnStyle = useCallback((columnConfig: ColumnsType) => { + const columnStyle = {} + if (typeof columnConfig.ellipsis === 'boolean' && columnConfig.ellipsis) { + columnStyle[styles.ellipsis_1] = true + } + if (typeof columnConfig.ellipsis === 'object' && columnConfig.ellipsis.isEllipsis) { + const rows = columnConfig.ellipsis.rows + if (rows === 2) { + columnStyle[styles.ellipsis_2] = true + } + else { + columnStyle[styles.ellipsis_1] = true + } + } + return columnStyle + }, []) + + const loadMoreComponent = useMemo(() => { + if (dataSource) { + if (dataSource.list.length === 0 && dataSource.list.length === dataSource.total) { + return + } + else if (dataSource.list.length < dataSource.total) { + return + } + else if (dataSource.list.length >= dataSource.total) { + return + } + } + else { + return + } + }, [dataSource]) + + const sourceContainer = () => { + return ( + <> + {!!dataSource?.list?.length + && dataSource.list.map((source) => { + return ( + + {columns.map((column, key) => { + if (column.render) { + return ( + + {/* 判断表头是不是有render 有就执行render */} + {column.render(source[column.dataIndex])} + + ) + } + else { + return ( + + { + source[column.dataIndex] // 根据表头填数据 + } + + ) + } + })} + + ) + })} + {loadMoreComponent} + + ) + } + + return ( + + + {columns.map((column) => { + return ( + + {column.title} + + ) + })} + + + {sourceContainer()} + + + ) +} +export default Table diff --git a/src/pages/bindSalesman/component/successBind/index.module.scss b/src/pages/bindSalesman/component/successBind/index.module.scss deleted file mode 100644 index 2d3c1c6..0000000 --- a/src/pages/bindSalesman/component/successBind/index.module.scss +++ /dev/null @@ -1,62 +0,0 @@ -.bindSalesman_main{ - width: 100%; - height: 100vh; - position: fixed; - left:0; - top:0; - .bindSalesman_pop{ - width: 654px; - height: 560px; - border-radius: 40px; - display: flex; - flex-direction: column; - align-items: center; - position:absolute; - margin:auto; - left: 0; - right: 0; - bottom: 0; - top: 0; - bottom: 0; - z-index: 1999; - .bindSalesman_header{ - width: 654px; - position: relative; - image{ - width: 100%; - height: 100%; - border-radius: 40px 40px 0 0; - } - .sale_man{ - color: #fff; - text-align: center; - font-size: 26px; - position: absolute; - margin: auto; - left: 0; - right: 0; - bottom: 60px; - height: 100px; - line-height: 100px; - } - } - .btns{ - width: 488px; - height: 104px; - margin: 50px; - image{ - width: 100%; - } - } - } - .bindSalesman_mask{ - z-index: 99; - position: absolute; - left:0; - top:0; - width: 100%; - height: 100%; - opacity: 0.8; - background: #000000; - } -} \ No newline at end of file diff --git a/src/pages/bindSalesman/component/successBind/index.tsx b/src/pages/bindSalesman/component/successBind/index.tsx deleted file mode 100644 index c74c8ee..0000000 --- a/src/pages/bindSalesman/component/successBind/index.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { Image, Swiper, SwiperItem, Text, View } from '@tarojs/components' -import Taro from '@tarojs/taro' -import { useEffect, useState } from 'react' -import styles from './index.module.scss' -import { formatImgUrl } from '@/common/fotmat' -import { goLink } from '@/common/common' -import CloseBtn from '@/components/closeBtn' - -interface params { - show?: true|false - onClose?: () => void - saleMan?: string -} -const SuccessBind = ({ show = false, saleMan = '', onClose }: params) => { - const onClick = async() => { - onClose?.() - goLink('/pages/index/index', {}, 'switchTab') - } - const onCloseEven = () => { - onClose?.() - } - return ( - <> - {show && - - onClick()}> - - 邀请人: {saleMan} - - - onClick()} /> - - - - - } - - ) -} - -export default SuccessBind diff --git a/src/pages/bindSalesman/index.config.ts b/src/pages/bindSalesman/index.config.ts deleted file mode 100644 index 3f25181..0000000 --- a/src/pages/bindSalesman/index.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - navigationBarTitleText: '邀请码', - enableShareAppMessage: true, -} diff --git a/src/pages/bindSalesman/index.module.scss b/src/pages/bindSalesman/index.module.scss deleted file mode 100644 index 9d930a3..0000000 --- a/src/pages/bindSalesman/index.module.scss +++ /dev/null @@ -1,83 +0,0 @@ -.bindSalesmanPage_main{ - display: flex; - flex-direction: column; - align-items: center; - .header_image{ - width: 240px; - height: 188px; - padding: 50px 0; - image{ - width: 100%; - height: 100%; - } - } - .salesman_name{ - font-size: 30px; - color: #007AFF; - box-sizing: border-box; - padding-top: 50px; - text{ - &:nth-child(2) { - margin-left: 20px; - } - } - } - .inputCode{ - width: 670px; - height: 106px; - background: #f6f6f6; - border: 2px solid #f0f0f0; - border-radius: 20px; - display: flex; - align-items: center; - padding: 20px 0 20px 30px; - box-sizing: border-box; - position: relative; - input{ - flex:1; - z-index: 0; - } - .scan_code{ - width: 101px; - height: 100%; - display: flex; - justify-content: center; - align-items: center; - border-left: 1PX solid #ccc; - .miconfont{ - font-size: 50px; - color: #007AFF; - } - } - .close_btn{ - padding: 0 20px; - } - } - .btns{ - width: 670px; - height: 90px; - opacity: 0.6; - background: linear-gradient(41deg,#007aff, #3a9bfd 86%, #4ba2fa 100%); - border-radius: 46px; - text-align: center; - line-height: 90px; - color: #fff; - margin-top: 50px; - } - .select_btns{ - opacity: 1; - } - .message{ - padding: 150px 30px 20px 30px; - color: #ABABAB; - font-size: 28px; - text{ - display: block; - margin-bottom: 30px; - &:nth-child(1) { - text-align: center; - font-weight: 700; - } - } - } -} \ No newline at end of file diff --git a/src/pages/bindSalesman/index.tsx b/src/pages/bindSalesman/index.tsx deleted file mode 100644 index 1a20bf7..0000000 --- a/src/pages/bindSalesman/index.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import { Image, Input, Text, View } from '@tarojs/components' -import Taro, { useDidShow } from '@tarojs/taro' -import classnames from 'classnames' -import { useEffect, useMemo, useRef, useState } from 'react' -import styles from './index.module.scss' -import SuccessBind from './component/successBind' -import useLogin from '@/use/useLogin' -import { formatImgUrl } from '@/common/fotmat' -import { alert } from '@/common/common' -import CloseBtn from '@/components/closeBtn' -import { BindInvitationInfoApi, GetInvitationInfoApi } from '@/api/user' -import { debounce, getFilterData, throttle } from '@/common/util' - -const BindSalesman = () => { - useLogin() - - const [submitData, setSubmitData] = useState({ - invitation_code: '', - }) - - // 获取业务员信息 - interface Param { invitation_code: string; name: string; phone: string } - const [salesMan, setSalesMan] = useState(null) - const { fetchData: GetInvitationInfoFetchData } = GetInvitationInfoApi() - const getInvitationInfo = async() => { - const res = await GetInvitationInfoFetchData(getFilterData({ ...submitData })) - res.success ? setSalesMan(res.data) : setSalesMan(null) - } - useEffect(() => { - if (submitData.invitation_code.length === 4) { getInvitationInfo() } - }, [submitData]) - - const onInputCode = (e) => { - const value = e.detail.value.replace(/[\W]/g, '') - setSubmitData(val => ({ ...val, invitation_code: value })) - } - - const oncloseEven = () => { - setSubmitData(val => ({ ...val, invitation_code: '' })) - setSalesMan(null) - } - - // 绑定业务员 - const [bindShow, setBindShow] = useState(false) - const { fetchData: bindInvitationInfoFetchData } = BindInvitationInfoApi() - const onSubmit = async() => { - if (!submitData.invitation_code) { return alert.error('请输入邀请码') } - const res = await bindInvitationInfoFetchData({ ...submitData }) - if (res.success) { setBindShow(() => true) } - } - - const onScanCode = () => { - Taro.scanCode({ - success: (res) => { - const val = res.result.match(/InviteCode:([a-zA-Z0-9]{4})/) - setSubmitData(() => ({ invitation_code: val ? val![1] : '' })) - }, - }) - } - - // 获取粘贴版内容 - const onClipboardData = () => { - Taro.getClipboardData({ - success(res) { - const val = res.data.match(/InviteCode:([a-zA-Z0-9]{4})/) - if (val) { setSubmitData(e => ({ ...e, invitation_code: val ? val[1] : '' })) } - }, - }) - } - useEffect(() => { - onClipboardData() - }, []) - return ( - - - - - - - - {submitData.invitation_code && } - - onScanCode()}> - - - - {salesMan && ( - - 邀请人: - {`${salesMan.name} (${salesMan.phone})`} - - )} - - 提交 - - - 温馨提示 - 1. 新用户授权手机号码后,7天内可以输入邀请码,超过时间不能输入。 - 2. 一个手机只能输入一次邀请码。输入邀请码。 - - - setBindShow(false)} saleMan={salesMan?.name} /> - - ) -} - -export default BindSalesman diff --git a/src/pages/inviteCode/index.config.ts b/src/pages/inviteCode/index.config.ts new file mode 100644 index 0000000..29bfdd0 --- /dev/null +++ b/src/pages/inviteCode/index.config.ts @@ -0,0 +1,7 @@ +export default { + navigationBarTitleText: '邀请码', + navigationBarTextStyle: 'black', + navigationBarBackgroundColor: '#E4EEFD', + backgroundColor: '#E4EEFD', + backgroundColorTop: '#E4EEFD', +} diff --git a/src/pages/inviteCode/index.module.scss b/src/pages/inviteCode/index.module.scss new file mode 100644 index 0000000..588dfc0 --- /dev/null +++ b/src/pages/inviteCode/index.module.scss @@ -0,0 +1,180 @@ +page { + display: flex; + flex-flow: column nowrap; + height: 100%; +} +.main { + display: flex; + flex-flow: column nowrap; + height: 100%; + background: linear-gradient(to bottom, #e4eefd 25%, $color_bg_one 42%); + padding-bottom: 0; + box-sizing: border-box; + overflow-y: scroll; + .content { + flex: 1 1 auto; + overflow: scroll; + } +} +.background { + display: flex; + flex-flow: row nowrap; + padding: 20px 56px; + padding-bottom: 0; + align-items: center; + justify-content: space-between; + overflow: hidden; + .left { + .title { + padding-bottom: 5px; + font-size: 60px; + font-weight: 500; + } + .description { + font-size: 28px; + color: #848689; + font-weight: 400; + } + } + .right { + .iconContainer { + width: 260px; + position: relative; + bottom: -36px; + .icon { + width: 130%; + } + } + } +} +.inviteCodeContent { + position: relative; + top: -20px; +} +.codeBar { + border-radius: 15px; + background-color: #f7f8fa; + padding: 40px 0; + .inviteCodeBar { + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + margin-bottom: 16px; + .invite { + padding: 0 40px; + font-size: 60px; + font-weight: 500; + color: #337fff; + line-height: 65px; + } + } + .codeTitle { + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + letter-spacing: 10px; + font-size: 40px; + font-weight: 400; + color: #9fa0a1; + line-height: 28px; + padding: 10px 40px; + padding-bottom: 0; + } +} +.inviteCord { + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + align-items: center; + font-size: 28px; + .noop { + color: #9e9e9e; + } + .inviteCordTitle { + font-weight: 500; + color: #000000; + } + .inviteCordMore { + color: #6b6b6b; + } +} +.tips { + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + font-size: 24px; + font-weight: 400; + color: #9fa0a1; + line-height: 28px; + padding: 0 40px; +} +.inviteListTitle { + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + padding-top: 15px; + padding-bottom: 30px; + .listTitle { + padding: 0 20px; + font-size: 32px; + font-weight: 500; + color: #000000; + } + .titleIconLeft { + width: 24px; + height: 4px; + background: linear-gradient(270deg, #333333 0%, rgba(51, 51, 51, 0) 100%); + opacity: 0.3; + } + .titleIconRight { + width: 24px; + height: 4px; + background: linear-gradient(270deg, rgba(51, 51, 51, 0) 0%, #333333 100%); + opacity: 0.3; + } +} +.bottomBar { + flex: none; + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + align-items: center; + padding-top: 24px; + padding-right: 48px; + padding-left: 48px; + background-color: #ffffff; + padding-bottom: calc(20px + constant(safe-area-inset-bottom)); + padding-bottom: calc(20px + env(safe-area-inset-bottom)); + &__text { + font-weight: 500; + } +} +.codePreview { + display: flex; + flex-flow: column nowrap; + justify-content: center; + align-items: center; + position: relative; + top: -120px; + .imageContainer { + width: 80vw; + height: auto; + .image { + width: 100%; + height: 100%; + } + } + .previewTips { + position: absolute; + bottom: -80px; + font-size: 40px; + font-weight: 400; + color: #c2c2c2; + letter-spacing: 5px; + white-space: nowrap; + } +} diff --git a/src/pages/inviteCode/index.tsx b/src/pages/inviteCode/index.tsx new file mode 100644 index 0000000..c04b171 --- /dev/null +++ b/src/pages/inviteCode/index.tsx @@ -0,0 +1,330 @@ +import { Canvas, Image, Text, View } from '@tarojs/components' +import Taro, { useReady } from '@tarojs/taro' +import { useRef, useState } from 'react' +import styles from './index.module.scss' +import useLogin from '@/use/useLogin' +import { alert, goLink } from '@/common/common' +import { GenBarCodeOrQrCode, GetInvitationInfo, GetInvitationInfoApi, GetInviteCodeList, GetInviteeRecord } from '@/api/user' +import { getFilterData } from '@/common/util' +import LayoutBlock from '@/components/layoutBlock' +import { getCDNSource } from '@/common/constant' +import NormalButton from '@/components/normalButton' +import Dialog from '@/components/Dialog' +import IconText from '@/components/iconText' +import BindSalesManDialog from '@/components/bindSalesManDialog' +// 获取业务员信息 +interface Param { inviter_id: number; inviter_name: string; phone: string } + +const BindSalesman = () => { + useLogin() + + const [inviteInfo, setInviteInfo] = useState({}) + + const [salesMan, setSalesMan] = useState(null) + // const { fetchData: GetInvitationInfoFetchData } = GetInvitationInfoApi() + // const getInvitationInfo = async() => { + // const res = await GetInvitationInfoFetchData(getFilterData({ ...inviteInfo })) + // res.success ? setSalesMan(res.data) : setSalesMan(null) + // } + // 获取被邀请记录 + const { fetchData: getInviteeRecordAPI } = GetInviteeRecord() + const getInviteeRecord = async() => { + const res = await getInviteeRecordAPI() + if (res.success) { + setSalesMan(res.data) + } + } + const { fetchData } = GetInvitationInfo() + // 获取邀请码 + const getInviteCode = async() => { + const res = await fetchData() + if (res.success) { + setInviteInfo(res.data) + // getInvitationInfo() + } + } + const [invite, setInvite] = useState(0) + const { fetchData: getInvitationListAPI } = GetInviteCodeList() + const getInvitationList = async() => { + const res = await getInvitationListAPI() + if (res.success) { + console.log('getInviteCode', res) + setInvite(res.data.total) + } + } + + const canvasNode = useRef(null) + const ctx = useRef(null) + const [showPopup, setShowPopup] = useState(false) + + const [loading, setLoading] = useState(false) + const { fetchData: genCode } = GenBarCodeOrQrCode() + // 生成二维码 + const genQRcode = async() => { + const res = await genCode({ content: `InviteCode:${inviteInfo.invitation_code}` }) + if (res.success) { + return res.data.qrcode_base64 + } + else { + setLoading(false) + } + } + const inviteDialog = useRef(null) + + const getImageObject = (canvas: Taro.Canvas, src: string) => { + return new Promise((resolve, reject) => { + console.log('getImageObject param', canvas, src) + const img = canvas.createImage() + img.src = src + img.onload = () => { + console.log('image===>', img) + resolve(img) + } + img.onerror = (err) => { + console.log('image error===>', err) + alert.error('图片加载失败') + reject(err) + } + }) + } + const doublePick = (num, minus = false) => { + if (minus) { + return num / 2 + } + else { + return num * 2 + } + } + const [targetImageUrl, setTargetImageUrl] = useState('') + // canvas 生成 图片 + const saveCanvasToImage = (canvas) => { + Taro.canvasToTempFilePath({ + canvas, + fileType: 'png', + success: (res) => { + console.log('tempFilePath', res.tempFilePath) + setTargetImageUrl(res.tempFilePath) + }, + fail: (error) => { + console.log('error', error) + }, + complete: () => { + setLoading(false) + }, + }) + } + const [, setForceUpdate] = useState({}) + // 初始化 canvas + const initCanvas = async() => { + return new Promise((resolve, reject) => { + Taro.nextTick(() => { + const query = Taro.createSelectorQuery() + query.select('#canvas').node(({ node: canvas }: { node: Taro.Canvas }) => { + console.log('canvas==>', canvas) + const context = canvas.getContext('2d') + console.log('ctx', context) + canvasNode.current = canvas + ctx.current = context + console.log('canvas', canvas) + setForceUpdate({}) + resolve(true) + }).exec() + }) + }) + } + const [canvasStyle, setCanvasStyle] = useState({}) + const startPaint = async(ctx: Taro.RenderingContext, canvas: Taro.Canvas, image: Taro.Image) => { + // 开始绘制 + const { width, height } = canvas + console.log('startPaint param', ctx, canvas, image) + const cCanvasCtx = ctx as any + cCanvasCtx.clearRect(0, 0, width, height) + cCanvasCtx.drawImage(image, 0, 0, width, height) + cCanvasCtx.save() + cCanvasCtx.font = `${doublePick(40)}px 微软雅黑` + cCanvasCtx.fillStyle = '#000000' + cCanvasCtx.fillText('陆盈商城', doublePick(40), doublePick(80)) // text up above canvas + cCanvasCtx.save() + cCanvasCtx.font = `${doublePick(26)}px 微软雅黑` + cCanvasCtx.fillStyle = '#8f9398' + cCanvasCtx.fillText('邀请好友加入', doublePick(40), doublePick(130)) // text up above canvas + cCanvasCtx.save() + cCanvasCtx.font = `${doublePick(24)}px 微软雅黑` + cCanvasCtx.fillStyle = '#a6a6a6' + cCanvasCtx.fillText('请前往陆盈商城,进行填写或扫描邀请', doublePick(100), doublePick(630)) // text up above canvas + cCanvasCtx.save() + cCanvasCtx.font = `${doublePick(36)}px 微软雅黑` + cCanvasCtx.fillStyle = '#7f7f7f' + cCanvasCtx.fillText('邀 请 码', doublePick(72), doublePick(730)) // text up above canvas + cCanvasCtx.save() + cCanvasCtx.font = `${doublePick(24)}px 微软雅黑` + cCanvasCtx.fillStyle = '#cccccc' + cCanvasCtx.fillText('|', doublePick(258), doublePick(724)) // text up above canvas + cCanvasCtx.save() + cCanvasCtx.font = `${doublePick(36)}px 微软雅黑` + cCanvasCtx.fillStyle = '#7f7f7f' + cCanvasCtx.fillText(`${inviteInfo.invitation_code}`, doublePick(311), doublePick(730)) // text up above canvas + cCanvasCtx.save() + const codeUrl = await genQRcode() + try { + const code = await getImageObject(canvas, codeUrl) + cCanvasCtx.drawImage(code, doublePick(110), doublePick(213), doublePick(342), doublePick(342)) + } + catch (err) { + console.error('合成二维邀请码失败', err) + setLoading(false) + throw new Error('合成二维邀请码失败') + } + + saveCanvasToImage(canvas) + } + // 绘制最终的海报,图片使用两倍大小,canvas大小是图片的二分之一 就能让canvas生成出来的图片清晰了 + const drawPictorial = async() => { + // eslint-disable-next-line no-async-promise-executor + return new Promise(async(resolve, reject) => { + setLoading(true) + if (!ctx.current) { + // 重新初始化canvas + await initCanvas() + } + const canvas = canvasNode.current! + Taro.getImageInfo({ + src: getCDNSource('/user/inviteCodePopup.png'), + success: (res) => { + console.log('res==>', res) + canvas.width = res.width + canvas.height = res.height + setCanvasStyle({ + width: `${doublePick(canvas.width, true)}px`, + height: `${doublePick(canvas.height, true)}px`, + }) + getImageObject(canvas, `${res.path}`).then(async(image) => { + try { + // 开始绘制 + await startPaint(ctx.current!, canvas, image) + resolve(true) + } + catch (err) { + console.log(err) + setLoading(false) + reject(new Error('绘制失败')) + } + }).catch((error) => { + setLoading(false) + throw new Error(error) + }) + }, + }) + }) + } + // 复制二维码 + const handleCopyInviteCode = () => { + Taro.setClipboardData({ + data: inviteInfo.invitation_code, + }) + } + const handleChange = (value: boolean) => { + setShowPopup(value) + } + useReady(() => { + getInviteCode() + getInvitationList() + getInviteeRecord() + setTimeout(() => { + initCanvas() + }, 200) + }) + const handleQRcodeShare = async() => { + try { + const flag = await drawPictorial() + if (flag) { + setShowPopup(true) + } + } + catch (err) { + throw new Error('弹出二维码失败') + } + } + // 邀请记录 + const handleInviteCord = () => { + goLink('/pages/inviteCode/inviteCord/index') + } + const handleBindSalesMan = () => { + inviteDialog.current.handleChange(true) + } + const handleBindSuccess = () => { + getInviteeRecord() + } + return ( + + + + + 陆盈商城 + 邀请好友加入 + + + + + + + + + + + + {inviteInfo.invitation_code ? inviteInfo.invitation_code : '暂无邀请码'} + + 您的专属邀请码 + + + + + 我的邀请记录: + {invite === 0 ? 暂无邀请信息 : {invite}人} + + + + + + + + 朋友邀请我: + {!salesMan?.inviter_id + ? 未绑定 + : + 已绑定 {salesMan.inviter_name}({salesMan.phone}) + } + {!salesMan?.inviter_id && + + } + + + 温馨提示:邀请码确定绑定后,不支持解绑。 + + + {/* 已踩坑,这里必须设置canvas的style的width和height,单单只设置canvas实例的width和height是不行的。会模糊! */} + + + + 二维码分享 + + + 复制邀请码 + + + + + + {/* showMenuByLongpress 属性只对 小程序有效 */} + + + 长按图片保存到手机 + + + + + ) +} + +export default BindSalesman diff --git a/src/pages/inviteCode/inviteCord/index.config.ts b/src/pages/inviteCode/inviteCord/index.config.ts new file mode 100644 index 0000000..cf00b9b --- /dev/null +++ b/src/pages/inviteCode/inviteCord/index.config.ts @@ -0,0 +1,7 @@ +export default { + navigationBarTitleText: '邀请记录', + navigationBarTextStyle: 'black', + navigationBarBackgroundColor: '#E4EEFD', + backgroundColor: '#E4EEFD', + backgroundColorTop: '#E4EEFD', +} diff --git a/src/pages/inviteCode/inviteCord/index.module.scss b/src/pages/inviteCode/inviteCord/index.module.scss new file mode 100644 index 0000000..008b84d --- /dev/null +++ b/src/pages/inviteCode/inviteCord/index.module.scss @@ -0,0 +1,163 @@ +page { + display: flex; + flex-flow: column nowrap; + height: 100%; +} +.main { + display: flex; + flex-flow: column nowrap; + height: 100%; + background: linear-gradient(to bottom, #e4eefd 25%, $color_bg_one 42%); + padding-bottom: 0; + box-sizing: border-box; + overflow-y: scroll; + .content { + flex: 1 1 auto; + overflow: scroll; + } +} +.background { + display: flex; + flex-flow: row nowrap; + padding: 20px 56px; + padding-bottom: 0; + align-items: center; + justify-content: space-between; + overflow: hidden; + .left { + .title { + padding-bottom: 5px; + font-size: 60px; + font-weight: 500; + } + .description { + font-size: 28px; + color: #848689; + font-weight: 400; + } + } + .right { + .iconContainer { + width: 260px; + position: relative; + bottom: -36px; + .icon { + width: 130%; + } + } + } +} +.inviteCodeContent { + position: relative; + top: -20px; +} +.codeBar { + border-radius: 15px; + background-color: #f7f8fa; + padding: 40px 0; + .inviteCodeBar { + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + margin-bottom: 16px; + .invite { + padding: 0 40px; + font-size: 60px; + font-weight: 500; + color: #337fff; + line-height: 65px; + } + } + .codeTitle { + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + letter-spacing: 10px; + font-size: 40px; + font-weight: 400; + color: #9fa0a1; + line-height: 28px; + padding: 10px 40px; + padding-bottom: 0; + } +} +.tips { + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + font-size: 24px; + font-weight: 400; + color: #9fa0a1; + line-height: 28px; + padding: 0 40px; +} +.inviteListTitle { + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + padding-top: 15px; + padding-bottom: 30px; + .listTitle { + padding: 0 20px; + font-size: 32px; + font-weight: 500; + color: #000000; + } + .titleIconLeft { + width: 24px; + height: 4px; + background: linear-gradient(270deg, #333333 0%, rgba(51, 51, 51, 0) 100%); + opacity: 0.3; + } + .titleIconRight { + width: 24px; + height: 4px; + background: linear-gradient(270deg, rgba(51, 51, 51, 0) 0%, #333333 100%); + opacity: 0.3; + } +} +.bottomBar { + flex: none; + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + align-items: center; + padding-top: 24px; + padding-right: 48px; + padding-left: 48px; + background-color: #ffffff; + padding-bottom: calc(20px + constant(safe-area-inset-bottom)); + padding-bottom: calc(20px + env(safe-area-inset-bottom)); + &__text { + font-weight: 500; + } +} +.codePreview { + display: flex; + flex-flow: column nowrap; + justify-content: center; + align-items: center; + position: relative; + top: -120px; + .imageContainer { + width: 80vw; + height: auto; + .image { + width: 100%; + height: 100%; + } + } + .previewTips { + position: absolute; + bottom: -80px; + font-size: 40px; + font-weight: 400; + color: #c2c2c2; + letter-spacing: 5px; + white-space: nowrap; + } +} diff --git a/src/pages/inviteCode/inviteCord/index.tsx b/src/pages/inviteCode/inviteCord/index.tsx new file mode 100644 index 0000000..9a8cd8b --- /dev/null +++ b/src/pages/inviteCode/inviteCord/index.tsx @@ -0,0 +1,91 @@ +import { Image, Swiper, SwiperItem, Text, View } from '@tarojs/components' +import Taro, { useReady } from '@tarojs/taro' +import { useEffect, useRef, useState } from 'react' +import styles from './index.module.scss' +import { formatImgUrl } from '@/common/fotmat' +import { goLink } from '@/common/common' +import CloseBtn from '@/components/closeBtn' +import { getCDNSource } from '@/common/constant' +import LayoutBlock from '@/components/layoutBlock' +import type { TablePropsType } from '@/components/table' +import Table from '@/components/table' +import { GetInviteCodeList } from '@/api/user' +// 需要传进来的表头数据示例 +const inviteColumns = [ + { + key: 'invitee', + title: '被邀请人', + dataIndex: 'invitee', + width: '50%', + }, + { + key: 'InviteTime', + title: '邀请时间', + dataIndex: 'InviteTime', + width: '50%', + }, +] +const defaultSize = 24 +const InviteCord = () => { + const size = useRef(defaultSize) + const [currentTable, setCurrentTable] = useState({ + columns: inviteColumns, + dataSource: { list: [], total: 0 }, + }) + const { fetchData: getInvitationListAPI } = GetInviteCodeList() + const getInvitationList = async() => { + const res = await getInvitationListAPI({ size: size.current }) + if (res.success) { + console.log('getInviteCode', res) + setCurrentTable((prev: any) => ({ + ...prev, + dataSource: { + list: res.data.list.map((item, index: number) => ({ + key: index, + index: index + 1, + invitee: item.invitee_name || '--', + InviteTime: item.schedule, + })), + total: res.data.list.length, + }, + })) + } + } + const handleLoadMore = () => { + size.current += defaultSize + } + useReady(() => { + getInvitationList() + }) + return ( + + + + + 邀请记录 + 查看成功邀请人信息 + + + + + + + + + + + + 成功邀请 + + + +
+
+
+
+
+
+ ) +} + +export default InviteCord diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index e45bc45..ca19a8e 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -260,7 +260,7 @@ const Main = () => { { text: '我的收藏', icon: 'icon-shoucang', url: '/pages/collection/index', type: 'url' }, { text: '颜色对比', icon: 'icon-yanseduibi', url: '/pages/sampleComparison/index', type: 'url' }, // { text: "分享推广", icon: "icon-fenxiang" }, - { text: '邀请码', icon: 'icon-yaoqingma', url: '/pages/bindSalesman/index', type: 'url' }, + { text: '邀请码', icon: 'icon-yaoqingma', url: '/pages/inviteCode/index', type: 'url' }, ] const navigation = (item) => { if (item.type === 'url') { goLink(item.url) }