🔧 build(svg): 升级taro-iconfont-svg依赖
This commit is contained in:
parent
0a794a17e2
commit
979373a2f4
@ -82,16 +82,16 @@ export const retrieval = (data: any, rules?: Object, message = '请填写完信
|
||||
return new Promise((resolve, reject) => {
|
||||
if (rules) {
|
||||
const keys = Reflect.ownKeys(rules)
|
||||
const result = keys.some((key: any) => {
|
||||
for (const item of (rules as any)[key]) {
|
||||
const result = keys.some((key: string) => {
|
||||
return (rules as any)[key].some((rule) => {
|
||||
let _res = false
|
||||
if (item.validator) {
|
||||
if (item.validator(data[key], item)) {
|
||||
if (rule.validator) {
|
||||
if (rule.validator(data[key], rule)) {
|
||||
_res = true
|
||||
}
|
||||
}
|
||||
else if (item.regex) {
|
||||
if (!item.regex.test(data[key])) {
|
||||
else if (rule.regex) {
|
||||
if (!rule.regex.test(data[key])) {
|
||||
_res = true
|
||||
}
|
||||
}
|
||||
@ -100,9 +100,9 @@ export const retrieval = (data: any, rules?: Object, message = '请填写完信
|
||||
_res = true
|
||||
}
|
||||
}
|
||||
message = item.message
|
||||
message = rule.message
|
||||
return _res
|
||||
}
|
||||
})
|
||||
})
|
||||
if (result) {
|
||||
reject(message)
|
||||
|
||||
@ -9,8 +9,8 @@ import { alert } from '@/common/common'
|
||||
|
||||
interface Param {
|
||||
onClose?: () => void
|
||||
show: boolean,
|
||||
messageTitle?: string,
|
||||
show: boolean
|
||||
messageTitle?: string
|
||||
messagePath?: string
|
||||
showCard?: true|false
|
||||
}
|
||||
@ -46,7 +46,7 @@ export default (props: Param) => {
|
||||
className={styles.customer}
|
||||
openType="contact"
|
||||
sendMessageTitle={props.messageTitle}
|
||||
showMessageCard = {props.showCard}
|
||||
showMessageCard={props.showCard}
|
||||
sendMessagePath={props.messagePath}
|
||||
></Button>
|
||||
</View>
|
||||
|
||||
@ -14,7 +14,7 @@ import Popup from '@/components/popup'
|
||||
import MCheckbox from '@/components/checkbox'
|
||||
import LoadingCard from '@/components/loadingCard'
|
||||
import InfiniteScroll from '@/components/infiniteScroll'
|
||||
import { alert, goLink } from '@/common/common'
|
||||
import { alert, goLink, retrieval } from '@/common/common'
|
||||
import { DelShoppingCartApi, GetShoppingCartApi, UpdateShoppingCartApi } from '@/api/shopCart'
|
||||
import { formatHashTag, formatImgUrl, formatPriceDiv } from '@/common/fotmat'
|
||||
import { setParam } from '@/common/system'
|
||||
@ -22,6 +22,9 @@ import { debounce, throttle } from '@/common/util'
|
||||
import { ApplyOrderAccessApi, GetAdminUserInfoApi, SubscriptionMessageApi } from '@/api/user'
|
||||
import useCommonData from '@/use/useCommonData'
|
||||
import type { saleModeType } from '@/common/enum'
|
||||
import { useSelector } from '@/reducers/hooks'
|
||||
import { companyDetailApi, companyUpdateApi } from '@/api/company'
|
||||
import useLogin from '@/use/useLogin'
|
||||
|
||||
interface param {
|
||||
show?: true | false
|
||||
@ -46,6 +49,8 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod
|
||||
{ value: 1, title: '剪板', unit: '米', eunit: 'm', step: 1, digits: 2, minNum: 0.3, maxNum: 100000, defaultNum: 0.3 },
|
||||
{ value: 2, title: '散剪', unit: '米', eunit: 'kg', step: 1, digits: 2, minNum: 3, maxNum: 100000, defaultNum: 3 },
|
||||
]
|
||||
const userInfo = useSelector(state => state.userInfo)
|
||||
|
||||
const bindSalesManDialogRef = useRef<SalesManDialogRef | null>(null)
|
||||
const [isPending, startTransition] = useTransition()
|
||||
|
||||
@ -276,12 +281,11 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod
|
||||
if (res.data.order_access_status !== 3) {
|
||||
if (res.data.order_access_status == 1) { applyOrderAccessFetchData() }
|
||||
bindSalesManDialogRef.current?.handleChange(true)
|
||||
// setShowBindSalesman(() => true)
|
||||
onClose?.()
|
||||
return
|
||||
}
|
||||
// TODO 检测是否修改过组织昵称
|
||||
if (false) {
|
||||
// 检测是否修改过组织昵称
|
||||
if (userInfo.adminUserInfo.first_change_name) {
|
||||
setShowModal(true)
|
||||
return
|
||||
}
|
||||
@ -323,7 +327,31 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod
|
||||
setSelectStatus(true)
|
||||
})
|
||||
}, [selectIndex])
|
||||
|
||||
// 弹出修改组织昵称弹窗
|
||||
const handleBindSalesManSuccess = () => {
|
||||
// 检测是否修改过组织昵称
|
||||
if (userInfo.adminUserInfo.first_change_name) {
|
||||
setShowModal(true)
|
||||
}
|
||||
}
|
||||
const { getAdminUserInfo } = useLogin()
|
||||
const { fetchData: saveFetch } = companyUpdateApi()
|
||||
const { fetchData: getCompanyFetch } = companyDetailApi()
|
||||
const handleOrganizationNameModalConfirm = async(text: string) => {
|
||||
const params = await getCompanyFetch()
|
||||
const result = await saveFetch({
|
||||
...params.data,
|
||||
company_name: text,
|
||||
})
|
||||
if (result.success) {
|
||||
getAdminUserInfo()
|
||||
handleClose()
|
||||
alert.success('保存成功')
|
||||
}
|
||||
else {
|
||||
alert.none(result.msg)
|
||||
}
|
||||
}
|
||||
return (
|
||||
<View className={styles.shop_cart_main}>
|
||||
<Popup showTitle={false} show={showPopup} onClose={() => closePopup()}>
|
||||
@ -389,12 +417,12 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod
|
||||
</View>
|
||||
</Popup>
|
||||
<View>
|
||||
<BindSalesManDialog ref={bindSalesManDialogRef} />
|
||||
<BindSalesManDialog ref={bindSalesManDialogRef} onSuccess={handleBindSalesManSuccess} />
|
||||
</View>
|
||||
<View>
|
||||
<LabAndImgShow value={labImageValue} show={showLabImage} onClose={closeLabImgShow} />
|
||||
</View>
|
||||
<OrganizationNameModal showModal={showModal} onClose={handleClose} onShowModalChange={handleShowChange} />
|
||||
<OrganizationNameModal showModal={showModal} onClose={handleClose} onShowModalChange={handleShowChange} onConfirm={handleOrganizationNameModalConfirm} />
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import styles from './index.module.scss'
|
||||
import Popup from '@/components/popup'
|
||||
import NormalButton from '@/components/normalButton'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
import { useSelector } from '@/reducers/hooks'
|
||||
|
||||
interface Params {
|
||||
title?: string
|
||||
@ -21,6 +22,7 @@ export interface ModifyModalRef {
|
||||
const ModifyModal = (props: Params, ref: Ref<ModifyModalRef>) => {
|
||||
const { title = '修改昵称', value: _value = '', isCompanyName = false } = props
|
||||
const [value, setValue] = useState('')
|
||||
const userInfo = useSelector(state => state.userInfo)
|
||||
|
||||
const [tipsComp, setTipsComp] = useState<React.ReactNode | null>(null)
|
||||
// 不合法状态
|
||||
@ -42,8 +44,8 @@ const ModifyModal = (props: Params, ref: Ref<ModifyModalRef>) => {
|
||||
}
|
||||
// 修改组织名称
|
||||
if (isCompanyName) {
|
||||
// TODO 检测是否没机会修改
|
||||
if (true) {
|
||||
// 检测是否没机会修改
|
||||
if (userInfo.adminUserInfo.first_change_name) {
|
||||
flag = false
|
||||
setTipsComp(() => {
|
||||
return <View className={styles['warn-tips']}>
|
||||
@ -67,7 +69,7 @@ const ModifyModal = (props: Params, ref: Ref<ModifyModalRef>) => {
|
||||
}
|
||||
}
|
||||
return flag
|
||||
}, [value, isCompanyName])
|
||||
}, [value, isCompanyName, userInfo])
|
||||
|
||||
useEffect(() => {
|
||||
setValue(_value)
|
||||
@ -101,14 +103,19 @@ const ModifyModal = (props: Params, ref: Ref<ModifyModalRef>) => {
|
||||
<View className={styles['modify-ickname-tips']}>请设置2-20个字符,可由中文、英文、数字组成</View>
|
||||
<View className={styles['modify-ickname-operation']}>
|
||||
{
|
||||
// TODO 检测是否没机会修改
|
||||
true
|
||||
// 检测是否没机会修改
|
||||
isCompanyName
|
||||
? userInfo.adminUserInfo.first_change_name
|
||||
? <>
|
||||
<NormalButton round type="primary" plain onClick={handleTextareaReset} customClassName={classNames(styles.button, styles['modify-ickname-operation-reset'])}>重置</NormalButton>
|
||||
<NormalButton round disabled={isInvalidate} onClick={() => props.save(value)} type="primary" customClassName={classNames(styles.button, styles['modify-ickname-operation-save'])}>保存</NormalButton>
|
||||
</>
|
||||
: <NormalButton round onClick={() => setModalShow(false)} type="primary" customClassName={classNames(styles.button, styles['modify-ickname-operation-IKnown'])}>知道了</NormalButton>
|
||||
: <>
|
||||
<NormalButton round type="primary" plain onClick={handleTextareaReset} customClassName={classNames(styles.button, styles['modify-ickname-operation-reset'])}>重置</NormalButton>
|
||||
<NormalButton round disabled={isInvalidate} onClick={() => props.save(value)} type="primary" customClassName={classNames(styles.button, styles['modify-ickname-operation-save'])}>保存</NormalButton>
|
||||
|
||||
</>
|
||||
: <NormalButton round onClick={() => setModalShow(false)} type="primary" customClassName={classNames(styles.button, styles['modify-ickname-operation-IKnown'])}>知道了</NormalButton>
|
||||
}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@ -29,32 +29,33 @@ export interface UserParam {
|
||||
}
|
||||
|
||||
export interface UserAdminParam {
|
||||
avatar_url?: string
|
||||
open_id?: string
|
||||
physical_warehouse?: number
|
||||
physical_warehouse_name?: string
|
||||
union_id?: string
|
||||
user_code?: string
|
||||
user_id?: number
|
||||
user_name?: string
|
||||
wechat_user_open_id?: number
|
||||
is_authorize_name?: false|true
|
||||
is_authorize_phone?: false|true
|
||||
phone?: string
|
||||
authentication_status?: number
|
||||
avatar_url: string
|
||||
open_id: string
|
||||
physical_warehouse: number
|
||||
physical_warehouse_name: string
|
||||
union_id: string
|
||||
user_code: string
|
||||
user_id: number
|
||||
user_name: string
|
||||
wechat_user_open_id: number
|
||||
is_authorize_name: boolean
|
||||
is_authorize_phone: boolean
|
||||
phone: string
|
||||
authentication_status: number
|
||||
authentication_status_name: string
|
||||
company_id?: number
|
||||
company_name?: string
|
||||
founder_user_id?: string
|
||||
founder_user_name?: string
|
||||
order_access_status?: number
|
||||
order_access_status_name?: string
|
||||
purchaser_type?: number
|
||||
purchaser_type_name?: string
|
||||
collection_quantity?: number
|
||||
sale_user_phone?: string
|
||||
sale_user_name?: string
|
||||
sale_user_id?: number|string
|
||||
company_id: number
|
||||
company_name: string
|
||||
first_change_name: boolean
|
||||
founder_user_id: string
|
||||
founder_user_name: string
|
||||
order_access_status: number
|
||||
order_access_status_name: string
|
||||
purchaser_type: number
|
||||
purchaser_type_name: string
|
||||
collection_quantity: number
|
||||
sale_user_phone: string
|
||||
sale_user_name: string
|
||||
sale_user_id: number|string
|
||||
}
|
||||
|
||||
export interface SortCodeParam {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user