diff --git a/iconfont.json b/iconfont.json index a0499e0..180f0e0 100644 --- a/iconfont.json +++ b/iconfont.json @@ -1,5 +1,5 @@ { - "symbol_url": "//at.alicdn.com/t/c/font_3786318_8mk04nkdxlg.js", + "symbol_url": "//at.alicdn.com/t/c/font_3786318_dbfm4mvm98c.js", "save_dir": "./src/components/iconfont", "use_typescript": false, "use_rpx": true, diff --git a/package.json b/package.json index 8c66942..bda52e5 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "prettier": "^2.8.0", "react-refresh": "0.14.0", "stylelint": "14.16.0", - "taro-iconfont-svg": "^1.0.19", + "taro-iconfont-svg": "^1.1.1", "typescript": "^4.9.3", "webpack": "^5.75.0" } diff --git a/src/common/constant.ts b/src/common/constant.ts index cc281c1..100e8f9 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -1,11 +1,11 @@ -// export const BASE_URL = CURRENT_BASE_URL +export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:40001/lymarket` // export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞 -// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境 -export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布 +// export const BASE_URL = 'https://test.zzfzyc.com/lymarket' // 测试环境 +// export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布 // export const BASE_URL = `http://192.168.1.9:40001/lymarket` // 发 // export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发 // export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发 diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx index 55cafca..1fa5feb 100644 --- a/src/components/Dialog/index.tsx +++ b/src/components/Dialog/index.tsx @@ -10,10 +10,12 @@ interface PropsType { onClose?: (show: boolean) => void onChange?: (isShow) => void children?: React.ReactNode + customClassName?: string + customStyles?: React.CSSProperties } // 弹出框 const Dialog = (props: PropsType) => { - const { showOverLay = true, show = false, onClose: _onClose, onChange: _onChange, children } = props + const { showOverLay = true, show = false, onClose: _onClose, onChange: _onChange, children, customClassName, customStyles } = props const [_show, setShow] = usePropsValue({ value: show, @@ -47,7 +49,7 @@ const Dialog = (props: PropsType) => { } }, [show]) return _show - ? + ? {/* 遮罩层 start */} = ({ name, - size = 18, + size = 36, color, customStyle = {}, customClassName = "" @@ -66,6 +66,8 @@ const IconFont:FC = ({ // 也可以使用 if (name === 'xxx') { return } 来渲染,但是测试发现在ios下会有问题,报错 Maximum call stack啥的。下面这个写法没问题 return ( + {/* icon-colorCard 本地svg */ } + {/* { name === 'icon-colorCard' && () } */} {/* icon-alipay */} {/* {name === "icon-alipay" && ( = ({ className={classnames(icon, customClassName)} /> )} */} - {/* icon-dianhua */} + {/* icon-tips */} - { name === 'icon-dianhua' && () } + { name === 'icon-tips' && () } +{/* icon-dianhua */} + + { name === 'icon-dianhua' && () } {/* icon-paixu */} - { name === 'icon-paixu' && () } + { name === 'icon-paixu' && () } {/* icon-shaixuan */} - { name === 'icon-shaixuan' && () } + { name === 'icon-shaixuan' && () } {/* icon-bodakehujingli */} - { name === 'icon-bodakehujingli' && () } + { name === 'icon-bodakehujingli' && () } {/* icon-guanfangweixinkefu */} - { name === 'icon-guanfangweixinkefu' && () } + { name === 'icon-guanfangweixinkefu' && () } {/* icon-tuijianbiaoqian */} - { name === 'icon-tuijianbiaoqian' && () } + { name === 'icon-tuijianbiaoqian' && () } {/* icon-rukou */} - { name === 'icon-rukou' && () } + { name === 'icon-rukou' && () } {/* icon-renzhengchenggong */} - { name === 'icon-renzhengchenggong' && () } + { name === 'icon-renzhengchenggong' && () } {/* icon-wodekefu */} - { name === 'icon-wodekefu' && () } + { name === 'icon-wodekefu' && () } {/* icon-yanseduibi */} - { name === 'icon-yanseduibi' && () } + { name === 'icon-yanseduibi' && () } {/* icon-dizhiguanli */} - { name === 'icon-dizhiguanli' && () } + { name === 'icon-dizhiguanli' && () } {/* icon-weixin */} - { name === 'icon-weixin' && () } + { name === 'icon-weixin' && () } {/* icon-riqi */} - { name === 'icon-riqi' && () } + { name === 'icon-riqi' && () } {/* icon-shuru */} - { name === 'icon-shuru' && () } + { name === 'icon-shuru' && () } {/* icon-a-0tianzhangqi */} - { name === 'icon-a-0tianzhangqi' && () } + { name === 'icon-a-0tianzhangqi' && () } {/* icon-huodaofukuan */} - { name === 'icon-huodaofukuan' && () } + { name === 'icon-huodaofukuan' && () } {/* icon-huozhuziti */} - { name === 'icon-huozhuziti' && () } + { name === 'icon-huozhuziti' && () } {/* icon-saomazhifu */} - { name === 'icon-saomazhifu' && () } + { name === 'icon-saomazhifu' && () } {/* icon-xianxiahuikuan */} - { name === 'icon-xianxiahuikuan' && () } + { name === 'icon-xianxiahuikuan' && () } {/* icon-yufukuan */} - { name === 'icon-yufukuan' && () } + { name === 'icon-yufukuan' && () } {/* icon-xinzengshoucangjia */} - { name === 'icon-xinzengshoucangjia' && () } + { name === 'icon-xinzengshoucangjia' && () } {/* icon-qingchusousuo */} - { name === 'icon-qingchusousuo' && () } + { name === 'icon-qingchusousuo' && () } {/* icon-xuanzechenggong */} - { name === 'icon-xuanzechenggong' && () } + { name === 'icon-xuanzechenggong' && () } {/* icon-gongnengtubiao-saomiao */} - { name === 'icon-gongnengtubiao-saomiao' && () } + { name === 'icon-gongnengtubiao-saomiao' && () } {/* icon-bianjizidingyimadan */} - { name === 'icon-bianjizidingyimadan' && () } + { name === 'icon-bianjizidingyimadan' && () } {/* icon-zidingyimadanyulan */} - { name === 'icon-zidingyimadanyulan' && () } + { name === 'icon-zidingyimadanyulan' && () } {/* icon-yuanshimadanyulan */} - { name === 'icon-yuanshimadanyulan' && () } + { name === 'icon-yuanshimadanyulan' && () } {/* icon-xiala */} - { name === 'icon-xiala' && () } + { name === 'icon-xiala' && () } {/* icon-shangla */} - { name === 'icon-shangla' && () } + { name === 'icon-shangla' && () } {/* icon-qingchuxinxi */} - { name === 'icon-qingchuxinxi' && () } + { name === 'icon-qingchuxinxi' && () } {/* icon-sousuo */} - { name === 'icon-sousuo' && () } + { name === 'icon-sousuo' && () } {/* icon-guanli */} - { name === 'icon-guanli' && () } + { name === 'icon-guanli' && () } {/* icon-bianji */} - { name === 'icon-bianji' && () } + { name === 'icon-bianji' && () } {/* icon-shoucangjia */} - { name === 'icon-shoucangjia' && () } + { name === 'icon-shoucangjia' && () } {/* icon-shezhi */} - { name === 'icon-shezhi' && () } + { name === 'icon-shezhi' && () } {/* icon-tishi */} - { name === 'icon-tishi' && () } + { name === 'icon-tishi' && () } {/* icon-erweima */} - { name === 'icon-erweima' && () } + { name === 'icon-erweima' && () } {/* icon-dianjishoucang */} - { name === 'icon-dianjishoucang' && () } + { name === 'icon-dianjishoucang' && () } {/* icon-gouwuche */} - { name === 'icon-gouwuche' && () } + { name === 'icon-gouwuche' && () } {/* icon-shoucangchenggong */} - { name === 'icon-shoucangchenggong' && () } + { name === 'icon-shoucangchenggong' && () } {/* icon-fenxiangshangpin */} - { name === 'icon-fenxiangshangpin' && () } + { name === 'icon-fenxiangshangpin' && () } {/* icon-kefu */} - { name === 'icon-kefu' && () } + { name === 'icon-kefu' && () } {/* icon-xinzenganniu */} - { name === 'icon-xinzenganniu' && () } + { name === 'icon-xinzenganniu' && () } {/* icon-jianshaoanniu */} - { name === 'icon-jianshaoanniu' && () } + { name === 'icon-jianshaoanniu' && () } {/* icon-daifahuo2 */} - { name === 'icon-daifahuo2' && () } + { name === 'icon-daifahuo2' && () } {/* icon-daishouhuo2 */} - { name === 'icon-daishouhuo2' && () } + { name === 'icon-daishouhuo2' && () } {/* icon-tuikuan-shouhou */} - { name === 'icon-tuikuan-shouhou' && () } + { name === 'icon-tuikuan-shouhou' && () } {/* icon-daipeibu2 */} - { name === 'icon-daipeibu2' && () } + { name === 'icon-daipeibu2' && () } {/* icon-daifukuan2 */} - { name === 'icon-daifukuan2' && () } + { name === 'icon-daifukuan2' && () } ) diff --git a/src/components/normalButton/index.module.scss b/src/components/normalButton/index.module.scss index a13e4e7..7903deb 100644 --- a/src/components/normalButton/index.module.scss +++ b/src/components/normalButton/index.module.scss @@ -10,7 +10,9 @@ text-align: center; color: #fff; box-sizing: border-box; - + &:active { + opacity: $opacity-active; + } &--normal { height: 72px; font-size: $font_size_medium; @@ -85,20 +87,20 @@ } } // active 伪类 - &--primary:active { - background-color: rgba($color: $color_main, $alpha: 0.5); - color: #fff; - } - &--danger:active { - background-color: rgba($color: $color_danger, $alpha: 0.5); - color: #fff; - } - &--warning:active { - background-color: rgba($color: $color_warning, $alpha: 0.5); - color: #fff; - } - &--info:active { - background-color: rgba($color: $color_info, $alpha: 0.5); - color: #fff; - } + // &--primary:active { + // background-color: rgba($color: $color_main, $alpha: 0.5); + // color: #fff; + // } + // &--danger:active { + // background-color: rgba($color: $color_danger, $alpha: 0.5); + // color: #fff; + // } + // &--warning:active { + // opacity: $opacity-active; + // } + // &--info:active { + // // background-color: rgba($color: $color_info, $alpha: 0.5); + // opacity: $opacity-active; + // // color: #fff; + // } } diff --git a/src/components/normalButton/index.tsx b/src/components/normalButton/index.tsx index df2bec4..2b26b54 100644 --- a/src/components/normalButton/index.tsx +++ b/src/components/normalButton/index.tsx @@ -12,7 +12,7 @@ interface PropsType { type?: ButtonType round?: boolean // 大圆角 disabled?: boolean - plain?: boolean // plain + plain?: boolean // 朴素(背景色为白色那种,不是全背景色) circle?: boolean // 小圆角 children?: ReactNode onClick?: Function @@ -20,10 +20,12 @@ interface PropsType { customStyles?: React.CSSProperties customTextClassName?: string loading?: boolean + hoverClass?: string } const NormalButton: FC = (props) => { const { + hoverClass = '', type = 'primary', size = 'normal', round = false, @@ -57,7 +59,7 @@ const NormalButton: FC = (props) => { } return ( - + {loading && } {children} diff --git a/src/components/organizationNameModal/index.module.scss b/src/components/organizationNameModal/index.module.scss new file mode 100644 index 0000000..d8e8fb8 --- /dev/null +++ b/src/components/organizationNameModal/index.module.scss @@ -0,0 +1,77 @@ +.organizationNameModal { + width: 75vw; + background-color: #fff; + border-radius: 20px; + padding-top: 20px; + overflow: hidden; + .inputBar { + border: 1px solid transparent; + background-color: #f5f5f5; + border-radius: 20px; + padding: 20px 42px; + margin: 32px 40px; + margin-bottom: 0; + font-size: 26px; + color: #333; + &_focus { + border: 1px solid #337fff; + } + &_error { + border: 1px solid #f64861; + color: #f64861; + } + } + + &_title { + padding: 10px; + text-align: center; + } + &_content { + margin-bottom: 20px; + display: flex; + flex-flow: column nowrap; + justify-content: center; + } + &_bottomBar { + display: flex; + flex-flow: row nowrap; + align-items: center; + justify-content: space-between; + border-top: 1px solid #eee; + margin-top: 30px; + .button { + display: flex; + align-items: center; + justify-content: center; + text-align: center; + box-sizing: border-box; + width: 50%; + height: 100%; + font-size: 32px; + font-weight: 550; + padding: 30px 0; + border: 0; + background-color: #fff; + } + &_left { + border-right: 1px solid #eee; + color: #333; + } + &_right { + color: #337fff; + } + } + .tips { + display: flex; + background-color: #fef9f4; + font-size: 24px; + color: #ff9b33; + line-height: 1.5; + padding: 20px; + } +} +.error_tips { + color: #f64861; + padding: 10px 42px; + font-size: 20px; +} diff --git a/src/components/organizationNameModal/index.tsx b/src/components/organizationNameModal/index.tsx new file mode 100644 index 0000000..fe0319d --- /dev/null +++ b/src/components/organizationNameModal/index.tsx @@ -0,0 +1,99 @@ +import type { CommonEventFunction, InputProps } from '@tarojs/components' +import { Input, Text, View } from '@tarojs/components' +import React, { useMemo, useState } from 'react' +import classNames from 'classnames' +import Dialog from '../Dialog' +import IconFont from '../iconfont/iconfont' +import NormalButton from '../normalButton' +import styles from './index.module.scss' + +interface PropsType { + showModal: boolean + onClose?: () => void + onShowModalChange?: (val: boolean) => void + onCancel?: () => void + onConfirm?: (val: string) => void +} +const OrganizationNameModal = (props: PropsType) => { + const { + showModal = false, + onClose, + onShowModalChange, + onCancel, + onConfirm, + } = props + + const handleClose = () => { + onClose?.() + } + + const [text, setText] = useState('') + + const handleCancel = () => { + onCancel?.() + handleClose() + } + const handleConfirm = () => { + onConfirm?.(text) + } + const [inputStyles, setInputStyles] = useState([]) + const [tipsComp, setTipsComp] = useState(null) + + const isInvalidate = useMemo(() => { + let flag = false + const Reg = /^[a-zA-Z0-9\u4E00-\u9FA5]+$/ + console.log('text', text) + setTipsComp(null) + setInputStyles(() => [styles.inputBar_focus]) + if (!text) { + flag = true + } + if (text && !Reg.test(text)) { + flag = true + setInputStyles(() => [styles.inputBar_error]) + setTipsComp(() => { + return + 只允许输入数字、英文、中文;不允许输入任何其他符号 + + }) + } + return flag + }, [text]) + + const handleIntput: CommonEventFunction = (e) => { + setText(e.detail.value) + } + const handleFocus = () => { + if (isInvalidate) { + setInputStyles(() => [styles.inputBar_error]) + return + } + setInputStyles(() => [styles.inputBar_focus]) + } + const handleBlur = () => { + if (isInvalidate) { + setInputStyles(() => [styles.inputBar_error]) + return + } + setInputStyles(() => []) + } + + return + + 请设置您的组织昵称 + + + + 公司名称是辨识您身份的重要依据,请谨慎修改。(仅支持修改一次) + + + {tipsComp} + + + 下次更改 + 确认 + + + +} +export default OrganizationNameModal diff --git a/src/components/shopCart/index.tsx b/src/components/shopCart/index.tsx index f187256..0a7cd1d 100644 --- a/src/components/shopCart/index.tsx +++ b/src/components/shopCart/index.tsx @@ -7,6 +7,7 @@ import type { SalesManDialogRef } from '../bindSalesManDialog' import BindSalesManDialog from '../bindSalesManDialog' import LabAndImgShow from '../LabAndImgShow' import LabAndImg from '../LabAndImg' +import OrganizationNameModal from '../organizationNameModal' import styles from './index.module.scss' import ProductItem from './components/productItem' import Popup from '@/components/popup' @@ -258,6 +259,15 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod } }, [list]) + const [showModal, setShowModal] = useState(false) + + const handleClose = () => { + setShowModal(false) + } + const handleShowChange = (val: boolean) => { + setShowModal(val) + } + // 去结算 const { fetchData: FetchData } = GetAdminUserInfoApi() const { fetchData: applyOrderAccessFetchData } = ApplyOrderAccessApi() @@ -268,7 +278,12 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod bindSalesManDialogRef.current?.handleChange(true) // setShowBindSalesman(() => true) onClose?.() - return false + return + } + // TODO 检测是否修改过组织昵称 + if (false) { + setShowModal(true) + return } getSelectId() if (selectIds.current.length == 0) { @@ -308,6 +323,7 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod setSelectStatus(true) }) }, [selectIndex]) + return ( closePopup()}> @@ -378,6 +394,7 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod + ) } diff --git a/src/pages/userEdit/components/ModifyModal.scss b/src/pages/userEdit/components/ModifyModal.scss deleted file mode 100644 index 1baab4b..0000000 --- a/src/pages/userEdit/components/ModifyModal.scss +++ /dev/null @@ -1,76 +0,0 @@ -.modify-ickname-content { - margin: 0 auto; - width: 658px; - padding-bottom: 50px; - - .modify-ickname-input { - width: 658px; - height: 182px; - background: #f3f3f3; - border: 2px solid #e6e6e6; - border-radius: 10px; - padding: 15px; - box-sizing: border-box; - font-size: 22px; - font-weight: 400; - color: #ababab; - display: flex; - flex-direction: column; - align-items: flex-end; - } - - .modify-ickname-input textarea { - width: 100%; - height: 80%; - font-size: 26px; - font-weight: 400; - color: #3c3c3c; - } - - .modify-ickname-tips { - font-size: 22px; - font-weight: 400; - color: #ababab; - margin-top: 30px; - } - - .modify-ickname-operation { - width: 658px; - height: 82px; - background: #ffffff; - border: 2px solid #cde5ff; - border-radius: 40px; - display: flex; - overflow: hidden; - margin-top: 105px; - display: flex; - } - - .modify-ickname-operation button { - height: 100%; - width: 50%; - font-size: 32px; - font-weight: 400; - color: $color_main; - background-color: white; - border: none; - outline: none; - padding: 0; - border-radius: 0; - } - - .modify-ickname-operation button::after, - .user-edit-logout::after { - border-radius: 0; - border: none; - } - - .modify-ickname-operation .modify-ickname-operation-save { - background: $color_main; - color: #ffffff; - } - - .modify-ickname-operation button::after { - border-radius: 0; - } -} diff --git a/src/pages/userEdit/components/ModifyModal.tsx b/src/pages/userEdit/components/ModifyModal.tsx deleted file mode 100644 index 540ca1c..0000000 --- a/src/pages/userEdit/components/ModifyModal.tsx +++ /dev/null @@ -1,49 +0,0 @@ - -import { Button, Image, Text, Textarea, View } from '@tarojs/components' -import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useState } from 'react' -import Popup from '@/components/popup' -import './ModifyModal.scss' - -interface Params{ - title?: string - save: (value: any) => void // 确定保存 -} -export default memo(forwardRef((props: any, ref) => { - const { title = '修改昵称' } = props - const [value, setValue] = useState('') - useEffect(() => { - setValue(props.value) - }, [props.value]) - // popup输入长度 - const handleTextareaInput = (ev: any) => { - setValue(ev.detail.value.slice(0, 20)) - } - // 重置 - const handleTextareaReset = () => { - setValue('') - } - const [textareaBottom, setTextareaBottom] = useState(0) - const handleBlur = () => { - setTextareaBottom(0) - } - const handleFocus = (ev) => { - setTextareaBottom(ev.detail.height) - } - const [modalShow, setModalShow] = useState(false) - useImperativeHandle(ref, () => ({ setModalShow })) - return ( - setModalShow(false)} title={title} show={modalShow}> - - -