🌈 style(eslint): add eslint rules
This commit is contained in:
@@ -1,76 +1,73 @@
|
||||
import { View, ScrollView, Button, Input } from '@tarojs/components'
|
||||
import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode } from 'react'
|
||||
import styles from "./index.module.scss"
|
||||
import classnames from "classnames";
|
||||
import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro';
|
||||
import { alert } from '@/common/common'
|
||||
import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format'
|
||||
import { Button, Input, ScrollView, View } from '@tarojs/components'
|
||||
import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
|
||||
import type { ReactNode } from 'react'
|
||||
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import classnames from 'classnames'
|
||||
import styles from './index.module.scss'
|
||||
import { alert, goLink } from '@/common/common'
|
||||
import { formatDateTime, formatPriceDiv, formatWeightDiv } from '@/common/format'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
import Popup from '@/components/popup';
|
||||
import { goLink } from '@/common/common'
|
||||
|
||||
import Popup from '@/components/popup'
|
||||
|
||||
interface Props {
|
||||
title: string
|
||||
isQuire?: boolean,
|
||||
placeholderFont?: string,
|
||||
handBlur?: (any) => void,
|
||||
inputValue?: string,
|
||||
isDisabled?: boolean,
|
||||
inputType?: any,
|
||||
maxlength?: number,
|
||||
children?: ReactNode,
|
||||
showInput?: boolean,
|
||||
showMore?: boolean,
|
||||
showBorder?: boolean,
|
||||
handNav?: () => void
|
||||
title: string
|
||||
isQuire?: boolean
|
||||
placeholderFont?: string
|
||||
handBlur?: (any) => void
|
||||
inputValue?: string
|
||||
isDisabled?: boolean
|
||||
inputType?: any
|
||||
maxlength?: number
|
||||
children?: ReactNode
|
||||
showInput?: boolean
|
||||
showMore?: boolean
|
||||
showBorder?: boolean
|
||||
handNav?: () => void
|
||||
}
|
||||
export default memo((props: Props) => {
|
||||
const {
|
||||
title = '标题',
|
||||
isQuire = true,
|
||||
placeholderFont = '请输入',
|
||||
handBlur,
|
||||
handNav,
|
||||
inputValue,
|
||||
isDisabled,
|
||||
inputType = 'text',
|
||||
maxlength = 999,
|
||||
children,
|
||||
showInput = true,
|
||||
showMore = false,
|
||||
showBorder = true,
|
||||
} = props
|
||||
|
||||
let {
|
||||
title = '标题',
|
||||
isQuire = true,
|
||||
placeholderFont = '请输入',
|
||||
handBlur,
|
||||
handNav,
|
||||
inputValue,
|
||||
isDisabled,
|
||||
inputType = "text",
|
||||
maxlength = 999,
|
||||
children,
|
||||
showInput = true,
|
||||
showMore = false,
|
||||
showBorder = true
|
||||
} = props
|
||||
|
||||
return (
|
||||
<View className={classnames(showBorder ? styles.mainItem : styles.mainItemactive)}>
|
||||
<View className={styles.leftItem}>{title}
|
||||
{
|
||||
isQuire && <View className={styles.xing}>*</View>
|
||||
}
|
||||
</View>
|
||||
{
|
||||
!children && <View className={styles.rightItem} onClick={() => handNav?.()}>
|
||||
{
|
||||
showInput && <Input
|
||||
maxlength={maxlength}
|
||||
type={inputType}
|
||||
disabled={isDisabled}
|
||||
className={styles.inputStyle}
|
||||
placeholder={placeholderFont}
|
||||
placeholderStyle={styles.placeholderStyle}
|
||||
onBlur={(e) => handBlur?.(e.detail.value)}
|
||||
value={inputValue}
|
||||
></Input>
|
||||
}
|
||||
{
|
||||
showMore && <IconFont name={'icon-chakanquanbukehu'} size={50} color={'#000000'}></IconFont>
|
||||
}
|
||||
</View>
|
||||
}
|
||||
{children}
|
||||
return (
|
||||
<View className={classnames(showBorder ? styles.mainItem : styles.mainItemactive)}>
|
||||
<View className={styles.leftItem}>{title}
|
||||
{
|
||||
isQuire && <View className={styles.xing}>*</View>
|
||||
}
|
||||
</View>
|
||||
{
|
||||
!children && <View className={styles.rightItem} onClick={() => handNav?.()}>
|
||||
{
|
||||
showInput && <Input
|
||||
maxlength={maxlength}
|
||||
type={inputType}
|
||||
disabled={isDisabled}
|
||||
className={styles.inputStyle}
|
||||
placeholder={placeholderFont}
|
||||
placeholderStyle={styles.placeholderStyle}
|
||||
onBlur={e => handBlur?.(e.detail.value)}
|
||||
value={inputValue}
|
||||
></Input>
|
||||
}
|
||||
{
|
||||
showMore && <IconFont name="icon-chakanquanbukehu" size={50} color="#000000"></IconFont>
|
||||
}
|
||||
</View>
|
||||
)
|
||||
|
||||
})
|
||||
}
|
||||
{children}
|
||||
</View>
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user